@@ -33,7 +33,7 @@ pub struct PaymentIntent {
33
33
pub last_synced : Option < PrimitiveDateTime > ,
34
34
pub setup_future_usage : Option < storage_enums:: FutureUsage > ,
35
35
pub client_secret : common_utils:: types:: ClientSecret ,
36
- pub active_attempt_id : Option < String > ,
36
+ pub active_attempt_id : Option < common_utils :: id_type :: GlobalAttemptId > ,
37
37
#[ diesel( deserialize_as = super :: OptionalDieselArray <masking:: Secret <OrderDetailsWithAmount >>) ]
38
38
pub order_details : Option < Vec < masking:: Secret < OrderDetailsWithAmount > > > ,
39
39
pub allowed_payment_method_types : Option < pii:: SecretSerdeValue > ,
@@ -250,7 +250,7 @@ pub struct PaymentIntentNew {
250
250
pub last_synced : Option < PrimitiveDateTime > ,
251
251
pub setup_future_usage : Option < storage_enums:: FutureUsage > ,
252
252
pub client_secret : common_utils:: types:: ClientSecret ,
253
- pub active_attempt_id : Option < String > ,
253
+ pub active_attempt_id : Option < common_utils :: id_type :: GlobalAttemptId > ,
254
254
#[ diesel( deserialize_as = super :: OptionalDieselArray <masking:: Secret <OrderDetailsWithAmount >>) ]
255
255
pub order_details : Option < Vec < masking:: Secret < OrderDetailsWithAmount > > > ,
256
256
pub allowed_payment_method_types : Option < pii:: SecretSerdeValue > ,
@@ -359,6 +359,7 @@ pub enum PaymentIntentUpdate {
359
359
ConfirmIntent {
360
360
status : storage_enums:: IntentStatus ,
361
361
updated_by : String ,
362
+ active_attempt_id : common_utils:: id_type:: GlobalAttemptId ,
362
363
} ,
363
364
/// Update the payment intent details on payment intent confirmation, after calling the connector
364
365
ConfirmIntentPostUpdate {
@@ -520,7 +521,7 @@ pub struct PaymentIntentUpdateInternal {
520
521
// pub setup_future_usage: Option<storage_enums::FutureUsage>,
521
522
// pub metadata: Option<pii::SecretSerdeValue>,
522
523
pub modified_at : PrimitiveDateTime ,
523
- // pub active_attempt_id: Option<String >,
524
+ pub active_attempt_id : Option < common_utils :: id_type :: GlobalAttemptId > ,
524
525
// pub description: Option<String>,
525
526
// pub statement_descriptor: Option<String>,
526
527
// #[diesel(deserialize_as = super::OptionalDieselArray<pii::SecretSerdeValue>)]
@@ -594,7 +595,7 @@ impl PaymentIntentUpdate {
594
595
// setup_future_usage,
595
596
// metadata,
596
597
modified_at : _,
597
- // active_attempt_id,
598
+ active_attempt_id,
598
599
// description,
599
600
// statement_descriptor,
600
601
// order_details,
@@ -620,7 +621,7 @@ impl PaymentIntentUpdate {
620
621
// setup_future_usage: setup_future_usage.or(source.setup_future_usage),
621
622
// metadata: metadata.or(source.metadata),
622
623
modified_at : common_utils:: date_time:: now ( ) ,
623
- // active_attempt_id: active_attempt_id.unwrap_or (source.active_attempt_id),
624
+ active_attempt_id : active_attempt_id. or ( source. active_attempt_id ) ,
624
625
// description: description.or(source.description),
625
626
// statement_descriptor: statement_descriptor.or(source.statement_descriptor),
626
627
// order_details: order_details.or(source.order_details),
@@ -735,15 +736,21 @@ impl PaymentIntentUpdate {
735
736
impl From < PaymentIntentUpdate > for PaymentIntentUpdateInternal {
736
737
fn from ( payment_intent_update : PaymentIntentUpdate ) -> Self {
737
738
match payment_intent_update {
738
- PaymentIntentUpdate :: ConfirmIntent { status, updated_by } => Self {
739
+ PaymentIntentUpdate :: ConfirmIntent {
740
+ status,
741
+ updated_by,
742
+ active_attempt_id,
743
+ } => Self {
739
744
status : Some ( status) ,
740
745
modified_at : common_utils:: date_time:: now ( ) ,
741
746
updated_by,
747
+ active_attempt_id : Some ( active_attempt_id) ,
742
748
} ,
743
749
PaymentIntentUpdate :: ConfirmIntentPostUpdate { status, updated_by } => Self {
744
750
status : Some ( status) ,
745
751
modified_at : common_utils:: date_time:: now ( ) ,
746
752
updated_by,
753
+ active_attempt_id : None ,
747
754
} ,
748
755
}
749
756
}
0 commit comments