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(framework): Add Smithy Annotations for Payments and Refunds Payloads (#9911)
Debarshi Gupta751816810b83
diff --git a/Cargo.lock b/Cargo.lockindex ce6a2876da..e4a9185d18 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -474,6 +474,8 @@ dependencies = ["router_derive","serde","serde_json",+ "smithy",+ "smithy-core","strum 0.26.3","tempfile","time",@@ -2005,6 +2007,8 @@ dependencies = ["router_derive","serde","serde_json",+ "smithy",+ "smithy-core","strum 0.26.3","thiserror 1.0.69","utoipa",@@ -2023,6 +2027,8 @@ dependencies = ["masking 0.1.0","serde","serde_json",+ "smithy",+ "smithy-core","time","utoipa",]diff --git a/crates/api_models/Cargo.toml b/crates/api_models/Cargo.tomlindex 16403f0e25..3582b8cb88 100644--- a/crates/api_models/Cargo.toml+++ b/crates/api_models/Cargo.toml@@ -48,6 +48,8 @@ common_utils = { version = "0.1.0", path = "../common_utils" }euclid = { version = "0.1.0", path = "../euclid" }masking = { version = "0.1.0", path = "../masking", default-features = false, features = ["alloc", "serde"] }router_derive = { version = "0.1.0", path = "../router_derive" }+smithy = { version = "0.1.0", path = "../smithy" }+smithy-core = { version = "0.1.0", path = "../smithy-core" }[lints]workspace = truediff --git a/crates/api_models/src/admin.rs b/crates/api_models/src/admin.rsindex 9d2ae85001..4886866b6e 100644--- a/crates/api_models/src/admin.rs+++ b/crates/api_models/src/admin.rs@@ -14,6 +14,7 @@ use common_utils::{crypto::OptionalEncryptableName, ext_traits::ValueExt};use masking::ExposeInterface;use masking::{PeekInterface, Secret};use serde::{Deserialize, Serialize};+use smithy::SmithyModel;use utoipa::ToSchema;use super::payments::AddressDetails;@@ -2026,9 +2027,21 @@ pub struct ToggleAllKVResponse {}/// Merchant connector details used to make payments.-#[derive(Debug, Clone, Default, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Debug,+ Clone,+ Default,+ Eq,+ PartialEq,+ serde::Deserialize,+ serde::Serialize,+ SmithyModel,+ ToSchema,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct MerchantConnectorDetailsWrap {/// Creds Identifier is to uniquely identify the credentials. Do not send any sensitive info, like encoded_data in this field. And do not send the string "null".+ #[smithy(value_type = "String")]pub creds_identifier: String,/// Merchant connector details type type. Base64 Encode the credentials and send it in this type and send as a string.#[schema(value_type = Option<MerchantConnectorDetails>, example = r#"{@@ -2041,16 +2054,20 @@ pub struct MerchantConnectorDetailsWrap {"user_defined_field_2": "sample_2",},}"#)]+ #[smithy(value_type = "Option<MerchantConnectorDetails>")]pub encoded_data: Option<Secret<String>>,}-#[derive(Debug, Clone, Deserialize, Serialize, ToSchema)]+#[derive(Debug, Clone, Deserialize, Serialize, SmithyModel, ToSchema)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct MerchantConnectorDetails {/// Account details of the Connector. You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Useful for storing additional, structured information on an object.#[schema(value_type = Option<Object>,example = json!({ "auth_type": "HeaderKey","api_key": "Basic MyVerySecretApiKey" }))]+ #[smithy(value_type = "Option<Object>")]pub connector_account_details: pii::SecretSerdeValue,/// Metadata is useful for storing additional, unstructured information on an object.#[schema(value_type = Option<Object>,max_length = 255,example = json!({ "city": "NY", "unit": "245" }))]+ #[smithy(value_type = "Option<Object>")]pub metadata: Option<pii::SecretSerdeValue>,}diff --git a/crates/api_models/src/disputes.rs b/crates/api_models/src/disputes.rsindex 7844b2ff6a..d84cdd58c0 100644--- a/crates/api_models/src/disputes.rs+++ b/crates/api_models/src/disputes.rs@@ -3,6 +3,7 @@ use std::collections::HashMap;use common_utils::types::{StringMinorUnit, TimeRange};use masking::{Deserialize, Serialize};use serde::de::Error;+use smithy::SmithyModel;use time::PrimitiveDateTime;use utoipa::ToSchema;@@ -57,33 +58,45 @@ pub struct DisputeResponse {pub merchant_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,}-#[derive(Clone, Debug, Serialize, ToSchema, Eq, PartialEq)]+#[derive(Clone, Debug, Serialize, ToSchema, Eq, PartialEq, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct DisputeResponsePaymentsRetrieve {/// The identifier for dispute+ #[smithy(value_type = "String")]pub dispute_id: String,/// Stage of the dispute+ #[smithy(value_type = "DisputeStage")]pub dispute_stage: DisputeStage,/// Status of the dispute+ #[smithy(value_type = "DisputeStatus")]pub dispute_status: DisputeStatus,/// Status of the dispute sent by connector+ #[smithy(value_type = "String")]pub connector_status: String,/// Dispute id sent by connector+ #[smithy(value_type = "String")]pub connector_dispute_id: String,/// Reason of dispute sent by connector+ #[smithy(value_type = "Option<String>")]pub connector_reason: Option<String>,/// Reason code of dispute sent by connector+ #[smithy(value_type = "Option<String>")]pub connector_reason_code: Option<String>,/// Evidence deadline of dispute sent by connector#[serde(with = "common_utils::custom_serde::iso8601::option")]+ #[smithy(value_type = "Option<String>")]pub challenge_required_by: Option<PrimitiveDateTime>,/// Dispute created time sent by connector#[serde(with = "common_utils::custom_serde::iso8601::option")]+ #[smithy(value_type = "Option<String>")]pub connector_created_at: Option<PrimitiveDateTime>,/// Dispute updated time sent by connector#[serde(with = "common_utils::custom_serde::iso8601::option")]+ #[smithy(value_type = "Option<String>")]pub connector_updated_at: Option<PrimitiveDateTime>,/// Time at which dispute is received#[serde(with = "common_utils::custom_serde::iso8601")]+ #[smithy(value_type = "String")]pub created_at: PrimitiveDateTime,}diff --git a/crates/api_models/src/enums.rs b/crates/api_models/src/enums.rsindex a12b0cf6e9..f9c429d2d1 100644--- a/crates/api_models/src/enums.rs+++ b/crates/api_models/src/enums.rs@@ -1,6 +1,7 @@use std::str::FromStr;pub use common_enums::*;+use smithy::SmithyModel;use utoipa::ToSchema;pub use super::connector_enums::Connector;@@ -424,9 +425,11 @@ mod test {PartialEq,Eq,ToSchema,+ SmithyModel,)]#[serde(rename_all = "snake_case")]#[strum(serialize_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum RetryAction {/// Manual retry through request is being deprecated, now it is available through profileManualRetry,diff --git a/crates/api_models/src/ephemeral_key.rs b/crates/api_models/src/ephemeral_key.rsindex eb8eb9c317..6301ca4190 100644--- a/crates/api_models/src/ephemeral_key.rs+++ b/crates/api_models/src/ephemeral_key.rs@@ -1,6 +1,7 @@use common_utils::id_type;#[cfg(feature = "v2")]use masking::Secret;+use smithy::SmithyModel;use utoipa::ToSchema;#[cfg(feature = "v1")]@@ -82,15 +83,22 @@ impl common_utils::events::ApiEventMetric for ClientSecretResponse {#[cfg(feature = "v1")]/// ephemeral_key for the customer_id mentioned-#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, Eq, PartialEq, ToSchema)]+#[derive(+ Debug, serde::Serialize, serde::Deserialize, Clone, Eq, PartialEq, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct EphemeralKeyCreateResponse {/// customer_id to which this ephemeral key belongs to#[schema(value_type = String, max_length = 64, min_length = 1, example = "cus_y3oqhf46pyzuxjbcn2giaqnb44")]+ #[smithy(value_type = "String")]pub customer_id: id_type::CustomerId,/// time at which this ephemeral key was created+ #[smithy(value_type = "i64")]pub created_at: i64,/// time at which this ephemeral key would expire+ #[smithy(value_type = "i64")]pub expires: i64,/// ephemeral key+ #[smithy(value_type = "String")]pub secret: String,}diff --git a/crates/api_models/src/mandates.rs b/crates/api_models/src/mandates.rsindex 6785232664..3abcb93689 100644--- a/crates/api_models/src/mandates.rs+++ b/crates/api_models/src/mandates.rs@@ -1,6 +1,7 @@use common_types::payments as common_payments_types;use masking::Secret;use serde::{Deserialize, Serialize};+use smithy::SmithyModel;use time::PrimitiveDateTime;use utoipa::ToSchema;@@ -116,68 +117,94 @@ pub struct MandateListConstraints {}/// Details required for recurring payment-#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema, PartialEq, Eq)]+#[derive(+ Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema, PartialEq, Eq, SmithyModel,+)]#[serde(tag = "type", content = "data", rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum RecurringDetails {+ #[smithy(value_type = "String")]MandateId(String),+ #[smithy(value_type = "String")]PaymentMethodId(String),+ #[smithy(value_type = "ProcessorPaymentToken")]ProcessorPaymentToken(ProcessorPaymentToken),/// Network transaction ID and Card Details for MIT payments when payment_method_data/// is not stored in the application+ #[smithy(value_type = "NetworkTransactionIdAndCardDetails")]NetworkTransactionIdAndCardDetails(NetworkTransactionIdAndCardDetails),}/// Processor payment token for MIT payments where payment_method_data is not available-#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema, PartialEq, Eq)]+#[derive(+ Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema, PartialEq, Eq, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct ProcessorPaymentToken {+ #[smithy(value_type = "String")]pub processor_payment_token: String,#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]pub merchant_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,}-#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema, PartialEq, Eq)]+#[derive(+ Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema, PartialEq, Eq, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct NetworkTransactionIdAndCardDetails {/// The card number#[schema(value_type = String, example = "4242424242424242")]+ #[smithy(value_type = "String")]pub card_number: cards::CardNumber,/// The card's expiry month#[schema(value_type = String, example = "24")]+ #[smithy(value_type = "String")]pub card_exp_month: Secret<String>,/// The card's expiry year#[schema(value_type = String, example = "24")]+ #[smithy(value_type = "String")]pub card_exp_year: Secret<String>,/// The card holder's name#[schema(value_type = String, example = "John Test")]+ #[smithy(value_type = "Option<String>")]pub card_holder_name: Option<Secret<String>>,/// The name of the issuer of card#[schema(example = "chase")]+ #[smithy(value_type = "Option<String>")]pub card_issuer: Option<String>,/// The card network for the card#[schema(value_type = Option<CardNetwork>, example = "Visa")]+ #[smithy(value_type = "Option<CardNetwork>")]pub card_network: Option<api_enums::CardNetwork>,#[schema(example = "CREDIT")]+ #[smithy(value_type = "Option<String>")]pub card_type: Option<String>,#[schema(example = "INDIA")]+ #[smithy(value_type = "Option<String>")]pub card_issuing_country: Option<String>,#[schema(example = "JP_AMEX")]+ #[smithy(value_type = "Option<String>")]pub bank_code: Option<String>,/// The card holder's nick name#[schema(value_type = Option<String>, example = "John Test")]+ #[smithy(value_type = "Option<String>")]pub nick_name: Option<Secret<String>>,/// The network transaction ID provided by the card network during a CIT (Customer Initiated Transaction),/// where `setup_future_usage` is set to `off_session`.#[schema(value_type = String)]+ #[smithy(value_type = "String")]pub network_transaction_id: Secret<String>,}diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rsindex 0680ce2406..a1588bbfc4 100644--- a/crates/api_models/src/payments.rs+++ b/crates/api_models/src/payments.rs@@ -64,6 +64,7 @@ use router_derive::Setter;#[cfg(feature = "v1")]use serde::{de, Deserializer};use serde::{ser::Serializer, Deserialize, Serialize};+use smithy::SmithyModel;use strum::Display;use time::{Date, PrimitiveDateTime};use url::Url;@@ -76,6 +77,11 @@ use crate::{enums as api_enums,mandates::RecurringDetails,payment_methods,+ payments::additional_info::{+ BankDebitAdditionalData, BankRedirectDetails, BankTransferAdditionalData,+ CardTokenAdditionalData, GiftCardAdditionalData, UpiAdditionalData,+ WalletAdditionalDataForCard,+ },};#[cfg(feature = "v1")]use crate::{disputes, ephemeral_key::EphemeralKeyCreateResponse, refunds, ValidateFieldAndGet};@@ -113,57 +119,78 @@ pub struct BankCodeResponse {}/// Passing this object creates a new customer or attaches an existing customer to the payment-#[derive(Debug, serde::Deserialize, serde::Serialize, Clone, ToSchema, PartialEq)]+#[derive(Debug, serde::Deserialize, serde::Serialize, Clone, ToSchema, PartialEq, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct CustomerDetails {/// The identifier for the customer.#[schema(value_type = String, max_length = 64, min_length = 1, example = "cus_y3oqhf46pyzuxjbcn2giaqnb44")]+ #[smithy(value_type = "String")]pub id: id_type::CustomerId,/// The customer's name#[schema(max_length = 255, value_type = Option<String>, example = "John Doe")]+ #[smithy(value_type = "Option<String>")]pub name: Option<Secret<String>>,/// The customer's email address#[schema(max_length = 255, value_type = Option<String>, example = "[email protected]")]+ #[smithy(value_type = "Option<String>")]pub email: Option<Email>,/// The customer's phone number#[schema(value_type = Option<String>, max_length = 10, example = "9123456789")]+ #[smithy(value_type = "Option<String>")]pub phone: Option<Secret<String>>,/// The country code for the customer's phone number#[schema(max_length = 2, example = "+1")]+ #[smithy(value_type = "Option<String>")]pub phone_country_code: Option<String>,/// The tax registration identifier of the customer.#[schema(value_type=Option<String>,max_length = 255)]+ #[smithy(value_type = "Option<String>")]pub tax_registration_id: Option<Secret<String>>,}#[cfg(feature = "v1")]/// Details of customer attached to this payment#[derive(- Debug, Default, serde::Serialize, serde::Deserialize, Clone, ToSchema, PartialEq, Setter,+ Debug,+ Default,+ serde::Serialize,+ serde::Deserialize,+ Clone,+ ToSchema,+ PartialEq,+ Setter,+ SmithyModel,)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct CustomerDetailsResponse {/// The identifier for the customer.#[schema(value_type = Option<String>, max_length = 64, min_length = 1, example = "cus_y3oqhf46pyzuxjbcn2giaqnb44")]+ #[smithy(value_type = "Option<String>")]pub id: Option<id_type::CustomerId>,/// The customer's name#[schema(max_length = 255, value_type = Option<String>, example = "John Doe")]+ #[smithy(value_type = "Option<String>")]pub name: Option<Secret<String>>,/// The customer's email address#[schema(max_length = 255, value_type = Option<String>, example = "[email protected]")]+ #[smithy(value_type = "Option<String>")]pub email: Option<Email>,/// The customer's phone number#[schema(value_type = Option<String>, max_length = 10, example = "9123456789")]+ #[smithy(value_type = "Option<String>")]pub phone: Option<Secret<String>>,/// The country code for the customer's phone number#[schema(max_length = 2, example = "+1")]+ #[smithy(value_type = "Option<String>")]pub phone_country_code: Option<String>,}@@ -932,32 +959,39 @@ impl AmountDetailsUpdate {ToSchema,router_derive::PolymorphicSchema,router_derive::ValidateSchema,+ SmithyModel,)]#[generate_schemas(PaymentsCreateRequest, PaymentsUpdateRequest, PaymentsConfirmRequest)]#[serde(deny_unknown_fields)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct PaymentsRequest {/// The primary amount for the payment, provided in the lowest denomination of the specified currency (e.g., 6540 for $65.40 USD). This field is mandatory for creating a payment.#[schema(value_type = Option<u64>, example = 6540)]#[serde(default, deserialize_with = "amount::deserialize_option")]#[mandatory_in(PaymentsCreateRequest = u64)]+ #[smithy(value_type = "Option<u64>")]// Makes the field mandatory in PaymentsCreateRequestpub amount: Option<Amount>,/// Total tax amount applicable to the order, in the lowest denomination of the currency.#[schema(value_type = Option<i64>, example = 6540)]+ #[smithy(value_type = "Option<i64>")]pub order_tax_amount: Option<MinorUnit>,/// The three-letter ISO 4217 currency code (e.g., "USD", "EUR") for the payment amount. This field is mandatory for creating a payment.#[schema(example = "USD", value_type = Option<Currency>)]#[mandatory_in(PaymentsCreateRequest = Currency)]+ #[smithy(value_type = "Option<Currency>")]pub currency: Option<api_enums::Currency>,/// The amount to be captured from the user's payment method, in the lowest denomination. If not provided, and `capture_method` is `automatic`, the full payment `amount` will be captured. If `capture_method` is `manual`, this can be specified in the `/capture` call. Must be less than or equal to the authorized amount.#[schema(value_type = Option<i64>, example = 6540)]+ #[smithy(value_type = "Option<i64>")]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)]+ #[smithy(value_type = "Option<i64>")]pub shipping_cost: Option<MinorUnit>,/// Optional. A merchant-provided unique identifier for the payment, contains 30 characters long (e.g., "pay_mbabizu24mvu3mela5njyhpit4"). If provided, it ensures idempotency for the payment creation request. If omitted, Hyperswitch generates a unique ID for the payment.@@ -968,6 +1002,7 @@ pub struct PaymentsRequest {example = "pay_mbabizu24mvu3mela5njyhpit4")]#[serde(default, deserialize_with = "payment_id_type::deserialize_option")]+ #[smithy(value_type = "Option<String>", length = "30..=30")]pub payment_id: Option<PaymentIdType>,/// This is an identifier for the merchant account. This is inferred from the API key@@ -981,19 +1016,24 @@ pub struct PaymentsRequest {"type": "single","data": {"connector": "stripe", "merchant_connector_id": "mca_123"}}))]+ #[smithy(value_type = "Option<Object>")]pub routing: Option<serde_json::Value>,/// This allows to manually select a connector with which the payment can go through.#[schema(value_type = Option<Vec<Connector>>, max_length = 255, example = json!(["stripe", "adyen"]))]+ #[smithy(value_type = "Option<Vec<Connector>>")]pub connector: Option<Vec<api_enums::Connector>>,#[schema(value_type = Option<CaptureMethod>, example = "automatic")]+ #[smithy(value_type = "Option<CaptureMethod>")]pub capture_method: Option<api_enums::CaptureMethod>,#[schema(value_type = Option<AuthenticationType>, example = "no_three_ds", default = "three_ds")]+ #[smithy(value_type = "Option<AuthenticationType>")]pub authentication_type: Option<api_enums::AuthenticationType>,/// The billing details of the payment. This address will be used for invoicing.+ #[smithy(value_type = "Option<Address>")]pub billing: Option<Address>,/// A timestamp (ISO 8601 code) that determines when the payment should be captured.@@ -1005,13 +1045,16 @@ pub struct PaymentsRequest {/// If set to `true`, Hyperswitch attempts to confirm and authorize the payment immediately after creation, provided sufficient payment method details are included. If `false` or omitted (default is `false`), the payment is created with a status such as `requires_payment_method` or `requires_confirmation`, and a separate `POST /payments/{payment_id}/confirm` call is necessary to proceed with authorization.#[schema(default = false, example = true)]+ #[smithy(value_type = "Option<bool>")]pub confirm: Option<bool>,/// Passing this object creates a new customer or attaches an existing customer to the payment+ #[smithy(value_type = "Option<CustomerDetails>")]pub customer: Option<CustomerDetails>,/// The identifier for the customer#[schema(value_type = Option<String>, max_length = 64, min_length = 1, example = "cus_y3oqhf46pyzuxjbcn2giaqnb44")]+ #[smithy(value_type = "Option<String>")]pub customer_id: Option<id_type::CustomerId>,/// The customer's email address.@@ -1040,28 +1083,35 @@ pub struct PaymentsRequest {/// Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. When making a recurring payment by passing a mandate_id, this parameter is mandatory#[schema(example = true)]+ #[smithy(value_type = "Option<bool>")]pub off_session: Option<bool>,/// An arbitrary string attached to the payment. Often useful for displaying to users or for your own internal record-keeping.#[schema(example = "It's my first payment request")]+ #[smithy(value_type = "Option<String>")]pub description: Option<String>,/// The URL to redirect the customer to after they complete the payment process or authentication. This is crucial for flows that involve off-site redirection (e.g., 3DS, some bank redirects, wallet payments).#[schema(value_type = Option<String>, example = "https://hyperswitch.io", max_length = 2048)]+ #[smithy(value_type = "Option<String>")]pub return_url: Option<Url>,#[schema(value_type = Option<FutureUsage>, example = "off_session")]+ #[smithy(value_type = "Option<FutureUsage>")]pub setup_future_usage: Option<api_enums::FutureUsage>,#[schema(example = "bank_transfer")]#[serde(with = "payment_method_data_serde", default)]+ #[smithy(value_type = "Option<PaymentMethodDataRequest>")]pub payment_method_data: Option<PaymentMethodDataRequest>,#[schema(value_type = Option<PaymentMethod>, example = "card")]+ #[smithy(value_type = "Option<PaymentMethod>")]pub payment_method: Option<api_enums::PaymentMethod>,/// As Hyperswitch tokenises the sensitive details about the payments method, it provides the payment_token as a reference to a stored payment method, ensuring that the sensitive details are not exposed in any manner.#[schema(example = "187282ab-40ef-47a9-9206-5099ba31e432")]+ #[smithy(value_type = "Option<String>")]pub payment_token: Option<String>,/// This is used along with the payment_token field while collecting during saved card payments. This field will be deprecated soon, use the payment_method_data.card_token object instead@@ -1070,14 +1120,17 @@ pub struct PaymentsRequest {pub card_cvc: Option<Secret<String>>,/// The shipping address for the payment+ #[smithy(value_type = "Option<Address>")]pub shipping: Option<Address>,/// For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters. To be deprecated soon, use billing_descriptor instead.#[schema(max_length = 255, example = "Hyperswitch Router", deprecated)]+ #[smithy(value_type = "Option<String>")]pub statement_descriptor_name: Option<String>,/// Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. To be deprecated soon, use billing_descriptor instead.#[schema(max_length = 255, example = "Payment for shoes purchase", deprecated)]+ #[smithy(value_type = "Option<String>")]pub statement_descriptor_suffix: Option<String>,/// Use this object to capture the details about the different products for which the payment is being made. The sum of amount across different products here should be equal to the overall payment amount@@ -1087,23 +1140,28 @@ pub struct PaymentsRequest {"amount" : 69000"product_img_link" : "https://dummy-img-link.com"}]"#)]+ #[smithy(value_type = "Option<OrderDetailsWithAmount>")]pub order_details: Option<Vec<OrderDetailsWithAmount>>,/// It's a token used for client side verification.#[schema(example = "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo")]#[remove_in(PaymentsUpdateRequest, PaymentsCreateRequest)]+ #[smithy(value_type = "Option<String>")]pub client_secret: Option<String>,/// Passing this object during payments creates a mandate. The mandate_type sub object is passed by the server.+ #[smithy(value_type = "Option<MandateData>")]pub mandate_data: Option<MandateData>,/// This "CustomerAcceptance" object is passed during Payments-Confirm request, it enlists the type, time, and mode of acceptance properties related to an acceptance done by the customer. The customer_acceptance sub object is usually passed by the SDK or client.#[schema(value_type = Option<CustomerAcceptance>)]+ #[smithy(value_type = "Option<CustomerAcceptance>")]pub customer_acceptance: Option<common_payments_types::CustomerAcceptance>,/// A unique identifier to link the payment to a mandate. To do Recurring payments after a mandate has been created, pass the mandate_id instead of payment_method_data#[schema(max_length = 64, example = "mandate_iwer89rnjef349dni3")]#[remove_in(PaymentsUpdateRequest)]+ #[smithy(value_type = "Option<String>")]pub mandate_id: Option<String>,/// Additional details required by 3DS 2.0@@ -1118,33 +1176,40 @@ pub struct PaymentsRequest {"java_enabled": true,"java_script_enabled":true}"#)]+ #[smithy(value_type = "Option<BrowserInformation>")]pub browser_info: Option<serde_json::Value>,/// To indicate the type of payment experience that the payment method would go through#[schema(value_type = Option<PaymentExperience>, example = "redirect_to_url")]+ #[smithy(value_type = "Option<PaymentExperience>")]pub payment_experience: Option<api_enums::PaymentExperience>,/// Can be used to specify the Payment Method Type#[schema(value_type = Option<PaymentMethodType>, example = "google_pay")]+ #[smithy(value_type = "Option<PaymentMethodType>")]pub payment_method_type: Option<api_enums::PaymentMethodType>,/// Business country of the merchant for this payment./// To be deprecated soon. Pass the profile_id instead#[schema(value_type = Option<CountryAlpha2>, example = "US")]#[remove_in(PaymentsUpdateRequest, PaymentsConfirmRequest)]+ #[smithy(value_type = "Option<CountryAlpha2>")]pub business_country: Option<api_enums::CountryAlpha2>,/// Business label of the merchant for this payment./// To be deprecated soon. Pass the profile_id instead#[schema(example = "food")]#[remove_in(PaymentsUpdateRequest, PaymentsConfirmRequest)]+ #[smithy(value_type = "Option<String>")]pub business_label: Option<String>,#[schema(value_type = Option<MerchantConnectorDetailsWrap>)]+ #[smithy(value_type = "Option<MerchantConnectorDetailsWrap>")]pub merchant_connector_details: Option<admin::MerchantConnectorDetailsWrap>,/// Use this parameter to restrict the Payment Method Types to show for a given PaymentIntent#[schema(value_type = Option<Vec<PaymentMethodType>>)]+ #[smithy(value_type = "Option<Vec<PaymentMethodType>>")]pub allowed_payment_method_types: Option<Vec<api_enums::PaymentMethodType>>,/// Business sub label for the payment@@ -1154,13 +1219,16 @@ pub struct PaymentsRequest {/// Denotes the retry action#[schema(value_type = Option<RetryAction>)]#[remove_in(PaymentsCreateRequest)]+ #[smithy(value_type = "Option<RetryAction>")]pub retry_action: Option<api_enums::RetryAction>,/// You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.#[schema(value_type = Option<Object>, example = r#"{ "udf1": "some-value", "udf2": "some-value" }"#)]+ #[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.+ #[smithy(value_type = "Option<ConnectorMetadata>")]pub connector_metadata: Option<ConnectorMetadata>,/// Additional data that might be required by hyperswitch based on the requested features by the merchants.@@ -1169,54 +1237,66 @@ pub struct PaymentsRequest {/// Whether to generate the payment link for this payment or not (if applicable)#[schema(default = false, example = true)]+ #[smithy(value_type = "Option<bool>")]pub payment_link: Option<bool>,#[schema(value_type = Option<PaymentCreatePaymentLinkConfig>)]pub payment_link_config: Option<PaymentCreatePaymentLinkConfig>,/// Custom payment link config id set at business profile, send only if business_specific_configs is configured+ #[smithy(value_type = "Option<String>")]pub payment_link_config_id: Option<String>,/// The business profile to be used for this payment, if not passed the default business profile associated with the merchant account will be used. It is mandatory in case multiple business profiles have been set up.#[remove_in(PaymentsUpdateRequest, PaymentsConfirmRequest)]#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]pub profile_id: Option<id_type::ProfileId>,#[remove_in(PaymentsConfirmRequest)]#[schema(value_type = Option<RequestSurchargeDetails>)]+ #[smithy(value_type = "Option<RequestSurchargeDetails>")]pub surcharge_details: Option<RequestSurchargeDetails>,/// The type of the payment that differentiates between normal and various types of mandate payments#[schema(value_type = Option<PaymentType>)]+ #[smithy(value_type = "Option<PaymentType>")]pub payment_type: Option<api_enums::PaymentType>,///Request an incremental authorization, i.e., increase the authorized amount on a confirmed payment before you capture it.+ #[smithy(value_type = "Option<bool>")]pub request_incremental_authorization: Option<bool>,///Will be used to expire client secret after certain amount of time to be supplied in seconds///(900) for 15 mins#[schema(example = 900)]+ #[smithy(value_type = "Option<u32>")]pub session_expiry: Option<u32>,/// Additional data related to some frm(Fraud Risk Management) connectors#[schema(value_type = Option<Object>, example = r#"{ "coverage_request" : "fraud", "fulfillment_method" : "delivery" }"#)]+ #[smithy(value_type = "Option<Object>")]pub frm_metadata: Option<pii::SecretSerdeValue>,/// Whether to perform external authentication (if applicable)#[schema(example = true)]+ #[smithy(value_type = "Option<bool>")]pub request_external_three_ds_authentication: Option<bool>,/// Details required for recurring payment+ #[smithy(value_type = "Option<RecurringDetails>")]pub recurring_details: Option<RecurringDetails>,/// Fee information to be charged on the payment being collected#[schema(value_type = Option<SplitPaymentsRequest>)]+ #[smithy(value_type = "Option<SplitPaymentsRequest>")]pub split_payments: Option<common_types::payments::SplitPaymentsRequest>,/// Optional boolean value to extent authorization period of this payment////// capture method must be manual or manual_multiple#[schema(value_type = Option<bool>, default = false)]+ #[smithy(value_type = "Option<bool>")]pub request_extended_authorization: Option<RequestExtendedAuthorizationBool>,/// Your unique identifier for this payment or order. This ID helps you reconcile payments on your system. If provided, it is passed to the connector if supported.@@ -1225,29 +1305,37 @@ pub struct PaymentsRequest {max_length = 255,example = "Custom_Order_id_123")]+ #[smithy(value_type = "Option<String>")]pub merchant_order_reference_id: Option<String>,/// Whether to calculate tax for this payment intent+ #[smithy(value_type = "Option<bool>")]pub skip_external_tax_calculation: Option<bool>,/// Choose what kind of sca exemption is required for this payment#[schema(value_type = Option<ScaExemptionType>)]+ #[smithy(value_type = "Option<ScaExemptionType>")]pub psd2_sca_exemption_type: Option<api_enums::ScaExemptionType>,/// Service details for click to pay external authentication#[schema(value_type = Option<CtpServiceDetails>)]+ #[smithy(value_type = "Option<CtpServiceDetails>")]pub ctp_service_details: Option<CtpServiceDetails>,/// Indicates if 3ds challenge is forced+ #[smithy(value_type = "Option<bool>")]pub force_3ds_challenge: Option<bool>,/// Indicates if 3DS method data was successfully completed or not+ #[smithy(value_type = "Option<ThreeDsCompletionIndicator>")]pub threeds_method_comp_ind: Option<ThreeDsCompletionIndicator>,/// Indicates if the redirection has to open in the iframe+ #[smithy(value_type = "Option<bool>")]pub is_iframe_redirection_enabled: Option<bool>,/// If enabled, provides whole connector response+ #[smithy(value_type = "Option<bool>")]pub all_keys_required: Option<bool>,/// Indicates whether the `payment_id` was provided by the merchant@@ -1258,20 +1346,25 @@ pub struct PaymentsRequest {/// Indicates how the payment was initiated (e.g., ecommerce, mail, or telephone).#[schema(value_type = Option<PaymentChannel>)]+ #[smithy(value_type = "Option<PaymentChannel>")]pub payment_channel: Option<common_enums::PaymentChannel>,/// Your tax status for this order or transaction.#[schema(value_type = Option<TaxStatus>)]+ #[smithy(value_type = "Option<TaxStatus>")]pub tax_status: Option<api_enums::TaxStatus>,/// Total amount of the discount you have applied to the order or transaction.#[schema(value_type = Option<i64>, example = 6540)]+ #[smithy(value_type = "Option<i64>")]pub discount_amount: Option<MinorUnit>,/// Tax amount applied to shipping charges.+ #[smithy(value_type = "Option<i64>")]pub shipping_amount_tax: Option<MinorUnit>,/// Duty or customs fee amount for international transactions.+ #[smithy(value_type = "Option<i64>")]pub duty_amount: Option<MinorUnit>,/// Date the payer placed the order.@@ -1280,19 +1373,23 @@ pub struct PaymentsRequest {/// Allow partial authorization for this payment#[schema(value_type = Option<bool>, default = false)]+ #[smithy(value_type = "Option<bool>")]pub enable_partial_authorization: Option<primitive_wrappers::EnablePartialAuthorizationBool>,/// Boolean indicating whether to enable overcapture for this payment#[remove_in(PaymentsConfirmRequest)]#[schema(value_type = Option<bool>, example = true)]+ #[smithy(value_type = "Option<bool>")]pub enable_overcapture: Option<primitive_wrappers::EnableOvercaptureBool>,/// Boolean flag indicating whether this payment method is stored and has been previously used for payments#[schema(value_type = Option<bool>, example = true)]+ #[smithy(value_type = "Option<bool>")]pub is_stored_credential: Option<bool>,/// The category of the MIT transaction#[schema(value_type = Option<MitCategory>, example = "recurring")]+ #[smithy(value_type = "Option<MitCategory>")]pub mit_category: Option<api_enums::MitCategory>,/// Billing descriptor information for the payment@@ -1300,19 +1397,25 @@ pub struct PaymentsRequest {pub billing_descriptor: Option<common_types::payments::BillingDescriptor>,}-#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct CtpServiceDetails {/// merchant transaction id+ #[smithy(value_type = "Option<String>")]pub merchant_transaction_id: Option<String>,/// network transaction correlation id+ #[smithy(value_type = "Option<String>")]pub correlation_id: Option<String>,/// session transaction flow id+ #[smithy(value_type = "Option<String>")]pub x_src_flow_id: Option<String>,/// provider Eg: Visa, Mastercard#[schema(value_type = Option<CtpServiceProvider>)]+ #[smithy(value_type = "Option<CtpServiceProvider>")]pub provider: Option<api_enums::CtpServiceProvider>,/// Encrypted payload#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]pub encrypted_payload: Option<Secret<String>>,}@@ -1558,66 +1661,93 @@ mod payments_request_test {/// Details of surcharge applied on this payment, if applicable#[derive(- Default, Debug, Clone, serde::Serialize, serde::Deserialize, Copy, ToSchema, PartialEq,+ Default,+ Debug,+ Clone,+ serde::Serialize,+ serde::Deserialize,+ Copy,+ ToSchema,+ PartialEq,+ SmithyModel,)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct RequestSurchargeDetails {#[schema(value_type = i64, example = 6540)]+ #[smithy(value_type = "i64")]pub surcharge_amount: MinorUnit,+ #[smithy(value_type = "Option<i64>")]pub tax_amount: Option<MinorUnit>,}// for v2 use the type from common_utils::types#[cfg(feature = "v1")]/// Browser information to be used for 3DS 2.0-#[derive(ToSchema, Debug, serde::Deserialize, serde::Serialize, Clone)]+#[derive(ToSchema, Debug, serde::Deserialize, serde::Serialize, Clone, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct BrowserInformation {/// Color depth supported by the browser+ #[smithy(value_type = "Option<u8>")]pub color_depth: Option<u8>,/// Whether java is enabled in the browser+ #[smithy(value_type = "Option<bool>")]pub java_enabled: Option<bool>,/// Whether javascript is enabled in the browser+ #[smithy(value_type = "Option<bool>")]pub java_script_enabled: Option<bool>,/// Language supported+ #[smithy(value_type = "Option<String>")]pub language: Option<String>,/// The screen height in pixels+ #[smithy(value_type = "Option<u32>")]pub screen_height: Option<u32>,/// The screen width in pixels+ #[smithy(value_type = "Option<u32>")]pub screen_width: Option<u32>,/// Time zone of the client+ #[smithy(value_type = "Option<i32>")]pub time_zone: Option<i32>,/// Ip address of the client#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]pub ip_address: Option<std::net::IpAddr>,/// List of headers that are accepted#[schema(example = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8")]+ #[smithy(value_type = "Option<String>")]pub accept_header: Option<String>,/// User-agent of the browser+ #[smithy(value_type = "Option<String>")]pub user_agent: Option<String>,/// The os type of the client device+ #[smithy(value_type = "Option<String>")]pub os_type: Option<String>,/// The os version of the client device+ #[smithy(value_type = "Option<String>")]pub os_version: Option<String>,/// The device model of the client+ #[smithy(value_type = "Option<String>")]pub device_model: Option<String>,/// Accept-language of the browser+ #[smithy(value_type = "Option<String>")]pub accept_language: Option<String>,/// Identifier of the source that initiated the request.+ #[smithy(value_type = "Option<String>")]pub referer: Option<String>,}@@ -1640,71 +1770,105 @@ impl RequestSurchargeDetails {}#[cfg(feature = "v1")]-#[derive(Debug, serde::Serialize, Clone, PartialEq, ToSchema, router_derive::PolymorphicSchema)]+#[derive(+ Debug,+ serde::Serialize,+ Clone,+ PartialEq,+ ToSchema,+ router_derive::PolymorphicSchema,+ SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct PaymentAttemptResponse {/// A unique identifier for this specific payment attempt.+ #[smithy(value_type = "String")]pub attempt_id: String,/// The status of the attempt#[schema(value_type = AttemptStatus, example = "charged")]+ #[smithy(value_type = "AttemptStatus")]pub status: enums::AttemptStatus,/// The payment attempt amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,#[schema(value_type = i64, example = 6540)]+ #[smithy(value_type = "i64")]pub amount: MinorUnit,/// The payment attempt tax_amount.#[schema(value_type = Option<i64>, example = 6540)]+ #[smithy(value_type = "Option<i64>")]pub order_tax_amount: Option<MinorUnit>,/// The currency of the amount of the payment attempt#[schema(value_type = Option<Currency>, example = "USD")]+ #[smithy(value_type = "Option<Currency>")]pub currency: Option<enums::Currency>,/// The name of the payment connector (e.g., 'stripe', 'adyen') used for this attempt.+ #[smithy(value_type = "Option<String>")]pub connector: Option<String>,/// A human-readable message from the connector explaining the error, if one occurred during this payment attempt.+ #[smithy(value_type = "Option<String>")]pub error_message: Option<String>,/// The payment method that is to be used#[schema(value_type = Option<PaymentMethod>, example = "bank_transfer")]+ #[smithy(value_type = "Option<PaymentMethod>")]pub payment_method: Option<enums::PaymentMethod>,/// A unique identifier for a payment provided by the connector+ #[smithy(value_type = "Option<String>")]pub connector_transaction_id: Option<String>,/// This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method.#[schema(value_type = Option<CaptureMethod>, example = "scheduled")]+ #[smithy(value_type = "Option<CaptureMethod>")]pub capture_method: Option<enums::CaptureMethod>,/// The transaction authentication can be set to undergo payer authentication. By default, the authentication will be marked as NO_THREE_DS#[schema(value_type = Option<AuthenticationType>, example = "no_three_ds", default = "three_ds")]+ #[smithy(value_type = "Option<AuthenticationType>")]pub authentication_type: Option<enums::AuthenticationType>,/// Time at which the payment attempt was created#[schema(value_type = PrimitiveDateTime, example = "2022-09-10T10:11:12Z")]#[serde(with = "common_utils::custom_serde::iso8601")]+ #[smithy(value_type = "String")]pub created_at: PrimitiveDateTime,/// Time at which the payment attempt was last modified#[schema(value_type = PrimitiveDateTime, example = "2022-09-10T10:11:12Z")]#[serde(with = "common_utils::custom_serde::iso8601")]+ #[smithy(value_type = "String")]pub modified_at: PrimitiveDateTime,/// If the payment was cancelled the reason will be provided here+ #[smithy(value_type = "Option<String>")]pub cancellation_reason: Option<String>,/// If this payment attempt is associated with a mandate (e.g., for a recurring or subsequent payment), this field will contain the ID of that mandate.+ #[smithy(value_type = "Option<String>")]pub mandate_id: Option<String>,/// The error code returned by the connector if this payment attempt failed. This code is specific to the connector.+ #[smithy(value_type = "Option<String>")]pub error_code: Option<String>,/// If a tokenized (saved) payment method was used for this attempt, this field contains the payment token representing that payment method.+ #[smithy(value_type = "Option<String>")]pub payment_token: Option<String>,/// Additional data related to some connectors+ #[smithy(value_type = "Option<Object>")]pub connector_metadata: Option<serde_json::Value>,/// Payment Experience for the current payment#[schema(value_type = Option<PaymentExperience>, example = "redirect_to_url")]+ #[smithy(value_type = "Option<PaymentExperience>")]pub payment_experience: Option<enums::PaymentExperience>,/// Payment Method Type#[schema(value_type = Option<PaymentMethodType>, example = "google_pay")]+ #[smithy(value_type = "Option<PaymentMethodType>")]pub payment_method_type: Option<enums::PaymentMethodType>,/// The connector's own reference or transaction ID for this specific payment attempt. Useful for reconciliation with the connector.#[schema(value_type = Option<String>, example = "993672945374576J")]+ #[smithy(value_type = "Option<String>")]pub reference_id: Option<String>,/// (This field is not live yet)Error code unified across the connectors is received here if there was an error while calling connector+ #[smithy(value_type = "Option<String>")]pub unified_code: Option<String>,/// (This field is not live yet)Error message unified across the connectors is received here if there was an error while calling connector+ #[smithy(value_type = "Option<String>")]pub unified_message: Option<String>,/// Value passed in X-CLIENT-SOURCE header during payments confirm request by the client+ #[smithy(value_type = "Option<String>")]pub client_source: Option<String>,/// Value passed in X-CLIENT-VERSION header during payments confirm request by the client+ #[smithy(value_type = "Option<String>")]pub client_version: Option<String>,}@@ -1859,35 +2023,55 @@ pub struct PaymentAttemptRevenueRecoveryData {}#[derive(- Default, Debug, serde::Serialize, Clone, PartialEq, ToSchema, router_derive::PolymorphicSchema,+ Default,+ Debug,+ serde::Serialize,+ Clone,+ PartialEq,+ ToSchema,+ router_derive::PolymorphicSchema,+ SmithyModel,)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct CaptureResponse {/// A unique identifier for this specific capture operation.+ #[smithy(value_type = "String")]pub capture_id: String,/// The status of the capture#[schema(value_type = CaptureStatus, example = "charged")]+ #[smithy(value_type = "CaptureStatus")]pub status: enums::CaptureStatus,/// The capture amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,#[schema(value_type = i64, example = 6540)]+ #[smithy(value_type = "i64")]pub amount: MinorUnit,/// The currency of the amount of the capture#[schema(value_type = Option<Currency>, example = "USD")]+ #[smithy(value_type = "Option<Currency>")]pub currency: Option<enums::Currency>,/// The name of the payment connector that processed this capture.+ #[smithy(value_type = "String")]pub connector: String,/// The ID of the payment attempt that was successfully authorized and subsequently captured by this operation.+ #[smithy(value_type = "String")]pub authorized_attempt_id: String,/// A unique identifier for this capture provided by the connector+ #[smithy(value_type = "Option<String>")]pub connector_capture_id: Option<String>,/// Sequence number of this capture, in the series of captures made for the parent attempt+ #[smithy(value_type = "i16")]pub capture_sequence: i16,/// A human-readable message from the connector explaining why this capture operation failed, if applicable.+ #[smithy(value_type = "Option<String>")]pub error_message: Option<String>,/// The error code returned by the connector if this capture operation failed. This code is connector-specific.+ #[smithy(value_type = "Option<String>")]pub error_code: Option<String>,/// A more detailed reason from the connector explaining the capture failure, if available.+ #[smithy(value_type = "Option<String>")]pub error_reason: Option<String>,/// The connector's own reference or transaction ID for this specific capture operation. Useful for reconciliation.+ #[smithy(value_type = "Option<String>")]pub reference_id: Option<String>,}@@ -2055,15 +2239,29 @@ impl MandateIds {/// Passing this object during payments creates a mandate. The mandate_type sub object is passed by the server.// The fields on this struct are optional, as we want to allow the merchant to provide partial// information about creating mandates-#[derive(Default, Eq, PartialEq, Debug, serde::Deserialize, serde::Serialize, Clone, ToSchema)]+#[derive(+ Default,+ Eq,+ PartialEq,+ Debug,+ serde::Deserialize,+ serde::Serialize,+ Clone,+ ToSchema,+ SmithyModel,+)]#[serde(deny_unknown_fields)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct MandateData {/// A way to update the mandate's payment method details+ #[smithy(value_type = "Option<String>")]pub update_mandate_id: Option<String>,/// A consent from the customer to store the payment method#[schema(value_type = Option<CustomerAcceptance>)]+ #[smithy(value_type = "Option<CustomerAcceptance>")]pub customer_acceptance: Option<common_payments_types::CustomerAcceptance>,/// A way to select the type of mandate used+ #[smithy(value_type = "Option<MandateType>")]pub mandate_type: Option<MandateType>,}@@ -2073,35 +2271,56 @@ pub struct SingleUseMandate {pub currency: api_enums::Currency,}-#[derive(Clone, Eq, PartialEq, Debug, Default, ToSchema, serde::Serialize, serde::Deserialize)]+#[derive(+ Clone,+ Eq,+ PartialEq,+ Debug,+ Default,+ ToSchema,+ serde::Serialize,+ serde::Deserialize,+ SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct MandateAmountData {/// The maximum amount to be debited for the mandate transaction#[schema(value_type = i64, example = 6540)]+ #[smithy(value_type = "Option<i64>")]pub amount: MinorUnit,/// The currency for the transaction#[schema(value_type = Currency, example = "USD")]+ #[smithy(value_type = "Currency")]pub currency: api_enums::Currency,/// Specifying start date of the mandate#[schema(example = "2022-09-10T00:00:00Z")]#[serde(default, with = "common_utils::custom_serde::iso8601::option")]+ #[smithy(value_type = "Option<PrimitiveDateTime>")]pub start_date: Option<PrimitiveDateTime>,/// Specifying end date of the mandate#[schema(example = "2023-09-10T23:59:59Z")]#[serde(default, with = "common_utils::custom_serde::iso8601::option")]+ #[smithy(value_type = "Option<PrimitiveDateTime>")]pub end_date: Option<PrimitiveDateTime>,/// Additional details required by mandate#[schema(value_type = Option<Object>, example = r#"{"frequency": "DAILY"}"#)]+ #[smithy(value_type = "Option<Object>")]pub metadata: Option<pii::SecretSerdeValue>,}-#[derive(Eq, PartialEq, Debug, serde::Deserialize, serde::Serialize, Clone, ToSchema)]+#[derive(+ Eq, PartialEq, Debug, serde::Deserialize, serde::Serialize, Clone, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum MandateType {/// If the mandate should only be valid for 1 off-session use+ #[smithy(value_type = "MandateAmountData")]SingleUse(MandateAmountData),/// If the mandate should be valid for multiple debits+ #[smithy(value_type = "Option<MandateAmountData>")]MultiUse(Option<MandateAmountData>),}@@ -2111,51 +2330,77 @@ impl Default for MandateType {}}-#[derive(Debug, serde::Deserialize, serde::Serialize, Clone, Eq, PartialEq, ToSchema)]+#[derive(+ Debug, serde::Deserialize, serde::Serialize, Clone, Eq, PartialEq, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct NetworkDetails {+ #[smithy(value_type = "Option<String>")]pub network_advice_code: Option<String>,}-#[derive(Default, Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Default,+ Eq,+ PartialEq,+ Clone,+ Debug,+ serde::Deserialize,+ serde::Serialize,+ ToSchema,+ SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct Card {/// The card number#[schema(value_type = String, example = "4242424242424242")]+ #[smithy(value_type = "String")]pub card_number: CardNumber,/// The card's expiry month#[schema(value_type = String, example = "24")]+ #[smithy(value_type = "String")]pub card_exp_month: Secret<String>,/// The card's expiry year#[schema(value_type = String, example = "24")]+ #[smithy(value_type = "String")]pub card_exp_year: Secret<String>,/// The card holder's name#[schema(value_type = String, example = "John Test")]+ #[smithy(value_type = "Option<String>")]pub card_holder_name: Option<Secret<String>>,/// The CVC number for the card#[schema(value_type = String, example = "242")]+ #[smithy(value_type = "String")]pub card_cvc: Secret<String>,/// The name of the issuer of card#[schema(example = "chase")]+ #[smithy(value_type = "Option<String>")]pub card_issuer: Option<String>,/// The card network for the card#[schema(value_type = Option<CardNetwork>, example = "Visa")]+ #[smithy(value_type = "Option<CardNetwork>")]pub card_network: Option<api_enums::CardNetwork>,#[schema(example = "CREDIT")]+ #[smithy(value_type = "Option<String>")]pub card_type: Option<String>,#[schema(example = "INDIA")]+ #[smithy(value_type = "Option<String>")]pub card_issuing_country: Option<String>,#[schema(example = "JP_AMEX")]+ #[smithy(value_type = "Option<String>")]pub bank_code: Option<String>,/// The card holder's nick name#[schema(value_type = Option<String>, example = "John Test")]+ #[smithy(value_type = "Option<String>")]pub nick_name: Option<Secret<String>>,}@@ -2324,64 +2569,102 @@ impl Card {}}-#[derive(Eq, PartialEq, Debug, serde::Deserialize, serde::Serialize, Clone, ToSchema, Default)]+#[derive(+ Eq,+ PartialEq,+ Debug,+ serde::Deserialize,+ serde::Serialize,+ Clone,+ ToSchema,+ Default,+ SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct CardToken {/// The card holder's name#[schema(value_type = String, example = "John Test")]+ #[smithy(value_type = "Option<String>")]pub card_holder_name: Option<Secret<String>>,/// The CVC number for the card#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]pub card_cvc: Option<Secret<String>>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum CardRedirectData {+ #[smithy(nested_value_type)]Knet {},+ #[smithy(nested_value_type)]Benefit {},+ #[smithy(nested_value_type)]MomoAtm {},+ #[smithy(nested_value_type)]CardRedirect {},}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum PayLaterData {/// For KlarnaRedirect as PayLater Option+ #[smithy(nested_value_type)]KlarnaRedirect {/// The billing email#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]billing_email: Option<Email>,// The billing country code#[schema(value_type = Option<CountryAlpha2>, example = "US")]+ #[smithy(value_type = "Option<CountryAlpha2>")]billing_country: Option<api_enums::CountryAlpha2>,},/// For Klarna Sdk as PayLater Option+ #[smithy(nested_value_type)]KlarnaSdk {/// The token for the sdk workflow+ #[smithy(value_type = "String")]token: String,},/// For Affirm redirect as PayLater Option+ #[smithy(nested_value_type)]AffirmRedirect {},/// For AfterpayClearpay redirect as PayLater Option+ #[smithy(nested_value_type)]AfterpayClearpayRedirect {/// The billing email#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]billing_email: Option<Email>,/// The billing name#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]billing_name: Option<Secret<String>>,},/// For PayBright Redirect as PayLater Option+ #[smithy(nested_value_type)]PayBrightRedirect {},/// For Flexiti Redirect as PayLater long term finance Option+ #[smithy(nested_value_type)]FlexitiRedirect {},/// For WalleyRedirect as PayLater Option+ #[smithy(nested_value_type)]WalleyRedirect {},/// For Alma Redirection as PayLater Option+ #[smithy(nested_value_type)]AlmaRedirect {},+ #[smithy(nested_value_type)]AtomeRedirect {},+ #[smithy(nested_value_type)]BreadpayRedirect {},PayjustnowRedirect {},}@@ -2432,79 +2715,109 @@ impl GetAddressFromPaymentMethodData for PayLaterData {}}-#[derive(serde::Deserialize, serde::Serialize, Debug, Clone, ToSchema, Eq, PartialEq)]+#[derive(+ serde::Deserialize, serde::Serialize, Debug, Clone, ToSchema, Eq, PartialEq, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum BankDebitData {/// Payment Method data for Ach bank debit+ #[smithy(nested_value_type)]AchBankDebit {/// Billing details for bank debit+ #[smithy(value_type = "Option<BankDebitBilling>")]billing_details: Option<BankDebitBilling>,/// Account number for ach bank debit payment#[schema(value_type = String, example = "000123456789")]+ #[smithy(value_type = "String")]account_number: Secret<String>,/// Routing number for ach bank debit payment#[schema(value_type = String, example = "110000000")]+ #[smithy(value_type = "String")]routing_number: Secret<String>,#[schema(value_type = String, example = "John Test")]+ #[smithy(value_type = "Option<String>")]card_holder_name: Option<Secret<String>>,#[schema(value_type = String, example = "John Doe")]+ #[smithy(value_type = "Option<String>")]bank_account_holder_name: Option<Secret<String>>,#[schema(value_type = String, example = "ACH")]+ #[smithy(value_type = "Option<BankNames>")]bank_name: Option<common_enums::BankNames>,#[schema(value_type = String, example = "Checking")]+ #[smithy(value_type = "Option<BankType>")]bank_type: Option<common_enums::BankType>,#[schema(value_type = String, example = "Personal")]+ #[smithy(value_type = "Option<BankHolderType>")]bank_holder_type: Option<common_enums::BankHolderType>,},+ #[smithy(nested_value_type)]SepaBankDebit {/// Billing details for bank debit+ #[smithy(value_type = "Option<BankDebitBilling>")]billing_details: Option<BankDebitBilling>,/// International bank account number (iban) for SEPA#[schema(value_type = String, example = "DE89370400440532013000")]+ #[smithy(value_type = "String")]iban: Secret<String>,/// Owner name for bank debit#[schema(value_type = String, example = "A. Schneider")]+ #[smithy(value_type = "Option<String>")]bank_account_holder_name: Option<Secret<String>>,},+ #[smithy(nested_value_type)]SepaGuarenteedBankDebit {/// Billing details for bank debit+ #[smithy(value_type = "Option<BankDebitBilling>")]billing_details: Option<BankDebitBilling>,/// International bank account number (iban) for SEPA#[schema(value_type = String, example = "DE89370400440532013000")]+ #[smithy(value_type = "String")]iban: Secret<String>,/// Owner name for bank debit#[schema(value_type = String, example = "A. Schneider")]+ #[smithy(value_type = "Option<String>")]bank_account_holder_name: Option<Secret<String>>,},+ #[smithy(nested_value_type)]BecsBankDebit {/// Billing details for bank debit+ #[smithy(value_type = "Option<BankDebitBilling>")]billing_details: Option<BankDebitBilling>,/// Account number for Becs payment method#[schema(value_type = String, example = "000123456")]+ #[smithy(value_type = "String")]account_number: Secret<String>,/// Bank-State-Branch (bsb) number#[schema(value_type = String, example = "000000")]+ #[smithy(value_type = "String")]bsb_number: Secret<String>,/// Owner name for bank debit#[schema(value_type = Option<String>, example = "A. Schneider")]+ #[smithy(value_type = "Option<String>")]bank_account_holder_name: Option<Secret<String>>,},+ #[smithy(nested_value_type)]BacsBankDebit {/// Billing details for bank debit+ #[smithy(value_type = "Option<BankDebitBilling>")]billing_details: Option<BankDebitBilling>,/// Account number for Bacs payment method#[schema(value_type = String, example = "00012345")]+ #[smithy(value_type = "String")]account_number: Secret<String>,/// Sort code for Bacs payment method#[schema(value_type = String, example = "108800")]+ #[smithy(value_type = "String")]sort_code: Secret<String>,/// holder name for bank debit#[schema(value_type = String, example = "A. Schneider")]+ #[smithy(value_type = "Option<String>")]bank_account_holder_name: Option<Secret<String>>,},}@@ -2721,12 +3034,16 @@ mod payment_method_data_serde {}/// The payment method information provided for making a payment-#[derive(Debug, Clone, serde::Deserialize, serde::Serialize, ToSchema, Eq, PartialEq)]+#[derive(+ Debug, Clone, serde::Deserialize, serde::Serialize, ToSchema, Eq, PartialEq, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct PaymentMethodDataRequest {/// This field is optional because, in case of saved cards we pass the payment_token/// There might be cases where we don't need to pass the payment_method_data and pass only payment method billing details/// We have flattened it because to maintain backwards compatibility with the old API contract#[serde(flatten)]+ #[smithy(value_type = "Option<PaymentMethodData>")]pub payment_method_data: Option<PaymentMethodData>,/// billing details for the payment method./// This billing details will be passed to the processor as billing address.@@ -2837,42 +3154,61 @@ pub struct VaultToken {pub card_holder_name: Option<Secret<String>>,}-#[derive(Debug, Clone, serde::Deserialize, serde::Serialize, ToSchema, Eq, PartialEq)]+#[derive(+ Debug, Clone, serde::Deserialize, serde::Serialize, ToSchema, Eq, PartialEq, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum PaymentMethodData {#[schema(title = "Card")]+ #[smithy(value_type = "Card")]Card(Card),#[schema(title = "CardRedirect")]+ #[smithy(value_type = "CardRedirectData")]CardRedirect(CardRedirectData),#[schema(title = "Wallet")]Wallet(WalletData),#[schema(title = "PayLater")]+ #[smithy(value_type = "PayLaterData")]PayLater(PayLaterData),#[schema(title = "BankRedirect")]+ #[smithy(value_type = "BankRedirectData")]BankRedirect(BankRedirectData),#[schema(title = "BankDebit")]+ #[smithy(value_type = "BankDebitData")]BankDebit(BankDebitData),#[schema(title = "BankTransfer")]+ #[smithy(value_type = "BankTransferData")]BankTransfer(Box<BankTransferData>),#[schema(title = "RealTimePayment")]+ #[smithy(value_type = "RealTimePaymentData")]RealTimePayment(Box<RealTimePaymentData>),#[schema(title = "Crypto")]+ #[smithy(value_type = "CryptoData")]Crypto(CryptoData),#[schema(title = "MandatePayment")]+ #[smithy(value_type = "smithy.api#Unit")]MandatePayment,#[schema(title = "Reward")]+ #[smithy(value_type = "smithy.api#Unit")]Reward,#[schema(title = "Upi")]+ #[smithy(value_type = "UpiData")]Upi(UpiData),#[schema(title = "Voucher")]+ #[smithy(value_type = "VoucherData")]Voucher(VoucherData),#[schema(title = "GiftCard")]+ #[smithy(value_type = "GiftCardData")]GiftCard(Box<GiftCardData>),#[schema(title = "CardToken")]+ #[smithy(value_type = "CardToken")]CardToken(CardToken),#[schema(title = "OpenBanking")]+ #[smithy(value_type = "OpenBankingData")]OpenBanking(OpenBankingData),#[schema(title = "MobilePayment")]+ #[smithy(value_type = "MobilePaymentData")]MobilePayment(MobilePaymentData),}@@ -3166,11 +3502,17 @@ impl GetPaymentMethodType for GiftCardData {}}-#[derive(serde::Deserialize, serde::Serialize, Debug, Clone, ToSchema, Eq, PartialEq)]+#[derive(+ serde::Deserialize, serde::Serialize, Debug, Clone, ToSchema, Eq, PartialEq, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum GiftCardData {+ #[smithy(value_type = "GiftCardDetails")]Givex(GiftCardDetails),+ #[smithy(nested_value_type)]PaySafeCard {},+ #[smithy(value_type = "BHNGiftCardDetails")]BhnCardNetwork(BHNGiftCardDetails),}@@ -3204,31 +3546,43 @@ pub struct ApplyPaymentMethodDataSurchargeResponseItem {pub surcharge_details: Option<payment_methods::SurchargeDetailsResponse>,}-#[derive(serde::Deserialize, serde::Serialize, Debug, Clone, ToSchema, Eq, PartialEq)]+#[derive(+ serde::Deserialize, serde::Serialize, Debug, Clone, ToSchema, Eq, PartialEq, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct BHNGiftCardDetails {/// The gift card or account number#[schema(value_type = String)]+ #[smithy(value_type = "String")]pub account_number: Secret<String>,/// The security PIN for gift cards requiring it#[schema(value_type = String)]+ #[smithy(value_type = "Option<String>")]pub pin: Option<Secret<String>>,/// The CVV2 code for Open Loop/VPLN products#[schema(value_type = String)]+ #[smithy(value_type = "Option<String>")]pub cvv2: Option<Secret<String>>,/// The expiration date in MMYYYY format for Open Loop/VPLN products#[schema(value_type = String)]+ #[smithy(value_type = "Option<String>")]pub expiration_date: Option<String>,}-#[derive(serde::Deserialize, serde::Serialize, Debug, Clone, ToSchema, Eq, PartialEq)]+#[derive(+ serde::Deserialize, serde::Serialize, Debug, Clone, ToSchema, Eq, PartialEq, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct GiftCardDetails {/// The gift card number#[schema(value_type = String)]+ #[smithy(value_type = "String")]pub number: Secret<String>,/// The card verification code.#[schema(value_type = String)]+ #[smithy(value_type = "String")]pub cvc: Secret<String>,}@@ -3287,20 +3641,20 @@ pub enum AdditionalPaymentData {BankRedirect {bank_name: Option<common_enums::BankNames>,#[serde(flatten)]- details: Option<additional_info::BankRedirectDetails>,+ details: Option<BankRedirectDetails>,interac: Option<InteracPaymentMethod>,},Wallet {apple_pay: Option<ApplepayPaymentMethod>,- google_pay: Option<additional_info::WalletAdditionalDataForCard>,- samsung_pay: Option<additional_info::WalletAdditionalDataForCard>,+ google_pay: Option<WalletAdditionalDataForCard>,+ samsung_pay: Option<WalletAdditionalDataForCard>,},PayLater {klarna_sdk: Option<KlarnaSdkPaymentMethod>,},BankTransfer {#[serde(flatten)]- details: Option<additional_info::BankTransferAdditionalData>,+ details: Option<BankTransferAdditionalData>,},Crypto {#[serde(flatten)]@@ -3308,7 +3662,7 @@ pub enum AdditionalPaymentData {},BankDebit {#[serde(flatten)]- details: Option<additional_info::BankDebitAdditionalData>,+ details: Option<BankDebitAdditionalData>,},MandatePayment {},Reward {},@@ -3318,11 +3672,11 @@ pub enum AdditionalPaymentData {},Upi {#[serde(flatten)]- details: Option<additional_info::UpiAdditionalData>,+ details: Option<UpiAdditionalData>,},GiftCard {#[serde(flatten)]- details: Option<additional_info::GiftCardAdditionalData>,+ details: Option<GiftCardAdditionalData>,},Voucher {#[serde(flatten)]@@ -3334,7 +3688,7 @@ pub enum AdditionalPaymentData {},CardToken {#[serde(flatten)]- details: Option<additional_info::CardTokenAdditionalData>,+ details: Option<CardTokenAdditionalData>,},OpenBanking {#[serde(flatten)]@@ -3366,147 +3720,202 @@ pub struct InteracPaymentMethod {pub customer_info: Option<pii::SecretSerdeValue>,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum BankRedirectData {+ #[smithy(nested_value_type)]BancontactCard {/// The card number#[schema(value_type = String, example = "4242424242424242")]+ #[smithy(value_type = "Option<String>")]card_number: Option<CardNumber>,/// The card's expiry month#[schema(value_type = String, example = "24")]+ #[smithy(value_type = "Option<String>")]card_exp_month: Option<Secret<String>>,/// The card's expiry year#[schema(value_type = String, example = "24")]+ #[smithy(value_type = "Option<String>")]card_exp_year: Option<Secret<String>>,/// The card holder's name#[schema(value_type = String, example = "John Test")]+ #[smithy(value_type = "Option<String>")]card_holder_name: Option<Secret<String>>,//Required by Stripes+ #[smithy(value_type = "Option<BankRedirectBilling>")]billing_details: Option<BankRedirectBilling>,},+ #[smithy(nested_value_type)]Bizum {},+ #[smithy(nested_value_type)]Blik {// Blik Code+ #[smithy(value_type = "Option<String>")]blik_code: Option<String>,},+ #[smithy(nested_value_type)]Eps {/// The billing details for bank redirection+ #[smithy(value_type = "Option<BankRedirectBilling>")]billing_details: Option<BankRedirectBilling>,/// The hyperswitch bank code for eps#[schema(value_type = BankNames, example = "triodos_bank")]+ #[smithy(value_type = "Option<BankNames>")]bank_name: Option<common_enums::BankNames>,/// The country for bank payment#[schema(value_type = CountryAlpha2, example = "US")]+ #[smithy(value_type = "Option<CountryAlpha2>")]country: Option<api_enums::CountryAlpha2>,},+ #[smithy(nested_value_type)]Giropay {/// The billing details for bank redirection+ #[smithy(value_type = "Option<BankRedirectBilling>")]billing_details: Option<BankRedirectBilling>,#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]/// Bank account bic codebank_account_bic: Option<Secret<String>>,/// Bank account iban#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]bank_account_iban: Option<Secret<String>>,/// The country for bank payment#[schema(value_type = CountryAlpha2, example = "US")]+ #[smithy(value_type = "Option<CountryAlpha2>")]country: Option<api_enums::CountryAlpha2>,},+ #[smithy(nested_value_type)]Ideal {/// The billing details for bank redirection+ #[smithy(value_type = "Option<BankRedirectBilling>")]billing_details: Option<BankRedirectBilling>,/// The hyperswitch bank code for ideal#[schema(value_type = BankNames, example = "abn_amro")]+ #[smithy(value_type = "Option<BankNames>")]bank_name: Option<common_enums::BankNames>,/// The country for bank payment#[schema(value_type = CountryAlpha2, example = "US")]+ #[smithy(value_type = "Option<CountryAlpha2>")]country: Option<api_enums::CountryAlpha2>,},+ #[smithy(nested_value_type)]Interac {/// The country for bank payment#[schema(value_type = Option<CountryAlpha2>, example = "US")]+ #[smithy(value_type = "Option<CountryAlpha2>")]country: Option<api_enums::CountryAlpha2>,#[schema(value_type = Option<String>, example = "[email protected]")]+ #[smithy(value_type = "Option<String>")]email: Option<Email>,},+ #[smithy(nested_value_type)]OnlineBankingCzechRepublic {// Issuer banks#[schema(value_type = BankNames)]+ #[smithy(value_type = "BankNames")]issuer: common_enums::BankNames,},+ #[smithy(nested_value_type)]OnlineBankingFinland {// Shopper Email#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]email: Option<Email>,},+ #[smithy(nested_value_type)]OnlineBankingPoland {// Issuer banks#[schema(value_type = BankNames)]+ #[smithy(value_type = "BankNames")]issuer: common_enums::BankNames,},+ #[smithy(nested_value_type)]OnlineBankingSlovakia {// Issuer value corresponds to the bank#[schema(value_type = BankNames)]+ #[smithy(value_type = "BankNames")]issuer: common_enums::BankNames,},+ #[smithy(nested_value_type)]OpenBankingUk {// Issuer banks#[schema(value_type = BankNames)]+ #[smithy(value_type = "Option<BankNames>")]issuer: Option<common_enums::BankNames>,/// The country for bank payment#[schema(value_type = CountryAlpha2, example = "US")]+ #[smithy(value_type = "Option<CountryAlpha2>")]country: Option<api_enums::CountryAlpha2>,},+ #[smithy(nested_value_type)]Przelewy24 {//Issuer banks#[schema(value_type = Option<BankNames>)]+ #[smithy(value_type = "Option<BankNames>")]bank_name: Option<common_enums::BankNames>,// The billing details for bank redirect+ #[smithy(value_type = "Option<BankRedirectBilling>")]billing_details: Option<BankRedirectBilling>,},+ #[smithy(nested_value_type)]Sofort {/// The billing details for bank redirection+ #[smithy(value_type = "Option<BankRedirectBilling>")]billing_details: Option<BankRedirectBilling>,/// The country for bank payment#[schema(value_type = CountryAlpha2, example = "US")]+ #[smithy(value_type = "Option<CountryAlpha2>")]country: Option<api_enums::CountryAlpha2>,/// The preferred language#[schema(example = "en")]+ #[smithy(value_type = "Option<String>")]preferred_language: Option<String>,},+ #[smithy(nested_value_type)]Trustly {/// The country for bank payment#[schema(value_type = CountryAlpha2, example = "US")]+ #[smithy(value_type = "CountryAlpha2")]country: api_enums::CountryAlpha2,},+ #[smithy(nested_value_type)]OnlineBankingFpx {// Issuer banks#[schema(value_type = BankNames)]+ #[smithy(value_type = "BankNames")]issuer: common_enums::BankNames,},+ #[smithy(nested_value_type)]OnlineBankingThailand {#[schema(value_type = BankNames)]+ #[smithy(value_type = "BankNames")]issuer: common_enums::BankNames,},+ #[smithy(nested_value_type)]LocalBankRedirect {},+ #[smithy(nested_value_type)]Eft {/// The preferred eft provider#[schema(example = "ozow")]+ #[smithy(value_type = "String")]provider: String,},}@@ -3630,110 +4039,168 @@ impl GetAddressFromPaymentMethodData for BankRedirectData {}}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct AlfamartVoucherData {/// The billing first name for Alfamart#[schema(value_type = Option<String>, example = "Jane")]+ #[smithy(value_type = "Option<String>")]pub first_name: Option<Secret<String>>,/// The billing second name for Alfamart#[schema(value_type = Option<String>, example = "Doe")]+ #[smithy(value_type = "Option<String>")]pub last_name: Option<Secret<String>>,/// The Email ID for Alfamart#[schema(value_type = Option<String>, example = "[email protected]")]+ #[smithy(value_type = "Option<String>")]pub email: Option<Email>,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct IndomaretVoucherData {/// The billing first name for Alfamart#[schema(value_type = Option<String>, example = "Jane")]+ #[smithy(value_type = "Option<String>")]pub first_name: Option<Secret<String>>,/// The billing second name for Alfamart#[schema(value_type = Option<String>, example = "Doe")]+ #[smithy(value_type = "Option<String>")]pub last_name: Option<Secret<String>>,/// The Email ID for Alfamart#[schema(value_type = Option<String>, example = "[email protected]")]+ #[smithy(value_type = "Option<String>")]pub email: Option<Email>,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct JCSVoucherData {/// The billing first name for Japanese convenience stores#[schema(value_type = Option<String>, example = "Jane")]+ #[smithy(value_type = "Option<String>")]pub first_name: Option<Secret<String>>,/// The billing second name Japanese convenience stores#[schema(value_type = Option<String>, example = "Doe")]+ #[smithy(value_type = "Option<String>")]pub last_name: Option<Secret<String>>,/// The Email ID for Japanese convenience stores#[schema(value_type = Option<String>, example = "[email protected]")]+ #[smithy(value_type = "Option<String>")]pub email: Option<Email>,/// The telephone number for Japanese convenience stores#[schema(value_type = Option<String>, example = "9123456789")]+ #[smithy(value_type = "Option<String>")]pub phone_number: Option<String>,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct AchBillingDetails {/// The Email ID for ACH billing#[schema(value_type = Option<String>, example = "[email protected]")]+ #[smithy(value_type = "Option<String>")]pub email: Option<Email>,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct DokuBillingDetails {/// The billing first name for Doku#[schema(value_type = Option<String>, example = "Jane")]+ #[smithy(value_type = "Option<String>")]pub first_name: Option<Secret<String>>,/// The billing second name for Doku#[schema(value_type = Option<String>, example = "Doe")]+ #[smithy(value_type = "Option<String>")]pub last_name: Option<Secret<String>>,/// The Email ID for Doku billing#[schema(value_type = Option<String>, example = "[email protected]")]+ #[smithy(value_type = "Option<String>")]pub email: Option<Email>,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct MultibancoBillingDetails {#[schema(value_type = Option<String>, example = "[email protected]")]+ #[smithy(value_type = "Option<String>")]pub email: Option<Email>,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct SepaAndBacsBillingDetails {/// The Email ID for SEPA and BACS billing#[schema(value_type = Option<String>, example = "[email protected]")]+ #[smithy(value_type = "Option<String>")]pub email: Option<Email>,/// The billing name for SEPA and BACS billing#[schema(value_type = Option<String>, example = "Jane Doe")]+ #[smithy(value_type = "Option<String>")]pub name: Option<Secret<String>>,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct CryptoData {+ #[smithy(value_type = "Option<String>")]pub pay_currency: Option<String>,+ #[smithy(value_type = "Option<String>")]pub network: Option<String>,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum UpiData {+ #[smithy(value_type = "UpiCollectData")]UpiCollect(UpiCollectData),+ #[smithy(value_type = "UpiIntentData")]UpiIntent(UpiIntentData),UpiQr(UpiQrData),}-#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct UpiCollectData {#[schema(value_type = Option<String>, example = "successtest@iata")]+ #[smithy(value_type = "Option<String>")]pub vpa_id: Option<Secret<String, pii::UpiVpaMaskingStrategy>>,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct UpiQrData {}-#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct UpiIntentData {}#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]@@ -3743,13 +4210,18 @@ pub struct SofortBilling {pub billing_country: String,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct BankRedirectBilling {/// The name for which billing is issued#[schema(value_type = String, example = "John Doe")]+ #[smithy(value_type = "Option<String>")]pub billing_name: Option<Secret<String>>,/// The billing email for bank redirect#[schema(value_type = String, example = "[email protected]")]+ #[smithy(value_type = "Option<String>")]pub email: Option<Email>,}@@ -3775,97 +4247,145 @@ impl GetAddressFromPaymentMethodData for BankRedirectBilling {}}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum BankTransferData {+ #[smithy(nested_value_type)]AchBankTransfer {/// The billing details for ACH Bank Transfer+ #[smithy(value_type = "Option<AchBillingDetails>")]billing_details: Option<AchBillingDetails>,},+ #[smithy(nested_value_type)]SepaBankTransfer {/// The billing details for SEPA+ #[smithy(value_type = "Option<SepaAndBacsBillingDetails>")]billing_details: Option<SepaAndBacsBillingDetails>,/// The two-letter ISO country code for SEPA and BACS#[schema(value_type = CountryAlpha2, example = "US")]+ #[smithy(value_type = "Option<CountryAlpha2>")]country: Option<api_enums::CountryAlpha2>,},+ #[smithy(nested_value_type)]BacsBankTransfer {/// The billing details for SEPA+ #[smithy(value_type = "Option<SepaAndBacsBillingDetails>")]billing_details: Option<SepaAndBacsBillingDetails>,},+ #[smithy(nested_value_type)]MultibancoBankTransfer {/// The billing details for Multibanco+ #[smithy(value_type = "Option<MultibancoBillingDetails>")]billing_details: Option<MultibancoBillingDetails>,},+ #[smithy(nested_value_type)]PermataBankTransfer {/// The billing details for Permata Bank Transfer+ #[smithy(value_type = "Option<DokuBillingDetails>")]billing_details: Option<DokuBillingDetails>,},+ #[smithy(nested_value_type)]BcaBankTransfer {/// The billing details for BCA Bank Transfer+ #[smithy(value_type = "Option<DokuBillingDetails>")]billing_details: Option<DokuBillingDetails>,},+ #[smithy(nested_value_type)]BniVaBankTransfer {/// The billing details for BniVa Bank Transfer+ #[smithy(value_type = "Option<DokuBillingDetails>")]billing_details: Option<DokuBillingDetails>,},+ #[smithy(nested_value_type)]BriVaBankTransfer {/// The billing details for BniVa Bank Transfer+ #[smithy(value_type = "Option<DokuBillingDetails>")]billing_details: Option<DokuBillingDetails>,},+ #[smithy(nested_value_type)]CimbVaBankTransfer {/// The billing details for BniVa Bank Transfer+ #[smithy(value_type = "Option<DokuBillingDetails>")]billing_details: Option<DokuBillingDetails>,},+ #[smithy(nested_value_type)]DanamonVaBankTransfer {/// The billing details for BniVa Bank Transfer+ #[smithy(value_type = "Option<DokuBillingDetails>")]billing_details: Option<DokuBillingDetails>,},+ #[smithy(nested_value_type)]MandiriVaBankTransfer {/// The billing details for BniVa Bank Transfer+ #[smithy(value_type = "Option<DokuBillingDetails>")]billing_details: Option<DokuBillingDetails>,},+ #[smithy(nested_value_type)]Pix {/// Unique key for pix transfer#[schema(value_type = Option<String>, example = "a1f4102e-a446-4a57-bcce-6fa48899c1d1")]+ #[smithy(value_type = "Option<String>")]pix_key: Option<Secret<String>>,/// CPF is a Brazilian tax identification number#[schema(value_type = Option<String>, example = "10599054689")]+ #[smithy(value_type = "Option<String>")]cpf: Option<Secret<String>>,/// CNPJ is a Brazilian company tax identification number#[schema(value_type = Option<String>, example = "74469027417312")]+ #[smithy(value_type = "Option<String>")]cnpj: Option<Secret<String>>,/// Source bank account number#[schema(value_type = Option<String>, example = "8b******-****-****-****-*******08bc5")]+ #[smithy(value_type = "Option<String>")]source_bank_account_id: Option<MaskedBankAccount>,/// Partially masked destination bank account number _Deprecated: Will be removed in next stable release._#[schema(value_type = Option<String>, example = "********-****-460b-****-f23b4e71c97b", deprecated)]+ #[smithy(value_type = "Option<String>")]destination_bank_account_id: Option<MaskedBankAccount>,/// The expiration date and time for the Pix QR code in ISO 8601 format#[schema(value_type = Option<String>, example = "2025-09-10T10:11:12Z")]#[serde(default, with = "common_utils::custom_serde::iso8601::option")]+ #[smithy(value_type = "Option<String>")]expiry_date: Option<PrimitiveDateTime>,},+ #[smithy(nested_value_type)]Pse {},+ #[smithy(nested_value_type)]LocalBankTransfer {+ #[smithy(value_type = "Option<String>")]bank_code: Option<String>,},+ #[smithy(nested_value_type)]InstantBankTransfer {},+ #[smithy(nested_value_type)]InstantBankTransferFinland {},+ #[smithy(nested_value_type)]InstantBankTransferPoland {},+ #[smithy(nested_value_type)]IndonesianBankTransfer {#[schema(value_type = Option<BankNames>, example = "bri")]+ #[smithy(value_type = "Option<BankNames>")]bank_name: Option<common_enums::BankNames>,},}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum RealTimePaymentData {+ #[smithy(nested_value_type)]Fps {},+ #[smithy(nested_value_type)]DuitNow {},+ #[smithy(nested_value_type)]PromptPay {},+ #[smithy(nested_value_type)]VietQr {},}@@ -3936,15 +4456,21 @@ impl GetAddressFromPaymentMethodData for BankTransferData {}}-#[derive(serde::Deserialize, serde::Serialize, Debug, Clone, ToSchema, Eq, PartialEq)]+#[derive(+ serde::Deserialize, serde::Serialize, Debug, Clone, ToSchema, Eq, PartialEq, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct BankDebitBilling {/// The billing name for bank debits#[schema(value_type = Option<String>, example = "John Doe")]+ #[smithy(value_type = "Option<String>")]pub name: Option<Secret<String>>,/// The billing email for bank debits#[schema(value_type = Option<String>, example = "[email protected]")]+ #[smithy(value_type = "Option<String>")]pub email: Option<Email>,/// The billing address for bank debits+ #[smithy(value_type = "Option<AddressDetails>")]pub address: Option<AddressDetails>,}@@ -3972,110 +4498,147 @@ impl GetAddressFromPaymentMethodData for BankDebitBilling {}}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum WalletData {/// The wallet data for Ali Pay HK redirect#[schema(title = "AliPayHkRedirect")]+ #[smithy(value_type = "AliPayHkRedirection")]AliPayHkRedirect(AliPayHkRedirection),/// The wallet data for Ali Pay QrCode#[schema(title = "AliPayQr")]+ #[smithy(value_type = "AliPayQr")]AliPayQr(Box<AliPayQr>),/// The wallet data for Ali Pay redirect#[schema(title = "AliPayRedirect")]+ #[smithy(value_type = "AliPayRedirection")]AliPayRedirect(AliPayRedirection),/// The wallet data for Amazon Pay#[schema(title = "AmazonPay")]+ #[smithy(value_type = "AmazonPayWalletData")]AmazonPay(AmazonPayWalletData),/// The wallet data for Amazon Pay redirect#[schema(title = "AmazonPayRedirect")]+ #[smithy(value_type = "AmazonPayRedirectData")]AmazonPayRedirect(AmazonPayRedirectData),/// The wallet data for Apple pay#[schema(title = "ApplePay")]+ #[smithy(value_type = "ApplePayWalletData")]ApplePay(ApplePayWalletData),/// Wallet data for apple pay redirect flow#[schema(title = "ApplePayRedirect")]+ #[smithy(value_type = "ApplePayRedirectData")]ApplePayRedirect(Box<ApplePayRedirectData>),/// Wallet data for apple pay third party sdk flow#[schema(title = "ApplePayThirdPartySdk")]+ #[smithy(value_type = "ApplePayThirdPartySdkData")]ApplePayThirdPartySdk(Box<ApplePayThirdPartySdkData>),/// The wallet data for Bluecode QR Code Redirect#[schema(title = "BluecodeRedirect")]+ #[smithy(nested_value_type)]BluecodeRedirect {},/// The wallet data for Cashapp Qr#[schema(title = "CashappQr")]+ #[smithy(value_type = "CashappQr")]CashappQr(Box<CashappQr>),/// Wallet data for DANA redirect flow#[schema(title = "DanaRedirect")]+ #[smithy(nested_value_type)]DanaRedirect {},/// The wallet data for Gcash redirect#[schema(title = "GcashRedirect")]+ #[smithy(value_type = "GcashRedirection")]GcashRedirect(GcashRedirection),/// The wallet data for GoPay redirect#[schema(title = "GoPayRedirect")]+ #[smithy(value_type = "GoPayRedirection")]GoPayRedirect(GoPayRedirection),/// The wallet data for Google pay#[schema(title = "GooglePay")]+ #[smithy(value_type = "GooglePayWalletData")]GooglePay(GooglePayWalletData),/// Wallet data for google pay redirect flow#[schema(title = "GooglePayRedirect")]+ #[smithy(value_type = "GooglePayRedirectData")]GooglePayRedirect(Box<GooglePayRedirectData>),/// Wallet data for Google pay third party sdk flow#[schema(title = "GooglePayThirdPartySdk")]+ #[smithy(value_type = "GooglePayThirdPartySdkData")]GooglePayThirdPartySdk(Box<GooglePayThirdPartySdkData>),/// The wallet data for KakaoPay redirect#[schema(title = "KakaoPayRedirect")]+ #[smithy(value_type = "KakaoPayRedirection")]KakaoPayRedirect(KakaoPayRedirection),/// Wallet data for MbWay redirect flow#[schema(title = "MbWayRedirect")]+ #[smithy(value_type = "MbWayRedirection")]MbWayRedirect(Box<MbWayRedirection>),// The wallet data for Mifinity Ewallet#[schema(title = "Mifinity")]+ #[smithy(value_type = "MifinityData")]Mifinity(MifinityData),/// The wallet data for MobilePay redirect#[schema(title = "MobilePayRedirect")]+ #[smithy(value_type = "MobilePayRedirection")]MobilePayRedirect(Box<MobilePayRedirection>),/// The wallet data for Momo redirect#[schema(title = "MomoRedirect")]+ #[smithy(value_type = "MomoRedirection")]MomoRedirect(MomoRedirection),/// This is for paypal redirection#[schema(title = "PaypalRedirect")]+ #[smithy(value_type = "PaypalRedirection")]PaypalRedirect(PaypalRedirection),/// The wallet data for Paypal#[schema(title = "PaypalSdk")]+ #[smithy(value_type = "PayPalWalletData")]PaypalSdk(PayPalWalletData),/// The wallet data for Paysera#[schema(title = "Paysera")]+ #[smithy(value_type = "PayseraData")]Paysera(PayseraData),/// The wallet data for Paze#[schema(title = "Paze")]+ #[smithy(value_type = "PazeWalletData")]Paze(PazeWalletData),// The wallet data for RevolutPay#[schema(title = "RevolutPay")]+ #[smithy(value_type = "RevolutPayData")]RevolutPay(RevolutPayData),/// The wallet data for Samsung Pay#[schema(title = "SamsungPay")]+ #[smithy(value_type = "SamsungPayWalletData")]SamsungPay(Box<SamsungPayWalletData>),/// The wallet data for Skrill#[schema(title = "Skrill")]+ #[smithy(value_type = "SkrillData")]Skrill(SkrillData),// The wallet data for Swish#[schema(title = "SwishQr")]+ #[smithy(value_type = "SwishQrData")]SwishQr(SwishQrData),/// The wallet data for Touch n Go Redirection#[schema(title = "TouchNGoRedirect")]+ #[smithy(value_type = "TouchNGoRedirection")]TouchNGoRedirect(Box<TouchNGoRedirection>),/// Wallet data for Twint Redirection#[schema(title = "TwintRedirect")]+ #[smithy(nested_value_type)]TwintRedirect {},/// Wallet data for Vipps Redirection#[schema(title = "VippsRedirect")]+ #[smithy(nested_value_type)]VippsRedirect {},/// The wallet data for WeChat Pay Display QrCode#[schema(title = "WeChatPayQr")]+ #[smithy(value_type = "WeChatPayQr")]WeChatPayQr(Box<WeChatPayQr>),/// The wallet data for WeChat Pay Redirection#[schema(title = "WeChatPayRedirect")]+ #[smithy(value_type = "WeChatPayRedirection")]WeChatPayRedirect(Box<WeChatPayRedirection>),}@@ -4138,23 +4701,36 @@ impl GetAddressFromPaymentMethodData for WalletData {}}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct PazeWalletData {#[schema(value_type = String)]+ #[smithy(value_type = "String")]pub complete_response: Secret<String>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct SamsungPayWalletData {+ #[smithy(value_type = "SamsungPayWalletCredentials")]pub payment_credential: SamsungPayWalletCredentials,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case", untagged)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum SamsungPayWalletCredentials {+ #[smithy(value_type = "SamsungPayWebWalletData")]SamsungPayWalletDataForWeb(SamsungPayWebWalletData),+ #[smithy(value_type = "SamsungPayAppWalletData")]SamsungPayWalletDataForApp(SamsungPayAppWalletData),}@@ -4170,60 +4746,88 @@ impl From<SamsungPayCardBrand> for common_enums::SamsungPayCardBrand {}}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct SamsungPayAppWalletData {/// Samsung Pay token data#[serde(rename = "3_d_s")]+ #[smithy(value_type = "SamsungPayTokenData")]pub token_data: SamsungPayTokenData,/// Brand of the payment card+ #[smithy(value_type = "SamsungPayCardBrand")]pub payment_card_brand: SamsungPayCardBrand,/// Currency type of the payment+ #[smithy(value_type = "String")]pub payment_currency_type: String,/// Last 4 digits of the device specific card number+ #[smithy(value_type = "Option<String>")]pub payment_last4_dpan: Option<String>,/// Last 4 digits of the card number+ #[smithy(value_type = "String")]pub payment_last4_fpan: String,/// Merchant reference id that was passed in the session call request+ #[smithy(value_type = "Option<String>")]pub merchant_ref: Option<String>,/// Specifies authentication method used+ #[smithy(value_type = "Option<String>")]pub method: Option<String>,/// Value if credential is enabled for recurring payment+ #[smithy(value_type = "Option<bool>")]pub recurring_payment: Option<bool>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct SamsungPayWebWalletData {/// Specifies authentication method used+ #[smithy(value_type = "Option<String>")]pub method: Option<String>,/// Value if credential is enabled for recurring payment+ #[smithy(value_type = "Option<bool>")]pub recurring_payment: Option<bool>,/// Brand of the payment card+ #[smithy(value_type = "SamsungPayCardBrand")]pub card_brand: SamsungPayCardBrand,/// Last 4 digits of the card number#[serde(rename = "card_last4digits")]+ #[smithy(value_type = "String")]pub card_last_four_digits: String,/// Samsung Pay token data#[serde(rename = "3_d_s")]+ #[smithy(value_type = "SamsungPayTokenData")]pub token_data: SamsungPayTokenData,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct SamsungPayTokenData {/// 3DS type used by Samsung Pay#[serde(rename = "type")]+ #[smithy(value_type = "Option<String>")]pub three_ds_type: Option<String>,/// 3DS version used by Samsung Pay+ #[smithy(value_type = "String")]pub version: String,/// Samsung Pay encrypted payment credential data#[schema(value_type = String)]+ #[smithy(value_type = "String")]pub data: Secret<String>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "lowercase")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum SamsungPayCardBrand {#[serde(alias = "VI")]Visa,@@ -4237,38 +4841,55 @@ pub enum SamsungPayCardBrand {Unknown,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum OpenBankingData {#[serde(rename = "open_banking_pis")]+ #[smithy(nested_value_type)]OpenBankingPIS {},}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum MobilePaymentData {+ #[smithy(nested_value_type)]DirectCarrierBilling {/// The phone number of the user#[schema(value_type = String, example = "1234567890")]+ #[smithy(value_type = "String")]msisdn: String,/// Unique user id#[schema(value_type = Option<String>, example = "02iacdYXGI9CnyJdoN8c7")]+ #[smithy(value_type = "Option<String>")]client_uid: Option<String>,},}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct GooglePayWalletData {/// The type of payment method#[serde(rename = "type")]+ #[smithy(value_type = "String")]pub pm_type: String,/// User-facing message to describe the payment method that funds this transaction.+ #[smithy(value_type = "String")]pub description: String,/// The information of the payment method+ #[smithy(value_type = "GooglePayPaymentMethodInfo")]pub info: GooglePayPaymentMethodInfo,/// The tokenization data of Google pay#[schema(value_type = GpayTokenizationData)]+ #[smithy(value_type = "Object")]pub tokenization_data: common_types::payments::GpayTokenizationData,}@@ -4286,175 +4907,306 @@ pub struct AmazonPayMerchantCredentials {pub store_id: String,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct ApplePayRedirectData {}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct AmazonPayRedirectData {}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct SkrillData {}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct PayseraData {}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct GooglePayRedirectData {}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct GooglePayThirdPartySdkData {#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]pub token: Option<Secret<String>>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct ApplePayThirdPartySdkData {#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]pub token: Option<Secret<String>>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct WeChatPayRedirection {}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct WeChatPay {}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct WeChatPayQr {}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct CashappQr {}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct PaypalRedirection {/// paypal's email address#[schema(max_length = 255, value_type = Option<String>, example = "[email protected]")]+ #[smithy(value_type = "Option<String>")]pub email: Option<Email>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct AliPayQr {}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct AliPayRedirection {}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct AliPayHkRedirection {}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct BluecodeQrRedirect {}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct MomoRedirection {}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct KakaoPayRedirection {}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct GoPayRedirection {}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct GcashRedirection {}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct MobilePayRedirection {}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct MbWayRedirection {/// Telephone number of the shopper. Should be Portuguese phone number.#[schema(value_type = String)]+ #[smithy(value_type = "Option<String>")]pub telephone_number: Option<Secret<String>>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct GooglePayPaymentMethodInfo {/// The name of the card network+ #[smithy(value_type = "String")]pub card_network: String,/// The details of the card+ #[smithy(value_type = "String")]pub card_details: String,//assurance_details of the card+ #[smithy(value_type = "Option<GooglePayAssuranceDetails>")]pub assurance_details: Option<GooglePayAssuranceDetails>,/// Card funding source for the selected payment method+ #[smithy(value_type = "Option<GooglePayCardFundingSource>")]pub card_funding_source: Option<GooglePayCardFundingSource>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct GooglePayAssuranceDetails {///indicates that Cardholder possession validation has been performed+ #[smithy(value_type = "bool")]pub card_holder_authenticated: bool,/// indicates that identification and verifications (ID&V) was performed+ #[smithy(value_type = "bool")]pub account_verified: bool,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct PayPalWalletData {/// Token generated for the Apple pay+ #[smithy(value_type = "String")]pub token: String,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct TouchNGoRedirection {}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct SwishQrData {}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct RevolutPayData {}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct MifinityData {#[schema(value_type = Date)]+ #[smithy(value_type = "String")]pub date_of_birth: Secret<Date>,+ #[smithy(value_type = "Option<String>")]pub language_preference: Option<String>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct AmazonPayWalletData {/// Checkout Session identifier+ #[smithy(value_type = "String")]pub checkout_session_id: String,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct ApplePayWalletData {/// The payment data of Apple pay#[schema(value_type = ApplePayPaymentData)]+ #[smithy(value_type = "Object")]pub payment_data: common_types::payments::ApplePayPaymentData,/// The payment method of Apple pay+ #[smithy(value_type = "ApplepayPaymentMethod")]pub payment_method: ApplepayPaymentMethod,/// The unique identifier for the transaction+ #[smithy(value_type = "String")]pub transaction_identifier: String,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct ApplepayPaymentMethod {/// The name to be displayed on Apple Pay button+ #[smithy(value_type = "String")]pub display_name: String,/// The network of the Apple pay payment method+ #[smithy(value_type = "String")]pub network: String,/// The type of the payment method#[serde(rename = "type")]+ #[smithy(value_type = "String")]pub pm_type: String,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct CardResponse {+ #[smithy(value_type = "Option<String>")]pub last4: Option<String>,+ #[smithy(value_type = "Option<String>")]pub card_type: Option<String>,#[schema(value_type = Option<CardNetwork>, example = "Visa")]+ #[smithy(value_type = "Option<CardNetwork>")]pub card_network: Option<api_enums::CardNetwork>,+ #[smithy(value_type = "Option<String>")]pub card_issuer: Option<String>,+ #[smithy(value_type = "Option<String>")]pub card_issuing_country: Option<String>,+ #[smithy(value_type = "Option<String>")]pub card_isin: Option<String>,+ #[smithy(value_type = "Option<String>")]pub card_extended_bin: Option<String>,#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]pub card_exp_month: Option<Secret<String>>,#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]pub card_exp_year: Option<Secret<String>>,#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]pub card_holder_name: Option<Secret<String>>,+ #[smithy(value_type = "Option<Object>")]pub payment_checks: Option<serde_json::Value>,+ #[smithy(value_type = "Option<Object>")]pub authentication_data: Option<serde_json::Value>,}@@ -4466,62 +5218,91 @@ pub struct RewardData {pub merchant_id: id_type::MerchantId,}-#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct BoletoVoucherData {/// The shopper's social security number (CPF or CNPJ)#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]pub social_security_number: Option<Secret<String>>,/// The shopper's bank account number associated with the boleto#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]pub bank_number: Option<Secret<String>>,/// The type of identification document used (e.g., CPF or CNPJ)#[schema(value_type = Option<DocumentKind>, example = "Cpf", default = "Cnpj")]+ #[smithy(value_type = "Option<DocumentKind>")]pub document_type: Option<common_enums::DocumentKind>,/// The fine percentage charged if payment is overdue#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]pub fine_percentage: Option<String>,/// The number of days after the due date when the fine is applied#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]pub fine_quantity_days: Option<String>,/// The interest percentage charged on late payments#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]pub interest_percentage: Option<String>,/// The number of days after which the boleto is written off (canceled)#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]pub write_off_quantity_days: Option<String>,/// Custom messages or instructions to display on the boleto#[schema(value_type = Option<Vec<String>>)]+ #[smithy(value_type = "Option<Vec<String>>")]pub messages: Option<Vec<String>>,// #[serde(with = "common_utils::custom_serde::date_yyyy_mm_dd::option")]#[schema(value_type = Option<String>, format = "date", example = "2025-08-22")]+ #[smithy(value_type = "Option<String>")]// The date upon which the boleto is due and is of format: "YYYY-MM-DD"pub due_date: Option<String>,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum VoucherData {+ #[smithy(value_type = "BoletoVoucherData")]Boleto(Box<BoletoVoucherData>),+ #[smithy(value_type = "smithy.api#Unit")]Efecty,+ #[smithy(value_type = "smithy.api#Unit")]PagoEfectivo,+ #[smithy(value_type = "smithy.api#Unit")]RedCompra,+ #[smithy(value_type = "smithy.api#Unit")]RedPagos,+ #[smithy(value_type = "AlfamartVoucherData")]Alfamart(Box<AlfamartVoucherData>),+ #[smithy(value_type = "IndomaretVoucherData")]Indomaret(Box<IndomaretVoucherData>),+ #[smithy(value_type = "smithy.api#Unit")]Oxxo,+ #[smithy(value_type = "JCSVoucherData")]SevenEleven(Box<JCSVoucherData>),+ #[smithy(value_type = "JCSVoucherData")]Lawson(Box<JCSVoucherData>),+ #[smithy(value_type = "JCSVoucherData")]MiniStop(Box<JCSVoucherData>),+ #[smithy(value_type = "JCSVoucherData")]FamilyMart(Box<JCSVoucherData>),+ #[smithy(value_type = "JCSVoucherData")]Seicomart(Box<JCSVoucherData>),+ #[smithy(value_type = "JCSVoucherData")]PayEasy(Box<JCSVoucherData>),}@@ -4614,145 +5395,236 @@ where}}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum PaymentMethodDataResponse {+ #[smithy(value_type = "CardResponse")]Card(Box<CardResponse>),+ #[smithy(value_type = "BankTransferResponse")]BankTransfer(Box<BankTransferResponse>),+ #[smithy(value_type = "WalletResponse")]Wallet(Box<WalletResponse>),+ #[smithy(value_type = "PaylaterResponse")]PayLater(Box<PaylaterResponse>),+ #[smithy(value_type = "BankRedirectResponse")]BankRedirect(Box<BankRedirectResponse>),+ #[smithy(value_type = "CryptoResponse")]Crypto(Box<CryptoResponse>),+ #[smithy(value_type = "BankDebitResponse")]BankDebit(Box<BankDebitResponse>),+ #[smithy(nested_value_type)]MandatePayment {},+ #[smithy(nested_value_type)]Reward {},+ #[smithy(value_type = "RealTimePaymentDataResponse")]RealTimePayment(Box<RealTimePaymentDataResponse>),+ #[smithy(value_type = "UpiResponse")]Upi(Box<UpiResponse>),+ #[smithy(value_type = "VoucherResponse")]Voucher(Box<VoucherResponse>),+ #[smithy(value_type = "GiftCardResponse")]GiftCard(Box<GiftCardResponse>),+ #[smithy(value_type = "CardRedirectResponse")]CardRedirect(Box<CardRedirectResponse>),+ #[smithy(value_type = "CardTokenResponse")]CardToken(Box<CardTokenResponse>),+ #[smithy(value_type = "OpenBankingResponse")]OpenBanking(Box<OpenBankingResponse>),+ #[smithy(value_type = "MobilePaymentResponse")]MobilePayment(Box<MobilePaymentResponse>),}-#[derive(Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct BankDebitResponse {#[serde(flatten)]#[schema(value_type = Option<BankDebitAdditionalData>)]- details: Option<additional_info::BankDebitAdditionalData>,+ #[smithy(value_type = "Option<BankDebitAdditionalData>")]+ details: Option<BankDebitAdditionalData>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case", tag = "type")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct BankRedirectResponse {/// Name of the bank#[schema(value_type = Option<BankNames>)]+ #[smithy(value_type = "Option<BankNames>")]pub bank_name: Option<common_enums::BankNames>,#[serde(flatten)]#[schema(value_type = Option<BankRedirectDetails>)]- pub details: Option<additional_info::BankRedirectDetails>,+ #[smithy(value_type = "Option<BankRedirectDetails>")]+ pub details: Option<BankRedirectDetails>,/// customer info for interac payment method#[schema(value_type = Option<InteracPaymentMethod>)]pub interac: Option<InteracPaymentMethod>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct BankTransferResponse {#[serde(flatten)]#[schema(value_type = Option<BankTransferAdditionalData>)]- details: Option<additional_info::BankTransferAdditionalData>,+ #[smithy(value_type = "Option<BankTransferAdditionalData>")]+ details: Option<BankTransferAdditionalData>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct CardRedirectResponse {#[serde(flatten)]+ #[smithy(value_type = "Option<CardRedirectData>")]details: Option<CardRedirectData>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct CardTokenResponse {#[serde(flatten)]#[schema(value_type = Option<CardTokenAdditionalData>)]- details: Option<additional_info::CardTokenAdditionalData>,+ #[smithy(value_type = "Option<CardTokenAdditionalData>")]+ details: Option<CardTokenAdditionalData>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct CryptoResponse {#[serde(flatten)]+ #[smithy(value_type = "Option<CryptoData>")]details: Option<CryptoData>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct GiftCardResponse {#[serde(flatten)]#[schema(value_type = Option<GiftCardAdditionalData>)]- details: Option<additional_info::GiftCardAdditionalData>,+ #[smithy(value_type = "Option<GiftCardAdditionalData>")]+ details: Option<GiftCardAdditionalData>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct OpenBankingResponse {#[serde(flatten)]+ #[smithy(value_type = "Option<OpenBankingData>")]details: Option<OpenBankingData>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct MobilePaymentResponse {#[serde(flatten)]+ #[smithy(value_type = "Option<MobilePaymentData>")]details: Option<MobilePaymentData>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct RealTimePaymentDataResponse {#[serde(flatten)]+ #[smithy(value_type = "Option<RealTimePaymentData>")]details: Option<RealTimePaymentData>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct UpiResponse {#[serde(flatten)]#[schema(value_type = Option<UpiAdditionalData>)]- details: Option<additional_info::UpiAdditionalData>,+ #[smithy(value_type = "Option<UpiAdditionalData>")]+ details: Option<UpiAdditionalData>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct VoucherResponse {#[serde(flatten)]+ #[smithy(value_type = "Option<VoucherData>")]details: Option<VoucherData>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct PaylaterResponse {+ #[smithy(value_type = "Option<KlarnaSdkPaymentMethodResponse>")]klarna_sdk: Option<KlarnaSdkPaymentMethodResponse>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct WalletResponse {#[serde(flatten)]+ #[smithy(value_type = "Option<WalletResponseData>")]details: Option<WalletResponseData>,}/// Hyperswitch supports SDK integration with Apple Pay and Google Pay wallets. For other wallets, we integrate with their respective connectors, redirecting the customer to the connector for wallet payments. As a result, we don’t receive any payment method data in the confirm call for payments made through other wallets.-#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum WalletResponseData {#[schema(value_type = WalletAdditionalDataForCard)]- ApplePay(Box<additional_info::WalletAdditionalDataForCard>),+ #[smithy(value_type = "Option<WalletAdditionalDataForCard>")]+ ApplePay(Box<WalletAdditionalDataForCard>),#[schema(value_type = WalletAdditionalDataForCard)]- GooglePay(Box<additional_info::WalletAdditionalDataForCard>),+ #[smithy(value_type = "Option<WalletAdditionalDataForCard>")]+ GooglePay(Box<WalletAdditionalDataForCard>),#[schema(value_type = WalletAdditionalDataForCard)]- SamsungPay(Box<additional_info::WalletAdditionalDataForCard>),+ #[smithy(value_type = "Option<WalletAdditionalDataForCard>")]+ SamsungPay(Box<WalletAdditionalDataForCard>),}-#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct KlarnaSdkPaymentMethodResponse {+ #[smithy(value_type = "Option<String>")]pub payment_type: Option<String>,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, ToSchema, serde::Serialize)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Deserialize, ToSchema, serde::Serialize, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct PaymentMethodDataResponseWithBilling {// The struct is flattened in order to provide backwards compatibility#[serde(flatten)]+ #[smithy(value_type = "Option<PaymentMethodDataResponse>")]pub payment_method_data: Option<PaymentMethodDataResponse>,pub billing: Option<Address>,}@@ -4825,15 +5697,29 @@ impl Default for PaymentIdType {}}-#[derive(Default, Clone, Debug, Eq, PartialEq, ToSchema, serde::Deserialize, serde::Serialize)]+#[derive(+ Default,+ Clone,+ Debug,+ Eq,+ PartialEq,+ ToSchema,+ serde::Deserialize,+ serde::Serialize,+ SmithyModel,+)]// #[serde(deny_unknown_fields)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct Address {/// Provide the address details+ #[smithy(value_type = "Option<AddressDetails>")]pub address: Option<AddressDetails>,+ #[smithy(value_type = "Option<PhoneDetails>")]pub phone: Option<PhoneDetails>,#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]pub email: Option<Email>,}@@ -4856,47 +5742,68 @@ impl Address {// used by customers also, could be moved outside/// Address details-#[derive(Clone, Default, Debug, Eq, serde::Deserialize, serde::Serialize, PartialEq, ToSchema)]+#[derive(+ Clone,+ Default,+ Debug,+ Eq,+ serde::Deserialize,+ serde::Serialize,+ PartialEq,+ ToSchema,+ SmithyModel,+)]// #[serde(deny_unknown_fields)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct AddressDetails {/// The city, district, suburb, town, or village of the address.#[schema(max_length = 50, example = "New York")]+ #[smithy(value_type = "Option<String>")]pub city: Option<String>,/// The two-letter ISO 3166-1 alpha-2 country code (e.g., US, GB).#[schema(value_type = Option<CountryAlpha2>, example = "US")]+ #[smithy(value_type = "Option<CountryAlpha2>")]pub country: Option<api_enums::CountryAlpha2>,/// The first line of the street address or P.O. Box.#[schema(value_type = Option<String>, max_length = 200, example = "123, King Street")]+ #[smithy(value_type = "Option<String>")]pub line1: Option<Secret<String>>,/// The second line of the street address or P.O. Box (e.g., apartment, suite, unit, or building).#[schema(value_type = Option<String>, max_length = 50, example = "Powelson Avenue")]+ #[smithy(value_type = "Option<String>")]pub line2: Option<Secret<String>>,/// The third line of the street address, if applicable.#[schema(value_type = Option<String>, max_length = 50, example = "Bridgewater")]+ #[smithy(value_type = "Option<String>")]pub line3: Option<Secret<String>>,/// The zip/postal code for the address#[schema(value_type = Option<String>, max_length = 50, example = "08807")]+ #[smithy(value_type = "Option<String>")]pub zip: Option<Secret<String>>,/// The address state#[schema(value_type = Option<String>, example = "New York")]+ #[smithy(value_type = "Option<String>")]pub state: Option<Secret<String>>,/// The first name for the address#[schema(value_type = Option<String>, max_length = 255, example = "John")]+ #[smithy(value_type = "Option<String>")]pub first_name: Option<Secret<String>>,/// The last name for the address#[schema(value_type = Option<String>, max_length = 255, example = "Doe")]+ #[smithy(value_type = "Option<String>")]pub last_name: Option<Secret<String>>,/// The zip/postal code of the origin#[schema(value_type = Option<String>, max_length = 50, example = "08807")]+ #[smithy(value_type = "Option<String>")]pub origin_zip: Option<Secret<String>>,}@@ -4961,36 +5868,66 @@ pub struct EncryptableAddressDetails {pub email: crypto::OptionalEncryptableEmail,}-#[derive(Debug, Clone, Default, Eq, PartialEq, ToSchema, serde::Deserialize, serde::Serialize)]+#[derive(+ Debug,+ Clone,+ Default,+ Eq,+ PartialEq,+ ToSchema,+ serde::Deserialize,+ serde::Serialize,+ SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct PhoneDetails {/// The contact number#[schema(value_type = Option<String>, example = "9123456789")]+ #[smithy(value_type = "Option<String>")]pub number: Option<Secret<String>>,/// The country code attached to the number#[schema(example = "+1")]+ #[smithy(value_type = "Option<String>")]pub country_code: Option<String>,}#[cfg(feature = "v1")]-#[derive(Debug, Clone, Default, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Debug,+ Clone,+ Default,+ Eq,+ PartialEq,+ serde::Deserialize,+ serde::Serialize,+ ToSchema,+ SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct PaymentsCaptureRequest {/// The unique identifier for the payment being captured. This is taken from the path parameter.#[serde(skip_deserializing)]pub payment_id: id_type::PaymentId,/// The unique identifier for the merchant. This is usually inferred from the API key.#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]pub merchant_id: Option<id_type::MerchantId>,/// The amount to capture, in the lowest denomination of the currency. If omitted, the entire `amount_capturable` of the payment will be captured. Must be less than or equal to the current `amount_capturable`.#[schema(value_type = Option<i64>, example = 6540)]+ #[smithy(value_type = "Option<i64>")]pub amount_to_capture: Option<MinorUnit>,/// Decider to refund the uncaptured amount. (Currently not fully supported or behavior may vary by connector).+ #[smithy(value_type = "Option<bool>")]pub refund_uncaptured_amount: Option<bool>,/// A dynamic suffix that appears on your customer's credit card statement. This is concatenated with the (shortened) descriptor prefix set on your account to form the complete statement descriptor. The combined length should not exceed connector-specific limits (typically 22 characters).+ #[smithy(value_type = "Option<String>")]pub statement_descriptor_suffix: Option<String>,/// An optional prefix for the statement descriptor that appears on your customer's credit card statement. This can override the default prefix set on your merchant account. The combined length of prefix and suffix should not exceed connector-specific limits (typically 22 characters).+ #[smithy(value_type = "Option<String>")]pub statement_descriptor_prefix: Option<String>,/// Merchant connector details used to make payments. (Deprecated)#[schema(value_type = Option<MerchantConnectorDetailsWrap>, deprecated)]+ #[smithy(value_type = "Option<MerchantConnectorDetailsWrap>")]pub merchant_connector_details: Option<admin::MerchantConnectorDetailsWrap>,}@@ -5091,17 +6028,23 @@ pub enum NextActionType {RedirectInsidePopup,}-#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]#[serde(tag = "type", rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum NextActionData {/// Contains the url for redirection flow#[cfg(feature = "v1")]RedirectToUrl {+ #[smithy(value_type = "String")]redirect_to_url: String,},#[cfg(feature = "v1")]RedirectInsidePopup {+ #[smithy(value_type = "String")]popup_url: String,+ #[smithy(value_type = "String")]redirect_response_url: String,},/// Contains the url for redirection flow@@ -5112,27 +6055,35 @@ pub enum NextActionData {},/// Informs the next steps for bank transfer and also contains the charges details (ex: amount received, amount charged etc)DisplayBankTransferInformation {+ #[smithy(value_type = "BankTransferNextStepsData")]bank_transfer_steps_and_charges_details: BankTransferNextStepsData,},/// Contains third party sdk session token responseThirdPartySdkSessionToken {+ #[smithy(value_type = "Option<Object>")]session_token: Option<SessionToken>,},/// Contains url for Qr code image, this qr code has to be shown in sdkQrCodeInformation {#[schema(value_type = String)]+ #[smithy(value_type = "String")]/// Hyperswitch generated image data source urlimage_data_url: Option<Url>,+ #[smithy(value_type = "Option<i64>")]display_to_timestamp: Option<i64>,#[schema(value_type = String)]+ #[smithy(value_type = "String")]/// The url for Qr code given by the connectorqr_code_url: Option<Url>,+ #[smithy(value_type = "Option<String>")]display_text: Option<String>,+ #[smithy(value_type = "Option<String>")]border_color: Option<String>,},/// Contains url to fetch Qr code dataFetchQrCodeInformation {#[schema(value_type = String)]+ #[smithy(value_type = "String")]qr_code_fetch_url: Url,},/// Contains the SDK UPI intent URI for payment processing@@ -5143,83 +6094,120 @@ pub enum NextActionData {/// Contains the download url and the reference number for transactionDisplayVoucherInformation {#[schema(value_type = String)]+ #[smithy(value_type = "VoucherNextStepData")]voucher_details: VoucherNextStepData,},/// Contains duration for displaying a wait screen, wait screen with timer is displayed by sdkWaitScreenInformation {+ #[smithy(value_type = "i128")]display_from_timestamp: i128,+ #[smithy(value_type = "Option<i128>")]display_to_timestamp: Option<i128>,+ #[smithy(value_type = "Option<PollConfig>")]poll_config: Option<PollConfig>,},/// Contains the information regarding three_ds_method_data submission, three_ds authentication, and authorization flowsThreeDsInvoke {+ #[smithy(value_type = "ThreeDsData")]three_ds_data: ThreeDsData,},InvokeSdkClient {+ #[smithy(value_type = "SdkNextActionData")]next_action_data: SdkNextActionData,},/// Contains consent to collect otp for mobile paymentCollectOtp {+ #[smithy(value_type = "MobilePaymentConsent")]consent_data_required: MobilePaymentConsent,},/// Contains data required to invoke hidden iframeInvokeHiddenIframe {+ #[smithy(value_type = "IframeData")]iframe_data: IframeData,},}-#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]#[serde(tag = "method_key")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum IframeData {#[serde(rename = "threeDSMethodData")]+ #[smithy(nested_value_type)]ThreedsInvokeAndCompleteAutorize {/// ThreeDS method url+ #[smithy(value_type = "String")]three_ds_method_url: String,/// Whether ThreeDS method data submission is required+ #[smithy(value_type = "bool")]three_ds_method_data_submission: bool,/// ThreeDS method data+ #[smithy(value_type = "Option<String>")]three_ds_method_data: Option<String>,/// ThreeDS Server ID+ #[smithy(value_type = "String")]directory_server_id: String,/// ThreeDS Protocol version+ #[smithy(value_type = "Option<String>")]message_version: Option<String>,},}-#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct ThreeDsData {/// ThreeDS authentication url - to initiate authentication+ #[smithy(value_type = "String")]pub three_ds_authentication_url: String,/// ThreeDS authorize url - to complete the payment authorization after authentication+ #[smithy(value_type = "String")]pub three_ds_authorize_url: String,/// ThreeDS method details+ #[smithy(value_type = "ThreeDsMethodData")]pub three_ds_method_details: ThreeDsMethodData,/// Poll config for a connector+ #[smithy(value_type = "PollConfigResponse")]pub poll_config: PollConfigResponse,/// Message Version+ #[smithy(value_type = "Option<String>")]pub message_version: Option<String>,/// Directory Server ID+ #[smithy(value_type = "Option<String>")]pub directory_server_id: Option<String>,}-#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]#[serde(untagged)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum ThreeDsMethodData {AcsThreeDsMethodData {/// Whether ThreeDS method data submission is required+ #[smithy(value_type = "bool")]three_ds_method_data_submission: bool,/// ThreeDS method data+ #[smithy(value_type = "Option<String>")]three_ds_method_data: Option<String>,/// ThreeDS method url+ #[smithy(value_type = "Option<String>")]three_ds_method_url: Option<String>,/// Three DS Method Key+ #[smithy(value_type = "Option<ThreeDsMethodKey>")]three_ds_method_key: Option<ThreeDsMethodKey>,/// Indicates whethere to wait for Post message after 3DS method data submission+ #[smithy(value_type = "bool")]consume_post_message_for_three_ds_method_completion: bool,},}-#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum ThreeDsMethodKey {#[serde(rename = "threeDSMethodData")]ThreeDsMethodData,@@ -5227,13 +6215,19 @@ pub enum ThreeDsMethodKey {JWT,}-#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct PollConfigResponse {/// Poll Id+ #[smithy(value_type = "String")]pub poll_id: String,/// Interval of the poll+ #[smithy(value_type = "i8")]pub delay_in_secs: i8,/// Frequency of the poll+ #[smithy(value_type = "i8")]pub frequency: i8,}@@ -5263,15 +6257,24 @@ pub enum QrCodeInformation {},}-#[derive(Clone, Debug, serde::Serialize, serde::Deserialize, Eq, PartialEq, ToSchema)]+#[derive(+ Clone, Debug, serde::Serialize, serde::Deserialize, Eq, PartialEq, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct SdkNextActionData {+ #[smithy(value_type = "NextActionCall")]pub next_action: NextActionCall,+ #[smithy(value_type = "Option<String>")]pub order_id: Option<String>,}-#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct FetchQrCodeInformation {+ #[smithy(value_type = "String")]pub qr_code_fetch_url: Url,}@@ -5280,28 +6283,42 @@ pub struct SdkUpiIntentInformation {pub sdk_uri: Url,}-#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct BankTransferNextStepsData {/// The instructions for performing a bank transfer#[serde(flatten)]+ #[smithy(value_type = "BankTransferInstructions")]pub bank_transfer_instructions: BankTransferInstructions,/// The details received by the receiver+ #[smithy(value_type = "Option<ReceiverDetails>")]pub receiver: Option<ReceiverDetails>,}-#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct VoucherNextStepData {/// Voucher entry date+ #[smithy(value_type = "Option<String>")]pub entry_date: Option<String>,/// Voucher expiry date and time+ #[smithy(value_type = "Option<i64>")]pub expires_at: Option<i64>,/// Reference number required for the transaction+ #[smithy(value_type = "String")]pub reference: String,/// Url to download the payment instruction+ #[smithy(value_type = "Option<String>")]pub download_url: Option<Url>,/// Url to payment instruction page+ #[smithy(value_type = "Option<String>")]pub instructions_url: Option<Url>,/// Human-readable numeric version of the barcode.+ #[smithy(value_type = "Option<String>")]pub digitable_line: Option<Secret<String>>,}@@ -5311,8 +6328,11 @@ pub struct MobilePaymentNextStepData {pub consent_data_required: MobilePaymentConsent,}-#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum MobilePaymentConsent {ConsentRequired,ConsentNotRequired,@@ -5333,39 +6353,60 @@ pub struct WaitScreenInstructions {pub poll_config: Option<PollConfig>,}-#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct PollConfig {/// Interval of the poll+ #[smithy(value_type = "u16")]pub delay_in_secs: u16,/// Frequency of the poll+ #[smithy(value_type = "u16")]pub frequency: u16,}-#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum BankTransferInstructions {/// The instructions for Doku bank transactions+ #[smithy(value_type = "DokuBankTransferInstructions")]DokuBankTransferInstructions(Box<DokuBankTransferInstructions>),/// The credit transfer for ACH transactions+ #[smithy(value_type = "AchTransfer")]AchCreditTransfer(Box<AchTransfer>),/// The instructions for SEPA bank transactions+ #[smithy(value_type = "SepaBankTransferInstructions")]SepaBankInstructions(Box<SepaBankTransferInstructions>),/// The instructions for BACS bank transactions+ #[smithy(value_type = "BacsBankTransferInstructions")]BacsBankInstructions(Box<BacsBankTransferInstructions>),/// The instructions for Multibanco bank transactions+ #[smithy(value_type = "MultibancoTransferInstructions")]Multibanco(Box<MultibancoTransferInstructions>),}-#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct SepaBankTransferInstructions {#[schema(value_type = String, example = "Jane Doe")]+ #[smithy(value_type = "String")]pub account_holder_name: Secret<String>,#[schema(value_type = String, example = "9123456789")]+ #[smithy(value_type = "String")]pub bic: Secret<String>,+ #[smithy(value_type = "String")]pub country: String,#[schema(value_type = String, example = "123456789")]+ #[smithy(value_type = "String")]pub iban: Secret<String>,#[schema(value_type = String, example = "U2PVVSEV4V9Y")]+ #[smithy(value_type = "String")]pub reference: Secret<String>,}@@ -5378,58 +6419,97 @@ pub struct PaymentsConnectorThreeDsInvokeData {pub three_ds_method_data_submission: bool,}-#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct BacsBankTransferInstructions {#[schema(value_type = String, example = "Jane Doe")]+ #[smithy(value_type = "String")]pub account_holder_name: Secret<String>,#[schema(value_type = String, example = "10244123908")]+ #[smithy(value_type = "String")]pub account_number: Secret<String>,#[schema(value_type = String, example = "012")]+ #[smithy(value_type = "String")]pub sort_code: Secret<String>,}-#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct MultibancoTransferInstructions {#[schema(value_type = String, example = "122385736258")]+ #[smithy(value_type = "String")]pub reference: Secret<String>,#[schema(value_type = String, example = "12345")]+ #[smithy(value_type = "String")]pub entity: String,}-#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct DokuBankTransferInstructions {#[schema(value_type = String, example = "1707091200000")]+ #[smithy(value_type = "String")]pub expires_at: Option<i64>,#[schema(value_type = String, example = "122385736258")]+ #[smithy(value_type = "String")]pub reference: Secret<String>,#[schema(value_type = String)]+ #[smithy(value_type = "String")]pub instructions_url: Option<Url>,}-#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct AchTransfer {#[schema(value_type = String, example = "122385736258")]+ #[smithy(value_type = "String")]pub account_number: Secret<String>,+ #[smithy(value_type = "String")]pub bank_name: String,#[schema(value_type = String, example = "012")]+ #[smithy(value_type = "String")]pub routing_number: Secret<String>,#[schema(value_type = String, example = "234")]+ #[smithy(value_type = "String")]pub swift_code: Secret<String>,}-#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct ReceiverDetails {/// The amount received by receiver+ #[smithy(value_type = "i64")]amount_received: i64,/// The amount charged by ACH+ #[smithy(value_type = "Option<i64>")]amount_charged: Option<i64>,/// The amount remaining to be sent via ACH+ #[smithy(value_type = "Option<i64>")]amount_remaining: Option<i64>,}#[cfg(feature = "v1")]-#[derive(Clone, Debug, PartialEq, serde::Serialize, ToSchema, router_derive::PolymorphicSchema)]+#[derive(+ Clone,+ Debug,+ PartialEq,+ serde::Serialize,+ ToSchema,+ router_derive::PolymorphicSchema,+ SmithyModel,+)]#[generate_schemas(PaymentsCreateResponseOpenApi)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct PaymentsResponse {/// Unique identifier for the payment. This ensures idempotency for multiple payments/// that have been done by a single merchant.@@ -5439,52 +6519,64 @@ pub struct PaymentsResponse {example = "pay_mbabizu24mvu3mela5njyhpit4",value_type = String,)]+ #[smithy(value_type = "String")]pub payment_id: id_type::PaymentId,/// This is an identifier for the merchant account. This is inferred from the API key/// provided during the request#[schema(max_length = 255, example = "merchant_1668273825", value_type = String)]+ #[smithy(value_type = "String")]pub merchant_id: id_type::MerchantId,#[schema(value_type = IntentStatus, example = "failed", default = "requires_confirmation")]+ #[smithy(value_type = "IntentStatus")]pub status: api_enums::IntentStatus,/// The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,#[schema(value_type = i64, example = 6540)]+ #[smithy(value_type = "i64")]pub amount: MinorUnit,/// The payment net amount. net_amount = amount + surcharge_details.surcharge_amount + surcharge_details.tax_amount + shipping_cost + order_tax_amount,/// If no surcharge_details, shipping_cost, order_tax_amount, net_amount = amount#[schema(value_type = i64, example = 6540)]+ #[smithy(value_type = "i64")]pub net_amount: MinorUnit,/// The shipping cost for the payment.#[schema(value_type = Option<i64>, example = 6540)]+ #[smithy(value_type = "Option<i64>")]pub shipping_cost: Option<MinorUnit>,/// The amount (in minor units) that can still be captured for this payment. This is relevant when `capture_method` is `manual`. Once fully captured, or if `capture_method` is `automatic` and payment succeeded, this will be 0.#[schema(value_type = i64, minimum = 100, example = 6540)]+ #[smithy(value_type = "i64")]pub amount_capturable: MinorUnit,/// The total amount (in minor units) that has been captured for this payment. For `fauxpay` sandbox connector, this might reflect the authorized amount if `status` is `succeeded` even if `capture_method` was `manual`.#[schema(value_type = Option<i64>, example = 6540)]+ #[smithy(value_type = "Option<i64>")]pub amount_received: Option<MinorUnit>,/// The name of the payment connector (e.g., 'stripe', 'adyen') that processed or is processing this payment.#[schema(example = "stripe")]+ #[smithy(value_type = "Option<String>")]pub connector: Option<String>,/// A secret token unique to this payment intent. It is primarily used by client-side applications (e.g., Hyperswitch SDKs) to authenticate actions like confirming the payment or handling next actions. This secret should be handled carefully and not exposed publicly beyond its intended client-side use.#[schema(value_type = Option<String>, example = "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo")]+ #[smithy(value_type = "Option<String>")]pub client_secret: Option<Secret<String>>,/// Timestamp indicating when this payment intent was created, in ISO 8601 format.#[schema(example = "2022-09-10T10:11:12Z")]#[serde(with = "common_utils::custom_serde::iso8601::option")]+ #[smithy(value_type = "Option<String>")]pub created: Option<PrimitiveDateTime>,/// Three-letter ISO currency code (e.g., USD, EUR) for the payment amount.#[schema(value_type = Currency, example = "USD")]+ #[smithy(value_type = "Currency")]pub currency: String,/// The identifier for the customer object. If not provided the customer ID will be autogenerated.@@ -5496,45 +6588,56 @@ pub struct PaymentsResponse {deprecated,value_type = Option<String>,)]+ #[smithy(value_type = "Option<String>")]pub customer_id: Option<id_type::CustomerId>,+ #[smithy(value_type = "Option<CustomerDetailsResponse>")]pub customer: Option<CustomerDetailsResponse>,/// An arbitrary string providing a description for the payment, often useful for display or internal record-keeping.#[schema(example = "It's my first payment request")]+ #[smithy(value_type = "Option<String>")]pub description: Option<String>,/// An array of refund objects associated with this payment. Empty or null if no refunds have been processed.#[schema(value_type = Option<Vec<RefundResponse>>)]+ #[smithy(value_type = "Option<Vec<RefundResponse>>")]pub refunds: Option<Vec<refunds::RefundResponse>>,/// List of disputes that happened on this intent#[schema(value_type = Option<Vec<DisputeResponsePaymentsRetrieve>>)]+ #[smithy(value_type = "Option<Vec<DisputeResponsePaymentsRetrieve>>")]pub disputes: Option<Vec<disputes::DisputeResponsePaymentsRetrieve>>,/// List of attempts that happened on this intent#[schema(value_type = Option<Vec<PaymentAttemptResponse>>)]#[serde(skip_serializing_if = "Option::is_none")]+ #[smithy(value_type = "Option<Vec<PaymentAttemptResponse>>")]pub attempts: Option<Vec<PaymentAttemptResponse>>,/// List of captures done on latest attempt#[schema(value_type = Option<Vec<CaptureResponse>>)]#[serde(skip_serializing_if = "Option::is_none")]+ #[smithy(value_type = "Option<Vec<CaptureResponse>>")]pub captures: Option<Vec<CaptureResponse>>,/// A unique identifier to link the payment to a mandate, can be used instead of payment_method_data, in case of setting up recurring payments#[schema(max_length = 255, example = "mandate_iwer89rnjef349dni3")]+ #[smithy(value_type = "Option<String>")]pub mandate_id: Option<String>,/// Provided mandate information for creating a mandate+ #[smithy(value_type = "Option<MandateData>")]pub mandate_data: Option<MandateData>,/// Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.#[schema(value_type = Option<FutureUsage>, example = "off_session")]+ #[smithy(value_type = "Option<FutureUsage>")]pub setup_future_usage: Option<api_enums::FutureUsage>,/// Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.#[schema(example = true)]+ #[smithy(value_type = "Option<bool>")]pub off_session: Option<bool>,/// A timestamp (ISO 8601 code) that determines when the payment should be captured.@@ -5542,29 +6645,36 @@ pub struct PaymentsResponse {#[schema(example = "2022-09-10T10:11:12Z")]#[serde(with = "common_utils::custom_serde::iso8601::option")]#[remove_in(PaymentsCreateResponseOpenApi)]+ #[smithy(value_type = "Option<String>")]pub capture_on: Option<PrimitiveDateTime>,/// This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method.#[schema(value_type = Option<CaptureMethod>, example = "automatic")]+ #[smithy(value_type = "Option<CaptureMethod>")]pub capture_method: Option<api_enums::CaptureMethod>,/// The payment method that is to be used#[schema(value_type = PaymentMethod, example = "bank_transfer")]+ #[smithy(value_type = "Option<PaymentMethod>")]pub payment_method: Option<api_enums::PaymentMethod>,/// The payment method information provided for making a payment#[schema(value_type = Option<PaymentMethodDataResponseWithBilling>, example = "bank_transfer")]#[serde(serialize_with = "serialize_payment_method_data_response")]+ #[smithy(value_type = "Option<PaymentMethodDataResponseWithBilling>")]pub payment_method_data: Option<PaymentMethodDataResponseWithBilling>,/// Provide a reference to a stored payment method#[schema(example = "187282ab-40ef-47a9-9206-5099ba31e432")]+ #[smithy(value_type = "Option<String>")]pub payment_token: Option<String>,/// The shipping address for the payment+ #[smithy(value_type = "Option<Address>")]pub shipping: Option<Address>,/// The billing address for the payment+ #[smithy(value_type = "Option<Address>")]pub billing: Option<Address>,/// Information about the product , quantity and amount for connectors. (e.g. Klarna)@@ -5573,192 +6683,242 @@ pub struct PaymentsResponse {"quantity": 15,"amount" : 900}]"#)]+ #[smithy(value_type = "Option<Vec<OrderDetailsWithAmount>>")]pub order_details: Option<Vec<pii::SecretSerdeValue>>,/// description: The customer's email address/// This field will be deprecated soon. Please refer to `customer.email` object#[schema(max_length = 255, value_type = Option<String>, example = "[email protected]", deprecated)]+ #[smithy(value_type = "Option<String>")]pub email: crypto::OptionalEncryptableEmail,/// description: The customer's name/// This field will be deprecated soon. Please refer to `customer.name` object#[schema(value_type = Option<String>, max_length = 255, example = "John Test", deprecated)]+ #[smithy(value_type = "Option<String>")]pub name: crypto::OptionalEncryptableName,/// The customer's phone number/// This field will be deprecated soon. Please refer to `customer.phone` object#[schema(value_type = Option<String>, max_length = 255, example = "9123456789", deprecated)]+ #[smithy(value_type = "Option<String>")]pub phone: crypto::OptionalEncryptablePhone,/// The URL to redirect after the completion of the operation#[schema(example = "https://hyperswitch.io")]+ #[smithy(value_type = "Option<String>")]pub return_url: Option<String>,/// The transaction authentication can be set to undergo payer authentication. By default, the authentication will be marked as NO_THREE_DS, as the 3DS method helps with more robust payer authentication#[schema(value_type = Option<AuthenticationType>, example = "no_three_ds", default = "three_ds")]+ #[smithy(value_type = "Option<AuthenticationType>")]pub authentication_type: Option<api_enums::AuthenticationType>,/// For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.#[schema(max_length = 255, example = "Hyperswitch Router")]+ #[smithy(value_type = "Option<String>")]pub statement_descriptor_name: Option<String>,/// Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 255 characters for the concatenated descriptor.#[schema(max_length = 255, example = "Payment for shoes purchase")]+ #[smithy(value_type = "Option<String>")]pub statement_descriptor_suffix: Option<String>,/// If the payment requires further action from the customer (e.g., 3DS authentication, redirect to a bank page), this object will contain the necessary information for the client to proceed. Null if no further action is needed from the customer at this stage.+ #[smithy(value_type = "Option<NextActionData>")]pub next_action: Option<NextActionData>,/// If the payment intent was cancelled, this field provides a textual reason for the cancellation (e.g., "requested_by_customer", "abandoned").+ #[smithy(value_type = "Option<String>")]pub cancellation_reason: Option<String>,/// The connector-specific error code from the last failed payment attempt associated with this payment intent.#[schema(example = "E0001")]+ #[smithy(value_type = "Option<String>")]pub error_code: Option<String>,/// A human-readable error message from the last failed payment attempt associated with this payment intent.#[schema(example = "Failed while verifying the card")]+ #[smithy(value_type = "Option<String>")]pub error_message: Option<String>,/// error code unified across the connectors is received here if there was an error while calling connector#[remove_in(PaymentsCreateResponseOpenApi)]+ #[smithy(value_type = "Option<String>")]pub unified_code: Option<String>,/// error message unified across the connectors is received here if there was an error while calling connector#[remove_in(PaymentsCreateResponseOpenApi)]+ #[smithy(value_type = "Option<String>")]pub unified_message: Option<String>,/// Describes the type of payment flow experienced by the customer (e.g., 'redirect_to_url', 'invoke_sdk', 'display_qr_code').#[schema(value_type = Option<PaymentExperience>, example = "redirect_to_url")]+ #[smithy(value_type = "Option<PaymentExperience>")]pub payment_experience: Option<api_enums::PaymentExperience>,/// The specific payment method subtype used for this payment (e.g., 'credit_card', 'klarna', 'gpay'). This provides more granularity than the 'payment_method' field.#[schema(value_type = Option<PaymentMethodType>, example = "gpay")]+ #[smithy(value_type = "Option<PaymentMethodType>")]pub payment_method_type: Option<api_enums::PaymentMethodType>,/// A label identifying the specific merchant connector account (MCA) used for this payment. This often combines the connector name, business country, and a custom label (e.g., "stripe_US_primary").#[schema(example = "stripe_US_food")]+ #[smithy(value_type = "Option<String>")]pub connector_label: Option<String>,/// The two-letter ISO country code (e.g., US, GB) of the business unit or profile under which this payment was processed.#[schema(value_type = Option<CountryAlpha2>, example = "US")]+ #[smithy(value_type = "Option<CountryAlpha2>")]pub business_country: Option<api_enums::CountryAlpha2>,/// The label identifying the specific business unit or profile under which this payment was processed by the merchant.+ #[smithy(value_type = "Option<String>")]pub business_label: Option<String>,/// An optional sub-label for further categorization of the business unit or profile used for this payment.+ #[smithy(value_type = "Option<String>")]pub business_sub_label: Option<String>,/// Allowed Payment Method Types for a given PaymentIntent#[schema(value_type = Option<Vec<PaymentMethodType>>)]+ #[smithy(value_type = "Option<Vec<PaymentMethodType>>")]pub allowed_payment_method_types: Option<serde_json::Value>,/// ephemeral_key for the customer_id mentioned+ #[smithy(value_type = "Option<EphemeralKeyCreateResponse>")]pub ephemeral_key: Option<EphemeralKeyCreateResponse>,/// If true the payment can be retried with same or different payment method which means the confirm call can be made again.+ #[smithy(value_type = "Option<bool>")]pub manual_retry_allowed: Option<bool>,/// A unique identifier for a payment provided by the connector#[schema(value_type = Option<String>, example = "993672945374576J")]+ #[smithy(value_type = "Option<String>")]pub connector_transaction_id: Option<String>,/// Frm message contains information about the frm response+ #[smithy(value_type = "Option<FrmMessage>")]pub frm_message: Option<FrmMessage>,/// You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.#[schema(value_type = Option<Object>, example = r#"{ "udf1": "some-value", "udf2": "some-value" }"#)]+ #[smithy(value_type = "Option<Object>")]pub metadata: Option<serde_json::Value>,/// Additional data related to some connectors#[schema(value_type = Option<ConnectorMetadata>)]+ #[smithy(value_type = "Option<ConnectorMetadata>")]pub connector_metadata: Option<serde_json::Value>, // This is Value because it is fetched from DB and before putting in DB the type is validated/// Additional data that might be required by hyperswitch, to enable some specific features.#[schema(value_type = Option<FeatureMetadata>)]+ #[smithy(value_type = "Option<FeatureMetadata>")]pub feature_metadata: Option<serde_json::Value>, // This is Value because it is fetched from DB and before putting in DB the type is validated/// reference(Identifier) to the payment at connector side#[schema(value_type = Option<String>, example = "993672945374576J")]+ #[smithy(value_type = "Option<String>")]pub reference_id: Option<String>,/// Details for Payment linkpub payment_link: Option<PaymentLinkResponse>,/// The business profile that is associated with this payment#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]pub profile_id: Option<id_type::ProfileId>,/// Details of surcharge applied on this payment+ #[smithy(value_type = "Option<RequestSurchargeDetails>")]pub surcharge_details: Option<RequestSurchargeDetails>,/// Total number of attempts associated with this payment+ #[smithy(value_type = "i16")]pub attempt_count: i16,/// Denotes the action(approve or reject) taken by merchant in case of manual review. Manual review can occur when the transaction is marked as risky by the frm_processor, payment processor or when there is underpayment/over payment incase of crypto payment+ #[smithy(value_type = "Option<String>")]pub merchant_decision: Option<String>,/// Identifier of the connector ( merchant connector account ) which was chosen to make the payment#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]pub merchant_connector_id: Option<id_type::MerchantConnectorAccountId>,/// If true, incremental authorization can be performed on this payment, in case the funds authorized initially fall short.+ #[smithy(value_type = "Option<bool>")]pub incremental_authorization_allowed: Option<bool>,/// Total number of authorizations happened in an incremental_authorization payment+ #[smithy(value_type = "Option<i32>")]pub authorization_count: Option<i32>,/// List of incremental authorizations happened to the payment+ #[smithy(value_type = "Option<Vec<IncrementalAuthorizationResponse>>")]pub incremental_authorizations: Option<Vec<IncrementalAuthorizationResponse>>,/// Details of external authentication+ #[smithy(value_type = "Option<ExternalAuthenticationDetailsResponse>")]pub external_authentication_details: Option<ExternalAuthenticationDetailsResponse>,/// Flag indicating if external 3ds authentication is made or not+ #[smithy(value_type = "Option<bool>")]pub external_3ds_authentication_attempted: Option<bool>,/// Date Time for expiry of the payment#[schema(example = "2022-09-10T10:11:12Z")]#[serde(default, with = "common_utils::custom_serde::iso8601::option")]+ #[smithy(value_type = "Option<String>")]pub expires_on: Option<PrimitiveDateTime>,/// Payment Fingerprint, to identify a particular card./// It is a 20 character long alphanumeric code.+ #[smithy(value_type = "Option<String>")]pub fingerprint: Option<String>,#[schema(value_type = Option<BrowserInformation>)]/// The browser information used for this payment+ #[smithy(value_type = "Option<BrowserInformation>")]pub browser_info: Option<serde_json::Value>,/// Indicates how the payment was initiated (e.g., ecommerce, mail, or telephone).#[schema(value_type = Option<PaymentChannel>)]+ #[smithy(value_type = "Option<PaymentChannel>")]pub payment_channel: Option<common_enums::PaymentChannel>,/// A unique identifier for the payment method used in this payment. If the payment method was saved or tokenized, this ID can be used to reference it for future transactions or recurring payments.+ #[smithy(value_type = "Option<String>")]pub payment_method_id: Option<String>,/// The network transaction ID is a unique identifier for the transaction as recognized by the payment network (e.g., Visa, Mastercard), this ID can be used to reference it for future transactions or recurring payments.+ #[smithy(value_type = "Option<String>")]pub network_transaction_id: Option<String>,/// Payment Method Status, refers to the status of the payment method used for this payment.#[schema(value_type = Option<PaymentMethodStatus>)]+ #[smithy(value_type = "Option<PaymentMethodStatus>")]pub payment_method_status: Option<common_enums::PaymentMethodStatus>,/// Date time at which payment was updated#[schema(example = "2022-09-10T10:11:12Z")]#[serde(default, with = "common_utils::custom_serde::iso8601::option")]+ #[smithy(value_type = "Option<String>")]pub updated: Option<PrimitiveDateTime>,/// Fee information to be charged on the payment being collected#[schema(value_type = Option<ConnectorChargeResponseData>)]+ #[smithy(value_type = "Option<ConnectorChargeResponseData>")]pub split_payments: Option<common_types::payments::ConnectorChargeResponseData>,/// You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. FRM Metadata is useful for storing additional, structured information on an object related to FRM.#[schema(value_type = Option<Object>, example = r#"{ "fulfillment_method" : "deliver", "coverage_request" : "fraud" }"#)]+ #[smithy(value_type = "Option<Object>")]pub frm_metadata: Option<pii::SecretSerdeValue>,/// flag that indicates if extended authorization is applied on this payment or not#[schema(value_type = Option<bool>)]+ #[smithy(value_type = "Option<bool>")]pub extended_authorization_applied: Option<ExtendedAuthorizationAppliedBool>,/// date and time at which extended authorization was last applied on this payment@@ -5770,10 +6930,12 @@ pub struct PaymentsResponse {////// capture method must be manual or manual_multiple#[schema(value_type = Option<bool>, default = false)]+ #[smithy(value_type = "Option<bool>")]pub request_extended_authorization: Option<RequestExtendedAuthorizationBool>,/// date and time after which this payment cannot be captured#[serde(default, with = "common_utils::custom_serde::iso8601::option")]+ #[smithy(value_type = "Option<String>")]pub capture_before: Option<PrimitiveDateTime>,/// Merchant's identifier for the payment/invoice. This will be sent to the connector@@ -5784,58 +6946,74 @@ pub struct PaymentsResponse {max_length = 255,example = "Custom_Order_id_123")]+ #[smithy(value_type = "Option<String>")]pub merchant_order_reference_id: Option<String>,/// order tax amount calculated by tax connectors+ #[smithy(value_type = "Option<i64>")]pub order_tax_amount: Option<MinorUnit>,/// Connector Identifier for the payment method+ #[smithy(value_type = "Option<String>")]pub connector_mandate_id: Option<String>,/// Method through which card was discovered#[schema(value_type = Option<CardDiscovery>, example = "manual")]+ #[smithy(value_type = "Option<CardDiscovery>")]pub card_discovery: Option<enums::CardDiscovery>,/// Indicates if 3ds challenge is forced+ #[smithy(value_type = "Option<bool>")]pub force_3ds_challenge: Option<bool>,/// Indicates if 3ds challenge is triggered+ #[smithy(value_type = "Option<bool>")]pub force_3ds_challenge_trigger: Option<bool>,/// Error code received from the issuer in case of failed payments+ #[smithy(value_type = "Option<String>")]pub issuer_error_code: Option<String>,/// Error message received from the issuer in case of failed payments+ #[smithy(value_type = "Option<String>")]pub issuer_error_message: Option<String>,/// Indicates if the redirection has to open in the iframe+ #[smithy(value_type = "Option<bool>")]pub is_iframe_redirection_enabled: Option<bool>,/// Contains whole connector response#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]pub whole_connector_response: Option<Secret<String>>,/// Allow partial authorization for this payment#[schema(value_type = Option<bool>, default = false)]+ #[smithy(value_type = "Option<bool>")]pub enable_partial_authorization: Option<primitive_wrappers::EnablePartialAuthorizationBool>,/// Bool indicating if overcapture must be requested for this payment#[schema(value_type = Option<bool>)]+ #[smithy(value_type = "Option<bool>")]pub enable_overcapture: Option<primitive_wrappers::EnableOvercaptureBool>,/// Boolean indicating whether overcapture is effectively enabled for this payment#[schema(value_type = Option<bool>)]+ #[smithy(value_type = "Option<bool>")]pub is_overcapture_enabled: Option<primitive_wrappers::OvercaptureEnabledBool>,/// Contains card network response details (e.g., Visa/Mastercard advice codes).#[schema(value_type = Option<NetworkDetails>)]+ #[smithy(value_type = "Option<NetworkDetails>")]pub network_details: Option<NetworkDetails>,/// Boolean flag indicating whether this payment method is stored and has been previously used for payments#[schema(value_type = Option<bool>, example = true)]+ #[smithy(value_type = "Option<bool>")]pub is_stored_credential: Option<bool>,/// The category of the MIT transaction#[schema(value_type = Option<MitCategory>, example = "recurring")]+ #[smithy(value_type = "Option<MitCategory>")]pub mit_category: Option<api_enums::MitCategory>,/// Billing descriptor information for the payment@@ -6603,23 +7781,31 @@ pub struct PaymentStartRedirectionParams {}/// Details of external authentication-#[derive(Setter, Clone, Default, Debug, PartialEq, serde::Serialize, ToSchema)]+#[derive(Setter, Clone, Default, Debug, PartialEq, serde::Serialize, ToSchema, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct ExternalAuthenticationDetailsResponse {/// Authentication Type - Challenge / Frictionless#[schema(value_type = Option<DecoupledAuthenticationType>)]+ #[smithy(value_type = "Option<DecoupledAuthenticationType>")]pub authentication_flow: Option<enums::DecoupledAuthenticationType>,/// Electronic Commerce Indicator (eci)+ #[smithy(value_type = "Option<String>")]pub electronic_commerce_indicator: Option<String>,/// Authentication Status#[schema(value_type = AuthenticationStatus)]+ #[smithy(value_type = "AuthenticationStatus")]pub status: enums::AuthenticationStatus,/// DS Transaction ID+ #[smithy(value_type = "Option<String>")]pub ds_transaction_id: Option<String>,/// Message Version+ #[smithy(value_type = "Option<String>")]pub version: Option<String>,/// Error Code+ #[smithy(value_type = "Option<String>")]pub error_code: Option<String>,/// Error Message+ #[smithy(value_type = "Option<String>")]pub error_message: Option<String>,}@@ -6840,21 +8026,28 @@ pub struct PaymentListResponse {/// The list of payments response objectspub data: Vec<PaymentsListResponseItem>,}-#[derive(Setter, Clone, Default, Debug, PartialEq, serde::Serialize, ToSchema)]+#[derive(Setter, Clone, Default, Debug, PartialEq, serde::Serialize, ToSchema, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct IncrementalAuthorizationResponse {/// The unique identifier of authorization+ #[smithy(value_type = "String")]pub authorization_id: String,/// Amount the authorization has been made for#[schema(value_type = i64, example = 6540)]+ #[smithy(value_type = "i64")]pub amount: MinorUnit,#[schema(value_type= AuthorizationStatus)]+ #[smithy(value_type = "AuthorizationStatus")]/// The status of the authorizationpub status: common_enums::AuthorizationStatus,/// Error code sent by the connector for authorization+ #[smithy(value_type = "Option<String>")]pub error_code: Option<String>,/// Error message sent by the connector for authorization+ #[smithy(value_type = "Option<String>")]pub error_message: Option<String>,/// Previously authorized amount for the payment+ #[smithy(value_type = "i64")]pub previously_authorized_amount: MinorUnit,}@@ -7153,7 +8346,7 @@ impl From<AdditionalPaymentData> for PaymentMethodDataResponse {} => match (apple_pay, google_pay, samsung_pay) {(Some(apple_pay_pm), _, _) => Self::Wallet(Box::new(WalletResponse {details: Some(WalletResponseData::ApplePay(Box::new(- additional_info::WalletAdditionalDataForCard {+ WalletAdditionalDataForCard {last4: apple_pay_pm.display_name.clone()@@ -7284,63 +8477,98 @@ pub struct PaymentsRetrieveRequest {pub all_keys_required: Option<bool>,}-#[derive(Debug, Default, PartialEq, serde::Deserialize, serde::Serialize, Clone, ToSchema)]+#[derive(+ Debug, Default, PartialEq, serde::Deserialize, serde::Serialize, Clone, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct OrderDetailsWithAmount {/// Name of the product that is being purchased#[schema(max_length = 255, example = "shirt")]+ #[smithy(value_type = "String")]pub product_name: String,/// The quantity of the product to be purchased#[schema(example = 1)]+ #[smithy(value_type = "u16")]pub quantity: u16,/// the amount per quantity of product#[schema(value_type = i64)]+ #[smithy(value_type = "i64")]pub amount: MinorUnit,/// tax rate applicable to the product+ #[smithy(value_type = "Option<f64>")]pub tax_rate: Option<f64>,/// total tax amount applicable to the product#[schema(value_type = Option<i64>)]+ #[smithy(value_type = "Option<i64>")]pub total_tax_amount: Option<MinorUnit>,// Does the order includes shipping+ #[smithy(value_type = "Option<bool>")]pub requires_shipping: Option<bool>,/// The image URL of the product+ #[smithy(value_type = "Option<String>")]pub product_img_link: Option<String>,/// ID of the product that is being purchased+ #[smithy(value_type = "Option<String>")]pub product_id: Option<String>,/// Category of the product that is being purchased+ #[smithy(value_type = "Option<String>")]pub category: Option<String>,/// Sub category of the product that is being purchased+ #[smithy(value_type = "Option<String>")]pub sub_category: Option<String>,/// Brand of the product that is being purchased+ #[smithy(value_type = "Option<String>")]pub brand: Option<String>,/// Type of the product that is being purchasedpub product_type: Option<ProductType>,/// The tax code for the product+ #[smithy(value_type = "Option<String>")]pub product_tax_code: Option<String>,/// Description for the item+ #[smithy(value_type = "Option<String>")]pub description: Option<String>,/// Stock Keeping Unit (SKU) or the item identifier for this item.+ #[smithy(value_type = "Option<String>")]pub sku: Option<String>,/// Universal Product Code for the item.+ #[smithy(value_type = "Option<String>")]pub upc: Option<String>,/// Code describing a commodity or a group of commodities pertaining to goods classification.+ #[smithy(value_type = "Option<String>")]pub commodity_code: Option<String>,/// Unit of measure used for the item quantity.+ #[smithy(value_type = "Option<String>")]pub unit_of_measure: Option<String>,/// Total amount for the item.#[schema(value_type = Option<i64>)]+ #[smithy(value_type = "Option<i64>")]pub total_amount: Option<MinorUnit>, // total_amount,/// Discount amount applied to this item.#[schema(value_type = Option<i64>)]+ #[smithy(value_type = "Option<i64>")]pub unit_discount_amount: Option<MinorUnit>,}impl masking::SerializableSecret for OrderDetailsWithAmount {}-#[derive(Default, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, Clone, ToSchema)]+#[derive(+ Default,+ Debug,+ Eq,+ PartialEq,+ serde::Deserialize,+ serde::Serialize,+ Clone,+ ToSchema,+ SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct RedirectResponse {#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]pub param: Option<Secret<String>>,#[schema(value_type = Option<Object>)]+ #[smithy(value_type = "Option<Object>")]pub json_payload: Option<pii::SecretSerdeValue>,}@@ -7460,102 +8688,150 @@ pub struct DisplayAmountOnSdk {pub shipping_cost: Option<StringMajorUnit>,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct GpayAllowedMethodsParameters {/// The list of allowed auth methods (ex: 3DS, No3DS, PAN_ONLY etc)+ #[smithy(value_type = "Vec<String>")]pub allowed_auth_methods: Vec<String>,/// The list of allowed card networks (ex: AMEX,JCB etc)+ #[smithy(value_type = "Vec<String>")]pub allowed_card_networks: Vec<String>,/// Is billing address required#[serde(skip_serializing_if = "Option::is_none")]+ #[smithy(value_type = "Option<bool>")]pub billing_address_required: Option<bool>,/// Billing address parameters#[serde(skip_serializing_if = "Option::is_none")]+ #[smithy(value_type = "Option<GpayBillingAddressParameters>")]pub billing_address_parameters: Option<GpayBillingAddressParameters>,/// Whether assurance details are required#[serde(skip_serializing_if = "Option::is_none")]+ #[smithy(value_type = "Option<bool>")]pub assurance_details_required: Option<bool>,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct GpayBillingAddressParameters {/// Is billing phone number required+ #[smithy(value_type = "bool")]pub phone_number_required: bool,/// Billing address format+ #[smithy(value_type = "GpayBillingAddressFormat")]pub format: GpayBillingAddressFormat,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum GpayBillingAddressFormat {FULL,MIN,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct GpayTokenParameters {/// The name of the connector#[serde(skip_serializing_if = "Option::is_none")]+ #[smithy(value_type = "Option<String>")]pub gateway: Option<String>,/// The merchant ID registered in the connector associated#[serde(skip_serializing_if = "Option::is_none")]+ #[smithy(value_type = "Option<String>")]pub gateway_merchant_id: Option<String>,#[serde(skip_serializing_if = "Option::is_none", rename = "stripe:version")]+ #[smithy(value_type = "Option<String>")]pub stripe_version: Option<String>,#[serde(skip_serializing_if = "Option::is_none",rename = "stripe:publishableKey")]+ #[smithy(value_type = "Option<String>")]pub stripe_publishable_key: Option<String>,/// The protocol version for encryption#[serde(skip_serializing_if = "Option::is_none")]+ #[smithy(value_type = "Option<String>")]pub protocol_version: Option<String>,/// The public key provided by the merchant#[serde(skip_serializing_if = "Option::is_none")]#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]pub public_key: Option<Secret<String>>,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct GpayTokenizationSpecification {/// The token specification type(ex: PAYMENT_GATEWAY)#[serde(rename = "type")]+ #[smithy(value_type = "String")]pub token_specification_type: String,/// The parameters for the token specification Google Pay+ #[smithy(value_type = "GpayTokenParameters")]pub parameters: GpayTokenParameters,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct GpayAllowedPaymentMethods {/// The type of payment method#[serde(rename = "type")]+ #[smithy(value_type = "String")]pub payment_method_type: String,/// The parameters Google Pay requires+ #[smithy(value_type = "GpayAllowedMethodsParameters")]pub parameters: GpayAllowedMethodsParameters,/// The tokenization specification for Google Pay+ #[smithy(value_type = "GpayTokenizationSpecification")]pub tokenization_specification: GpayTokenizationSpecification,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct GpayTransactionInfo {/// The country code#[schema(value_type = CountryAlpha2, example = "US")]+ #[smithy(value_type = "CountryAlpha2")]pub country_code: api_enums::CountryAlpha2,/// The currency code#[schema(value_type = Currency, example = "USD")]+ #[smithy(value_type = "Currency")]pub currency_code: api_enums::Currency,/// The total price status (ex: 'FINAL')+ #[smithy(value_type = "String")]pub total_price_status: String,/// The total price#[schema(value_type = String, example = "38.02")]+ #[smithy(value_type = "String")]pub total_price: StringMajorUnit,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct GpayMerchantInfo {/// The merchant Identifier that needs to be passed while invoking Gpay SDK#[serde(skip_serializing_if = "Option::is_none")]+ #[smithy(value_type = "Option<String>")]pub merchant_id: Option<String>,/// The name of the merchant that needs to be displayed on Gpay PopUp+ #[smithy(value_type = "String")]pub merchant_name: String,}@@ -7636,12 +8912,18 @@ pub struct ApplepaySessionRequest {}/// Some connectors like Apple Pay, Airwallex and Noon might require some additional information, find specific details in the child attributes below.-#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct ConnectorMetadata {+ #[smithy(value_type = "Option<ApplepayConnectorMetadataRequest>")]pub apple_pay: Option<ApplepayConnectorMetadataRequest>,+ #[smithy(value_type = "Option<AirwallexData>")]pub airwallex: Option<AirwallexData>,+ #[smithy(value_type = "Option<NoonData>")]pub noon: Option<NoonData>,+ #[smithy(value_type = "Option<BraintreeData>")]pub braintree: Option<BraintreeData>,+ #[smithy(value_type = "Option<AdyenConnectorMetadata>")]pub adyen: Option<AdyenConnectorMetadata>,}@@ -7671,41 +8953,54 @@ impl ConnectorMetadata {}}-#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct AirwallexData {/// payload required by airwallex+ #[smithy(value_type = "Option<String>")]payload: Option<String>,}-#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct NoonData {/// Information about the order category that merchant wants to specify at connector level. (e.g. In Noon Payments it can take values like "pay", "food", or any other custom string set by the merchant in Noon's Dashboard)+ #[smithy(value_type = "Option<String>")]pub order_category: Option<String>,}-#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct BraintreeData {/// Information about the merchant_account_id that merchant wants to specify at connector level.#[schema(value_type = String)]+ #[smithy(value_type = "String")]pub merchant_account_id: Option<Secret<String>>,/// Information about the merchant_config_currency that merchant wants to specify at connector level.#[schema(value_type = String)]+ #[smithy(value_type = "String")]pub merchant_config_currency: Option<api_enums::Currency>,}-#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct AdyenConnectorMetadata {+ #[smithy(value_type = "AdyenTestingData")]pub testing: AdyenTestingData,}-#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct AdyenTestingData {/// Holder name to be sent to Adyen for a card payment(CIT) or a generic payment(MIT). This value overrides the values for card.card_holder_name and applies during both CIT and MIT payment transactions.#[schema(value_type = String)]+ #[smithy(value_type = "String")]pub holder_name: Option<Secret<String>>,}-#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct ApplepayConnectorMetadataRequest {+ #[smithy(value_type = "Option<SessionTokenInfo>")]pub session_token_data: Option<SessionTokenInfo>,}@@ -7752,41 +9047,60 @@ pub struct PaymentRequestMetadata {pub label: String,}-#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct SessionTokenInfo {#[schema(value_type = String)]+ #[smithy(value_type = "String")]pub certificate: Secret<String>,#[schema(value_type = String)]+ #[smithy(value_type = "String")]pub certificate_keys: Secret<String>,+ #[smithy(value_type = "String")]pub merchant_identifier: String,+ #[smithy(value_type = "String")]pub display_name: String,+ #[smithy(value_type = "ApplepayInitiative")]pub initiative: ApplepayInitiative,+ #[smithy(value_type = "Option<String>")]pub initiative_context: Option<String>,#[schema(value_type = Option<CountryAlpha2>)]+ #[smithy(value_type = "Option<CountryAlpha2>")]pub merchant_business_country: Option<api_enums::CountryAlpha2>,#[serde(flatten)]pub payment_processing_details_at: Option<PaymentProcessingDetailsAt>,}-#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Display, ToSchema)]+#[derive(+ Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Display, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum ApplepayInitiative {Web,Ios,}-#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel)]#[serde(tag = "payment_processing_details_at")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum PaymentProcessingDetailsAt {+ #[smithy(value_type = "PaymentProcessingDetails")]Hyperswitch(PaymentProcessingDetails),+ #[smithy(value_type = "smithy.api#Unit")]Connector,}-#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, PartialEq, Eq, ToSchema)]+#[derive(+ Debug, Clone, serde::Serialize, serde::Deserialize, PartialEq, Eq, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct PaymentProcessingDetails {#[schema(value_type = String)]+ #[smithy(value_type = "String")]pub payment_processing_certificate: Secret<String>,#[schema(value_type = String)]+ #[smithy(value_type = "String")]pub payment_processing_certificate_key: Secret<String>,}@@ -7854,29 +9168,42 @@ pub struct GooglePayTokenizationParameters {pub stripe_version: Option<Secret<String>>,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]#[serde(tag = "wallet_name")]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum SessionToken {/// The session response structure for Google Pay+ #[smithy(value_type = "GpaySessionTokenResponse")]GooglePay(Box<GpaySessionTokenResponse>),/// The session response structure for Samsung Pay+ #[smithy(value_type = "SamsungPaySessionTokenResponse")]SamsungPay(Box<SamsungPaySessionTokenResponse>),/// The session response structure for Klarna+ #[smithy(value_type = "KlarnaSessionTokenResponse")]Klarna(Box<KlarnaSessionTokenResponse>),/// The session response structure for PayPal+ #[smithy(value_type = "PaypalSessionTokenResponse")]Paypal(Box<PaypalSessionTokenResponse>),/// The session response structure for Apple Pay+ #[smithy(value_type = "ApplepaySessionTokenResponse")]ApplePay(Box<ApplepaySessionTokenResponse>),/// Session token for OpenBanking PIS flow+ #[smithy(value_type = "OpenBankingSessionToken")]OpenBanking(OpenBankingSessionToken),/// The session response structure for Paze+ #[smithy(value_type = "PazeSessionTokenResponse")]Paze(Box<PazeSessionTokenResponse>),/// The sessions response structure for ClickToPay+ #[smithy(value_type = "ClickToPaySessionResponse")]ClickToPay(Box<ClickToPaySessionResponse>),/// The session response structure for Amazon Pay+ #[smithy(value_type = "AmazonPaySessionTokenResponse")]AmazonPay(Box<AmazonPaySessionTokenResponse>),/// Whenever there is no session token response or an error in session response+ #[smithy(value_type = "smithy.api#Unit")]NoSessionTokenReceived,}@@ -7912,131 +9239,194 @@ pub struct HyperswitchVaultSessionDetails {pub profile_id: Secret<String>,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "lowercase")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct PazeSessionTokenResponse {/// Paze Client ID+ #[smithy(value_type = "String")]pub client_id: String,/// Client Name to be displayed on the Paze screen+ #[smithy(value_type = "String")]pub client_name: String,/// Paze Client Profile ID+ #[smithy(value_type = "String")]pub client_profile_id: String,/// The transaction currency code#[schema(value_type = Currency, example = "USD")]+ #[smithy(value_type = "Currency")]pub transaction_currency_code: api_enums::Currency,/// The transaction amount#[schema(value_type = String, example = "38.02")]+ #[smithy(value_type = "String")]pub transaction_amount: StringMajorUnit,/// Email Address#[schema(max_length = 255, value_type = Option<String>, example = "[email protected]")]+ #[smithy(value_type = "Option<String>")]pub email_address: Option<Email>,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]#[serde(untagged)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum GpaySessionTokenResponse {/// Google pay response involving third party sdk+ #[smithy(value_type = "GooglePayThirdPartySdk")]ThirdPartyResponse(GooglePayThirdPartySdk),/// Google pay session response for non third party sdk+ #[smithy(value_type = "GooglePaySessionResponse")]GooglePaySession(GooglePaySessionResponse),}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "lowercase")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct GooglePayThirdPartySdk {/// Identifier for the delayed session response+ #[smithy(value_type = "bool")]pub delayed_session_token: bool,/// The name of the connector+ #[smithy(value_type = "String")]pub connector: String,/// The next action for the sdk (ex: calling confirm or sync call)+ #[smithy(value_type = "SdkNextAction")]pub sdk_next_action: SdkNextAction,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "lowercase")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct GooglePaySessionResponse {/// The merchant info+ #[smithy(value_type = "GpayMerchantInfo")]pub merchant_info: GpayMerchantInfo,/// Is shipping address required+ #[smithy(value_type = "bool")]pub shipping_address_required: bool,/// Is email required+ #[smithy(value_type = "bool")]pub email_required: bool,/// Shipping address parameters+ #[smithy(value_type = "GpayShippingAddressParameters")]pub shipping_address_parameters: GpayShippingAddressParameters,/// List of the allowed payment methods+ #[smithy(value_type = "Vec<GpayAllowedPaymentMethods>")]pub allowed_payment_methods: Vec<GpayAllowedPaymentMethods>,/// The transaction info Google Pay requires+ #[smithy(value_type = "GpayTransactionInfo")]pub transaction_info: GpayTransactionInfo,/// Identifier for the delayed session response+ #[smithy(value_type = "bool")]pub delayed_session_token: bool,/// The name of the connector+ #[smithy(value_type = "String")]pub connector: String,/// The next action for the sdk (ex: calling confirm or sync call)+ #[smithy(value_type = "SdkNextAction")]pub sdk_next_action: SdkNextAction,/// Secrets for sdk display and payment+ #[smithy(value_type = " Option<SecretInfoToInitiateSdk>")]pub secrets: Option<SecretInfoToInitiateSdk>,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "lowercase")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct SamsungPaySessionTokenResponse {/// Samsung Pay API version+ #[smithy(value_type = "String")]pub version: String,/// Samsung Pay service ID to which session call needs to be made+ #[smithy(value_type = "String")]pub service_id: String,/// Order number of the transaction+ #[smithy(value_type = "String")]pub order_number: String,/// Field containing merchant information#[serde(rename = "merchant")]+ #[smithy(value_type = "SamsungPayMerchantPaymentInformation")]pub merchant_payment_information: SamsungPayMerchantPaymentInformation,/// Field containing the payment amount+ #[smithy(value_type = "SamsungPayAmountDetails")]pub amount: SamsungPayAmountDetails,/// Payment protocol type+ #[smithy(value_type = "SamsungPayProtocolType")]pub protocol: SamsungPayProtocolType,/// List of supported card brands#[schema(value_type = Vec<String>)]+ #[smithy(value_type = "Vec<String>")]pub allowed_brands: Vec<String>,/// Is billing address required to be collected from wallet+ #[smithy(value_type = "bool")]pub billing_address_required: bool,/// Is shipping address required to be collected from wallet+ #[smithy(value_type = "bool")]pub shipping_address_required: bool,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "SCREAMING_SNAKE_CASE")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum SamsungPayProtocolType {Protocol3ds,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "lowercase")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct SamsungPayMerchantPaymentInformation {/// Merchant name, this will be displayed on the Samsung Pay screen+ #[smithy(value_type = "String")]pub name: String,/// Merchant domain that process payments, required for web payments+ #[smithy(value_type = "Option<String>")]pub url: Option<String>,/// Merchant country code#[schema(value_type = CountryAlpha2, example = "US")]+ #[smithy(value_type = "CountryAlpha2")]pub country_code: api_enums::CountryAlpha2,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "lowercase")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct SamsungPayAmountDetails {#[serde(rename = "option")]+ #[smithy(value_type = "SamsungPayAmountFormat")]/// Amount format to be displayedpub amount_format: SamsungPayAmountFormat,/// The currency code#[schema(value_type = Currency, example = "USD")]+ #[smithy(value_type = "Currency")]pub currency_code: api_enums::Currency,/// The total amount of the transaction#[serde(rename = "total")]#[schema(value_type = String, example = "38.02")]+ #[smithy(value_type = "String")]pub total_amount: StringMajorUnit,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "SCREAMING_SNAKE_CASE")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum SamsungPayAmountFormat {/// Display the total amount onlyFormatTotalPriceOnly,@@ -8044,19 +9434,28 @@ pub enum SamsungPayAmountFormat {FormatTotalEstimatedAmount,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "lowercase")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct GpayShippingAddressParameters {/// Is shipping phone number required+ #[smithy(value_type = "bool")]pub phone_number_required: bool,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "lowercase")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct KlarnaSessionTokenResponse {/// The session token for Klarna+ #[smithy(value_type = "String")]pub session_token: String,/// The identifier for the session+ #[smithy(value_type = "String")]pub session_id: String,}@@ -8079,14 +9478,20 @@ pub struct PaypalTransactionInfo {pub total_price: StringMajorUnit,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "lowercase")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct PaypalSessionTokenResponse {/// Name of the connector+ #[smithy(value_type = "String")]pub connector: String,/// The session token for PayPal+ #[smithy(value_type = "String")]pub session_token: String,/// The next action for the sdk (ex: calling confirm or sync call)+ #[smithy(value_type = "SdkNextAction")]pub sdk_next_action: SdkNextAction,/// Authorization token used by client to initiate sdkpub client_token: Option<String>,@@ -8094,44 +9499,66 @@ pub struct PaypalSessionTokenResponse {pub transaction_info: Option<PaypalTransactionInfo>,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "lowercase")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct OpenBankingSessionToken {/// The session token for OpenBanking Connectors+ #[smithy(value_type = "String")]pub open_banking_session_token: String,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "lowercase")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct ApplepaySessionTokenResponse {/// Session object for Apple Pay/// The session_token_data will be null for iOS devices because the Apple Pay session call is skipped, as there is no web domain involved#[serde(skip_serializing_if = "Option::is_none")]+ #[smithy(value_type = "Option<ApplePaySessionResponse>")]pub session_token_data: Option<ApplePaySessionResponse>,/// Payment request object for Apple Pay+ #[smithy(value_type = "Option<ApplePayPaymentRequest>")]pub payment_request_data: Option<ApplePayPaymentRequest>,/// The session token is w.r.t this connector+ #[smithy(value_type = "String")]pub connector: String,/// Identifier for the delayed session response+ #[smithy(value_type = "bool")]pub delayed_session_token: bool,/// The next action for the sdk (ex: calling confirm or sync call)+ #[smithy(value_type = "SdkNextAction")]pub sdk_next_action: SdkNextAction,/// The connector transaction id+ #[smithy(value_type = "Option<String>")]pub connector_reference_id: Option<String>,/// The public key id is to invoke third party sdk+ #[smithy(value_type = "Option<String>")]pub connector_sdk_public_key: Option<String>,/// The connector merchant id+ #[smithy(value_type = "Option<String>")]pub connector_merchant_id: Option<String>,}-#[derive(Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, Clone, ToSchema)]+#[derive(+ Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, Clone, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct SdkNextAction {/// The type of next action+ #[smithy(value_type = "NextActionCall")]pub next_action: NextActionCall,}-#[derive(Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, Clone, ToSchema)]+#[derive(+ Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, Clone, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum NextActionCall {/// The next action call is Post Session TokensPostSessionTokens,@@ -8149,127 +9576,188 @@ pub enum NextActionCall {EligibilityCheck,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]#[serde(untagged)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum ApplePaySessionResponse {/// We get this session response, when third party sdk is involved+ #[smithy(value_type = "ThirdPartySdkSessionResponse")]ThirdPartySdk(ThirdPartySdkSessionResponse),/// We get this session response, when there is no involvement of third party sdk/// This is the common response most of the times+ #[smithy(value_type = "NoThirdPartySdkSessionResponse")]NoThirdPartySdk(NoThirdPartySdkSessionResponse),/// This is for the empty session response+ #[smithy(value_type = "smithy.api#Unit")]NoSessionResponse(NullObject),}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, ToSchema, serde::Deserialize)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, ToSchema, serde::Deserialize, SmithyModel,+)]#[serde(rename_all(deserialize = "camelCase"))]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct NoThirdPartySdkSessionResponse {/// Timestamp at which session is requested+ #[smithy(value_type = "u64")]pub epoch_timestamp: u64,/// Timestamp at which session expires+ #[smithy(value_type = "u64")]pub expires_at: u64,/// The identifier for the merchant session+ #[smithy(value_type = "String")]pub merchant_session_identifier: String,/// Apple pay generated unique ID (UUID) value+ #[smithy(value_type = "String")]pub nonce: String,/// The identifier for the merchant+ #[smithy(value_type = "String")]pub merchant_identifier: String,/// The domain name of the merchant which is registered in Apple Pay+ #[smithy(value_type = "String")]pub domain_name: String,/// The name to be displayed on Apple Pay button+ #[smithy(value_type = "String")]pub display_name: String,/// A string which represents the properties of a payment+ #[smithy(value_type = "String")]pub signature: String,/// The identifier for the operational analytics+ #[smithy(value_type = "String")]pub operational_analytics_identifier: String,/// The number of retries to get the session response+ #[smithy(value_type = "u8")]pub retries: u8,/// The identifier for the connector transaction+ #[smithy(value_type = "String")]pub psp_id: String,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct ThirdPartySdkSessionResponse {+ #[smithy(value_type = "SecretInfoToInitiateSdk")]pub secrets: SecretInfoToInitiateSdk,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, ToSchema, serde::Deserialize)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, ToSchema, serde::Deserialize, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct SecretInfoToInitiateSdk {// Authorization secrets used by client to initiate sdk#[schema(value_type = String)]+ #[smithy(value_type = "String")]pub display: Secret<String>,// Authorization secrets used by client for payment#[schema(value_type = String)]+ #[smithy(value_type = "Option<String>")]pub payment: Option<Secret<String>>,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, ToSchema, serde::Deserialize)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, ToSchema, serde::Deserialize, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct ApplePayPaymentRequest {/// The code for country#[schema(value_type = CountryAlpha2, example = "US")]+ #[smithy(value_type = "CountryAlpha2")]pub country_code: api_enums::CountryAlpha2,/// The code for currency#[schema(value_type = Currency, example = "USD")]+ #[smithy(value_type = "Currency")]pub currency_code: api_enums::Currency,/// Represents the total for the payment.+ #[smithy(value_type = "AmountInfo")]pub total: AmountInfo,/// The list of merchant capabilities(ex: whether capable of 3ds or no-3ds)+ #[smithy(value_type = "Option<Vec<String>>")]pub merchant_capabilities: Option<Vec<String>>,/// The list of supported networks+ #[smithy(value_type = "Option<Vec<String>>")]pub supported_networks: Option<Vec<String>>,+ #[smithy(value_type = "Option<String>")]pub merchant_identifier: Option<String>,/// The required billing contact fields for connector#[serde(skip_serializing_if = "Option::is_none")]+ #[smithy(value_type = "Option<Vec<ApplePayAddressParameters>>")]pub required_billing_contact_fields: Option<ApplePayBillingContactFields>,#[serde(skip_serializing_if = "Option::is_none")]/// The required shipping contacht fields for connector+ #[smithy(value_type = "Option<Vec<ApplePayAddressParameters>>")]pub required_shipping_contact_fields: Option<ApplePayShippingContactFields>,/// Recurring payment request for apple pay Merchant Token#[serde(skip_serializing_if = "Option::is_none")]+ #[smithy(value_type = "Option<ApplePayRecurringPaymentRequest>")]pub recurring_payment_request: Option<ApplePayRecurringPaymentRequest>,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct ApplePayRecurringPaymentRequest {/// A description of the recurring payment that Apple Pay displays to the user in the payment sheet+ #[smithy(value_type = "String")]pub payment_description: String,/// The regular billing cycle for the recurring payment, including start and end dates, an interval, and an interval count+ #[smithy(value_type = "ApplePayRegularBillingRequest")]pub regular_billing: ApplePayRegularBillingRequest,/// A localized billing agreement that the payment sheet displays to the user before the user authorizes the payment#[serde(skip_serializing_if = "Option::is_none")]+ #[smithy(value_type = "Option<String>")]pub billing_agreement: Option<String>,/// A URL to a web page where the user can update or delete the payment method for the recurring payment#[schema(value_type = String, example = "https://hyperswitch.io")]+ #[smithy(value_type = "String")]pub management_u_r_l: common_utils::types::Url,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct ApplePayRegularBillingRequest {/// The amount of the recurring payment#[schema(value_type = String, example = "38.02")]+ #[smithy(value_type = "String")]pub amount: StringMajorUnit,/// The label that Apple Pay displays to the user in the payment sheet with the recurring details+ #[smithy(value_type = "String")]pub label: String,/// The time that the payment occurs as part of a successful transaction+ #[smithy(value_type = "ApplePayPaymentTiming")]pub payment_timing: ApplePayPaymentTiming,/// The date of the first payment#[serde(skip_serializing_if = "Option::is_none")]#[serde(with = "common_utils::custom_serde::iso8601::option")]+ #[smithy(value_type = "Option<String>")]pub recurring_payment_start_date: Option<PrimitiveDateTime>,/// The date of the final payment#[serde(skip_serializing_if = "Option::is_none")]#[serde(with = "common_utils::custom_serde::iso8601::option")]+ #[smithy(value_type = "Option<String>")]pub recurring_payment_end_date: Option<PrimitiveDateTime>,/// The amount of time — in calendar units, such as day, month, or year — that represents a fraction of the total payment interval#[serde(skip_serializing_if = "Option::is_none")]+ #[smithy(value_type = "Option<RecurringPaymentIntervalUnit>")]pub recurring_payment_interval_unit: Option<RecurringPaymentIntervalUnit>,/// The number of interval units that make up the total payment interval#[serde(skip_serializing_if = "Option::is_none")]+ #[smithy(value_type = "Option<i32>")]pub recurring_payment_interval_count: Option<i32>,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum ApplePayPaymentTiming {/// A value that specifies that the payment occurs when the transaction is completeImmediate,@@ -8282,23 +9770,32 @@ pub struct ApplePayBillingContactFields(pub Vec<ApplePayAddressParameters>);#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, ToSchema, serde::Deserialize)]pub struct ApplePayShippingContactFields(pub Vec<ApplePayAddressParameters>);-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, ToSchema, serde::Deserialize)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, ToSchema, serde::Deserialize, SmithyModel,+)]#[serde(rename_all = "camelCase")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum ApplePayAddressParameters {PostalAddress,Phone,Email,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, ToSchema, serde::Deserialize)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, ToSchema, serde::Deserialize, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct AmountInfo {/// The label must be the name of the merchant.+ #[smithy(value_type = "String")]pub label: String,/// A value that indicates whether the line item(Ex: total, tax, discount, or grand total) is final or pending.#[serde(rename = "type")]+ #[smithy(value_type = "Option<String>")]pub total_type: Option<String>,/// The total amount for the payment in majot unit string (Ex: 38.02)#[schema(value_type = String, example = "38.02")]+ #[smithy(value_type = "String")]pub amount: StringMajorUnit,}@@ -8309,31 +9806,45 @@ pub struct ApplepayErrorResponse {pub status_message: String,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct AmazonPaySessionTokenResponse {/// Amazon Pay merchant account identifier+ #[smithy(value_type = "String")]pub merchant_id: String,/// Ledger currency provided during registration for the given merchant identifier#[schema(example = "USD", value_type = Currency)]+ #[smithy(value_type = "Currency")]pub ledger_currency: common_enums::Currency,/// Amazon Pay store ID+ #[smithy(value_type = "String")]pub store_id: String,/// Payment flow for charging the buyer+ #[smithy(value_type = "AmazonPayPaymentIntent")]pub payment_intent: AmazonPayPaymentIntent,/// The total shipping costs#[schema(value_type = String)]+ #[smithy(value_type = "String")]pub total_shipping_amount: StringMajorUnit,/// The total tax amount for the order#[schema(value_type = String)]+ #[smithy(value_type = "String")]pub total_tax_amount: StringMajorUnit,/// The total amount for items in the cart#[schema(value_type = String)]+ #[smithy(value_type = "String")]pub total_base_amount: StringMajorUnit,/// The delivery options available for the provided address+ #[smithy(value_type = "Vec<AmazonPayDeliveryOptions>")]pub delivery_options: Vec<AmazonPayDeliveryOptions>,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum AmazonPayPaymentIntent {/// Create a Charge Permission to authorize and capture funds at a later timeConfirm,@@ -8343,36 +9854,54 @@ pub enum AmazonPayPaymentIntent {AuthorizeWithCapture,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct AmazonPayDeliveryOptions {/// Delivery Option identifier+ #[smithy(value_type = "String")]pub id: String,/// Total delivery cost+ #[smithy(value_type = "AmazonPayDeliveryPrice")]pub price: AmazonPayDeliveryPrice,/// Shipping method details+ #[smithy(value_type = "AmazonPayShippingMethod")]pub shipping_method: AmazonPayShippingMethod,/// Specifies if this delivery option is the default+ #[smithy(value_type = "bool")]pub is_default: bool,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct AmazonPayDeliveryPrice {/// Transaction amount in MinorUnit+ #[smithy(value_type = "i64")]pub amount: MinorUnit,#[serde(skip_deserializing)]/// Transaction amount in StringMajorUnit#[schema(value_type = String)]+ #[smithy(value_type = "String")]pub display_amount: StringMajorUnit,/// Transaction currency code in ISO 4217 format#[schema(example = "USD", value_type = Currency)]+ #[smithy(value_type = "Currency")]pub currency_code: common_enums::Currency,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct AmazonPayShippingMethod {/// Name of the shipping method+ #[smithy(value_type = "String")]pub shipping_method_name: String,/// Code of the shipping method+ #[smithy(value_type = "String")]pub shipping_method_code: String,}@@ -8510,15 +10039,18 @@ pub struct PaymentsCompleteAuthorizeRequest {}#[cfg(feature = "v1")]-#[derive(Default, Debug, serde::Deserialize, serde::Serialize, Clone, ToSchema)]+#[derive(Default, Debug, serde::Deserialize, serde::Serialize, Clone, ToSchema, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct PaymentsCancelRequest {/// The identifier for the payment#[serde(skip)]pub payment_id: id_type::PaymentId,/// The reason for the payment cancel+ #[smithy(value_type = "Option<String>")]pub cancellation_reason: Option<String>,/// Merchant connector details used to make payments.#[schema(value_type = Option<MerchantConnectorDetailsWrap>, deprecated)]+ #[smithy(value_type = "Option<MerchantConnectorDetailsWrap>")]pub merchant_connector_details: Option<admin::MerchantConnectorDetailsWrap>,}@@ -8615,7 +10147,8 @@ pub struct PaymentsManualUpdateResponse {pub amount_capturable: Option<MinorUnit>,}-#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, ToSchema)]+#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, ToSchema, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]/// Indicates if 3DS method data was successfully completed or notpub enum ThreeDsCompletionIndicator {/// 3DS method successfully completed@@ -8839,51 +10372,68 @@ impl FeatureMetadata {/// additional data that might be required by hyperswitch#[cfg(feature = "v1")]-#[derive(Debug, Clone, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(Debug, Clone, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct FeatureMetadata {/// Redirection response coming in request as metadata field only for redirection scenarios#[schema(value_type = Option<RedirectResponse>)]+ #[smithy(value_type = "Option<RedirectResponse>")]pub redirect_response: Option<RedirectResponse>,/// Additional tags to be used for global search#[schema(value_type = Option<Vec<String>>)]+ #[smithy(value_type = "Option<Vec<String>>")]pub search_tags: Option<Vec<HashedString<WithType>>>,/// Recurring payment details required for apple pay Merchant Token+ #[smithy(value_type = "Option<ApplePayRecurringDetails>")]pub apple_pay_recurring_details: Option<ApplePayRecurringDetails>,}-#[derive(Debug, Clone, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(Debug, Clone, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct ApplePayRecurringDetails {/// A description of the recurring payment that Apple Pay displays to the user in the payment sheet+ #[smithy(value_type = "String")]pub payment_description: String,/// The regular billing cycle for the recurring payment, including start and end dates, an interval, and an interval count+ #[smithy(value_type = "ApplePayRegularBillingDetails")]pub regular_billing: ApplePayRegularBillingDetails,/// A localized billing agreement that the payment sheet displays to the user before the user authorizes the payment+ #[smithy(value_type = "Option<String>")]pub billing_agreement: Option<String>,/// A URL to a web page where the user can update or delete the payment method for the recurring payment#[schema(value_type = String, example = "https://hyperswitch.io")]+ #[smithy(value_type = "String")]pub management_url: common_utils::types::Url,}-#[derive(Debug, Clone, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(Debug, Clone, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct ApplePayRegularBillingDetails {/// The label that Apple Pay displays to the user in the payment sheet with the recurring detailspub label: String,/// The date of the first payment#[schema(example = "2023-09-10T23:59:59Z")]#[serde(default, with = "common_utils::custom_serde::iso8601::option")]+ #[smithy(value_type = "Option<String>")]pub recurring_payment_start_date: Option<PrimitiveDateTime>,/// The date of the final payment#[schema(example = "2023-09-10T23:59:59Z")]#[serde(default, with = "common_utils::custom_serde::iso8601::option")]+ #[smithy(value_type = "Option<String>")]pub recurring_payment_end_date: Option<PrimitiveDateTime>,/// The amount of time — in calendar units, such as day, month, or year — that represents a fraction of the total payment interval+ #[smithy(value_type = "Option<RecurringPaymentIntervalUnit>")]pub recurring_payment_interval_unit: Option<RecurringPaymentIntervalUnit>,/// The number of interval units that make up the total payment interval+ #[smithy(value_type = "Option<i32>")]pub recurring_payment_interval_count: Option<i32>,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum RecurringPaymentIntervalUnit {Year,Month,@@ -8893,14 +10443,22 @@ pub enum RecurringPaymentIntervalUnit {}///frm message is an object sent inside the payments response...when frm is invoked, its value is Some(...), else its None-#[derive(Clone, Debug, serde::Deserialize, serde::Serialize, PartialEq, ToSchema)]+#[derive(Clone, Debug, serde::Deserialize, serde::Serialize, PartialEq, ToSchema, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct FrmMessage {+ #[smithy(value_type = "String")]pub frm_name: String,+ #[smithy(value_type = "Option<String>")]pub frm_transaction_id: Option<String>,+ #[smithy(value_type = "Option<String>")]pub frm_transaction_type: Option<String>,+ #[smithy(value_type = "Option<String>")]pub frm_status: Option<String>,+ #[smithy(value_type = "Option<i32>")]pub frm_score: Option<i32>,+ #[smithy(value_type = "Option<Object>")]pub frm_reason: Option<serde_json::Value>,+ #[smithy(value_type = "Option<String>")]pub frm_error: Option<String>,}@@ -9399,29 +10957,47 @@ pub struct ExtendedCardInfoResponse {pub payload: String,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct ClickToPaySessionResponse {+ #[smithy(value_type = "String")]pub dpa_id: String,+ #[smithy(value_type = "String")]pub dpa_name: String,+ #[smithy(value_type = "String")]pub locale: String,#[schema(value_type = Vec<CardNetwork>, example = "[Visa, Mastercard]")]+ #[smithy(value_type = "Vec<CardNetwork>")]pub card_brands: HashSet<api_enums::CardNetwork>,+ #[smithy(value_type = "String")]pub acquirer_bin: String,+ #[smithy(value_type = "String")]pub acquirer_merchant_id: String,+ #[smithy(value_type = "String")]pub merchant_category_code: String,+ #[smithy(value_type = "String")]pub merchant_country_code: String,#[schema(value_type = String, example = "38.02")]+ #[smithy(value_type = "String")]pub transaction_amount: StringMajorUnit,#[schema(value_type = Currency)]+ #[smithy(value_type = "Currency")]pub transaction_currency_code: common_enums::Currency,#[schema(value_type = Option<String>, max_length = 255, example = "9123456789")]+ #[smithy(value_type = "Option<String>")]pub phone_number: Option<Secret<String>>,#[schema(max_length = 255, value_type = Option<String>, example = "[email protected]")]+ #[smithy(value_type = "Option<String>")]pub email: Option<Email>,+ #[smithy(value_type = "Option<String>")]pub phone_country_code: Option<String>,/// provider Eg: Visa, Mastercard#[schema(value_type = Option<CtpServiceProvider>)]+ #[smithy(value_type = "Option<CtpServiceProvider>")]pub provider: Option<api_enums::CtpServiceProvider>,+ #[smithy(value_type = "Option<String>")]pub dpa_client_id: Option<String>,}diff --git a/crates/api_models/src/payments/additional_info.rs b/crates/api_models/src/payments/additional_info.rsindex e59ea16387..0bce059cd7 100644--- a/crates/api_models/src/payments/additional_info.rs+++ b/crates/api_models/src/payments/additional_info.rs@@ -2,246 +2,368 @@ use common_utils::new_type::{MaskedBankAccount, MaskedIban, MaskedRoutingNumber, MaskedSortCode, MaskedUpiVpaId,};use masking::Secret;+use smithy::SmithyModel;use utoipa::ToSchema;use crate::enums as api_enums;-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum BankDebitAdditionalData {+ #[smithy(value_type = "AchBankDebitAdditionalData")]Ach(Box<AchBankDebitAdditionalData>),+ #[smithy(value_type = "BacsBankDebitAdditionalData")]Bacs(Box<BacsBankDebitAdditionalData>),+ #[smithy(value_type = "BecsBankDebitAdditionalData")]Becs(Box<BecsBankDebitAdditionalData>),+ #[smithy(value_type = "SepaBankDebitAdditionalData")]Sepa(Box<SepaBankDebitAdditionalData>),SepaGuarenteedDebit(Box<SepaBankDebitAdditionalData>),}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct AchBankDebitAdditionalData {/// Partially masked account number for ach bank debit payment#[schema(value_type = String, example = "0001****3456")]+ #[smithy(value_type = "String")]pub account_number: MaskedBankAccount,/// Partially masked routing number for ach bank debit payment#[schema(value_type = String, example = "110***000")]+ #[smithy(value_type = "String")]pub routing_number: MaskedRoutingNumber,/// Card holder's name#[schema(value_type = Option<String>, example = "John Doe")]+ #[smithy(value_type = "Option<String>")]pub card_holder_name: Option<Secret<String>>,/// Bank account's owner name#[schema(value_type = Option<String>, example = "John Doe")]+ #[smithy(value_type = "Option<String>")]pub bank_account_holder_name: Option<Secret<String>>,/// Name of the bank#[schema(value_type = Option<BankNames>, example = "ach")]+ #[smithy(value_type = "Option<BankNames>")]pub bank_name: Option<common_enums::BankNames>,/// Bank account type#[schema(value_type = Option<BankType>, example = "checking")]+ #[smithy(value_type = "Option<BankType>")]pub bank_type: Option<common_enums::BankType>,/// Bank holder entity type#[schema(value_type = Option<BankHolderType>, example = "personal")]+ #[smithy(value_type = "Option<BankHolderType>")]pub bank_holder_type: Option<common_enums::BankHolderType>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct BacsBankDebitAdditionalData {/// Partially masked account number for Bacs payment method#[schema(value_type = String, example = "0001****3456")]+ #[smithy(value_type = "String")]pub account_number: MaskedBankAccount,/// Partially masked sort code for Bacs payment method#[schema(value_type = String, example = "108800")]+ #[smithy(value_type = "String")]pub sort_code: MaskedSortCode,/// Bank account's owner name#[schema(value_type = Option<String>, example = "John Doe")]+ #[smithy(value_type = "Option<String>")]pub bank_account_holder_name: Option<Secret<String>>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct BecsBankDebitAdditionalData {/// Partially masked account number for Becs payment method#[schema(value_type = String, example = "0001****3456")]+ #[smithy(value_type = "String")]pub account_number: MaskedBankAccount,/// Bank-State-Branch (bsb) number#[schema(value_type = String, example = "000000")]+ #[smithy(value_type = "String")]pub bsb_number: Secret<String>,/// Bank account's owner name#[schema(value_type = Option<String>, example = "John Doe")]+ #[smithy(value_type = "Option<String>")]pub bank_account_holder_name: Option<Secret<String>>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct SepaBankDebitAdditionalData {/// Partially masked international bank account number (iban) for SEPA#[schema(value_type = String, example = "DE8937******013000")]+ #[smithy(value_type = "String")]pub iban: MaskedIban,/// Bank account's owner name#[schema(value_type = Option<String>, example = "John Doe")]+ #[smithy(value_type = "Option<String>")]pub bank_account_holder_name: Option<Secret<String>>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum BankRedirectDetails {+ #[smithy(value_type = "BancontactBankRedirectAdditionalData")]BancontactCard(Box<BancontactBankRedirectAdditionalData>),+ #[smithy(value_type = "BlikBankRedirectAdditionalData")]Blik(Box<BlikBankRedirectAdditionalData>),+ #[smithy(value_type = "GiropayBankRedirectAdditionalData")]Giropay(Box<GiropayBankRedirectAdditionalData>),}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct BancontactBankRedirectAdditionalData {/// Last 4 digits of the card number#[schema(value_type = Option<String>, example = "4242")]+ #[smithy(value_type = "Option<String>")]pub last4: Option<String>,/// The card's expiry month#[schema(value_type = Option<String>, example = "12")]+ #[smithy(value_type = "Option<String>")]pub card_exp_month: Option<Secret<String>>,/// The card's expiry year#[schema(value_type = Option<String>, example = "24")]+ #[smithy(value_type = "Option<String>")]pub card_exp_year: Option<Secret<String>>,/// The card holder's name#[schema(value_type = Option<String>, example = "John Test")]+ #[smithy(value_type = "Option<String>")]pub card_holder_name: Option<Secret<String>>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct BlikBankRedirectAdditionalData {#[schema(value_type = Option<String>, example = "3GD9MO")]+ #[smithy(value_type = "Option<String>")]pub blik_code: Option<String>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct GiropayBankRedirectAdditionalData {#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]/// Masked bank account bic codepub bic: Option<MaskedSortCode>,/// Partially masked international bank account number (iban) for SEPA#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]pub iban: Option<MaskedIban>,/// Country for bank payment#[schema(value_type = Option<CountryAlpha2>, example = "US")]+ #[smithy(value_type = "Option<CountryAlpha2>")]pub country: Option<api_enums::CountryAlpha2>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum BankTransferAdditionalData {+ #[smithy(nested_value_type)]Ach {},+ #[smithy(nested_value_type)]Sepa {},+ #[smithy(nested_value_type)]Bacs {},+ #[smithy(nested_value_type)]Multibanco {},+ #[smithy(nested_value_type)]Permata {},+ #[smithy(nested_value_type)]Bca {},+ #[smithy(nested_value_type)]BniVa {},+ #[smithy(nested_value_type)]BriVa {},+ #[smithy(nested_value_type)]CimbVa {},+ #[smithy(nested_value_type)]DanamonVa {},+ #[smithy(nested_value_type)]MandiriVa {},+ #[smithy(value_type = "PixBankTransferAdditionalData")]Pix(Box<PixBankTransferAdditionalData>),+ #[smithy(nested_value_type)]Pse {},+ #[smithy(value_type = "LocalBankTransferAdditionalData")]LocalBankTransfer(Box<LocalBankTransferAdditionalData>),+ #[smithy(nested_value_type)]InstantBankTransfer {},+ #[smithy(nested_value_type)]InstantBankTransferFinland {},+ #[smithy(nested_value_type)]InstantBankTransferPoland {},+ #[smithy(nested_value_type)]IndonesianBankTransfer {#[schema(value_type = Option<BankNames>, example = "bri")]+ #[smithy(value_type = "Option<BankNames>")]bank_name: Option<common_enums::BankNames>,},}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct PixBankTransferAdditionalData {/// Partially masked unique key for pix transfer#[schema(value_type = Option<String>, example = "a1f4102e ****** 6fa48899c1d1")]+ #[smithy(value_type = "Option<String>")]pub pix_key: Option<MaskedBankAccount>,/// Partially masked CPF - CPF is a Brazilian tax identification number#[schema(value_type = Option<String>, example = "**** 124689")]+ #[smithy(value_type = "Option<String>")]pub cpf: Option<MaskedBankAccount>,/// Partially masked CNPJ - CNPJ is a Brazilian company tax identification number#[schema(value_type = Option<String>, example = "**** 417312")]+ #[smithy(value_type = "Option<String>")]pub cnpj: Option<MaskedBankAccount>,/// Partially masked source bank account number#[schema(value_type = Option<String>, example = "********-****-4073-****-9fa964d08bc5")]+ #[smithy(value_type = "Option<String>")]pub source_bank_account_id: Option<MaskedBankAccount>,/// Partially masked destination bank account number _Deprecated: Will be removed in next stable release._#[schema(value_type = Option<String>, example = "********-****-460b-****-f23b4e71c97b", deprecated)]+ #[smithy(value_type = "Option<String>")]pub destination_bank_account_id: Option<MaskedBankAccount>,/// The expiration date and time for the Pix QR code in ISO 8601 format#[schema(value_type = Option<String>, example = "2025-09-10T10:11:12Z")]#[serde(default, with = "common_utils::custom_serde::iso8601::option")]+ #[smithy(value_type = "Option<String>")]pub expiry_date: Option<time::PrimitiveDateTime>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct LocalBankTransferAdditionalData {/// Partially masked bank code#[schema(value_type = Option<String>, example = "**** OA2312")]+ #[smithy(value_type = "Option<String>")]pub bank_code: Option<MaskedBankAccount>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum GiftCardAdditionalData {+ #[smithy(value_type = "String")]Givex(Box<GivexGiftCardAdditionalData>),+ #[smithy(nested_value_type)]PaySafeCard {},+ #[smithy(nested_value_type)]BhnCardNetwork {},}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct GivexGiftCardAdditionalData {/// Last 4 digits of the gift card number#[schema(value_type = String, example = "4242")]+ #[smithy(value_type = "String")]pub last4: Secret<String>,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct CardTokenAdditionalData {/// The card holder's name#[schema(value_type = String, example = "John Test")]+ #[smithy(value_type = "String")]pub card_holder_name: Option<Secret<String>>,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum UpiAdditionalData {+ #[smithy(value_type = "UpiCollectAdditionalData")]UpiCollect(Box<UpiCollectAdditionalData>),#[schema(value_type = UpiIntentData)]+ #[smithy(value_type = "UpiIntentData")]UpiIntent(Box<super::UpiIntentData>),#[schema(value_type = UpiQrData)]UpiQr(Box<super::UpiQrData>),}-#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct UpiCollectAdditionalData {/// Masked VPA ID#[schema(value_type = Option<String>, example = "ab********@okhdfcbank")]+ #[smithy(value_type = "Option<String>")]pub vpa_id: Option<MaskedUpiVpaId>,}-#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct WalletAdditionalDataForCard {/// Last 4 digits of the card number+ #[smithy(value_type = "String")]pub last4: String,/// The information of the payment method+ #[smithy(value_type = "String")]pub card_network: String,/// The type of payment method#[serde(rename = "type")]+ #[smithy(value_type = "Option<String>")]pub card_type: Option<String>,}diff --git a/crates/api_models/src/refunds.rs b/crates/api_models/src/refunds.rsindex cb147bf11d..a851c01949 100644--- a/crates/api_models/src/refunds.rs+++ b/crates/api_models/src/refunds.rs@@ -3,6 +3,7 @@ use std::collections::HashMap;pub use common_utils::types::MinorUnit;use common_utils::{pii, types::TimeRange};use serde::{Deserialize, Serialize};+use smithy::SmithyModel;use time::PrimitiveDateTime;use utoipa::ToSchema;@@ -12,8 +13,9 @@ use crate::admin;use crate::{admin::MerchantConnectorInfo, enums};#[cfg(feature = "v1")]-#[derive(Default, Debug, ToSchema, Clone, Deserialize, Serialize)]+#[derive(Default, Debug, ToSchema, Clone, Deserialize, Serialize, SmithyModel)]#[serde(deny_unknown_fields)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct RefundRequest {/// The payment id against which refund is to be initiated#[schema(@@ -22,6 +24,7 @@ pub struct RefundRequest {example = "pay_mbabizu24mvu3mela5njyhpit4",value_type = String,)]+ #[smithy(value_type = "String")]pub payment_id: common_utils::id_type::PaymentId,/// Unique Identifier for the Refund. This is to ensure idempotency for multiple partial refunds initiated against the same payment. If this is not passed by the merchant, this field shall be auto generated and provided in the API response. It is recommended to generate uuid(v4) as the refund_id.@@ -30,34 +33,42 @@ pub struct RefundRequest {min_length = 30,example = "ref_mbabizu24mvu3mela5njyhpit4")]+ #[smithy(value_type = "Option<String>")]pub refund_id: Option<String>,/// The identifier for the Merchant Account#[schema(max_length = 255, example = "y3oqhf46pyzuxjbcn2giaqnb44", value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]pub merchant_id: Option<common_utils::id_type::MerchantId>,/// Total amount for which the refund is to be initiated. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc., If not provided, this will default to the full payment amount#[schema(value_type = Option<i64> , minimum = 100, example = 6540)]+ #[smithy(value_type = "Option<i64>")]pub amount: Option<MinorUnit>,/// Reason for the refund. Often useful for displaying to users and your customer support executive. In case the payment went through Stripe, this field needs to be passed with one of these enums: `duplicate`, `fraudulent`, or `requested_by_customer`#[schema(max_length = 255, example = "Customer returned the product")]+ #[smithy(value_type = "Option<String>")]pub reason: Option<String>,/// To indicate whether to refund needs to be instant or scheduled. Default value is instant#[schema(default = "Instant", example = "Instant")]+ #[smithy(value_type = "Option<RefundType>")]pub refund_type: Option<RefundType>,/// You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.#[schema(value_type = Option<Object>, example = r#"{ "city": "NY", "unit": "245" }"#)]+ #[smithy(value_type = "Option<Object>")]pub metadata: Option<pii::SecretSerdeValue>,/// Merchant connector details used to make payments.#[schema(value_type = Option<MerchantConnectorDetailsWrap>)]+ #[smithy(value_type = "Option<MerchantConnectorDetailsWrap>")]pub merchant_connector_details: Option<admin::MerchantConnectorDetailsWrap>,/// Charge specific fields for controlling the revert of funds from either platform or connected account#[schema(value_type = Option<SplitRefund>)]+ #[smithy(value_type = "Option<SplitRefund>")]pub split_refunds: Option<common_types::refunds::SplitRefund>,}@@ -169,17 +180,20 @@ pub struct RefundsRetrieveRequest {pub merchant_connector_details: Option<common_types::domain::MerchantConnectorAuthDetails>,}-#[derive(Default, Debug, ToSchema, Clone, Deserialize, Serialize)]+#[derive(Default, Debug, ToSchema, Clone, Deserialize, Serialize, SmithyModel)]#[serde(deny_unknown_fields)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct RefundUpdateRequest {#[serde(skip)]pub refund_id: String,/// An arbitrary string attached to the object. Often useful for displaying to users and your customer support executive#[schema(max_length = 255, example = "Customer returned the product")]+ #[smithy(value_type = "Option<String>")]pub reason: Option<String>,/// You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.#[schema(value_type = Option<Object>, example = r#"{ "city": "NY", "unit": "245" }"#)]+ #[smithy(value_type = "Option<Object>")]pub metadata: Option<pii::SecretSerdeValue>,}@@ -215,9 +229,20 @@ pub struct RefundManualUpdateRequest {#[cfg(feature = "v1")]/// To indicate whether to refund needs to be instant or scheduled#[derive(- Default, Debug, Clone, Copy, ToSchema, Deserialize, Serialize, Eq, PartialEq, strum::Display,+ Default,+ Debug,+ Clone,+ Copy,+ ToSchema,+ Deserialize,+ Serialize,+ Eq,+ PartialEq,+ strum::Display,+ SmithyModel,)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum RefundType {Scheduled,#[default]@@ -237,54 +262,74 @@ pub enum RefundType {}#[cfg(feature = "v1")]-#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize, ToSchema)]+#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize, ToSchema, SmithyModel)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct RefundResponse {/// Unique Identifier for the refund+ #[smithy(value_type = "String")]pub refund_id: String,/// The payment id against which refund is initiated#[schema(value_type = String)]+ #[smithy(value_type = "String")]pub payment_id: common_utils::id_type::PaymentId,/// The refund amount, which should be less than or equal to the total payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc#[schema(value_type = i64 , minimum = 100, example = 6540)]+ #[smithy(value_type = "i64")]pub amount: MinorUnit,/// The three-letter ISO currency code+ #[smithy(value_type = "String")]pub currency: String,/// The status for refund+ #[smithy(value_type = "RefundStatus")]pub status: RefundStatus,/// An arbitrary string attached to the object. Often useful for displaying to users and your customer support executive+ #[smithy(value_type = "Option<String>")]pub reason: Option<String>,/// You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object#[schema(value_type = Option<Object>)]+ #[smithy(value_type = "Option<Object>")]pub metadata: Option<pii::SecretSerdeValue>,/// The error message+ #[smithy(value_type = "Option<String>")]pub error_message: Option<String>,/// The code for the error+ #[smithy(value_type = "Option<String>")]pub error_code: Option<String>,/// Error code unified across the connectors is received here if there was an error while calling connector+ #[smithy(value_type = "Option<String>")]pub unified_code: Option<String>,/// Error message unified across the connectors is received here if there was an error while calling connector+ #[smithy(value_type = "Option<String>")]pub unified_message: Option<String>,/// The timestamp at which refund is created#[serde(with = "common_utils::custom_serde::iso8601::option")]+ #[smithy(value_type = "Option<String>")]pub created_at: Option<PrimitiveDateTime>,/// The timestamp at which refund is updated#[serde(with = "common_utils::custom_serde::iso8601::option")]+ #[smithy(value_type = "Option<String>")]pub updated_at: Option<PrimitiveDateTime>,/// The connector used for the refund and the corresponding payment#[schema(example = "stripe")]+ #[smithy(value_type = "String")]pub connector: String,/// The id of business profile for this refund#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]pub profile_id: Option<common_utils::id_type::ProfileId>,/// The merchant_connector_id of the processor through which this payment went through#[schema(value_type = Option<String>)]+ #[smithy(value_type = "Option<String>")]pub merchant_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,/// Charge specific fields for controlling the revert of funds from either platform or connected account#[schema(value_type = Option<SplitRefund>,)]+ #[smithy(value_type = "Option<SplitRefund>")]pub split_refunds: Option<common_types::refunds::SplitRefund>,/// Error code received from the issuer in case of failed refunds+ #[smithy(value_type = "Option<String>")]pub issuer_error_code: Option<String>,/// Error message received from the issuer in case of failed refunds+ #[smithy(value_type = "Option<String>")]pub issuer_error_message: Option<String>,}@@ -475,8 +520,10 @@ pub struct RefundAggregateResponse {ToSchema,strum::Display,strum::EnumIter,+ SmithyModel,)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum RefundStatus {Succeeded,Failed,diff --git a/crates/common_enums/Cargo.toml b/crates/common_enums/Cargo.tomlindex 32d267b788..38316e2db9 100644--- a/crates/common_enums/Cargo.toml+++ b/crates/common_enums/Cargo.toml@@ -24,6 +24,8 @@ utoipa = { version = "4.2.3", features = ["preserve_order", "preserve_path_order# First party cratesrouter_derive = { version = "0.1.0", path = "../router_derive" }masking = { version = "0.1.0", path = "../masking" }+smithy = { version = "0.1.0", path = "../smithy" }+smithy-core = { version = "0.1.0", path = "../smithy-core" }[dev-dependencies]serde_json = "1.0.140"diff --git a/crates/common_enums/src/connector_enums.rs b/crates/common_enums/src/connector_enums.rsindex 7bb9cbeb3e..f3450134e0 100644--- a/crates/common_enums/src/connector_enums.rs+++ b/crates/common_enums/src/connector_enums.rs@@ -1,5 +1,6 @@use std::collections::HashSet;+use smithy::SmithyModel;use utoipa::ToSchema;pub use super::enums::{PaymentMethod, PayoutType};@@ -198,10 +199,12 @@ pub enum RoutableConnectors {strum::Display,strum::EnumString,Hash,+ SmithyModel,)]#[router_derive::diesel_enum(storage_type = "text")]#[serde(rename_all = "snake_case")]#[strum(serialize_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum Connector {Authipay,Adyenplatform,diff --git a/crates/common_enums/src/enums.rs b/crates/common_enums/src/enums.rsindex 1983cf5925..59b8944096 100644--- a/crates/common_enums/src/enums.rs+++ b/crates/common_enums/src/enums.rs@@ -11,6 +11,7 @@ pub use accounts::{};pub use payments::ProductType;use serde::{Deserialize, Serialize};+use smithy::SmithyModel;pub use ui::*;use utoipa::ToSchema;@@ -122,6 +123,7 @@ impl From<std::io::Error> for ApplicationError {PartialEq,serde::Deserialize,serde::Serialize,+ SmithyModel,strum::Display,strum::EnumString,ToSchema,@@ -129,6 +131,7 @@ impl From<std::io::Error> for ApplicationError {#[router_derive::diesel_enum(storage_type = "db_enum")]#[serde(rename_all = "snake_case")]#[strum(serialize_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum AttemptStatus {Started,AuthenticationFailed,@@ -235,6 +238,7 @@ pub enum ApplePayPaymentMethodType {PartialEq,serde::Deserialize,serde::Serialize,+ SmithyModel,strum::Display,strum::EnumString,strum::EnumIter,@@ -243,6 +247,7 @@ pub enum ApplePayPaymentMethodType {#[router_derive::diesel_enum(storage_type = "db_enum")]#[serde(rename_all = "snake_case")]#[strum(serialize_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum CardDiscovery {#[default]Manual,@@ -331,6 +336,7 @@ pub enum GsmFeature {PartialEq,serde::Deserialize,serde::Serialize,+ SmithyModel,strum::Display,strum::VariantNames,strum::EnumIter,@@ -340,6 +346,7 @@ pub enum GsmFeature {#[router_derive::diesel_enum(storage_type = "db_enum")]#[serde(rename_all = "snake_case")]#[strum(serialize_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum AuthenticationType {/// If the card is enrolled for 3DS authentication, the 3DS based authentication will be activated. The liability of chargeback shift to the issuerThreeDs,@@ -387,6 +394,7 @@ pub enum FraudCheckStatus {PartialEq,serde::Deserialize,serde::Serialize,+ SmithyModel,strum::Display,strum::EnumString,ToSchema,@@ -395,6 +403,7 @@ pub enum FraudCheckStatus {#[router_derive::diesel_enum(storage_type = "db_enum")]#[serde(rename_all = "snake_case")]#[strum(serialize_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum CaptureStatus {// Capture request initiated#[default]@@ -415,6 +424,7 @@ pub enum CaptureStatus {PartialEq,serde::Deserialize,serde::Serialize,+ SmithyModel,strum::Display,strum::EnumString,ToSchema,@@ -423,6 +433,7 @@ pub enum CaptureStatus {#[router_derive::diesel_enum(storage_type = "text")]#[serde(rename_all = "snake_case")]#[strum(serialize_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum AuthorizationStatus {Success,Failure,@@ -493,6 +504,7 @@ pub enum BlocklistDataKind {PartialEq,serde::Deserialize,serde::Serialize,+ SmithyModel,strum::Display,strum::VariantNames,strum::EnumIter,@@ -502,6 +514,7 @@ pub enum BlocklistDataKind {#[router_derive::diesel_enum(storage_type = "db_enum")]#[serde(rename_all = "snake_case")]#[strum(serialize_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum CaptureMethod {/// Post the payment authorization, the capture will be executed on the full amount immediately.#[default]@@ -592,6 +605,7 @@ pub enum CallConnectorAction {PartialEq,serde::Deserialize,serde::Serialize,+ SmithyModel,strum::Display,strum::VariantNames,strum::EnumIter,@@ -599,6 +613,7 @@ pub enum CallConnectorAction {ToSchema,)]#[serde(rename_all = "UPPERCASE")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum DocumentKind {Cnpj,Cpf,@@ -621,8 +636,10 @@ pub enum DocumentKind {strum::EnumIter,strum::VariantNames,ToSchema,+ SmithyModel,)]#[router_derive::diesel_enum(storage_type = "db_enum")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum Currency {AED,AFN,@@ -1732,6 +1749,7 @@ pub enum MerchantStorageScheme {ToSchema,serde::Deserialize,serde::Serialize,+ SmithyModel,strum::Display,strum::EnumIter,strum::EnumString,@@ -1739,6 +1757,7 @@ pub enum MerchantStorageScheme {#[router_derive::diesel_enum(storage_type = "db_enum")]#[serde(rename_all = "snake_case")]#[strum(serialize_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum IntentStatus {/// The payment has succeeded. Refunds and disputes can be initiated./// Manual retries are not allowed to be performed.@@ -1834,6 +1853,7 @@ impl IntentStatus {PartialEq,serde::Deserialize,serde::Serialize,+ SmithyModel,strum::Display,strum::VariantNames,strum::EnumIter,@@ -1843,6 +1863,7 @@ impl IntentStatus {#[router_derive::diesel_enum(storage_type = "db_enum")]#[serde(rename_all = "snake_case")]#[strum(serialize_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum FutureUsage {OffSession,#[default]@@ -1898,6 +1919,7 @@ pub enum PaymentMethodIssuerCode {Hash,serde::Serialize,serde::Deserialize,+ SmithyModel,strum::Display,strum::EnumString,ToSchema,@@ -1905,6 +1927,7 @@ pub enum PaymentMethodIssuerCode {#[router_derive::diesel_enum(storage_type = "text")]#[strum(serialize_all = "snake_case")]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum PaymentMethodStatus {/// Indicates that the payment method is active and can be used for payments.Active,@@ -1965,10 +1988,12 @@ impl From<AttemptStatus> for PaymentMethodStatus {strum::Display,ToSchema,Default,+ SmithyModel,)]#[router_derive::diesel_enum(storage_type = "text")]#[strum(serialize_all = "snake_case")]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum PaymentExperience {/// The URL to which the customer needs to be redirected for completing the payment.#[default]@@ -2011,6 +2036,7 @@ pub enum SamsungPayCardBrand {PartialEq,serde::Deserialize,serde::Serialize,+ SmithyModel,strum::Display,strum::VariantNames,strum::EnumIter,@@ -2020,6 +2046,7 @@ pub enum SamsungPayCardBrand {#[router_derive::diesel_enum(storage_type = "text")]#[serde(rename_all = "snake_case")]#[strum(serialize_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum PaymentMethodType {Ach,Affirm,@@ -2282,6 +2309,7 @@ impl masking::SerializableSecret for PaymentMethodType {}PartialEq,serde::Deserialize,serde::Serialize,+ SmithyModel,strum::Display,strum::VariantNames,strum::EnumIter,@@ -2291,6 +2319,7 @@ impl masking::SerializableSecret for PaymentMethodType {}#[router_derive::diesel_enum(storage_type = "text")]#[serde(rename_all = "snake_case")]#[strum(serialize_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum PaymentMethod {#[default]Card,@@ -2478,6 +2507,7 @@ pub enum ConnectorIntegrationType {PartialEq,serde::Deserialize,serde::Serialize,+ SmithyModel,strum::Display,strum::EnumString,ToSchema,@@ -2485,6 +2515,7 @@ pub enum ConnectorIntegrationType {#[router_derive::diesel_enum(storage_type = "db_enum")]#[serde(rename_all = "snake_case")]#[strum(serialize_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum PaymentType {#[default]Normal,@@ -2503,6 +2534,7 @@ pub enum PaymentType {PartialEq,serde::Deserialize,serde::Serialize,+ SmithyModel,strum::Display,strum::EnumString,ToSchema,@@ -2510,6 +2542,7 @@ pub enum PaymentType {#[router_derive::diesel_enum(storage_type = "db_enum")]#[serde(rename_all = "snake_case")]#[strum(serialize_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum ScaExemptionType {#[default]LowValue,@@ -2527,6 +2560,7 @@ pub enum ScaExemptionType {PartialEq,serde::Deserialize,serde::Serialize,+ SmithyModel,strum::Display,strum::VariantNames,strum::EnumIter,@@ -2536,6 +2570,7 @@ pub enum ScaExemptionType {#[router_derive::diesel_enum(storage_type = "text")]#[serde(rename_all = "snake_case")]#[strum(serialize_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]/// Describes the channel through which the payment was initiated.pub enum PaymentChannel {#[default]@@ -2558,10 +2593,12 @@ pub enum PaymentChannel {strum::Display,strum::EnumString,ToSchema,+ SmithyModel,)]#[router_derive::diesel_enum(storage_type = "text")]#[serde(rename_all = "snake_case")]#[strum(serialize_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum CtpServiceProvider {#[strum(serialize = "ctp_visa")]Visa,@@ -2704,6 +2741,7 @@ pub enum MandateStatus {PartialEq,serde::Deserialize,serde::Serialize,+ SmithyModel,strum::Display,strum::VariantNames,strum::EnumIter,@@ -2711,6 +2749,7 @@ pub enum MandateStatus {ToSchema,)]#[router_derive::diesel_enum(storage_type = "text")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum CardNetwork {#[serde(alias = "VISA")]Visa,@@ -2871,6 +2910,7 @@ impl CardNetwork {PartialEq,serde::Deserialize,serde::Serialize,+ SmithyModel,strum::Display,strum::EnumIter,strum::EnumString,@@ -2879,6 +2919,7 @@ impl CardNetwork {#[router_derive::diesel_enum(storage_type = "db_enum")]#[serde(rename_all = "snake_case")]#[strum(serialize_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum DisputeStage {PreDispute,#[default]@@ -2899,6 +2940,7 @@ pub enum DisputeStage {PartialEq,serde::Deserialize,serde::Serialize,+ SmithyModel,strum::Display,strum::EnumString,strum::EnumIter,@@ -2907,6 +2949,7 @@ pub enum DisputeStage {#[router_derive::diesel_enum(storage_type = "db_enum")]#[serde(rename_all = "snake_case")]#[strum(serialize_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum DisputeStatus {#[default]DisputeOpened,@@ -3025,10 +3068,12 @@ pub struct MerchantCategoryCodeWithName {strum::EnumIter,strum::EnumString,utoipa::ToSchema,- Copy+ Copy,+ SmithyModel,)]#[router_derive::diesel_enum(storage_type = "db_enum")]#[rustfmt::skip]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum CountryAlpha2 {AF, AX, AL, DZ, AS, AD, AO, AI, AQ, AG, AR, AM, AW, AU, AT,AZ, BS, BH, BD, BB, BY, BE, BZ, BJ, BM, BT, BO, BQ, BA, BW,@@ -8212,6 +8257,7 @@ pub enum MerchantDecision {PartialEq,serde::Serialize,serde::Deserialize,+ SmithyModel,strum::Display,strum::EnumString,strum::EnumIter,@@ -8220,6 +8266,7 @@ pub enum MerchantDecision {#[router_derive::diesel_enum(storage_type = "text")]#[serde(rename_all = "snake_case")]#[strum(serialize_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum TaxStatus {Taxable,Exempt,@@ -8362,6 +8409,7 @@ pub enum VaultSdk {PartialEq,serde::Deserialize,serde::Serialize,+ SmithyModel,strum::Display,strum::EnumString,utoipa::ToSchema,@@ -8370,6 +8418,7 @@ pub enum VaultSdk {#[router_derive::diesel_enum(storage_type = "text")]#[serde(rename_all = "snake_case")]#[strum(serialize_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum AuthenticationStatus {#[default]Started,@@ -8404,6 +8453,7 @@ impl AuthenticationStatus {PartialEq,serde::Deserialize,serde::Serialize,+ SmithyModel,strum::Display,strum::EnumString,utoipa::ToSchema,@@ -8412,6 +8462,7 @@ impl AuthenticationStatus {#[router_derive::diesel_enum(storage_type = "text")]#[serde(rename_all = "snake_case")]#[strum(serialize_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum DecoupledAuthenticationType {#[default]Challenge,@@ -8684,12 +8735,14 @@ pub enum PermissionScope {PartialEq,serde::Deserialize,serde::Serialize,+ SmithyModel,strum::Display,strum::EnumString,ToSchema,)]#[strum(serialize_all = "snake_case")]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum BankNames {AmericanExpress,AffinBank,@@ -8847,12 +8900,14 @@ pub enum BankNames {PartialEq,serde::Deserialize,serde::Serialize,+ SmithyModel,strum::Display,strum::EnumString,ToSchema,)]#[strum(serialize_all = "snake_case")]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum BankType {Checking,Savings,@@ -8866,12 +8921,14 @@ pub enum BankType {PartialEq,serde::Deserialize,serde::Serialize,+ SmithyModel,strum::Display,strum::EnumString,ToSchema,)]#[strum(serialize_all = "snake_case")]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum BankHolderType {Personal,Business,@@ -9327,9 +9384,12 @@ impl ErrorCategory {strum::EnumString,ToSchema,Hash,+ SmithyModel,)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum PaymentChargeType {#[serde(untagged)]+ #[smithy(value_type = "StripeChargeType")]Stripe(StripeChargeType),}@@ -9345,9 +9405,11 @@ pub enum PaymentChargeType {serde::Deserialize,strum::Display,strum::EnumString,+ SmithyModel,)]#[serde(rename_all = "lowercase")]#[strum(serialize_all = "lowercase")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum StripeChargeType {#[default]Direct,@@ -9495,12 +9557,14 @@ pub enum GooglePayAuthMethod {PartialEq,serde::Deserialize,serde::Serialize,+ SmithyModel,strum::Display,strum::EnumString,ToSchema,)]#[strum(serialize_all = "PascalCase")]#[serde(rename_all = "PascalCase")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum AdyenSplitType {/// Books split amount to the specified account.BalanceAccount,@@ -9572,6 +9636,7 @@ pub enum TriggeredBy {PartialEq,serde::Deserialize,serde::Serialize,+ SmithyModel,strum::Display,strum::EnumString,ToSchema,@@ -9579,6 +9644,7 @@ pub enum TriggeredBy {#[router_derive::diesel_enum(storage_type = "text")]#[serde(rename_all = "snake_case")]#[strum(serialize_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum MitCategory {/// A fixed purchase amount split into multiple scheduled payments until the total is paid.Installment,@@ -9799,8 +9865,11 @@ pub enum ExternalVaultEnabled {Skip,}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "UPPERCASE")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum GooglePayCardFundingSource {Credit,Debit,diff --git a/crates/common_types/Cargo.toml b/crates/common_types/Cargo.tomlindex 61b3ae128e..7892aa7805 100644--- a/crates/common_types/Cargo.toml+++ b/crates/common_types/Cargo.toml@@ -25,6 +25,8 @@ common_utils = { version = "0.1.0", path = "../common_utils"}cards = { version = "0.1.0", path = "../cards"}euclid = { version = "0.1.0", path = "../euclid" }masking = { version = "0.1.0", path = "../masking" }+smithy = { version = "0.1.0", path = "../smithy" }+smithy-core = { version = "0.1.0", path = "../smithy-core" }[lints]workspace = truediff --git a/crates/common_types/src/domain.rs b/crates/common_types/src/domain.rsindex 3836aaabe7..567a5cb213 100644--- a/crates/common_types/src/domain.rs+++ b/crates/common_types/src/domain.rs@@ -8,52 +8,91 @@ use diesel::{sql_types::Jsonb, AsExpression, FromSqlRow};#[cfg(feature = "v2")]use masking::Secret;use serde::{Deserialize, Serialize};+use smithy::SmithyModel;use utoipa::ToSchema;#[derive(- Serialize, Deserialize, Debug, Clone, PartialEq, Eq, FromSqlRow, AsExpression, ToSchema,+ Serialize,+ Deserialize,+ Debug,+ Clone,+ PartialEq,+ Eq,+ FromSqlRow,+ AsExpression,+ ToSchema,+ SmithyModel,)]#[diesel(sql_type = Jsonb)]#[serde(deny_unknown_fields)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]/// Fee information for Split Payments to be charged on the payment being collected for Adyenpub struct AdyenSplitData {/// The store identifier+ #[smithy(value_type = "Option<String>")]pub store: Option<String>,/// Data for the split items+ #[smithy(value_type = "Vec<AdyenSplitItem>")]pub split_items: Vec<AdyenSplitItem>,}impl_to_sql_from_sql_json!(AdyenSplitData);#[derive(- Serialize, Deserialize, Debug, Clone, PartialEq, Eq, FromSqlRow, AsExpression, ToSchema,+ Serialize,+ Deserialize,+ Debug,+ Clone,+ PartialEq,+ Eq,+ FromSqlRow,+ AsExpression,+ ToSchema,+ SmithyModel,)]#[diesel(sql_type = Jsonb)]#[serde(deny_unknown_fields)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]/// Data for the split itemspub struct AdyenSplitItem {/// The amount of the split item#[schema(value_type = i64, example = 6540)]+ #[smithy(value_type = "Option<i64>")]pub amount: Option<MinorUnit>,/// Defines type of split item#[schema(value_type = AdyenSplitType, example = "BalanceAccount")]+ #[smithy(value_type = "AdyenSplitType")]pub split_type: enums::AdyenSplitType,/// The unique identifier of the account to which the split amount is allocated.+ #[smithy(value_type = "Option<String>")]pub account: Option<String>,/// Unique Identifier for the split item+ #[smithy(value_type = "String")]pub reference: String,/// Description for the part of the payment that will be allocated to the specified account.+ #[smithy(value_type = "Option<String>")]pub description: Option<String>,}impl_to_sql_from_sql_json!(AdyenSplitItem);/// Fee information to be charged on the payment being collected for sub-merchant via xendit#[derive(- Serialize, Deserialize, Debug, Clone, PartialEq, Eq, FromSqlRow, AsExpression, ToSchema,+ Serialize,+ Deserialize,+ Debug,+ Clone,+ PartialEq,+ Eq,+ FromSqlRow,+ AsExpression,+ ToSchema,+ SmithyModel,)]#[diesel(sql_type = Jsonb)]#[serde(deny_unknown_fields)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct XenditSplitSubMerchantData {/// The sub-account user-id that you want to make this transaction for.+ #[smithy(value_type = "String")]pub for_user_id: String,}impl_to_sql_from_sql_json!(XenditSplitSubMerchantData);diff --git a/crates/common_types/src/payments.rs b/crates/common_types/src/payments.rsindex 850c650536..2627b895ef 100644--- a/crates/common_types/src/payments.rs+++ b/crates/common_types/src/payments.rs@@ -18,43 +18,70 @@ use euclid::frontend::{};use masking::{ExposeInterface, PeekInterface, Secret};use serde::{Deserialize, Serialize};+use smithy::SmithyModel;use time::PrimitiveDateTime;use utoipa::ToSchema;use crate::domain::{AdyenSplitData, XenditSplitSubMerchantData};#[derive(- Serialize, Deserialize, Debug, Clone, PartialEq, Eq, FromSqlRow, AsExpression, ToSchema,+ Serialize,+ Deserialize,+ Debug,+ Clone,+ PartialEq,+ Eq,+ FromSqlRow,+ AsExpression,+ ToSchema,+ SmithyModel,)]#[diesel(sql_type = Jsonb)]#[serde(rename_all = "snake_case")]#[serde(deny_unknown_fields)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]/// Fee information for Split Payments to be charged on the payment being collectedpub enum SplitPaymentsRequest {/// StripeSplitPayment+ #[smithy(value_type = "StripeSplitPaymentRequest")]StripeSplitPayment(StripeSplitPaymentRequest),/// AdyenSplitPayment+ #[smithy(value_type = "AdyenSplitData")]AdyenSplitPayment(AdyenSplitData),/// XenditSplitPayment+ #[smithy(value_type = "XenditSplitRequest")]XenditSplitPayment(XenditSplitRequest),}impl_to_sql_from_sql_json!(SplitPaymentsRequest);#[derive(- Serialize, Deserialize, Debug, Clone, PartialEq, Eq, FromSqlRow, AsExpression, ToSchema,+ Serialize,+ Deserialize,+ Debug,+ Clone,+ PartialEq,+ Eq,+ FromSqlRow,+ AsExpression,+ ToSchema,+ SmithyModel,)]#[diesel(sql_type = Jsonb)]#[serde(deny_unknown_fields)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]/// Fee information for Split Payments to be charged on the payment being collected for Stripepub struct StripeSplitPaymentRequest {/// Stripe's charge type#[schema(value_type = PaymentChargeType, example = "direct")]+ #[smithy(value_type = "PaymentChargeType")]pub charge_type: enums::PaymentChargeType,/// Platform fees to be collected on the payment#[schema(value_type = i64, example = 6540)]+ #[smithy(value_type = "Option<i64>")]pub application_fees: Option<MinorUnit>,/// Identifier for the reseller's account where the funds were transferred+ #[smithy(value_type = "String")]pub transfer_account_id: String,}impl_to_sql_from_sql_json!(StripeSplitPaymentRequest);@@ -184,18 +211,23 @@ impl_to_sql_from_sql_json!(ConditionalConfigs);Clone,AsExpression,ToSchema,+ SmithyModel,)]#[serde(deny_unknown_fields)]#[diesel(sql_type = Jsonb)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct CustomerAcceptance {/// Type of acceptance provided by the#[schema(example = "online")]+ #[smithy(value_type = "AcceptanceType")]pub acceptance_type: AcceptanceType,/// Specifying when the customer acceptance was provided#[schema(example = "2022-09-10T10:11:12Z")]#[serde(default, with = "common_utils::custom_serde::iso8601::option")]+ #[smithy(value_type = "Option<PrimitiveDateTime>")]pub accepted_at: Option<PrimitiveDateTime>,/// Information required for online mandate generation+ #[smithy(value_type = "Option<OnlineMandate>")]pub online: Option<OnlineMandate>,}@@ -223,9 +255,19 @@ impl CustomerAcceptance {impl masking::SerializableSecret for CustomerAcceptance {}#[derive(- Default, Debug, serde::Deserialize, serde::Serialize, PartialEq, Eq, Clone, Copy, ToSchema,+ Default,+ Debug,+ serde::Deserialize,+ serde::Serialize,+ PartialEq,+ Eq,+ Clone,+ Copy,+ ToSchema,+ SmithyModel,)]#[serde(rename_all = "lowercase")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]/// This is used to indicate if the mandate was accepted online or offlinepub enum AcceptanceType {/// Online@@ -245,15 +287,19 @@ pub enum AcceptanceType {AsExpression,Clone,ToSchema,+ SmithyModel,)]#[serde(deny_unknown_fields)]/// Details of online mandate#[diesel(sql_type = Jsonb)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct OnlineMandate {/// Ip address of the customer machine from which the mandate was created#[schema(value_type = String, example = "123.32.25.123")]+ #[smithy(value_type = "String")]pub ip_address: Option<Secret<String, pii::IpAddress>>,/// The user-agent of the customer's browser+ #[smithy(value_type = "String")]pub user_agent: String,}@@ -283,40 +329,67 @@ pub type DecisionManagerResponse = DecisionManagerRecord;/// Fee information to be charged on the payment being collected via Stripe#[derive(- Serialize, Deserialize, Debug, Clone, PartialEq, Eq, FromSqlRow, AsExpression, ToSchema,+ Serialize,+ Deserialize,+ Debug,+ Clone,+ PartialEq,+ Eq,+ FromSqlRow,+ AsExpression,+ ToSchema,+ SmithyModel,)]#[diesel(sql_type = Jsonb)]#[serde(deny_unknown_fields)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct StripeChargeResponseData {/// Identifier for charge created for the payment+ #[smithy(value_type = "Option<String>")]pub charge_id: Option<String>,/// Type of charge (connector specific)#[schema(value_type = PaymentChargeType, example = "direct")]+ #[smithy(value_type = "PaymentChargeType")]pub charge_type: enums::PaymentChargeType,/// Platform fees collected on the payment#[schema(value_type = i64, example = 6540)]+ #[smithy(value_type = "Option<i64>")]pub application_fees: Option<MinorUnit>,/// Identifier for the reseller's account where the funds were transferred+ #[smithy(value_type = "String")]pub transfer_account_id: String,}impl_to_sql_from_sql_json!(StripeChargeResponseData);/// Charge Information#[derive(- Serialize, Deserialize, Debug, Clone, PartialEq, Eq, FromSqlRow, AsExpression, ToSchema,+ Serialize,+ Deserialize,+ Debug,+ Clone,+ PartialEq,+ Eq,+ FromSqlRow,+ AsExpression,+ ToSchema,+ SmithyModel,)]#[diesel(sql_type = Jsonb)]#[serde(rename_all = "snake_case")]#[serde(deny_unknown_fields)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum ConnectorChargeResponseData {/// StripeChargeResponseData+ #[smithy(value_type = "StripeChargeResponseData")]StripeSplitPayment(StripeChargeResponseData),/// AdyenChargeResponseData+ #[smithy(value_type = "AdyenSplitData")]AdyenSplitPayment(AdyenSplitData),/// XenditChargeResponseData+ #[smithy(value_type = "XenditChargeResponseData")]XenditSplitPayment(XenditChargeResponseData),}@@ -324,54 +397,95 @@ impl_to_sql_from_sql_json!(ConnectorChargeResponseData);/// Fee information to be charged on the payment being collected via xendit#[derive(- Serialize, Deserialize, Debug, Clone, PartialEq, Eq, FromSqlRow, AsExpression, ToSchema,+ Serialize,+ Deserialize,+ Debug,+ Clone,+ PartialEq,+ Eq,+ FromSqlRow,+ AsExpression,+ ToSchema,+ SmithyModel,)]#[diesel(sql_type = Jsonb)]#[serde(deny_unknown_fields)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct XenditSplitRoute {/// Amount of payments to be split+ #[smithy(value_type = "Option<i64>")]pub flat_amount: Option<MinorUnit>,/// Amount of payments to be split, using a percent rate as unit+ #[smithy(value_type = "Option<i64>")]pub percent_amount: Option<i64>,/// Currency code#[schema(value_type = Currency, example = "USD")]+ #[smithy(value_type = "Currency")]pub currency: enums::Currency,/// ID of the destination account where the amount will be routed to+ #[smithy(value_type = "String")]pub destination_account_id: String,/// Reference ID which acts as an identifier of the route itself+ #[smithy(value_type = "String")]pub reference_id: String,}impl_to_sql_from_sql_json!(XenditSplitRoute);/// Fee information to be charged on the payment being collected via xendit#[derive(- Serialize, Deserialize, Debug, Clone, PartialEq, Eq, FromSqlRow, AsExpression, ToSchema,+ Serialize,+ Deserialize,+ Debug,+ Clone,+ PartialEq,+ Eq,+ FromSqlRow,+ AsExpression,+ ToSchema,+ SmithyModel,)]#[diesel(sql_type = Jsonb)]#[serde(deny_unknown_fields)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct XenditMultipleSplitRequest {/// Name to identify split rule. Not required to be unique. Typically based on transaction and/or sub-merchant types.+ #[smithy(value_type = "String")]pub name: String,/// Description to identify fee rule+ #[smithy(value_type = "String")]pub description: String,/// The sub-account user-id that you want to make this transaction for.+ #[smithy(value_type = "Option<String>")]pub for_user_id: Option<String>,/// Array of objects that define how the platform wants to route the fees and to which accounts.+ #[smithy(value_type = "Vec<XenditSplitRoute>")]pub routes: Vec<XenditSplitRoute>,}impl_to_sql_from_sql_json!(XenditMultipleSplitRequest);/// Xendit Charge Request#[derive(- Serialize, Deserialize, Debug, Clone, PartialEq, Eq, FromSqlRow, AsExpression, ToSchema,+ Serialize,+ Deserialize,+ Debug,+ Clone,+ PartialEq,+ Eq,+ FromSqlRow,+ AsExpression,+ ToSchema,+ SmithyModel,)]#[diesel(sql_type = Jsonb)]#[serde(rename_all = "snake_case")]#[serde(deny_unknown_fields)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum XenditSplitRequest {/// Split Between Multiple Accounts+ #[smithy(value_type = "XenditMultipleSplitRequest")]MultipleSplits(XenditMultipleSplitRequest),/// Collect Fee for Single Account+ #[smithy(value_type = "XenditSplitSubMerchantData")]SingleSplit(XenditSplitSubMerchantData),}@@ -379,15 +493,27 @@ impl_to_sql_from_sql_json!(XenditSplitRequest);/// Charge Information#[derive(- Serialize, Deserialize, Debug, Clone, PartialEq, Eq, FromSqlRow, AsExpression, ToSchema,+ Serialize,+ Deserialize,+ Debug,+ Clone,+ PartialEq,+ Eq,+ FromSqlRow,+ AsExpression,+ ToSchema,+ SmithyModel,)]#[diesel(sql_type = Jsonb)]#[serde(rename_all = "snake_case")]#[serde(deny_unknown_fields)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub enum XenditChargeResponseData {/// Split Between Multiple Accounts+ #[smithy(value_type = "XenditMultipleSplitResponse")]MultipleSplits(XenditMultipleSplitResponse),/// Collect Fee for Single Account+ #[smithy(value_type = "XenditSplitSubMerchantData")]SingleSplit(XenditSplitSubMerchantData),}@@ -395,67 +521,100 @@ impl_to_sql_from_sql_json!(XenditChargeResponseData);/// Fee information charged on the payment being collected via xendit#[derive(- Serialize, Deserialize, Debug, Clone, PartialEq, Eq, FromSqlRow, AsExpression, ToSchema,+ Serialize,+ Deserialize,+ Debug,+ Clone,+ PartialEq,+ Eq,+ FromSqlRow,+ AsExpression,+ ToSchema,+ SmithyModel,)]#[diesel(sql_type = Jsonb)]#[serde(deny_unknown_fields)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]pub struct XenditMultipleSplitResponse {/// Identifier for split rule created for the payment+ #[smithy(value_type = "String")]pub split_rule_id: String,/// The sub-account user-id that you want to make this transaction for.+ #[smithy(value_type = "Option<String>")]pub for_user_id: Option<String>,/// Name to identify split rule. Not required to be unique. Typically based on transaction and/or sub-merchant types.+ #[smithy(value_type = "String")]pub name: String,/// Description to identify fee rule+ #[smithy(value_type = "String")]pub description: String,/// Array of objects that define how the platform wants to route the fees and to which accounts.+ #[smithy(value_type = "Vec<XenditSplitRoute>")]pub routes: Vec<XenditSplitRoute>,}impl_to_sql_from_sql_json!(XenditMultipleSplitResponse);-#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]#[serde(untagged)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]/// This enum is used to represent the Gpay payment data, which can either be encrypted or decrypted.pub enum GpayTokenizationData {/// This variant contains the decrypted Gpay payment data as a structured object.+ #[smithy(value_type = "GPayPredecryptData")]Decrypted(GPayPredecryptData),/// This variant contains the encrypted Gpay payment data as a string.+ #[smithy(value_type = "GpayEcryptedTokenizationData")]Encrypted(GpayEcryptedTokenizationData),}-#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]/// This struct represents the encrypted Gpay payment datapub struct GpayEcryptedTokenizationData {/// The type of the token#[serde(rename = "type")]+ #[smithy(value_type = "String")]pub token_type: String,/// Token generated for the wallet+ #[smithy(value_type = "String")]pub token: String,}-#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]/// This struct represents the decrypted Google Pay payment datapub struct GPayPredecryptData {/// The card's expiry month#[schema(value_type = String)]+ #[smithy(value_type = "String")]pub card_exp_month: Secret<String>,/// The card's expiry year#[schema(value_type = String)]+ #[smithy(value_type = "String")]pub card_exp_year: Secret<String>,/// The Primary Account Number (PAN) of the card#[schema(value_type = String, example = "4242424242424242")]+ #[smithy(value_type = "String")]pub application_primary_account_number: cards::CardNumber,/// Cryptogram generated by the Network#[schema(value_type = String, example = "AgAAAAAAAIR8CQrXcIhbQAAAAAA")]+ #[smithy(value_type = "Option<String>")]pub cryptogram: Option<Secret<String>>,/// Electronic Commerce Indicator#[schema(value_type = String, example = "07")]+ #[smithy(value_type = "Option<String>")]pub eci_indicator: Option<String>,}impl GpayTokenizationData {@@ -545,44 +704,61 @@ impl GPayPredecryptData {Ok(self.card_exp_month.clone())}}-#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]#[serde(untagged)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]/// This enum is used to represent the Apple Pay payment data, which can either be encrypted or decrypted.pub enum ApplePayPaymentData {/// This variant contains the decrypted Apple Pay payment data as a structured object.+ #[smithy(value_type = "ApplePayPredecryptData")]Decrypted(ApplePayPredecryptData),/// This variant contains the encrypted Apple Pay payment data as a string.+ #[smithy(value_type = "String")]Encrypted(String),}-#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]/// This struct represents the decrypted Apple Pay payment datapub struct ApplePayPredecryptData {/// The primary account number#[schema(value_type = String, example = "4242424242424242")]+ #[smithy(value_type = "String")]pub application_primary_account_number: cards::CardNumber,/// The application expiration date (PAN expiry month)#[schema(value_type = String, example = "12")]+ #[smithy(value_type = "String")]pub application_expiration_month: Secret<String>,/// The application expiration date (PAN expiry year)#[schema(value_type = String, example = "24")]+ #[smithy(value_type = "String")]pub application_expiration_year: Secret<String>,/// The payment data, which contains the cryptogram and ECI indicator#[schema(value_type = ApplePayCryptogramData)]+ #[smithy(value_type = "ApplePayCryptogramData")]pub payment_data: ApplePayCryptogramData,}-#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]+#[derive(+ Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema, SmithyModel,+)]#[serde(rename_all = "snake_case")]+#[smithy(namespace = "com.hyperswitch.smithy.types")]/// This struct represents the cryptogram data for Apple Pay transactionspub struct ApplePayCryptogramData {/// The online payment cryptogram#[schema(value_type = String, example = "A1B2C3D4E5F6G7H8")]+ #[smithy(value_type = "String")]pub online_payment_cryptogram: Secret<String>,/// The ECI (Electronic Commerce Indicator) value#[schema(value_type = String, example = "05")]+ #[smithy(value_type = "Option<String>")]pub eci_indicator: Option<String>,}diff --git a/crates/common_types/src/refunds.rs b/crates/common_types/src/refunds.rsindex f7c12f90f8..2b98637657 100644--- a/crates/common_types/src/refunds.rs+++ b/crates/common_types/src/refunds.rs@@ -3,40 +3,66 @@use common_utils::impl_to_sql_from_sql_json;use diesel::{sql_types::Jsonb, AsExpression, FromSqlRow};use serde::{Deserialize, Serialize};+use smithy::SmithyModel;use utoipa::ToSchema;use crate::domain::{AdyenSplitData, XenditSplitSubMerchantData};#[derive(- Serialize, Deserialize, Debug, Clone, PartialEq, Eq, FromSqlRow, AsExpression, ToSchema,+ Serialize,+ Deserialize,+ Debug,+ Clone,+ PartialEq,+ Eq,+ FromSqlRow,+ AsExpression,+ ToSchema,+ SmithyModel,)]#[diesel(sql_type = Jsonb)]#[serde(rename_all = "snake_case")]#[serde(deny_unknown_fields)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]/// Charge specific fields for controlling the revert of funds from either platform or connected account. Check sub-fields for more details.pub enum SplitRefund {/// StripeSplitRefundRequest+ #[smithy(value_type = "StripeSplitRefundRequest")]StripeSplitRefund(StripeSplitRefundRequest),/// AdyenSplitRefundRequest+ #[smithy(value_type = "AdyenSplitData")]AdyenSplitRefund(AdyenSplitData),/// XenditSplitRefundRequest+ #[smithy(value_type = "XenditSplitSubMerchantData")]XenditSplitRefund(XenditSplitSubMerchantData),}impl_to_sql_from_sql_json!(SplitRefund);#[derive(- Serialize, Deserialize, Debug, Clone, PartialEq, Eq, FromSqlRow, AsExpression, ToSchema,+ Serialize,+ Deserialize,+ Debug,+ Clone,+ PartialEq,+ Eq,+ FromSqlRow,+ AsExpression,+ ToSchema,+ SmithyModel,)]#[diesel(sql_type = Jsonb)]#[serde(deny_unknown_fields)]+#[smithy(namespace = "com.hyperswitch.smithy.types")]/// Charge specific fields for controlling the revert of funds from either platform or connected account for Stripe. Check sub-fields for more details.pub struct StripeSplitRefundRequest {/// Toggle for reverting the application fee that was collected for the payment./// If set to false, the funds are pulled from the destination account.+ #[smithy(value_type = "Option<bool>")]pub revert_platform_fee: Option<bool>,/// Toggle for reverting the transfer that was made during the charge./// If set to false, the funds are pulled from the main platform's account.+ #[smithy(value_type = "Option<bool>")]pub revert_transfer: Option<bool>,}impl_to_sql_from_sql_json!(StripeSplitRefundRequest);diff --git a/crates/smithy-core/src/generator.rs b/crates/smithy-core/src/generator.rsindex 34abb2fd40..7d15e637a4 100644--- a/crates/smithy-core/src/generator.rs+++ b/crates/smithy-core/src/generator.rs@@ -170,6 +170,11 @@ impl SmithyGenerator {if let Some(doc) = &enum_value.documentation {def.push_str(&format!(" /// {}\n", doc));}++ for smithy_trait in &enum_value.traits {+ def.push_str(&format!(" @{}\n", self.trait_to_string(smithy_trait)));+ }+def.push_str(&format!(" {}\n", value_name));}@@ -285,6 +290,12 @@ impl SmithyGenerator {format!("httpQuery(\"{}\")", name)}types::SmithyTrait::Mixin => "mixin".to_string(),+ types::SmithyTrait::JsonName { name } => {+ format!("jsonName(\"{}\")", name)+ }+ types::SmithyTrait::EnumValue { value } => {+ format!("enumValue(\"{}\")", value)+ }}}}diff --git a/crates/smithy-core/src/types.rs b/crates/smithy-core/src/types.rsindex fc2db45a52..921f9659a2 100644--- a/crates/smithy-core/src/types.rs+++ b/crates/smithy-core/src/types.rs@@ -80,6 +80,8 @@ pub struct SmithyEnumValue {#[serde(skip_serializing_if = "Option::is_none")]pub documentation: Option<String>,pub is_default: bool,+ #[serde(skip_serializing_if = "Vec::is_empty")]+ pub traits: Vec<SmithyTrait>,}#[derive(Debug, Clone, Serialize, Deserialize)]@@ -101,6 +103,10 @@ pub enum SmithyTrait {HttpQuery { name: String },#[serde(rename = "smithy.api#mixin")]Mixin,+ #[serde(rename = "smithy.api#jsonName")]+ JsonName { name: String },+ #[serde(rename = "smithy.api#enumValue")]+ EnumValue { value: String },}#[derive(Debug, Clone)]@@ -119,6 +125,8 @@ pub struct SmithyEnumVariant {pub fields: Vec<SmithyField>,pub constraints: Vec<SmithyConstraint>,pub documentation: Option<String>,+ pub nested_value_type: bool,+ pub value_type: Option<String>,}#[derive(Debug, Clone)]@@ -129,6 +137,8 @@ pub enum SmithyConstraint {Required,HttpLabel,HttpQuery(String),+ JsonName(String),+ EnumValue(String),}pub trait SmithyModelGenerator {@@ -148,7 +158,7 @@ pub fn resolve_type_and_generate_shapes(let target_type = match value_type {"String" | "str" => "smithy.api#String".to_string(),"i8" | "i16" | "i32" | "u8" | "u16" | "u32" => "smithy.api#Integer".to_string(),- "i64" | "u64" | "isize" | "usize" => "smithy.api#Long".to_string(),+ "i64" | "u64" | "i128" | "isize" | "usize" => "smithy.api#Long".to_string(),"f32" => "smithy.api#Float".to_string(),"f64" => "smithy.api#Double".to_string(),"bool" => "smithy.api#Boolean".to_string(),diff --git a/crates/smithy-generator/build.rs b/crates/smithy-generator/build.rsindex 9d03af4d54..b339e72172 100644--- a/crates/smithy-generator/build.rs+++ b/crates/smithy-generator/build.rs@@ -1,17 +1,22 @@// crates/smithy-generator/build.rs-use std::{fs, path::Path};+use std::{collections::HashSet, fs, path::Path};use regex::Regex;fn main() -> Result<(), Box<dyn std::error::Error>> {- println!("cargo:rerun-if-changed=../");run_build()}fn run_build() -> Result<(), Box<dyn std::error::Error>> {let workspace_root = get_workspace_root()?;+ // Detect enabled features for this build+ let enabled_features = detect_enabled_features();++ // Create feature resolver to map smithy-generator features to dependency features+ let feature_resolver = FeatureResolver::new(&enabled_features);+let mut smithy_models = Vec::new();// Scan all crates in the workspace for SmithyModel derives@@ -23,10 +28,6 @@ fn run_build() -> Result<(), Box<dyn std::error::Error>> {let crate_name = match crate_path.file_name() {Some(name) => name.to_string_lossy(),None => {- println!(- "cargo:warning=Skipping crate with invalid path: {}",- crate_path.display()- );continue;}};@@ -39,10 +40,14 @@ fn run_build() -> Result<(), Box<dyn std::error::Error>> {continue;}- if let Err(e) =- scan_crate_for_smithy_models(&crate_path, &crate_name, &mut smithy_models)- {- println!("cargo:warning=Failed to scan crate {}: {}", crate_name, e);+ // Check if this crate should be scanned based on enabled features+ if feature_resolver.should_scan_crate(&crate_name) {+ let _ = scan_crate_for_smithy_models(+ &crate_path,+ &crate_name,+ &mut smithy_models,+ &feature_resolver,+ );}}}@@ -54,6 +59,180 @@ fn run_build() -> Result<(), Box<dyn std::error::Error>> {Ok(())}+/// Detects which features are enabled for the current build+fn detect_enabled_features() -> HashSet<String> {+ let mut features = HashSet::new();++ // Check all CARGO_FEATURE_* environment variables+ for (key, value) in std::env::vars() {+ if key.starts_with("CARGO_FEATURE_") && value == "1" {+ if let Some(feature_suffix) = key.strip_prefix("CARGO_FEATURE_") {+ let feature_name = feature_suffix.to_lowercase().replace('_', "-");+ features.insert(feature_name);+ }+ }+ }++ // Always include default features if none are explicitly enabled+ // Note: We should be more careful about default feature assumptions+ if features.is_empty() {+ features.insert("v1".to_string());+ }++ features+}++/// Resolves feature dependencies between smithy-generator and its dependencies+struct FeatureResolver {+ enabled_features: HashSet<String>,+ crate_feature_cache: std::collections::HashMap<String, HashSet<String>>,+}++impl FeatureResolver {+ fn new(enabled_features: &HashSet<String>) -> Self {+ let mut resolver = Self {+ enabled_features: enabled_features.clone(),+ crate_feature_cache: std::collections::HashMap::new(),+ };++ // Pre-compute feature mappings for known crates+ resolver.initialize_feature_mappings();+ resolver+ }++ fn initialize_feature_mappings(&mut self) {+ // Initialize feature mappings for each known crate+ for crate_name in &["api_models", "common_utils", "common_types", "common_enums"] {+ let features = self.compute_crate_features(crate_name);+ self.crate_feature_cache+ .insert(crate_name.to_string(), features);+ }+ }++ /// Determines if a crate should be scanned based on enabled features+ fn should_scan_crate(&self, crate_name: &str) -> bool {+ match crate_name {+ "api_models" => {+ // api_models is a core crate that should always be scanned+ // The feature gates within the crate will determine what's available+ true+ }+ "common_utils" => {+ // common_utils is a core utility crate, always scan it+ true+ }+ "common_types" => {+ // common_types should be scanned if any version features are enabled+ self.enabled_features.contains("v1") || self.enabled_features.contains("v2")+ }+ "common_enums" => {+ // common_enums is used by most other crates, always scan it+ true+ }+ "router_derive" => {+ // Proc macro crate, not relevant for SmithyModel scanning+ false+ }+ "external_services" | "storage_impl" | "router" => {+ // These are application crates, may contain models but less likely+ // Include them but with lower priority+ true+ }+ _ => {+ // For unknown crates, include them by default to be safe+ true+ }+ }+ }++ /// Determines which features are enabled for a dependency crate+ fn get_enabled_crate_features(&self, crate_name: &str) -> HashSet<String> {+ // Use cached result if available+ if let Some(cached_features) = self.crate_feature_cache.get(crate_name) {+ return cached_features.clone();+ }++ // Compute features for unknown crates+ self.compute_crate_features(crate_name)+ }++ fn compute_crate_features(&self, crate_name: &str) -> HashSet<String> {+ let mut crate_features = HashSet::new();++ match crate_name {+ "api_models" => {+ // api_models has v1 and v2 features that directly map to smithy-generator features+ if self.enabled_features.contains("v1") {+ crate_features.insert("v1".to_string());+ }+ if self.enabled_features.contains("v2") {+ crate_features.insert("v2".to_string());+ }++ // api_models also has some derived features+ for feature in &self.enabled_features {+ match feature.as_str() {+ "frm" | "payouts" | "disputes" | "routing" => {+ crate_features.insert(feature.clone());+ }+ _ => {}+ }+ }+ }+ "common_utils" => {+ // common_utils features typically map directly+ if self.enabled_features.contains("v1") {+ crate_features.insert("v1".to_string());+ }+ if self.enabled_features.contains("v2") {+ crate_features.insert("v2".to_string());+ }+ }+ "common_types" => {+ // common_types has payment-related features+ if self.enabled_features.contains("v2") {+ crate_features.insert("v2".to_string());+ }+ // Some features are version-independent+ for feature in &self.enabled_features {+ match feature.as_str() {+ "frm" | "payouts" | "disputes" => {+ crate_features.insert(feature.clone());+ }+ _ => {}+ }+ }+ }+ "common_enums" => {+ // common_enums typically doesn't have version-specific features+ // but may have functional features+ for feature in &self.enabled_features {+ match feature.as_str() {+ "frm" | "payouts" | "disputes" | "routing" => {+ crate_features.insert(feature.clone());+ }+ _ => {}+ }+ }+ }+ _ => {+ // For unknown crates, be conservative and only pass through+ // features that are commonly used+ for feature in &self.enabled_features {+ match feature.as_str() {+ "v1" | "v2" => {+ crate_features.insert(feature.clone());+ }+ _ => {}+ }+ }+ }+ }++ crate_features+ }+}+fn get_workspace_root() -> Result<std::path::PathBuf, Box<dyn std::error::Error>> {let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").map_err(|_| "CARGO_MANIFEST_DIR environment variable not set")?;@@ -75,13 +254,16 @@ fn scan_crate_for_smithy_models(crate_path: &Path,crate_name: &str,models: &mut Vec<SmithyModelInfo>,+ feature_resolver: &FeatureResolver,) -> Result<(), Box<dyn std::error::Error>> {let src_path = crate_path.join("src");if !src_path.exists() {return Ok(());}- scan_directory(&src_path, crate_name, "", models)?;+ let _enabled_features = feature_resolver.get_enabled_crate_features(crate_name);++ scan_directory(&src_path, crate_name, "", models, feature_resolver)?;Ok(())}@@ -90,6 +272,7 @@ fn scan_directory(crate_name: &str,module_path: &str,models: &mut Vec<SmithyModelInfo>,+ feature_resolver: &FeatureResolver,) -> Result<(), Box<dyn std::error::Error>> {if let Ok(entries) = fs::read_dir(dir) {for entry in entries.flatten() {@@ -98,10 +281,6 @@ fn scan_directory(let dir_name = match path.file_name() {Some(name) => name.to_string_lossy(),None => {- println!(- "cargo:warning=Skipping directory with invalid name: {}",- path.display()- );continue;}};@@ -110,15 +289,15 @@ fn scan_directory(} else {format!("{}::{}", module_path, dir_name)};- scan_directory(&path, crate_name, &new_module_path, models)?;+ scan_directory(+ &path,+ crate_name,+ &new_module_path,+ models,+ feature_resolver,+ )?;} else if path.extension().map(|ext| ext == "rs").unwrap_or(false) {- if let Err(e) = scan_rust_file(&path, crate_name, module_path, models) {- println!(- "cargo:warning=Failed to scan Rust file {}: {}",- path.display(),- e- );- }+ let _ = scan_rust_file(&path, crate_name, module_path, models, feature_resolver);}}}@@ -130,37 +309,44 @@ fn scan_rust_file(crate_name: &str,module_path: &str,models: &mut Vec<SmithyModelInfo>,+ feature_resolver: &FeatureResolver,) -> Result<(), Box<dyn std::error::Error>> {if let Ok(content) = fs::read_to_string(file_path) {- // Enhanced regex that handles comments, doc comments, and multiple attributes- // between derive and struct/enum declarations- let re = Regex::new(r"(?ms)^#\[derive\(([^)]*(?:\([^)]*\))*[^)]*)\)\]\s*(?:(?:#\[[^\]]*\]\s*)|(?://[^\r\n]*\s*)|(?:///[^\r\n]*\s*)|(?:/\*.*?\*/\s*))*(?:pub\s+)?(?:struct|enum)\s+([A-Z][A-Za-z0-9_]*)\s*[<\{\(]")+ // More precise regex that captures cfg attributes, derive, and struct/enum declarations+ // This captures cfg attributes that may be separated from derive by comments/other attributes+ let re = Regex::new(r"(?ms)((?:#\[cfg\([^\]]*\)\]\s*)*)((?:///[^\r\n]*\s*|#\[[^\]]*\]\s*)*)(#\[derive\([^)]*\bSmithyModel\b[^)]*\)\])\s*(?:(?:#\[[^\]]*\]\s*)|(?://[^\r\n]*\s*)|(?:///[^\r\n]*\s*)|(?:/\*.*?\*/\s*))*(?:pub\s+)?(?:struct|enum)\s+([A-Z][A-Za-z0-9_]*)\s*[<\{\(]").map_err(|e| format!("Failed to compile regex: {}", e))?;for captures in re.captures_iter(&content) {- let derive_content = match captures.get(1) {+ let cfg_attrs = captures.get(1).map(|m| m.as_str()).unwrap_or("");+ let derive_attr = captures.get(3).map(|m| m.as_str()).unwrap_or("");+ let item_name = match captures.get(4) {Some(capture) => capture.as_str(),None => {- println!(- "cargo:warning=Missing derive content in regex capture for {}",- file_path.display()- );continue;}};- let item_name = match captures.get(2) {- Some(capture) => capture.as_str(),- None => {- println!(- "cargo:warning=Missing item name in regex capture for {}",- file_path.display()- );++ // Verify this is actually a SmithyModel derive by checking the derive attribute more precisely+ if !derive_attr.contains("SmithyModel") {+ continue;+ }++ // For items with the same name but different feature gates (like FeatureMetadata),+ // we need to ensure we only include the version that actually has SmithyModel+ // under the current feature configuration+ let enabled_features = feature_resolver.get_enabled_crate_features(crate_name);++ // Special handling for items that have multiple definitions with different derives+ if item_name == "FeatureMetadata" {+ // FeatureMetadata only has SmithyModel in v1 version+ if !enabled_features.contains("v1") {continue;}- };+ }- // Check if "SmithyModel" is present in the derive macro's content.- if derive_content.contains("SmithyModel") {+ // Check if this item is available under current feature gates+ if is_item_available_for_features(cfg_attrs, crate_name, feature_resolver) {// Validate that the item name is a valid Rust identifierif is_valid_rust_identifier(item_name) {let full_module_path = create_module_path(file_path, crate_name, module_path)?;@@ -168,13 +354,8 @@ fn scan_rust_file(models.push(SmithyModelInfo {struct_name: item_name.to_string(),module_path: full_module_path,+ cfg_attrs: cfg_attrs.to_string(),});- } else {- println!(- "cargo:warning=Skipping invalid identifier: {} in {}",- item_name,- file_path.display()- );}}}@@ -182,6 +363,135 @@ fn scan_rust_file(Ok(())}+/// Checks if an item is available under the current feature configuration+fn is_item_available_for_features(+ cfg_attrs: &str,+ crate_name: &str,+ feature_resolver: &FeatureResolver,+) -> bool {+ if cfg_attrs.trim().is_empty() {+ // No feature gates, item is always available+ return true;+ }++ let enabled_features = feature_resolver.get_enabled_crate_features(crate_name);++ // Parse each cfg attribute line+ let cfg_lines: Vec<&str> = cfg_attrs+ .lines()+ .map(|line| line.trim())+ .filter(|line| !line.is_empty() && line.starts_with("#[cfg("))+ .collect();++ // If no cfg attributes found, item is available+ if cfg_lines.is_empty() {+ return true;+ }++ // All cfg attributes must be satisfied (AND logic between different cfg attributes)+ for cfg_line in cfg_lines {+ if !evaluate_cfg_condition(cfg_line, &enabled_features) {+ return false;+ }+ }++ true+}++/// Evaluates a single cfg condition+fn evaluate_cfg_condition(cfg_line: &str, enabled_features: &HashSet<String>) -> bool {+ // Simple feature check: #[cfg(feature = "v1")]+ if let Some(captures) = Regex::new(r#"#\[cfg\(feature\s*=\s*"([^"]+)"\)\]"#)+ .ok()+ .and_then(|re| re.captures(cfg_line))+ {+ if let Some(feature_match) = captures.get(1) {+ let feature_name = feature_match.as_str();+ return enabled_features.contains(feature_name);+ }+ }++ // any() function: #[cfg(any(feature = "v1", feature = "v2"))]+ if let Some(captures) = Regex::new(r#"#\[cfg\(any\(([^)]+)\)\)\]"#)+ .ok()+ .and_then(|re| re.captures(cfg_line))+ {+ if let Some(any_content) = captures.get(1) {+ return evaluate_any_condition(any_content.as_str(), enabled_features);+ }+ }++ // all() function: #[cfg(all(feature = "v1", not(feature = "v2")))]+ if let Some(captures) = Regex::new(r#"#\[cfg\(all\(([^)]+)\)\)\]"#)+ .ok()+ .and_then(|re| re.captures(cfg_line))+ {+ if let Some(all_content) = captures.get(1) {+ return evaluate_all_condition(all_content.as_str(), enabled_features);+ }+ }++ // not() function: #[cfg(not(feature = "v1"))]+ if let Some(captures) = Regex::new(r#"#\[cfg\(not\(([^)]+)\)\)\]"#)+ .ok()+ .and_then(|re| re.captures(cfg_line))+ {+ if let Some(not_content) = captures.get(1) {+ return !evaluate_simple_feature_condition(not_content.as_str(), enabled_features);+ }+ }++ // If we can't parse the cfg condition, assume it's available to avoid false negatives+ true+}++/// Evaluates any() condition - returns true if any condition is met+fn evaluate_any_condition(condition: &str, enabled_features: &HashSet<String>) -> bool {+ let parts: Vec<&str> = condition.split(',').map(|s| s.trim()).collect();++ for part in parts {+ if evaluate_simple_feature_condition(part, enabled_features) {+ return true;+ }+ }++ false+}++/// Evaluates all() condition - returns true if all conditions are met+fn evaluate_all_condition(condition: &str, enabled_features: &HashSet<String>) -> bool {+ let parts: Vec<&str> = condition.split(',').map(|s| s.trim()).collect();++ for part in parts {+ if part.starts_with("not(") && part.ends_with(')') {+ let inner = &part[4..part.len() - 1];+ if evaluate_simple_feature_condition(inner, enabled_features) {+ return false; // not() condition failed+ }+ } else if !evaluate_simple_feature_condition(part, enabled_features) {+ return false;+ }+ }++ true+}++/// Evaluates a simple feature condition like 'feature = "v1"'+fn evaluate_simple_feature_condition(condition: &str, enabled_features: &HashSet<String>) -> bool {+ if let Some(captures) = Regex::new(r#"feature\s*=\s*"([^"]+)""#)+ .ok()+ .and_then(|re| re.captures(condition))+ {+ if let Some(feature_match) = captures.get(1) {+ let feature_name = feature_match.as_str();+ return enabled_features.contains(feature_name);+ }+ }++ // If we can't parse it, assume it's false for safety+ false+}+fn is_valid_rust_identifier(name: &str) -> bool {if name.is_empty() {return false;@@ -249,6 +559,7 @@ fn create_module_path(struct SmithyModelInfo {struct_name: String,module_path: String,+ cfg_attrs: String,}fn generate_model_registry(models: &[SmithyModelInfo]) -> Result<(), Box<dyn std::error::Error>> {@@ -262,8 +573,12 @@ fn generate_model_registry(models: &[SmithyModelInfo]) -> Result<(), Box<dyn stdif !models.is_empty() {content.push_str("use smithy_core::{SmithyModel, SmithyModelGenerator};\n\n");- // Generate imports+ // Generate feature-gated importsfor model in models {+ if !model.cfg_attrs.trim().is_empty() {+ // Add cfg attributes for conditional compilation+ content.push_str(&format!("{}\n", model.cfg_attrs.trim()));+ }content.push_str(&format!("use {}::{};\n",model.module_path, model.struct_name@@ -271,25 +586,26 @@ fn generate_model_registry(models: &[SmithyModelInfo]) -> Result<(), Box<dyn std}content.push_str("\npub fn discover_smithy_models() -> Vec<SmithyModel> {\n");- content.push_str(" let mut models = Vec::new();\n\n");+ content.push_str(" vec![\n");- // Generate model collection calls- for model in models {+ // Generate feature-gated model collection calls+ for model in models.iter() {+ if !model.cfg_attrs.trim().is_empty() {+ // Add cfg attributes for conditional compilation+ content.push_str(&format!(" {}\n", model.cfg_attrs.trim()));+ }content.push_str(&format!(- " models.push({}::generate_smithy_model());\n",+ " {}::generate_smithy_model(),\n",model.struct_name));}- content.push_str("\n models\n");+ content.push_str(" ]\n");content.push_str("}\n");} else {// Generate empty function if no models foundcontent.push_str("use smithy_core::SmithyModel;\n\n");content.push_str("pub fn discover_smithy_models() -> Vec<SmithyModel> {\n");- content.push_str(- " router_env::logger::info!(\"No SmithyModel structs found in workspace\");\n",- );content.push_str(" Vec::new()\n");content.push_str("}\n");}diff --git a/crates/smithy/src/lib.rs b/crates/smithy/src/lib.rsindex 76a65f62f8..fc62175972 100644--- a/crates/smithy/src/lib.rs+++ b/crates/smithy/src/lib.rs@@ -48,6 +48,25 @@ fn generate_struct_impl(.map(|doc| quote! { Some(#doc.to_string()) }).unwrap_or(quote! { None });+ // Count flattened vs non-flattened fields to determine shape type+ let flattened_fields: Vec<_> = fields.iter().filter(|f| f.flatten).collect();+ let non_flattened_fields: Vec<_> = fields.iter().filter(|f| !f.flatten).collect();++ // Use smart runtime inspection for structs with only a single flattened field+ let should_use_smart_generation =+ non_flattened_fields.is_empty() && flattened_fields.len() == 1;++ if should_use_smart_generation {+ // Generate smart logic that determines union vs structure at runtime based on the flattened type+ return generate_union_from_flattened_struct(+ name,+ namespace,+ flattened_fields[0],+ &struct_doc_expr,+ );+ }++ // Otherwise, generate Structure (existing logic)let field_implementations = fields.iter().map(|field| {let field_name = &field.name;let value_type = &field.value_type;@@ -141,6 +160,12 @@ fn generate_struct_impl(SmithyConstraint::HttpQuery(name) => quote! {smithy_core::SmithyTrait::HttpQuery { name: #name.to_string() }},+ SmithyConstraint::JsonName(name) => quote! {+ smithy_core::SmithyTrait::JsonName { name: #name.to_string() }+ },+ SmithyConstraint::EnumValue(value) => quote! {+ smithy_core::SmithyTrait::EnumValue { value: #value.to_string() }+ },}).collect::<Vec<_>>();@@ -194,6 +219,142 @@ fn generate_struct_impl(Ok(expanded)}+fn generate_union_from_flattened_struct(+ name: &syn::Ident,+ namespace: &str,+ flattened_field: &SmithyField,+ struct_doc_expr: &proc_macro2::TokenStream,+) -> syn::Result<TokenStream2> {+ let value_type = &flattened_field.value_type;++ // Extract the inner type from Option<T> if it's an optional type+ let inner_type = if value_type.starts_with("Option<") && value_type.ends_with('>') {+ let start_idx = "Option<".len();+ let end_idx = value_type.len() - 1;+ &value_type[start_idx..end_idx]+ } else {+ value_type+ };++ let inner_type_ident = syn::parse_str::<syn::Type>(inner_type).unwrap();++ let expanded = quote! {+ impl smithy_core::SmithyModelGenerator for #name {+ fn generate_smithy_model() -> smithy_core::SmithyModel {+ let mut shapes = std::collections::HashMap::new();+ let mut members = std::collections::HashMap::new();++ // Get the flattened model and determine if it's actually an enum/union+ let flattened_model = <#inner_type_ident as smithy_core::SmithyModelGenerator>::generate_smithy_model();+ let flattened_struct_name = stringify!(#inner_type_ident).to_string();++ // Check if the flattened type is actually an enum or union+ let mut is_flattened_enum_or_union = false;++ // Find the target shape in the flattened model+ for (shape_name, shape) in flattened_model.shapes.clone() {+ if shape_name == flattened_struct_name {+ match &shape {+ smithy_core::SmithyShape::Union { .. } |+ smithy_core::SmithyShape::Enum { .. } => {+ is_flattened_enum_or_union = true;+ },+ smithy_core::SmithyShape::Structure { .. } => {+ is_flattened_enum_or_union = false;+ },+ _ => {+ is_flattened_enum_or_union = false;+ }+ }+ break;+ }+ }++ if is_flattened_enum_or_union {+ // Generate as Union: flattened type is enum/union+ for (shape_name, shape) in flattened_model.shapes {+ if shape_name == flattened_struct_name {+ match shape {+ smithy_core::SmithyShape::Union { members: flattened_members, .. } => {+ // If the flattened type is already a union, use its members+ members.extend(flattened_members);+ },+ smithy_core::SmithyShape::Enum { values, .. } => {+ // If the flattened type is an enum, convert enum values to union members+ for (enum_name, enum_value) in values {+ members.insert(enum_name, smithy_core::SmithyMember {+ target: "smithy.api#Unit".to_string(),+ documentation: enum_value.documentation,+ traits: vec![],+ });+ }+ },+ _ => {+ // Fallback case+ members.insert("value".to_string(), smithy_core::SmithyMember {+ target: flattened_struct_name.clone(),+ documentation: None,+ traits: vec![],+ });+ }+ }+ } else {+ // Add all other shapes from the flattened model+ shapes.insert(shape_name, shape);+ }+ }++ // Create the union shape+ let shape = smithy_core::SmithyShape::Union {+ members,+ documentation: #struct_doc_expr,+ traits: vec![]+ };++ shapes.insert(stringify!(#name).to_string(), shape);+ } else {+ // Generate as Structure: flattened type is struct, merge fields+ for (shape_name, shape) in flattened_model.shapes {+ if shape_name == flattened_struct_name {+ match shape {+ smithy_core::SmithyShape::Structure { members: flattened_members, .. } => {+ members.extend(flattened_members);+ }+ _ => {+ // Fallback - add as single field+ members.insert("value".to_string(), smithy_core::SmithyMember {+ target: flattened_struct_name.clone(),+ documentation: None,+ traits: vec![],+ });+ }+ }+ } else {+ shapes.insert(shape_name, shape);+ }+ }++ // Create the structure shape+ let shape = smithy_core::SmithyShape::Structure {+ members,+ documentation: #struct_doc_expr,+ traits: vec![]+ };++ shapes.insert(stringify!(#name).to_string(), shape);+ }++ smithy_core::SmithyModel {+ namespace: #namespace.to_string(),+ shapes+ }+ }+ }+ };++ Ok(expanded)+}+fn generate_enum_impl(name: &syn::Ident,namespace: &str,@@ -209,10 +370,22 @@ fn generate_enum_impl(.map(|doc| quote! { Some(#doc.to_string()) }).unwrap_or(quote! { None });- // Check if this is a string enum (all variants are unit variants) or a union+ // Check if this is a tagged enum, string enum, or unionlet is_string_enum = variants.iter().all(|v| v.fields.is_empty());-- if is_string_enum {+ let has_nested_value_type = variants.iter().any(|v| v.nested_value_type);+ let is_tagged_enum = serde_enum_attrs.tag.is_some() && !is_string_enum;++ if is_tagged_enum {+ // Generate tagged enum as a structure with tag field + all variant fields as optional+ // Plus a separate enum for the variants+ generate_tagged_enum_impl(+ name,+ namespace,+ &variants,+ &serde_enum_attrs,+ &enum_doc_expr,+ )+ } else if is_string_enum && !has_nested_value_type {// Generate as Smithy enumlet variant_implementations = variants.iter()@@ -234,11 +407,68 @@ fn generate_enum_impl(quote! { #variant_name.to_string() }};+ // Generate traits for enum value+ let traits = if variant.constraints.is_empty() {+ quote! { vec![] }+ } else {+ let trait_tokens = variant+ .constraints+ .iter()+ .map(|constraint| match constraint {+ SmithyConstraint::Pattern(pattern) => quote! {+ smithy_core::SmithyTrait::Pattern { pattern: #pattern.to_string() }+ },+ SmithyConstraint::Range(min, max) => {+ let min_expr =+ min.map(|v| quote! { Some(#v) }).unwrap_or(quote! { None });+ let max_expr =+ max.map(|v| quote! { Some(#v) }).unwrap_or(quote! { None });+ quote! {+ smithy_core::SmithyTrait::Range {+ min: #min_expr,+ max: #max_expr+ }+ }+ }+ SmithyConstraint::Length(min, max) => {+ let min_expr =+ min.map(|v| quote! { Some(#v) }).unwrap_or(quote! { None });+ let max_expr =+ max.map(|v| quote! { Some(#v) }).unwrap_or(quote! { None });+ quote! {+ smithy_core::SmithyTrait::Length {+ min: #min_expr,+ max: #max_expr+ }+ }+ }+ SmithyConstraint::Required => quote! {+ smithy_core::SmithyTrait::Required+ },+ SmithyConstraint::HttpLabel => quote! {+ smithy_core::SmithyTrait::HttpLabel+ },+ SmithyConstraint::HttpQuery(name) => quote! {+ smithy_core::SmithyTrait::HttpQuery { name: #name.to_string() }+ },+ SmithyConstraint::JsonName(name) => quote! {+ smithy_core::SmithyTrait::JsonName { name: #name.to_string() }+ },+ SmithyConstraint::EnumValue(value) => quote! {+ smithy_core::SmithyTrait::EnumValue { value: #value.to_string() }+ },+ })+ .collect::<Vec<_>>();++ quote! { vec![#(#trait_tokens),*] }+ };+quote! {enum_values.insert(#transformed_name, smithy_core::SmithyEnumValue {name: #transformed_name,documentation: #variant_doc,is_default: false,+ traits: #traits,});}})@@ -281,9 +511,108 @@ fn generate_enum_impl(.map(|doc| quote! { Some(#doc.to_string()) }).unwrap_or(quote! { None });- let target_type_expr = if variant.fields.is_empty() {- // If there are no fields with `value_type`, this variant should be skipped.- return None;+ let target_type_expr = if variant.nested_value_type {+ // Force nested structure creation when nested_value_type is specified+ // This works for both empty and non-empty variants+ let nested_struct_members = variant.fields.iter().map(|field| {+ let field_name = &field.name;+ let field_value_type = &field.value_type;+ let field_doc = field+ .documentation+ .as_ref()+ .map(|doc| quote! { Some(#doc.to_string()) })+ .unwrap_or(quote! { None });++ let mut field_constraints = field.constraints.clone();+ if !field.optional && !field_constraints.iter().any(|c| matches!(c, SmithyConstraint::Required)) {+ field_constraints.push(SmithyConstraint::Required);+ }++ let field_traits = if field_constraints.is_empty() {+ quote! { vec![] }+ } else {+ let trait_tokens = field_constraints+ .iter()+ .map(|constraint| match constraint {+ SmithyConstraint::Pattern(pattern) => quote! {+ smithy_core::SmithyTrait::Pattern { pattern: #pattern.to_string() }+ },+ SmithyConstraint::Range(min, max) => {+ let min_expr = min.map(|v| quote! { Some(#v) }).unwrap_or(quote! { None });+ let max_expr = max.map(|v| quote! { Some(#v) }).unwrap_or(quote! { None });+ quote! {+ smithy_core::SmithyTrait::Range {+ min: #min_expr,+ max: #max_expr+ }+ }+ },+ SmithyConstraint::Length(min, max) => {+ let min_expr = min.map(|v| quote! { Some(#v) }).unwrap_or(quote! { None });+ let max_expr = max.map(|v| quote! { Some(#v) }).unwrap_or(quote! { None });+ quote! {+ smithy_core::SmithyTrait::Length {+ min: #min_expr,+ max: #max_expr+ }+ }+ },+ SmithyConstraint::Required => quote! {+ smithy_core::SmithyTrait::Required+ },+ SmithyConstraint::HttpLabel => quote! {+ smithy_core::SmithyTrait::HttpLabel+ },+ SmithyConstraint::HttpQuery(name) => quote! {+ smithy_core::SmithyTrait::HttpQuery { name: #name.to_string() }+ },+ SmithyConstraint::JsonName(name) => quote! {+ smithy_core::SmithyTrait::JsonName { name: #name.to_string() }+ },+ SmithyConstraint::EnumValue(value) => quote! {+ smithy_core::SmithyTrait::EnumValue { value: #value.to_string() }+ },+ })+ .collect::<Vec<_>>();++ quote! { vec![#(#trait_tokens),*] }+ };++ quote! {+ {+ let (field_target, field_shapes) = smithy_core::types::resolve_type_and_generate_shapes(#field_value_type, &mut shapes).unwrap();+ shapes.extend(field_shapes);+ nested_members.insert(#field_name.to_string(), smithy_core::SmithyMember {+ target: field_target,+ documentation: #field_doc,+ traits: #field_traits,+ });+ }+ }+ });++ quote! {+ {+ let nested_struct_name = format!("{}NestedType", #variant_name);+ let mut nested_members = std::collections::HashMap::new();+ #(#nested_struct_members)*+ let nested_shape = smithy_core::SmithyShape::Structure {+ members: nested_members,+ documentation: None,+ traits: vec![],+ };+ shapes.insert(nested_struct_name.clone(), nested_shape);+ nested_struct_name+ }+ }+ } else if variant.fields.is_empty() {+ // If there are no fields but variant has a value_type, use that+ if let Some(variant_value_type) = &variant.value_type {+ quote! { #variant_value_type.to_string() }+ } else {+ // If there are no fields and no variant value_type, this variant should be skipped+ return None;+ }} else if variant.fields.len() == 1 {// Single field - reference the type directly instead of creating a wrapperlet field = &variant.fields[0];@@ -353,6 +682,12 @@ fn generate_enum_impl(SmithyConstraint::HttpQuery(name) => quote! {smithy_core::SmithyTrait::HttpQuery { name: #name.to_string() }},+ SmithyConstraint::JsonName(name) => quote! {+ smithy_core::SmithyTrait::JsonName { name: #name.to_string() }+ },+ SmithyConstraint::EnumValue(value) => quote! {+ smithy_core::SmithyTrait::EnumValue { value: #value.to_string() }+ },}).collect::<Vec<_>>();@@ -437,6 +772,188 @@ fn generate_enum_impl(}}+fn generate_tagged_enum_impl(+ name: &syn::Ident,+ namespace: &str,+ variants: &[SmithyEnumVariant],+ serde_enum_attrs: &SerdeEnumAttributes,+ enum_doc_expr: &proc_macro2::TokenStream,+) -> syn::Result<TokenStream2> {+ let tag_field_name = serde_enum_attrs.tag.as_ref().unwrap();+ let variants_enum_name = format!("{}EnumVariants", name);++ // Collect all unique fields from all variants+ let mut all_fields = std::collections::HashMap::new();++ for variant in variants {+ for field in &variant.fields {+ // Make all variant fields optional by wrapping in Option<> if not already+ let optional_type = if field.optional {+ field.value_type.clone()+ } else {+ format!("Option<{}>", field.value_type)+ };++ all_fields.insert(+ field.name.clone(),+ (+ optional_type,+ field.documentation.clone(),+ field.constraints.clone(),+ ),+ );+ }+ }++ // Generate field implementations for the main structure+ let field_implementations = all_fields.iter().map(|(field_name, (value_type, documentation, constraints))| {+ let field_doc = documentation+ .as_ref()+ .map(|doc| quote! { Some(#doc.to_string()) })+ .unwrap_or(quote! { None });++ let traits = if constraints.is_empty() {+ quote! { vec![] }+ } else {+ let trait_tokens = constraints+ .iter()+ .map(|constraint| match constraint {+ SmithyConstraint::Pattern(pattern) => quote! {+ smithy_core::SmithyTrait::Pattern { pattern: #pattern.to_string() }+ },+ SmithyConstraint::Range(min, max) => {+ let min_expr = min.map(|v| quote! { Some(#v) }).unwrap_or(quote! { None });+ let max_expr = max.map(|v| quote! { Some(#v) }).unwrap_or(quote! { None });+ quote! {+ smithy_core::SmithyTrait::Range {+ min: #min_expr,+ max: #max_expr+ }+ }+ },+ SmithyConstraint::Length(min, max) => {+ let min_expr = min.map(|v| quote! { Some(#v) }).unwrap_or(quote! { None });+ let max_expr = max.map(|v| quote! { Some(#v) }).unwrap_or(quote! { None });+ quote! {+ smithy_core::SmithyTrait::Length {+ min: #min_expr,+ max: #max_expr+ }+ }+ },+ SmithyConstraint::Required => quote! {+ smithy_core::SmithyTrait::Required+ },+ SmithyConstraint::HttpLabel => quote! {+ smithy_core::SmithyTrait::HttpLabel+ },+ SmithyConstraint::HttpQuery(name) => quote! {+ smithy_core::SmithyTrait::HttpQuery { name: #name.to_string() }+ },+ SmithyConstraint::JsonName(name) => quote! {+ smithy_core::SmithyTrait::JsonName { name: #name.to_string() }+ },+ SmithyConstraint::EnumValue(value) => quote! {+ smithy_core::SmithyTrait::EnumValue { value: #value.to_string() }+ },+ })+ .collect::<Vec<_>>();++ quote! { vec![#(#trait_tokens),*] }+ };++ quote! {+ {+ let (target_type, new_shapes) = smithy_core::types::resolve_type_and_generate_shapes(#value_type, &mut shapes).unwrap();+ shapes.extend(new_shapes);+ members.insert(#field_name.to_string(), smithy_core::SmithyMember {+ target: target_type,+ documentation: #field_doc,+ traits: #traits,+ });+ }+ }+ });++ // Generate variant enum values+ let variant_implementations = variants+ .iter()+ .map(|variant| {+ let variant_name = &variant.name;+ let variant_doc = variant+ .documentation+ .as_ref()+ .map(|doc| quote! { Some(#doc.to_string()) })+ .unwrap_or(quote! { None });++ // Apply serde rename transformation if specified+ let rename_all = serde_enum_attrs.rename_all.as_deref();+ let transformed_name = if let Some(rename_pattern) = rename_all {+ let transformed = transform_variant_name(variant_name, Some(rename_pattern));+ quote! { #transformed.to_string() }+ } else {+ quote! { #variant_name.to_string() }+ };++ quote! {+ enum_values.insert(#transformed_name, smithy_core::SmithyEnumValue {+ name: #transformed_name,+ documentation: #variant_doc,+ is_default: false,+ traits: vec![],+ });+ }+ })+ .collect::<Vec<_>>();++ let expanded = quote! {+ impl smithy_core::SmithyModelGenerator for #name {+ fn generate_smithy_model() -> smithy_core::SmithyModel {+ let mut shapes = std::collections::HashMap::new();+ let mut members = std::collections::HashMap::new();++ // Add all variant fields as optional members+ #(#field_implementations;)*++ // Add the tag field - required and references the variants enum+ members.insert(#tag_field_name.to_string(), smithy_core::SmithyMember {+ target: #variants_enum_name.to_string(),+ documentation: Some("Discriminator field for the tagged enum".to_string()),+ traits: vec![smithy_core::SmithyTrait::Required],+ });++ // Create the main structure+ let main_shape = smithy_core::SmithyShape::Structure {+ members,+ documentation: #enum_doc_expr,+ traits: vec![]+ };++ shapes.insert(stringify!(#name).to_string(), main_shape);++ // Create the variants enum+ let mut enum_values = std::collections::HashMap::new();+ #(#variant_implementations)*++ let variants_shape = smithy_core::SmithyShape::Enum {+ values: enum_values,+ documentation: Some(format!("Enum variants for {}", stringify!(#name))),+ traits: vec![]+ };++ shapes.insert(#variants_enum_name.to_string(), variants_shape);++ smithy_core::SmithyModel {+ namespace: #namespace.to_string(),+ shapes+ }+ }+ }+ };++ Ok(expanded)+}+fn extract_namespace_and_mixin(attrs: &[Attribute]) -> syn::Result<(String, bool)> {for attr in attrs {if attr.path().is_ident("smithy") {@@ -482,10 +999,17 @@ fn extract_fields(fields: &Fields) -> syn::Result<Vec<SmithyField>> {let documentation = extract_documentation(&field.attrs);let optional = value_type.trim().starts_with("Option<");+ // Apply JsonName trait if field has serde rename+ let mut constraints = field_attrs.constraints;+ if let Some(rename_value) = &serde_attrs.rename {+ // Add JsonName constraint for serde rename+ constraints.push(SmithyConstraint::JsonName(rename_value.clone()));+ }+smithy_fields.push(SmithyField {name: field_name,value_type,- constraints: field_attrs.constraints,+ constraints,documentation,optional,flatten: serde_attrs.flatten,@@ -513,6 +1037,7 @@ fn extract_enum_variants(let variant_name = variant.ident.to_string();let documentation = extract_documentation(&variant.attrs);let variant_attrs = parse_smithy_field_attributes(&variant.attrs)?;+ let variant_serde_attrs = parse_serde_attributes(&variant.attrs)?;// Extract fields from the variantlet fields = match &variant.fields {@@ -568,11 +1093,20 @@ fn extract_enum_variants(}};+ // Apply EnumValue trait if variant has serde rename+ let mut constraints = variant_attrs.constraints;+ if let Some(rename_value) = &variant_serde_attrs.rename {+ // Add EnumValue constraint for serde rename+ constraints.push(SmithyConstraint::EnumValue(rename_value.clone()));+ }+smithy_variants.push(SmithyEnumVariant {name: variant_name,fields,- constraints: variant_attrs.constraints,+ constraints,documentation,+ nested_value_type: variant_attrs.nested_value_type,+ value_type: variant_attrs.value_type,});}@@ -583,16 +1117,21 @@ fn extract_enum_variants(struct SmithyFieldAttributes {value_type: Option<String>,constraints: Vec<SmithyConstraint>,+ nested_value_type: bool,}#[derive(Default)]struct SerdeAttributes {flatten: bool,+ tag: Option<String>,+ rename: Option<String>,}#[derive(Default)]struct SerdeEnumAttributes {rename_all: Option<String>,+ tag: Option<String>,+ rename: Option<String>,}fn parse_serde_attributes(attrs: &[Attribute]) -> syn::Result<SerdeAttributes> {@@ -600,16 +1139,88 @@ fn parse_serde_attributes(attrs: &[Attribute]) -> syn::Result<SerdeAttributes> {for attr in attrs {if attr.path().is_ident("serde") {- if let Ok(list) = attr.meta.require_list() {- if list.path.is_ident("serde") {- for item in list.tokens.clone() {- if let Some(ident) = item.to_string().split_whitespace().next() {- if ident == "flatten" {- serde_attributes.flatten = true;- }+ // Use more robust parsing that handles all serde attributes+ let parse_result = attr.parse_nested_meta(|meta| {+ if meta.path.is_ident("flatten") {+ serde_attributes.flatten = true;+ } else if meta.path.is_ident("tag") {+ // Parse and capture the tag attribute+ if let Ok(value) = meta.value() {+ if let Ok(Lit::Str(lit_str)) = value.parse::<Lit>() {+ serde_attributes.tag = Some(lit_str.value());}}+ } else if meta.path.is_ident("rename_all") {+ // Parse and ignore the rename_all attribute for structs+ if let Ok(value) = meta.value() {+ let _ = value.parse::<Lit>();+ }+ } else if meta.path.is_ident("content") {+ // Parse and ignore the content attribute+ if let Ok(value) = meta.value() {+ let _ = value.parse::<Lit>();+ }+ } else if meta.path.is_ident("rename") {+ // Parse and capture the rename attribute+ if let Ok(value) = meta.value() {+ if let Ok(Lit::Str(lit_str)) = value.parse::<Lit>() {+ serde_attributes.rename = Some(lit_str.value());+ }+ }+ } else if meta.path.is_ident("deny_unknown_fields") {+ // Handle deny_unknown_fields (no value needed)+ } else if meta.path.is_ident("skip_serializing") {+ // Handle skip_serializing+ } else if meta.path.is_ident("skip_deserializing") {+ // Handle skip_deserializing+ } else if meta.path.is_ident("skip_serializing_if") {+ // Handle skip_serializing_if+ if let Ok(value) = meta.value() {+ let _ = value.parse::<syn::Expr>();+ }+ } else if meta.path.is_ident("default") {+ // Handle default attribute+ if meta.value().is_ok() {+ let _ = meta.value().and_then(|v| v.parse::<syn::Expr>());+ }+ } else if meta.path.is_ident("untagged") {+ // Handle untagged (flag attribute)+ } else if meta.path.is_ident("bound") {+ // Handle bound attribute+ if let Ok(value) = meta.value() {+ let _ = value.parse::<Lit>();+ }+ } else if meta.path.is_ident("with") {+ // Handle with attribute+ if let Ok(value) = meta.value() {+ let _ = value.parse::<Lit>();+ }+ } else if meta.path.is_ident("serialize_with") {+ // Handle serialize_with attribute+ if let Ok(value) = meta.value() {+ let _ = value.parse::<Lit>();+ }+ } else if meta.path.is_ident("deserialize_with") {+ // Handle deserialize_with attribute+ if let Ok(value) = meta.value() {+ let _ = value.parse::<Lit>();+ }+ } else if meta.path.is_ident("alias") {+ // Handle alias attribute+ if let Ok(value) = meta.value() {+ let _ = value.parse::<Lit>();+ }}+ // Silently ignore any other serde attributes to prevent parsing errors+ Ok(())+ });++ // If parsing failed, provide a more helpful error message+ if let Err(e) = parse_result {+ return Err(syn::Error::new_spanned(+ attr,+ format!("Failed to parse serde attribute: {}. This may be due to multiple serde attributes on separate lines. Consider consolidating them into a single #[serde(...)] attribute.", e)+ ));}}}@@ -631,9 +1242,11 @@ fn parse_serde_enum_attributes(attrs: &[Attribute]) -> syn::Result<SerdeEnumAttr}}} else if meta.path.is_ident("tag") {- // Parse and ignore the tag attribute+ // Parse and capture the tag attributeif let Ok(value) = meta.value() {- let _ = value.parse::<Lit>();+ if let Ok(Lit::Str(lit_str)) = value.parse::<Lit>() {+ serde_enum_attributes.tag = Some(lit_str.value());+ }}} else if meta.path.is_ident("content") {// Parse and ignore the content attribute@@ -641,9 +1254,11 @@ fn parse_serde_enum_attributes(attrs: &[Attribute]) -> syn::Result<SerdeEnumAttrlet _ = value.parse::<Lit>();}} else if meta.path.is_ident("rename") {- // Parse and ignore the rename attribute (used for enum renaming)+ // Parse and capture the rename attribute (used for enum renaming)if let Ok(value) = meta.value() {- let _ = value.parse::<Lit>();+ if let Ok(Lit::Str(lit_str)) = value.parse::<Lit>() {+ serde_enum_attributes.rename = Some(lit_str.value());+ }}} else if meta.path.is_ident("deny_unknown_fields") {// Handle deny_unknown_fields (no value needed)@@ -837,6 +1452,8 @@ fn parse_smithy_field_attributes(attrs: &[Attribute]) -> syn::Result<SmithyField.push(SmithyConstraint::HttpQuery(lit_str.value()));}}+ } else if meta.path.is_ident("nested_value_type") {+ field_attributes.nested_value_type = true;}Ok(())})?;