feat: cards info api (#749)

Co-authored-by: Jagan <jaganelavarasan@gmail.com>
Co-authored-by: Kartikeya Hegde <karthikey.hegde@juspay.in>
Co-authored-by: Arun Raj M <jarnura47@gmail.com>
This commit is contained in:
Narayan Bhat
2023-03-28 19:04:58 +05:30
committed by GitHub
parent 20b4372bfe
commit b15b8f7b43
27 changed files with 1336 additions and 299 deletions

View File

@ -33,6 +33,22 @@ where
#[derive(Debug)]
pub struct ApiKeyAuth;
pub struct NoAuth;
#[async_trait]
impl<A> AuthenticateAndFetch<(), A> for NoAuth
where
A: AppStateInfo + Sync,
{
async fn authenticate_and_fetch(
&self,
_request_headers: &HeaderMap,
_state: &A,
) -> RouterResult<()> {
Ok(())
}
}
#[async_trait]
impl<A> AuthenticateAndFetch<storage::MerchantAccount, A> for ApiKeyAuth
where
@ -243,6 +259,12 @@ impl ClientSecretFetch for PaymentMethodListRequest {
}
}
impl ClientSecretFetch for api_models::cards_info::CardsInfoRequest {
fn get_client_secret(&self) -> Option<&String> {
self.client_secret.as_ref()
}
}
pub fn jwt_auth_or<'a, T, A: AppStateInfo>(
default_auth: &'a dyn AuthenticateAndFetch<T, A>,
headers: &HeaderMap,