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(connector): [Stripe] fix cashapp webhooks response deserialization failure (#5690)

chikke srujan2ccce01bf4c6
diff --git a/crates/router/src/connector/stripe/transformers.rs b/crates/router/src/connector/stripe/transformers.rs
index 3513dead92..f9fd519241 100644
--- a/crates/router/src/connector/stripe/transformers.rs
+++ b/crates/router/src/connector/stripe/transformers.rs
@@ -2208,6 +2208,12 @@ pub struct StripeBankRedirectDetails {
attached_payment_method: Option<Secret<String>>,
}
+#[derive(Deserialize, Clone, Debug, PartialEq, Eq, Serialize)]
+pub struct StripeCashappDetails {
+ buyer_id: Option<String>,
+ cashtag: Option<String>,
+}
+
impl Deref for PaymentIntentSyncResponse {
type Target = PaymentIntentResponse;
@@ -2247,6 +2253,9 @@ pub enum StripePaymentMethodDetailsResponse {
Card {
card: StripeAdditionalCardDetails,
},
+ Cashapp {
+ cashapp: StripeCashappDetails,
+ },
Klarna,
Affirm,
AfterpayClearpay,
@@ -2304,7 +2313,8 @@ impl StripePaymentMethodDetailsResponse {
| Self::Bacs
| Self::Wechatpay
| Self::Alipay
- | Self::CustomerBalance => None,
+ | Self::CustomerBalance
+ | Self::Cashapp { .. } => None,
}
}
}
@@ -2619,6 +2629,7 @@ impl<F, T>
| Some(StripePaymentMethodDetailsResponse::Wechatpay)
| Some(StripePaymentMethodDetailsResponse::Alipay)
| Some(StripePaymentMethodDetailsResponse::CustomerBalance)
+ | Some(StripePaymentMethodDetailsResponse::Cashapp { .. })
| None => payment_method_id.expose(),
}
}