Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
feat(connector): [SANTANDER] Added support for additional fields in Boleto (#11359)
Sayak Bhattacharyae0acca197cfa
diff --git a/api-reference/v1/openapi_spec_v1.json b/api-reference/v1/openapi_spec_v1.jsonindex c88b2cf478..2639a6ac29 100644--- a/api-reference/v1/openapi_spec_v1.json+++ b/api-reference/v1/openapi_spec_v1.json@@ -13040,6 +13040,32 @@}}},+ "BeneficiaryDetails": {+ "type": "object",+ "description": "Represents the end-recipient of a payout or fund transfer.",+ "properties": {+ "name": {+ "type": "string",+ "description": "The full legal name of the individual or entity receiving the funds.",+ "example": "João da Silva",+ "nullable": true+ },+ "document_number": {+ "type": "string",+ "description": "The customer's unique identification number (e.g., Tax ID, SSN, Passport Number).\nUsed by processors to verify the identity of the recipient and prevent fraud.\nLength of the document number depends upon the document_type.\nFor CPF/CNPJ it is typically 11/14 digits long.",+ "example": "9615865832",+ "nullable": true+ },+ "document_type": {+ "allOf": [+ {+ "$ref": "#/components/schemas/DocumentKind"+ }+ ],+ "nullable": true+ }+ }+ },"BillingDescriptor": {"type": "object","description": "Billing Descriptor information to be sent to the payment gateway",@@ -13250,6 +13276,64 @@"installment"]},+ "BoletoPaymentTypeConstraints": {+ "oneOf": [+ {+ "type": "object",+ "required": [+ "type"+ ],+ "properties": {+ "type": {+ "type": "string",+ "enum": [+ "fixed_amount"+ ]+ }+ }+ },+ {+ "type": "object",+ "required": [+ "type",+ "details"+ ],+ "properties": {+ "type": {+ "type": "string",+ "enum": [+ "flexible_amount"+ ]+ },+ "details": {+ "$ref": "#/components/schemas/FlexibleAmountDetails"+ }+ }+ },+ {+ "type": "object",+ "required": [+ "type",+ "details"+ ],+ "properties": {+ "type": {+ "type": "string",+ "enum": [+ "installment"+ ]+ },+ "details": {+ "$ref": "#/components/schemas/InstallmentDetails"+ }+ }+ }+ ],+ "description": "Represents the rules for legal protest (official debt registration) for non-payment, including the type of protest and the number of days after which the protest is initiated.",+ "discriminator": {+ "propertyName": "type"+ }+ },"BoletoVoucherData": {"type": "object","properties": {@@ -13529,6 +13613,14 @@}]},+ "CalculationType": {+ "type": "string",+ "description": "Defines how the payment amount is calculated for penalties or discounts, either as a percentage or as a flat amount.",+ "enum": [+ "percentage",+ "flat_amount"+ ]+ },"CancelOption": {"type": "string","enum": [@@ -14767,6 +14859,28 @@"type": "string","description": "For Client based calls, SDK will use the client_secret\\nin order to call /payment_methods\\nClient secret will be generated whenever a new\\npayment method is created"},+ "CollectionActions": {+ "type": "object",+ "description": "Represents the legal or administrative actions that may be taken for non-payment, such as protest rules and automatic write-off timelines.",+ "properties": {+ "legal_protest": {+ "allOf": [+ {+ "$ref": "#/components/schemas/ProtestRules"+ }+ ],+ "nullable": true+ },+ "auto_write_off_days": {+ "type": "integer",+ "format": "int32",+ "description": "Days after which the bill is automatically cancelled/written off",+ "example": 60,+ "nullable": true,+ "minimum": 0+ }+ }+ },"Comparison": {"type": "object","description": "Represents a single comparison condition.",@@ -15253,6 +15367,14 @@}],"nullable": true+ },+ "santander": {+ "allOf": [+ {+ "$ref": "#/components/schemas/SantanderConnectorMetadataData"+ }+ ],+ "nullable": true}}},@@ -17948,6 +18070,33 @@}}},+ "DiscountTier": {+ "type": "object",+ "properties": {+ "amount": {+ "type": "string",+ "description": "The discount value (e.g., \"5.50\").",+ "example": "5.50",+ "nullable": true+ },+ "end_date": {+ "type": "string",+ "description": "The ISO-8601 date until which this discount is valid",+ "example": "2027-12-31",+ "nullable": true+ }+ }+ },+ "DiscountType": {+ "type": "string",+ "description": "Defines the type of discount applied to a payment, such as whether it's a fixed date discount, a daily calendar discount, or a daily business discount.",+ "enum": [+ "standard",+ "fixed_date",+ "daily_calendar",+ "daily_business"+ ]+ },"DisplayAmountOnSdk": {"type": "object","required": [@@ -19519,6 +19668,32 @@],"description": "Possible field type of required fields in payment_method_data"},+ "FlexibleAmountDetails": {+ "type": "object",+ "description": "Represents the rules for legal protest (official debt registration) for non-payment, including the type of protest and the number of days after which the protest is initiated.",+ "properties": {+ "min_value": {+ "type": "string",+ "description": "Minimum value allowed (e.g., \"10.00\")",+ "example": "38.02",+ "nullable": true+ },+ "max_value": {+ "type": "string",+ "description": "Maximum value allowed (e.g., \"5000.00\")",+ "example": "38.02",+ "nullable": true+ },+ "value_type": {+ "allOf": [+ {+ "$ref": "#/components/schemas/CalculationType"+ }+ ],+ "nullable": true+ }+ }+ },"FrmAction": {"type": "string","enum": [@@ -20990,6 +21165,28 @@}}},+ "InstallmentDetails": {+ "type": "object",+ "description": "Represents the rules for legal protest (official debt registration) for non-payment, including the type of protest and the number of days after which the protest is initiated.",+ "properties": {+ "max_partial_payments": {+ "type": "integer",+ "format": "int32",+ "description": "Maximum number of partial payments allowed (Up to 99 for Santander).",+ "example": 99,+ "nullable": true,+ "minimum": 0+ },+ "value_type": {+ "allOf": [+ {+ "$ref": "#/components/schemas/CalculationType"+ }+ ],+ "nullable": true+ }+ }+ },"InstallmentOption": {"type": "object","description": "Installment options grouped by payment method",@@ -21109,6 +21306,24 @@}}},+ "InterestDetail": {+ "type": "object",+ "description": "Represents the rules for applying discounts to a payment, such as a percentage discount or a fixed amount discount, along with any applicable grace periods.",+ "properties": {+ "interest_percentage": {+ "type": "string",+ "description": "Percentage of Juros (Interest). Pattern: ^[0-9]{1,3}\\.[0-9]{2}$",+ "example": "5.00",+ "nullable": true+ },+ "iof_percentage": {+ "type": "string",+ "description": "Percentage of IOF (Financial Operations Tax). Pattern: \\d{3}$\\.\\d{5}\nOnly provided if the agreement is \"Cobra IOF na Barra ou Cadastro\"",+ "example": "32.45325",+ "nullable": true+ }+ }+ },"Invoice": {"type": "object","required": [@@ -34138,6 +34353,48 @@}}},+ "PenaltyDetail": {+ "type": "object",+ "description": "Represents the rules for applying discounts to a payment, such as a percentage discount or a fixed amount discount, along with any applicable grace periods.",+ "properties": {+ "value": {+ "type": "string",+ "description": "The numeric value (as a string to preserve decimal precision)",+ "example": "2.00",+ "nullable": true+ },+ "grace_period_days": {+ "type": "integer",+ "format": "int32",+ "description": "Grace period: Days after due date before this applies",+ "example": 1,+ "nullable": true,+ "minimum": 0+ }+ }+ },+ "PenaltyRules": {+ "type": "object",+ "description": "Represents the rules for applying discounts to a payment, such as a percentage discount or a fixed amount discount, along with any applicable grace periods.",+ "properties": {+ "fixed_penalty": {+ "allOf": [+ {+ "$ref": "#/components/schemas/PenaltyDetail"+ }+ ],+ "nullable": true+ },+ "interest": {+ "allOf": [+ {+ "$ref": "#/components/schemas/InterestDetail"+ }+ ],+ "nullable": true+ }+ }+ },"PeriodUnit": {"type": "string","enum": [@@ -35501,6 +35758,35 @@}}},+ "ProtestRules": {+ "type": "object",+ "required": [+ "protest_type",+ "days_after_due_date"+ ],+ "properties": {+ "protest_type": {+ "$ref": "#/components/schemas/ProtestType"+ },+ "days_after_due_date": {+ "type": "integer",+ "format": "int32",+ "description": "Number of days after the due date to initiate the protest",+ "example": 30,+ "minimum": 0+ }+ }+ },+ "ProtestType": {+ "type": "string",+ "description": "Defines the type of protest for non-payment, such as whether the count is based on calendar days, business days, or if the protest logic is determined by a pre-signed contract with the bank.",+ "enum": [+ "disabled",+ "calendar_days",+ "business_days",+ "contract_default"+ ]+ },"RankingAlgorithm": {"type": "string","enum": [@@ -37660,6 +37946,74 @@}}},+ "SantanderBoletoData": {+ "type": "object",+ "description": "Represents the specific data and rules related to Santander Boleto payments, including discounts, penalties, collection actions, payment constraints, beneficiary details, and document kind.",+ "properties": {+ "discount_rules": {+ "allOf": [+ {+ "$ref": "#/components/schemas/SantanderPaymentDiscountRules"+ }+ ],+ "nullable": true+ },+ "penalties": {+ "allOf": [+ {+ "$ref": "#/components/schemas/PenaltyRules"+ }+ ],+ "nullable": true+ },+ "collection_actions": {+ "allOf": [+ {+ "$ref": "#/components/schemas/CollectionActions"+ }+ ],+ "nullable": true+ },+ "payment_constraints": {+ "allOf": [+ {+ "$ref": "#/components/schemas/BoletoPaymentTypeConstraints"+ }+ ],+ "nullable": true+ },+ "beneficiary": {+ "allOf": [+ {+ "$ref": "#/components/schemas/BeneficiaryDetails"+ }+ ],+ "nullable": true+ },+ "document_kind": {+ "allOf": [+ {+ "$ref": "#/components/schemas/BoletoDocumentKind"+ }+ ],+ "nullable": true+ }+ }+ },+ "SantanderConnectorMetadataData": {+ "type": "object",+ "description": "Represents the connector-specific metadata for Santander payments, including boleto data and related rules.",+ "properties": {+ "boleto": {+ "allOf": [+ {+ "$ref": "#/components/schemas/SantanderBoletoData"+ }+ ],+ "nullable": true+ }+ }+ },"SantanderData": {"type": "object","properties": {@@ -37670,6 +38024,30 @@},"additionalProperties": false},+ "SantanderPaymentDiscountRules": {+ "type": "object",+ "description": "Defines the type of discount applied to a payment, such as whether it's a fixed date discount, a daily calendar discount, or a daily business discount.",+ "required": [+ "tiers"+ ],+ "properties": {+ "discount_type": {+ "allOf": [+ {+ "$ref": "#/components/schemas/DiscountType"+ }+ ],+ "nullable": true+ },+ "tiers": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/DiscountTier"+ },+ "description": "A generic vector of discount tiers"+ }+ }+ },"ScaExemptionType": {"type": "string","description": "SCA Exemptions types available for authentication",diff --git a/api-reference/v2/openapi_spec_v2.json b/api-reference/v2/openapi_spec_v2.jsonindex ba70713895..0361e5fc87 100644--- a/api-reference/v2/openapi_spec_v2.json+++ b/api-reference/v2/openapi_spec_v2.json@@ -8859,6 +8859,32 @@}}},+ "BeneficiaryDetails": {+ "type": "object",+ "description": "Represents the end-recipient of a payout or fund transfer.",+ "properties": {+ "name": {+ "type": "string",+ "description": "The full legal name of the individual or entity receiving the funds.",+ "example": "João da Silva",+ "nullable": true+ },+ "document_number": {+ "type": "string",+ "description": "The customer's unique identification number (e.g., Tax ID, SSN, Passport Number).\nUsed by processors to verify the identity of the recipient and prevent fraud.\nLength of the document number depends upon the document_type.\nFor CPF/CNPJ it is typically 11/14 digits long.",+ "example": "9615865832",+ "nullable": true+ },+ "document_type": {+ "allOf": [+ {+ "$ref": "#/components/schemas/DocumentKind"+ }+ ],+ "nullable": true+ }+ }+ },"BillingConnectorAdditionalCardInfo": {"type": "object","required": [@@ -9082,6 +9108,64 @@"installment"]},+ "BoletoPaymentTypeConstraints": {+ "oneOf": [+ {+ "type": "object",+ "required": [+ "type"+ ],+ "properties": {+ "type": {+ "type": "string",+ "enum": [+ "fixed_amount"+ ]+ }+ }+ },+ {+ "type": "object",+ "required": [+ "type",+ "details"+ ],+ "properties": {+ "type": {+ "type": "string",+ "enum": [+ "flexible_amount"+ ]+ },+ "details": {+ "$ref": "#/components/schemas/FlexibleAmountDetails"+ }+ }+ },+ {+ "type": "object",+ "required": [+ "type",+ "details"+ ],+ "properties": {+ "type": {+ "type": "string",+ "enum": [+ "installment"+ ]+ },+ "details": {+ "$ref": "#/components/schemas/InstallmentDetails"+ }+ }+ }+ ],+ "description": "Represents the rules for legal protest (official debt registration) for non-payment, including the type of protest and the number of days after which the protest is initiated.",+ "discriminator": {+ "propertyName": "type"+ }+ },"BoletoVoucherData": {"type": "object","properties": {@@ -9361,6 +9445,14 @@}]},+ "CalculationType": {+ "type": "string",+ "description": "Defines how the payment amount is calculated for penalties or discounts, either as a percentage or as a flat amount.",+ "enum": [+ "percentage",+ "flat_amount"+ ]+ },"CaptureMethod": {"type": "string","description": "Specifies how the payment is captured.\n- `automatic`: Funds are captured immediately after successful authorization. This is the default behavior if the field is omitted.\n- `manual`: Funds are authorized but not captured. A separate request to the `/payments/{payment_id}/capture` endpoint is required to capture the funds.",@@ -10463,6 +10555,28 @@}}},+ "CollectionActions": {+ "type": "object",+ "description": "Represents the legal or administrative actions that may be taken for non-payment, such as protest rules and automatic write-off timelines.",+ "properties": {+ "legal_protest": {+ "allOf": [+ {+ "$ref": "#/components/schemas/ProtestRules"+ }+ ],+ "nullable": true+ },+ "auto_write_off_days": {+ "type": "integer",+ "format": "int32",+ "description": "Days after which the bill is automatically cancelled/written off",+ "example": 60,+ "nullable": true,+ "minimum": 0+ }+ }+ },"Comparison": {"type": "object","description": "Represents a single comparison condition.",@@ -10801,6 +10915,14 @@}],"nullable": true+ },+ "santander": {+ "allOf": [+ {+ "$ref": "#/components/schemas/SantanderConnectorMetadataData"+ }+ ],+ "nullable": true}}},@@ -12693,6 +12815,33 @@}}},+ "DiscountTier": {+ "type": "object",+ "properties": {+ "amount": {+ "type": "string",+ "description": "The discount value (e.g., \"5.50\").",+ "example": "5.50",+ "nullable": true+ },+ "end_date": {+ "type": "string",+ "description": "The ISO-8601 date until which this discount is valid",+ "example": "2027-12-31",+ "nullable": true+ }+ }+ },+ "DiscountType": {+ "type": "string",+ "description": "Defines the type of discount applied to a payment, such as whether it's a fixed date discount, a daily calendar discount, or a daily business discount.",+ "enum": [+ "standard",+ "fixed_date",+ "daily_calendar",+ "daily_business"+ ]+ },"DisplayAmountOnSdk": {"type": "object","required": [@@ -14159,6 +14308,32 @@],"description": "Possible field type of required fields in payment_method_data"},+ "FlexibleAmountDetails": {+ "type": "object",+ "description": "Represents the rules for legal protest (official debt registration) for non-payment, including the type of protest and the number of days after which the protest is initiated.",+ "properties": {+ "min_value": {+ "type": "string",+ "description": "Minimum value allowed (e.g., \"10.00\")",+ "example": "38.02",+ "nullable": true+ },+ "max_value": {+ "type": "string",+ "description": "Maximum value allowed (e.g., \"5000.00\")",+ "example": "38.02",+ "nullable": true+ },+ "value_type": {+ "allOf": [+ {+ "$ref": "#/components/schemas/CalculationType"+ }+ ],+ "nullable": true+ }+ }+ },"ForceSync": {"type": "string","enum": [@@ -15627,6 +15802,28 @@"connected"]},+ "InstallmentDetails": {+ "type": "object",+ "description": "Represents the rules for legal protest (official debt registration) for non-payment, including the type of protest and the number of days after which the protest is initiated.",+ "properties": {+ "max_partial_payments": {+ "type": "integer",+ "format": "int32",+ "description": "Maximum number of partial payments allowed (Up to 99 for Santander).",+ "example": 99,+ "nullable": true,+ "minimum": 0+ },+ "value_type": {+ "allOf": [+ {+ "$ref": "#/components/schemas/CalculationType"+ }+ ],+ "nullable": true+ }+ }+ },"IntentStatus": {"type": "string","description": "Represents the overall status of a payment intent.\nThe status transitions through various states depending on the payment method, confirmation, capture method, and any subsequent actions (like customer authentication or manual capture).",@@ -15683,6 +15880,24 @@}}},+ "InterestDetail": {+ "type": "object",+ "description": "Represents the rules for applying discounts to a payment, such as a percentage discount or a fixed amount discount, along with any applicable grace periods.",+ "properties": {+ "interest_percentage": {+ "type": "string",+ "description": "Percentage of Juros (Interest). Pattern: ^[0-9]{1,3}\\.[0-9]{2}$",+ "example": "5.00",+ "nullable": true+ },+ "iof_percentage": {+ "type": "string",+ "description": "Percentage of IOF (Financial Operations Tax). Pattern: \\d{3}$\\.\\d{5}\nOnly provided if the agreement is \"Cobra IOF na Barra ou Cadastro\"",+ "example": "32.45325",+ "nullable": true+ }+ }+ },"JCSVoucherData": {"type": "object","properties": {@@ -25282,6 +25497,48 @@}}},+ "PenaltyDetail": {+ "type": "object",+ "description": "Represents the rules for applying discounts to a payment, such as a percentage discount or a fixed amount discount, along with any applicable grace periods.",+ "properties": {+ "value": {+ "type": "string",+ "description": "The numeric value (as a string to preserve decimal precision)",+ "example": "2.00",+ "nullable": true+ },+ "grace_period_days": {+ "type": "integer",+ "format": "int32",+ "description": "Grace period: Days after due date before this applies",+ "example": 1,+ "nullable": true,+ "minimum": 0+ }+ }+ },+ "PenaltyRules": {+ "type": "object",+ "description": "Represents the rules for applying discounts to a payment, such as a percentage discount or a fixed amount discount, along with any applicable grace periods.",+ "properties": {+ "fixed_penalty": {+ "allOf": [+ {+ "$ref": "#/components/schemas/PenaltyDetail"+ }+ ],+ "nullable": true+ },+ "interest": {+ "allOf": [+ {+ "$ref": "#/components/schemas/InterestDetail"+ }+ ],+ "nullable": true+ }+ }+ },"PhoneDetails": {"type": "object","properties": {@@ -26286,6 +26543,35 @@}}},+ "ProtestRules": {+ "type": "object",+ "required": [+ "protest_type",+ "days_after_due_date"+ ],+ "properties": {+ "protest_type": {+ "$ref": "#/components/schemas/ProtestType"+ },+ "days_after_due_date": {+ "type": "integer",+ "format": "int32",+ "description": "Number of days after the due date to initiate the protest",+ "example": 30,+ "minimum": 0+ }+ }+ },+ "ProtestType": {+ "type": "string",+ "description": "Defines the type of protest for non-payment, such as whether the count is based on calendar days, business days, or if the protest logic is determined by a pre-signed contract with the bank.",+ "enum": [+ "disabled",+ "calendar_days",+ "business_days",+ "contract_default"+ ]+ },"ProxyCardDetails": {"type": "object","required": [@@ -28221,6 +28507,74 @@}}},+ "SantanderBoletoData": {+ "type": "object",+ "description": "Represents the specific data and rules related to Santander Boleto payments, including discounts, penalties, collection actions, payment constraints, beneficiary details, and document kind.",+ "properties": {+ "discount_rules": {+ "allOf": [+ {+ "$ref": "#/components/schemas/SantanderPaymentDiscountRules"+ }+ ],+ "nullable": true+ },+ "penalties": {+ "allOf": [+ {+ "$ref": "#/components/schemas/PenaltyRules"+ }+ ],+ "nullable": true+ },+ "collection_actions": {+ "allOf": [+ {+ "$ref": "#/components/schemas/CollectionActions"+ }+ ],+ "nullable": true+ },+ "payment_constraints": {+ "allOf": [+ {+ "$ref": "#/components/schemas/BoletoPaymentTypeConstraints"+ }+ ],+ "nullable": true+ },+ "beneficiary": {+ "allOf": [+ {+ "$ref": "#/components/schemas/BeneficiaryDetails"+ }+ ],+ "nullable": true+ },+ "document_kind": {+ "allOf": [+ {+ "$ref": "#/components/schemas/BoletoDocumentKind"+ }+ ],+ "nullable": true+ }+ }+ },+ "SantanderConnectorMetadataData": {+ "type": "object",+ "description": "Represents the connector-specific metadata for Santander payments, including boleto data and related rules.",+ "properties": {+ "boleto": {+ "allOf": [+ {+ "$ref": "#/components/schemas/SantanderBoletoData"+ }+ ],+ "nullable": true+ }+ }+ },"SantanderData": {"type": "object","properties": {@@ -28231,6 +28585,30 @@},"additionalProperties": false},+ "SantanderPaymentDiscountRules": {+ "type": "object",+ "description": "Defines the type of discount applied to a payment, such as whether it's a fixed date discount, a daily calendar discount, or a daily business discount.",+ "required": [+ "tiers"+ ],+ "properties": {+ "discount_type": {+ "allOf": [+ {+ "$ref": "#/components/schemas/DiscountType"+ }+ ],+ "nullable": true+ },+ "tiers": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/DiscountTier"+ },+ "description": "A generic vector of discount tiers"+ }+ }+ },"ScaExemptionType": {"type": "string","description": "SCA Exemptions types available for authentication",diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rsindex 94f4298458..880beac2c9 100644--- a/crates/api_models/src/payments.rs+++ b/crates/api_models/src/payments.rs@@ -9,7 +9,7 @@ pub mod trait_impls;use cards::{CardNumber, NetworkToken};#[cfg(feature = "v2")]use common_enums::enums::PaymentConnectorTransmission;-use common_enums::{GooglePayCardFundingSource, ProductType};+use common_enums::{self, GooglePayCardFundingSource, ProductType};#[cfg(feature = "v1")]use common_types::primitive_wrappers::{ExtendedAuthorizationAppliedBool, RequestExtendedAuthorizationBool,@@ -314,7 +314,7 @@ pub struct PaymentsCreateIntentRequest {#[schema(value_type = Option<Object>, example = r#"{ "udf1": "some-value", "udf2": "some-value" }"#)]pub metadata: Option<pii::SecretSerdeValue>,- /// Some connectors like Apple pay, Airwallex and Noon might require some additional information, find specific details in the child attributes below.+ /// Some connectors like Airwallex and Noon might require some additional information, find specific details in the child attributes below.pub connector_metadata: Option<ConnectorMetadata>,/// Additional data that might be required by hyperswitch based on the requested features by the merchants.@@ -499,7 +499,7 @@ pub struct PaymentsUpdateIntentRequest {#[schema(value_type = Option<Object>, example = r#"{ "udf1": "some-value", "udf2": "some-value" }"#)]pub metadata: Option<pii::SecretSerdeValue>,- /// Some connectors like Apple pay, Airwallex and Noon might require some additional information, find specific details in the child attributes below.+ /// Some connectors like Airwallex and Noon might require some additional information, find specific details in the child attributes below.#[schema(value_type = Option<ConnectorMetadata>)]pub connector_metadata: Option<ConnectorMetadata>,@@ -674,7 +674,7 @@ pub struct PaymentsIntentResponse {#[schema(value_type = Option<Object>, example = r#"{ "udf1": "some-value", "udf2": "some-value" }"#)]pub metadata: Option<pii::SecretSerdeValue>,- /// Some connectors like Apple pay, Airwallex and Noon might require some additional information, find specific details in the child attributes below.+ /// Some connectors like Airwallex and Noon might require some additional information, find specific details in the child attributes below.#[schema(value_type = Option<ConnectorMetadata>)]pub connector_metadata: Option<ConnectorMetadata>,@@ -820,7 +820,7 @@ pub struct RevenueRecoveryGetIntentResponse {#[schema(value_type = Option<Object>, example = r#"{ "udf1": "some-value", "udf2": "some-value" }"#)]pub metadata: Option<pii::SecretSerdeValue>,- /// Some connectors like Apple pay, Airwallex and Noon might require some additional information, find specific details in the child attributes below.+ /// Some connectors like Airwallex and Noon might require some additional information, find specific details in the child attributes below.#[schema(value_type = Option<ConnectorMetadata>)]pub connector_metadata: Option<ConnectorMetadata>,@@ -1404,7 +1404,7 @@ pub struct PaymentsRequest {#[smithy(value_type = "Option<Object>")]pub metadata: Option<serde_json::Value>,- /// Some connectors like Apple pay, Airwallex and Noon might require some additional information, find specific details in the child attributes below.+ /// Some connectors like Airwallex and Noon might require some additional information, find specific details in the child attributes below.#[smithy(value_type = "Option<ConnectorMetadata>")]pub connector_metadata: Option<ConnectorMetadata>,@@ -8203,7 +8203,7 @@ pub struct PaymentsRequest {#[schema(value_type = Option<Object>, example = r#"{ "udf1": "some-value", "udf2": "some-value" }"#)]pub metadata: Option<pii::SecretSerdeValue>,- /// Some connectors like Apple pay, Airwallex and Noon might require some additional information, find specific details in the child attributes below.+ /// Some connectors like Airwallex and Noon might require some additional information, find specific details in the child attributes below.pub connector_metadata: Option<ConnectorMetadata>,/// Additional data that might be required by hyperswitch based on the requested features by the merchants.@@ -9894,6 +9894,8 @@ pub struct ConnectorMetadata {pub adyen: Option<AdyenConnectorMetadata>,#[smithy(value_type = "Option<PeachpaymentsData>")]pub peachpayments: Option<PeachpaymentsData>,+ #[smithy(value_type = "Option<SantanderData>")]+ pub santander: Option<SantanderConnectorMetadataData>,}#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel)]@@ -11534,12 +11536,14 @@ pub struct BoletoAdditionalDetails {#[schema(value_type = Option<String>, example="2026-12-31")]#[serde(default, with = "common_utils::custom_serde::date_only_optional")]pub due_date: Option<PrimitiveDateTime>,- // It tells the bank what type of commercial document created the boleto. Why does this boleto exist? What kind of transaction or contract caused it?- #[schema(value_type = Option<BoletoDocumentKind>, example="commercial_invoice")]- pub document_kind: Option<common_enums::enums::BoletoDocumentKind>,- // This field tells the bank how the boleto can be paid — whether the payer must pay the exact amount, can pay a different amount, or pay in parts.- #[schema(value_type = Option<BoletoPaymentType>, example="fixed_amount")]- pub payment_type: Option<common_enums::enums::BoletoPaymentType>,+ /// It tells the bank what type of commercial document created the boleto. Why does this boleto exist? What kind of transaction or contract caused it?+ /// Depcreated since it has been moved to connector_metadata+ #[schema(value_type = Option<BoletoDocumentKind>, example="commercial_invoice", deprecated)]+ pub document_kind: Option<common_enums::BoletoDocumentKind>,+ /// This field tells the bank how the boleto can be paid — whether the payer must pay the exact amount, can pay a different amount, or pay in parts.+ /// Depcreated since it has been moved to connector_metadata+ #[schema(value_type = Option<BoletoPaymentType>, example="fixed_amount", deprecated)]+ pub payment_type: Option<common_enums::BoletoPaymentType>,// It is a number which shows a contract between merchant and bank#[schema(value_type = Option<String>, example="3568253")]pub covenant_code: Option<Secret<String>>,@@ -12960,7 +12964,7 @@ pub struct CartesBancairesParams {}impl PaymentsUpdateMetadataRequest {- /// Helper function to validate that at least one of `metadata` or `feature_metadata` is present in the request+ /// Helper function to validate that at least one of `metadata` or `feature_metadata` or `connector_metadata` is present in the requestpub fn validate(&self) -> common_utils::errors::CustomResult<(), ValidationError> {let Self {metadata,@@ -12977,3 +12981,271 @@ impl PaymentsUpdateMetadataRequest {Ok(())}}++/// Represents the connector-specific metadata for Santander payments, including boleto data and related rules.+#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]+pub struct SantanderConnectorMetadataData {+ /// Boleto-specific data and rules for Santander payments+ #[smithy(value_type = "Option<SantanderBoletoData>")]+ pub boleto: Option<SantanderBoletoData>,+}++/// Represents the specific data and rules related to Santander Boleto payments, including discounts, penalties, collection actions, payment constraints, beneficiary details, and document kind.+#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]+pub struct SantanderBoletoData {+ // Rules for applying discounts+ #[smithy(value_type = "Option<SantanderPaymentDiscountRules>")]+ #[schema(value_type = Option<SantanderPaymentDiscountRules>)]+ pub discount_rules: Option<SantanderPaymentDiscountRules>,+ /// Rules for late payments (Interest and Fines)+ #[smithy(value_type = "Option<PenaltyRules>")]+ #[schema(value_type = Option<PenaltyRules>)]+ pub penalties: Option<PenaltyRules>,+ /// Legal or administrative actions for non-payment (Protest/Write-off)+ #[smithy(value_type = "Option<CollectionActions>")]+ #[schema(value_type = Option<CollectionActions>)]+ pub collection_actions: Option<CollectionActions>,+ /// Constraints on how the payment can be made (Partial payments/Limits)+ #[smithy(value_type = "Option<BoletoPaymentTypeConstraints>")]+ #[schema(value_type = Option<BoletoPaymentTypeConstraints>)]+ pub payment_constraints: Option<BoletoPaymentTypeConstraints>,+ #[smithy(value_type = "Option<BeneficiaryDetails>")]+ #[schema(value_type = Option<BeneficiaryDetails>)]+ pub beneficiary: Option<BeneficiaryDetails>,+ #[smithy(value_type = "Option<BoletoDocumentKind>")]+ #[schema(value_type = Option<BoletoDocumentKind>, example = "commercial_invoice")]+ pub document_kind: Option<common_enums::BoletoDocumentKind>,+}++#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]+/// Represents the end-recipient of a payout or fund transfer.+pub struct BeneficiaryDetails {+ /// The full legal name of the individual or entity receiving the funds.+ #[smithy(value_type = "Option<String>")]+ #[schema(value_type = Option<String>, example = "João da Silva")]+ pub name: Option<String>,+ /// The customer's unique identification number (e.g., Tax ID, SSN, Passport Number).+ /// Used by processors to verify the identity of the recipient and prevent fraud.+ /// Length of the document number depends upon the document_type.+ /// For CPF/CNPJ it is typically 11/14 digits long.+ #[smithy(value_type = "Option<String>")]+ #[schema(value_type = Option<String>, example = "9615865832")]+ pub document_number: Option<String>,+ /// The category of identification provided (e.g., Passport, National ID, CPF).+ #[smithy(value_type = "Option<DocumentKind>")]+ #[schema(value_type = Option<DocumentKind>, example = "cpf")]+ pub document_type: Option<DocumentKind>,+}++/// Represents the rules for applying discounts to a payment, such as a percentage discount or a fixed amount discount, along with any applicable grace periods.+#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]+pub struct PenaltyRules {+ /// Fixed fee applied once after the due date (Fine)+ #[smithy(value_type = "Option<PenaltyDetail>")]+ #[schema(value_type = Option<PenaltyDetail>)]+ pub fixed_penalty: Option<PenaltyDetail>,+ /// Recurring cost applied over time (Interest)+ #[smithy(value_type = "Option<InterestDetail>")]+ #[schema(value_type = Option<InterestDetail>)]+ pub interest: Option<InterestDetail>,+}++/// Represents the rules for applying discounts to a payment, such as a percentage discount or a fixed amount discount, along with any applicable grace periods.+#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]+pub struct InterestDetail {+ /// Percentage of Juros (Interest). Pattern: ^[0-9]{1,3}\.[0-9]{2}$+ #[schema(value_type = Option<String>, example = "5.00")]+ #[smithy(value_type = "Option<String>")]+ pub interest_percentage: Option<StringMajorUnit>,+ /// Percentage of IOF (Financial Operations Tax). Pattern: \d{3}$\.\d{5}+ /// Only provided if the agreement is "Cobra IOF na Barra ou Cadastro"+ #[schema(value_type = Option<String>, example = "32.45325")]+ #[smithy(value_type = "Option<String>")]+ pub iof_percentage: Option<StringMajorUnit>,+}++/// Represents the rules for applying discounts to a payment, such as a percentage discount or a fixed amount discount, along with any applicable grace periods.+#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]+pub struct PenaltyDetail {+ /// The numeric value (as a string to preserve decimal precision)+ #[schema(value_type = Option<String>, example = "2.00")]+ #[smithy(value_type = "Option<String>")]+ pub value: Option<StringMajorUnit>,+ /// Grace period: Days after due date before this applies+ #[schema(example = 1)]+ #[smithy(value_type = "Option<u32>")]+ pub grace_period_days: Option<u32>,+}++/// Represents the legal or administrative actions that may be taken for non-payment, such as protest rules and automatic write-off timelines.+#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]+pub struct CollectionActions {+ /// Logic for legal protest (official debt registration)+ #[schema(value_type = Option<ProtestRules>)]+ #[smithy(value_type = "Option<ProtestRules>")]+ pub legal_protest: Option<ProtestRules>,+ /// Days after which the bill is automatically cancelled/written off+ #[schema(value_type = Option<u32>, example = 60)]+ #[smithy(value_type = "Option<u32>")]+ pub auto_write_off_days: Option<u32>,+}++/// Represents the rules for legal protest (official debt registration) for non-payment, including the type of protest and the number of days after which the protest is initiated.+#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel)]+#[serde(rename_all = "snake_case", tag = "type", content = "details")]+pub enum BoletoPaymentTypeConstraints {+ /// Only the exact nominal amount can be paid.+ FixedAmount,+ /// The payer may pay any amount within an allowed range.+ FlexibleAmount(FlexibleAmountDetails),+ /// The payer may make multiple payments, up to a specific limit.+ Installment(InstallmentDetails),+}++/// Represents the rules for legal protest (official debt registration) for non-payment, including the type of protest and the number of days after which the protest is initiated.+#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel)]+pub struct FlexibleAmountDetails {+ /// Minimum value allowed (e.g., "10.00")+ #[schema(value_type = Option<String>, example = "38.02")]+ #[smithy(value_type = "Option<String>")]+ pub min_value: Option<StringMajorUnit>,+ /// Maximum value allowed (e.g., "5000.00")+ #[schema(value_type = Option<String>, example = "38.02")]+ #[smithy(value_type = "Option<String>")]+ pub max_value: Option<StringMajorUnit>,+ /// Defines if the min/max values are percentages or flat amounts+ #[schema(value_type = Option<CalculationType>, example = "percentage")]+ #[smithy(value_type = "Option<CalculationType>")]+ pub value_type: Option<CalculationType>,+}++/// Represents the rules for legal protest (official debt registration) for non-payment, including the type of protest and the number of days after which the protest is initiated.+#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel)]+pub struct InstallmentDetails {+ /// Maximum number of partial payments allowed (Up to 99 for Santander).+ #[schema(value_type = Option<u32>, example = 99)]+ #[smithy(value_type = "Option<u32>")]+ pub max_partial_payments: Option<u32>,+ /// Defines if the min/max values are percentages or flat amounts+ #[schema(value_type = Option<CalculationType>, example = "percentage")]+ #[smithy(value_type = "Option<CalculationType>")]+ pub value_type: Option<CalculationType>,+}++/// Defines how the payment amount is calculated for penalties or discounts, either as a percentage or as a flat amount.+#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]+#[serde(rename_all = "snake_case")]+pub enum CalculationType {+ /// The value is treated as a percentage (e.g., "2.00" represents 2%).+ /// In financial contexts, this is often used for late fees (fines) or+ /// monthly interest rates.+ Percentage,+ /// The value is treated as a fixed monetary amount in the currency's major+ /// or minor unit (e.g., "10.00" represents $10.00).+ /// Typically used for flat-fee penalties or specific rebate amounts.+ FlatAmount,+}++/// Defines the type of payment allowance for a boleto, such as whether only the exact amount is accepted, partial payments are allowed, or overpayment is permitted.+#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]+pub enum PaymentAllowanceType {+ /// Only the exact amount is accepted+ Exact,+ /// Any amount between min and max+ Partial,+ /// Overpayment allowed (common in some B2B contexts)+ Flexible,+}++/// Defines the type of protest for non-payment, such as whether the count is based on calendar days, business days, or if the protest logic is determined by a pre-signed contract with the bank.+#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]+#[serde(rename_all = "snake_case")]+pub enum ProtestType {+ /// No legal protest will be initiated+ Disabled,+ /// Count is based on calendar days (Standard)+ CalendarDays,+ /// Count is based on business days (Mon-Fri, excluding bank holidays)+ BusinessDays,+ /// Protest logic is handled based on the merchant's pre-signed contract/agreement with the bank+ ContractDefault,+}++/// Defines the type of discount applied to a payment, such as whether it's a fixed date discount, a daily calendar discount, or a daily business discount.+#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]+pub struct SantanderPaymentDiscountRules {+ /// Generic label for the logic (e.g., "tier_based", "early_bird")+ #[schema(value_type = Option<DiscountType>, example = "fixed_date")]+ #[smithy(value_type = "Option<DiscountType>")]+ pub discount_type: Option<DiscountType>,+ /// A generic vector of discount tiers+ #[schema(value_type = Vec<DiscountTier>)]+ #[smithy(value_type = "Option<DiscountType>")]+ pub tiers: Vec<DiscountTier>,+}++/// Defines the type of discount applied to a payment, such as whether it's a fixed date discount, a daily calendar discount, or a daily business discount.+#[derive(+ Debug,+ Default,+ Clone,+ PartialEq,+ serde::Serialize,+ serde::Deserialize,+ Display,+ ToSchema,+ SmithyModel,+)]+#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]+pub enum DiscountType {+ /// No discount logic will be applied. The payment amount remains at the base value.+ #[default]+ Standard,+ /// A fixed amount reduction if paid on or before a specific date.+ FixedDate,+ /// A sliding discount calculated per calendar day until the due date.+ DailyCalendar,+ /// A sliding discount calculated per business day until the due date.+ DailyBusiness,+}++#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel)]+#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]+pub struct DiscountTier {+ /// The discount value (e.g., "5.50").+ #[schema(value_type = Option<String>, example = "5.50")]+ #[smithy(value_type = "Option<String>")]+ pub amount: Option<StringMajorUnit>,+ /// The ISO-8601 date until which this discount is valid+ #[schema(value_type = Option<String>, example="2027-12-31")]+ #[serde(default, with = "common_utils::custom_serde::date_only_optional")]+ #[smithy(value_type = "Option<String>")]+ pub end_date: Option<PrimitiveDateTime>,+}++#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel)]+#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]+pub struct ProtestRules {+ /// The timing logic for when the protest should occur+ #[schema(value_type = ProtestType, example = "calendar_days")]+ #[smithy(value_type = "ProtestType")]+ pub protest_type: Option<ProtestType>,+ /// Number of days after the due date to initiate the protest+ #[schema(value_type = u32, example = 30)]+ #[smithy(value_type = "u32")]+ pub days_after_due_date: Option<u32>,+}diff --git a/crates/hyperswitch_connectors/src/connectors/santander/requests.rs b/crates/hyperswitch_connectors/src/connectors/santander/requests.rsindex 877b5d60ee..de91f98e2f 100644--- a/crates/hyperswitch_connectors/src/connectors/santander/requests.rs+++ b/crates/hyperswitch_connectors/src/connectors/santander/requests.rs@@ -22,24 +22,26 @@ pub struct InterestPercentage {}#[derive(Debug, Clone, Serialize, Deserialize)]+#[serde(rename_all = "camelCase")]pub struct Discount {#[serde(rename = "type")]- pub discount_type: DiscountType,+ pub discount_type: SantanderDiscountType,pub discount_one: Option<DiscountObject>,pub discount_two: Option<DiscountObject>,pub discount_three: Option<DiscountObject>,}-#[derive(Debug, Clone, Serialize, Deserialize)]-#[serde(rename_all = "SCREAMING_SNAKE_CASE")]+#[derive(Debug, Default, Clone, Serialize, Deserialize)]+#[serde(rename_all = "camelCase")]pub struct DiscountObject {- pub value: f64,- pub limit_date: String, // YYYY-MM-DD+ pub value: Option<StringMajorUnit>,+ #[serde(default, with = "common_utils::custom_serde::date_only_optional")]+ pub limit_date: Option<time::PrimitiveDateTime>,}#[derive(Debug, Clone, Serialize, Deserialize)]#[serde(rename_all = "SCREAMING_SNAKE_CASE")]-pub enum DiscountType {+pub enum SantanderDiscountType {// No discountIsento,// If the payer pays before a certain date, they get a fixed discount amount@@ -102,7 +104,7 @@ pub struct SantanderAuthRequest {#[derive(Debug, Clone, Serialize, Deserialize)]#[serde(rename_all = "SCREAMING_SNAKE_CASE")]-pub enum ProtestType {+pub enum SantanderProtestType {// No protestSemProtesto,// Protest after X calendar days@@ -272,18 +274,18 @@ pub struct SantanderBoletoPaymentRequest {#[serde(skip_serializing_if = "Option::is_none")]pub discount: Option<Discount>,#[serde(skip_serializing_if = "Option::is_none")]- pub fine_percentage: Option<String>,+ pub fine_percentage: Option<StringMajorUnit>,#[serde(skip_serializing_if = "Option::is_none")]pub fine_quantity_days: Option<String>,#[serde(skip_serializing_if = "Option::is_none")]- pub interest_percentage: Option<String>,+ pub interest_percentage: Option<StringMajorUnit>,#[serde(skip_serializing_if = "Option::is_none")]pub deduction_value: Option<FloatMajorUnit>,// Protest is a formal step a bank or notary office takes to claim unpaid boletos after the due date#[serde(skip_serializing_if = "Option::is_none")]- pub protest_type: Option<ProtestType>,+ pub protest_type: Option<SantanderProtestType>,#[serde(skip_serializing_if = "Option::is_none")]- pub protest_quantity_days: Option<i64>,+ pub protest_quantity_days: Option<String>,// This field tells the bank after how many days past the due date the boleto should be automatically “written off”#[serde(skip_serializing_if = "Option::is_none")]pub write_off_quantity_days: Option<String>,@@ -292,18 +294,18 @@ pub struct SantanderBoletoPaymentRequest {pub payment_type: Option<responses::SantanderBoletoPaymentType>,// This becomes a required field if payment_type is Parcial. This field indicates the number of payments allowed for the same payment slip, with a maximum of 99.#[serde(skip_serializing_if = "Option::is_none")]- pub parcels_quantity: Option<i64>,+ pub parcels_quantity: Option<u32>,// The valueType field defines how the min/max limits are expressed for boletos that allow flexible payments. Only used if paymentType is DIVERGENTE or PARCIAL.#[serde(skip_serializing_if = "Option::is_none")]- pub value_type: Option<ValueType>,+ pub value_type: Option<SantanderValueType>,// This field defines the minimum amount or minimum percentage the payer can pay for a boleto that allows DIVERGENTE or PARCIAL payments.#[serde(skip_serializing_if = "Option::is_none")]- pub min_value_or_percentage: Option<f64>,+ pub min_value_or_percentage: Option<StringMajorUnit>,// This field defines the max amount or max percentage the payer can pay for a boleto that allows DIVERGENTE or PARCIAL payments.#[serde(skip_serializing_if = "Option::is_none")]- pub max_value_or_percentage: Option<f64>,+ pub max_value_or_percentage: Option<StringMajorUnit>,#[serde(skip_serializing_if = "Option::is_none")]- pub iof_percentage: Option<f64>,+ pub iof_percentage: Option<StringMajorUnit>,// This feature allows the merchant (beneficiário) to split the funds received from a boleto into up to four Santander accounts that they own.#[serde(skip_serializing_if = "Option::is_none")]pub sharing: Option<Vec<responses::Sharing>>,@@ -321,7 +323,7 @@ pub struct SantanderBoletoPaymentRequest {#[derive(Debug, Clone, Serialize, Deserialize)]#[serde(rename_all = "UPPERCASE")]-pub enum ValueType {+pub enum SantanderValueType {// PercentagePercentual,// Value terms@@ -336,3 +338,25 @@ pub enum Environment {// ProductionProducao,}++pub type BoletoAdditionalFields = (+ (+ Option<responses::Beneficiary>,+ Option<Discount>,+ Option<responses::SantanderBoletoDocumentKind>,+ ),+ (+ Option<StringMajorUnit>,+ Option<String>,+ Option<StringMajorUnit>,+ Option<StringMajorUnit>,+ ),+ (Option<SantanderProtestType>, Option<String>, Option<String>),+ (+ Option<responses::SantanderBoletoPaymentType>,+ Option<SantanderValueType>,+ Option<u32>,+ Option<StringMajorUnit>,+ Option<StringMajorUnit>,+ ),+);diff --git a/crates/hyperswitch_connectors/src/connectors/santander/responses.rs b/crates/hyperswitch_connectors/src/connectors/santander/responses.rsindex 5e93d9cd42..4f1163fd6b 100644--- a/crates/hyperswitch_connectors/src/connectors/santander/responses.rs+++ b/crates/hyperswitch_connectors/src/connectors/santander/responses.rs@@ -29,7 +29,7 @@ pub enum SantanderDocumentKind {#[serde(rename_all = "camelCase")]pub struct Beneficiary {pub name: Option<Secret<String>>,- pub document_type: Option<String>,+ pub document_type: Option<SantanderDocumentKind>,pub document_number: Option<Secret<String>>,}@@ -147,7 +147,7 @@ pub struct SantanderBoletoPaymentsResponse {pub fine_quantity_days: Option<String>,pub interest_percentage: Option<String>,pub deduction_value: Option<String>,- pub protest_type: Option<requests::ProtestType>,+ pub protest_type: Option<requests::SantanderProtestType>,pub protest_quantity_days: Option<String>,pub write_off_quantity_days: Option<String>,pub payment_type: SantanderBoletoPaymentType,diff --git a/crates/hyperswitch_connectors/src/connectors/santander/transformers.rs b/crates/hyperswitch_connectors/src/connectors/santander/transformers.rsindex 1866c94ea9..b5c27e1dbf 100644--- a/crates/hyperswitch_connectors/src/connectors/santander/transformers.rs+++ b/crates/hyperswitch_connectors/src/connectors/santander/transformers.rs@@ -1,7 +1,9 @@-use api_models::payments::{QrCodeInformation, SantanderData, VoucherNextStepData};-use common_enums::{- enums, AttemptStatus, BoletoDocumentKind, BoletoPaymentType, ExpiryType, PixKey,+use api_models::payments::{+ BeneficiaryDetails, BoletoPaymentTypeConstraints, CalculationType, ConnectorMetadata,+ DiscountTier, DiscountType, ProtestType, QrCodeInformation, SantanderData,+ SantanderPaymentDiscountRules, VoucherNextStepData,};+use common_enums::{enums, AttemptStatus, BoletoDocumentKind, ExpiryType, PixKey};use common_utils::{errors::CustomResult,ext_traits::{Encode, ValueExt},@@ -31,23 +33,23 @@ use url::Url;use crate::{connectors::santander::{requests::{- Environment, SantanderAuthRequest, SantanderAuthType, SantanderBoletoCancelOperation,- SantanderBoletoCancelRequest, SantanderBoletoPaymentRequest,- SantanderBoletoUpdateRequest, SantanderDebtor, SantanderGrantType,- SantanderMetadataObject, SantanderPaymentRequest, SantanderPaymentsCancelRequest,- SantanderPixCancelRequest, SantanderPixDueDateCalendarRequest,- SantanderPixImmediateCalendarRequest, SantanderPixQRPaymentRequest,- SantanderPixRequestCalendar, SantanderRefundRequest, SantanderRouterData,- SantanderValue,+ BoletoAdditionalFields, Discount, DiscountObject, Environment, SantanderAuthRequest,+ SantanderAuthType, SantanderBoletoCancelOperation, SantanderBoletoCancelRequest,+ SantanderBoletoPaymentRequest, SantanderBoletoUpdateRequest, SantanderDebtor,+ SantanderDiscountType, SantanderGrantType, SantanderMetadataObject,+ SantanderPaymentRequest, SantanderPaymentsCancelRequest, SantanderPixCancelRequest,+ SantanderPixDueDateCalendarRequest, SantanderPixImmediateCalendarRequest,+ SantanderPixQRPaymentRequest, SantanderPixRequestCalendar, SantanderProtestType,+ SantanderRefundRequest, SantanderRouterData, SantanderValue, SantanderValueType,},responses::{- Key, NsuComposite, Payer, SanatanderAccessTokenResponse, SanatanderTokenResponse,- SantanderAdditionalInfo, SantanderBoletoDocumentKind, SantanderBoletoPaymentType,- SantanderBoletoStatus, SantanderDocumentKind, SantanderPaymentStatus,- SantanderPaymentsResponse, SantanderPaymentsSyncResponse, SantanderPixKeyType,- SantanderPixQRCodePaymentsResponse, SantanderPixQRCodeSyncResponse,- SantanderRefundResponse, SantanderRefundStatus, SantanderUpdateMetadataResponse,- SantanderVoidResponse, SantanderVoidStatus,+ Beneficiary, Key, NsuComposite, Payer, SanatanderAccessTokenResponse,+ SanatanderTokenResponse, SantanderAdditionalInfo, SantanderBoletoDocumentKind,+ SantanderBoletoPaymentType, SantanderBoletoStatus, SantanderDocumentKind,+ SantanderPaymentStatus, SantanderPaymentsResponse, SantanderPaymentsSyncResponse,+ SantanderPixKeyType, SantanderPixQRCodePaymentsResponse,+ SantanderPixQRCodeSyncResponse, SantanderRefundResponse, SantanderRefundStatus,+ SantanderUpdateMetadataResponse, SantanderVoidResponse, SantanderVoidStatus,},},types::{RefreshTokenRouterData, RefundsResponseRouterData, ResponseRouterData},@@ -376,36 +378,19 @@ impllet bank_number = nsu_code.clone();- let (due_date, payment_type, document_kind) = {- let details = value+ let due_date = Some(+ value.0.router_data.request.feature_metadata.as_ref().and_then(|fm| fm.boleto_additional_details.as_ref())- .ok_or_else(|| errors::ConnectorError::MissingRequiredField {- field_name: "feature_metadata.boleto_additional_details",- })?;-- (- Some(details.due_date.as_ref().copied().ok_or_else(|| {- errors::ConnectorError::MissingRequiredField {- field_name: "feature_metadata.boleto_additional_details.due_date",- }- })?),- Some(details.payment_type.as_ref().copied().ok_or_else(|| {- errors::ConnectorError::MissingRequiredField {- field_name: "feature_metadata.boleto_additional_details.payment_type",- }- })?),- Some(details.document_kind.as_ref().copied().ok_or_else(|| {- errors::ConnectorError::MissingRequiredField {- field_name: "feature_metadata.boleto_additional_details.document_kind",- }- })?),- )- };+ .and_then(|details| details.due_date)+ .ok_or(errors::ConnectorError::MissingRequiredField {+ field_name: "feature_metadata.boleto_additional_details.due_date",+ })?,+ );let covenant_code = value.0@@ -501,6 +486,26 @@ implzip_code: Some(value.0.router_data.get_billing_zip()?),});+ let (+ (beneficiary, discount, document_kind),+ (fine_percentage, fine_quantity_days, interest_percentage, iof_percentage),+ (protest_type, protest_quantity_days, write_off_quantity_days),+ (+ payment_type,+ value_type,+ parcels_quantity,+ min_value_or_percentage,+ max_value_or_percentage,+ ),+ ) = get_boleto_additional_fields_from_connector_metadata(+ value+ .0+ .router_data+ .request+ .connector_intent_metadata+ .clone(),+ );+Ok(Self::Boleto(Box::new(SantanderBoletoPaymentRequest {environment: Some(Environment::Producao),nsu_code,@@ -523,22 +528,22 @@ implnominal_value: Some(value.0.amount.to_owned()),participant_code: order_id,payer,- beneficiary: None,- document_kind: document_kind.map(SantanderBoletoDocumentKind::from),- discount: None,- fine_percentage: None,- fine_quantity_days: None,- interest_percentage: None,+ beneficiary,+ document_kind,+ discount,+ fine_percentage,+ fine_quantity_days,+ interest_percentage,+ protest_type,+ protest_quantity_days,+ write_off_quantity_days,+ payment_type,+ parcels_quantity,+ value_type,+ min_value_or_percentage,+ max_value_or_percentage,+ iof_percentage,deduction_value: None,- protest_type: None,- protest_quantity_days: None,- write_off_quantity_days: None,- payment_type: payment_type.map(SantanderBoletoPaymentType::from),- parcels_quantity: None,- value_type: None,- min_value_or_percentage: None,- max_value_or_percentage: None,- iof_percentage: None,sharing: None,tx_id: None,key,@@ -754,16 +759,6 @@ impl From<BoletoDocumentKind> for SantanderBoletoDocumentKind {}}-impl From<BoletoPaymentType> for SantanderBoletoPaymentType {- fn from(item: BoletoPaymentType) -> Self {- match item {- BoletoPaymentType::FixedAmount => Self::Registro,- BoletoPaymentType::FlexibleAmount => Self::Divergente,- BoletoPaymentType::Installment => Self::Parcial,- }- }-}-impl From<router_env::env::Env> for Environment {fn from(item: router_env::env::Env) -> Self {match item {@@ -1239,10 +1234,29 @@ impl TryFrom<&PaymentsUpdateMetadataRouterData> for SantanderBoletoPaymentReques.or(Some(boleto_mca_metadata.covenant_code.clone()))});+ let key = Some(Key {+ key_type: value+ .request+ .feature_metadata+ .as_ref()+ .and_then(|data| {+ data.get_boleto_pix_key_and_value()+ .0+ .map(SantanderPixKeyType::from)+ })+ .or(boleto_mca_metadata.pix_key_type),+ dict_key: value+ .request+ .feature_metadata+ .as_ref()+ .and_then(|data| data.get_boleto_pix_key_and_value().1)+ .or(boleto_mca_metadata.pix_key_value.clone()),+ });+Ok(Self {bank_number: Some(value.connector_request_reference_id.clone()),covenant_code,- environment: None,+ environment: Some(Environment::Producao),due_date: Some(format_as_date_only(due_date)?),nsu_code: None,nsu_date: None,@@ -1257,7 +1271,6 @@ impl TryFrom<&PaymentsUpdateMetadataRouterData> for SantanderBoletoPaymentRequesfine_percentage: None,fine_quantity_days: None,interest_percentage: None,- deduction_value: None,protest_type: None,protest_quantity_days: None,write_off_quantity_days: None,@@ -1267,8 +1280,9 @@ impl TryFrom<&PaymentsUpdateMetadataRouterData> for SantanderBoletoPaymentRequesmin_value_or_percentage: None,max_value_or_percentage: None,iof_percentage: None,+ deduction_value: None,sharing: None,- key: None,+ key,tx_id: None,messages: None,})@@ -1426,3 +1440,170 @@ pub fn format_as_date_only(dt.format(&format).map_err(|_| errors::ConnectorError::ParsingFailed)}++impl From<BeneficiaryDetails> for Beneficiary {+ fn from(b: BeneficiaryDetails) -> Self {+ Self {+ name: b.name.map(Secret::new),+ document_type: b.document_type.map(Into::into),+ document_number: b.document_number.map(Secret::new),+ }+ }+}++impl From<SantanderPaymentDiscountRules> for Discount {+ fn from(rules: SantanderPaymentDiscountRules) -> Self {+ let mut tiers = rules.tiers.into_iter();+ let map_tier = |tier: DiscountTier| -> DiscountObject {+ DiscountObject {+ value: tier.amount,+ limit_date: tier.end_date,+ }+ };+ Self {+ discount_type: SantanderDiscountType::from(rules.discount_type.unwrap_or_default()),+ discount_one: tiers.next().map(map_tier),+ discount_two: tiers.next().map(map_tier),+ discount_three: tiers.next().map(map_tier),+ }+ }+}++impl From<DiscountType> for SantanderDiscountType {+ fn from(value: DiscountType) -> Self {+ match value {+ DiscountType::Standard => Self::Isento,+ DiscountType::FixedDate => Self::ValorDataFixa,+ DiscountType::DailyCalendar => Self::ValorDiaCorrido,+ DiscountType::DailyBusiness => Self::ValorDiaUtil,+ }+ }+}++impl From<ProtestType> for SantanderProtestType {+ fn from(value: ProtestType) -> Self {+ match value {+ ProtestType::Disabled => Self::SemProtesto,+ ProtestType::CalendarDays => Self::DiasCorridos,+ ProtestType::BusinessDays => Self::DiasUteis,+ ProtestType::ContractDefault => Self::CadastroConvenio,+ }+ }+}++impl From<CalculationType> for SantanderValueType {+ fn from(calc_type: CalculationType) -> Self {+ match calc_type {+ CalculationType::Percentage => Self::Percentual,+ CalculationType::FlatAmount => Self::Valor,+ }+ }+}++impl From<BoletoPaymentTypeConstraints> for SantanderBoletoPaymentType {+ fn from(internal_type: BoletoPaymentTypeConstraints) -> Self {+ match internal_type {+ BoletoPaymentTypeConstraints::FixedAmount => Self::Registro,+ BoletoPaymentTypeConstraints::FlexibleAmount(_) => Self::Divergente,+ BoletoPaymentTypeConstraints::Installment(_) => Self::Parcial,+ }+ }+}++fn get_boleto_additional_fields_from_connector_metadata(+ metadata: Option<ConnectorMetadata>,+) -> BoletoAdditionalFields {+ metadata+ .and_then(|m| m.santander)+ .and_then(|s| s.boleto)+ .map(|b| {+ let fine = b.penalties.as_ref().and_then(|p| p.fixed_penalty.as_ref());+ let fine_quantity_days = fine.and_then(|f| f.grace_period_days.map(|d| d.to_string()));+ let fine_percentage = fine.and_then(|f| f.value.clone());++ let (interest_percentage, iof_percentage) = b+ .penalties+ .as_ref()+ .and_then(|p| p.interest.as_ref())+ .map(|i| (i.interest_percentage.clone(), i.iof_percentage.clone()))+ .unwrap_or((None, None));++ let protest = b+ .collection_actions+ .as_ref()+ .and_then(|c| c.legal_protest.as_ref());++ let beneficiary = b.beneficiary.map(Beneficiary::from);+ let discount = b.discount_rules.map(Discount::from);+ let protest_type = protest.and_then(|p| {+ p.protest_type+ .as_ref()+ .map(|pt| SantanderProtestType::from(pt.clone()))+ });+ let write_off_quantity_days = b+ .collection_actions+ .as_ref()+ .and_then(|c| c.auto_write_off_days.map(|d| d.to_string()));+ let protest_quantity_days =+ protest.and_then(|p| p.days_after_due_date.map(|d| d.to_string()));+ let document_kind = b.document_kind.map(SantanderBoletoDocumentKind::from);++ let (+ payment_type,+ value_type,+ parcels_quantity,+ min_value_or_percentage,+ max_value_or_percentage,+ ) = match b.payment_constraints {+ Some(ref constraints) => match constraints {+ BoletoPaymentTypeConstraints::FixedAmount => (+ Some(SantanderBoletoPaymentType::from(constraints.clone())),+ None,+ None,+ None,+ None,+ ),+ BoletoPaymentTypeConstraints::FlexibleAmount(ref details) => (+ Some(SantanderBoletoPaymentType::from(constraints.clone())),+ details+ .value_type+ .as_ref()+ .map(|vt| SantanderValueType::from(vt.clone())),+ None,+ details.min_value.clone(),+ details.max_value.clone(),+ ),+ BoletoPaymentTypeConstraints::Installment(ref details) => (+ Some(SantanderBoletoPaymentType::from(constraints.clone())),+ details+ .value_type+ .as_ref()+ .map(|vt| SantanderValueType::from(vt.clone())),+ details.max_partial_payments,+ None,+ None,+ ),+ },+ None => (None, None, None, None, None),+ };++ (+ (beneficiary, discount, document_kind),+ (+ fine_percentage,+ fine_quantity_days,+ interest_percentage,+ iof_percentage,+ ),+ (protest_type, protest_quantity_days, write_off_quantity_days),+ (+ payment_type,+ value_type,+ parcels_quantity,+ min_value_or_percentage,+ max_value_or_percentage,+ ),+ )+ })+ .unwrap_or_default()+}diff --git a/crates/hyperswitch_connectors/src/utils.rs b/crates/hyperswitch_connectors/src/utils.rsindex 24f8aa4bcd..c836bc1194 100644--- a/crates/hyperswitch_connectors/src/utils.rs+++ b/crates/hyperswitch_connectors/src/utils.rs@@ -7564,6 +7564,7 @@ pub(crate) fn convert_setup_mandate_router_data_to_authorize_router_data(rrn: None,feature_metadata: None,installment_details: None,+ connector_intent_metadata: None,}}diff --git a/crates/hyperswitch_domain_models/src/payments.rs b/crates/hyperswitch_domain_models/src/payments.rsindex 3db2a7709b..ffab0824e1 100644--- a/crates/hyperswitch_domain_models/src/payments.rs+++ b/crates/hyperswitch_domain_models/src/payments.rs@@ -1,9 +1,9 @@#[cfg(feature = "v2")]use std::marker::PhantomData;-use api_models::customers::CustomerDocumentDetails;#[cfg(feature = "v2")]-use api_models::payments::{ConnectorMetadata, SessionToken, VaultSessionDetails};+use api_models::payments::{SessionToken, VaultSessionDetails};+use api_models::{customers::CustomerDocumentDetails, payments::ConnectorMetadata};use common_types::primitive_wrappers;#[cfg(feature = "v1")]use common_types::{@@ -426,6 +426,21 @@ impl PaymentIntent {.map(|opt| opt.flatten()).map_err(|report| (*report.current_context()).clone())}++ #[cfg(feature = "v1")]+ pub fn get_connector_metadata_from_intent(+ &self,+ ) -> CustomResult<Option<ConnectorMetadata>, common_utils::errors::ParsingError> {+ self.connector_metadata+ .as_ref()+ .map(|metadata| {+ metadata+ .clone()+ .parse_value::<ConnectorMetadata>("ConnectorMetadata")+ })+ .transpose()+ }+#[cfg(feature = "v1")]pub fn get_optional_feature_metadata(&self,diff --git a/crates/hyperswitch_domain_models/src/router_request_types.rs b/crates/hyperswitch_domain_models/src/router_request_types.rsindex c6aec33951..7b6f64755e 100644--- a/crates/hyperswitch_domain_models/src/router_request_types.rs+++ b/crates/hyperswitch_domain_models/src/router_request_types.rs@@ -4,7 +4,9 @@ pub mod merchant_connector_webhook_management;pub mod revenue_recovery;pub mod subscriptions;pub mod unified_authentication_service;-use api_models::payments::{AdditionalPaymentData, AddressDetails, RequestSurchargeDetails};+use api_models::payments::{+ AdditionalPaymentData, AddressDetails, ConnectorMetadata, RequestSurchargeDetails,+};use common_types::payments as common_payments_types;use common_utils::{consts, errors,@@ -105,6 +107,8 @@ pub struct PaymentsAuthorizeData {pub rrn: Option<String>,pub feature_metadata: Option<api_models::payments::FeatureMetadata>,pub installment_details: Option<common_types::payments::InstallmentData>,+ // Contains the connector specific metadata coming from payments request+ pub connector_intent_metadata: Option<ConnectorMetadata>,}#[derive(Debug, Clone, Serialize)]diff --git a/crates/openapi/src/openapi.rs b/crates/openapi/src/openapi.rsindex 14f8927a1b..8ec68ed9a2 100644--- a/crates/openapi/src/openapi.rs+++ b/crates/openapi/src/openapi.rs@@ -605,6 +605,22 @@ Never share your secret api keys. Keep them guarded and secure.api_models::payments::ApplePayAddressParameters,api_models::payments::AmountInfo,api_models::payments::ClickToPaySessionResponse,+ api_models::payments::SantanderConnectorMetadataData,+ api_models::payments::SantanderBoletoData,+ api_models::payments::BoletoPaymentTypeConstraints,+ api_models::payments::BeneficiaryDetails,+ api_models::payments::InterestDetail,+ api_models::payments::FlexibleAmountDetails,+ api_models::payments::InstallmentDetails,+ api_models::payments::CalculationType,+ api_models::payments::ProtestType,+ api_models::payments::SantanderPaymentDiscountRules,+ api_models::payments::DiscountType,+ api_models::payments::DiscountTier,+ api_models::payments::PenaltyRules,+ api_models::payments::PenaltyDetail,+ api_models::payments::CollectionActions,+ api_models::payments::ProtestRules,api_models::enums::ProductType,api_models::enums::MerchantAccountType,api_models::enums::MerchantAccountRequestType,diff --git a/crates/openapi/src/openapi_v2.rs b/crates/openapi/src/openapi_v2.rsindex 3d309157aa..1a4db4a0c6 100644--- a/crates/openapi/src/openapi_v2.rs+++ b/crates/openapi/src/openapi_v2.rs@@ -706,6 +706,22 @@ Never share your secret api keys. Keep them guarded and secure.api_models::payments::MobilePaymentResponse,api_models::payments::NetworkTokenData,api_models::payments::Address,+ api_models::payments::SantanderConnectorMetadataData,+ api_models::payments::SantanderBoletoData,+ api_models::payments::BoletoPaymentTypeConstraints,+ api_models::payments::BeneficiaryDetails,+ api_models::payments::InterestDetail,+ api_models::payments::FlexibleAmountDetails,+ api_models::payments::InstallmentDetails,+ api_models::payments::CalculationType,+ api_models::payments::ProtestType,+ api_models::payments::SantanderPaymentDiscountRules,+ api_models::payments::DiscountType,+ api_models::payments::DiscountTier,+ api_models::payments::PenaltyRules,+ api_models::payments::PenaltyDetail,+ api_models::payments::CollectionActions,+ api_models::payments::ProtestRules,api_models::payouts::CardPayout,api_models::payouts::Wallet,api_models::payouts::Paypal,diff --git a/crates/router/src/core/authentication.rs b/crates/router/src/core/authentication.rsindex 855a7cc4d8..a77686c935 100644--- a/crates/router/src/core/authentication.rs+++ b/crates/router/src/core/authentication.rs@@ -160,9 +160,12 @@ pub async fn perform_post_authentication(&authentication,payment_id,)?;- let router_data =- utils::do_auth_connector_call(state, authentication_connector.to_string(), router_data)- .await?;+ let router_data = Box::pin(utils::do_auth_connector_call(+ state,+ authentication_connector.to_string(),+ router_data,+ ))+ .await?;let authentication_info =hyperswitch_domain_models::router_request_types::authentication::AuthenticationInfo {@@ -261,11 +264,11 @@ pub async fn perform_pre_authentication(business_profile.merchant_id.clone(),payment_id.clone(),)?;- let router_data = utils::do_auth_connector_call(+ let router_data = Box::pin(utils::do_auth_connector_call(state,authentication_connector_name.clone(),router_data,- )+ )).await?;let authentication_info =@@ -279,14 +282,14 @@ pub async fn perform_pre_authentication(merchant_country_code: None,};- let updated_authentication = utils::update_trackers(+ let updated_authentication = Box::pin(utils::update_trackers(state,router_data,authentication,acquirer_details.clone(),processor.get_key_store(),authentication_info,- )+ )).await?;// from version call response, we will get to know the maximum supported 3ds version.// If the version is not greater than or equal to 3DS 2.0, We should not do the successive pre authentication call.@@ -310,8 +313,12 @@ pub async fn perform_pre_authentication(business_profile.merchant_id.clone(),payment_id,)?;- let router_data =- utils::do_auth_connector_call(state, authentication_connector_name, router_data).await?;+ let router_data = Box::pin(utils::do_auth_connector_call(+ state,+ authentication_connector_name,+ router_data,+ ))+ .await?;let authentication_info =hyperswitch_domain_models::router_request_types::authentication::AuthenticationInfo {@@ -324,14 +331,14 @@ pub async fn perform_pre_authentication(merchant_country_code: None,};- let authentication_update = utils::update_trackers(+ let authentication_update = Box::pin(utils::update_trackers(state,router_data,authentication,acquirer_details,processor.get_key_store(),authentication_info,- )+ )).await?;Ok(diff --git a/crates/router/src/core/payment_method_balance.rs b/crates/router/src/core/payment_method_balance.rsindex 414605e7a4..b298024c21 100644--- a/crates/router/src/core/payment_method_balance.rs+++ b/crates/router/src/core/payment_method_balance.rs@@ -247,14 +247,14 @@ pub async fn payments_check_and_apply_pm_data_core()}None => {- match payments_check_gift_card_balance_core(+ match Box::pin(payments_check_gift_card_balance_core(&state,&platform,&profile,&_req_state,pm.clone(),&payment_id,- )+ )).await{Ok((balance, currency)) => {diff --git a/crates/router/src/core/payment_methods.rs b/crates/router/src/core/payment_methods.rsindex e0bdc3f06f..dc66081574 100644--- a/crates/router/src/core/payment_methods.rs+++ b/crates/router/src/core/payment_methods.rs@@ -1442,21 +1442,17 @@ impl PaymentMethodResolver {logger::debug!("No CVC found in the payment method request, trying to retrieve from redis");- let existing_cvc_expiry_details =- vault::retrieve_key_and_ttl_for_cvc_from_payment_method_id(- state,- existing_pm.id.to_owned(),- )- .await- .change_context(errors::ApiErrorResponse::InternalServerError)- .attach_printable("Failed to retrieve cvc from redis")- .ok()- .map(|time| {- payment_methods::CardCVCTokenStorageDetails::generate_expiry_timestamp(- time,- )- });- existing_cvc_expiry_details+ vault::retrieve_key_and_ttl_for_cvc_from_payment_method_id(+ state,+ existing_pm.id.to_owned(),+ )+ .await+ .change_context(errors::ApiErrorResponse::InternalServerError)+ .attach_printable("Failed to retrieve cvc from redis")+ .ok()+ .map(|time| {+ payment_methods::CardCVCTokenStorageDetails::generate_expiry_timestamp(time)+ })};let billing = billing_address.clone()@@ -3517,12 +3513,12 @@ pub async fn vault_payment_method(let payment_method_custom_data =get_payment_method_custom_data(pmd.clone(), vault_token_selector)?;- vault_payment_method_external(+ Box::pin(vault_payment_method_external(state,&payment_method_custom_data,platform.get_provider().get_account(),merchant_connector_account,- )+ )).await.map(|value| (value, Some(external_vault_source)))}diff --git a/crates/router/src/core/payments/flows/external_proxy_flow.rs b/crates/router/src/core/payments/flows/external_proxy_flow.rsindex ca5e7575af..9dfbcfb159 100644--- a/crates/router/src/core/payments/flows/external_proxy_flow.rs+++ b/crates/router/src/core/payments/flows/external_proxy_flow.rs@@ -125,8 +125,14 @@ impl Feature<api::ExternalVaultProxy, types::ExternalVaultProxyPaymentsData>creds_identifier: Option<&str>,gateway_context: &payments::gateway::context::RouterGatewayContext,) -> RouterResult<types::AddAccessTokenResult> {- access_token::add_access_token(state, connector, self, creds_identifier, gateway_context)- .await+ Box::pin(access_token::add_access_token(+ state,+ connector,+ self,+ creds_identifier,+ gateway_context,+ ))+ .await}async fn add_session_token<'a>(diff --git a/crates/router/src/core/payments/transformers.rs b/crates/router/src/core/payments/transformers.rsindex f88aab2c45..54f0cb7b90 100644--- a/crates/router/src/core/payments/transformers.rs+++ b/crates/router/src/core/payments/transformers.rs@@ -493,6 +493,7 @@ pub async fn construct_payment_router_data_for_authorize<'a>(rrn,feature_metadata: None,installment_details: None,+ connector_intent_metadata: None,};let connector_mandate_request_reference_id = payment_data.payment_attempt@@ -4834,6 +4835,7 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsAuthorizrrn,feature_metadata: None,installment_details: None,+ connector_intent_metadata: None,})}}@@ -4887,6 +4889,12 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsAuthoriz.change_context(errors::ApiErrorResponse::InternalServerError).attach_printable("Failed to parse feature metadata")?;+ let connector_intent_metadata = payment_data+ .get_payment_intent()+ .get_connector_metadata_from_intent()+ .change_context(errors::ApiErrorResponse::InternalServerError)+ .attach_printable("Failed to parse connector metadata")?;+let order_category = connector_metadata.as_ref().and_then(|cm| {cm.noon.as_ref()@@ -5102,6 +5110,7 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsAuthorizrrn,feature_metadata,installment_details: payment_data.payment_attempt.installment_data.clone(),+ connector_intent_metadata,})}}diff --git a/crates/router/src/core/relay.rs b/crates/router/src/core/relay.rsindex 7bcfe5dd1e..87dd7649f8 100644--- a/crates/router/src/core/relay.rs+++ b/crates/router/src/core/relay.rs@@ -836,12 +836,12 @@ pub async fn relay_retrieve(}common_enums::RelayType::Capture => {if should_call_connector_for_relay_capture_status(&relay_record, req.force_sync) {- let relay_response = sync_relay_capture_with_gateway(+ let relay_response = Box::pin(sync_relay_capture_with_gateway(&state,&platform,&relay_record,connector_account,- )+ )).await?;db.update_relay(diff --git a/crates/router/src/core/unified_authentication_service.rs b/crates/router/src/core/unified_authentication_service.rsindex 48628c90e6..4a4218fcad 100644--- a/crates/router/src/core/unified_authentication_service.rs+++ b/crates/router/src/core/unified_authentication_service.rs@@ -203,11 +203,11 @@ impl UnifiedAuthenticationService for ClickToPay {payment_id.cloned(),)?;- utils::do_auth_connector_call(+ Box::pin(utils::do_auth_connector_call(state,UNIFIED_AUTHENTICATION_SERVICE.to_string(),post_auth_router_data,- )+ )).await}@@ -275,11 +275,11 @@ impl UnifiedAuthenticationService for ClickToPay {payment_id.cloned(),)?;- utils::do_auth_connector_call(+ Box::pin(utils::do_auth_connector_call(state,UNIFIED_AUTHENTICATION_SERVICE.to_string(),authentication_confirmation_router_data,- )+ )).await.ok(); // marking this as .ok() since this is not a required step at our end for completing the transaction@@ -556,11 +556,11 @@ impl UnifiedAuthenticationService for ExternalAuthentication {payment_id.cloned(),)?;- utils::do_auth_connector_call(+ Box::pin(utils::do_auth_connector_call(state,UNIFIED_AUTHENTICATION_SERVICE.to_string(),auth_router_data,- )+ )).await}}diff --git a/crates/router/src/core/unified_connector_service.rs b/crates/router/src/core/unified_connector_service.rsindex e3c4472118..4ad75bd4aa 100644--- a/crates/router/src/core/unified_connector_service.rs+++ b/crates/router/src/core/unified_connector_service.rs@@ -530,7 +530,7 @@ fn build_rollout_keys(// Detect if this is a refund flow based on flow namelet is_refund_flow = matches!(flow_name, "Execute" | "RSync");- let rollout_key = if is_refund_flow {+ if is_refund_flow {// Refund flows: UCS_merchant_connector_flow (e.g., UCS_merchant123_stripe_Execute)format!("{}_{}_{}_{}",@@ -583,9 +583,7 @@ fn build_rollout_keys()}}- };-- rollout_key+ }}/// Extracts the gateway system from the payment intent's feature metadatadiff --git a/crates/router/src/core/webhooks/incoming.rs b/crates/router/src/core/webhooks/incoming.rsindex a790e9985d..c890f5aec3 100644--- a/crates/router/src/core/webhooks/incoming.rs+++ b/crates/router/src/core/webhooks/incoming.rs@@ -253,13 +253,13 @@ async fn incoming_webhooks_core<W: types::OutgoingWebhookType>(let (uas_connector, _) =get_connector_by_connector_name(&state, UNIFIED_AUTHENTICATION_SERVICE, None)?;- let webhook_processing_result = process_uas_incoming_webhook(+ let webhook_processing_result = Box::pin(process_uas_incoming_webhook(&state,&request_details,connector_name.clone(),uas_connector.clone(),platform.clone(),- )+ )).await;(uas_connector, connector_name, webhook_processing_result)@@ -3416,11 +3416,11 @@ pub async fn process_uas_incoming_webhook<'a>(None,)?; // check of paymentId is present- let response = uas_utils::do_auth_connector_call(+ let response = Box::pin(uas_utils::do_auth_connector_call(state,UNIFIED_AUTHENTICATION_SERVICE.to_string(),webhook_router_data,- )+ )).await?;let response_body = match response.response {diff --git a/crates/router/src/types.rs b/crates/router/src/types.rsindex 3b14a34604..11ac54b0b2 100644--- a/crates/router/src/types.rs+++ b/crates/router/src/types.rs@@ -1336,6 +1336,7 @@ impl ForeignFrom<&SetupMandateRouterData> for PaymentsAuthorizeData {rrn: None,feature_metadata: None,installment_details: None,+ connector_intent_metadata: None,}}}diff --git a/crates/router/src/types/api/verify_connector.rs b/crates/router/src/types/api/verify_connector.rsindex e5a9e16157..38feb07823 100644--- a/crates/router/src/types/api/verify_connector.rs+++ b/crates/router/src/types/api/verify_connector.rs@@ -77,6 +77,7 @@ impl VerifyConnectorData {rrn: None,feature_metadata: None,installment_details: None,+ connector_intent_metadata: None,}}diff --git a/crates/router/src/workflows/revenue_recovery.rs b/crates/router/src/workflows/revenue_recovery.rsindex 8fa837e8be..7639fb8dcd 100644--- a/crates/router/src/workflows/revenue_recovery.rs+++ b/crates/router/src/workflows/revenue_recovery.rs@@ -1079,7 +1079,7 @@ pub async fn call_decider_for_payment_processor_tokens_select_closest_time(// Unlock the customer status only if all tokens are hard declined and payment intent is in Failed statuslet _unlocked = match payment_intent.status {common_enums::enums::IntentStatus::Failed => {- let lock_released = RedisTokenManager::unlock_connector_customer_status(+ RedisTokenManager::unlock_connector_customer_status(state,connector_customer_id,&payment_intent.id,@@ -1089,8 +1089,7 @@ pub async fn call_decider_for_payment_processor_tokens_select_closest_time(errors::ProcessTrackerError::ERedisError(errors::RedisError::RedisConnectionError.into(),),- )?;- lock_released+ )?}_ => false,};diff --git a/crates/router/tests/connectors/utils.rs b/crates/router/tests/connectors/utils.rsindex 780582f117..7edce78ac5 100644--- a/crates/router/tests/connectors/utils.rs+++ b/crates/router/tests/connectors/utils.rs@@ -1025,6 +1025,7 @@ impl Default for PaymentAuthorizeType {rrn: None,feature_metadata: None,installment_details: None,+ connector_intent_metadata: None,};Self(data)}