feat(revenue_recovery): Add redis-based payment processor token tracking for revenue recovery (#8846)

Co-authored-by: Aniket Burman <aniket.burman@Aniket-Burman-JDXHW2PH34.local>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: chikke srujan <121822803+srujanchikke@users.noreply.github.com>
Co-authored-by: Aditya Chaurasia <113281443+AdityaKumaar21@users.noreply.github.com>
This commit is contained in:
Aniket Burman
2025-08-25 14:58:39 +05:30
committed by GitHub
parent f5db00352b
commit 0b59b9086c
24 changed files with 1364 additions and 172 deletions

View File

@ -752,10 +752,25 @@ impl PaymentIntent {
retry_count: None,
invoice_next_billing_time: None,
invoice_billing_started_at_time: None,
card_isin: None,
card_network: None,
// No charge id is present here since it is an internal payment and we didn't call connector yet.
charge_id: None,
card_info: api_models::payments::AdditionalCardInfo {
card_issuer: None,
card_network: None,
card_type: None,
card_issuing_country: None,
bank_code: None,
last4: None,
card_isin: None,
card_extended_bin: None,
card_exp_month: None,
card_exp_year: None,
card_holder_name: None,
payment_checks: None,
authentication_data: None,
is_regulated: None,
signature_network: None,
},
})
}

View File

@ -54,12 +54,10 @@ pub struct RevenueRecoveryAttemptData {
pub invoice_next_billing_time: Option<PrimitiveDateTime>,
/// Time at which the invoice created
pub invoice_billing_started_at_time: Option<PrimitiveDateTime>,
/// card network type
pub card_network: Option<common_enums::CardNetwork>,
/// card isin
pub card_isin: Option<String>,
/// stripe specific id used to validate duplicate attempts in revenue recovery flow
pub charge_id: Option<String>,
/// Additional card details
pub card_info: api_payments::AdditionalCardInfo,
}
/// This is unified struct for Revenue Recovery Invoice Data and it is constructed from billing connectors
@ -227,10 +225,9 @@ impl
network_error_message: None,
retry_count: invoice_details.retry_count,
invoice_next_billing_time: invoice_details.next_billing_at,
card_network: billing_connector_payment_details.card_network.clone(),
card_isin: billing_connector_payment_details.card_isin.clone(),
charge_id: billing_connector_payment_details.charge_id.clone(),
invoice_billing_started_at_time: invoice_details.billing_started_at,
card_info: billing_connector_payment_details.card_info.clone(),
}
}
}

View File

@ -28,12 +28,10 @@ pub struct BillingConnectorPaymentsSyncResponse {
pub payment_method_type: common_enums::enums::PaymentMethod,
/// payment method sub type of the payment attempt.
pub payment_method_sub_type: common_enums::enums::PaymentMethodType,
/// card netword network
pub card_network: Option<common_enums::CardNetwork>,
/// card isin
pub card_isin: Option<String>,
/// stripe specific id used to validate duplicate attempts.
pub charge_id: Option<String>,
/// card information
pub card_info: api_models::payments::AdditionalCardInfo,
}
#[derive(Debug, Clone)]