fix(router): aggregate critical hotfixes for v0.5.10 (#1162)

Co-authored-by: Narayan Bhat <narayan.bhat@juspay.in>
Co-authored-by: Jagan Elavarasan <jaganelavarasan@gmail.com>
Co-authored-by: SamraatBansal <samraatbansal7@gmail.com>
Co-authored-by: Arun Raj M <jarnura47@gmail.com>
This commit is contained in:
ItsMeShashank
2023-05-17 15:39:00 +05:30
committed by GitHub
parent 2ce5d5ffe4
commit ed22b2af76
6 changed files with 21 additions and 7 deletions

View File

@ -170,6 +170,7 @@ pub trait PaymentsAuthorizeRequestData {
fn is_mandate_payment(&self) -> bool;
fn get_webhook_url(&self) -> Result<String, Error>;
fn get_router_return_url(&self) -> Result<String, Error>;
fn is_wallet(&self) -> bool;
fn get_payment_method_type(&self) -> Result<storage_models::enums::PaymentMethodType, Error>;
}
@ -234,6 +235,10 @@ impl PaymentsAuthorizeRequestData for types::PaymentsAuthorizeData {
.clone()
.ok_or_else(missing_field_err("webhook_url"))
}
fn is_wallet(&self) -> bool {
matches!(self.payment_method_data, api::PaymentMethodData::Wallet(_))
}
fn get_payment_method_type(&self) -> Result<storage_models::enums::PaymentMethodType, Error> {
self.payment_method_type
.to_owned()