feat(connector): add auth_token_refresh for payu and some quick bug fixes (#426)

Co-authored-by: Narayan Bhat <narayan.bhat@juspay.in>
Co-authored-by: samraat bansal <samraat.bansal@samraat.bansal-MacBookPro>
Co-authored-by: Jagan Elavarasan <jaganelavarasan@gmail.com>
This commit is contained in:
SamraatBansal
2023-01-21 23:34:44 +05:30
committed by GitHub
parent beae6c474c
commit da6a026ef7
13 changed files with 396 additions and 133 deletions

View File

@ -18,6 +18,20 @@ pub fn missing_field_err(
}
type Error = error_stack::Report<errors::ConnectorError>;
pub trait AccessTokenRequestInfo {
fn get_request_id(&self) -> Result<String, Error>;
}
impl AccessTokenRequestInfo for types::RefreshTokenRouterData {
fn get_request_id(&self) -> Result<String, Error> {
self.request
.id
.clone()
.ok_or_else(missing_field_err("request.id"))
}
}
pub trait PaymentsRequestData {
fn get_attempt_id(&self) -> Result<String, Error>;
fn get_billing(&self) -> Result<&api::Address, Error>;