feat(core): add support to generate session token response from both connector_wallets_details and metadata (#7140)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Sakil Mostak
2025-02-13 13:10:28 +05:30
committed by GitHub
parent 6aac16e0c9
commit 66d9c731f5
11 changed files with 297 additions and 163 deletions

View File

@ -6085,7 +6085,8 @@ pub enum GpayBillingAddressFormat {
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
pub struct GpayTokenParameters {
/// The name of the connector
pub gateway: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway: Option<String>,
/// The merchant ID registered in the connector associated
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_merchant_id: Option<String>,
@ -6096,6 +6097,13 @@ pub struct GpayTokenParameters {
rename = "stripe:publishableKey"
)]
pub stripe_publishable_key: Option<String>,
/// The protocol version for encryption
#[serde(skip_serializing_if = "Option::is_none")]
pub protocol_version: Option<String>,
/// The public key provided by the merchant
#[serde(skip_serializing_if = "Option::is_none")]
#[schema(value_type = Option<String>)]
pub public_key: Option<Secret<String>>,
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
@ -6365,6 +6373,7 @@ pub struct GooglePayWalletDetails {
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct GooglePayDetails {
pub provider_details: GooglePayProviderDetails,
pub cards: GpayAllowedMethodsParameters,
}
// Google Pay Provider Details can of two types: GooglePayMerchantDetails or GooglePayHyperSwitchDetails
@ -6383,6 +6392,7 @@ pub struct GooglePayMerchantDetails {
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct GooglePayMerchantInfo {
pub merchant_name: String,
pub merchant_id: Option<String>,
pub tokenization_specification: GooglePayTokenizationSpecification,
}
@ -6393,8 +6403,9 @@ pub struct GooglePayTokenizationSpecification {
pub parameters: GooglePayTokenizationParameters,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
#[derive(Debug, Clone, Copy, serde::Serialize, serde::Deserialize, strum::Display)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
#[strum(serialize_all = "SCREAMING_SNAKE_CASE")]
pub enum GooglePayTokenizationType {
PaymentGateway,
Direct,
@ -6402,10 +6413,13 @@ pub enum GooglePayTokenizationType {
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct GooglePayTokenizationParameters {
pub gateway: String,
pub public_key: Secret<String>,
pub private_key: Secret<String>,
pub gateway: Option<String>,
pub public_key: Option<Secret<String>>,
pub private_key: Option<Secret<String>>,
pub recipient_id: Option<Secret<String>>,
pub gateway_merchant_id: Option<Secret<String>>,
pub stripe_publishable_key: Option<Secret<String>>,
pub stripe_version: Option<Secret<String>>,
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, ToSchema)]