mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 19:46:48 +08:00
feat(recovery-events): add revenue recovery topic and vector config to push these events to s3 (#8285)
Co-authored-by: Nishanth Challa <nishanth.challa@Nishanth-Challa-C0WGKCFHLF.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>
This commit is contained in:
committed by
GitHub
parent
b5dddbc1a8
commit
17d34a29e4
@ -1562,11 +1562,14 @@ pub struct PaymentAttemptResponse {
|
||||
/// The global identifier for the payment attempt
|
||||
#[schema(value_type = String)]
|
||||
pub id: id_type::GlobalAttemptId,
|
||||
|
||||
/// /// The status of the attempt
|
||||
#[schema(value_type = AttemptStatus, example = "charged")]
|
||||
pub status: enums::AttemptStatus,
|
||||
|
||||
/// Amount related information for this payment and attempt
|
||||
pub amount: PaymentAttemptAmountDetails,
|
||||
|
||||
/// Name of the connector that was used for the payment attempt.
|
||||
#[schema(example = "stripe")]
|
||||
pub connector: Option<String>,
|
||||
@ -1624,6 +1627,7 @@ pub struct PaymentAttemptResponse {
|
||||
|
||||
/// Value passed in X-CLIENT-SOURCE header during payments confirm request by the client
|
||||
pub client_source: Option<String>,
|
||||
|
||||
/// Value passed in X-CLIENT-VERSION header during payments confirm request by the client
|
||||
pub client_version: Option<String>,
|
||||
|
||||
@ -1643,12 +1647,21 @@ pub struct PaymentAttemptRecordResponse {
|
||||
/// The status of the attempt
|
||||
#[schema(value_type = AttemptStatus, example = "charged")]
|
||||
pub status: enums::AttemptStatus,
|
||||
/// The amount of the payment attempt
|
||||
#[schema(value_type = i64, example = 6540)]
|
||||
pub amount: MinorUnit,
|
||||
/// Error details for the payment attempt, if any.
|
||||
/// This includes fields like error code, network advice code, and network decline code.
|
||||
pub error_details: Option<RecordAttemptErrorDetails>,
|
||||
/// Additional data that might be required by hyperswitch based on the requested features by the merchants.
|
||||
#[schema(value_type = Option<FeatureMetadata>)]
|
||||
pub payment_intent_feature_metadata: Option<FeatureMetadata>,
|
||||
/// Additional data that might be required by hyperswitch, to enable some specific features.
|
||||
pub payment_attempt_feature_metadata: Option<PaymentAttemptFeatureMetadata>,
|
||||
/// attempt created at timestamp
|
||||
pub created_at: PrimitiveDateTime,
|
||||
}
|
||||
|
||||
#[cfg(feature = "v2")]
|
||||
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize, PartialEq, ToSchema)]
|
||||
pub struct PaymentAttemptFeatureMetadata {
|
||||
@ -8803,6 +8816,9 @@ pub struct PaymentRevenueRecoveryMetadata {
|
||||
/// Invoice Next billing time
|
||||
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
|
||||
pub invoice_next_billing_time: Option<PrimitiveDateTime>,
|
||||
/// Invoice Next billing time
|
||||
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
|
||||
pub invoice_billing_started_at_time: Option<PrimitiveDateTime>,
|
||||
/// First Payment Attempt Payment Gateway Error Code
|
||||
#[schema(value_type = Option<String>, example = "card_declined")]
|
||||
pub first_payment_attempt_pg_error_code: Option<String>,
|
||||
@ -8832,6 +8848,15 @@ pub struct BillingConnectorAdditionalCardInfo {
|
||||
pub card_issuer: Option<String>,
|
||||
}
|
||||
|
||||
#[cfg(feature = "v2")]
|
||||
impl BillingConnectorPaymentMethodDetails {
|
||||
pub fn get_billing_connector_card_info(&self) -> Option<&BillingConnectorAdditionalCardInfo> {
|
||||
match self {
|
||||
Self::Card(card_details) => Some(card_details),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v2")]
|
||||
impl PaymentRevenueRecoveryMetadata {
|
||||
pub fn set_payment_transmission_field_for_api_request(
|
||||
@ -8942,6 +8967,11 @@ pub struct PaymentsAttemptRecordRequest {
|
||||
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
|
||||
pub invoice_next_billing_time: Option<PrimitiveDateTime>,
|
||||
|
||||
/// Next Billing time of the Invoice
|
||||
#[schema(example = "2022-09-10T10:11:12Z")]
|
||||
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
|
||||
pub invoice_billing_started_at_time: Option<PrimitiveDateTime>,
|
||||
|
||||
/// source where the payment was triggered by
|
||||
#[schema(value_type = TriggeredBy, example = "internal" )]
|
||||
pub triggered_by: common_enums::TriggeredBy,
|
||||
|
||||
Reference in New Issue
Block a user