Skip to content

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

fix(router): add `serde(transparent)` annotation for `PaymentMethodMetadata` (#1899)

Prajjwal Kumar2d839170fe88
diff --git a/crates/router/src/core/payment_methods/cards.rs b/crates/router/src/core/payment_methods/cards.rs
index 9dab92f67f..571b55e9e5 100644
--- a/crates/router/src/core/payment_methods/cards.rs
+++ b/crates/router/src/core/payment_methods/cards.rs
@@ -1831,7 +1831,7 @@ pub async fn list_customer_payment_method(
.parse_value("PaymentMethodMetadata")
.change_context(errors::ApiErrorResponse::InternalServerError)
.attach_printable(
- "Failed to deserialize metadata to PaymmentmethodMetadata struct",
+ "Failed to deserialize metadata to PaymentmethodMetadata struct",
)?;
for pm_metadata in pm_metadata_vec.payment_method_tokenization {
diff --git a/crates/router/src/core/payment_methods/transformers.rs b/crates/router/src/core/payment_methods/transformers.rs
index 6e4b43593a..2d8fe43d18 100644
--- a/crates/router/src/core/payment_methods/transformers.rs
+++ b/crates/router/src/core/payment_methods/transformers.rs
@@ -147,6 +147,7 @@ pub struct DeleteCardResponse {
}
#[derive(Debug, Deserialize, Serialize)]
+#[serde(transparent)]
pub struct PaymentMethodMetadata {
pub payment_method_tokenization: std::collections::HashMap<String, String>,
}