mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-03 05:17:02 +08:00
revert: serialize with camelCase for gpay token (#328)
This commit is contained in:
@ -772,21 +772,18 @@ pub struct PaymentsSessionRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||||
#[serde(rename_all(serialize = "camelCase"))]
|
|
||||||
pub struct GpayAllowedMethodsParameters {
|
pub struct GpayAllowedMethodsParameters {
|
||||||
pub allowed_auth_methods: Vec<String>,
|
pub allowed_auth_methods: Vec<String>,
|
||||||
pub allowed_card_networks: Vec<String>,
|
pub allowed_card_networks: Vec<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||||
#[serde(rename_all(serialize = "camelCase"))]
|
|
||||||
pub struct GpayTokenParameters {
|
pub struct GpayTokenParameters {
|
||||||
pub gateway: String,
|
pub gateway: String,
|
||||||
pub gateway_merchant_id: String,
|
pub gateway_merchant_id: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||||
#[serde(rename_all(serialize = "camelCase"))]
|
|
||||||
pub struct GpayTokenizationSpecification {
|
pub struct GpayTokenizationSpecification {
|
||||||
#[serde(rename = "type")]
|
#[serde(rename = "type")]
|
||||||
pub token_specification_type: String,
|
pub token_specification_type: String,
|
||||||
@ -794,7 +791,6 @@ pub struct GpayTokenizationSpecification {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||||
#[serde(rename_all(serialize = "camelCase"))]
|
|
||||||
pub struct GpayAllowedPaymentMethods {
|
pub struct GpayAllowedPaymentMethods {
|
||||||
#[serde(rename = "type")]
|
#[serde(rename = "type")]
|
||||||
pub payment_method_type: String,
|
pub payment_method_type: String,
|
||||||
@ -803,7 +799,6 @@ pub struct GpayAllowedPaymentMethods {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||||
#[serde(rename_all(serialize = "camelCase"))]
|
|
||||||
pub struct GpayTransactionInfo {
|
pub struct GpayTransactionInfo {
|
||||||
pub country_code: String,
|
pub country_code: String,
|
||||||
pub currency_code: String,
|
pub currency_code: String,
|
||||||
@ -812,13 +807,11 @@ pub struct GpayTransactionInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||||
#[serde(rename_all(serialize = "camelCase"))]
|
|
||||||
pub struct GpayMerchantInfo {
|
pub struct GpayMerchantInfo {
|
||||||
pub merchant_name: String,
|
pub merchant_name: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||||
#[serde(rename_all(serialize = "camelCase"))]
|
|
||||||
pub struct GpayMetadata {
|
pub struct GpayMetadata {
|
||||||
pub merchant_info: GpayMerchantInfo,
|
pub merchant_info: GpayMerchantInfo,
|
||||||
pub allowed_payment_methods: Vec<GpayAllowedPaymentMethods>,
|
pub allowed_payment_methods: Vec<GpayAllowedPaymentMethods>,
|
||||||
@ -834,9 +827,7 @@ pub struct GpaySessionTokenData {
|
|||||||
#[serde(rename_all = "lowercase")]
|
#[serde(rename_all = "lowercase")]
|
||||||
pub enum SessionToken {
|
pub enum SessionToken {
|
||||||
Gpay {
|
Gpay {
|
||||||
#[serde(flatten)]
|
allowed_payment_methods: Vec<GpayAllowedPaymentMethods>,
|
||||||
gpay_token: GpayMetadata,
|
|
||||||
#[serde(rename(serialize = "transactionInfo"))]
|
|
||||||
transaction_info: GpayTransactionInfo,
|
transaction_info: GpayTransactionInfo,
|
||||||
},
|
},
|
||||||
Klarna {
|
Klarna {
|
||||||
|
|||||||
@ -84,7 +84,7 @@ fn create_gpay_session_token(
|
|||||||
let response_router_data = types::PaymentsSessionRouterData {
|
let response_router_data = types::PaymentsSessionRouterData {
|
||||||
response: Ok(types::PaymentsResponseData::SessionResponse {
|
response: Ok(types::PaymentsResponseData::SessionResponse {
|
||||||
session_token: payment_types::SessionToken::Gpay {
|
session_token: payment_types::SessionToken::Gpay {
|
||||||
gpay_token: gpay_data.gpay,
|
allowed_payment_methods: gpay_data.gpay.allowed_payment_methods,
|
||||||
transaction_info,
|
transaction_info,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user