refactor(router): move api models into separate crate (#103)

This commit is contained in:
ItsMeShashank
2022-12-12 15:36:45 +05:30
committed by GitHub
parent 81593e0a6b
commit d6afbe8011
49 changed files with 2272 additions and 1863 deletions

View File

@ -22,7 +22,7 @@ use crate::{
services,
types::{
self,
api::{self, enums as api_enums},
api::{self, enums as api_enums, CustomerAcceptanceExt, MandateValidationFieldsExt},
storage::{self, enums as storage_enums, ephemeral_key},
},
utils::{
@ -1092,9 +1092,9 @@ pub fn make_url_with_signature(
params: parameters,
return_url_with_query_params: url.to_string(),
http_method: if merchant_account.redirect_to_merchant_with_http_post {
services::Method::Post
services::Method::Post.to_string()
} else {
services::Method::Get
services::Method::Get.to_string()
},
headers: Vec::new(),
})
@ -1160,14 +1160,14 @@ pub fn generate_mandate(
Some(match data.mandate_type {
api::MandateType::SingleUse(data) => new_mandate
.set_mandate_amount(Some(data.amount))
.set_mandate_currency(Some(data.currency))
.set_mandate_currency(Some(data.currency.into()))
.set_mandate_type(storage_enums::MandateType::SingleUse)
.to_owned(),
api::MandateType::MultiUse(op_data) => match op_data {
Some(data) => new_mandate
.set_mandate_amount(Some(data.amount))
.set_mandate_currency(Some(data.currency)),
.set_mandate_currency(Some(data.currency.into())),
None => &mut new_mandate,
}
.set_mandate_type(storage_enums::MandateType::MultiUse)