Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

feat(core): Add Support for Payments Dynamic Tax Calculation Based on Shipping Address (#5619)

Swangi Kumaria03ad53e437e
diff --git a/api-reference-v2/openapi_spec.json b/api-reference-v2/openapi_spec.json
index 3ba7097d3a..6b9ba4afd0 100644
--- a/api-reference-v2/openapi_spec.json
+++ b/api-reference-v2/openapi_spec.json
@@ -4508,6 +4508,7 @@
"square",
"stax",
"stripe",
+ "taxjar",
"threedsecureio",
"trustpay",
"tsys",
@@ -4622,7 +4623,8 @@
"non_banking_finance",
"payout_processor",
"payment_method_auth",
- "authentication_processor"
+ "authentication_processor",
+ "tax_processor"
]
},
"ConnectorVolumeSplit": {
@@ -9341,6 +9343,11 @@
}
],
"nullable": true
+ },
+ "product_tax_code": {
+ "type": "string",
+ "description": "The tax code for the product",
+ "nullable": true
}
}
},
@@ -9406,6 +9413,11 @@
}
],
"nullable": true
+ },
+ "product_tax_code": {
+ "type": "string",
+ "description": "The tax code for the product",
+ "nullable": true
}
}
},
@@ -11585,6 +11597,13 @@
"example": 6540,
"nullable": true
},
+ "shipping_cost": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The shipping cost for the payment. This is required for tax calculation in some regions.",
+ "example": 6540,
+ "nullable": true
+ },
"payment_id": {
"type": "string",
"description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant. The value for this field can be specified in the request, it will be auto generated otherwise and returned in the API response.",
@@ -11930,6 +11949,13 @@
"example": 6540,
"nullable": true
},
+ "shipping_cost": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The shipping cost for the payment. This is required for tax calculation in some regions.",
+ "example": 6540,
+ "nullable": true
+ },
"payment_id": {
"type": "string",
"description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant. The value for this field can be specified in the request, it will be auto generated otherwise and returned in the API response.",
@@ -12903,6 +12929,13 @@
"example": 6540,
"nullable": true
},
+ "shipping_cost": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The shipping cost for the payment. This is required for tax calculation in some regions.",
+ "example": 6540,
+ "nullable": true
+ },
"payment_id": {
"type": "string",
"description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant. The value for this field can be specified in the request, it will be auto generated otherwise and returned in the API response.",
@@ -14001,6 +14034,13 @@
"example": 6540,
"nullable": true
},
+ "shipping_cost": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The shipping cost for the payment. This is required for tax calculation in some regions.",
+ "example": 6540,
+ "nullable": true
+ },
"payment_id": {
"type": "string",
"description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant. The value for this field can be specified in the request, it will be auto generated otherwise and returned in the API response.",
diff --git a/api-reference/openapi_spec.json b/api-reference/openapi_spec.json
index 24bb66598e..2a758cc06d 100644
--- a/api-reference/openapi_spec.json
+++ b/api-reference/openapi_spec.json
@@ -8155,6 +8155,7 @@
"square",
"stax",
"stripe",
+ "taxjar",
"threedsecureio",
"trustpay",
"tsys",
@@ -8269,7 +8270,8 @@
"non_banking_finance",
"payout_processor",
"payment_method_auth",
- "authentication_processor"
+ "authentication_processor",
+ "tax_processor"
]
},
"ConnectorVolumeSplit": {
@@ -13346,6 +13348,11 @@
}
],
"nullable": true
+ },
+ "product_tax_code": {
+ "type": "string",
+ "description": "The tax code for the product",
+ "nullable": true
}
}
},
@@ -13411,6 +13418,11 @@
}
],
"nullable": true
+ },
+ "product_tax_code": {
+ "type": "string",
+ "description": "The tax code for the product",
+ "nullable": true
}
}
},
@@ -15583,6 +15595,13 @@
"example": 6540,
"nullable": true
},
+ "shipping_cost": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The shipping cost for the payment. This is required for tax calculation in some regions.",
+ "example": 6540,
+ "nullable": true
+ },
"payment_id": {
"type": "string",
"description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant. The value for this field can be specified in the request, it will be auto generated otherwise and returned in the API response.",
@@ -15928,6 +15947,13 @@
"example": 6540,
"nullable": true
},
+ "shipping_cost": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The shipping cost for the payment. This is required for tax calculation in some regions.",
+ "example": 6540,
+ "nullable": true
+ },
"payment_id": {
"type": "string",
"description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant. The value for this field can be specified in the request, it will be auto generated otherwise and returned in the API response.",
@@ -16782,6 +16808,26 @@
}
}
},
+ "PaymentsDynamicTaxCalculationRequest": {
+ "type": "object",
+ "required": [
+ "shipping",
+ "client_secret",
+ "payment_method_type"
+ ],
+ "properties": {
+ "shipping": {
+ "$ref": "#/components/schemas/Address"
+ },
+ "client_secret": {
+ "type": "string",
+ "description": "Client Secret"
+ },
+ "payment_method_type": {
+ "$ref": "#/components/schemas/PaymentMethodType"
+ }
+ }
+ },
"PaymentsExternalAuthenticationRequest": {
"type": "object",
"required": [
@@ -16901,6 +16947,13 @@
"example": 6540,
"nullable": true
},
+ "shipping_cost": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The shipping cost for the payment. This is required for tax calculation in some regions.",
+ "example": 6540,
+ "nullable": true
+ },
"payment_id": {
"type": "string",
"description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant. The value for this field can be specified in the request, it will be auto generated otherwise and returned in the API response.",
@@ -17999,6 +18052,13 @@
"example": 6540,
"nullable": true
},
+ "shipping_cost": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The shipping cost for the payment. This is required for tax calculation in some regions.",
+ "example": 6540,
+ "nullable": true
+ },
"payment_id": {
"type": "string",
"description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant. The value for this field can be specified in the request, it will be auto generated otherwise and returned in the API response.",
diff --git a/crates/api_models/src/admin.rs b/crates/api_models/src/admin.rs
index aef5f106be..0b77fd15a3 100644
--- a/crates/api_models/src/admin.rs
+++ b/crates/api_models/src/admin.rs
@@ -1911,7 +1911,8 @@ pub struct BusinessProfileCreate {
pub outgoing_webhook_custom_http_headers: Option<HashMap<String, String>>,
/// Merchant Connector id to be stored for tax_calculator connector
- pub tax_connector_id: Option<String>,
+ #[schema(value_type = Option<String>)]
+ pub tax_connector_id: Option<id_type::MerchantConnectorAccountId>,
/// Indicates if tax_calculator connector is enabled or not.
/// If set to `true` tax_connector_id will be checked.
@@ -2014,7 +2015,8 @@ pub struct BusinessProfileCreate {
pub outgoing_webhook_custom_http_headers: Option<HashMap<String, String>>,
/// Merchant Connector id to be stored for tax_calculator connector
- pub tax_connector_id: Option<String>,
+ #[schema(value_type = Option<String>)]
+ pub tax_connector_id: Option<id_type::MerchantConnectorAccountId>,
/// Indicates if tax_calculator connector is enabled or not.
/// If set to `true` tax_connector_id will be checked.
@@ -2131,7 +2133,8 @@ pub struct BusinessProfileResponse {
pub outgoing_webhook_custom_http_headers: Option<HashMap<String, Secret<String>>>,
/// Merchant Connector id to be stored for tax_calculator connector
- pub tax_connector_id: Option<String>,
+ #[schema(value_type = Option<String>)]
+ pub tax_connector_id: Option<id_type::MerchantConnectorAccountId>,
/// Indicates if tax_calculator connector is enabled or not.
/// If set to `true` tax_connector_id will be checked.
@@ -2238,7 +2241,8 @@ pub struct BusinessProfileResponse {
pub order_fulfillment_time_origin: Option<api_enums::OrderFulfillmentTimeOrigin>,
/// Merchant Connector id to be stored for tax_calculator connector
- pub tax_connector_id: Option<String>,
+ #[schema(value_type = Option<String>)]
+ pub tax_connector_id: Option<id_type::MerchantConnectorAccountId>,
/// Indicates if tax_calculator connector is enabled or not.
/// If set to `true` tax_connector_id will be checked.
@@ -2346,7 +2350,8 @@ pub struct BusinessProfileUpdate {
pub outgoing_webhook_custom_http_headers: Option<HashMap<String, String>>,
/// Merchant Connector id to be stored for tax_calculator connector
- pub tax_connector_id: Option<String>,
+ #[schema(value_type = Option<String>)]
+ pub tax_connector_id: Option<id_type::MerchantConnectorAccountId>,
/// Indicates if tax_calculator connector is enabled or not.
/// If set to `true` tax_connector_id will be checked.
@@ -2445,7 +2450,8 @@ pub struct BusinessProfileUpdate {
pub outgoing_webhook_custom_http_headers: Option<HashMap<String, String>>,
/// Merchant Connector id to be stored for tax_calculator connector
- pub tax_connector_id: Option<String>,
+ #[schema(value_type = Option<String>)]
+ pub tax_connector_id: Option<id_type::MerchantConnectorAccountId>,
/// Indicates if tax_calculator connector is enabled or not.
/// If set to `true` tax_connector_id will be checked.
diff --git a/crates/api_models/src/enums.rs b/crates/api_models/src/enums.rs
index 34a0445887..5db816305b 100644
--- a/crates/api_models/src/enums.rs
+++ b/crates/api_models/src/enums.rs
@@ -135,7 +135,7 @@ pub enum Connector {
Square,
Stax,
Stripe,
- // Taxjar,
+ Taxjar,
Threedsecureio,
Trustpay,
Tsys,
@@ -215,7 +215,7 @@ impl Connector {
// Add Separate authentication support for connectors
// | Self::Novalnet
// | Self::Nexixpay
- // | Self::Taxjar
+ // | Self::Fiuu
| Self::Adyen
| Self::Adyenplatform
| Self::Airwallex
@@ -264,6 +264,7 @@ impl Connector {
| Self::Shift4
| Self::Square
| Self::Stax
+ | Self::Taxjar
| Self::Trustpay
| Self::Tsys
| Self::Volt
@@ -415,6 +416,26 @@ pub enum FrmConnectors {
Riskified,
}
+#[derive(
+ Clone,
+ Copy,
+ Debug,
+ Eq,
+ Hash,
+ PartialEq,
+ serde::Serialize,
+ serde::Deserialize,
+ strum::Display,
+ strum::EnumString,
+ ToSchema,
+)]
+#[serde(rename_all = "snake_case")]
+#[strum(serialize_all = "snake_case")]
+
+pub enum TaxConnectors {
+ Taxjar,
+}
+
#[derive(
Clone, Debug, serde::Deserialize, serde::Serialize, strum::Display, strum::EnumString, ToSchema,
)]
@@ -656,6 +677,10 @@ pub fn convert_authentication_connector(connector_name: &str) -> Option<Authenti
AuthenticationConnectors::from_str(connector_name).ok()
}
+pub fn convert_tax_connector(connector_name: &str) -> Option<TaxConnectors> {
+ TaxConnectors::from_str(connector_name).ok()
+}
+
#[derive(
Clone,
Debug,
diff --git a/crates/api_models/src/events/payment.rs b/crates/api_models/src/events/payment.rs
index ba137cd3ba..aa8cd43ca9 100644
--- a/crates/api_models/src/events/payment.rs
+++ b/crates/api_models/src/events/payment.rs
@@ -20,7 +20,8 @@ use crate::{
PaymentListFilterConstraints, PaymentListFilters, PaymentListFiltersV2,
PaymentListResponse, PaymentListResponseV2, PaymentsAggregateResponse,
PaymentsApproveRequest, PaymentsCancelRequest, PaymentsCaptureRequest,
- PaymentsCompleteAuthorizeRequest, PaymentsExternalAuthenticationRequest,
+ PaymentsCompleteAuthorizeRequest, PaymentsDynamicTaxCalculationRequest,
+ PaymentsDynamicTaxCalculationResponse, PaymentsExternalAuthenticationRequest,
PaymentsExternalAuthenticationResponse, PaymentsIncrementalAuthorizationRequest,
PaymentsManualUpdateRequest, PaymentsManualUpdateResponse, PaymentsRejectRequest,
PaymentsRequest, PaymentsResponse, PaymentsRetrieveRequest, PaymentsSessionResponse,
@@ -62,6 +63,16 @@ impl ApiEventMetric for PaymentsCompleteAuthorizeRequest {
}
}
+impl ApiEventMetric for PaymentsDynamicTaxCalculationRequest {
+ fn get_api_event_type(&self) -> Option<ApiEventsType> {
+ Some(ApiEventsType::Payment {
+ payment_id: self.payment_id.clone(),
+ })
+ }
+}
+
+impl ApiEventMetric for PaymentsDynamicTaxCalculationResponse {}
+
impl ApiEventMetric for PaymentsCancelRequest {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Payment {
diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs
index 22084f1d9f..d512d487e5 100644
--- a/crates/api_models/src/payments.rs
+++ b/crates/api_models/src/payments.rs
@@ -294,6 +294,10 @@ pub struct PaymentsRequest {
#[schema(value_type = Option<i64>, example = 6540)]
pub amount_to_capture: Option<MinorUnit>,
+ /// The shipping cost for the payment. This is required for tax calculation in some regions.
+ #[schema(value_type = Option<i64>, example = 6540)]
+ pub shipping_cost: Option<MinorUnit>,
+
/// Unique identifier for the payment. This ensures idempotency for multiple payments
/// that have been done by a single merchant. The value for this field can be specified in the request, it will be auto generated otherwise and returned in the API response.
#[schema(
@@ -4391,6 +4395,8 @@ pub struct OrderDetailsWithAmount {
pub brand: Option<String>,
/// Type of the product that is being purchased
pub product_type: Option<ProductType>,
+ /// The tax code for the product
+ pub product_tax_code: Option<String>,
}
#[derive(Debug, Default, Eq, PartialEq, serde::Deserialize, serde::Serialize, Clone, ToSchema)]
@@ -4427,6 +4433,8 @@ pub struct OrderDetails {
pub brand: Option<String>,
/// Type of the product that is being purchased
pub product_type: Option<ProductType>,
+ /// The tax code for the product
+ pub product_tax_code: Option<String>,
}
#[derive(Default, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, Clone, ToSchema)]
@@ -4452,6 +4460,28 @@ pub struct PaymentsSessionRequest {
pub merchant_connector_details: Option<admin::MerchantConnectorDetailsWrap>,
}
+#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, ToSchema)]
+pub struct PaymentsDynamicTaxCalculationRequest {
+ /// The unique identifier for the payment
+ #[serde(skip_deserializing)]
+ #[schema(value_type = String)]
+ pub payment_id: id_type::PaymentId,
+ /// The shipping address for the payment
+ pub shipping: Address,
+ /// Client Secret
+ #[schema(value_type = String)]
+ pub client_secret: Secret<String>,
+ /// Payment method type
+ #[schema(value_type = PaymentMethodType)]
+ pub payment_method_type: api_enums::PaymentMethodType,
+}
+
+#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, ToSchema)]
+pub struct PaymentsDynamicTaxCalculationResponse {
+ /// net amount
+ pub net_amount: MinorUnit,
+}
+
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
pub struct GpayAllowedMethodsParameters {
/// The list of allowed auth methods (ex: 3DS, No3DS, PAN_ONLY etc)
diff --git a/crates/common_enums/src/enums.rs b/crates/common_enums/src/enums.rs
index 56d86d34bc..db32cd2285 100644
--- a/crates/common_enums/src/enums.rs
+++ b/crates/common_enums/src/enums.rs
@@ -402,6 +402,26 @@ pub enum AuthorizationStatus {
Unresolved,
}
+// #[derive(
+// Clone,
+// Debug,
+// Eq,
+// PartialEq,
+// serde::Deserialize,
+// serde::Serialize,
+// strum::Display,
+// strum::EnumString,
+// ToSchema,
+// Hash,
+// )]
+// #[router_derive::diesel_enum(storage_type = "text")]
+// #[serde(rename_all = "snake_case")]
+// #[strum(serialize_all = "snake_case")]
+// pub enum SessionUpdateStatus {
+// Success,
+// Failure,
+// }
+
#[derive(
Clone,
Debug,
@@ -492,6 +512,8 @@ pub enum ConnectorType {
PaymentMethodAuth,
/// 3DS Authentication Service Providers
AuthenticationProcessor,
+ /// Tax Calculation Processor
+ TaxProcessor,
}
#[derive(Debug, Eq, PartialEq)]
diff --git a/crates/connector_configs/src/connector.rs b/crates/connector_configs/src/connector.rs
index cb13ec9d86..cc1f881835 100644
--- a/crates/connector_configs/src/connector.rs
+++ b/crates/connector_configs/src/connector.rs
@@ -226,6 +226,7 @@ pub struct ConnectorConfig {
pub paypal_test: Option<ConnectorTomlConfig>,
pub zen: Option<ConnectorTomlConfig>,
pub zsl: Option<ConnectorTomlConfig>,
+ pub taxjar: Option<ConnectorTomlConfig>,
}
impl ConnectorConfig {
@@ -357,6 +358,7 @@ impl ConnectorConfig {
Connector::Stripe => Ok(connector_data.stripe),
Connector::Trustpay => Ok(connector_data.trustpay),
Connector::Threedsecureio => Ok(connector_data.threedsecureio),
+ Connector::Taxjar => Ok(connector_data.taxjar),
Connector::Tsys => Ok(connector_data.tsys),
Connector::Volt => Ok(connector_data.volt),
Connector::Wellsfargo => Ok(connector_data.wellsfargo),
diff --git a/crates/diesel_models/src/business_profile.rs b/crates/diesel_models/src/business_profile.rs
index 7883e3b29b..549ad47609 100644
--- a/crates/diesel_models/src/business_profile.rs
+++ b/crates/diesel_models/src/business_profile.rs
@@ -50,7 +50,7 @@ pub struct BusinessProfile {
pub outgoing_webhook_custom_http_headers: Option<Encryption>,
pub always_collect_billing_details_from_wallet_connector: Option<bool>,
pub always_collect_shipping_details_from_wallet_connector: Option<bool>,
- pub tax_connector_id: Option<String>,
+ pub tax_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
pub is_tax_connector_enabled: Option<bool>,
pub version: common_enums::ApiVersion,
}
@@ -90,7 +90,7 @@ pub struct BusinessProfileNew {
pub outgoing_webhook_custom_http_headers: Option<Encryption>,
pub always_collect_billing_details_from_wallet_connector: Option<bool>,
pub always_collect_shipping_details_from_wallet_connector: Option<bool>,
- pub tax_connector_id: Option<String>,
+ pub tax_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
pub is_tax_connector_enabled: Option<bool>,
pub version: common_enums::ApiVersion,
}
@@ -127,7 +127,7 @@ pub struct BusinessProfileUpdateInternal {
pub outgoing_webhook_custom_http_headers: Option<Encryption>,
pub always_collect_billing_details_from_wallet_connector: Option<bool>,
pub always_collect_shipping_details_from_wallet_connector: Option<bool>,
- pub tax_connector_id: Option<String>,
+ pub tax_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
pub is_tax_connector_enabled: Option<bool>,
}
@@ -256,7 +256,7 @@ pub struct BusinessProfile {
pub outgoing_webhook_custom_http_headers: Option<Encryption>,
pub always_collect_billing_details_from_wallet_connector: Option<bool>,
pub always_collect_shipping_details_from_wallet_connector: Option<bool>,
- pub tax_connector_id: Option<String>,
+ pub tax_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
pub is_tax_connector_enabled: Option<bool>,
pub routing_algorithm_id: Option<common_utils::id_type::RoutingId>,
pub order_fulfillment_time: Option<i64>,
@@ -310,7 +310,7 @@ pub struct BusinessProfileNew {
pub outgoing_webhook_custom_http_headers: Option<Encryption>,
pub always_collect_billing_details_from_wallet_connector: Option<bool>,
pub always_collect_shipping_details_from_wallet_connector: Option<bool>,
- pub tax_connector_id: Option<String>,
+ pub tax_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
pub is_tax_connector_enabled: Option<bool>,
pub routing_algorithm_id: Option<common_utils::id_type::RoutingId>,
pub order_fulfillment_time: Option<i64>,
@@ -350,7 +350,7 @@ pub struct BusinessProfileUpdateInternal {
pub outgoing_webhook_custom_http_headers: Option<Encryption>,
pub always_collect_billing_details_from_wallet_connector: Option<bool>,
pub always_collect_shipping_details_from_wallet_connector: Option<bool>,
- pub tax_connector_id: Option<String>,
+ pub tax_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
pub is_tax_connector_enabled: Option<bool>,
pub routing_algorithm_id: Option<common_utils::id_type::RoutingId>,
pub order_fulfillment_time: Option<i64>,
diff --git a/crates/diesel_models/src/payment_intent.rs b/crates/diesel_models/src/payment_intent.rs
index 179769f9c3..c80e9e5f4d 100644
--- a/crates/diesel_models/src/payment_intent.rs
+++ b/crates/diesel_models/src/payment_intent.rs
@@ -1,4 +1,4 @@
-use common_enums::RequestIncrementalAuthorization;
+use common_enums::{PaymentMethodType, RequestIncrementalAuthorization};
use common_utils::{encryption::Encryption, pii, types::MinorUnit};
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
use serde::{Deserialize, Serialize};
@@ -69,7 +69,9 @@ pub struct PaymentIntent {
pub merchant_order_reference_id: Option<String>,
pub shipping_details: Option<Encryption>,
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>,
}
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "payment_v2")))]
@@ -131,7 +133,29 @@ pub struct PaymentIntent {
pub merchant_order_reference_id: Option<String>,
pub shipping_details: Option<Encryption>,
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>,
+}
+
+#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, diesel::AsExpression)]
+#[diesel(sql_type = diesel::sql_types::Jsonb)]
+pub struct TaxDetails {
+ pub default: Option<DefaultTax>,
+ pub payment_method_type: Option<PaymentMethodTypeTax>,
+}
+
+common_utils::impl_to_sql_from_sql_json!(TaxDetails);
+
+#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
+pub struct PaymentMethodTypeTax {
+ pub order_tax_amount: MinorUnit,
+ pub pmt: PaymentMethodType,
+}
+
+#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
+pub struct DefaultTax {
+ pub order_tax_amount: MinorUnit,
}
#[derive(
@@ -192,7 +216,9 @@ pub struct PaymentIntentNew {
pub merchant_order_reference_id: Option<String>,
pub shipping_details: Option<Encryption>,
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>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -268,6 +294,12 @@ pub enum PaymentIntentUpdate {
status: Option<storage_enums::IntentStatus>,
updated_by: String,
},
+ SessionResponseUpdate {
+ tax_details: TaxDetails,
+ shipping_address_id: Option<String>,
+ updated_by: String,
+ shipping_details: Option<Encryption>,
+ },
}
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -298,6 +330,7 @@ pub struct PaymentIntentUpdateFields {
pub merchant_order_reference_id: Option<String>,
pub shipping_details: Option<Encryption>,
pub is_payment_processor_token_flow: Option<bool>,
+ pub tax_details: Option<TaxDetails>,
}
#[derive(Clone, Debug, AsChangeset, router_derive::DebugAsDisplay)]
@@ -339,6 +372,7 @@ pub struct PaymentIntentUpdateInternal {
pub merchant_order_reference_id: Option<String>,
pub shipping_details: Option<Encryption>,
pub is_payment_processor_token_flow: Option<bool>,
+ pub tax_details: Option<TaxDetails>,
}
impl PaymentIntentUpdate {
@@ -379,6 +413,7 @@ impl PaymentIntentUpdate {
merchant_order_reference_id,
shipping_details,
is_payment_processor_token_flow,
+ tax_details,
} = self.into();
PaymentIntent {
amount: amount.unwrap_or(source.amount),
@@ -423,6 +458,7 @@ impl PaymentIntentUpdate {
shipping_details: shipping_details.or(source.shipping_details),
is_payment_processor_token_flow: is_payment_processor_token_flow
.or(source.is_payment_processor_token_flow),
+ tax_details: tax_details.or(source.tax_details),
..source
}
}
@@ -470,6 +506,7 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
merchant_order_reference_id: None,
shipping_details: None,
is_payment_processor_token_flow: None,
+ tax_details: None,
},
PaymentIntentUpdate::Update(value) => Self {
amount: Some(value.amount),
@@ -508,6 +545,7 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
incremental_authorization_allowed: None,
authorization_count: None,
is_payment_processor_token_flow: value.is_payment_processor_token_flow,
+ tax_details: None,
},
PaymentIntentUpdate::PaymentCreateUpdate {
return_url,
@@ -553,6 +591,7 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
merchant_order_reference_id: None,
shipping_details: None,
is_payment_processor_token_flow: None,
+ tax_details: None,
},
PaymentIntentUpdate::PGStatusUpdate {
status,
@@ -594,6 +633,7 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
merchant_order_reference_id: None,
shipping_details: None,
is_payment_processor_token_flow: None,
+ tax_details: None,
},
PaymentIntentUpdate::MerchantStatusUpdate {
status,
@@ -636,6 +676,7 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
merchant_order_reference_id: None,
shipping_details: None,
is_payment_processor_token_flow: None,
+ tax_details: None,
},
PaymentIntentUpdate::ResponseUpdate {
// amount,
@@ -686,6 +727,7 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
merchant_order_reference_id: None,
shipping_details: None,
is_payment_processor_token_flow: None,
+ tax_details: None,
},
PaymentIntentUpdate::PaymentAttemptAndAttemptCountUpdate {
active_attempt_id,
@@ -727,6 +769,7 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
merchant_order_reference_id: None,
shipping_details: None,
is_payment_processor_token_flow: None,
+ tax_details: None,
},
PaymentIntentUpdate::StatusAndAttemptUpdate {
status,
@@ -769,6 +812,7 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
merchant_order_reference_id: None,
shipping_details: None,
is_payment_processor_token_flow: None,
+ tax_details: None,
},
PaymentIntentUpdate::ApproveUpdate {
status,
@@ -810,6 +854,7 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
merchant_order_reference_id: None,
shipping_details: None,
is_payment_processor_token_flow: None,
+ tax_details: None,
},
PaymentIntentUpdate::RejectUpdate {
status,
@@ -851,6 +896,7 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
merchant_order_reference_id: None,
shipping_details: None,
is_payment_processor_token_flow: None,
+ tax_details: None,
},
PaymentIntentUpdate::SurchargeApplicableUpdate {
surcharge_applicable,
@@ -891,6 +937,7 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
merchant_order_reference_id: None,
shipping_details: None,
is_payment_processor_token_flow: None,
+ tax_details: None,
},
PaymentIntentUpdate::IncrementalAuthorizationAmountUpdate { amount } => Self {
amount: Some(amount),
@@ -928,6 +975,7 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
merchant_order_reference_id: None,
shipping_details: None,
is_payment_processor_token_flow: None,
+ tax_details: None,
},
PaymentIntentUpdate::AuthorizationCountUpdate {
authorization_count,
@@ -967,6 +1015,7 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
merchant_order_reference_id: None,
shipping_details: None,
is_payment_processor_token_flow: None,
+ tax_details: None,
},
PaymentIntentUpdate::CompleteAuthorizeUpdate {
shipping_address_id,
@@ -1006,6 +1055,7 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
merchant_order_reference_id: None,
shipping_details: None,
is_payment_processor_token_flow: None,
+ tax_details: None,
},
PaymentIntentUpdate::ManualUpdate { status, updated_by } => Self {
status,
@@ -1043,6 +1093,50 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
merchant_order_reference_id: None,
shipping_details: None,
is_payment_processor_token_flow: None,
+ tax_details: None,
+ },
+ PaymentIntentUpdate::SessionResponseUpdate {
+ tax_details,
+ shipping_address_id,
+ updated_by,
+ shipping_details,
+ } => Self {
+ shipping_address_id,
+ amount: None,
+ tax_details: Some(tax_details),
+ currency: None,
+ status: None,
+ amount_captured: None,
+ customer_id: None,
+ return_url: None,
+ setup_future_usage: None,
+ off_session: None,
+ metadata: None,
+ billing_address_id: None,
+ modified_at: common_utils::date_time::now(),
+ active_attempt_id: None,
+ business_country: None,
+ business_label: None,
+ description: None,
+ statement_descriptor_name: None,
+ statement_descriptor_suffix: None,
+ order_details: None,
+ attempt_count: None,
+ merchant_decision: None,
+ payment_confirm_source: None,
+ updated_by,
+ surcharge_applicable: None,
+ incremental_authorization_allowed: None,
+ authorization_count: None,
+ session_expiry: None,
+ fingerprint_id: None,
+ request_external_three_ds_authentication: None,
+ frm_metadata: None,
+ customer_details: None,
+ billing_details: None,
+ merchant_order_reference_id: None,
+ shipping_details,
+ is_payment_processor_token_flow: None,
},
}
}
diff --git a/crates/diesel_models/src/schema.rs b/crates/diesel_models/src/schema.rs
index 58cf206362..213687431d 100644
--- a/crates/diesel_models/src/schema.rs
+++ b/crates/diesel_models/src/schema.rs
@@ -915,8 +915,10 @@ diesel::table! {
merchant_order_reference_id -> Nullable<Varchar>,
shipping_details -> Nullable<Bytea>,
is_payment_processor_token_flow -> Nullable<Bool>,
+ shipping_cost -> Nullable<Int8>,
#[max_length = 32]
organization_id -> Varchar,
+ tax_details -> Nullable<Jsonb>,
}
}
diff --git a/crates/diesel_models/src/schema_v2.rs b/crates/diesel_models/src/schema_v2.rs
index cda3157767..de4adf7984 100644
--- a/crates/diesel_models/src/schema_v2.rs
+++ b/crates/diesel_models/src/schema_v2.rs
@@ -895,8 +895,10 @@ diesel::table! {
merchant_order_reference_id -> Nullable<Varchar>,
shipping_details -> Nullable<Bytea>,
is_payment_processor_token_flow -> Nullable<Bool>,
+ shipping_cost -> Nullable<Int8>,
#[max_length = 32]
organization_id -> Varchar,
+ tax_details -> Nullable<Jsonb>,
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/taxjar.rs b/crates/hyperswitch_connectors/src/connectors/taxjar.rs
index 3ea453e528..ef8631004a 100644
--- a/crates/hyperswitch_connectors/src/connectors/taxjar.rs
+++ b/crates/hyperswitch_connectors/src/connectors/taxjar.rs
@@ -4,26 +4,28 @@ use common_utils::{
errors::CustomResult,
ext_traits::BytesExt,
request::{Method, Request, RequestBuilder, RequestContent},
- types::{AmountConvertor, StringMinorUnit, StringMinorUnitForConnector},
+ types::{AmountConvertor, FloatMajorUnit, FloatMajorUnitForConnector, MinorUnit},
};
use error_stack::{report, ResultExt};
use hyperswitch_domain_models::{
router_data::{AccessToken, ConnectorAuthType, ErrorResponse, RouterData},
router_flow_types::{
access_token_auth::AccessTokenAuth,
- payments::{Authorize, Capture, PSync, PaymentMethodToken, Session, SetupMandate, Void},
+ payments::{
+ Authorize, CalculateTax, Capture, PSync, PaymentMethodToken, Session, SetupMandate,
+ Void,
+ },
refunds::{Execute, RSync},
},
router_request_types::{
AccessTokenRequestData, PaymentMethodTokenizationData, PaymentsAuthorizeData,
PaymentsCancelData, PaymentsCaptureData, PaymentsSessionData, PaymentsSyncData,
- RefundsData, SetupMandateRequestData,
+ PaymentsTaxCalculationData, RefundsData, SetupMandateRequestData,
},
- router_response_types::{PaymentsResponseData, RefundsResponseData},
- types::{
- PaymentsAuthorizeRouterData, PaymentsCaptureRouterData, PaymentsSyncRouterData,
- RefundSyncRouterData, RefundsRouterData,
+ router_response_types::{
+ PaymentsResponseData, RefundsResponseData, TaxCalculationResponseData,
},
+ types::PaymentsTaxCalculationRouterData,
};
use hyperswitch_interfaces::{
api::{self, ConnectorCommon, ConnectorCommonExt, ConnectorIntegration, ConnectorValidation},
@@ -33,20 +35,20 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
-use masking::{ExposeInterface, Mask};
+use masking::{Mask, PeekInterface};
use transformers as taxjar;
use crate::{constants::headers, types::ResponseRouterData, utils};
#[derive(Clone)]
pub struct Taxjar {
- amount_converter: &'static (dyn AmountConvertor<Output = StringMinorUnit> + Sync),
+ amount_converter: &'static (dyn AmountConvertor<Output = FloatMajorUnit> + Sync),
}
impl Taxjar {
pub fn new() -> &'static Self {
&Self {
- amount_converter: &StringMinorUnitForConnector,
+ amount_converter: &FloatMajorUnitForConnector,
}
}
}
@@ -63,6 +65,7 @@ impl api::Refund for Taxjar {}
impl api::RefundExecute for Taxjar {}
impl api::RefundSync for Taxjar {}
impl api::PaymentToken for Taxjar {}
+impl api::PaymentTaxCalculation for Taxjar {}
impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData>
for Taxjar
@@ -96,9 +99,6 @@ impl ConnectorCommon for Taxjar {
fn get_currency_unit(&self) -> api::CurrencyUnit {
api::CurrencyUnit::Base
- // TODO! Check connector documentation, on which unit they are processing the currency.
- // If the connector accepts amount in lower unit ( i.e cents for USD) then return api::CurrencyUnit::Minor,
- // if connector accepts amount in base unit (i.e dollars for USD) then return api::CurrencyUnit::Base
}
fn common_get_content_type(&self) -> &'static str {
@@ -117,7 +117,7 @@ impl ConnectorCommon for Taxjar {
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
Ok(vec![(
headers::AUTHORIZATION.to_string(),
- auth.api_key.expose().into_masked(),
+ format!("Bearer {}", auth.api_key.peek()).into_masked(),
)])
}
@@ -136,31 +136,31 @@ impl ConnectorCommon for Taxjar {
Ok(ErrorResponse {
status_code: res.status_code,
- code: response.code,
- message: response.message,
- reason: response.reason,
+ code: response.status.clone(),
+ message: response.detail.clone(),
+ reason: Some(response.detail),
attempt_status: None,
connector_transaction_id: None,
})
}
}
-impl ConnectorValidation for Taxjar {
- //TODO: implement functions when support enabled
-}
+impl ConnectorValidation for Taxjar {}
-impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Taxjar {
- //TODO: implement sessions flow
-}
+impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Taxjar {}
impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Taxjar {}
impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Taxjar {}
-impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Taxjar {
+impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Taxjar {}
+
+impl ConnectorIntegration<CalculateTax, PaymentsTaxCalculationData, TaxCalculationResponseData>
+ for Taxjar
+{
fn get_headers(
&self,
- req: &PaymentsAuthorizeRouterData,
+ req: &PaymentsTaxCalculationRouterData,
connectors: &Connectors,
) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
self.build_headers(req, connectors)
@@ -172,44 +172,48 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
fn get_url(
&self,
- _req: &PaymentsAuthorizeRouterData,
- _connectors: &Connectors,
+ _req: &PaymentsTaxCalculationRouterData,
+ connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
- Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into())
+ Ok(format!("{}taxes", self.base_url(connectors)))
}
-
fn get_request_body(
&self,
- req: &PaymentsAuthorizeRouterData,
+ req: &PaymentsTaxCalculationRouterData,
_connectors: &Connectors,
) -> CustomResult<RequestContent, errors::ConnectorError> {
let amount = utils::convert_amount(
self.amount_converter,
- req.request.minor_amount,
+ req.request.amount,
req.request.currency,
)?;
- let connector_router_data = taxjar::TaxjarRouterData::from((amount, req));
+ let shipping = utils::convert_amount(
+ self.amount_converter,
+ req.request.shipping_cost.unwrap_or(MinorUnit::new(0)),
+ req.request.currency,
+ )?;
+
+ let connector_router_data = taxjar::TaxjarRouterData::from((amount, shipping, req));
let connector_req = taxjar::TaxjarPaymentsRequest::try_from(&connector_router_data)?;
Ok(RequestContent::Json(Box::new(connector_req)))
}
-
fn build_request(
&self,
- req: &PaymentsAuthorizeRouterData,
+ req: &PaymentsTaxCalculationRouterData,
connectors: &Connectors,
) -> CustomResult<Option<Request>, errors::ConnectorError> {
Ok(Some(
RequestBuilder::new()
.method(Method::Post)
- .url(&types::PaymentsAuthorizeType::get_url(
+ .url(&types::PaymentsTaxCalculationType::get_url(
self, req, connectors,
)?)
.attach_default_headers()
- .headers(types::PaymentsAuthorizeType::get_headers(
+ .headers(types::PaymentsTaxCalculationType::get_headers(
self, req, connectors,
)?)
- .set_body(types::PaymentsAuthorizeType::get_request_body(
+ .set_body(types::PaymentsTaxCalculationType::get_request_body(
self, req, connectors,
)?)
.build(),
@@ -218,77 +222,13 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
fn handle_response(
&self,
- data: &PaymentsAuthorizeRouterData,
- event_builder: Option<&mut ConnectorEvent>,
- res: Response,
- ) -> CustomResult<PaymentsAuthorizeRouterData, errors::ConnectorError> {
- let response: taxjar::TaxjarPaymentsResponse = res
- .response
- .parse_struct("Taxjar PaymentsAuthorizeResponse")
- .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
- event_builder.map(|i| i.set_response_body(&response));
- router_env::logger::info!(connector_response=?response);
- RouterData::try_from(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<PSync, PaymentsSyncData, PaymentsResponseData> for Taxjar {
- fn get_headers(
- &self,
- req: &PaymentsSyncRouterData,
- connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::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: &PaymentsSyncRouterData,
- _connectors: &Connectors,
- ) -> CustomResult<String, errors::ConnectorError> {
- Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into())
- }
-
- fn build_request(
- &self,
- req: &PaymentsSyncRouterData,
- connectors: &Connectors,
- ) -> CustomResult<Option<Request>, errors::ConnectorError> {
- Ok(Some(
- RequestBuilder::new()
- .method(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: &PaymentsSyncRouterData,
+ data: &PaymentsTaxCalculationRouterData,
event_builder: Option<&mut ConnectorEvent>,
res: Response,
- ) -> CustomResult<PaymentsSyncRouterData, errors::ConnectorError> {
+ ) -> CustomResult<PaymentsTaxCalculationRouterData, errors::ConnectorError> {
let response: taxjar::TaxjarPaymentsResponse = res
.response
- .parse_struct("taxjar PaymentsSyncResponse")
+ .parse_struct("Taxjar PaymentsResponse")
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
event_builder.map(|i| i.set_response_body(&response));
router_env::logger::info!(connector_response=?response);
@@ -308,235 +248,15 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Tax
}
}
-impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Taxjar {
- fn get_headers(
- &self,
- req: &PaymentsCaptureRouterData,
- connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::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: &PaymentsCaptureRouterData,
- _connectors: &Connectors,
- ) -> CustomResult<String, errors::ConnectorError> {
- Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into())
- }
-
- fn get_request_body(
- &self,
- _req: &PaymentsCaptureRouterData,
- _connectors: &Connectors,
- ) -> CustomResult<RequestContent, errors::ConnectorError> {
- Err(errors::ConnectorError::NotImplemented("get_request_body method".to_string()).into())
- }
-
- fn build_request(
- &self,
- req: &PaymentsCaptureRouterData,
- connectors: &Connectors,
- ) -> CustomResult<Option<Request>, errors::ConnectorError> {
- Ok(Some(
- RequestBuilder::new()
- .method(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: &PaymentsCaptureRouterData,
- event_builder: Option<&mut ConnectorEvent>,
- res: Response,
- ) -> CustomResult<PaymentsCaptureRouterData, errors::ConnectorError> {
- let response: taxjar::TaxjarPaymentsResponse = res
- .response
- .parse_struct("Taxjar PaymentsCaptureResponse")
- .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
- event_builder.map(|i| i.set_response_body(&response));
- router_env::logger::info!(connector_response=?response);
- RouterData::try_from(ResponseRouterData {
- response,
- data: data.clone(),
- http_code: res.status_code,
- })
- }
+impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Taxjar {}
- 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<Capture, PaymentsCaptureData, PaymentsResponseData> for Taxjar {}
impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Taxjar {}
-impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Taxjar {
- fn get_headers(
- &self,
- req: &RefundsRouterData<Execute>,
- connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::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: &RefundsRouterData<Execute>,
- _connectors: &Connectors,
- ) -> CustomResult<String, errors::ConnectorError> {
- Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into())
- }
-
- fn get_request_body(
- &self,
- req: &RefundsRouterData<Execute>,
- _connectors: &Connectors,
- ) -> CustomResult<RequestContent, errors::ConnectorError> {
- let refund_amount = utils::convert_amount(
- self.amount_converter,
- req.request.minor_refund_amount,
- req.request.currency,
- )?;
-
- let connector_router_data = taxjar::TaxjarRouterData::from((refund_amount, req));
- let connector_req = taxjar::TaxjarRefundRequest::try_from(&connector_router_data)?;
- Ok(RequestContent::Json(Box::new(connector_req)))
- }
-
- fn build_request(
- &self,
- req: &RefundsRouterData<Execute>,
- connectors: &Connectors,
- ) -> CustomResult<Option<Request>, errors::ConnectorError> {
- let request = RequestBuilder::new()
- .method(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: &RefundsRouterData<Execute>,
- event_builder: Option<&mut ConnectorEvent>,
- res: Response,
- ) -> CustomResult<RefundsRouterData<Execute>, errors::ConnectorError> {
- let response: taxjar::RefundResponse =
- res.response
- .parse_struct("taxjar RefundResponse")
- .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
- event_builder.map(|i| i.set_response_body(&response));
- router_env::logger::info!(connector_response=?response);
- RouterData::try_from(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<RSync, RefundsData, RefundsResponseData> for Taxjar {
- fn get_headers(
- &self,
- req: &RefundSyncRouterData,
- connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::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: &RefundSyncRouterData,
- _connectors: &Connectors,
- ) -> CustomResult<String, errors::ConnectorError> {
- Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into())
- }
+impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Taxjar {}
- fn build_request(
- &self,
- req: &RefundSyncRouterData,
- connectors: &Connectors,
- ) -> CustomResult<Option<Request>, errors::ConnectorError> {
- Ok(Some(
- RequestBuilder::new()
- .method(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: &RefundSyncRouterData,
- event_builder: Option<&mut ConnectorEvent>,
- res: Response,
- ) -> CustomResult<RefundSyncRouterData, errors::ConnectorError> {
- let response: taxjar::RefundResponse = res
- .response
- .parse_struct("taxjar RefundSyncResponse")
- .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
- event_builder.map(|i| i.set_response_body(&response));
- router_env::logger::info!(connector_response=?response);
- RouterData::try_from(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<RSync, RefundsData, RefundsResponseData> for Taxjar {}
#[async_trait::async_trait]
impl webhooks::IncomingWebhook for Taxjar {
diff --git a/crates/hyperswitch_connectors/src/connectors/taxjar/transformers.rs b/crates/hyperswitch_connectors/src/connectors/taxjar/transformers.rs
index 81493c8f5d..53c120a278 100644
--- a/crates/hyperswitch_connectors/src/connectors/taxjar/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/taxjar/transformers.rs
@@ -1,43 +1,55 @@
use common_enums::enums;
-use common_utils::types::StringMinorUnit;
+use common_utils::types::{FloatMajorUnit, FloatMajorUnitForConnector};
+use error_stack::report;
use hyperswitch_domain_models::{
- payment_method_data::PaymentMethodData,
router_data::{ConnectorAuthType, RouterData},
- router_flow_types::refunds::{Execute, RSync},
- router_request_types::ResponseId,
- router_response_types::{PaymentsResponseData, RefundsResponseData},
- types::{PaymentsAuthorizeRouterData, RefundsRouterData},
+ router_request_types::PaymentsTaxCalculationData,
+ router_response_types::TaxCalculationResponseData,
+ types,
};
-use hyperswitch_interfaces::errors;
+use hyperswitch_interfaces::{api, errors};
use masking::Secret;
use serde::{Deserialize, Serialize};
use crate::{
- types::{RefundsResponseRouterData, ResponseRouterData},
- utils::PaymentsAuthorizeRequestData,
+ types::ResponseRouterData,
+ utils::{self, AddressDetailsData},
};
-//TODO: Fill the struct with respective fields
pub struct TaxjarRouterData<T> {
- pub amount: StringMinorUnit, // The type of amount that a connector accepts, for example, String, i64, f64, etc.
+ pub amount: FloatMajorUnit, // The type of amount that a connector accepts, for example, String, i64, f64, etc.
+ pub shipping: FloatMajorUnit,
pub router_data: T,
}
-impl<T> From<(StringMinorUnit, T)> for TaxjarRouterData<T> {
- fn from((amount, item): (StringMinorUnit, T)) -> Self {
- //Todo : use utils to convert the amount to the type of amount that a connector accepts
+impl<T> From<(FloatMajorUnit, FloatMajorUnit, T)> for TaxjarRouterData<T> {
+ fn from((amount, shipping, item): (FloatMajorUnit, FloatMajorUnit, T)) -> Self {
Self {
amount,
+ shipping,
router_data: item,
}
}
}
-//TODO: Fill the struct with respective fields
#[derive(Default, Debug, Serialize, PartialEq)]
pub struct TaxjarPaymentsRequest {
- amount: StringMinorUnit,
- card: TaxjarCard,
+ to_country: enums::CountryAlpha2,
+ to_zip: Secret<String>,
+ to_state: Secret<String>,
+ to_city: Option<String>,
+ to_street: Option<Secret<String>>,
+ amount: FloatMajorUnit,
+ shipping: FloatMajorUnit,
+ line_items: Vec<LineItem>,
+}
+
+#[derive(Serialize, Deserialize, Debug, PartialEq)]
+pub struct LineItem {
+ id: Option<String>,
+ quantity: Option<u16>,
+ product_tax_code: Option<String>,
+ unit_price: Option<f64>,
}
#[derive(Default, Debug, Serialize, Eq, PartialEq)]
@@ -49,32 +61,64 @@ pub struct TaxjarCard {
complete: bool,
}
-impl TryFrom<&TaxjarRouterData<&PaymentsAuthorizeRouterData>> for TaxjarPaymentsRequest {
+impl TryFrom<&TaxjarRouterData<&types::PaymentsTaxCalculationRouterData>>
+ for TaxjarPaymentsRequest
+{
type Error = error_stack::Report<errors::ConnectorError>;
fn try_from(
- item: &TaxjarRouterData<&PaymentsAuthorizeRouterData>,
+ item: &TaxjarRouterData<&types::PaymentsTaxCalculationRouterData>,
) -> Result<Self, Self::Error> {
- match item.router_data.request.payment_method_data.clone() {
- PaymentMethodData::Card(req_card) => {
- let card = TaxjarCard {
- 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()?,
- };
+ let request = &item.router_data.request;
+ let currency = item.router_data.request.currency;
+ let currency_unit = &api::CurrencyUnit::Base;
+ let shipping = &item
+ .router_data
+ .request
+ .shipping_address
+ .address
+ .clone()
+ .ok_or(errors::ConnectorError::MissingRequiredField {
+ field_name: "address",
+ })?;
+
+ match request.order_details.clone() {
+ Some(order_details) => {
+ let line_items: Result<Vec<LineItem>, error_stack::Report<errors::ConnectorError>> =
+ order_details
+ .iter()
+ .map(|line_item| {
+ let unit_price = utils::get_amount_as_f64(
+ currency_unit,
+ line_item.amount,
+ currency,
+ )?;
+ Ok(LineItem {
+ id: line_item.product_id.clone(),
+ quantity: Some(line_item.quantity),
+ product_tax_code: line_item.product_tax_code.clone(),
+ unit_price: Some(unit_price),
+ })
+ })
+ .collect();
+
Ok(Self {
- amount: item.amount.clone(),
- card,
+ to_country: shipping.get_country()?.to_owned(),
+ to_zip: shipping.get_zip()?.to_owned(),
+ to_state: shipping.to_state_code()?.to_owned(),
+ to_city: shipping.get_optional_city(),
+ to_street: shipping.get_optional_line1(),
+ amount: item.amount,
+ shipping: item.shipping,
+ line_items: line_items?,
})
}
- _ => Err(errors::ConnectorError::NotImplemented("Payment methods".to_string()).into()),
+ None => Err(report!(errors::ConnectorError::MissingRequiredField {
+ field_name: "order_details"
+ })),
}
}
}
-//TODO: Fill the struct with respective fields
-// Auth Struct
pub struct TaxjarAuthType {
pub(super) api_key: Secret<String>,
}
@@ -90,139 +134,56 @@ impl TryFrom<&ConnectorAuthType> for TaxjarAuthType {
}
}
}
-// PaymentsResponse
-//TODO: Append the remaining status flags
-#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq)]
-#[serde(rename_all = "lowercase")]
-pub enum TaxjarPaymentStatus {
- Succeeded,
- Failed,
- #[default]
- Processing,
-}
-
-impl From<TaxjarPaymentStatus> for common_enums::AttemptStatus {
- fn from(item: TaxjarPaymentStatus) -> Self {
- match item {
- TaxjarPaymentStatus::Succeeded => Self::Charged,
- TaxjarPaymentStatus::Failed => Self::Failure,
- TaxjarPaymentStatus::Processing => Self::Authorizing,
- }
- }
-}
-//TODO: Fill the struct with respective fields
#[derive(Default, Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct TaxjarPaymentsResponse {
- status: TaxjarPaymentStatus,
- id: String,
+ tax: Tax,
}
-impl<F, T> TryFrom<ResponseRouterData<F, TaxjarPaymentsResponse, T, PaymentsResponseData>>
- for RouterData<F, T, PaymentsResponseData>
+#[derive(Default, Debug, Clone, Serialize, Deserialize, PartialEq)]
+pub struct Tax {
+ amount_to_collect: FloatMajorUnit, //calculated_tax_amount
+}
+
+impl<F>
+ TryFrom<
+ ResponseRouterData<
+ F,
+ TaxjarPaymentsResponse,
+ PaymentsTaxCalculationData,
+ TaxCalculationResponseData,
+ >,
+ > for RouterData<F, PaymentsTaxCalculationData, TaxCalculationResponseData>
{
type Error = error_stack::Report<errors::ConnectorError>;
fn try_from(
- item: ResponseRouterData<F, TaxjarPaymentsResponse, T, PaymentsResponseData>,
- ) -> Result<Self, Self::Error> {
- Ok(Self {
- status: common_enums::AttemptStatus::from(item.response.status),
- response: Ok(PaymentsResponseData::TransactionResponse {
- resource_id: 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 TaxjarRefundRequest {
- pub amount: StringMinorUnit,
-}
-
-impl<F> TryFrom<&TaxjarRouterData<&RefundsRouterData<F>>> for TaxjarRefundRequest {
- type Error = error_stack::Report<errors::ConnectorError>;
- fn try_from(item: &TaxjarRouterData<&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<RefundsResponseRouterData<Execute, RefundResponse>> for RefundsRouterData<Execute> {
- type Error = error_stack::Report<errors::ConnectorError>;
- fn try_from(
- item: RefundsResponseRouterData<Execute, RefundResponse>,
+ item: ResponseRouterData<
+ F,
+ TaxjarPaymentsResponse,
+ PaymentsTaxCalculationData,
+ TaxCalculationResponseData,
+ >,
) -> Result<Self, Self::Error> {
- Ok(Self {
- response: Ok(RefundsResponseData {
- connector_refund_id: item.response.id.to_string(),
- refund_status: enums::RefundStatus::from(item.response.status),
- }),
- ..item.data
- })
- }
-}
+ let currency = item.data.request.currency;
+ let amount_to_collect = item.response.tax.amount_to_collect;
+ let calculated_tax = utils::convert_back_amount_to_minor_units(
+ &FloatMajorUnitForConnector,
+ amount_to_collect,
+ currency,
+ )?;
-impl TryFrom<RefundsResponseRouterData<RSync, RefundResponse>> for RefundsRouterData<RSync> {
- type Error = error_stack::Report<errors::ConnectorError>;
- fn try_from(
- item: RefundsResponseRouterData<RSync, RefundResponse>,
- ) -> Result<Self, Self::Error> {
Ok(Self {
- response: Ok(RefundsResponseData {
- connector_refund_id: item.response.id.to_string(),
- refund_status: enums::RefundStatus::from(item.response.status),
+ response: Ok(TaxCalculationResponseData {
+ order_tax_amount: calculated_tax,
}),
..item.data
})
}
}
-//TODO: Fill the struct with respective fields
#[derive(Default, Debug, Serialize, Deserialize, PartialEq)]
pub struct TaxjarErrorResponse {
- pub status_code: u16,
- pub code: String,
- pub message: String,
- pub reason: Option<String>,
+ pub status: String,
+ pub error: String,
+ pub detail: String,
}
diff --git a/crates/hyperswitch_connectors/src/default_implementations.rs b/crates/hyperswitch_connectors/src/default_implementations.rs
index 02d83636b5..0210bfa551 100644
--- a/crates/hyperswitch_connectors/src/default_implementations.rs
+++ b/crates/hyperswitch_connectors/src/default_implementations.rs
@@ -28,8 +28,9 @@ use hyperswitch_domain_models::{
files::{Retrieve, Upload},
mandate_revoke::MandateRevoke,
payments::{
- Approve, AuthorizeSessionToken, CompleteAuthorize, CreateConnectorCustomer,
- IncrementalAuthorization, PostProcessing, PreProcessing, Reject,
+ Approve, AuthorizeSessionToken, CalculateTax, CompleteAuthorize,
+ CreateConnectorCustomer, IncrementalAuthorization, PostProcessing, PreProcessing,
+ Reject, SdkSessionUpdate,
},
webhooks::VerifyWebhookSource,
},
@@ -37,13 +38,14 @@ use hyperswitch_domain_models::{
AcceptDisputeRequestData, AuthorizeSessionTokenData, CompleteAuthorizeData,
ConnectorCustomerData, DefendDisputeRequestData, MandateRevokeRequestData,
PaymentsApproveData, PaymentsIncrementalAuthorizationData, PaymentsPostProcessingData,
- PaymentsPreProcessingData, PaymentsRejectData, RetrieveFileRequestData,
- SubmitEvidenceRequestData, UploadFileRequestData, VerifyWebhookSourceRequestData,
+ PaymentsPreProcessingData, PaymentsRejectData, PaymentsTaxCalculationData,
+ RetrieveFileRequestData, SdkPaymentsSessionUpdateData, SubmitEvidenceRequestData,
+ UploadFileRequestData, VerifyWebhookSourceRequestData,
},
router_response_types::{
AcceptDisputeResponse, DefendDisputeResponse, MandateRevokeResponseData,
- PaymentsResponseData, RetrieveFileResponse, SubmitEvidenceResponse, UploadFileResponse,
- VerifyWebhookSourceResponseData,
+ PaymentsResponseData, RetrieveFileResponse, SubmitEvidenceResponse,
+ TaxCalculationResponseData, UploadFileResponse, VerifyWebhookSourceResponseData,
},
};
#[cfg(feature = "frm")]
@@ -63,8 +65,9 @@ use hyperswitch_interfaces::{
files::{FileUpload, RetrieveFile, UploadFile},
payments::{
ConnectorCustomer, PaymentApprove, PaymentAuthorizeSessionToken,
- PaymentIncrementalAuthorization, PaymentReject, PaymentsCompleteAuthorize,
- PaymentsPostProcessing, PaymentsPreProcessing,
+ PaymentIncrementalAuthorization, PaymentReject, PaymentSessionUpdate,
+ PaymentTaxCalculation, PaymentsCompleteAuthorize, PaymentsPostProcessing,
+ PaymentsPreProcessing,
},
ConnectorIntegration, ConnectorMandateRevoke, ConnectorRedirectResponse,
},
@@ -103,6 +106,69 @@ default_imp_for_authorize_session_token!(
connectors::Worldline
);
+macro_rules! default_imp_for_calculate_tax {
+ ($($path:ident::$connector:ident),*) => {
+ $( impl PaymentTaxCalculation for $path::$connector {}
+ impl
+ ConnectorIntegration<
+ CalculateTax,
+ PaymentsTaxCalculationData,
+ TaxCalculationResponseData,
+ > for $path::$connector
+ {}
+ )*
+ };
+}
+
+default_imp_for_calculate_tax!(
+ connectors::Bambora,
+ connectors::Bitpay,
+ connectors::Fiserv,
+ connectors::Fiservemea,
+ connectors::Helcim,
+ connectors::Stax,
+ connectors::Novalnet,
+ connectors::Nexixpay,
+ connectors::Fiuu,
+ connectors::Globepay,
+ connectors::Worldline,
+ connectors::Powertranz,
+ connectors::Tsys,
+ connectors::Deutschebank
+);
+
+macro_rules! default_imp_for_session_update {
+ ($($path:ident::$connector:ident),*) => {
+ $( impl PaymentSessionUpdate for $path::$connector {}
+ impl
+ ConnectorIntegration<
+ SdkSessionUpdate,
+ SdkPaymentsSessionUpdateData,
+ PaymentsResponseData,
+ > for $path::$connector
+ {}
+ )*
+ };
+}
+
+default_imp_for_session_update!(
+ connectors::Bambora,
+ connectors::Bitpay,
+ connectors::Fiserv,
+ connectors::Fiservemea,
+ connectors::Helcim,
+ connectors::Stax,
+ connectors::Taxjar,
+ connectors::Novalnet,
+ connectors::Nexixpay,
+ connectors::Fiuu,
+ connectors::Globepay,
+ connectors::Worldline,
+ connectors::Powertranz,
+ connectors::Tsys,
+ connectors::Deutschebank
+);
+
use crate::connectors;
macro_rules! default_imp_for_complete_authorize {
($($path:ident::$connector:ident),*) => {
diff --git a/crates/hyperswitch_connectors/src/default_implementations_v2.rs b/crates/hyperswitch_connectors/src/default_implementations_v2.rs
index fcab2b721d..e23f8fdb29 100644
--- a/crates/hyperswitch_connectors/src/default_implementations_v2.rs
+++ b/crates/hyperswitch_connectors/src/default_implementations_v2.rs
@@ -12,9 +12,9 @@ use hyperswitch_domain_models::{
files::{Retrieve, Upload},
mandate_revoke::MandateRevoke,
payments::{
- Approve, Authorize, AuthorizeSessionToken, Capture, CompleteAuthorize,
+ Approve, Authorize, AuthorizeSessionToken, CalculateTax, Capture, CompleteAuthorize,
CreateConnectorCustomer, IncrementalAuthorization, PSync, PaymentMethodToken,
- PostProcessing, PreProcessing, Reject, Session, SetupMandate, Void,
+ PostProcessing, PreProcessing, Reject, SdkSessionUpdate, Session, SetupMandate, Void,
},
refunds::{Execute, RSync},
webhooks::VerifyWebhookSource,
@@ -27,13 +27,14 @@ use hyperswitch_domain_models::{
PaymentsAuthorizeData, PaymentsCancelData, PaymentsCaptureData,
PaymentsIncrementalAuthorizationData, PaymentsPostProcessingData,
PaymentsPreProcessingData, PaymentsRejectData, PaymentsSessionData, PaymentsSyncData,
- RefundsData, RetrieveFileRequestData, SetupMandateRequestData, SubmitEvidenceRequestData,
+ PaymentsTaxCalculationData, RefundsData, RetrieveFileRequestData,
+ SdkPaymentsSessionUpdateData, SetupMandateRequestData, SubmitEvidenceRequestData,
UploadFileRequestData, VerifyWebhookSourceRequestData,
},
router_response_types::{
AcceptDisputeResponse, DefendDisputeResponse, MandateRevokeResponseData,
PaymentsResponseData, RefundsResponseData, RetrieveFileResponse, SubmitEvidenceResponse,
- UploadFileResponse, VerifyWebhookSourceResponseData,
+ TaxCalculationResponseData, UploadFileResponse, VerifyWebhookSourceResponseData,
},
};
#[cfg(feature = "frm")]
@@ -73,9 +74,9 @@ use hyperswitch_interfaces::{
payments_v2::{
ConnectorCustomerV2, MandateSetupV2, PaymentApproveV2, PaymentAuthorizeSessionTokenV2,
PaymentAuthorizeV2, PaymentCaptureV2, PaymentIncrementalAuthorizationV2,
- PaymentRejectV2, PaymentSessionV2, PaymentSyncV2, PaymentTokenV2, PaymentV2,
- PaymentVoidV2, PaymentsCompleteAuthorizeV2, PaymentsPostProcessingV2,
- PaymentsPreProcessingV2,
+ PaymentRejectV2, PaymentSessionUpdateV2, PaymentSessionV2, PaymentSyncV2,
+ PaymentTaxCalculationV2, PaymentTokenV2, PaymentV2, PaymentVoidV2,
+ PaymentsCompleteAuthorizeV2, PaymentsPostProcessingV2, PaymentsPreProcessingV2,
},
refunds_v2::{RefundExecuteV2, RefundSyncV2, RefundV2},
ConnectorAccessTokenV2, ConnectorMandateRevokeV2, ConnectorVerifyWebhookSourceV2,
@@ -104,6 +105,8 @@ macro_rules! default_imp_for_new_connector_integration_payment {
impl ConnectorCustomerV2 for $path::$connector{}
impl PaymentsPreProcessingV2 for $path::$connector{}
impl PaymentsPostProcessingV2 for $path::$connector{}
+ impl PaymentTaxCalculationV2 for $path::$connector{}
+ impl PaymentSessionUpdateV2 for $path::$connector{}
impl
ConnectorIntegrationV2<Authorize,PaymentFlowData, PaymentsAuthorizeData, PaymentsResponseData>
for $path::$connector{}
@@ -176,6 +179,18 @@ macro_rules! default_imp_for_new_connector_integration_payment {
AuthorizeSessionTokenData,
PaymentsResponseData
> for $path::$connector{}
+ impl ConnectorIntegrationV2<
+ CalculateTax,
+ PaymentFlowData,
+ PaymentsTaxCalculationData,
+ TaxCalculationResponseData,
+ > for $path::$connector{}
+ impl ConnectorIntegrationV2<
+ SdkSessionUpdate,
+ PaymentFlowData,
+ SdkPaymentsSessionUpdateData,
+ PaymentsResponseData,
+ > for $path::$connector{}
)*
};
}
diff --git a/crates/hyperswitch_connectors/src/utils.rs b/crates/hyperswitch_connectors/src/utils.rs
index e5ed9d3e7b..808f2c956d 100644
--- a/crates/hyperswitch_connectors/src/utils.rs
+++ b/crates/hyperswitch_connectors/src/utils.rs
@@ -1,10 +1,13 @@
use std::collections::HashMap;
use api_models::payments::{self, Address, AddressDetails, OrderDetailsWithAmount, PhoneDetails};
-use common_enums::{enums, enums::FutureUsage};
+use common_enums::{
+ enums,
+ enums::{CanadaStatesAbbreviation, FutureUsage, UsStatesAbbreviation},
+};
use common_utils::{
errors::{CustomResult, ReportSwitchExt},
- ext_traits::{OptionExt, ValueExt},
+ ext_traits::{OptionExt, StringExt, ValueExt},
id_type,
pii::{self, Email, IpAddress},
types::{AmountConvertor, MinorUnit},
@@ -147,6 +150,16 @@ pub(crate) fn convert_amount<T>(
.change_context(errors::ConnectorError::AmountConversionFailed)
}
+pub(crate) fn convert_back_amount_to_minor_units<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)
+}
+
// TODO: Make all traits as `pub(crate) trait` once all connectors are moved.
pub trait RouterData {
fn get_billing(&self) -> Result<&Address, Error>;
@@ -163,6 +176,9 @@ pub trait RouterData {
fn get_billing_full_name(&self) -> Result<Secret<String>, Error>;
fn get_billing_last_name(&self) -> Result<Secret<String>, Error>;
fn get_billing_line1(&self) -> Result<Secret<String>, Error>;
+ fn get_billing_zip(&self) -> Result<Secret<String>, Error>;
+ fn get_billing_state(&self) -> Result<Secret<String>, Error>;
+ fn get_billing_state_code(&self) -> Result<Secret<String>, Error>;
fn get_billing_city(&self) -> Result<String, Error>;
fn get_billing_email(&self) -> Result<Email, Error>;
fn get_billing_phone_number(&self) -> Result<Secret<String>, Error>;
@@ -405,6 +421,43 @@ impl<Flow, Request, Response> RouterData
"payment_method_data.billing.address.line1",
))
}
+ fn get_billing_zip(&self) -> Result<Secret<String>, Error> {
+ self.address
+ .get_payment_method_billing()
+ .and_then(|billing_address| {
+ billing_address
+ .clone()
+ .address
+ .and_then(|billing_details| billing_details.zip.clone())
+ })
+ .ok_or_else(missing_field_err("payment_method_data.billing.address.zip"))
+ }
+ fn get_billing_state(&self) -> Result<Secret<String>, Error> {
+ self.address
+ .get_payment_method_billing()
+ .and_then(|billing_address| {
+ billing_address
+ .clone()
+ .address
+ .and_then(|billing_details| billing_details.state.clone())
+ })
+ .ok_or_else(missing_field_err(
+ "payment_method_data.billing.address.state",
+ ))
+ }
+ fn get_billing_state_code(&self) -> Result<Secret<String>, Error> {
+ let country = self.get_billing_country()?;
+ let state = self.get_billing_state()?;
+ match country {
+ api_models::enums::CountryAlpha2::US => Ok(Secret::new(
+ UsStatesAbbreviation::foreign_try_from(state.peek().to_string())?.to_string(),
+ )),
+ api_models::enums::CountryAlpha2::CA => Ok(Secret::new(
+ CanadaStatesAbbreviation::foreign_try_from(state.peek().to_string())?.to_string(),
+ )),
+ _ => Ok(state.clone()),
+ }
+ }
fn get_billing_city(&self) -> Result<String, Error> {
self.address
.get_payment_method_billing()
@@ -761,6 +814,10 @@ pub trait AddressDetailsData {
fn get_zip(&self) -> Result<&Secret<String>, Error>;
fn get_country(&self) -> Result<&api_models::enums::CountryAlpha2, Error>;
fn get_combined_address_line(&self) -> Result<Secret<String>, Error>;
+ fn to_state_code(&self) -> Result<Secret<String>, Error>;
+ fn to_state_code_as_optional(&self) -> Result<Option<Secret<String>>, Error>;
+ fn get_optional_city(&self) -> Option<String>;
+ fn get_optional_line1(&self) -> Option<Secret<String>>;
fn get_optional_line2(&self) -> Option<Secret<String>>;
}
@@ -833,6 +890,40 @@ impl AddressDetailsData for AddressDetails {
)))
}
+ fn to_state_code(&self) -> Result<Secret<String>, Error> {
+ let country = self.get_country()?;
+ let state = self.get_state()?;
+ match country {
+ api_models::enums::CountryAlpha2::US => Ok(Secret::new(
+ UsStatesAbbreviation::foreign_try_from(state.peek().to_string())?.to_string(),
+ )),
+ api_models::enums::CountryAlpha2::CA => Ok(Secret::new(
+ CanadaStatesAbbreviation::foreign_try_from(state.peek().to_string())?.to_string(),
+ )),
+ _ => Ok(state.clone()),
+ }
+ }
+ fn to_state_code_as_optional(&self) -> Result<Option<Secret<String>>, Error> {
+ self.state
+ .as_ref()
+ .map(|state| {
+ if state.peek().len() == 2 {
+ Ok(state.to_owned())
+ } else {
+ self.to_state_code()
+ }
+ })
+ .transpose()
+ }
+
+ fn get_optional_city(&self) -> Option<String> {
+ self.city.clone()
+ }
+
+ fn get_optional_line1(&self) -> Option<Secret<String>> {
+ self.line1.clone()
+ }
+
fn get_optional_line2(&self) -> Option<Secret<String>> {
self.line2.clone()
}
@@ -1317,3 +1408,124 @@ macro_rules! unimplemented_payment_method {
))
};
}
+
+impl ForeignTryFrom<String> for UsStatesAbbreviation {
+ type Error = error_stack::Report<errors::ConnectorError>;
+ fn foreign_try_from(value: String) -> Result<Self, Self::Error> {
+ let state_abbreviation_check =
+ StringExt::<Self>::parse_enum(value.to_uppercase().clone(), "UsStatesAbbreviation");
+
+ match state_abbreviation_check {
+ Ok(state_abbreviation) => Ok(state_abbreviation),
+ Err(_) => {
+ let binding = value.as_str().to_lowercase();
+ let state = binding.as_str();
+ match state {
+ "alabama" => Ok(Self::AL),
+ "alaska" => Ok(Self::AK),
+ "american samoa" => Ok(Self::AS),
+ "arizona" => Ok(Self::AZ),
+ "arkansas" => Ok(Self::AR),
+ "california" => Ok(Self::CA),
+ "colorado" => Ok(Self::CO),
+ "connecticut" => Ok(Self::CT),
+ "delaware" => Ok(Self::DE),
+ "district of columbia" | "columbia" => Ok(Self::DC),
+ "federated states of micronesia" | "micronesia" => Ok(Self::FM),
+ "florida" => Ok(Self::FL),
+ "georgia" => Ok(Self::GA),
+ "guam" => Ok(Self::GU),
+ "hawaii" => Ok(Self::HI),
+ "idaho" => Ok(Self::ID),
+ "illinois" => Ok(Self::IL),
+ "indiana" => Ok(Self::IN),
+ "iowa" => Ok(Self::IA),
+ "kansas" => Ok(Self::KS),
+ "kentucky" => Ok(Self::KY),
+ "louisiana" => Ok(Self::LA),
+ "maine" => Ok(Self::ME),
+ "marshall islands" => Ok(Self::MH),
+ "maryland" => Ok(Self::MD),
+ "massachusetts" => Ok(Self::MA),
+ "michigan" => Ok(Self::MI),
+ "minnesota" => Ok(Self::MN),
+ "mississippi" => Ok(Self::MS),
+ "missouri" => Ok(Self::MO),
+ "montana" => Ok(Self::MT),
+ "nebraska" => Ok(Self::NE),
+ "nevada" => Ok(Self::NV),
+ "new hampshire" => Ok(Self::NH),
+ "new jersey" => Ok(Self::NJ),
+ "new mexico" => Ok(Self::NM),
+ "new york" => Ok(Self::NY),
+ "north carolina" => Ok(Self::NC),
+ "north dakota" => Ok(Self::ND),
+ "northern mariana islands" => Ok(Self::MP),
+ "ohio" => Ok(Self::OH),
+ "oklahoma" => Ok(Self::OK),
+ "oregon" => Ok(Self::OR),
+ "palau" => Ok(Self::PW),
+ "pennsylvania" => Ok(Self::PA),
+ "puerto rico" => Ok(Self::PR),
+ "rhode island" => Ok(Self::RI),
+ "south carolina" => Ok(Self::SC),
+ "south dakota" => Ok(Self::SD),
+ "tennessee" => Ok(Self::TN),
+ "texas" => Ok(Self::TX),
+ "utah" => Ok(Self::UT),
+ "vermont" => Ok(Self::VT),
+ "virgin islands" => Ok(Self::VI),
+ "virginia" => Ok(Self::VA),
+ "washington" => Ok(Self::WA),
+ "west virginia" => Ok(Self::WV),
+ "wisconsin" => Ok(Self::WI),
+ "wyoming" => Ok(Self::WY),
+ _ => Err(errors::ConnectorError::InvalidDataFormat {
+ field_name: "address.state",
+ }
+ .into()),
+ }
+ }
+ }
+ }
+}
+
+impl ForeignTryFrom<String> for CanadaStatesAbbreviation {
+ type Error = error_stack::Report<errors::ConnectorError>;
+ fn foreign_try_from(value: String) -> Result<Self, Self::Error> {
+ let state_abbreviation_check =
+ StringExt::<Self>::parse_enum(value.to_uppercase().clone(), "CanadaStatesAbbreviation");
+ match state_abbreviation_check {
+ Ok(state_abbreviation) => Ok(state_abbreviation),
+ Err(_) => {
+ let binding = value.as_str().to_lowercase();
+ let state = binding.as_str();
+ match state {
+ "alberta" => Ok(Self::AB),
+ "british columbia" => Ok(Self::BC),
+ "manitoba" => Ok(Self::MB),
+ "new brunswick" => Ok(Self::NB),
+ "newfoundland and labrador" | "newfoundland & labrador" => Ok(Self::NL),
+ "northwest territories" => Ok(Self::NT),
+ "nova scotia" => Ok(Self::NS),
+ "nunavut" => Ok(Self::NU),
+ "ontario" => Ok(Self::ON),
+ "prince edward island" => Ok(Self::PE),
+ "quebec" => Ok(Self::QC),
+ "saskatchewan" => Ok(Self::SK),
+ "yukon" => Ok(Self::YT),
+ _ => Err(errors::ConnectorError::InvalidDataFormat {
+ field_name: "address.state",
+ }
+ .into()),
+ }
+ }
+ }
+ }
+}
+
+pub trait ForeignTryFrom<F>: Sized {
+ type Error;
+
+ fn foreign_try_from(from: F) -> Result<Self, Self::Error>;
+}
diff --git a/crates/hyperswitch_domain_models/src/business_profile.rs b/crates/hyperswitch_domain_models/src/business_profile.rs
index ff98475e62..cfc0d07e0c 100644
--- a/crates/hyperswitch_domain_models/src/business_profile.rs
+++ b/crates/hyperswitch_domain_models/src/business_profile.rs
@@ -51,7 +51,7 @@ pub struct BusinessProfile {
pub outgoing_webhook_custom_http_headers: OptionalEncryptableValue,
pub always_collect_billing_details_from_wallet_connector: Option<bool>,
pub always_collect_shipping_details_from_wallet_connector: Option<bool>,
- pub tax_connector_id: Option<String>,
+ pub tax_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
pub is_tax_connector_enabled: bool,
pub version: common_enums::ApiVersion,
}
@@ -88,7 +88,7 @@ pub struct BusinessProfileSetter {
pub outgoing_webhook_custom_http_headers: OptionalEncryptableValue,
pub always_collect_billing_details_from_wallet_connector: Option<bool>,
pub always_collect_shipping_details_from_wallet_connector: Option<bool>,
- pub tax_connector_id: Option<String>,
+ pub tax_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
pub is_tax_connector_enabled: bool,
}
@@ -176,7 +176,7 @@ pub struct BusinessProfileGeneralUpdate {
pub outgoing_webhook_custom_http_headers: OptionalEncryptableValue,
pub always_collect_billing_details_from_wallet_connector: Option<bool>,
pub always_collect_shipping_details_from_wallet_connector: Option<bool>,
- pub tax_connector_id: Option<String>,
+ pub tax_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
pub is_tax_connector_enabled: Option<bool>,
}
@@ -568,7 +568,7 @@ pub struct BusinessProfile {
pub frm_routing_algorithm_id: Option<String>,
pub payout_routing_algorithm_id: Option<common_utils::id_type::RoutingId>,
pub default_fallback_routing: Option<pii::SecretSerdeValue>,
- pub tax_connector_id: Option<String>,
+ pub tax_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
pub is_tax_connector_enabled: bool,
pub version: common_enums::ApiVersion,
}
@@ -607,7 +607,7 @@ pub struct BusinessProfileSetter {
pub frm_routing_algorithm_id: Option<String>,
pub payout_routing_algorithm_id: Option<common_utils::id_type::RoutingId>,
pub default_fallback_routing: Option<pii::SecretSerdeValue>,
- pub tax_connector_id: Option<String>,
+ pub tax_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
pub is_tax_connector_enabled: bool,
}
diff --git a/crates/hyperswitch_domain_models/src/payments.rs b/crates/hyperswitch_domain_models/src/payments.rs
index 70ab814d98..1365a7f082 100644
--- a/crates/hyperswitch_domain_models/src/payments.rs
+++ b/crates/hyperswitch_domain_models/src/payments.rs
@@ -1,4 +1,5 @@
use common_utils::{self, crypto::Encryptable, id_type, pii, types::MinorUnit};
+use diesel_models::payment_intent::TaxDetails;
use masking::Secret;
use time::PrimitiveDateTime;
@@ -16,6 +17,7 @@ pub struct PaymentIntent {
pub merchant_id: id_type::MerchantId,
pub status: storage_enums::IntentStatus,
pub amount: MinorUnit,
+ pub shipping_cost: Option<MinorUnit>,
pub currency: Option<storage_enums::Currency>,
pub amount_captured: Option<MinorUnit>,
pub customer_id: Option<id_type::CustomerId>,
@@ -68,4 +70,5 @@ pub struct PaymentIntent {
pub shipping_details: Option<Encryptable<Secret<serde_json::Value>>>,
pub is_payment_processor_token_flow: Option<bool>,
pub organization_id: id_type::OrganizationId,
+ pub tax_details: Option<TaxDetails>,
}
diff --git a/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs b/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs
index 1fc327ef4e..4c2a67ff12 100644
--- a/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs
+++ b/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs
@@ -548,6 +548,8 @@ impl behaviour::Conversion for PaymentIntent {
shipping_details: self.shipping_details.map(Encryption::from),
is_payment_processor_token_flow: self.is_payment_processor_token_flow,
organization_id: self.organization_id,
+ shipping_cost: self.shipping_cost,
+ tax_details: self.tax_details,
})
}
async fn convert_back(
@@ -631,6 +633,8 @@ impl behaviour::Conversion for PaymentIntent {
.await?,
is_payment_processor_token_flow: storage_model.is_payment_processor_token_flow,
organization_id: storage_model.organization_id,
+ shipping_cost: storage_model.shipping_cost,
+ tax_details: storage_model.tax_details,
})
}
.await
@@ -690,6 +694,8 @@ impl behaviour::Conversion for PaymentIntent {
shipping_details: self.shipping_details.map(Encryption::from),
is_payment_processor_token_flow: self.is_payment_processor_token_flow,
organization_id: self.organization_id,
+ shipping_cost: self.shipping_cost,
+ tax_details: self.tax_details,
})
}
}
@@ -751,6 +757,8 @@ impl behaviour::Conversion for PaymentIntent {
shipping_details: self.shipping_details.map(Encryption::from),
is_payment_processor_token_flow: self.is_payment_processor_token_flow,
organization_id: self.organization_id,
+ shipping_cost: self.shipping_cost,
+ tax_details: self.tax_details,
})
}
@@ -820,6 +828,8 @@ impl behaviour::Conversion for PaymentIntent {
.request_external_three_ds_authentication,
charges: storage_model.charges,
frm_metadata: storage_model.frm_metadata,
+ shipping_cost: storage_model.shipping_cost,
+ tax_details: storage_model.tax_details,
customer_details: storage_model
.customer_details
.async_lift(inner_decrypt)
@@ -894,6 +904,8 @@ impl behaviour::Conversion for PaymentIntent {
shipping_details: self.shipping_details.map(Encryption::from),
is_payment_processor_token_flow: self.is_payment_processor_token_flow,
organization_id: self.organization_id,
+ shipping_cost: self.shipping_cost,
+ tax_details: self.tax_details,
})
}
}
diff --git a/crates/hyperswitch_domain_models/src/payments/payment_intent.rs b/crates/hyperswitch_domain_models/src/payments/payment_intent.rs
index 6c9ba443de..64403cf3b9 100644
--- a/crates/hyperswitch_domain_models/src/payments/payment_intent.rs
+++ b/crates/hyperswitch_domain_models/src/payments/payment_intent.rs
@@ -182,6 +182,7 @@ pub struct PaymentIntentUpdateFields {
pub merchant_order_reference_id: Option<String>,
pub shipping_details: Option<Encryptable<Secret<serde_json::Value>>>,
pub is_payment_processor_token_flow: Option<bool>,
+ pub tax_details: Option<diesel_models::TaxDetails>,
}
#[derive(Debug, Clone, Serialize)]
@@ -257,6 +258,12 @@ pub enum PaymentIntentUpdate {
status: Option<storage_enums::IntentStatus>,
updated_by: String,
},
+ SessionResponseUpdate {
+ tax_details: diesel_models::TaxDetails,
+ shipping_address_id: Option<String>,
+ updated_by: String,
+ shipping_details: Option<Encryptable<Secret<serde_json::Value>>>,
+ },
}
#[derive(Clone, Debug, Default)]
@@ -299,6 +306,7 @@ pub struct PaymentIntentUpdateInternal {
pub merchant_order_reference_id: Option<String>,
pub shipping_details: Option<Encryptable<Secret<serde_json::Value>>>,
pub is_payment_processor_token_flow: Option<bool>,
+ pub tax_details: Option<diesel_models::TaxDetails>,
}
impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
@@ -481,6 +489,18 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
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()
+ },
}
}
}
@@ -544,6 +564,7 @@ impl From<PaymentIntentUpdate> for DieselPaymentIntentUpdate {
merchant_order_reference_id: value.merchant_order_reference_id,
shipping_details: value.shipping_details.map(Encryption::from),
is_payment_processor_token_flow: value.is_payment_processor_token_flow,
+ tax_details: value.tax_details,
}))
}
PaymentIntentUpdate::PaymentCreateUpdate {
@@ -644,6 +665,17 @@ impl From<PaymentIntentUpdate> for DieselPaymentIntentUpdate {
PaymentIntentUpdate::ManualUpdate { status, updated_by } => {
Self::ManualUpdate { status, updated_by }
}
+ PaymentIntentUpdate::SessionResponseUpdate {
+ tax_details,
+ shipping_address_id,
+ updated_by,
+ shipping_details,
+ } => Self::SessionResponseUpdate {
+ tax_details,
+ shipping_address_id,
+ updated_by,
+ shipping_details: shipping_details.map(Encryption::from),
+ },
}
}
}
@@ -688,6 +720,7 @@ impl From<PaymentIntentUpdateInternal> for diesel_models::PaymentIntentUpdateInt
merchant_order_reference_id,
shipping_details,
is_payment_processor_token_flow,
+ tax_details,
} = value;
Self {
@@ -726,6 +759,7 @@ impl From<PaymentIntentUpdateInternal> for diesel_models::PaymentIntentUpdateInt
merchant_order_reference_id,
shipping_details: shipping_details.map(Encryption::from),
is_payment_processor_token_flow,
+ tax_details,
}
}
}
diff --git a/crates/hyperswitch_domain_models/src/router_flow_types/payments.rs b/crates/hyperswitch_domain_models/src/router_flow_types/payments.rs
index 1263f8f975..a0e6adc855 100644
--- a/crates/hyperswitch_domain_models/src/router_flow_types/payments.rs
+++ b/crates/hyperswitch_domain_models/src/router_flow_types/payments.rs
@@ -49,3 +49,9 @@ pub struct IncrementalAuthorization;
#[derive(Debug, Clone)]
pub struct PostProcessing;
+
+#[derive(Debug, Clone)]
+pub struct CalculateTax;
+
+#[derive(Debug, Clone)]
+pub struct SdkSessionUpdate;
diff --git a/crates/hyperswitch_domain_models/src/router_request_types.rs b/crates/hyperswitch_domain_models/src/router_request_types.rs
index ac7bf932fe..ec182056f6 100644
--- a/crates/hyperswitch_domain_models/src/router_request_types.rs
+++ b/crates/hyperswitch_domain_models/src/router_request_types.rs
@@ -1,8 +1,11 @@
pub mod authentication;
pub mod fraud_check;
-use api_models::payments::RequestSurchargeDetails;
+use api_models::payments::{Address, RequestSurchargeDetails};
use common_utils::{
- consts, errors, ext_traits::OptionExt, id_type, pii, types as common_types, types::MinorUnit,
+ consts, errors,
+ ext_traits::OptionExt,
+ id_type, pii,
+ types::{self as common_types, MinorUnit},
};
use diesel_models::enums as storage_enums;
use error_stack::ResultExt;
@@ -791,6 +794,21 @@ pub struct PaymentsSessionData {
pub minor_amount: MinorUnit,
}
+#[derive(Debug, Clone, Default)]
+pub struct PaymentsTaxCalculationData {
+ pub amount: MinorUnit,
+ pub currency: storage_enums::Currency,
+ pub shipping_cost: Option<MinorUnit>,
+ pub order_details: Option<Vec<api_models::payments::OrderDetailsWithAmount>>,
+ pub shipping_address: Address,
+}
+
+#[derive(Debug, Clone, Default)]
+pub struct SdkPaymentsSessionUpdateData {
+ pub order_tax_amount: MinorUnit,
+ pub net_amount: MinorUnit,
+}
+
#[derive(Debug, Clone)]
pub struct SetupMandateRequestData {
pub currency: storage_enums::Currency,
diff --git a/crates/hyperswitch_domain_models/src/router_response_types.rs b/crates/hyperswitch_domain_models/src/router_response_types.rs
index e41b0aa78b..cb682514c8 100644
--- a/crates/hyperswitch_domain_models/src/router_response_types.rs
+++ b/crates/hyperswitch_domain_models/src/router_response_types.rs
@@ -68,6 +68,14 @@ pub enum PaymentsResponseData {
PostProcessingResponse {
session_token: Option<api_models::payments::OpenBankingSessionToken>,
},
+ // SessionUpdateResponse {
+ // status: common_enums::SessionUpdateStatus,
+ // },
+}
+
+#[derive(Debug, Clone)]
+pub struct TaxCalculationResponseData {
+ pub order_tax_amount: MinorUnit,
}
#[derive(serde::Serialize, Debug, Clone)]
diff --git a/crates/hyperswitch_domain_models/src/types.rs b/crates/hyperswitch_domain_models/src/types.rs
index e425fc7fcc..d27c797409 100644
--- a/crates/hyperswitch_domain_models/src/types.rs
+++ b/crates/hyperswitch_domain_models/src/types.rs
@@ -1,15 +1,17 @@
use crate::{
router_data::RouterData,
router_flow_types::{
- Authorize, Capture, CompleteAuthorize, CreateConnectorCustomer, PSync, PaymentMethodToken,
- RSync, SetupMandate, Void,
+ Authorize, CalculateTax, Capture, CompleteAuthorize, CreateConnectorCustomer, PSync,
+ PaymentMethodToken, RSync, SetupMandate, Void,
},
router_request_types::{
CompleteAuthorizeData, ConnectorCustomerData, PaymentMethodTokenizationData,
PaymentsAuthorizeData, PaymentsCancelData, PaymentsCaptureData, PaymentsSyncData,
- RefundsData, SetupMandateRequestData,
+ PaymentsTaxCalculationData, RefundsData, SetupMandateRequestData,
+ },
+ router_response_types::{
+ PaymentsResponseData, RefundsResponseData, TaxCalculationResponseData,
},
- router_response_types::{PaymentsResponseData, RefundsResponseData},
};
pub type PaymentsAuthorizeRouterData =
@@ -27,3 +29,5 @@ pub type ConnectorCustomerRouterData =
RouterData<CreateConnectorCustomer, ConnectorCustomerData, PaymentsResponseData>;
pub type PaymentsCompleteAuthorizeRouterData =
RouterData<CompleteAuthorize, CompleteAuthorizeData, PaymentsResponseData>;
+pub type PaymentsTaxCalculationRouterData =
+ RouterData<CalculateTax, PaymentsTaxCalculationData, TaxCalculationResponseData>;
diff --git a/crates/hyperswitch_interfaces/src/api/payments.rs b/crates/hyperswitch_interfaces/src/api/payments.rs
index 8a53f65805..530dd51645 100644
--- a/crates/hyperswitch_interfaces/src/api/payments.rs
+++ b/crates/hyperswitch_interfaces/src/api/payments.rs
@@ -2,18 +2,19 @@
use hyperswitch_domain_models::{
router_flow_types::payments::{
- Approve, Authorize, AuthorizeSessionToken, Capture, CompleteAuthorize,
+ Approve, Authorize, AuthorizeSessionToken, CalculateTax, Capture, CompleteAuthorize,
CreateConnectorCustomer, IncrementalAuthorization, PSync, PaymentMethodToken,
- PostProcessing, PreProcessing, Reject, Session, SetupMandate, Void,
+ PostProcessing, PreProcessing, Reject, SdkSessionUpdate, Session, SetupMandate, Void,
},
router_request_types::{
AuthorizeSessionTokenData, CompleteAuthorizeData, ConnectorCustomerData,
PaymentMethodTokenizationData, PaymentsApproveData, PaymentsAuthorizeData,
PaymentsCancelData, PaymentsCaptureData, PaymentsIncrementalAuthorizationData,
PaymentsPostProcessingData, PaymentsPreProcessingData, PaymentsRejectData,
- PaymentsSessionData, PaymentsSyncData, SetupMandateRequestData,
+ PaymentsSessionData, PaymentsSyncData, PaymentsTaxCalculationData,
+ SdkPaymentsSessionUpdateData, SetupMandateRequestData,
},
- router_response_types::PaymentsResponseData,
+ router_response_types::{PaymentsResponseData, TaxCalculationResponseData},
};
use crate::api;
@@ -37,6 +38,7 @@ pub trait Payment:
+ PaymentsPostProcessing
+ ConnectorCustomer
+ PaymentIncrementalAuthorization
+ + PaymentSessionUpdate
{
}
@@ -110,6 +112,18 @@ pub trait PaymentIncrementalAuthorization:
{
}
+/// trait PaymentTaxCalculation
+pub trait PaymentTaxCalculation:
+ api::ConnectorIntegration<CalculateTax, PaymentsTaxCalculationData, TaxCalculationResponseData>
+{
+}
+
+/// trait SessionUpdate
+pub trait PaymentSessionUpdate:
+ api::ConnectorIntegration<SdkSessionUpdate, SdkPaymentsSessionUpdateData, PaymentsResponseData>
+{
+}
+
/// trait PaymentsCompleteAuthorize
pub trait PaymentsCompleteAuthorize:
api::ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResponseData>
diff --git a/crates/hyperswitch_interfaces/src/api/payments_v2.rs b/crates/hyperswitch_interfaces/src/api/payments_v2.rs
index 4ebe9e8517..29bc6eee06 100644
--- a/crates/hyperswitch_interfaces/src/api/payments_v2.rs
+++ b/crates/hyperswitch_interfaces/src/api/payments_v2.rs
@@ -3,18 +3,19 @@
use hyperswitch_domain_models::{
router_data_v2::PaymentFlowData,
router_flow_types::payments::{
- Approve, Authorize, AuthorizeSessionToken, Capture, CompleteAuthorize,
+ Approve, Authorize, AuthorizeSessionToken, CalculateTax, Capture, CompleteAuthorize,
CreateConnectorCustomer, IncrementalAuthorization, PSync, PaymentMethodToken,
- PostProcessing, PreProcessing, Reject, Session, SetupMandate, Void,
+ PostProcessing, PreProcessing, Reject, SdkSessionUpdate, Session, SetupMandate, Void,
},
router_request_types::{
AuthorizeSessionTokenData, CompleteAuthorizeData, ConnectorCustomerData,
PaymentMethodTokenizationData, PaymentsApproveData, PaymentsAuthorizeData,
PaymentsCancelData, PaymentsCaptureData, PaymentsIncrementalAuthorizationData,
PaymentsPostProcessingData, PaymentsPreProcessingData, PaymentsRejectData,
- PaymentsSessionData, PaymentsSyncData, SetupMandateRequestData,
+ PaymentsSessionData, PaymentsSyncData, PaymentsTaxCalculationData,
+ SdkPaymentsSessionUpdateData, SetupMandateRequestData,
},
- router_response_types::PaymentsResponseData,
+ router_response_types::{PaymentsResponseData, TaxCalculationResponseData},
};
use crate::api::{ConnectorCommon, ConnectorIntegrationV2, ConnectorValidation};
@@ -89,6 +90,28 @@ pub trait PaymentIncrementalAuthorizationV2:
{
}
+///trait PaymentTaxCalculationV2
+pub trait PaymentTaxCalculationV2:
+ ConnectorIntegrationV2<
+ CalculateTax,
+ PaymentFlowData,
+ PaymentsTaxCalculationData,
+ TaxCalculationResponseData,
+>
+{
+}
+
+///trait PaymentSessionUpdateV2
+pub trait PaymentSessionUpdateV2:
+ ConnectorIntegrationV2<
+ SdkSessionUpdate,
+ PaymentFlowData,
+ SdkPaymentsSessionUpdateData,
+ PaymentsResponseData,
+>
+{
+}
+
/// trait PaymentsCompleteAuthorizeV2
pub trait PaymentsCompleteAuthorizeV2:
ConnectorIntegrationV2<
@@ -163,5 +186,7 @@ pub trait PaymentV2:
+ PaymentsPostProcessingV2
+ ConnectorCustomerV2
+ PaymentIncrementalAuthorizationV2
+ + PaymentTaxCalculationV2
+ + PaymentSessionUpdateV2
{
}
diff --git a/crates/hyperswitch_interfaces/src/types.rs b/crates/hyperswitch_interfaces/src/types.rs
index 06a1d6028e..e42942a94d 100644
--- a/crates/hyperswitch_interfaces/src/types.rs
+++ b/crates/hyperswitch_interfaces/src/types.rs
@@ -7,7 +7,7 @@ use hyperswitch_domain_models::{
files::{Retrieve, Upload},
mandate_revoke::MandateRevoke,
payments::{
- Authorize, AuthorizeSessionToken, Balance, Capture, CompleteAuthorize,
+ Authorize, AuthorizeSessionToken, Balance, CalculateTax, Capture, CompleteAuthorize,
CreateConnectorCustomer, IncrementalAuthorization, InitPayment, PSync,
PaymentMethodToken, PostProcessing, PreProcessing, Session, SetupMandate, Void,
},
@@ -20,13 +20,14 @@ use hyperswitch_domain_models::{
MandateRevokeRequestData, PaymentMethodTokenizationData, PaymentsAuthorizeData,
PaymentsCancelData, PaymentsCaptureData, PaymentsIncrementalAuthorizationData,
PaymentsPostProcessingData, PaymentsPreProcessingData, PaymentsSessionData,
- PaymentsSyncData, RefundsData, RetrieveFileRequestData, SetupMandateRequestData,
- SubmitEvidenceRequestData, UploadFileRequestData, VerifyWebhookSourceRequestData,
+ PaymentsSyncData, PaymentsTaxCalculationData, RefundsData, RetrieveFileRequestData,
+ SetupMandateRequestData, SubmitEvidenceRequestData, UploadFileRequestData,
+ VerifyWebhookSourceRequestData,
},
router_response_types::{
AcceptDisputeResponse, DefendDisputeResponse, MandateRevokeResponseData,
PaymentsResponseData, RefundsResponseData, RetrieveFileResponse, SubmitEvidenceResponse,
- UploadFileResponse, VerifyWebhookSourceResponseData,
+ TaxCalculationResponseData, UploadFileResponse, VerifyWebhookSourceResponseData,
},
};
#[cfg(feature = "payouts")]
@@ -54,6 +55,9 @@ pub struct Response {
/// Type alias for `ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData>`
pub type PaymentsAuthorizeType =
dyn ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData>;
+/// Type alias for `ConnectorIntegration<CalculateTax, PaymentsTaxCalculationData, TaxCalculationResponseData>`
+pub type PaymentsTaxCalculationType =
+ dyn ConnectorIntegration<CalculateTax, PaymentsTaxCalculationData, TaxCalculationResponseData>;
/// Type alias for `ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData>`
pub type SetupMandateType =
dyn ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData>;
diff --git a/crates/openapi/src/openapi.rs b/crates/openapi/src/openapi.rs
index 7a37f22afa..f12539cc23 100644
--- a/crates/openapi/src/openapi.rs
+++ b/crates/openapi/src/openapi.rs
@@ -570,6 +570,7 @@ Never share your secret api keys. Keep them guarded and secure.
api_models::payments::CustomerDetailsResponse,
api_models::payments::OpenBankingData,
api_models::payments::OpenBankingSessionToken,
+ api_models::payments::PaymentsDynamicTaxCalculationRequest,
)),
modifiers(&SecurityAddon)
)]
diff --git a/crates/openapi/src/routes/payments.rs b/crates/openapi/src/routes/payments.rs
index 0e3bb9fe07..1ed8c541bf 100644
--- a/crates/openapi/src/routes/payments.rs
+++ b/crates/openapi/src/routes/payments.rs
@@ -545,3 +545,21 @@ pub fn payments_external_authentication() {}
security(("publishable_key" = []))
)]
pub fn payments_complete_authorize() {}
+
+/// Dynamic Tax Calculation
+///
+///
+#[utoipa::path(
+ post,
+ path = "/payments/{payment_id}/calculate_tax",
+ request_body=PaymentsDynamicTaxCalculationRequest,
+ responses(
+ (status = 200, description = "Tax Calculation is done", body = PaymentsDynamicTaxCalculationResponse),
+ (status = 400, description = "Missing mandatory fields")
+ ),
+ tag = "Payments",
+ operation_id = "Create Tax Calculation for a Payment",
+ security(("publishable_key" = []))
+)]
+
+pub fn payments_dynamic_tax_calculation() {}
diff --git a/crates/router/src/core/admin.rs b/crates/router/src/core/admin.rs
index 8101867df4..8c42e8df35 100644
--- a/crates/router/src/core/admin.rs
+++ b/crates/router/src/core/admin.rs
@@ -1453,6 +1453,7 @@ impl<'a> ConnectorAuthTypeAndMetadataValidation<'a> {
stax::transformers::StaxAuthType::try_from(self.auth_type)?;
Ok(())
}
+ api_enums::Connector::Taxjar => Ok(()),
api_enums::Connector::Stripe => {
stripe::transformers::StripeAuthType::try_from(self.auth_type)?;
Ok(())
@@ -1776,6 +1777,8 @@ impl<'a> ConnectorTypeAndConnectorName<'a> {
api_enums::convert_pm_auth_connector(self.connector_name.to_string().as_str());
let authentication_connector =
api_enums::convert_authentication_connector(self.connector_name.to_string().as_str());
+ let tax_connector =
+ api_enums::convert_tax_connector(self.connector_name.to_string().as_str());
if pm_auth_connector.is_some() {
if self.connector_type != &api_enums::ConnectorType::PaymentMethodAuth
@@ -1793,6 +1796,13 @@ impl<'a> ConnectorTypeAndConnectorName<'a> {
}
.into());
}
+ } else if tax_connector.is_some() {
+ if self.connector_type != &api_enums::ConnectorType::TaxProcessor {
+ return Err(errors::ApiErrorResponse::InvalidRequestData {
+ message: "Invalid connector type given".to_string(),
+ }
+ .into());
+ }
} else {
let routable_connector_option = self
.connector_name
diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rs
index 8778079e72..f71bf9b94a 100644
--- a/crates/router/src/core/payments.rs
+++ b/crates/router/src/core/payments.rs
@@ -54,8 +54,8 @@ use time;
pub use self::operations::{
PaymentApprove, PaymentCancel, PaymentCapture, PaymentConfirm, PaymentCreate,
- PaymentIncrementalAuthorization, PaymentReject, PaymentResponse, PaymentSession, PaymentStatus,
- PaymentUpdate,
+ PaymentIncrementalAuthorization, PaymentReject, PaymentResponse, PaymentSession,
+ PaymentSessionUpdate, PaymentStatus, PaymentUpdate,
};
use self::{
conditional_configs::perform_decision_management,
@@ -267,6 +267,20 @@ where
mandate_type,
)
.await?;
+
+ operation
+ .to_domain()?
+ .payments_dynamic_tax_calculation(
+ state,
+ &mut payment_data,
+ &mut should_continue_transaction,
+ &connector_details,
+ &business_profile,
+ &key_store,
+ &merchant_account,
+ )
+ .await?;
+
if should_continue_transaction {
#[cfg(feature = "frm")]
match (
@@ -2753,6 +2767,13 @@ where
pub authentication: Option<storage::Authentication>,
pub recurring_details: Option<RecurringDetails>,
pub poll_config: Option<router_types::PollConfig>,
+ pub tax_data: Option<TaxData>,
+}
+
+#[derive(Clone, serde::Serialize, Debug)]
+pub struct TaxData {
+ pub shipping_details: api_models::payments::Address,
+ pub payment_method_type: enums::PaymentMethodType,
}
#[derive(Clone, serde::Serialize, Debug)]
@@ -2888,6 +2909,7 @@ pub fn should_call_connector<Op: Debug, F: Clone>(
"PaymentApprove" => true,
"PaymentReject" => true,
"PaymentSession" => true,
+ "PaymentSessionUpdate" => true,
"PaymentIncrementalAuthorization" => matches!(
payment_data.payment_intent.status,
storage_enums::IntentStatus::RequiresCapture
diff --git a/crates/router/src/core/payments/connector_integration_v2_impls.rs b/crates/router/src/core/payments/connector_integration_v2_impls.rs
index a0b7b530bf..0a4aa8348d 100644
--- a/crates/router/src/core/payments/connector_integration_v2_impls.rs
+++ b/crates/router/src/core/payments/connector_integration_v2_impls.rs
@@ -42,6 +42,10 @@ mod dummy_connector_default_impl {
impl<const T: u8> api::PaymentsPostProcessingV2 for connector::DummyConnector<T> {}
+ impl<const T: u8> api::PaymentTaxCalculationV2 for connector::DummyConnector<T> {}
+
+ impl<const T: u8> api::PaymentSessionUpdateV2 for connector::DummyConnector<T> {}
+
impl<const T: u8>
services::ConnectorIntegrationV2<
api::Authorize,
@@ -181,6 +185,24 @@ mod dummy_connector_default_impl {
> for connector::DummyConnector<T>
{
}
+ impl<const T: u8>
+ services::ConnectorIntegrationV2<
+ api::CalculateTax,
+ types::PaymentFlowData,
+ types::PaymentsTaxCalculationData,
+ types::TaxCalculationResponseData,
+ > for connector::DummyConnector<T>
+ {
+ }
+ impl<const T: u8>
+ services::ConnectorIntegrationV2<
+ api::SdkSessionUpdate,
+ types::PaymentFlowData,
+ types::SdkPaymentsSessionUpdateData,
+ types::PaymentsResponseData,
+ > for connector::DummyConnector<T>
+ {
+ }
impl<const T: u8>
services::ConnectorIntegrationV2<
@@ -557,6 +579,8 @@ macro_rules! default_imp_for_new_connector_integration_payment {
impl api::ConnectorCustomerV2 for $path::$connector{}
impl api::PaymentsPreProcessingV2 for $path::$connector{}
impl api::PaymentsPostProcessingV2 for $path::$connector{}
+ impl api::PaymentTaxCalculationV2 for $path::$connector{}
+ impl api::PaymentSessionUpdateV2 for $path::$connector{}
impl
services::ConnectorIntegrationV2<api::Authorize,types::PaymentFlowData, types::PaymentsAuthorizeData, types::PaymentsResponseData>
for $path::$connector{}
@@ -629,6 +653,19 @@ macro_rules! default_imp_for_new_connector_integration_payment {
types::AuthorizeSessionTokenData,
types::PaymentsResponseData
> for $path::$connector{}
+ impl services::ConnectorIntegrationV2<
+ api::CalculateTax,
+ types::PaymentFlowData,
+ types::PaymentsTaxCalculationData,
+ types::TaxCalculationResponseData,
+ > for $path::$connector{}
+
+ impl services::ConnectorIntegrationV2<
+ api::SdkSessionUpdate,
+ types::PaymentFlowData,
+ types::SdkPaymentsSessionUpdateData,
+ types::PaymentsResponseData,
+ > for $path::$connector{}
)*
};
}
diff --git a/crates/router/src/core/payments/flows.rs b/crates/router/src/core/payments/flows.rs
index c7045733cb..9cf3530169 100644
--- a/crates/router/src/core/payments/flows.rs
+++ b/crates/router/src/core/payments/flows.rs
@@ -8,6 +8,7 @@ pub mod psync_flow;
pub mod reject_flow;
pub mod session_flow;
pub mod setup_mandate_flow;
+pub mod tax_calculation_flow;
use async_trait::async_trait;
@@ -3084,3 +3085,181 @@ default_imp_for_authorize_session_token!(
connector::Zen,
connector::Zsl
);
+
+macro_rules! default_imp_for_calculate_tax {
+ ($($path:ident::$connector:ident),*) => {
+ $( impl api::PaymentTaxCalculation for $path::$connector {}
+ impl
+ services::ConnectorIntegration<
+ api::CalculateTax,
+ types::PaymentsTaxCalculationData,
+ types::TaxCalculationResponseData
+ > for $path::$connector
+ {}
+ )*
+ };
+}
+#[cfg(feature = "dummy_connector")]
+impl<const T: u8> api::PaymentTaxCalculation for connector::DummyConnector<T> {}
+#[cfg(feature = "dummy_connector")]
+impl<const T: u8>
+ services::ConnectorIntegration<
+ api::CalculateTax,
+ types::PaymentsTaxCalculationData,
+ types::TaxCalculationResponseData,
+ > for connector::DummyConnector<T>
+{
+}
+
+default_imp_for_calculate_tax!(
+ connector::Aci,
+ connector::Adyen,
+ connector::Adyenplatform,
+ connector::Airwallex,
+ connector::Authorizedotnet,
+ connector::Bamboraapac,
+ connector::Bankofamerica,
+ connector::Billwerk,
+ connector::Bluesnap,
+ connector::Boku,
+ connector::Braintree,
+ connector::Cashtocode,
+ connector::Checkout,
+ connector::Cryptopay,
+ connector::Coinbase,
+ connector::Cybersource,
+ connector::Datatrans,
+ connector::Dlocal,
+ connector::Ebanx,
+ connector::Forte,
+ connector::Globalpay,
+ connector::Gocardless,
+ connector::Gpayments,
+ connector::Iatapay,
+ connector::Itaubank,
+ connector::Klarna,
+ connector::Mifinity,
+ connector::Mollie,
+ connector::Multisafepay,
+ connector::Netcetera,
+ connector::Nexinets,
+ connector::Nuvei,
+ connector::Nmi,
+ connector::Noon,
+ connector::Opayo,
+ connector::Opennode,
+ connector::Paybox,
+ connector::Payeezy,
+ connector::Payme,
+ connector::Payone,
+ connector::Paypal,
+ connector::Payu,
+ connector::Placetopay,
+ connector::Plaid,
+ connector::Prophetpay,
+ connector::Rapyd,
+ connector::Razorpay,
+ connector::Riskified,
+ connector::Square,
+ connector::Signifyd,
+ connector::Stripe,
+ connector::Shift4,
+ connector::Threedsecureio,
+ connector::Trustpay,
+ connector::Volt,
+ connector::Wellsfargo,
+ connector::Wellsfargopayout,
+ connector::Wise,
+ connector::Worldpay,
+ connector::Zen,
+ connector::Zsl
+);
+
+macro_rules! default_imp_for_session_update {
+ ($($path:ident::$connector:ident),*) => {
+ $( impl api::PaymentSessionUpdate for $path::$connector {}
+ impl
+ services::ConnectorIntegration<
+ api::SdkSessionUpdate,
+ types::SdkPaymentsSessionUpdateData,
+ types::PaymentsResponseData
+ > for $path::$connector
+ {}
+ )*
+ };
+}
+#[cfg(feature = "dummy_connector")]
+impl<const T: u8> api::PaymentSessionUpdate for connector::DummyConnector<T> {}
+#[cfg(feature = "dummy_connector")]
+impl<const T: u8>
+ services::ConnectorIntegration<
+ api::SdkSessionUpdate,
+ types::SdkPaymentsSessionUpdateData,
+ types::PaymentsResponseData,
+ > for connector::DummyConnector<T>
+{
+}
+
+default_imp_for_session_update!(
+ connector::Aci,
+ connector::Adyen,
+ connector::Adyenplatform,
+ connector::Airwallex,
+ connector::Authorizedotnet,
+ connector::Bamboraapac,
+ connector::Bankofamerica,
+ connector::Billwerk,
+ connector::Bluesnap,
+ connector::Boku,
+ connector::Braintree,
+ connector::Cashtocode,
+ connector::Checkout,
+ connector::Cryptopay,
+ connector::Coinbase,
+ connector::Cybersource,
+ connector::Datatrans,
+ connector::Dlocal,
+ connector::Ebanx,
+ connector::Forte,
+ connector::Globalpay,
+ connector::Gocardless,
+ connector::Gpayments,
+ connector::Iatapay,
+ connector::Itaubank,
+ connector::Klarna,
+ connector::Mifinity,
+ connector::Mollie,
+ connector::Multisafepay,
+ connector::Netcetera,
+ connector::Nexinets,
+ connector::Nuvei,
+ connector::Nmi,
+ connector::Noon,
+ connector::Opayo,
+ connector::Opennode,
+ connector::Paybox,
+ connector::Payeezy,
+ connector::Payme,
+ connector::Payone,
+ connector::Paypal,
+ connector::Payu,
+ connector::Placetopay,
+ connector::Plaid,
+ connector::Prophetpay,
+ connector::Rapyd,
+ connector::Razorpay,
+ connector::Riskified,
+ connector::Square,
+ connector::Signifyd,
+ connector::Stripe,
+ connector::Shift4,
+ connector::Threedsecureio,
+ connector::Trustpay,
+ connector::Volt,
+ connector::Wellsfargo,
+ connector::Wellsfargopayout,
+ connector::Wise,
+ connector::Worldpay,
+ connector::Zen,
+ connector::Zsl
+);
diff --git a/crates/router/src/core/payments/flows/tax_calculation_flow.rs b/crates/router/src/core/payments/flows/tax_calculation_flow.rs
new file mode 100644
index 0000000000..1a8ebbccc7
--- /dev/null
+++ b/crates/router/src/core/payments/flows/tax_calculation_flow.rs
@@ -0,0 +1,130 @@
+use async_trait::async_trait;
+
+use super::ConstructFlowSpecificData;
+use crate::{
+ core::{
+ errors::{ConnectorErrorExt, RouterResult},
+ payments::{self, access_token, helpers, transformers, Feature, PaymentData},
+ },
+ routes::SessionState,
+ services,
+ types::{self, api, domain},
+};
+
+#[async_trait]
+impl
+ ConstructFlowSpecificData<
+ api::SdkSessionUpdate,
+ types::SdkPaymentsSessionUpdateData,
+ types::PaymentsResponseData,
+ > for PaymentData<api::SdkSessionUpdate>
+{
+ async fn construct_router_data<'a>(
+ &self,
+ state: &SessionState,
+ connector_id: &str,
+ merchant_account: &domain::MerchantAccount,
+ key_store: &domain::MerchantKeyStore,
+ customer: &Option<domain::Customer>,
+ merchant_connector_account: &helpers::MerchantConnectorAccountType,
+ _merchant_recipient_data: Option<types::MerchantRecipientData>,
+ ) -> RouterResult<types::SdkSessionUpdateRouterData> {
+ Box::pin(
+ transformers::construct_router_data_to_update_calculated_tax::<
+ api::SdkSessionUpdate,
+ types::SdkPaymentsSessionUpdateData,
+ >(
+ state,
+ self.clone(),
+ connector_id,
+ merchant_account,
+ key_store,
+ customer,
+ merchant_connector_account,
+ ),
+ )
+ .await
+ }
+
+ async fn get_merchant_recipient_data<'a>(
+ &self,
+ _state: &SessionState,
+ _merchant_account: &domain::MerchantAccount,
+ _key_store: &domain::MerchantKeyStore,
+ _merchant_connector_account: &helpers::MerchantConnectorAccountType,
+ _connector: &api::ConnectorData,
+ ) -> RouterResult<Option<types::MerchantRecipientData>> {
+ Ok(None)
+ }
+}
+
+#[async_trait]
+impl Feature<api::SdkSessionUpdate, types::SdkPaymentsSessionUpdateData>
+ for types::RouterData<
+ api::SdkSessionUpdate,
+ types::SdkPaymentsSessionUpdateData,
+ types::PaymentsResponseData,
+ >
+{
+ async fn decide_flows<'a>(
+ self,
+ state: &SessionState,
+ connector: &api::ConnectorData,
+ call_connector_action: payments::CallConnectorAction,
+ connector_request: Option<services::Request>,
+ _business_profile: &domain::BusinessProfile,
+ _header_payload: api_models::payments::HeaderPayload,
+ ) -> RouterResult<Self> {
+ let connector_integration: services::BoxedPaymentConnectorIntegrationInterface<
+ api::SdkSessionUpdate,
+ types::SdkPaymentsSessionUpdateData,
+ types::PaymentsResponseData,
+ > = connector.connector.get_connector_integration();
+
+ let resp = services::execute_connector_processing_step(
+ state,
+ connector_integration,
+ &self,
+ call_connector_action,
+ connector_request,
+ )
+ .await
+ .to_payment_failed_response()?;
+ Ok(resp)
+ }
+
+ async fn add_access_token<'a>(
+ &self,
+ state: &SessionState,
+ connector: &api::ConnectorData,
+ merchant_account: &domain::MerchantAccount,
+ creds_identifier: Option<&String>,
+ ) -> RouterResult<types::AddAccessTokenResult> {
+ access_token::add_access_token(state, connector, merchant_account, self, creds_identifier)
+ .await
+ }
+
+ async fn build_flow_specific_connector_request(
+ &mut self,
+ state: &SessionState,
+ connector: &api::ConnectorData,
+ call_connector_action: payments::CallConnectorAction,
+ ) -> RouterResult<(Option<services::Request>, bool)> {
+ let request = match call_connector_action {
+ payments::CallConnectorAction::Trigger => {
+ let connector_integration: services::BoxedPaymentConnectorIntegrationInterface<
+ api::SdkSessionUpdate,
+ types::SdkPaymentsSessionUpdateData,
+ types::PaymentsResponseData,
+ > = connector.connector.get_connector_integration();
+
+ connector_integration
+ .build_request(self, &state.conf.connectors)
+ .to_payment_failed_response()?
+ }
+ _ => None,
+ };
+
+ Ok((request, true))
+ }
+}
diff --git a/crates/router/src/core/payments/helpers.rs b/crates/router/src/core/payments/helpers.rs
index 8ce183d3e3..fdec36d3b7 100644
--- a/crates/router/src/core/payments/helpers.rs
+++ b/crates/router/src/core/payments/helpers.rs
@@ -3103,6 +3103,8 @@ mod tests {
shipping_details: None,
is_payment_processor_token_flow: None,
organization_id: id_type::OrganizationId::default(),
+ shipping_cost: None,
+ tax_details: None,
};
let req_cs = Some("1".to_string());
assert!(authenticate_client_secret(req_cs.as_ref(), &payment_intent).is_ok());
@@ -3169,6 +3171,8 @@ mod tests {
shipping_details: None,
is_payment_processor_token_flow: None,
organization_id: id_type::OrganizationId::default(),
+ shipping_cost: None,
+ tax_details: None,
};
let req_cs = Some("1".to_string());
assert!(authenticate_client_secret(req_cs.as_ref(), &payment_intent,).is_err())
@@ -3233,6 +3237,8 @@ mod tests {
shipping_details: None,
is_payment_processor_token_flow: None,
organization_id: id_type::OrganizationId::default(),
+ shipping_cost: None,
+ tax_details: None,
};
let req_cs = Some("1".to_string());
assert!(authenticate_client_secret(req_cs.as_ref(), &payment_intent).is_err())
diff --git a/crates/router/src/core/payments/operations.rs b/crates/router/src/core/payments/operations.rs
index 0eef08c104..58ca148579 100644
--- a/crates/router/src/core/payments/operations.rs
+++ b/crates/router/src/core/payments/operations.rs
@@ -11,6 +11,7 @@ pub mod payment_start;
pub mod payment_status;
pub mod payment_update;
pub mod payments_incremental_authorization;
+pub mod tax_calculation;
use api_models::enums::FrmSuggestion;
use async_trait::async_trait;
@@ -24,6 +25,7 @@ pub use self::{
payment_response::PaymentResponse, payment_session::PaymentSession,
payment_start::PaymentStart, payment_status::PaymentStatus, payment_update::PaymentUpdate,
payments_incremental_authorization::PaymentIncrementalAuthorization,
+ tax_calculation::PaymentSessionUpdate,
};
use super::{helpers, CustomerDetails, PaymentData};
use crate::{
@@ -180,6 +182,20 @@ pub trait Domain<F: Clone, R>: Send + Sync {
Ok(())
}
+ #[allow(clippy::too_many_arguments)]
+ async fn payments_dynamic_tax_calculation<'a>(
+ &'a self,
+ _state: &SessionState,
+ _payment_data: &mut PaymentData<F>,
+ _should_continue_confirm_transaction: &mut bool,
+ _connector_call_type: &ConnectorCallType,
+ _business_profile: &domain::BusinessProfile,
+ _key_store: &domain::MerchantKeyStore,
+ _merchant_account: &domain::MerchantAccount,
+ ) -> CustomResult<(), errors::ApiErrorResponse> {
+ Ok(())
+ }
+
#[instrument(skip_all)]
async fn guard_payment_against_blocklist<'a>(
&'a self,
diff --git a/crates/router/src/core/payments/operations/payment_approve.rs b/crates/router/src/core/payments/operations/payment_approve.rs
index 3ad4cff9ef..ee5f166f82 100644
--- a/crates/router/src/core/payments/operations/payment_approve.rs
+++ b/crates/router/src/core/payments/operations/payment_approve.rs
@@ -182,6 +182,7 @@ impl<F: Send + Clone> GetTracker<F, PaymentData<F>, api::PaymentsCaptureRequest>
authentication: None,
recurring_details: None,
poll_config: None,
+ tax_data: None,
};
let get_trackers_response = operations::GetTrackerResponse {
diff --git a/crates/router/src/core/payments/operations/payment_cancel.rs b/crates/router/src/core/payments/operations/payment_cancel.rs
index 689184a619..d17d9ebb22 100644
--- a/crates/router/src/core/payments/operations/payment_cancel.rs
+++ b/crates/router/src/core/payments/operations/payment_cancel.rs
@@ -196,6 +196,7 @@ impl<F: Send + Clone> GetTracker<F, PaymentData<F>, api::PaymentsCancelRequest>
authentication: None,
recurring_details: None,
poll_config: None,
+ tax_data: None,
};
let get_trackers_response = operations::GetTrackerResponse {
diff --git a/crates/router/src/core/payments/operations/payment_capture.rs b/crates/router/src/core/payments/operations/payment_capture.rs
index 5c04fc99ef..d9c841c6af 100644
--- a/crates/router/src/core/payments/operations/payment_capture.rs
+++ b/crates/router/src/core/payments/operations/payment_capture.rs
@@ -242,6 +242,7 @@ impl<F: Send + Clone> GetTracker<F, payments::PaymentData<F>, api::PaymentsCaptu
authentication: None,
recurring_details: None,
poll_config: None,
+ tax_data: None,
};
let get_trackers_response = operations::GetTrackerResponse {
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 f45872c2a8..b905295b2b 100644
--- a/crates/router/src/core/payments/operations/payment_complete_authorize.rs
+++ b/crates/router/src/core/payments/operations/payment_complete_authorize.rs
@@ -338,6 +338,7 @@ impl<F: Send + Clone> GetTracker<F, PaymentData<F>, api::PaymentsRequest> for Co
authentication: None,
recurring_details,
poll_config: None,
+ tax_data: None,
};
let customer_details = Some(CustomerDetails {
diff --git a/crates/router/src/core/payments/operations/payment_confirm.rs b/crates/router/src/core/payments/operations/payment_confirm.rs
index 3edefd2946..35df8a61f7 100644
--- a/crates/router/src/core/payments/operations/payment_confirm.rs
+++ b/crates/router/src/core/payments/operations/payment_confirm.rs
@@ -722,6 +722,7 @@ impl<F: Send + Clone> GetTracker<F, PaymentData<F>, api::PaymentsRequest> for Pa
authentication: None,
recurring_details,
poll_config: None,
+ tax_data: None,
};
let get_trackers_response = operations::GetTrackerResponse {
@@ -1382,6 +1383,7 @@ impl<F: Clone> UpdateTracker<F, PaymentData<F>, api::PaymentsRequest> for Paymen
billing_details,
shipping_details,
is_payment_processor_token_flow,
+ tax_details: None,
})),
&m_key_store,
storage_scheme,
diff --git a/crates/router/src/core/payments/operations/payment_create.rs b/crates/router/src/core/payments/operations/payment_create.rs
index 6c0b748fc4..257a3156bb 100644
--- a/crates/router/src/core/payments/operations/payment_create.rs
+++ b/crates/router/src/core/payments/operations/payment_create.rs
@@ -7,7 +7,7 @@ use api_models::{
use async_trait::async_trait;
use common_utils::{
ext_traits::{AsyncExt, Encode, ValueExt},
- types::MinorUnit,
+ types::{keymanager::KeyManagerState, MinorUnit},
};
use diesel_models::ephemeral_key;
use error_stack::{self, ResultExt};
@@ -38,7 +38,8 @@ use crate::{
},
services,
types::{
- api::{self, PaymentIdTypeExt},
+ self,
+ api::{self, ConnectorCallType, PaymentIdTypeExt},
domain,
storage::{
self,
@@ -532,6 +533,7 @@ impl<F: Send + Clone> GetTracker<F, PaymentData<F>, api::PaymentsRequest> for Pa
authentication: None,
recurring_details,
poll_config: None,
+ tax_data: None,
};
let get_trackers_response = operations::GetTrackerResponse {
@@ -575,6 +577,106 @@ impl<F: Clone + Send> Domain<F, api::PaymentsRequest> for PaymentCreate {
.await
}
+ async fn payments_dynamic_tax_calculation<'a>(
+ &'a self,
+ state: &SessionState,
+ payment_data: &mut PaymentData<F>,
+ _should_continue_confirm_transaction: &mut bool,
+ _connector_call_type: &ConnectorCallType,
+ business_profile: &domain::BusinessProfile,
+ key_store: &domain::MerchantKeyStore,
+ merchant_account: &domain::MerchantAccount,
+ ) -> CustomResult<(), errors::ApiErrorResponse> {
+ if business_profile.is_tax_connector_enabled {
+ let db = state.store.as_ref();
+
+ let key_manager_state: &KeyManagerState = &state.into();
+
+ let merchant_connector_id = business_profile
+ .tax_connector_id
+ .as_ref()
+ .get_required_value("business_profile.tax_connector_id")?;
+
+ #[cfg(feature = "v1")]
+ let mca = db
+ .find_by_merchant_connector_account_merchant_id_merchant_connector_id(
+ key_manager_state,
+ &business_profile.merchant_id,
+ merchant_connector_id,
+ key_store,
+ )
+ .await
+ .to_not_found_response(
+ errors::ApiErrorResponse::MerchantConnectorAccountNotFound {
+ id: merchant_connector_id.get_string_repr().to_string(),
+ },
+ )?;
+
+ #[cfg(feature = "v2")]
+ let mca = db
+ .find_merchant_connector_account_by_id(
+ key_manager_state,
+ merchant_connector_id,
+ key_store,
+ )
+ .await
+ .to_not_found_response(
+ errors::ApiErrorResponse::MerchantConnectorAccountNotFound {
+ id: merchant_connector_id.get_string_repr().to_string(),
+ },
+ )?;
+
+ let connector_data =
+ api::TaxCalculateConnectorData::get_connector_by_name(&mca.connector_name)?;
+
+ let router_data = core_utils::construct_payments_dynamic_tax_calculation_router_data(
+ state,
+ merchant_account,
+ key_store,
+ payment_data,
+ &mca,
+ )
+ .await?;
+ let connector_integration: services::BoxedPaymentConnectorIntegrationInterface<
+ api::CalculateTax,
+ types::PaymentsTaxCalculationData,
+ types::TaxCalculationResponseData,
+ > = connector_data.connector.get_connector_integration();
+
+ let response = services::execute_connector_processing_step(
+ state,
+ connector_integration,
+ &router_data,
+ payments::CallConnectorAction::Trigger,
+ None,
+ )
+ .await
+ .change_context(errors::ApiErrorResponse::InternalServerError)
+ .attach_printable("Tax connector Response Failed")?;
+
+ let tax_response = response.response.map_err(|err| {
+ errors::ApiErrorResponse::ExternalConnectorError {
+ code: err.code,
+ message: err.message,
+ connector: connector_data.connector_name.clone().to_string(),
+ status_code: err.status_code,
+ reason: err.reason,
+ }
+ })?;
+
+ payment_data.payment_intent.tax_details = Some(diesel_models::TaxDetails {
+ default: Some(diesel_models::DefaultTax {
+ order_tax_amount: tax_response.order_tax_amount,
+ }),
+ payment_method_type: None,
+ });
+
+ Ok(())
+ } else {
+ Ok(())
+ }
+ }
+
#[instrument(skip_all)]
async fn make_pm_data<'a>(
&'a self,
@@ -1234,6 +1336,8 @@ impl PaymentCreate {
shipping_details,
is_payment_processor_token_flow,
organization_id: merchant_account.organization_id.clone(),
+ shipping_cost: request.shipping_cost,
+ tax_details: None,
})
}
diff --git a/crates/router/src/core/payments/operations/payment_reject.rs b/crates/router/src/core/payments/operations/payment_reject.rs
index 928d69dc1c..6cdc4caf87 100644
--- a/crates/router/src/core/payments/operations/payment_reject.rs
+++ b/crates/router/src/core/payments/operations/payment_reject.rs
@@ -180,6 +180,7 @@ impl<F: Send + Clone> GetTracker<F, PaymentData<F>, PaymentsCancelRequest> for P
authentication: None,
recurring_details: None,
poll_config: None,
+ tax_data: None,
};
let get_trackers_response = operations::GetTrackerResponse {
diff --git a/crates/router/src/core/payments/operations/payment_response.rs b/crates/router/src/core/payments/operations/payment_response.rs
index 675c64aeb9..548e9b1be8 100644
--- a/crates/router/src/core/payments/operations/payment_response.rs
+++ b/crates/router/src/core/payments/operations/payment_response.rs
@@ -45,7 +45,7 @@ use crate::{
#[derive(Debug, Clone, Copy, router_derive::PaymentOperation)]
#[operation(
operations = "post_update_tracker",
- flow = "sync_data, cancel_data, authorize_data, capture_data, complete_authorize_data, approve_data, reject_data, setup_mandate_data, session_data,incremental_authorization_data"
+ flow = "sync_data, cancel_data, authorize_data, capture_data, complete_authorize_data, approve_data, reject_data, setup_mandate_data, session_data,incremental_authorization_data, sdk_session_update_data"
)]
pub struct PaymentResponse;
@@ -489,6 +489,79 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsSessionData>
}
}
+#[async_trait]
+impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::SdkPaymentsSessionUpdateData>
+ for PaymentResponse
+{
+ async fn update_tracker<'b>(
+ &'b self,
+ _db: &'b SessionState,
+ _payment_id: &api::PaymentIdType,
+ payment_data: PaymentData<F>,
+ _router_data: types::RouterData<
+ F,
+ types::SdkPaymentsSessionUpdateData,
+ types::PaymentsResponseData,
+ >,
+ _key_store: &domain::MerchantKeyStore,
+ _storage_scheme: enums::MerchantStorageScheme,
+ _locale: &Option<String>,
+ ) -> RouterResult<PaymentData<F>>
+ where
+ F: 'b + Send,
+ {
+ // let session_update_details =
+ // payment_data
+ // .payment_intent
+ // .tax_details
+ // .clone()
+ // .ok_or_else(|| {
+ // report!(errors::ApiErrorResponse::InternalServerError)
+ // .attach_printable("missing tax_details in payment_intent")
+ // })?;
+
+ // let pmt_amount = session_update_details
+ // .pmt
+ // .clone()
+ // .map(|pmt| pmt.order_tax_amount)
+ // .ok_or(errors::ApiErrorResponse::InternalServerError)
+ // .attach_printable("Missing tax_details.order_tax_amount")?;
+
+ // let total_amount = MinorUnit::from(payment_data.amount) + pmt_amount;
+
+ // // if connector_ call successful -> payment_intent.amount update
+ // match router_data.response.clone() {
+ // Err(_) => (None, None),
+ // Ok(types::PaymentsResponseData::SessionUpdateResponse { status }) => {
+ // if status == SessionUpdateStatus::Success {
+ // (
+ // Some(
+ // storage::PaymentAttemptUpdate::IncrementalAuthorizationAmountUpdate {
+ // amount: total_amount,
+ // amount_capturable: total_amount,
+ // },
+ // ),
+ // Some(
+ // storage::PaymentIntentUpdate::IncrementalAuthorizationAmountUpdate {
+ // amount: pmt_amount,
+ // },
+ // ),
+ // )
+ // } else {
+ // (None, None)
+ // }
+ // }
+ // _ => Err(errors::ApiErrorResponse::InternalServerError)
+ // .attach_printable("unexpected response in session_update flow")?,
+ // };
+
+ // let _shipping_address = payment_data.address.get_shipping();
+ // let _amount = payment_data.amount;
+
+ Ok(payment_data)
+ }
+}
+
#[async_trait]
impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::PaymentsCaptureData>
for PaymentResponse
@@ -1178,6 +1251,7 @@ async fn payment_response_update_tracker<F: Clone, T: types::Capturable>(
types::PaymentsResponseData::IncrementalAuthorizationResponse {
..
} => (None, None),
+ // types::PaymentsResponseData::SessionUpdateResponse { .. } => (None, None),
types::PaymentsResponseData::MultipleCaptureResponse {
capture_sync_response_list,
} => match payment_data.multiple_capture_data {
diff --git a/crates/router/src/core/payments/operations/payment_session.rs b/crates/router/src/core/payments/operations/payment_session.rs
index a5c27b2042..251f23ad9e 100644
--- a/crates/router/src/core/payments/operations/payment_session.rs
+++ b/crates/router/src/core/payments/operations/payment_session.rs
@@ -205,6 +205,7 @@ impl<F: Send + Clone> GetTracker<F, PaymentData<F>, api::PaymentsSessionRequest>
authentication: None,
recurring_details: None,
poll_config: None,
+ tax_data: None,
};
let get_trackers_response = operations::GetTrackerResponse {
diff --git a/crates/router/src/core/payments/operations/payment_start.rs b/crates/router/src/core/payments/operations/payment_start.rs
index 2304ab1256..814712396a 100644
--- a/crates/router/src/core/payments/operations/payment_start.rs
+++ b/crates/router/src/core/payments/operations/payment_start.rs
@@ -190,6 +190,7 @@ impl<F: Send + Clone> GetTracker<F, PaymentData<F>, api::PaymentsStartRequest> f
authentication: None,
recurring_details: None,
poll_config: None,
+ tax_data: None,
};
let get_trackers_response = operations::GetTrackerResponse {
diff --git a/crates/router/src/core/payments/operations/payment_status.rs b/crates/router/src/core/payments/operations/payment_status.rs
index 85dab242de..a2f68a9de3 100644
--- a/crates/router/src/core/payments/operations/payment_status.rs
+++ b/crates/router/src/core/payments/operations/payment_status.rs
@@ -468,6 +468,7 @@ async fn get_tracker_for_sync<
authentication,
recurring_details: None,
poll_config: None,
+ tax_data: None,
};
let get_trackers_response = operations::GetTrackerResponse {
diff --git a/crates/router/src/core/payments/operations/payment_update.rs b/crates/router/src/core/payments/operations/payment_update.rs
index e42f0ccdfd..3a21475c64 100644
--- a/crates/router/src/core/payments/operations/payment_update.rs
+++ b/crates/router/src/core/payments/operations/payment_update.rs
@@ -7,6 +7,7 @@ use async_trait::async_trait;
use common_utils::{
ext_traits::{AsyncExt, Encode, ValueExt},
pii::Email,
+ types::keymanager::KeyManagerState,
};
use error_stack::{report, ResultExt};
use hyperswitch_domain_models::payments::payment_intent::{
@@ -22,11 +23,13 @@ use crate::{
mandate::helpers as m_helpers,
payment_methods::cards::create_encrypted_data,
payments::{self, helpers, operations, CustomerDetails, PaymentAddress, PaymentData},
+ utils as core_utils,
},
routes::{app::ReqState, SessionState},
services,
types::{
- api::{self, PaymentIdTypeExt},
+ self,
+ api::{self, ConnectorCallType, PaymentIdTypeExt},
domain,
storage::{self, enums as storage_enums, payment_attempt::PaymentAttemptExt},
transformers::ForeignTryFrom,
@@ -471,6 +474,7 @@ impl<F: Send + Clone> GetTracker<F, PaymentData<F>, api::PaymentsRequest> for Pa
authentication: None,
recurring_details,
poll_config: None,
+ tax_data: None,
};
let get_trackers_response = operations::GetTrackerResponse {
@@ -514,6 +518,105 @@ impl<F: Clone + Send> Domain<F, api::PaymentsRequest> for PaymentUpdate {
.await
}
+ async fn payments_dynamic_tax_calculation<'a>(
+ &'a self,
+ state: &SessionState,
+ payment_data: &mut PaymentData<F>,
+ _should_continue_confirm_transaction: &mut bool,
+ _connector_call_type: &ConnectorCallType,
+ business_profile: &domain::BusinessProfile,
+ key_store: &domain::MerchantKeyStore,
+ merchant_account: &domain::MerchantAccount,
+ ) -> CustomResult<(), errors::ApiErrorResponse> {
+ if business_profile.is_tax_connector_enabled {
+ let db = state.store.as_ref();
+ let key_manager_state: &KeyManagerState = &state.into();
+
+ let merchant_connector_id = business_profile
+ .tax_connector_id
+ .as_ref()
+ .get_required_value("business_profile.tax_connector_id")?;
+
+ #[cfg(feature = "v1")]
+ let mca = db
+ .find_by_merchant_connector_account_merchant_id_merchant_connector_id(
+ key_manager_state,
+ &business_profile.merchant_id,
+ merchant_connector_id,
+ key_store,
+ )
+ .await
+ .to_not_found_response(
+ errors::ApiErrorResponse::MerchantConnectorAccountNotFound {
+ id: merchant_connector_id.get_string_repr().to_string(),
+ },
+ )?;
+
+ #[cfg(feature = "v2")]
+ let mca = db
+ .find_merchant_connector_account_by_id(
+ key_manager_state,
+ merchant_connector_id,
+ key_store,
+ )
+ .await
+ .to_not_found_response(
+ errors::ApiErrorResponse::MerchantConnectorAccountNotFound {
+ id: merchant_connector_id.get_string_repr().to_string(),
+ },
+ )?;
+
+ let connector_data =
+ api::TaxCalculateConnectorData::get_connector_by_name(&mca.connector_name)?;
+
+ let router_data = core_utils::construct_payments_dynamic_tax_calculation_router_data(
+ state,
+ merchant_account,
+ key_store,
+ payment_data,
+ &mca,
+ )
+ .await?;
+ let connector_integration: services::BoxedPaymentConnectorIntegrationInterface<
+ api::CalculateTax,
+ types::PaymentsTaxCalculationData,
+ types::TaxCalculationResponseData,
+ > = connector_data.connector.get_connector_integration();
+
+ let response = services::execute_connector_processing_step(
+ state,
+ connector_integration,
+ &router_data,
+ payments::CallConnectorAction::Trigger,
+ None,
+ )
+ .await
+ .change_context(errors::ApiErrorResponse::InternalServerError)
+ .attach_printable("Tax connector Response Failed")?;
+
+ let tax_response = response.response.map_err(|err| {
+ errors::ApiErrorResponse::ExternalConnectorError {
+ code: err.code,
+ message: err.message,
+ connector: connector_data.connector_name.clone().to_string(),
+ status_code: err.status_code,
+ reason: err.reason,
+ }
+ })?;
+
+ payment_data.payment_intent.tax_details = Some(diesel_models::TaxDetails {
+ default: Some(diesel_models::DefaultTax {
+ order_tax_amount: tax_response.order_tax_amount,
+ }),
+ payment_method_type: None,
+ });
+
+ Ok(())
+ } else {
+ Ok(())
+ }
+ }
+
#[instrument(skip_all)]
async fn make_pm_data<'a>(
&'a self,
@@ -792,6 +895,7 @@ impl<F: Clone> UpdateTracker<F, PaymentData<F>, api::PaymentsRequest> for Paymen
billing_details,
shipping_details,
is_payment_processor_token_flow: None,
+ tax_details: None,
})),
key_store,
storage_scheme,
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 72ae1d6190..957282cea1 100644
--- a/crates/router/src/core/payments/operations/payments_incremental_authorization.rs
+++ b/crates/router/src/core/payments/operations/payments_incremental_authorization.rs
@@ -158,6 +158,7 @@ impl<F: Send + Clone>
authentication: None,
recurring_details: None,
poll_config: None,
+ tax_data: None,
};
let get_trackers_response = operations::GetTrackerResponse {
diff --git a/crates/router/src/core/payments/operations/tax_calculation.rs b/crates/router/src/core/payments/operations/tax_calculation.rs
new file mode 100644
index 0000000000..eec35f79b9
--- /dev/null
+++ b/crates/router/src/core/payments/operations/tax_calculation.rs
@@ -0,0 +1,452 @@
+use std::marker::PhantomData;
+
+use api_models::enums::FrmSuggestion;
+use async_trait::async_trait;
+use common_utils::{ext_traits::AsyncExt, types::keymanager::KeyManagerState};
+use error_stack::ResultExt;
+use masking::PeekInterface;
+use router_derive::PaymentOperation;
+use router_env::{instrument, tracing};
+
+use super::{BoxedOperation, Domain, GetTracker, Operation, UpdateTracker, ValidateRequest};
+use crate::{
+ core::{
+ errors::{self, RouterResult, StorageErrorExt},
+ payment_methods::cards::create_encrypted_data,
+ payments::{self, helpers, operations, PaymentData},
+ utils as core_utils,
+ },
+ routes::{app::ReqState, SessionState},
+ services,
+ types::{
+ self,
+ api::{self, ConnectorCallType, PaymentIdTypeExt},
+ domain,
+ storage::{self, enums as storage_enums},
+ },
+ utils::OptionExt,
+};
+
+#[derive(Debug, Clone, Copy, PaymentOperation)]
+#[operation(operations = "all", flow = "sdk_session_update")]
+pub struct PaymentSessionUpdate;
+
+#[async_trait]
+impl<F: Send + Clone> GetTracker<F, PaymentData<F>, api::PaymentsDynamicTaxCalculationRequest>
+ for PaymentSessionUpdate
+{
+ #[instrument(skip_all)]
+ async fn get_trackers<'a>(
+ &'a self,
+ state: &'a SessionState,
+ payment_id: &api::PaymentIdType,
+ request: &api::PaymentsDynamicTaxCalculationRequest,
+ merchant_account: &domain::MerchantAccount,
+ key_store: &domain::MerchantKeyStore,
+ _auth_flow: services::AuthFlow,
+ _header_payload: &api::HeaderPayload,
+ ) -> RouterResult<
+ operations::GetTrackerResponse<'a, F, api::PaymentsDynamicTaxCalculationRequest>,
+ > {
+ let payment_id = payment_id
+ .get_payment_intent_id()
+ .change_context(errors::ApiErrorResponse::PaymentNotFound)?;
+
+ let db = &*state.store;
+ let key_manager_state: &KeyManagerState = &state.into();
+ let merchant_id = merchant_account.get_id();
+ let storage_scheme = merchant_account.storage_scheme;
+
+ let payment_intent = db
+ .find_payment_intent_by_payment_id_merchant_id(
+ &state.into(),
+ &payment_id,
+ merchant_id,
+ key_store,
+ storage_scheme,
+ )
+ .await
+ .to_not_found_response(errors::ApiErrorResponse::PaymentNotFound)?;
+
+ helpers::validate_payment_status_against_not_allowed_statuses(
+ &payment_intent.status,
+ &[
+ storage_enums::IntentStatus::Failed,
+ storage_enums::IntentStatus::Succeeded,
+ ],
+ "create a session update for",
+ )?;
+
+ helpers::authenticate_client_secret(Some(request.client_secret.peek()), &payment_intent)?;
+
+ let mut payment_attempt = db
+ .find_payment_attempt_by_payment_id_merchant_id_attempt_id(
+ &payment_intent.payment_id,
+ merchant_id,
+ payment_intent.active_attempt.get_id().as_str(),
+ storage_scheme,
+ )
+ .await
+ .to_not_found_response(errors::ApiErrorResponse::PaymentNotFound)?;
+
+ let currency = payment_intent.currency.get_required_value("currency")?;
+
+ let amount = payment_attempt.get_total_amount().into();
+
+ payment_attempt.payment_method_type = Some(request.payment_method_type);
+
+ let shipping_address = helpers::get_address_by_id(
+ state,
+ payment_intent.shipping_address_id.clone(),
+ key_store,
+ &payment_intent.payment_id,
+ merchant_id,
+ merchant_account.storage_scheme,
+ )
+ .await?;
+
+ let profile_id = payment_intent
+ .profile_id
+ .as_ref()
+ .get_required_value("profile_id")
+ .change_context(errors::ApiErrorResponse::InternalServerError)
+ .attach_printable("'profile_id' not set in payment intent")?;
+
+ let business_profile = db
+ .find_business_profile_by_profile_id(key_manager_state, key_store, profile_id)
+ .await
+ .to_not_found_response(errors::ApiErrorResponse::BusinessProfileNotFound {
+ id: profile_id.get_string_repr().to_owned(),
+ })?;
+
+ let tax_data = payments::TaxData {
+ shipping_details: request.shipping.clone(),
+ payment_method_type: request.payment_method_type,
+ };
+
+ let payment_data = PaymentData {
+ flow: PhantomData,
+ payment_intent,
+ payment_attempt,
+ currency,
+ amount,
+ email: None,
+ mandate_id: None,
+ mandate_connector: None,
+ customer_acceptance: None,
+ token: None,
+ token_data: None,
+ setup_mandate: None,
+ address: payments::PaymentAddress::new(
+ shipping_address.as_ref().map(From::from),
+ None,
+ None,
+ business_profile.use_billing_as_payment_method_billing,
+ ),
+ confirm: None,
+ payment_method_data: None,
+ payment_method_info: None,
+ force_sync: None,
+ refunds: vec![],
+ disputes: vec![],
+ attempts: None,
+ sessions_token: vec![],
+ card_cvc: None,
+ creds_identifier: None,
+ pm_token: None,
+ connector_customer_id: None,
+ recurring_mandate_payment_data: None,
+ ephemeral_key: None,
+ multiple_capture_data: None,
+ redirect_response: None,
+ surcharge_details: None,
+ frm_message: None,
+ payment_link_data: None,
+ incremental_authorization_details: None,
+ authorizations: vec![],
+ authentication: None,
+ recurring_details: None,
+ poll_config: None,
+ tax_data: Some(tax_data),
+ };
+ let get_trackers_response = operations::GetTrackerResponse {
+ operation: Box::new(self),
+ customer_details: None,
+ payment_data,
+ business_profile,
+ mandate_type: None,
+ };
+
+ Ok(get_trackers_response)
+ }
+}
+
+#[async_trait]
+impl<F: Clone + Send> Domain<F, api::PaymentsDynamicTaxCalculationRequest>
+ for PaymentSessionUpdate
+{
+ #[instrument(skip_all)]
+ async fn get_or_create_customer_details<'a>(
+ &'a self,
+ _state: &SessionState,
+ _payment_data: &mut PaymentData<F>,
+ _request: Option<payments::CustomerDetails>,
+ _merchant_key_store: &domain::MerchantKeyStore,
+ _storage_scheme: storage_enums::MerchantStorageScheme,
+ ) -> errors::CustomResult<
+ (
+ BoxedOperation<'a, F, api::PaymentsDynamicTaxCalculationRequest>,
+ Option<domain::Customer>,
+ ),
+ errors::StorageError,
+ > {
+ Ok((Box::new(self), None))
+ }
+
+ async fn payments_dynamic_tax_calculation<'a>(
+ &'a self,
+ state: &SessionState,
+ payment_data: &mut PaymentData<F>,
+ should_continue_confirm_transaction: &mut bool,
+ _connector_call_type: &ConnectorCallType,
+ business_profile: &domain::BusinessProfile,
+ key_store: &domain::MerchantKeyStore,
+ merchant_account: &domain::MerchantAccount,
+ ) -> errors::CustomResult<(), errors::ApiErrorResponse> {
+ if business_profile.is_tax_connector_enabled {
+ *should_continue_confirm_transaction = false;
+ let db = state.store.as_ref();
+ let key_manager_state: &KeyManagerState = &state.into();
+
+ let merchant_connector_id = business_profile
+ .tax_connector_id
+ .as_ref()
+ .get_required_value("business_profile.tax_connector_id")?;
+
+ #[cfg(feature = "v1")]
+ let mca = db
+ .find_by_merchant_connector_account_merchant_id_merchant_connector_id(
+ key_manager_state,
+ &business_profile.merchant_id,
+ merchant_connector_id,
+ key_store,
+ )
+ .await
+ .to_not_found_response(
+ errors::ApiErrorResponse::MerchantConnectorAccountNotFound {
+ id: merchant_connector_id.get_string_repr().to_string(),
+ },
+ )?;
+
+ #[cfg(feature = "v2")]
+ let mca = db
+ .find_merchant_connector_account_by_id(
+ key_manager_state,
+ merchant_connector_id,
+ key_store,
+ )
+ .await
+ .to_not_found_response(
+ errors::ApiErrorResponse::MerchantConnectorAccountNotFound {
+ id: merchant_connector_id.get_string_repr().to_string(),
+ },
+ )?;
+
+ let connector_data =
+ api::TaxCalculateConnectorData::get_connector_by_name(&mca.connector_name)?;
+
+ let router_data = core_utils::construct_payments_dynamic_tax_calculation_router_data(
+ state,
+ merchant_account,
+ key_store,
+ payment_data,
+ &mca,
+ )
+ .await?;
+ let connector_integration: services::BoxedPaymentConnectorIntegrationInterface<
+ api::CalculateTax,
+ types::PaymentsTaxCalculationData,
+ types::TaxCalculationResponseData,
+ > = connector_data.connector.get_connector_integration();
+
+ let response = services::execute_connector_processing_step(
+ state,
+ connector_integration,
+ &router_data,
+ payments::CallConnectorAction::Trigger,
+ None,
+ )
+ .await
+ .change_context(errors::ApiErrorResponse::InternalServerError)
+ .attach_printable("Tax connector Response Failed")?;
+
+ let tax_response = response.response.map_err(|err| {
+ errors::ApiErrorResponse::ExternalConnectorError {
+ code: err.code,
+ message: err.message,
+ connector: connector_data.connector_name.clone().to_string(),
+ status_code: err.status_code,
+ reason: err.reason,
+ }
+ })?;
+
+ let payment_method_type = payment_data
+ .tax_data
+ .clone()
+ .map(|tax_data| tax_data.payment_method_type)
+ .ok_or(errors::ApiErrorResponse::InternalServerError)
+ .attach_printable("missing tax_data.payment_method_type")?;
+
+ payment_data.payment_intent.tax_details = Some(diesel_models::TaxDetails {
+ payment_method_type: Some(diesel_models::PaymentMethodTypeTax {
+ order_tax_amount: tax_response.order_tax_amount,
+ pmt: payment_method_type,
+ }),
+ default: None,
+ });
+ Ok(())
+ } else {
+ Ok(())
+ }
+ }
+
+ #[instrument(skip_all)]
+ async fn make_pm_data<'a>(
+ &'a self,
+ _state: &'a SessionState,
+ _payment_data: &mut PaymentData<F>,
+ _storage_scheme: storage_enums::MerchantStorageScheme,
+ _merchant_key_store: &domain::MerchantKeyStore,
+ _customer: &Option<domain::Customer>,
+ _business_profile: Option<&domain::BusinessProfile>,
+ ) -> RouterResult<(
+ BoxedOperation<'a, F, api::PaymentsDynamicTaxCalculationRequest>,
+ Option<domain::PaymentMethodData>,
+ Option<String>,
+ )> {
+ Ok((Box::new(self), None, None))
+ }
+
+ async fn get_connector<'a>(
+ &'a self,
+ _merchant_account: &domain::MerchantAccount,
+ state: &SessionState,
+ _request: &api::PaymentsDynamicTaxCalculationRequest,
+ _payment_intent: &storage::PaymentIntent,
+ _merchant_key_store: &domain::MerchantKeyStore,
+ ) -> errors::CustomResult<api::ConnectorChoice, errors::ApiErrorResponse> {
+ helpers::get_connector_default(state, None).await
+ }
+
+ #[instrument(skip_all)]
+ async fn guard_payment_against_blocklist<'a>(
+ &'a self,
+ _state: &SessionState,
+ _merchant_account: &domain::MerchantAccount,
+ _key_store: &domain::MerchantKeyStore,
+ _payment_data: &mut PaymentData<F>,
+ ) -> errors::CustomResult<bool, errors::ApiErrorResponse> {
+ Ok(false)
+ }
+}
+
+#[async_trait]
+impl<F: Clone> UpdateTracker<F, PaymentData<F>, api::PaymentsDynamicTaxCalculationRequest>
+ for PaymentSessionUpdate
+{
+ #[instrument(skip_all)]
+ async fn update_trackers<'b>(
+ &'b self,
+ state: &'b SessionState,
+ _req_state: ReqState,
+ mut payment_data: PaymentData<F>,
+ _customer: Option<domain::Customer>,
+ storage_scheme: storage_enums::MerchantStorageScheme,
+ _updated_customer: Option<storage::CustomerUpdate>,
+ key_store: &domain::MerchantKeyStore,
+ _frm_suggestion: Option<FrmSuggestion>,
+ _header_payload: api::HeaderPayload,
+ ) -> RouterResult<(
+ BoxedOperation<'b, F, api::PaymentsDynamicTaxCalculationRequest>,
+ PaymentData<F>,
+ )>
+ where
+ F: 'b + Send,
+ {
+ let shipping_address = payment_data
+ .tax_data
+ .clone()
+ .map(|tax_data| tax_data.shipping_details);
+
+ let shipping_details = shipping_address
+ .clone()
+ .async_map(|shipping_details| create_encrypted_data(state, key_store, shipping_details))
+ .await
+ .transpose()
+ .change_context(errors::ApiErrorResponse::InternalServerError)
+ .attach_printable("Unable to encrypt shipping details")?;
+
+ let shipping_address = helpers::create_or_update_address_for_payment_by_request(
+ state,
+ shipping_address.as_ref(),
+ payment_data.payment_intent.shipping_address_id.as_deref(),
+ &payment_data.payment_intent.merchant_id,
+ payment_data.payment_intent.customer_id.as_ref(),
+ key_store,
+ &payment_data.payment_intent.payment_id,
+ storage_scheme,
+ )
+ .await?;
+
+ let payment_intent_update = hyperswitch_domain_models::payments::payment_intent::PaymentIntentUpdate::SessionResponseUpdate {
+ tax_details: payment_data.payment_intent.tax_details.clone().ok_or(errors::ApiErrorResponse::InternalServerError).attach_printable("payment_intent.tax_details not found")?,
+ shipping_address_id: shipping_address.map(|address| address.address_id),
+ updated_by: payment_data.payment_intent.updated_by.clone(),
+ shipping_details,
+ };
+
+ let db = &*state.store;
+ let payment_intent = payment_data.payment_intent.clone();
+
+ let updated_payment_intent = db
+ .update_payment_intent(
+ &state.into(),
+ payment_intent,
+ payment_intent_update,
+ key_store,
+ storage_scheme,
+ )
+ .await
+ .to_not_found_response(errors::ApiErrorResponse::PaymentNotFound)?;
+
+ payment_data.payment_intent = updated_payment_intent;
+ Ok((Box::new(self), payment_data))
+ }
+}
+
+impl<F: Send + Clone> ValidateRequest<F, api::PaymentsDynamicTaxCalculationRequest>
+ for PaymentSessionUpdate
+{
+ #[instrument(skip_all)]
+ fn validate_request<'a, 'b>(
+ &'b self,
+ request: &api::PaymentsDynamicTaxCalculationRequest,
+ merchant_account: &'a domain::MerchantAccount,
+ ) -> RouterResult<(
+ BoxedOperation<'b, F, api::PaymentsDynamicTaxCalculationRequest>,
+ operations::ValidateResult,
+ )> {
+ //paymentid is already generated and should be sent in the request
+ let given_payment_id = request.payment_id.clone();
+
+ Ok((
+ Box::new(self),
+ operations::ValidateResult {
+ merchant_id: merchant_account.get_id().to_owned(),
+ payment_id: api::PaymentIdType::PaymentIntentId(given_payment_id),
+ storage_scheme: merchant_account.storage_scheme,
+ requeue: false,
+ },
+ ))
+ }
+}
diff --git a/crates/router/src/core/payments/transformers.rs b/crates/router/src/core/payments/transformers.rs
index a41205a496..2bcc80f2e8 100644
--- a/crates/router/src/core/payments/transformers.rs
+++ b/crates/router/src/core/payments/transformers.rs
@@ -35,6 +35,121 @@ use crate::{
utils::{OptionExt, ValueExt},
};
+pub async fn construct_router_data_to_update_calculated_tax<'a, F, T>(
+ state: &'a SessionState,
+ payment_data: PaymentData<F>,
+ connector_id: &str,
+ merchant_account: &domain::MerchantAccount,
+ _key_store: &domain::MerchantKeyStore,
+ customer: &'a Option<domain::Customer>,
+ merchant_connector_account: &helpers::MerchantConnectorAccountType,
+) -> RouterResult<types::RouterData<F, T, types::PaymentsResponseData>>
+where
+ T: TryFrom<PaymentAdditionalData<'a, F>>,
+ types::RouterData<F, T, types::PaymentsResponseData>: Feature<F, T>,
+ F: Clone,
+ error_stack::Report<errors::ApiErrorResponse>:
+ From<<T as TryFrom<PaymentAdditionalData<'a, F>>>::Error>,
+{
+ fp_utils::when(merchant_connector_account.is_disabled(), || {
+ Err(errors::ApiErrorResponse::MerchantConnectorAccountDisabled)
+ })?;
+
+ let test_mode = merchant_connector_account.is_test_mode_on();
+
+ let auth_type: types::ConnectorAuthType = merchant_connector_account
+ .get_connector_account_details()
+ .parse_value("ConnectorAuthType")
+ .change_context(errors::ApiErrorResponse::InternalServerError)
+ .attach_printable("Failed while parsing value for ConnectorAuthType")?;
+
+ let resource_id = match payment_data
+ .payment_attempt
+ .connector_transaction_id
+ .clone()
+ {
+ Some(id) => types::ResponseId::ConnectorTransactionId(id),
+ None => types::ResponseId::NoResponseId,
+ };
+
+ // [#44]: why should response be filled during request
+ let response = Ok(types::PaymentsResponseData::TransactionResponse {
+ resource_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,
+ });
+ let additional_data = PaymentAdditionalData {
+ router_base_url: state.base_url.clone(),
+ connector_name: connector_id.to_string(),
+ payment_data: payment_data.clone(),
+ state,
+ customer_data: customer,
+ };
+
+ let router_data = types::RouterData {
+ flow: PhantomData,
+ merchant_id: merchant_account.get_id().clone(),
+ customer_id: None,
+ connector: connector_id.to_owned(),
+ payment_id: payment_data
+ .payment_attempt
+ .payment_id
+ .get_string_repr()
+ .to_owned(),
+ attempt_id: payment_data.payment_attempt.attempt_id.clone(),
+ status: payment_data.payment_attempt.status,
+ payment_method: diesel_models::enums::PaymentMethod::default(),
+ connector_auth_type: auth_type,
+ description: None,
+ return_url: None,
+ address: payment_data.address.clone(),
+ auth_type: payment_data
+ .payment_attempt
+ .authentication_type
+ .unwrap_or_default(),
+ connector_meta_data: None,
+ connector_wallets_details: None,
+ request: T::try_from(additional_data)?,
+ response,
+ amount_captured: None,
+ minor_amount_captured: None,
+ access_token: None,
+ session_token: None,
+ reference_id: None,
+ payment_method_status: None,
+ payment_method_token: None,
+ connector_customer: None,
+ recurring_mandate_payment_data: None,
+ connector_request_reference_id: core_utils::get_connector_request_reference_id(
+ &state.conf,
+ merchant_account.get_id(),
+ &payment_data.payment_attempt,
+ ),
+ preprocessing_id: None,
+ #[cfg(feature = "payouts")]
+ payout_method_data: None,
+ #[cfg(feature = "payouts")]
+ quote_id: None,
+ test_mode,
+ payment_method_balance: None,
+ connector_api_version: None,
+ connector_http_status_code: None,
+ external_latency: None,
+ apple_pay_flow: None,
+ frm_metadata: None,
+ refund_id: None,
+ dispute_id: None,
+ connector_response: None,
+ integrity_check: Ok(()),
+ };
+ Ok(router_data)
+}
+
#[cfg(all(feature = "v2", feature = "customer_v2"))]
#[instrument(skip_all)]
#[allow(clippy::too_many_arguments)]
@@ -350,6 +465,43 @@ where
}
}
+impl<F, Op> ToResponse<PaymentData<F>, Op> for api::PaymentsDynamicTaxCalculationResponse
+where
+ F: Clone,
+ Op: Debug,
+{
+ #[allow(clippy::too_many_arguments)]
+ fn generate_response(
+ payment_data: PaymentData<F>,
+ _customer: Option<domain::Customer>,
+ _auth_flow: services::AuthFlow,
+ _base_url: &str,
+ _operation: Op,
+ _connector_request_reference_id_config: &ConnectorRequestReferenceIdConfig,
+ _connector_http_status_code: Option<u16>,
+ _external_latency: Option<u128>,
+ _is_latency_header_enabled: Option<bool>,
+ ) -> RouterResponse<Self> {
+ let mut amount = payment_data.payment_intent.amount;
+ let shipping_cost = payment_data.payment_intent.shipping_cost;
+ let order_tax_amount = payment_data
+ .payment_intent
+ .tax_details
+ .clone()
+ .and_then(|tax| tax.payment_method_type.map(|a| a.order_tax_amount));
+ if let Some(shipping_cost) = shipping_cost {
+ amount = amount + shipping_cost;
+ }
+ if let Some(order_tax_amount) = order_tax_amount {
+ amount = amount + order_tax_amount;
+ }
+ Ok(services::ApplicationResponse::JsonWithHeaders((
+ Self { net_amount: amount },
+ vec![],
+ )))
+ }
+}
+
impl<F, Op> ToResponse<PaymentData<F>, Op> for api::VerifyResponse
where
F: Clone,
@@ -1297,6 +1449,7 @@ pub fn change_order_details_to_new_type(
sub_category: order_details.sub_category,
brand: order_details.brand,
product_type: order_details.product_type,
+ product_tax_code: order_details.product_tax_code,
}])
}
@@ -1721,6 +1874,28 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsApproveD
}
}
+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> {
+ let payment_data = additional_data.payment_data;
+ let order_tax_amount = payment_data
+ .payment_intent
+ .tax_details
+ .clone()
+ .and_then(|tax| tax.payment_method_type.map(|pmt| pmt.order_tax_amount))
+ .ok_or(errors::ApiErrorResponse::MissingRequiredField {
+ field_name: "order_tax_amount",
+ })?;
+ let amount = payment_data.payment_intent.amount;
+
+ Ok(Self {
+ net_amount: amount + order_tax_amount, //need to change after we move to connector module
+ order_tax_amount,
+ })
+ }
+}
+
impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsRejectData {
type Error = error_stack::Report<errors::ApiErrorResponse>;
diff --git a/crates/router/src/core/utils.rs b/crates/router/src/core/utils.rs
index a6cf890dc1..2faa69978c 100644
--- a/crates/router/src/core/utils.rs
+++ b/crates/router/src/core/utils.rs
@@ -1,12 +1,19 @@
use std::{collections::HashSet, marker::PhantomData, str::FromStr};
-use api_models::enums::{DisputeStage, DisputeStatus};
#[cfg(feature = "payouts")]
use api_models::payouts::PayoutVendorAccountDetails;
+use api_models::{
+ enums::{DisputeStage, DisputeStatus},
+ payments::OrderDetailsWithAmount,
+};
use common_enums::{IntentStatus, RequestIncrementalAuthorization};
#[cfg(feature = "payouts")]
use common_utils::{crypto::Encryptable, pii::Email};
-use common_utils::{errors::CustomResult, ext_traits::AsyncExt, types::MinorUnit};
+use common_utils::{
+ errors::CustomResult,
+ ext_traits::AsyncExt,
+ types::{keymanager::KeyManagerState, MinorUnit},
+};
use error_stack::{report, ResultExt};
use hyperswitch_domain_models::{
merchant_connector_account::MerchantConnectorAccount, payment_address::PaymentAddress,
@@ -26,7 +33,10 @@ use crate::core::payments;
use crate::{
configs::Settings,
consts,
- core::errors::{self, RouterResult, StorageErrorExt},
+ core::{
+ errors::{self, RouterResult, StorageErrorExt},
+ payments::PaymentData,
+ },
db::StorageInterface,
routes::SessionState,
types::{
@@ -861,6 +871,113 @@ pub async fn construct_upload_file_router_data<'a>(
Ok(router_data)
}
+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> {
+ let payment_intent = &payment_data.payment_intent.clone();
+ let payment_attempt = &payment_data.payment_attempt.clone();
+
+ #[cfg(feature = "v1")]
+ let test_mode: Option<bool> = merchant_connector_account.test_mode;
+
+ #[cfg(feature = "v2")]
+ let test_mode = None;
+
+ let connector_auth_type: types::ConnectorAuthType = merchant_connector_account
+ .connector_account_details
+ .clone()
+ .parse_value("ConnectorAuthType")
+ .change_context(errors::ApiErrorResponse::InternalServerError)
+ .attach_printable("Failed while parsing value for ConnectorAuthType")?;
+
+ let shipping_address = payment_data
+ .tax_data
+ .clone()
+ .map(|tax_data| tax_data.shipping_details)
+ .clone()
+ .ok_or(errors::ApiErrorResponse::InternalServerError)
+ .attach_printable("Missing shipping_details")?;
+
+ let order_details: Option<Vec<OrderDetailsWithAmount>> = payment_intent
+ .order_details
+ .clone()
+ .map(|order_details| {
+ order_details
+ .iter()
+ .map(|data| {
+ data.to_owned()
+ .parse_value("OrderDetailsWithAmount")
+ .change_context(errors::ApiErrorResponse::InvalidDataValue {
+ field_name: "OrderDetailsWithAmount",
+ })
+ .attach_printable("Unable to parse OrderDetailsWithAmount")
+ })
+ .collect::<Result<Vec<_>, _>>()
+ })
+ .transpose()?;
+
+ let router_data = types::RouterData {
+ flow: PhantomData,
+ merchant_id: merchant_account.get_id().to_owned(),
+ customer_id: None,
+ connector_customer: None,
+ connector: merchant_connector_account.connector_name.clone(),
+ payment_id: payment_attempt.payment_id.get_string_repr().to_owned(),
+ attempt_id: payment_attempt.attempt_id.clone(),
+ status: payment_attempt.status,
+ payment_method: diesel_models::enums::PaymentMethod::default(),
+ connector_auth_type,
+ description: None,
+ return_url: None,
+ address: payment_data.address.clone(),
+ auth_type: payment_attempt.authentication_type.unwrap_or_default(),
+ connector_meta_data: None,
+ connector_wallets_details: None,
+ amount_captured: None,
+ access_token: None,
+ session_token: None,
+ reference_id: None,
+ payment_method_token: None,
+ recurring_mandate_payment_data: None,
+ preprocessing_id: None,
+ payment_method_balance: None,
+ connector_api_version: None,
+ request: types::PaymentsTaxCalculationData {
+ amount: payment_intent.amount,
+ shipping_cost: payment_intent.shipping_cost,
+ order_details,
+ currency: payment_data.currency,
+ shipping_address,
+ },
+ response: Err(ErrorResponse::default()),
+ connector_request_reference_id: get_connector_request_reference_id(
+ &state.conf,
+ merchant_account.get_id(),
+ payment_attempt,
+ ),
+ #[cfg(feature = "payouts")]
+ payout_method_data: None,
+ #[cfg(feature = "payouts")]
+ quote_id: None,
+ test_mode,
+ connector_http_status_code: None,
+ external_latency: None,
+ apple_pay_flow: None,
+ frm_metadata: None,
+ refund_id: None,
+ dispute_id: None,
+ connector_response: None,
+ payment_method_status: None,
+ minor_amount_captured: None,
+ integrity_check: Ok(()),
+ };
+ Ok(router_data)
+}
+
#[instrument(skip_all)]
pub async fn construct_defend_dispute_router_data<'a>(
state: &'a SessionState,
@@ -1074,7 +1191,7 @@ pub fn get_connector_request_reference_id(
/// Validate whether the profile_id exists and is associated with the merchant_id
pub async fn validate_and_get_business_profile(
db: &dyn StorageInterface,
- key_manager_state: &common_utils::types::keymanager::KeyManagerState,
+ key_manager_state: &KeyManagerState,
merchant_key_store: &domain::MerchantKeyStore,
profile_id: Option<&common_utils::id_type::ProfileId>,
merchant_id: &common_utils::id_type::MerchantId,
@@ -1151,7 +1268,7 @@ pub fn get_connector_label(
/// or return a `MissingRequiredField` error
#[allow(clippy::too_many_arguments)]
pub async fn get_profile_id_from_business_details(
- key_manager_state: &common_utils::types::keymanager::KeyManagerState,
+ key_manager_state: &KeyManagerState,
merchant_key_store: &domain::MerchantKeyStore,
business_country: Option<api_models::enums::CountryAlpha2>,
business_label: Option<&String>,
diff --git a/crates/router/src/routes/app.rs b/crates/router/src/routes/app.rs
index 5424bcb251..f697f704c1 100644
--- a/crates/router/src/routes/app.rs
+++ b/crates/router/src/routes/app.rs
@@ -626,6 +626,10 @@ impl Payments {
.service(
web::resource("/{payment_id}/extended_card_info").route(web::get().to(retrieve_extended_card_info)),
)
+ .service(
+ web::resource("{payment_id}/calculate_tax")
+ .route(web::post().to(payments_dynamic_tax_calculation)),
+ );
}
route
}
diff --git a/crates/router/src/routes/lock_utils.rs b/crates/router/src/routes/lock_utils.rs
index 2b2a1be087..13148801aa 100644
--- a/crates/router/src/routes/lock_utils.rs
+++ b/crates/router/src/routes/lock_utils.rs
@@ -133,7 +133,8 @@ impl From<Flow> for ApiIdentifier {
| Flow::PaymentsAuthorize
| Flow::GetExtendedCardInfo
| Flow::PaymentsCompleteAuthorize
- | Flow::PaymentsManualUpdate => Self::Payments,
+ | Flow::PaymentsManualUpdate
+ | Flow::SessionUpdateTaxCalculation => Self::Payments,
Flow::PayoutsCreate
| Flow::PayoutsRetrieve
diff --git a/crates/router/src/routes/payments.rs b/crates/router/src/routes/payments.rs
index f249285c55..28660a12e3 100644
--- a/crates/router/src/routes/payments.rs
+++ b/crates/router/src/routes/payments.rs
@@ -604,6 +604,66 @@ pub async fn payments_capture(
))
.await
}
+
+/// Dynamic Tax Calculation
+
+#[instrument(skip_all, fields(flow = ?Flow::SessionUpdateTaxCalculation, payment_id))]
+pub async fn payments_dynamic_tax_calculation(
+ state: web::Data<app::AppState>,
+ req: actix_web::HttpRequest,
+ json_payload: web::Json<payment_types::PaymentsDynamicTaxCalculationRequest>,
+ path: web::Path<common_utils::id_type::PaymentId>,
+) -> impl Responder {
+ let flow = Flow::SessionUpdateTaxCalculation;
+ let payment_id = path.into_inner();
+ let payload = payment_types::PaymentsDynamicTaxCalculationRequest {
+ payment_id,
+ ..json_payload.into_inner()
+ };
+ let header_payload = match HeaderPayload::foreign_try_from(req.headers()) {
+ Ok(headers) => headers,
+ Err(error) => {
+ logger::error!(
+ ?error,
+ "Failed to get headers in payments_connector_session"
+ );
+ HeaderPayload::default()
+ }
+ };
+ tracing::Span::current().record("payment_id", payload.payment_id.get_string_repr());
+ let locking_action = payload.get_locking_input(flow.clone());
+ Box::pin(api::server_wrap(
+ flow,
+ state,
+ &req,
+ payload,
+ |state, auth, payload, req_state| {
+ payments::payments_core::<
+ api_types::SdkSessionUpdate,
+ payment_types::PaymentsDynamicTaxCalculationResponse,
+ _,
+ _,
+ _,
+ >(
+ state,
+ req_state,
+ auth.merchant_account,
+ auth.profile_id,
+ auth.key_store,
+ payments::PaymentSessionUpdate,
+ payload,
+ api::AuthFlow::Client,
+ payments::CallConnectorAction::Trigger,
+ None,
+ header_payload.clone(),
+ )
+ },
+ &auth::PublishableKeyAuth,
+ locking_action,
+ ))
+ .await
+}
+
/// Payments - Session token
///
/// To create the session object or to get session token for wallets
@@ -1788,6 +1848,22 @@ impl GetLockingInput for payment_types::PaymentsSessionRequest {
}
}
+impl GetLockingInput for payment_types::PaymentsDynamicTaxCalculationRequest {
+ fn get_locking_input<F>(&self, flow: F) -> api_locking::LockAction
+ where
+ F: types::FlowMetric,
+ lock_utils::ApiIdentifier: From<F>,
+ {
+ api_locking::LockAction::Hold {
+ input: api_locking::LockingInput {
+ unique_locking_key: self.payment_id.get_string_repr().to_owned(),
+ api_identifier: lock_utils::ApiIdentifier::from(flow),
+ override_lock_retries: None,
+ },
+ }
+ }
+}
+
impl GetLockingInput for payments::PaymentsRedirectResponseData {
fn get_locking_input<F>(&self, flow: F) -> api_locking::LockAction
where
diff --git a/crates/router/src/services/api.rs b/crates/router/src/services/api.rs
index 38d9b77703..8c74629d9a 100644
--- a/crates/router/src/services/api.rs
+++ b/crates/router/src/services/api.rs
@@ -1242,6 +1242,11 @@ impl Authenticate for api_models::payments::PaymentsSessionRequest {
Some(&self.client_secret)
}
}
+impl Authenticate for api_models::payments::PaymentsDynamicTaxCalculationRequest {
+ fn get_client_secret(&self) -> Option<&String> {
+ Some(self.client_secret.peek())
+ }
+}
impl Authenticate for api_models::payments::PaymentsRetrieveRequest {}
impl Authenticate for api_models::payments::PaymentsCancelRequest {}
diff --git a/crates/router/src/types.rs b/crates/router/src/types.rs
index d71d0b2f50..a77f3a16ad 100644
--- a/crates/router/src/types.rs
+++ b/crates/router/src/types.rs
@@ -30,9 +30,9 @@ use hyperswitch_domain_models::router_flow_types::{
files::{Retrieve, Upload},
mandate_revoke::MandateRevoke,
payments::{
- Approve, Authorize, AuthorizeSessionToken, Balance, Capture, CompleteAuthorize,
- CreateConnectorCustomer, IncrementalAuthorization, InitPayment, PSync, PostProcessing,
- PreProcessing, Reject, Session, SetupMandate, Void,
+ Approve, Authorize, AuthorizeSessionToken, Balance, CalculateTax, Capture,
+ CompleteAuthorize, CreateConnectorCustomer, IncrementalAuthorization, InitPayment, PSync,
+ PostProcessing, PreProcessing, Reject, SdkSessionUpdate, Session, SetupMandate, Void,
},
refunds::{Execute, RSync},
webhooks::VerifyWebhookSource,
@@ -58,15 +58,16 @@ pub use hyperswitch_domain_models::{
PaymentsAuthorizeData, PaymentsCancelData, PaymentsCaptureData,
PaymentsIncrementalAuthorizationData, PaymentsPostProcessingData,
PaymentsPreProcessingData, PaymentsRejectData, PaymentsSessionData, PaymentsSyncData,
- RefundsData, ResponseId, RetrieveFileRequestData, SetupMandateRequestData,
- SubmitEvidenceRequestData, SyncRequestType, UploadFileRequestData,
- VerifyWebhookSourceRequestData,
+ PaymentsTaxCalculationData, RefundsData, ResponseId, RetrieveFileRequestData,
+ SdkPaymentsSessionUpdateData, SetupMandateRequestData, SubmitEvidenceRequestData,
+ SyncRequestType, UploadFileRequestData, VerifyWebhookSourceRequestData,
},
router_response_types::{
AcceptDisputeResponse, CaptureSyncResponse, DefendDisputeResponse, MandateReference,
MandateRevokeResponseData, PaymentsResponseData, PreprocessingResponseId,
- RefundsResponseData, RetrieveFileResponse, SubmitEvidenceResponse, UploadFileResponse,
- VerifyWebhookSourceResponseData, VerifyWebhookStatus,
+ RefundsResponseData, RetrieveFileResponse, SubmitEvidenceResponse,
+ TaxCalculationResponseData, UploadFileResponse, VerifyWebhookSourceResponseData,
+ VerifyWebhookStatus,
},
};
#[cfg(feature = "payouts")]
@@ -126,6 +127,12 @@ pub type PaymentsIncrementalAuthorizationRouterData = RouterData<
PaymentsIncrementalAuthorizationData,
PaymentsResponseData,
>;
+pub type PaymentsTaxCalculationRouterData =
+ RouterData<CalculateTax, PaymentsTaxCalculationData, TaxCalculationResponseData>;
+
+pub type SdkSessionUpdateRouterData =
+ RouterData<SdkSessionUpdate, SdkPaymentsSessionUpdateData, PaymentsResponseData>;
+
pub type PaymentsCancelRouterData = RouterData<Void, PaymentsCancelData, PaymentsResponseData>;
pub type PaymentsRejectRouterData = RouterData<Reject, PaymentsRejectData, PaymentsResponseData>;
pub type PaymentsApproveRouterData = RouterData<Approve, PaymentsApproveData, PaymentsResponseData>;
@@ -362,6 +369,8 @@ impl Capturable for CompleteAuthorizeData {
}
}
impl Capturable for SetupMandateRequestData {}
+impl Capturable for PaymentsTaxCalculationData {}
+impl Capturable for SdkPaymentsSessionUpdateData {}
impl Capturable for PaymentsCancelData {
fn get_captured_amount<F>(&self, payment_data: &PaymentData<F>) -> Option<i64>
where
diff --git a/crates/router/src/types/api.rs b/crates/router/src/types/api.rs
index 33ecacc681..1c5e6eb5e9 100644
--- a/crates/router/src/types/api.rs
+++ b/crates/router/src/types/api.rs
@@ -112,6 +112,7 @@ pub trait Connector:
+ ConnectorMandateRevokeV2
+ ExternalAuthentication
+ ExternalAuthenticationV2
+ + PaymentTaxCalculation
{
}
@@ -139,7 +140,8 @@ impl<
+ ConnectorMandateRevoke
+ ConnectorMandateRevokeV2
+ ExternalAuthentication
- + ExternalAuthenticationV2,
+ + ExternalAuthenticationV2
+ + PaymentTaxCalculation,
> Connector for T
{
}
@@ -455,7 +457,6 @@ impl ConnectorData {
enums::Connector::Stripe => {
Ok(ConnectorEnum::Old(Box::new(connector::Stripe::new())))
}
- // enums::Connector::Taxjar => Ok(ConnectorEnum::Old(Box::new(connector::Taxjar))),
enums::Connector::Wise => Ok(ConnectorEnum::Old(Box::new(&connector::Wise))),
enums::Connector::Worldline => {
Ok(ConnectorEnum::Old(Box::new(&connector::Worldline)))
@@ -500,7 +501,8 @@ impl ConnectorData {
enums::Connector::Signifyd
| enums::Connector::Riskified
| enums::Connector::Gpayments
- | enums::Connector::Threedsecureio => {
+ | enums::Connector::Threedsecureio
+ | enums::Connector::Taxjar => {
Err(report!(errors::ConnectorError::InvalidConnectorName)
.attach_printable(format!("invalid connector name: {connector_name}")))
.change_context(errors::ApiErrorResponse::InternalServerError)
@@ -590,3 +592,32 @@ mod test {
assert!(result.is_err());
}
}
+
+#[derive(Clone)]
+pub struct TaxCalculateConnectorData {
+ pub connector: ConnectorEnum,
+ pub connector_name: enums::TaxConnectors,
+}
+
+impl TaxCalculateConnectorData {
+ pub fn get_connector_by_name(name: &str) -> CustomResult<Self, errors::ApiErrorResponse> {
+ let connector_name = enums::TaxConnectors::from_str(name)
+ .change_context(errors::ApiErrorResponse::IncorrectConnectorNameGiven)
+ .attach_printable_lazy(|| format!("unable to parse connector: {name}"))?;
+ let connector = Self::convert_connector(connector_name)?;
+ Ok(Self {
+ connector,
+ connector_name,
+ })
+ }
+
+ fn convert_connector(
+ connector_name: enums::TaxConnectors,
+ ) -> CustomResult<ConnectorEnum, errors::ApiErrorResponse> {
+ match connector_name {
+ enums::TaxConnectors::Taxjar => {
+ Ok(ConnectorEnum::Old(Box::new(connector::Taxjar::new())))
+ }
+ }
+ }
+}
diff --git a/crates/router/src/types/api/payments.rs b/crates/router/src/types/api/payments.rs
index 3b342c5c7d..bbdbb05907 100644
--- a/crates/router/src/types/api/payments.rs
+++ b/crates/router/src/types/api/payments.rs
@@ -7,7 +7,8 @@ pub use api_models::payments::{
PaymentListResponseV2, PaymentMethodData, PaymentMethodDataRequest, PaymentMethodDataResponse,
PaymentOp, PaymentRetrieveBody, PaymentRetrieveBodyWithCredentials, PaymentsAggregateResponse,
PaymentsApproveRequest, PaymentsCancelRequest, PaymentsCaptureRequest,
- PaymentsCompleteAuthorizeRequest, PaymentsExternalAuthenticationRequest,
+ PaymentsCompleteAuthorizeRequest, PaymentsDynamicTaxCalculationRequest,
+ PaymentsDynamicTaxCalculationResponse, PaymentsExternalAuthenticationRequest,
PaymentsIncrementalAuthorizationRequest, PaymentsManualUpdateRequest, PaymentsRedirectRequest,
PaymentsRedirectionResponse, PaymentsRejectRequest, PaymentsRequest, PaymentsResponse,
PaymentsResponseForm, PaymentsRetrieveRequest, PaymentsSessionRequest, PaymentsSessionResponse,
@@ -16,22 +17,23 @@ pub use api_models::payments::{
};
use error_stack::ResultExt;
pub use hyperswitch_domain_models::router_flow_types::payments::{
- Approve, Authorize, AuthorizeSessionToken, Balance, Capture, CompleteAuthorize,
+ Approve, Authorize, AuthorizeSessionToken, Balance, CalculateTax, Capture, CompleteAuthorize,
CreateConnectorCustomer, IncrementalAuthorization, InitPayment, PSync, PaymentMethodToken,
- PostProcessing, PreProcessing, Reject, Session, SetupMandate, Void,
+ PostProcessing, PreProcessing, Reject, SdkSessionUpdate, Session, SetupMandate, Void,
};
pub use hyperswitch_interfaces::api::payments::{
ConnectorCustomer, MandateSetup, Payment, PaymentApprove, PaymentAuthorize,
PaymentAuthorizeSessionToken, PaymentCapture, PaymentIncrementalAuthorization, PaymentReject,
- PaymentSession, PaymentSync, PaymentToken, PaymentVoid, PaymentsCompleteAuthorize,
- PaymentsPostProcessing, PaymentsPreProcessing,
+ PaymentSession, PaymentSessionUpdate, PaymentSync, PaymentTaxCalculation, PaymentToken,
+ PaymentVoid, PaymentsCompleteAuthorize, PaymentsPostProcessing, PaymentsPreProcessing,
};
pub use super::payments_v2::{
ConnectorCustomerV2, MandateSetupV2, PaymentApproveV2, PaymentAuthorizeSessionTokenV2,
PaymentAuthorizeV2, PaymentCaptureV2, PaymentIncrementalAuthorizationV2, PaymentRejectV2,
- PaymentSessionV2, PaymentSyncV2, PaymentTokenV2, PaymentV2, PaymentVoidV2,
- PaymentsCompleteAuthorizeV2, PaymentsPostProcessingV2, PaymentsPreProcessingV2,
+ PaymentSessionUpdateV2, PaymentSessionV2, PaymentSyncV2, PaymentTaxCalculationV2,
+ PaymentTokenV2, PaymentV2, PaymentVoidV2, PaymentsCompleteAuthorizeV2,
+ PaymentsPostProcessingV2, PaymentsPreProcessingV2,
};
use crate::core::errors;
diff --git a/crates/router/src/types/api/payments_v2.rs b/crates/router/src/types/api/payments_v2.rs
index 8d8e3498ef..cfcabadee5 100644
--- a/crates/router/src/types/api/payments_v2.rs
+++ b/crates/router/src/types/api/payments_v2.rs
@@ -1,6 +1,7 @@
pub use hyperswitch_interfaces::api::payments_v2::{
ConnectorCustomerV2, MandateSetupV2, PaymentApproveV2, PaymentAuthorizeSessionTokenV2,
PaymentAuthorizeV2, PaymentCaptureV2, PaymentIncrementalAuthorizationV2, PaymentRejectV2,
- PaymentSessionV2, PaymentSyncV2, PaymentTokenV2, PaymentV2, PaymentVoidV2,
- PaymentsCompleteAuthorizeV2, PaymentsPostProcessingV2, PaymentsPreProcessingV2,
+ PaymentSessionUpdateV2, PaymentSessionV2, PaymentSyncV2, PaymentTaxCalculationV2,
+ PaymentTokenV2, PaymentV2, PaymentVoidV2, PaymentsCompleteAuthorizeV2,
+ PaymentsPostProcessingV2, PaymentsPreProcessingV2,
};
diff --git a/crates/router/src/types/transformers.rs b/crates/router/src/types/transformers.rs
index ba2f01e93e..de897c816d 100644
--- a/crates/router/src/types/transformers.rs
+++ b/crates/router/src/types/transformers.rs
@@ -333,7 +333,6 @@ impl ForeignTryFrom<api_enums::Connector> for common_enums::RoutableConnectors {
api_enums::Connector::Square => Self::Square,
api_enums::Connector::Stax => Self::Stax,
api_enums::Connector::Stripe => Self::Stripe,
- // api_enums::Connector::Taxjar => Self::Taxjar,
api_enums::Connector::Trustpay => Self::Trustpay,
api_enums::Connector::Tsys => Self::Tsys,
api_enums::Connector::Volt => Self::Volt,
@@ -363,6 +362,11 @@ impl ForeignTryFrom<api_enums::Connector> for common_enums::RoutableConnectors {
message: "threedsecureio is not a routable connector".to_string(),
})?
}
+ api_enums::Connector::Taxjar => {
+ Err(common_utils::errors::ValidationError::InvalidValue {
+ message: "Taxjar is not a routable connector".to_string(),
+ })?
+ }
})
}
}
diff --git a/crates/router/src/utils/user/sample_data.rs b/crates/router/src/utils/user/sample_data.rs
index a877ad7315..07bfe74f1d 100644
--- a/crates/router/src/utils/user/sample_data.rs
+++ b/crates/router/src/utils/user/sample_data.rs
@@ -248,6 +248,8 @@ pub async fn generate_sample_data(
shipping_details: None,
is_payment_processor_token_flow: None,
organization_id: org_id.clone(),
+ shipping_cost: None,
+ tax_details: None,
};
let payment_attempt = PaymentAttemptBatchNew {
attempt_id: attempt_id.clone(),
diff --git a/crates/router/tests/connectors/payme.rs b/crates/router/tests/connectors/payme.rs
index 605f63d0f6..e85c57df62 100644
--- a/crates/router/tests/connectors/payme.rs
+++ b/crates/router/tests/connectors/payme.rs
@@ -88,6 +88,7 @@ fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {
sub_category: None,
brand: None,
product_type: None,
+ product_tax_code: None,
}]),
router_return_url: Some("https://hyperswitch.io".to_string()),
webhook_url: Some("https://hyperswitch.io".to_string()),
@@ -388,6 +389,7 @@ async fn should_fail_payment_for_incorrect_cvc() {
sub_category: None,
brand: None,
product_type: None,
+ product_tax_code: None,
}]),
router_return_url: Some("https://hyperswitch.io".to_string()),
webhook_url: Some("https://hyperswitch.io".to_string()),
@@ -427,6 +429,7 @@ async fn should_fail_payment_for_invalid_exp_month() {
sub_category: None,
brand: None,
product_type: None,
+ product_tax_code: None,
}]),
router_return_url: Some("https://hyperswitch.io".to_string()),
webhook_url: Some("https://hyperswitch.io".to_string()),
@@ -466,6 +469,7 @@ async fn should_fail_payment_for_incorrect_expiry_year() {
sub_category: None,
brand: None,
product_type: None,
+ product_tax_code: None,
}]),
router_return_url: Some("https://hyperswitch.io".to_string()),
webhook_url: Some("https://hyperswitch.io".to_string()),
diff --git a/crates/router/tests/connectors/utils.rs b/crates/router/tests/connectors/utils.rs
index b9be08c435..ea12d463fb 100644
--- a/crates/router/tests/connectors/utils.rs
+++ b/crates/router/tests/connectors/utils.rs
@@ -565,6 +565,7 @@ pub trait ConnectorActions: Connector {
Ok(types::PaymentsResponseData::MultipleCaptureResponse { .. }) => None,
Ok(types::PaymentsResponseData::IncrementalAuthorizationResponse { .. }) => None,
Ok(types::PaymentsResponseData::PostProcessingResponse { .. }) => None,
+ // Ok(types::PaymentsResponseData::SessionUpdateResponse { .. }) => None,
Err(_) => None,
}
}
@@ -1075,6 +1076,7 @@ pub fn get_connector_transaction_id(
Ok(types::PaymentsResponseData::MultipleCaptureResponse { .. }) => None,
Ok(types::PaymentsResponseData::IncrementalAuthorizationResponse { .. }) => None,
Ok(types::PaymentsResponseData::PostProcessingResponse { .. }) => None,
+ // Ok(types::PaymentsResponseData::SessionUpdateResponse { .. }) => None,
Err(_) => None,
}
}
diff --git a/crates/router/tests/connectors/zen.rs b/crates/router/tests/connectors/zen.rs
index 2b9ea8f821..5c9cc2694c 100644
--- a/crates/router/tests/connectors/zen.rs
+++ b/crates/router/tests/connectors/zen.rs
@@ -331,6 +331,7 @@ async fn should_fail_payment_for_incorrect_card_number() {
sub_category: None,
brand: None,
product_type: None,
+ product_tax_code: None,
}]),
email: Some(Email::from_str("[email protected]").unwrap()),
webhook_url: Some("https://1635-116-74-253-164.ngrok-free.app".to_string()),
@@ -373,6 +374,7 @@ async fn should_fail_payment_for_incorrect_cvc() {
sub_category: None,
brand: None,
product_type: None,
+ product_tax_code: None,
}]),
email: Some(Email::from_str("[email protected]").unwrap()),
webhook_url: Some("https://1635-116-74-253-164.ngrok-free.app".to_string()),
@@ -415,6 +417,7 @@ async fn should_fail_payment_for_invalid_exp_month() {
sub_category: None,
brand: None,
product_type: None,
+ product_tax_code: None,
}]),
email: Some(Email::from_str("[email protected]").unwrap()),
webhook_url: Some("https://1635-116-74-253-164.ngrok-free.app".to_string()),
@@ -457,6 +460,7 @@ async fn should_fail_payment_for_incorrect_expiry_year() {
sub_category: None,
brand: None,
product_type: None,
+ product_tax_code: None,
}]),
email: Some(Email::from_str("[email protected]").unwrap()),
webhook_url: Some("https://1635-116-74-253-164.ngrok-free.app".to_string()),
diff --git a/crates/router_derive/src/macros/operation.rs b/crates/router_derive/src/macros/operation.rs
index c1e8c4e5bb..e73fefb4b5 100644
--- a/crates/router_derive/src/macros/operation.rs
+++ b/crates/router_derive/src/macros/operation.rs
@@ -29,6 +29,8 @@ pub enum Derives {
SessionData,
IncrementalAuthorization,
IncrementalAuthorizationData,
+ SdkSessionUpdate,
+ SdkSessionUpdateData,
}
impl Derives {
@@ -103,6 +105,12 @@ impl Conversion {
Derives::IncrementalAuthorizationData => {
syn::Ident::new("PaymentsIncrementalAuthorizationData", Span::call_site())
}
+ Derives::SdkSessionUpdate => {
+ syn::Ident::new("PaymentsDynamicTaxCalculationRequest", Span::call_site())
+ }
+ Derives::SdkSessionUpdateData => {
+ syn::Ident::new("SdkPaymentsSessionUpdateData", Span::call_site())
+ }
}
}
@@ -423,6 +431,7 @@ pub fn operation_derive_inner(input: DeriveInput) -> syn::Result<proc_macro::Tok
PaymentsSessionData,
CompleteAuthorizeData,
PaymentsIncrementalAuthorizationData,
+ SdkPaymentsSessionUpdateData,
api::{
PaymentsCaptureRequest,
@@ -434,7 +443,8 @@ pub fn operation_derive_inner(input: DeriveInput) -> syn::Result<proc_macro::Tok
PaymentsStartRequest,
PaymentsSessionRequest,
VerifyRequest,
- PaymentsIncrementalAuthorizationRequest
+ PaymentsDynamicTaxCalculationRequest,
+ PaymentsIncrementalAuthorizationRequest,
}
};
#trait_derive
diff --git a/crates/router_env/src/logger/types.rs b/crates/router_env/src/logger/types.rs
index 34e4dc7203..79ab704fbb 100644
--- a/crates/router_env/src/logger/types.rs
+++ b/crates/router_env/src/logger/types.rs
@@ -498,6 +498,8 @@ pub enum Flow {
RefundsManualUpdate,
/// Manually update the payment details like status, error code, error message etc.
PaymentsManualUpdate,
+ /// Dynamic Tax Calcultion
+ SessionUpdateTaxCalculation,
}
///
diff --git a/migrations/2024-08-05-171030_add_shipping_cost_in_payment_intent/down.sql b/migrations/2024-08-05-171030_add_shipping_cost_in_payment_intent/down.sql
new file mode 100644
index 0000000000..21e11e8f48
--- /dev/null
+++ b/migrations/2024-08-05-171030_add_shipping_cost_in_payment_intent/down.sql
@@ -0,0 +1,3 @@
+-- This file should undo anything in `up.sql`
+ALTER TABLE payment_intent
+DROP COLUMN IF EXISTS shipping_cost;
\ No newline at end of file
diff --git a/migrations/2024-08-05-171030_add_shipping_cost_in_payment_intent/up.sql b/migrations/2024-08-05-171030_add_shipping_cost_in_payment_intent/up.sql
new file mode 100644
index 0000000000..5f3045d160
--- /dev/null
+++ b/migrations/2024-08-05-171030_add_shipping_cost_in_payment_intent/up.sql
@@ -0,0 +1,2 @@
+-- Your SQL goes here
+ALTER TABLE payment_intent ADD COLUMN IF NOT EXISTS shipping_cost BIGINT;
\ No newline at end of file
diff --git a/migrations/2024-08-21-085916_add_tax_details_in_payment_intent_to_store_tax_amount/down.sql b/migrations/2024-08-21-085916_add_tax_details_in_payment_intent_to_store_tax_amount/down.sql
new file mode 100644
index 0000000000..235f027efd
--- /dev/null
+++ b/migrations/2024-08-21-085916_add_tax_details_in_payment_intent_to_store_tax_amount/down.sql
@@ -0,0 +1,2 @@
+-- This file should undo anything in `up.sql`
+ALTER TABLE payment_intent DROP COLUMN IF EXISTS tax_details;
diff --git a/migrations/2024-08-21-085916_add_tax_details_in_payment_intent_to_store_tax_amount/up.sql b/migrations/2024-08-21-085916_add_tax_details_in_payment_intent_to_store_tax_amount/up.sql
new file mode 100644
index 0000000000..547b6ff286
--- /dev/null
+++ b/migrations/2024-08-21-085916_add_tax_details_in_payment_intent_to_store_tax_amount/up.sql
@@ -0,0 +1,2 @@
+-- Your SQL goes here
+ALTER TABLE payment_intent ADD COLUMN IF NOT EXISTS tax_details JSONB;
diff --git a/migrations/2024-08-27-190822_add_tax_processor_in_connector_type/down.sql b/migrations/2024-08-27-190822_add_tax_processor_in_connector_type/down.sql
new file mode 100644
index 0000000000..da13010c01
--- /dev/null
+++ b/migrations/2024-08-27-190822_add_tax_processor_in_connector_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-08-27-190822_add_tax_processor_in_connector_type/up.sql b/migrations/2024-08-27-190822_add_tax_processor_in_connector_type/up.sql
new file mode 100644
index 0000000000..3026bf0478
--- /dev/null
+++ b/migrations/2024-08-27-190822_add_tax_processor_in_connector_type/up.sql
@@ -0,0 +1,3 @@
+-- Your SQL goes here
+ALTER TYPE "ConnectorType"
+ADD VALUE IF NOT EXISTS 'tax_processor';
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index d7c69792ce..19a2d2fb02 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,855 +1,662 @@
{
"name": "hyperswitch",
"version": "0.0.0",
- "lockfileVersion": 3,
+ "lockfileVersion": 1,
"requires": true,
- "packages": {
- "": {
- "name": "hyperswitch",
- "version": "0.0.0",
- "devDependencies": {
- "newman": "git+ssh://[email protected]:knutties/newman.git#7106e194c15d49d066fa09d9a2f18b2238f3dba8"
- }
- },
- "node_modules/@colors/colors": {
+ "dependencies": {
+ "@colors/colors": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz",
"integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==",
"dev": true,
- "optional": true,
- "engines": {
- "node": ">=0.1.90"
- }
+ "optional": true
},
- "node_modules/@faker-js/faker": {
+ "@faker-js/faker": {
"version": "5.5.3",
"resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-5.5.3.tgz",
"integrity": "sha512-R11tGE6yIFwqpaIqcfkcg7AICXzFg14+5h5v0TfF/9+RMDL6jhzCy/pxHVOfbALGdtVYdt6JdR21tuxEgl34dw==",
"dev": true
},
- "node_modules/@postman/form-data": {
+ "@postman/form-data": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/@postman/form-data/-/form-data-3.1.1.tgz",
"integrity": "sha512-vjh8Q2a8S6UCm/KKs31XFJqEEgmbjBmpPNVV2eVav6905wyFAwaUOBGA1NPBI4ERH9MMZc6w0umFgM6WbEPMdg==",
"dev": true,
- "dependencies": {
+ "requires": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"mime-types": "^2.1.12"
- },
- "engines": {
- "node": ">= 6"
}
},
- "node_modules/@postman/tough-cookie": {
+ "@postman/tough-cookie": {
"version": "4.1.3-postman.1",
"resolved": "https://registry.npmjs.org/@postman/tough-cookie/-/tough-cookie-4.1.3-postman.1.tgz",
"integrity": "sha512-txpgUqZOnWYnUHZpHjkfb0IwVH4qJmyq77pPnJLlfhMtdCLMFTEeQHlzQiK906aaNCe4NEB5fGJHo9uzGbFMeA==",
"dev": true,
- "dependencies": {
+ "requires": {
"psl": "^1.1.33",
"punycode": "^2.1.1",
"universalify": "^0.2.0",
"url-parse": "^1.5.3"
- },
- "engines": {
- "node": ">=6"
}
},
- "node_modules/@postman/tunnel-agent": {
- "version": "0.6.3",
- "resolved": "https://registry.npmjs.org/@postman/tunnel-agent/-/tunnel-agent-0.6.3.tgz",
- "integrity": "sha512-k57fzmAZ2PJGxfOA4SGR05ejorHbVAa/84Hxh/2nAztjNXc4ZjOm9NUIk6/Z6LCrBvJZqjRZbN8e/nROVUPVdg==",
+ "@postman/tunnel-agent": {
+ "version": "0.6.4",
+ "resolved": "https://registry.npmjs.org/@postman/tunnel-agent/-/tunnel-agent-0.6.4.tgz",
+ "integrity": "sha512-CJJlq8V7rNKhAw4sBfjixKpJW00SHqebqNUQKxMoepgeWZIbdPcD+rguRcivGhS4N12PymDcKgUgSD4rVC+RjQ==",
"dev": true,
- "dependencies": {
+ "requires": {
"safe-buffer": "^5.0.1"
- },
- "engines": {
- "node": "*"
}
},
- "node_modules/ajv": {
+ "ajv": {
"version": "6.12.6",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
"dev": true,
- "dependencies": {
+ "requires": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
- },
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/epoberezkin"
}
},
- "node_modules/ansi-regex": {
+ "ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
+ "dev": true
},
- "node_modules/ansi-styles": {
+ "ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
- "dependencies": {
+ "requires": {
"color-convert": "^1.9.0"
- },
- "engines": {
- "node": ">=4"
}
},
- "node_modules/array-back": {
+ "array-back": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz",
"integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==",
- "dev": true,
- "engines": {
- "node": ">=6"
- }
+ "dev": true
},
- "node_modules/asn1": {
+ "asn1": {
"version": "0.2.6",
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz",
"integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==",
"dev": true,
- "dependencies": {
+ "requires": {
"safer-buffer": "~2.1.0"
}
},
- "node_modules/assert-plus": {
+ "assert-plus": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
"integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==",
- "dev": true,
- "engines": {
- "node": ">=0.8"
- }
+ "dev": true
},
- "node_modules/async": {
+ "async": {
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz",
"integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==",
"dev": true
},
- "node_modules/asynckit": {
+ "asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
"dev": true
},
- "node_modules/aws-sign2": {
+ "aws-sign2": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz",
"integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==",
- "dev": true,
- "engines": {
- "node": "*"
- }
+ "dev": true
},
- "node_modules/aws4": {
- "version": "1.12.0",
- "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz",
- "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==",
+ "aws4": {
+ "version": "1.13.2",
+ "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.2.tgz",
+ "integrity": "sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==",
"dev": true
},
- "node_modules/base64-js": {
+ "base64-js": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
"integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
- "dev": true,
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ]
+ "dev": true
},
- "node_modules/bcrypt-pbkdf": {
+ "bcrypt-pbkdf": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
"integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==",
"dev": true,
- "dependencies": {
+ "requires": {
"tweetnacl": "^0.14.3"
}
},
- "node_modules/bluebird": {
+ "bluebird": {
"version": "2.11.0",
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz",
"integrity": "sha512-UfFSr22dmHPQqPP9XWHRhq+gWnHCYguQGkXQlbyPtW5qTnhFWA8/iXg765tH0cAjy7l/zPJ1aBTO0g5XgA7kvQ==",
"dev": true
},
- "node_modules/brotli": {
+ "brotli": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/brotli/-/brotli-1.3.3.tgz",
"integrity": "sha512-oTKjJdShmDuGW94SyyaoQvAjf30dZaHnjJ8uAF+u2/vGJkJbJPJAT1gDiOJP5v1Zb6f9KEyW/1HpuaWIXtGHPg==",
"dev": true,
- "dependencies": {
+ "requires": {
"base64-js": "^1.1.2"
}
},
- "node_modules/caseless": {
+ "caseless": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
"integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==",
"dev": true
},
- "node_modules/chalk": {
+ "chalk": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"dev": true,
- "dependencies": {
+ "requires": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
- },
- "engines": {
- "node": ">=4"
}
},
- "node_modules/chardet": {
+ "chardet": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/chardet/-/chardet-1.6.0.tgz",
"integrity": "sha512-+QOTw3otC4+FxdjK9RopGpNOglADbr4WPFi0SonkO99JbpkTPbMxmdm4NenhF5Zs+4gPXLI1+y2uazws5TMe8w==",
"dev": true
},
- "node_modules/charset": {
+ "charset": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/charset/-/charset-1.0.1.tgz",
"integrity": "sha512-6dVyOOYjpfFcL1Y4qChrAoQLRHvj2ziyhcm0QJlhOcAhykL/k1kTUPbeo+87MNRTRdk2OIIsIXbuF3x2wi5EXg==",
- "dev": true,
- "engines": {
- "node": ">=4.0.0"
- }
+ "dev": true
},
- "node_modules/cli-progress": {
+ "cli-progress": {
"version": "3.12.0",
"resolved": "https://registry.npmjs.org/cli-progress/-/cli-progress-3.12.0.tgz",
"integrity": "sha512-tRkV3HJ1ASwm19THiiLIXLO7Im7wlTuKnvkYaTkyoAPefqjNg7W7DHKUlGRxy9vxDvbyCYQkQozvptuMkGCg8A==",
"dev": true,
- "dependencies": {
+ "requires": {
"string-width": "^4.2.3"
- },
- "engines": {
- "node": ">=4"
}
},
- "node_modules/cli-table3": {
+ "cli-table3": {
"version": "0.6.3",
"resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.3.tgz",
"integrity": "sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==",
"dev": true,
- "dependencies": {
+ "requires": {
+ "@colors/colors": "1.5.0",
"string-width": "^4.2.0"
- },
- "engines": {
- "node": "10.* || >= 12.*"
- },
- "optionalDependencies": {
- "@colors/colors": "1.5.0"
}
},
- "node_modules/color-convert": {
+ "color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"dev": true,
- "dependencies": {
+ "requires": {
"color-name": "1.1.3"
}
},
- "node_modules/color-name": {
+ "color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
"dev": true
},
- "node_modules/colors": {
+ "colors": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz",
"integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==",
- "dev": true,
- "engines": {
- "node": ">=0.1.90"
- }
+ "dev": true
},
- "node_modules/combined-stream": {
+ "combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"dev": true,
- "dependencies": {
+ "requires": {
"delayed-stream": "~1.0.0"
- },
- "engines": {
- "node": ">= 0.8"
}
},
- "node_modules/command-line-args": {
+ "command-line-args": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz",
"integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==",
"dev": true,
- "dependencies": {
+ "requires": {
"array-back": "^3.1.0",
"find-replace": "^3.0.0",
"lodash.camelcase": "^4.3.0",
"typical": "^4.0.0"
- },
- "engines": {
- "node": ">=4.0.0"
}
},
- "node_modules/command-line-usage": {
+ "command-line-usage": {
"version": "6.1.3",
"resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.3.tgz",
"integrity": "sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw==",
"dev": true,
- "dependencies": {
+ "requires": {
"array-back": "^4.0.2",
"chalk": "^2.4.2",
"table-layout": "^1.0.2",
"typical": "^5.2.0"
},
- "engines": {
- "node": ">=8.0.0"
- }
- },
- "node_modules/command-line-usage/node_modules/array-back": {
- "version": "4.0.2",
- "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz",
- "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/command-line-usage/node_modules/typical": {
- "version": "5.2.0",
- "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz",
- "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==",
- "dev": true,
- "engines": {
- "node": ">=8"
+ "dependencies": {
+ "array-back": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz",
+ "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==",
+ "dev": true
+ },
+ "typical": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz",
+ "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==",
+ "dev": true
+ }
}
},
- "node_modules/commander": {
+ "commander": {
"version": "11.0.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-11.0.0.tgz",
"integrity": "sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==",
- "dev": true,
- "engines": {
- "node": ">=16"
- }
+ "dev": true
},
- "node_modules/core-util-is": {
+ "core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==",
"dev": true
},
- "node_modules/csv-parse": {
+ "csv-parse": {
"version": "4.16.3",
"resolved": "https://registry.npmjs.org/csv-parse/-/csv-parse-4.16.3.tgz",
"integrity": "sha512-cO1I/zmz4w2dcKHVvpCr7JVRu8/FymG5OEpmvsZYlccYolPBLoVGKUHgNoc4ZGkFeFlWGEDmMyBM+TTqRdW/wg==",
"dev": true
},
- "node_modules/dashdash": {
+ "dashdash": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz",
"integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==",
"dev": true,
- "dependencies": {
+ "requires": {
"assert-plus": "^1.0.0"
- },
- "engines": {
- "node": ">=0.10"
}
},
- "node_modules/deep-extend": {
+ "deep-extend": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
"integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==",
- "dev": true,
- "engines": {
- "node": ">=4.0.0"
- }
+ "dev": true
},
- "node_modules/delayed-stream": {
+ "delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
- "dev": true,
- "engines": {
- "node": ">=0.4.0"
- }
+ "dev": true
},
- "node_modules/des.js": {
+ "des.js": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/des.js/-/des.js-1.1.0.tgz",
"integrity": "sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg==",
"dev": true,
- "dependencies": {
+ "requires": {
"inherits": "^2.0.1",
"minimalistic-assert": "^1.0.0"
}
},
- "node_modules/directory-tree": {
+ "directory-tree": {
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/directory-tree/-/directory-tree-3.5.1.tgz",
"integrity": "sha512-HqjZ49fDzUnKYUhHxVw9eKBqbQ+lL0v4kSBInlDlaktmLtGoV9tC54a6A0ZfYeIrkMHWTE6MwwmUXP477+UEKQ==",
"dev": true,
- "dependencies": {
+ "requires": {
"command-line-args": "^5.2.0",
"command-line-usage": "^6.1.1"
- },
- "bin": {
- "directory-tree": "bin/index.js"
- },
- "engines": {
- "node": ">=10.0"
}
},
- "node_modules/ecc-jsbn": {
+ "ecc-jsbn": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz",
"integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==",
"dev": true,
- "dependencies": {
+ "requires": {
"jsbn": "~0.1.0",
"safer-buffer": "^2.1.0"
}
},
- "node_modules/emoji-regex": {
+ "emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"dev": true
},
- "node_modules/escape-string-regexp": {
+ "escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
- "dev": true,
- "engines": {
- "node": ">=0.8.0"
- }
+ "dev": true
},
- "node_modules/eventemitter3": {
+ "eventemitter3": {
"version": "4.0.7",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
"integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==",
"dev": true
},
- "node_modules/extend": {
+ "extend": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
"integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==",
"dev": true
},
- "node_modules/extsprintf": {
+ "extsprintf": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz",
"integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==",
- "dev": true,
- "engines": [
- "node >=0.6.0"
- ]
+ "dev": true
},
- "node_modules/fast-deep-equal": {
+ "fast-deep-equal": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
"dev": true
},
- "node_modules/fast-json-stable-stringify": {
+ "fast-json-stable-stringify": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
"integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
"dev": true
},
- "node_modules/file-type": {
+ "file-type": {
"version": "3.9.0",
"resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz",
"integrity": "sha512-RLoqTXE8/vPmMuTI88DAzhMYC99I8BWv7zYP4A1puo5HIjEJ5EX48ighy4ZyKMG9EDXxBgW6e++cn7d1xuFghA==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
+ "dev": true
},
- "node_modules/filesize": {
+ "filesize": {
"version": "10.0.12",
"resolved": "https://registry.npmjs.org/filesize/-/filesize-10.0.12.tgz",
"integrity": "sha512-6RS9gDchbn+qWmtV2uSjo5vmKizgfCQeb5jKmqx8HyzA3MoLqqyQxN+QcjkGBJt7FjJ9qFce67Auyya5rRRbpw==",
- "dev": true,
- "engines": {
- "node": ">= 10.4.0"
- }
+ "dev": true
},
- "node_modules/find-replace": {
+ "find-replace": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz",
"integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==",
"dev": true,
- "dependencies": {
+ "requires": {
"array-back": "^3.0.1"
- },
- "engines": {
- "node": ">=4.0.0"
}
},
- "node_modules/flatted": {
+ "flatted": {
"version": "3.2.6",
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.6.tgz",
"integrity": "sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==",
"dev": true
},
- "node_modules/forever-agent": {
+ "forever-agent": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
"integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==",
- "dev": true,
- "engines": {
- "node": "*"
- }
+ "dev": true
},
- "node_modules/getpass": {
+ "getpass": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
"integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==",
"dev": true,
- "dependencies": {
+ "requires": {
"assert-plus": "^1.0.0"
}
},
- "node_modules/handlebars": {
+ "handlebars": {
"version": "4.7.8",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz",
"integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==",
"dev": true,
- "dependencies": {
+ "requires": {
"minimist": "^1.2.5",
"neo-async": "^2.6.2",
"source-map": "^0.6.1",
+ "uglify-js": "^3.1.4",
"wordwrap": "^1.0.0"
- },
- "bin": {
- "handlebars": "bin/handlebars"
- },
- "engines": {
- "node": ">=0.4.7"
- },
- "optionalDependencies": {
- "uglify-js": "^3.1.4"
}
},
- "node_modules/har-schema": {
+ "har-schema": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz",
"integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==",
- "dev": true,
- "engines": {
- "node": ">=4"
- }
+ "dev": true
},
- "node_modules/har-validator": {
+ "har-validator": {
"version": "5.1.5",
"resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz",
"integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==",
- "deprecated": "this library is no longer supported",
"dev": true,
- "dependencies": {
+ "requires": {
"ajv": "^6.12.3",
"har-schema": "^2.0.0"
- },
- "engines": {
- "node": ">=6"
}
},
- "node_modules/has-flag": {
+ "has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
- "dev": true,
- "engines": {
- "node": ">=4"
- }
+ "dev": true
},
- "node_modules/http-reasons": {
+ "http-reasons": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/http-reasons/-/http-reasons-0.1.0.tgz",
"integrity": "sha512-P6kYh0lKZ+y29T2Gqz+RlC9WBLhKe8kDmcJ+A+611jFfxdPsbMRQ5aNmFRM3lENqFkK+HTTL+tlQviAiv0AbLQ==",
"dev": true
},
- "node_modules/http-signature": {
+ "http-signature": {
"version": "1.3.6",
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.3.6.tgz",
"integrity": "sha512-3adrsD6zqo4GsTqtO7FyrejHNv+NgiIfAfv68+jVlFmSr9OGy7zrxONceFRLKvnnZA5jbxQBX1u9PpB6Wi32Gw==",
"dev": true,
- "dependencies": {
+ "requires": {
"assert-plus": "^1.0.0",
"jsprim": "^2.0.2",
"sshpk": "^1.14.1"
- },
- "engines": {
- "node": ">=0.10"
}
},
- "node_modules/httpntlm": {
+ "httpntlm": {
"version": "1.8.13",
"resolved": "https://registry.npmjs.org/httpntlm/-/httpntlm-1.8.13.tgz",
"integrity": "sha512-2F2FDPiWT4rewPzNMg3uPhNkP3NExENlUGADRUDPQvuftuUTGW98nLZtGemCIW3G40VhWZYgkIDcQFAwZ3mf2Q==",
"dev": true,
- "funding": [
- {
- "type": "paypal",
- "url": "https://www.paypal.com/donate/?hosted_button_id=2CKNJLZJBW8ZC"
- },
- {
- "type": "buymeacoffee",
- "url": "https://www.buymeacoffee.com/samdecrock"
- }
- ],
- "dependencies": {
+ "requires": {
"des.js": "^1.0.1",
"httpreq": ">=0.4.22",
"js-md4": "^0.3.2",
"underscore": "~1.12.1"
- },
- "engines": {
- "node": ">=10.4.0"
}
},
- "node_modules/httpreq": {
+ "httpreq": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/httpreq/-/httpreq-1.1.1.tgz",
"integrity": "sha512-uhSZLPPD2VXXOSN8Cni3kIsoFHaU2pT/nySEU/fHr/ePbqHYr0jeiQRmUKLEirC09SFPsdMoA7LU7UXMd/w0Kw==",
- "dev": true,
- "engines": {
- "node": ">= 6.15.1"
- }
+ "dev": true
},
- "node_modules/iconv-lite": {
+ "iconv-lite": {
"version": "0.6.3",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
"dev": true,
- "dependencies": {
+ "requires": {
"safer-buffer": ">= 2.1.2 < 3.0.0"
- },
- "engines": {
- "node": ">=0.10.0"
}
},
- "node_modules/inherits": {
+ "inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
"dev": true
},
- "node_modules/is-fullwidth-code-point": {
+ "is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
+ "dev": true
},
- "node_modules/is-typedarray": {
+ "is-typedarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
"integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==",
"dev": true
},
- "node_modules/isstream": {
+ "isstream": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
"integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==",
"dev": true
},
- "node_modules/jose": {
+ "jose": {
"version": "4.14.4",
"resolved": "https://registry.npmjs.org/jose/-/jose-4.14.4.tgz",
"integrity": "sha512-j8GhLiKmUAh+dsFXlX1aJCbt5KMibuKb+d7j1JaOJG6s2UjX1PQlW+OKB/sD4a/5ZYF4RcmYmLSndOoU3Lt/3g==",
- "dev": true,
- "funding": {
- "url": "https://github.com/sponsors/panva"
- }
+ "dev": true
},
- "node_modules/js-md4": {
+ "js-md4": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/js-md4/-/js-md4-0.3.2.tgz",
"integrity": "sha512-/GDnfQYsltsjRswQhN9fhv3EMw2sCpUdrdxyWDOUK7eyD++r3gRhzgiQgc/x4MAv2i1iuQ4lxO5mvqM3vj4bwA==",
"dev": true
},
- "node_modules/js-sha512": {
+ "js-sha512": {
"version": "0.8.0",
"resolved": "https://registry.npmjs.org/js-sha512/-/js-sha512-0.8.0.tgz",
"integrity": "sha512-PWsmefG6Jkodqt+ePTvBZCSMFgN7Clckjd0O7su3I0+BW2QWUTJNzjktHsztGLhncP2h8mcF9V9Y2Ha59pAViQ==",
"dev": true
},
- "node_modules/jsbn": {
+ "jsbn": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
"integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==",
"dev": true
},
- "node_modules/json-schema": {
+ "json-schema": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz",
"integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==",
"dev": true
},
- "node_modules/json-schema-traverse": {
+ "json-schema-traverse": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
"dev": true
},
- "node_modules/json-stringify-safe": {
+ "json-stringify-safe": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
"integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==",
"dev": true
},
- "node_modules/jsprim": {
+ "jsprim": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/jsprim/-/jsprim-2.0.2.tgz",
"integrity": "sha512-gqXddjPqQ6G40VdnI6T6yObEC+pDNvyP95wdQhkWkg7crHH3km5qP1FsOXEkzEQwnz6gz5qGTn1c2Y52wP3OyQ==",
"dev": true,
- "engines": [
- "node >=0.6.0"
- ],
- "dependencies": {
+ "requires": {
"assert-plus": "1.0.0",
"extsprintf": "1.3.0",
"json-schema": "0.4.0",
"verror": "1.10.0"
}
},
- "node_modules/liquid-json": {
+ "liquid-json": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/liquid-json/-/liquid-json-0.3.1.tgz",
"integrity": "sha512-wUayTU8MS827Dam6MxgD72Ui+KOSF+u/eIqpatOtjnvgJ0+mnDq33uC2M7J0tPK+upe/DpUAuK4JUU89iBoNKQ==",
- "dev": true,
- "engines": {
- "node": ">=4"
- }
+ "dev": true
},
- "node_modules/lodash": {
+ "lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true
},
- "node_modules/lodash.camelcase": {
+ "lodash.camelcase": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz",
"integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==",
"dev": true
},
- "node_modules/lru-cache": {
+ "lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"dev": true,
- "dependencies": {
+ "requires": {
"yallist": "^4.0.0"
- },
- "engines": {
- "node": ">=10"
}
},
- "node_modules/mime-db": {
+ "mime-db": {
"version": "1.52.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
- "dev": true,
- "engines": {
- "node": ">= 0.6"
- }
+ "dev": true
},
- "node_modules/mime-format": {
+ "mime-format": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/mime-format/-/mime-format-2.0.1.tgz",
"integrity": "sha512-XxU3ngPbEnrYnNbIX+lYSaYg0M01v6p2ntd2YaFksTu0vayaw5OJvbdRyWs07EYRlLED5qadUZ+xo+XhOvFhwg==",
"dev": true,
- "dependencies": {
+ "requires": {
"charset": "^1.0.0"
}
},
- "node_modules/mime-types": {
+ "mime-types": {
"version": "2.1.35",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
"dev": true,
- "dependencies": {
+ "requires": {
"mime-db": "1.52.0"
- },
- "engines": {
- "node": ">= 0.6"
}
},
- "node_modules/minimalistic-assert": {
+ "minimalistic-assert": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz",
"integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==",
"dev": true
},
- "node_modules/minimist": {
+ "minimist": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
- "dev": true,
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
+ "dev": true
},
- "node_modules/mkdirp": {
+ "mkdirp": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz",
"integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==",
- "dev": true,
- "bin": {
- "mkdirp": "dist/cjs/src/bin.js"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
+ "dev": true
},
- "node_modules/neo-async": {
+ "neo-async": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
"integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==",
"dev": true
},
- "node_modules/newman": {
- "version": "6.0.0",
- "resolved": "git+ssh://[email protected]/knutties/newman.git#7106e194c15d49d066fa09d9a2f18b2238f3dba8",
- "integrity": "sha512-peCwAcRcwBCerxnYiEXAGHkO2ZxsmJyW7BH2/PigzO1qbWtD9FXOnDuwXmp6/Hnc9uxgKqokd2YKPjkHXU6qCw==",
+ "newman": {
+ "version": "git+ssh://[email protected]/knutties/newman.git#7106e194c15d49d066fa09d9a2f18b2238f3dba8",
+ "from": "git+ssh://[email protected]/knutties/newman.git#7106e194c15d49d066fa09d9a2f18b2238f3dba8",
"dev": true,
- "license": "Apache-2.0",
- "dependencies": {
+ "requires": {
"@postman/tough-cookie": "4.1.3-postman.1",
"async": "3.2.4",
"chardet": "1.6.0",
@@ -873,59 +680,44 @@
"serialised-error": "1.1.3",
"word-wrap": "1.2.5",
"xmlbuilder": "15.1.1"
- },
- "bin": {
- "newman": "bin/newman.js"
- },
- "engines": {
- "node": ">=16"
}
},
- "node_modules/node-oauth1": {
+ "node-oauth1": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/node-oauth1/-/node-oauth1-1.3.0.tgz",
"integrity": "sha512-0yggixNfrA1KcBwvh/Hy2xAS1Wfs9dcg6TdFf2zN7gilcAigMdrtZ4ybrBSXBgLvGDw9V1p2MRnGBMq7XjTWLg==",
"dev": true
},
- "node_modules/oauth-sign": {
+ "oauth-sign": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
"integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==",
- "dev": true,
- "engines": {
- "node": "*"
- }
+ "dev": true
},
- "node_modules/object-hash": {
+ "object-hash": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/object-hash/-/object-hash-1.3.1.tgz",
"integrity": "sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA==",
- "dev": true,
- "engines": {
- "node": ">= 0.10.0"
- }
+ "dev": true
},
- "node_modules/parse-ms": {
+ "parse-ms": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-2.1.0.tgz",
"integrity": "sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA==",
- "dev": true,
- "engines": {
- "node": ">=6"
- }
+ "dev": true
},
- "node_modules/performance-now": {
+ "performance-now": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
"integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==",
"dev": true
},
- "node_modules/postman-collection": {
+ "postman-collection": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/postman-collection/-/postman-collection-4.2.1.tgz",
"integrity": "sha512-DFLt3/yu8+ldtOTIzmBUctoupKJBOVK4NZO0t68K2lIir9smQg7OdQTBjOXYy+PDh7u0pSDvD66tm93eBHEPHA==",
"dev": true,
- "dependencies": {
+ "requires": {
"@faker-js/faker": "5.5.3",
"file-type": "3.9.0",
"http-reasons": "0.1.0",
@@ -937,45 +729,35 @@
"postman-url-encoder": "3.0.5",
"semver": "7.5.4",
"uuid": "8.3.2"
- },
- "engines": {
- "node": ">=10"
}
},
- "node_modules/postman-collection-transformer": {
+ "postman-collection-transformer": {
"version": "4.1.7",
"resolved": "https://registry.npmjs.org/postman-collection-transformer/-/postman-collection-transformer-4.1.7.tgz",
"integrity": "sha512-SxJkm/LnlFZs2splUBnS4jQFicgBptghpm4voHtNnaum3Ad64E2MHLV4fJhv58dVUmFwdSwdQUN3m2q0iLecnQ==",
"dev": true,
- "dependencies": {
+ "requires": {
"commander": "8.3.0",
"inherits": "2.0.4",
"lodash": "4.17.21",
"semver": "7.5.4",
"strip-json-comments": "3.1.1"
},
- "bin": {
- "postman-collection-transformer": "bin/transform-collection.js"
- },
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/postman-collection-transformer/node_modules/commander": {
- "version": "8.3.0",
- "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz",
- "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==",
- "dev": true,
- "engines": {
- "node": ">= 12"
+ "dependencies": {
+ "commander": {
+ "version": "8.3.0",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz",
+ "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==",
+ "dev": true
+ }
}
},
- "node_modules/postman-request": {
+ "postman-request": {
"version": "2.88.1-postman.33",
"resolved": "https://registry.npmjs.org/postman-request/-/postman-request-2.88.1-postman.33.tgz",
"integrity": "sha512-uL9sCML4gPH6Z4hreDWbeinKU0p0Ke261nU7OvII95NU22HN6Dk7T/SaVPaj6T4TsQqGKIFw6/woLZnH7ugFNA==",
"dev": true,
- "dependencies": {
+ "requires": {
"@postman/form-data": "~3.1.1",
"@postman/tough-cookie": "~4.1.3-postman.1",
"@postman/tunnel-agent": "^0.6.3",
@@ -998,17 +780,14 @@
"safe-buffer": "^5.1.2",
"stream-length": "^1.0.2",
"uuid": "^8.3.2"
- },
- "engines": {
- "node": ">= 6"
}
},
- "node_modules/postman-runtime": {
+ "postman-runtime": {
"version": "7.33.0",
"resolved": "https://registry.npmjs.org/postman-runtime/-/postman-runtime-7.33.0.tgz",
"integrity": "sha512-cYCb+5Y12FwZU/T3gOj2SKiOz38pisVLc0tdppb+ZlG7iqn5aLgxghJwhjG62pZCV6uixKiQX1hNdLSk9a9Xtw==",
"dev": true,
- "dependencies": {
+ "requires": {
"@postman/tough-cookie": "4.1.3-postman.1",
"async": "3.2.4",
"aws4": "1.12.0",
@@ -1028,218 +807,173 @@
"strip-json-comments": "3.1.1",
"uuid": "8.3.2"
},
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/postman-runtime/node_modules/postman-collection": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/postman-collection/-/postman-collection-4.2.0.tgz",
- "integrity": "sha512-tvOLgN1h6Kab6dt43PmBoV5kYO/YUta3x0C2QqfmbzmHZe47VTpZ/+gIkGlbNhjKNPUUub5X6ehxYKoaTYdy1w==",
- "dev": true,
"dependencies": {
- "@faker-js/faker": "5.5.3",
- "file-type": "3.9.0",
- "http-reasons": "0.1.0",
- "iconv-lite": "0.6.3",
- "liquid-json": "0.3.1",
- "lodash": "4.17.21",
- "mime-format": "2.0.1",
- "mime-types": "2.1.35",
- "postman-url-encoder": "3.0.5",
- "semver": "7.5.4",
- "uuid": "8.3.2"
- },
- "engines": {
- "node": ">=10"
+ "aws4": {
+ "version": "1.12.0",
+ "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz",
+ "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==",
+ "dev": true
+ },
+ "postman-collection": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/postman-collection/-/postman-collection-4.2.0.tgz",
+ "integrity": "sha512-tvOLgN1h6Kab6dt43PmBoV5kYO/YUta3x0C2QqfmbzmHZe47VTpZ/+gIkGlbNhjKNPUUub5X6ehxYKoaTYdy1w==",
+ "dev": true,
+ "requires": {
+ "@faker-js/faker": "5.5.3",
+ "file-type": "3.9.0",
+ "http-reasons": "0.1.0",
+ "iconv-lite": "0.6.3",
+ "liquid-json": "0.3.1",
+ "lodash": "4.17.21",
+ "mime-format": "2.0.1",
+ "mime-types": "2.1.35",
+ "postman-url-encoder": "3.0.5",
+ "semver": "7.5.4",
+ "uuid": "8.3.2"
+ }
+ }
}
},
- "node_modules/postman-sandbox": {
+ "postman-sandbox": {
"version": "4.2.7",
"resolved": "https://registry.npmjs.org/postman-sandbox/-/postman-sandbox-4.2.7.tgz",
"integrity": "sha512-/EcCrKnb/o+9iLS4u+H76E0kBomJFjPptVjoDiq1uZ7Es/4aTv0MAX+0aoDxdDO+0h9sl8vy65uKQwyjN7AOaw==",
"dev": true,
- "dependencies": {
+ "requires": {
"lodash": "4.17.21",
"postman-collection": "4.2.0",
"teleport-javascript": "1.0.0",
"uvm": "2.1.1"
},
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/postman-sandbox/node_modules/postman-collection": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/postman-collection/-/postman-collection-4.2.0.tgz",
- "integrity": "sha512-tvOLgN1h6Kab6dt43PmBoV5kYO/YUta3x0C2QqfmbzmHZe47VTpZ/+gIkGlbNhjKNPUUub5X6ehxYKoaTYdy1w==",
- "dev": true,
"dependencies": {
- "@faker-js/faker": "5.5.3",
- "file-type": "3.9.0",
- "http-reasons": "0.1.0",
- "iconv-lite": "0.6.3",
- "liquid-json": "0.3.1",
- "lodash": "4.17.21",
- "mime-format": "2.0.1",
- "mime-types": "2.1.35",
- "postman-url-encoder": "3.0.5",
- "semver": "7.5.4",
- "uuid": "8.3.2"
- },
- "engines": {
- "node": ">=10"
+ "postman-collection": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/postman-collection/-/postman-collection-4.2.0.tgz",
+ "integrity": "sha512-tvOLgN1h6Kab6dt43PmBoV5kYO/YUta3x0C2QqfmbzmHZe47VTpZ/+gIkGlbNhjKNPUUub5X6ehxYKoaTYdy1w==",
+ "dev": true,
+ "requires": {
+ "@faker-js/faker": "5.5.3",
+ "file-type": "3.9.0",
+ "http-reasons": "0.1.0",
+ "iconv-lite": "0.6.3",
+ "liquid-json": "0.3.1",
+ "lodash": "4.17.21",
+ "mime-format": "2.0.1",
+ "mime-types": "2.1.35",
+ "postman-url-encoder": "3.0.5",
+ "semver": "7.5.4",
+ "uuid": "8.3.2"
+ }
+ }
}
},
- "node_modules/postman-url-encoder": {
+ "postman-url-encoder": {
"version": "3.0.5",
"resolved": "https://registry.npmjs.org/postman-url-encoder/-/postman-url-encoder-3.0.5.tgz",
"integrity": "sha512-jOrdVvzUXBC7C+9gkIkpDJ3HIxOHTIqjpQ4C1EMt1ZGeMvSEpbFCKq23DEfgsj46vMnDgyQf+1ZLp2Wm+bKSsA==",
"dev": true,
- "dependencies": {
+ "requires": {
"punycode": "^2.1.1"
- },
- "engines": {
- "node": ">=10"
}
},
- "node_modules/pretty-ms": {
+ "pretty-ms": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-7.0.1.tgz",
"integrity": "sha512-973driJZvxiGOQ5ONsFhOF/DtzPMOMtgC11kCpUrPGMTgqp2q/1gwzCquocrN33is0VZ5GFHXZYMM9l6h67v2Q==",
"dev": true,
- "dependencies": {
+ "requires": {
"parse-ms": "^2.1.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/psl": {
+ "psl": {
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz",
"integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==",
"dev": true
},
- "node_modules/punycode": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz",
- "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==",
- "dev": true,
- "engines": {
- "node": ">=6"
- }
+ "punycode": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
+ "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
+ "dev": true
},
- "node_modules/qs": {
+ "qs": {
"version": "6.5.3",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz",
"integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==",
- "dev": true,
- "engines": {
- "node": ">=0.6"
- }
+ "dev": true
},
- "node_modules/querystringify": {
+ "querystringify": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz",
"integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==",
"dev": true
},
- "node_modules/reduce-flatten": {
+ "reduce-flatten": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz",
"integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==",
- "dev": true,
- "engines": {
- "node": ">=6"
- }
+ "dev": true
},
- "node_modules/requires-port": {
+ "requires-port": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
"integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==",
"dev": true
},
- "node_modules/safe-buffer": {
+ "safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
- "dev": true,
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ]
+ "dev": true
},
- "node_modules/safer-buffer": {
+ "safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
"dev": true
},
- "node_modules/semver": {
+ "semver": {
"version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dev": true,
- "dependencies": {
+ "requires": {
"lru-cache": "^6.0.0"
- },
- "bin": {
- "semver": "bin/semver.js"
- },
- "engines": {
- "node": ">=10"
}
},
- "node_modules/serialised-error": {
+ "serialised-error": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/serialised-error/-/serialised-error-1.1.3.tgz",
"integrity": "sha512-vybp3GItaR1ZtO2nxZZo8eOo7fnVaNtP3XE2vJKgzkKR2bagCkdJ1EpYYhEMd3qu/80DwQk9KjsNSxE3fXWq0g==",
"dev": true,
- "dependencies": {
+ "requires": {
"object-hash": "^1.1.2",
"stack-trace": "0.0.9",
"uuid": "^3.0.0"
+ },
+ "dependencies": {
+ "uuid": {
+ "version": "3.4.0",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
+ "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
+ "dev": true
+ }
}
},
- "node_modules/serialised-error/node_modules/uuid": {
- "version": "3.4.0",
- "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
- "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
- "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.",
- "dev": true,
- "bin": {
- "uuid": "bin/uuid"
- }
- },
- "node_modules/source-map": {
+ "source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
+ "dev": true
},
- "node_modules/sshpk": {
- "version": "1.17.0",
- "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz",
- "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==",
+ "sshpk": {
+ "version": "1.18.0",
+ "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz",
+ "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==",
"dev": true,
- "dependencies": {
+ "requires": {
"asn1": "~0.2.3",
"assert-plus": "^1.0.0",
"bcrypt-pbkdf": "^1.0.0",
@@ -1249,267 +983,203 @@
"jsbn": "~0.1.0",
"safer-buffer": "^2.0.2",
"tweetnacl": "~0.14.0"
- },
- "bin": {
- "sshpk-conv": "bin/sshpk-conv",
- "sshpk-sign": "bin/sshpk-sign",
- "sshpk-verify": "bin/sshpk-verify"
- },
- "engines": {
- "node": ">=0.10.0"
}
},
- "node_modules/stack-trace": {
+ "stack-trace": {
"version": "0.0.9",
"resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.9.tgz",
"integrity": "sha512-vjUc6sfgtgY0dxCdnc40mK6Oftjo9+2K8H/NG81TMhgL392FtiPA9tn9RLyTxXmTLPJPjF3VyzFp6bsWFLisMQ==",
- "dev": true,
- "engines": {
- "node": "*"
- }
+ "dev": true
},
- "node_modules/stream-length": {
+ "stream-length": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/stream-length/-/stream-length-1.0.2.tgz",
"integrity": "sha512-aI+qKFiwoDV4rsXiS7WRoCt+v2RX1nUj17+KJC5r2gfh5xoSJIfP6Y3Do/HtvesFcTSWthIuJ3l1cvKQY/+nZg==",
"dev": true,
- "dependencies": {
+ "requires": {
"bluebird": "^2.6.2"
}
},
- "node_modules/string-width": {
+ "string-width": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dev": true,
- "dependencies": {
+ "requires": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
- },
- "engines": {
- "node": ">=8"
}
},
- "node_modules/strip-ansi": {
+ "strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
- "dependencies": {
+ "requires": {
"ansi-regex": "^5.0.1"
- },
- "engines": {
- "node": ">=8"
}
},
- "node_modules/strip-json-comments": {
+ "strip-json-comments": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
- "dev": true,
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
+ "dev": true
},
- "node_modules/supports-color": {
+ "supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"dev": true,
- "dependencies": {
+ "requires": {
"has-flag": "^3.0.0"
- },
- "engines": {
- "node": ">=4"
}
},
- "node_modules/table-layout": {
+ "table-layout": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.2.tgz",
"integrity": "sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A==",
"dev": true,
- "dependencies": {
+ "requires": {
"array-back": "^4.0.1",
"deep-extend": "~0.6.0",
"typical": "^5.2.0",
"wordwrapjs": "^4.0.0"
},
- "engines": {
- "node": ">=8.0.0"
- }
- },
- "node_modules/table-layout/node_modules/array-back": {
- "version": "4.0.2",
- "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz",
- "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/table-layout/node_modules/typical": {
- "version": "5.2.0",
- "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz",
- "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==",
- "dev": true,
- "engines": {
- "node": ">=8"
+ "dependencies": {
+ "array-back": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz",
+ "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==",
+ "dev": true
+ },
+ "typical": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz",
+ "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==",
+ "dev": true
+ }
}
},
- "node_modules/teleport-javascript": {
+ "teleport-javascript": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/teleport-javascript/-/teleport-javascript-1.0.0.tgz",
"integrity": "sha512-j1llvWVFyEn/6XIFDfX5LAU43DXe0GCt3NfXDwJ8XpRRMkS+i50SAkonAONBy+vxwPFBd50MFU8a2uj8R/ccLg==",
"dev": true
},
- "node_modules/tweetnacl": {
+ "tweetnacl": {
"version": "0.14.5",
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
"integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==",
"dev": true
},
- "node_modules/typical": {
+ "typical": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz",
"integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
+ "dev": true
},
- "node_modules/uglify-js": {
- "version": "3.17.4",
- "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz",
- "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==",
+ "uglify-js": {
+ "version": "3.19.3",
+ "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz",
+ "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==",
"dev": true,
- "optional": true,
- "bin": {
- "uglifyjs": "bin/uglifyjs"
- },
- "engines": {
- "node": ">=0.8.0"
- }
+ "optional": true
},
- "node_modules/underscore": {
+ "underscore": {
"version": "1.12.1",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.1.tgz",
"integrity": "sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw==",
"dev": true
},
- "node_modules/universalify": {
+ "universalify": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz",
"integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==",
- "dev": true,
- "engines": {
- "node": ">= 4.0.0"
- }
+ "dev": true
},
- "node_modules/uri-js": {
+ "uri-js": {
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
"integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
"dev": true,
- "dependencies": {
+ "requires": {
"punycode": "^2.1.0"
}
},
- "node_modules/url-parse": {
+ "url-parse": {
"version": "1.5.10",
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz",
"integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==",
"dev": true,
- "dependencies": {
+ "requires": {
"querystringify": "^2.1.1",
"requires-port": "^1.0.0"
}
},
- "node_modules/uuid": {
+ "uuid": {
"version": "8.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
- "dev": true,
- "bin": {
- "uuid": "dist/bin/uuid"
- }
+ "dev": true
},
- "node_modules/uvm": {
+ "uvm": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/uvm/-/uvm-2.1.1.tgz",
"integrity": "sha512-BZ5w8adTpNNr+zczOBRpaX/hH8UPKAf7fmCnidrcsqt3bn8KT9bDIfuS7hgRU9RXgiN01su2pwysBONY6w8W5w==",
"dev": true,
- "dependencies": {
+ "requires": {
"flatted": "3.2.6"
- },
- "engines": {
- "node": ">=10"
}
},
- "node_modules/verror": {
+ "verror": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz",
"integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==",
"dev": true,
- "engines": [
- "node >=0.6.0"
- ],
- "dependencies": {
+ "requires": {
"assert-plus": "^1.0.0",
"core-util-is": "1.0.2",
"extsprintf": "^1.2.0"
}
},
- "node_modules/word-wrap": {
+ "word-wrap": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz",
"integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
+ "dev": true
},
- "node_modules/wordwrap": {
+ "wordwrap": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
"integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==",
"dev": true
},
- "node_modules/wordwrapjs": {
+ "wordwrapjs": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.1.tgz",
"integrity": "sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA==",
"dev": true,
- "dependencies": {
+ "requires": {
"reduce-flatten": "^2.0.0",
"typical": "^5.2.0"
},
- "engines": {
- "node": ">=8.0.0"
- }
- },
- "node_modules/wordwrapjs/node_modules/typical": {
- "version": "5.2.0",
- "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz",
- "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==",
- "dev": true,
- "engines": {
- "node": ">=8"
+ "dependencies": {
+ "typical": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz",
+ "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==",
+ "dev": true
+ }
}
},
- "node_modules/xmlbuilder": {
+ "xmlbuilder": {
"version": "15.1.1",
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-15.1.1.tgz",
"integrity": "sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==",
- "dev": true,
- "engines": {
- "node": ">=8.0"
- }
+ "dev": true
},
- "node_modules/yallist": {
+ "yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",