mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 12:06:56 +08:00
feat(router): modify attempt_id generation logic to accommodate payment_id as prefix (#1596)
This commit is contained in:
committed by
GitHub
parent
6447b04574
commit
82e1bf0d16
@ -39,6 +39,7 @@ pub struct PaymentIntent {
|
||||
#[diesel(deserialize_as = super::OptionalDieselArray<pii::SecretSerdeValue>)]
|
||||
pub order_details: Option<Vec<pii::SecretSerdeValue>>,
|
||||
pub udf: Option<pii::SecretSerdeValue>,
|
||||
pub attempt_count: i16,
|
||||
}
|
||||
|
||||
#[derive(
|
||||
@ -84,6 +85,7 @@ pub struct PaymentIntentNew {
|
||||
#[diesel(deserialize_as = super::OptionalDieselArray<pii::SecretSerdeValue>)]
|
||||
pub order_details: Option<Vec<pii::SecretSerdeValue>>,
|
||||
pub udf: Option<pii::SecretSerdeValue>,
|
||||
pub attempt_count: i16,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
@ -135,6 +137,7 @@ pub enum PaymentIntentUpdate {
|
||||
StatusAndAttemptUpdate {
|
||||
status: storage_enums::IntentStatus,
|
||||
active_attempt_id: String,
|
||||
attempt_count: i16,
|
||||
},
|
||||
}
|
||||
|
||||
@ -164,6 +167,7 @@ pub struct PaymentIntentUpdateInternal {
|
||||
#[diesel(deserialize_as = super::OptionalDieselArray<pii::SecretSerdeValue>)]
|
||||
pub order_details: Option<Vec<pii::SecretSerdeValue>>,
|
||||
pub udf: Option<pii::SecretSerdeValue>,
|
||||
pub attempt_count: Option<i16>,
|
||||
}
|
||||
|
||||
impl PaymentIntentUpdate {
|
||||
@ -302,9 +306,11 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
|
||||
PaymentIntentUpdate::StatusAndAttemptUpdate {
|
||||
status,
|
||||
active_attempt_id,
|
||||
attempt_count,
|
||||
} => Self {
|
||||
status: Some(status),
|
||||
active_attempt_id: Some(active_attempt_id),
|
||||
attempt_count: Some(attempt_count),
|
||||
..Default::default()
|
||||
},
|
||||
}
|
||||
|
||||
@ -478,6 +478,7 @@ diesel::table! {
|
||||
business_label -> Varchar,
|
||||
order_details -> Nullable<Array<Nullable<Jsonb>>>,
|
||||
udf -> Nullable<Jsonb>,
|
||||
attempt_count -> Int2,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user