mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-03 13:30:39 +08:00
feat(core): add sessions api endpoint (#104)
This commit is contained in:
@ -92,7 +92,6 @@ pub trait GetTracker<F, D, R>: Send {
|
||||
state: &'a AppState,
|
||||
payment_id: &api::PaymentIdType,
|
||||
merchant_id: &str,
|
||||
connector: types::Connector,
|
||||
request: &R,
|
||||
mandate_type: Option<api::MandateTxnType>,
|
||||
storage_scheme: enums::MerchantStorageScheme,
|
||||
@ -129,6 +128,12 @@ pub trait Domain<F: Clone, R>: Send + Sync {
|
||||
) -> CustomResult<(), errors::ApiErrorResponse> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn get_connector<'a>(
|
||||
&'a self,
|
||||
merchant_account: &storage::MerchantAccount,
|
||||
state: &AppState,
|
||||
) -> CustomResult<api::ConnectorCallType, errors::ApiErrorResponse>;
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
@ -224,9 +229,14 @@ where
|
||||
if helpers::check_if_operation_confirm(self) {
|
||||
metrics::TASKS_ADDED_COUNT.add(&metrics::CONTEXT, 1, &[]); // Metrics
|
||||
|
||||
let connector_name = payment_attempt
|
||||
.connector
|
||||
.clone()
|
||||
.ok_or(errors::ApiErrorResponse::InternalServerError)?;
|
||||
|
||||
let schedule_time = payment_sync::get_sync_process_schedule_time(
|
||||
&*state.store,
|
||||
&payment_attempt.connector,
|
||||
&connector_name,
|
||||
&payment_attempt.merchant_id,
|
||||
0,
|
||||
)
|
||||
@ -245,6 +255,14 @@ where
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
async fn get_connector<'a>(
|
||||
&'a self,
|
||||
merchant_account: &storage::MerchantAccount,
|
||||
state: &AppState,
|
||||
) -> CustomResult<api::ConnectorCallType, errors::ApiErrorResponse> {
|
||||
helpers::get_connector_default(merchant_account, state).await
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
@ -278,6 +296,14 @@ where
|
||||
))
|
||||
}
|
||||
|
||||
async fn get_connector<'a>(
|
||||
&'a self,
|
||||
merchant_account: &storage::MerchantAccount,
|
||||
state: &AppState,
|
||||
) -> CustomResult<api::ConnectorCallType, errors::ApiErrorResponse> {
|
||||
helpers::get_connector_default(merchant_account, state).await
|
||||
}
|
||||
|
||||
#[instrument(skip_all)]
|
||||
async fn make_pm_data<'a>(
|
||||
&'a self,
|
||||
@ -351,6 +377,14 @@ where
|
||||
)> {
|
||||
Ok((Box::new(self), None))
|
||||
}
|
||||
|
||||
async fn get_connector<'a>(
|
||||
&'a self,
|
||||
merchant_account: &storage::MerchantAccount,
|
||||
state: &AppState,
|
||||
) -> CustomResult<api::ConnectorCallType, errors::ApiErrorResponse> {
|
||||
helpers::get_connector_default(merchant_account, state).await
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
@ -400,4 +434,12 @@ where
|
||||
)> {
|
||||
Ok((Box::new(self), None))
|
||||
}
|
||||
|
||||
async fn get_connector<'a>(
|
||||
&'a self,
|
||||
merchant_account: &storage::MerchantAccount,
|
||||
state: &AppState,
|
||||
) -> CustomResult<api::ConnectorCallType, errors::ApiErrorResponse> {
|
||||
helpers::get_connector_default(merchant_account, state).await
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user