mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 12:15:40 +08:00
feat(core): support for gpay session token creation (#152)
This commit is contained in:
@ -691,11 +691,65 @@ pub struct PaymentsSessionRequest {
|
||||
pub client_secret: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub struct GpayAllowedMethodsParameters {
|
||||
pub allowed_auth_methods: Vec<String>,
|
||||
pub allowed_card_networks: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub struct GpayTokenParameters {
|
||||
pub gateway: String,
|
||||
pub gateway_merchant_id: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub struct GpayTokenizationSpecification {
|
||||
#[serde(rename = "type")]
|
||||
pub token_specification_type: String,
|
||||
pub parameters: GpayTokenParameters,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub struct GpayAllowedPaymentMethods {
|
||||
#[serde(rename = "type")]
|
||||
pub payment_method_type: String,
|
||||
pub parameters: GpayAllowedMethodsParameters,
|
||||
pub tokenization_specification: GpayTokenizationSpecification,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub struct GpayTransactionInfo {
|
||||
pub country_code: String,
|
||||
pub currency_code: String,
|
||||
pub total_price_status: String,
|
||||
pub total_price: i64,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub struct GpayMerchantInfo {
|
||||
pub merchant_name: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub struct GpayMetadata {
|
||||
pub merchant_info: GpayMerchantInfo,
|
||||
pub allowed_payment_methods: Vec<GpayAllowedPaymentMethods>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub struct GpaySessionTokenData {
|
||||
pub gpay: GpayMetadata,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize)]
|
||||
#[serde(tag = "connector_name")]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum SessionToken {
|
||||
Gpay {},
|
||||
Gpay {
|
||||
allowed_payment_methods: Vec<GpayAllowedPaymentMethods>,
|
||||
transaction_info: GpayTransactionInfo,
|
||||
},
|
||||
Klarna {
|
||||
session_token: String,
|
||||
session_id: String,
|
||||
|
||||
Reference in New Issue
Block a user