mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 17:19:15 +08:00
feat(router): add payments incremental authorization api (#3038)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
9274cefbdd
commit
a0cfdd3fb1
@ -52,4 +52,5 @@ pub struct PaymentIntent {
|
||||
pub surcharge_applicable: Option<bool>,
|
||||
pub request_incremental_authorization: storage_enums::RequestIncrementalAuthorization,
|
||||
pub incremental_authorization_allowed: Option<bool>,
|
||||
pub authorization_count: Option<i32>,
|
||||
}
|
||||
|
||||
@ -359,6 +359,10 @@ pub enum PaymentAttemptUpdate {
|
||||
connector: Option<String>,
|
||||
updated_by: String,
|
||||
},
|
||||
IncrementalAuthorizationAmountUpdate {
|
||||
amount: i64,
|
||||
amount_capturable: i64,
|
||||
},
|
||||
}
|
||||
|
||||
impl ForeignIDRef for PaymentAttempt {
|
||||
|
||||
@ -109,6 +109,7 @@ pub struct PaymentIntentNew {
|
||||
pub surcharge_applicable: Option<bool>,
|
||||
pub request_incremental_authorization: storage_enums::RequestIncrementalAuthorization,
|
||||
pub incremental_authorization_allowed: Option<bool>,
|
||||
pub authorization_count: Option<i32>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
@ -186,6 +187,12 @@ pub enum PaymentIntentUpdate {
|
||||
surcharge_applicable: bool,
|
||||
updated_by: String,
|
||||
},
|
||||
IncrementalAuthorizationAmountUpdate {
|
||||
amount: i64,
|
||||
},
|
||||
AuthorizationCountUpdate {
|
||||
authorization_count: i32,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default)]
|
||||
@ -218,6 +225,7 @@ pub struct PaymentIntentUpdateInternal {
|
||||
pub updated_by: String,
|
||||
pub surcharge_applicable: Option<bool>,
|
||||
pub incremental_authorization_allowed: Option<bool>,
|
||||
pub authorization_count: Option<i32>,
|
||||
}
|
||||
|
||||
impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
|
||||
@ -381,6 +389,16 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
|
||||
updated_by,
|
||||
..Default::default()
|
||||
},
|
||||
PaymentIntentUpdate::IncrementalAuthorizationAmountUpdate { amount } => Self {
|
||||
amount: Some(amount),
|
||||
..Default::default()
|
||||
},
|
||||
PaymentIntentUpdate::AuthorizationCountUpdate {
|
||||
authorization_count,
|
||||
} => Self {
|
||||
authorization_count: Some(authorization_count),
|
||||
..Default::default()
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user