mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 03:13:56 +08:00
fix(payments): add connector metadata parsing and order category to payment router data (#9825)
This commit is contained in:
@ -459,7 +459,7 @@ pub struct PaymentsUpdateIntentRequest {
|
||||
|
||||
/// Some connectors like Apple pay, Airwallex and Noon might require some additional information, find specific details in the child attributes below.
|
||||
#[schema(value_type = Option<ConnectorMetadata>)]
|
||||
pub connector_metadata: Option<pii::SecretSerdeValue>,
|
||||
pub connector_metadata: Option<ConnectorMetadata>,
|
||||
|
||||
/// Additional data that might be required by hyperswitch based on the requested features by the merchants.
|
||||
#[schema(value_type = Option<FeatureMetadata>)]
|
||||
@ -634,7 +634,7 @@ pub struct PaymentsIntentResponse {
|
||||
|
||||
/// Some connectors like Apple pay, Airwallex and Noon might require some additional information, find specific details in the child attributes below.
|
||||
#[schema(value_type = Option<ConnectorMetadata>)]
|
||||
pub connector_metadata: Option<pii::SecretSerdeValue>,
|
||||
pub connector_metadata: Option<ConnectorMetadata>,
|
||||
|
||||
/// Additional data that might be required by hyperswitch based on the requested features by the merchants.
|
||||
#[schema(value_type = Option<FeatureMetadata>)]
|
||||
@ -7558,7 +7558,7 @@ 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, serde::Serialize, serde::Deserialize, ToSchema)]
|
||||
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
|
||||
pub struct ConnectorMetadata {
|
||||
pub apple_pay: Option<ApplepayConnectorMetadataRequest>,
|
||||
pub airwallex: Option<AirwallexData>,
|
||||
@ -7593,18 +7593,18 @@ impl ConnectorMetadata {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema)]
|
||||
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
|
||||
pub struct AirwallexData {
|
||||
/// payload required by airwallex
|
||||
payload: Option<String>,
|
||||
}
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema)]
|
||||
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
|
||||
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)
|
||||
pub order_category: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema)]
|
||||
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
|
||||
pub struct BraintreeData {
|
||||
/// Information about the merchant_account_id that merchant wants to specify at connector level.
|
||||
#[schema(value_type = String)]
|
||||
@ -7614,19 +7614,19 @@ pub struct BraintreeData {
|
||||
pub merchant_config_currency: Option<api_enums::Currency>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema)]
|
||||
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
|
||||
pub struct AdyenConnectorMetadata {
|
||||
pub testing: AdyenTestingData,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema)]
|
||||
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
|
||||
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)]
|
||||
pub holder_name: Option<Secret<String>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema)]
|
||||
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
|
||||
pub struct ApplepayConnectorMetadataRequest {
|
||||
pub session_token_data: Option<SessionTokenInfo>,
|
||||
}
|
||||
@ -7674,7 +7674,7 @@ pub struct PaymentRequestMetadata {
|
||||
pub label: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema)]
|
||||
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
|
||||
pub struct SessionTokenInfo {
|
||||
#[schema(value_type = String)]
|
||||
pub certificate: Secret<String>,
|
||||
@ -7690,14 +7690,14 @@ pub struct SessionTokenInfo {
|
||||
pub payment_processing_details_at: Option<PaymentProcessingDetailsAt>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, Display, ToSchema)]
|
||||
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Display, ToSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum ApplepayInitiative {
|
||||
Web,
|
||||
Ios,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema)]
|
||||
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
|
||||
#[serde(tag = "payment_processing_details_at")]
|
||||
pub enum PaymentProcessingDetailsAt {
|
||||
Hyperswitch(PaymentProcessingDetails),
|
||||
|
||||
Reference in New Issue
Block a user