-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): api ,domain and diesel model changes for extended authori…
…zation (#6607)
- Loading branch information
1 parent
ed276ec
commit e4210b0
Showing
34 changed files
with
557 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#[cfg(feature = "v1")] | ||
use common_enums::enums; | ||
#[cfg(feature = "v1")] | ||
use common_utils::errors; | ||
|
||
#[cfg(feature = "v1")] | ||
use crate::payments; | ||
|
||
#[cfg(feature = "v1")] | ||
impl crate::ValidateFieldAndGet<payments::PaymentsRequest> | ||
for common_utils::types::RequestExtendedAuthorizationBool | ||
{ | ||
fn validate_field_and_get( | ||
&self, | ||
request: &payments::PaymentsRequest, | ||
) -> errors::CustomResult<Self, errors::ValidationError> | ||
where | ||
Self: Sized, | ||
{ | ||
match request.capture_method{ | ||
Some(enums::CaptureMethod::Automatic) | ||
| Some(enums::CaptureMethod::Scheduled) | ||
| Some(enums::CaptureMethod::SequentialAutomatic) | ||
| None => Err(error_stack::report!(errors::ValidationError::InvalidValue { message: "request_extended_authorization must be sent only if capture method is manual or manual_multiple".to_string() })), | ||
Some(enums::CaptureMethod::Manual) | ||
| Some(enums::CaptureMethod::ManualMultiple) => Ok(*self) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.