feat(kafka): add payment_intent payment_attempt and refund kafka events for v2 (#8328)

Co-authored-by: Kashif <kashif.dev@protonmail.com>
This commit is contained in:
Hrithikesh
2025-06-19 12:06:07 +05:30
committed by GitHub
parent 5f7055fc8c
commit 305ca9bda9
12 changed files with 1138 additions and 332 deletions

View File

@ -1679,6 +1679,16 @@ pub enum FutureUsage {
OnSession,
}
impl FutureUsage {
/// Indicates whether the payment method should be saved for future use or not
pub fn is_off_session(self) -> bool {
match self {
Self::OffSession => true,
Self::OnSession => false,
}
}
}
#[derive(
Clone,
Copy,
@ -7975,7 +7985,9 @@ pub enum SuccessBasedRoutingConclusiveState {
}
/// Whether 3ds authentication is requested or not
#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize, Default, ToSchema)]
#[derive(
Clone, Copy, Debug, PartialEq, serde::Serialize, serde::Deserialize, Default, ToSchema,
)]
pub enum External3dsAuthenticationRequest {
/// Request for 3ds authentication
Enable,
@ -7985,7 +7997,9 @@ pub enum External3dsAuthenticationRequest {
}
/// Whether payment link is requested to be enabled or not for this transaction
#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize, Default, ToSchema)]
#[derive(
Clone, Copy, Debug, PartialEq, serde::Serialize, serde::Deserialize, Default, ToSchema,
)]
pub enum EnablePaymentLinkRequest {
/// Request for enabling payment link
Enable,
@ -7994,7 +8008,9 @@ pub enum EnablePaymentLinkRequest {
Skip,
}
#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize, Default, ToSchema)]
#[derive(
Clone, Copy, Debug, PartialEq, serde::Serialize, serde::Deserialize, Default, ToSchema,
)]
pub enum MitExemptionRequest {
/// Request for applying MIT exemption
Apply,
@ -8004,7 +8020,9 @@ pub enum MitExemptionRequest {
}
/// Set to `present` to indicate that the customer is in your checkout flow during this payment, and therefore is able to authenticate. This parameter should be `absent` when merchant's doing merchant initiated payments and customer is not present while doing the payment.
#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize, Default, ToSchema)]
#[derive(
Clone, Copy, Debug, PartialEq, serde::Serialize, serde::Deserialize, Default, ToSchema,
)]
#[serde(rename_all = "snake_case")]
pub enum PresenceOfCustomerDuringPayment {
/// Customer is present during the payment. This is the default value