mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 00:49:42 +08:00
feat(connector): [DUMMY_CONNECTOR] crate restructuring (#8372)
This commit is contained in:
@ -26,7 +26,7 @@ oltp = ["storage_impl/oltp"]
|
||||
kv_store = ["scheduler/kv_store"]
|
||||
accounts_cache = []
|
||||
vergen = ["router_env/vergen"]
|
||||
dummy_connector = ["api_models/dummy_connector", "euclid/dummy_connector", "hyperswitch_interfaces/dummy_connector", "kgraph_utils/dummy_connector", "payment_methods/dummy_connector", "hyperswitch_domain_models/dummy_connector"]
|
||||
dummy_connector = ["api_models/dummy_connector", "euclid/dummy_connector", "hyperswitch_interfaces/dummy_connector", "kgraph_utils/dummy_connector", "payment_methods/dummy_connector", "hyperswitch_domain_models/dummy_connector","hyperswitch_connectors/dummy_connector"]
|
||||
external_access_dc = ["dummy_connector"]
|
||||
detailed_errors = ["api_models/detailed_errors", "error-stack/serde"]
|
||||
payouts = ["api_models/payouts", "common_enums/payouts", "hyperswitch_connectors/payouts", "hyperswitch_domain_models/payouts", "storage_impl/payouts", "payment_methods/payouts"]
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
pub mod dummyconnector;
|
||||
pub mod utils;
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
pub use hyperswitch_connectors::connectors::DummyConnector;
|
||||
pub use hyperswitch_connectors::connectors::{
|
||||
aci, aci::Aci, adyen, adyen::Adyen, adyenplatform, adyenplatform::Adyenplatform, airwallex,
|
||||
airwallex::Airwallex, amazonpay, amazonpay::Amazonpay, archipel, archipel::Archipel,
|
||||
@ -41,6 +41,3 @@ pub use hyperswitch_connectors::connectors::{
|
||||
worldpayvantiv::Worldpayvantiv, worldpayxml, worldpayxml::Worldpayxml, xendit, xendit::Xendit,
|
||||
zen, zen::Zen, zsl, zsl::Zsl,
|
||||
};
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
pub use self::dummyconnector::DummyConnector;
|
||||
|
||||
@ -1,630 +0,0 @@
|
||||
pub mod transformers;
|
||||
|
||||
use std::fmt::Debug;
|
||||
|
||||
use common_utils::{consts as common_consts, request::RequestContent};
|
||||
use diesel_models::enums;
|
||||
use error_stack::{report, ResultExt};
|
||||
|
||||
use super::utils::RefundsRequestData;
|
||||
use crate::{
|
||||
configs::settings,
|
||||
connector::utils as connector_utils,
|
||||
core::errors::{self, CustomResult},
|
||||
events::connector_api_logs::ConnectorEvent,
|
||||
headers,
|
||||
services::{
|
||||
self,
|
||||
request::{self, Mask},
|
||||
ConnectorIntegration, ConnectorSpecifications, ConnectorValidation,
|
||||
},
|
||||
types::{
|
||||
self,
|
||||
api::{self, ConnectorCommon, ConnectorCommonExt},
|
||||
ErrorResponse, Response,
|
||||
},
|
||||
utils::BytesExt,
|
||||
};
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct DummyConnector<const T: u8>;
|
||||
|
||||
impl<const T: u8> api::Payment for DummyConnector<T> {}
|
||||
impl<const T: u8> api::PaymentSession for DummyConnector<T> {}
|
||||
impl<const T: u8> api::ConnectorAccessToken for DummyConnector<T> {}
|
||||
impl<const T: u8> api::MandateSetup for DummyConnector<T> {}
|
||||
impl<const T: u8> api::PaymentAuthorize for DummyConnector<T> {}
|
||||
impl<const T: u8> api::PaymentSync for DummyConnector<T> {}
|
||||
impl<const T: u8> api::PaymentCapture for DummyConnector<T> {}
|
||||
impl<const T: u8> api::PaymentVoid for DummyConnector<T> {}
|
||||
impl<const T: u8> api::Refund for DummyConnector<T> {}
|
||||
impl<const T: u8> api::RefundExecute for DummyConnector<T> {}
|
||||
impl<const T: u8> api::RefundSync for DummyConnector<T> {}
|
||||
impl<const T: u8> api::PaymentToken for DummyConnector<T> {}
|
||||
|
||||
impl<const T: u8>
|
||||
ConnectorIntegration<
|
||||
api::PaymentMethodToken,
|
||||
types::PaymentMethodTokenizationData,
|
||||
types::PaymentsResponseData,
|
||||
> for DummyConnector<T>
|
||||
{
|
||||
// Not Implemented (R)
|
||||
}
|
||||
|
||||
impl<const T: u8, Flow, Request, Response> ConnectorCommonExt<Flow, Request, Response>
|
||||
for DummyConnector<T>
|
||||
where
|
||||
Self: ConnectorIntegration<Flow, Request, Response>,
|
||||
{
|
||||
fn build_headers(
|
||||
&self,
|
||||
req: &types::RouterData<Flow, Request, Response>,
|
||||
_connectors: &settings::Connectors,
|
||||
) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> {
|
||||
let mut header = vec![
|
||||
(
|
||||
headers::CONTENT_TYPE.to_string(),
|
||||
types::PaymentsAuthorizeType::get_content_type(self)
|
||||
.to_string()
|
||||
.into(),
|
||||
),
|
||||
(
|
||||
common_consts::TENANT_HEADER.to_string(),
|
||||
req.tenant_id.get_string_repr().to_string().into(),
|
||||
),
|
||||
];
|
||||
let mut api_key = self.get_auth_header(&req.connector_auth_type)?;
|
||||
header.append(&mut api_key);
|
||||
Ok(header)
|
||||
}
|
||||
}
|
||||
|
||||
impl<const T: u8> ConnectorCommon for DummyConnector<T> {
|
||||
fn id(&self) -> &'static str {
|
||||
Into::<transformers::DummyConnectors>::into(T).get_dummy_connector_id()
|
||||
}
|
||||
|
||||
fn common_get_content_type(&self) -> &'static str {
|
||||
"application/json"
|
||||
}
|
||||
|
||||
fn base_url<'a>(&self, connectors: &'a settings::Connectors) -> &'a str {
|
||||
connectors.dummyconnector.base_url.as_ref()
|
||||
}
|
||||
|
||||
fn get_auth_header(
|
||||
&self,
|
||||
auth_type: &types::ConnectorAuthType,
|
||||
) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> {
|
||||
let auth = transformers::DummyConnectorAuthType::try_from(auth_type)
|
||||
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
|
||||
Ok(vec![(
|
||||
headers::AUTHORIZATION.to_string(),
|
||||
auth.api_key.into_masked(),
|
||||
)])
|
||||
}
|
||||
|
||||
fn build_error_response(
|
||||
&self,
|
||||
res: Response,
|
||||
event_builder: Option<&mut ConnectorEvent>,
|
||||
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
|
||||
let response: transformers::DummyConnectorErrorResponse = res
|
||||
.response
|
||||
.parse_struct("DummyConnectorErrorResponse")
|
||||
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
|
||||
|
||||
event_builder.map(|i| i.set_error_response_body(&response));
|
||||
router_env::logger::info!(connector_response=?response);
|
||||
|
||||
Ok(ErrorResponse {
|
||||
status_code: res.status_code,
|
||||
code: response.error.code,
|
||||
message: response.error.message,
|
||||
reason: response.error.reason,
|
||||
attempt_status: None,
|
||||
connector_transaction_id: None,
|
||||
network_advice_code: None,
|
||||
network_decline_code: None,
|
||||
network_error_message: None,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl<const T: u8> ConnectorValidation for DummyConnector<T> {
|
||||
fn validate_connector_against_payment_request(
|
||||
&self,
|
||||
capture_method: Option<enums::CaptureMethod>,
|
||||
_payment_method: enums::PaymentMethod,
|
||||
_pmt: Option<enums::PaymentMethodType>,
|
||||
) -> CustomResult<(), errors::ConnectorError> {
|
||||
let capture_method = capture_method.unwrap_or_default();
|
||||
match capture_method {
|
||||
enums::CaptureMethod::Automatic
|
||||
| enums::CaptureMethod::Manual
|
||||
| enums::CaptureMethod::SequentialAutomatic => Ok(()),
|
||||
enums::CaptureMethod::ManualMultiple | enums::CaptureMethod::Scheduled => Err(
|
||||
connector_utils::construct_not_supported_error_report(capture_method, self.id()),
|
||||
),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<const T: u8>
|
||||
ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData>
|
||||
for DummyConnector<T>
|
||||
{
|
||||
//TODO: implement sessions flow
|
||||
}
|
||||
|
||||
impl<const T: u8>
|
||||
ConnectorIntegration<api::AccessTokenAuth, types::AccessTokenRequestData, types::AccessToken>
|
||||
for DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
impl<const T: u8>
|
||||
ConnectorIntegration<
|
||||
api::SetupMandate,
|
||||
types::SetupMandateRequestData,
|
||||
types::PaymentsResponseData,
|
||||
> for DummyConnector<T>
|
||||
{
|
||||
fn build_request(
|
||||
&self,
|
||||
_req: &types::RouterData<
|
||||
api::SetupMandate,
|
||||
types::SetupMandateRequestData,
|
||||
types::PaymentsResponseData,
|
||||
>,
|
||||
_connectors: &settings::Connectors,
|
||||
) -> CustomResult<Option<services::Request>, errors::ConnectorError> {
|
||||
Err(errors::ConnectorError::NotImplemented(
|
||||
"Setup Mandate flow for DummyConnector".to_string(),
|
||||
)
|
||||
.into())
|
||||
}
|
||||
}
|
||||
|
||||
impl<const T: u8>
|
||||
ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::PaymentsResponseData>
|
||||
for DummyConnector<T>
|
||||
{
|
||||
fn get_headers(
|
||||
&self,
|
||||
req: &types::PaymentsAuthorizeRouterData,
|
||||
connectors: &settings::Connectors,
|
||||
) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> {
|
||||
self.build_headers(req, connectors)
|
||||
}
|
||||
|
||||
fn get_content_type(&self) -> &'static str {
|
||||
self.common_get_content_type()
|
||||
}
|
||||
|
||||
fn get_url(
|
||||
&self,
|
||||
req: &types::PaymentsAuthorizeRouterData,
|
||||
connectors: &settings::Connectors,
|
||||
) -> CustomResult<String, errors::ConnectorError> {
|
||||
match req.payment_method {
|
||||
enums::PaymentMethod::Card
|
||||
| enums::PaymentMethod::Upi
|
||||
| enums::PaymentMethod::Wallet
|
||||
| enums::PaymentMethod::PayLater => {
|
||||
Ok(format!("{}/payment", self.base_url(connectors)))
|
||||
}
|
||||
_ => Err(error_stack::report!(errors::ConnectorError::NotSupported {
|
||||
message: format!("The payment method {} is not supported", req.payment_method),
|
||||
connector: Into::<transformers::DummyConnectors>::into(T).get_dummy_connector_id(),
|
||||
})),
|
||||
}
|
||||
}
|
||||
|
||||
fn get_request_body(
|
||||
&self,
|
||||
req: &types::PaymentsAuthorizeRouterData,
|
||||
_connectors: &settings::Connectors,
|
||||
) -> CustomResult<RequestContent, errors::ConnectorError> {
|
||||
let connector_req = transformers::DummyConnectorPaymentsRequest::<T>::try_from(req)?;
|
||||
Ok(RequestContent::Json(Box::new(connector_req)))
|
||||
}
|
||||
|
||||
fn build_request(
|
||||
&self,
|
||||
req: &types::PaymentsAuthorizeRouterData,
|
||||
connectors: &settings::Connectors,
|
||||
) -> CustomResult<Option<services::Request>, errors::ConnectorError> {
|
||||
Ok(Some(
|
||||
services::RequestBuilder::new()
|
||||
.method(services::Method::Post)
|
||||
.url(&types::PaymentsAuthorizeType::get_url(
|
||||
self, req, connectors,
|
||||
)?)
|
||||
.attach_default_headers()
|
||||
.headers(types::PaymentsAuthorizeType::get_headers(
|
||||
self, req, connectors,
|
||||
)?)
|
||||
.set_body(types::PaymentsAuthorizeType::get_request_body(
|
||||
self, req, connectors,
|
||||
)?)
|
||||
.build(),
|
||||
))
|
||||
}
|
||||
|
||||
fn handle_response(
|
||||
&self,
|
||||
data: &types::PaymentsAuthorizeRouterData,
|
||||
event_builder: Option<&mut ConnectorEvent>,
|
||||
res: Response,
|
||||
) -> CustomResult<types::PaymentsAuthorizeRouterData, errors::ConnectorError> {
|
||||
let response: transformers::PaymentsResponse = res
|
||||
.response
|
||||
.parse_struct("DummyConnector PaymentsResponse")
|
||||
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
|
||||
event_builder.map(|i| i.set_response_body(&response));
|
||||
router_env::logger::info!(connector_response=?response);
|
||||
types::RouterData::try_from(types::ResponseRouterData {
|
||||
response,
|
||||
data: data.clone(),
|
||||
http_code: res.status_code,
|
||||
})
|
||||
.change_context(errors::ConnectorError::ResponseHandlingFailed)
|
||||
}
|
||||
|
||||
fn get_error_response(
|
||||
&self,
|
||||
res: Response,
|
||||
event_builder: Option<&mut ConnectorEvent>,
|
||||
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
|
||||
self.build_error_response(res, event_builder)
|
||||
}
|
||||
}
|
||||
|
||||
impl<const T: u8>
|
||||
ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsResponseData>
|
||||
for DummyConnector<T>
|
||||
{
|
||||
fn get_headers(
|
||||
&self,
|
||||
req: &types::PaymentsSyncRouterData,
|
||||
connectors: &settings::Connectors,
|
||||
) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> {
|
||||
self.build_headers(req, connectors)
|
||||
}
|
||||
|
||||
fn get_content_type(&self) -> &'static str {
|
||||
self.common_get_content_type()
|
||||
}
|
||||
|
||||
fn get_url(
|
||||
&self,
|
||||
req: &types::PaymentsSyncRouterData,
|
||||
connectors: &settings::Connectors,
|
||||
) -> CustomResult<String, errors::ConnectorError> {
|
||||
match req
|
||||
.request
|
||||
.connector_transaction_id
|
||||
.get_connector_transaction_id()
|
||||
{
|
||||
Ok(transaction_id) => Ok(format!(
|
||||
"{}/payments/{}",
|
||||
self.base_url(connectors),
|
||||
transaction_id
|
||||
)),
|
||||
Err(_) => Err(error_stack::report!(
|
||||
errors::ConnectorError::MissingConnectorTransactionID
|
||||
)),
|
||||
}
|
||||
}
|
||||
|
||||
fn build_request(
|
||||
&self,
|
||||
req: &types::PaymentsSyncRouterData,
|
||||
connectors: &settings::Connectors,
|
||||
) -> CustomResult<Option<services::Request>, errors::ConnectorError> {
|
||||
Ok(Some(
|
||||
services::RequestBuilder::new()
|
||||
.method(services::Method::Get)
|
||||
.url(&types::PaymentsSyncType::get_url(self, req, connectors)?)
|
||||
.attach_default_headers()
|
||||
.headers(types::PaymentsSyncType::get_headers(self, req, connectors)?)
|
||||
.build(),
|
||||
))
|
||||
}
|
||||
|
||||
fn handle_response(
|
||||
&self,
|
||||
data: &types::PaymentsSyncRouterData,
|
||||
event_builder: Option<&mut ConnectorEvent>,
|
||||
res: Response,
|
||||
) -> CustomResult<types::PaymentsSyncRouterData, errors::ConnectorError> {
|
||||
let response: transformers::PaymentsResponse = res
|
||||
.response
|
||||
.parse_struct("dummyconnector PaymentsSyncResponse")
|
||||
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
|
||||
event_builder.map(|i| i.set_response_body(&response));
|
||||
router_env::logger::info!(connector_response=?response);
|
||||
types::RouterData::try_from(types::ResponseRouterData {
|
||||
response,
|
||||
data: data.clone(),
|
||||
http_code: res.status_code,
|
||||
})
|
||||
.change_context(errors::ConnectorError::ResponseHandlingFailed)
|
||||
}
|
||||
|
||||
fn get_error_response(
|
||||
&self,
|
||||
res: Response,
|
||||
event_builder: Option<&mut ConnectorEvent>,
|
||||
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
|
||||
self.build_error_response(res, event_builder)
|
||||
}
|
||||
}
|
||||
|
||||
impl<const T: u8>
|
||||
ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::PaymentsResponseData>
|
||||
for DummyConnector<T>
|
||||
{
|
||||
fn get_headers(
|
||||
&self,
|
||||
req: &types::PaymentsCaptureRouterData,
|
||||
connectors: &settings::Connectors,
|
||||
) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> {
|
||||
self.build_headers(req, connectors)
|
||||
}
|
||||
|
||||
fn get_content_type(&self) -> &'static str {
|
||||
self.common_get_content_type()
|
||||
}
|
||||
|
||||
fn get_url(
|
||||
&self,
|
||||
_req: &types::PaymentsCaptureRouterData,
|
||||
_connectors: &settings::Connectors,
|
||||
) -> CustomResult<String, errors::ConnectorError> {
|
||||
Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into())
|
||||
}
|
||||
|
||||
fn get_request_body(
|
||||
&self,
|
||||
_req: &types::PaymentsCaptureRouterData,
|
||||
_connectors: &settings::Connectors,
|
||||
) -> CustomResult<RequestContent, errors::ConnectorError> {
|
||||
Err(errors::ConnectorError::NotImplemented("get_request_body method".to_string()).into())
|
||||
}
|
||||
|
||||
fn build_request(
|
||||
&self,
|
||||
req: &types::PaymentsCaptureRouterData,
|
||||
connectors: &settings::Connectors,
|
||||
) -> CustomResult<Option<services::Request>, errors::ConnectorError> {
|
||||
Ok(Some(
|
||||
services::RequestBuilder::new()
|
||||
.method(services::Method::Post)
|
||||
.url(&types::PaymentsCaptureType::get_url(self, req, connectors)?)
|
||||
.attach_default_headers()
|
||||
.headers(types::PaymentsCaptureType::get_headers(
|
||||
self, req, connectors,
|
||||
)?)
|
||||
.build(),
|
||||
))
|
||||
}
|
||||
|
||||
fn handle_response(
|
||||
&self,
|
||||
data: &types::PaymentsCaptureRouterData,
|
||||
event_builder: Option<&mut ConnectorEvent>,
|
||||
res: Response,
|
||||
) -> CustomResult<types::PaymentsCaptureRouterData, errors::ConnectorError> {
|
||||
let response: transformers::PaymentsResponse = res
|
||||
.response
|
||||
.parse_struct("transformers PaymentsCaptureResponse")
|
||||
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
|
||||
event_builder.map(|i| i.set_response_body(&response));
|
||||
router_env::logger::info!(connector_response=?response);
|
||||
types::RouterData::try_from(types::ResponseRouterData {
|
||||
response,
|
||||
data: data.clone(),
|
||||
http_code: res.status_code,
|
||||
})
|
||||
.change_context(errors::ConnectorError::ResponseHandlingFailed)
|
||||
}
|
||||
|
||||
fn get_error_response(
|
||||
&self,
|
||||
res: Response,
|
||||
event_builder: Option<&mut ConnectorEvent>,
|
||||
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
|
||||
self.build_error_response(res, event_builder)
|
||||
}
|
||||
}
|
||||
|
||||
impl<const T: u8>
|
||||
ConnectorIntegration<api::Void, types::PaymentsCancelData, types::PaymentsResponseData>
|
||||
for DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
impl<const T: u8> ConnectorIntegration<api::Execute, types::RefundsData, types::RefundsResponseData>
|
||||
for DummyConnector<T>
|
||||
{
|
||||
fn get_headers(
|
||||
&self,
|
||||
req: &types::RefundsRouterData<api::Execute>,
|
||||
connectors: &settings::Connectors,
|
||||
) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> {
|
||||
self.build_headers(req, connectors)
|
||||
}
|
||||
|
||||
fn get_content_type(&self) -> &'static str {
|
||||
self.common_get_content_type()
|
||||
}
|
||||
|
||||
fn get_url(
|
||||
&self,
|
||||
req: &types::RefundsRouterData<api::Execute>,
|
||||
connectors: &settings::Connectors,
|
||||
) -> CustomResult<String, errors::ConnectorError> {
|
||||
Ok(format!(
|
||||
"{}/{}/refund",
|
||||
self.base_url(connectors),
|
||||
req.request.connector_transaction_id
|
||||
))
|
||||
}
|
||||
|
||||
fn get_request_body(
|
||||
&self,
|
||||
req: &types::RefundsRouterData<api::Execute>,
|
||||
_connectors: &settings::Connectors,
|
||||
) -> CustomResult<RequestContent, errors::ConnectorError> {
|
||||
let connector_req = transformers::DummyConnectorRefundRequest::try_from(req)?;
|
||||
Ok(RequestContent::Json(Box::new(connector_req)))
|
||||
}
|
||||
|
||||
fn build_request(
|
||||
&self,
|
||||
req: &types::RefundsRouterData<api::Execute>,
|
||||
connectors: &settings::Connectors,
|
||||
) -> CustomResult<Option<services::Request>, errors::ConnectorError> {
|
||||
let request = services::RequestBuilder::new()
|
||||
.method(services::Method::Post)
|
||||
.url(&types::RefundExecuteType::get_url(self, req, connectors)?)
|
||||
.attach_default_headers()
|
||||
.headers(types::RefundExecuteType::get_headers(
|
||||
self, req, connectors,
|
||||
)?)
|
||||
.set_body(types::RefundExecuteType::get_request_body(
|
||||
self, req, connectors,
|
||||
)?)
|
||||
.build();
|
||||
Ok(Some(request))
|
||||
}
|
||||
|
||||
fn handle_response(
|
||||
&self,
|
||||
data: &types::RefundsRouterData<api::Execute>,
|
||||
event_builder: Option<&mut ConnectorEvent>,
|
||||
res: Response,
|
||||
) -> CustomResult<types::RefundsRouterData<api::Execute>, errors::ConnectorError> {
|
||||
let response: transformers::RefundResponse = res
|
||||
.response
|
||||
.parse_struct("transformers RefundResponse")
|
||||
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
|
||||
event_builder.map(|i| i.set_response_body(&response));
|
||||
router_env::logger::info!(connector_response=?response);
|
||||
types::RouterData::try_from(types::ResponseRouterData {
|
||||
response,
|
||||
data: data.clone(),
|
||||
http_code: res.status_code,
|
||||
})
|
||||
.change_context(errors::ConnectorError::ResponseHandlingFailed)
|
||||
}
|
||||
|
||||
fn get_error_response(
|
||||
&self,
|
||||
res: Response,
|
||||
event_builder: Option<&mut ConnectorEvent>,
|
||||
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
|
||||
self.build_error_response(res, event_builder)
|
||||
}
|
||||
}
|
||||
|
||||
impl<const T: u8> ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponseData>
|
||||
for DummyConnector<T>
|
||||
{
|
||||
fn get_headers(
|
||||
&self,
|
||||
req: &types::RefundSyncRouterData,
|
||||
connectors: &settings::Connectors,
|
||||
) -> CustomResult<Vec<(String, request::Maskable<String>)>, errors::ConnectorError> {
|
||||
self.build_headers(req, connectors)
|
||||
}
|
||||
|
||||
fn get_content_type(&self) -> &'static str {
|
||||
self.common_get_content_type()
|
||||
}
|
||||
|
||||
fn get_url(
|
||||
&self,
|
||||
req: &types::RefundSyncRouterData,
|
||||
connectors: &settings::Connectors,
|
||||
) -> CustomResult<String, errors::ConnectorError> {
|
||||
let refund_id = req.request.get_connector_refund_id()?;
|
||||
Ok(format!(
|
||||
"{}/refunds/{}",
|
||||
self.base_url(connectors),
|
||||
refund_id
|
||||
))
|
||||
}
|
||||
|
||||
fn build_request(
|
||||
&self,
|
||||
req: &types::RefundSyncRouterData,
|
||||
connectors: &settings::Connectors,
|
||||
) -> CustomResult<Option<services::Request>, errors::ConnectorError> {
|
||||
Ok(Some(
|
||||
services::RequestBuilder::new()
|
||||
.method(services::Method::Get)
|
||||
.url(&types::RefundSyncType::get_url(self, req, connectors)?)
|
||||
.attach_default_headers()
|
||||
.headers(types::RefundSyncType::get_headers(self, req, connectors)?)
|
||||
.build(),
|
||||
))
|
||||
}
|
||||
|
||||
fn handle_response(
|
||||
&self,
|
||||
data: &types::RefundSyncRouterData,
|
||||
event_builder: Option<&mut ConnectorEvent>,
|
||||
res: Response,
|
||||
) -> CustomResult<types::RefundSyncRouterData, errors::ConnectorError> {
|
||||
let response: transformers::RefundResponse = res
|
||||
.response
|
||||
.parse_struct("transformers RefundSyncResponse")
|
||||
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
|
||||
event_builder.map(|i| i.set_response_body(&response));
|
||||
router_env::logger::info!(connector_response=?response);
|
||||
types::RouterData::try_from(types::ResponseRouterData {
|
||||
response,
|
||||
data: data.clone(),
|
||||
http_code: res.status_code,
|
||||
})
|
||||
.change_context(errors::ConnectorError::ResponseHandlingFailed)
|
||||
}
|
||||
|
||||
fn get_error_response(
|
||||
&self,
|
||||
res: Response,
|
||||
event_builder: Option<&mut ConnectorEvent>,
|
||||
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
|
||||
self.build_error_response(res, event_builder)
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl<const T: u8> api::IncomingWebhook for DummyConnector<T> {
|
||||
fn get_webhook_object_reference_id(
|
||||
&self,
|
||||
_request: &api::IncomingWebhookRequestDetails<'_>,
|
||||
) -> CustomResult<api::webhooks::ObjectReferenceId, errors::ConnectorError> {
|
||||
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
|
||||
}
|
||||
|
||||
fn get_webhook_event_type(
|
||||
&self,
|
||||
_request: &api::IncomingWebhookRequestDetails<'_>,
|
||||
) -> CustomResult<api::IncomingWebhookEvent, errors::ConnectorError> {
|
||||
Ok(api::IncomingWebhookEvent::EventNotSupported)
|
||||
}
|
||||
|
||||
fn get_webhook_resource_object(
|
||||
&self,
|
||||
_request: &api::IncomingWebhookRequestDetails<'_>,
|
||||
) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
|
||||
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
|
||||
}
|
||||
}
|
||||
|
||||
impl<const T: u8> ConnectorSpecifications for DummyConnector<T> {}
|
||||
@ -1,416 +0,0 @@
|
||||
use common_utils::pii;
|
||||
use diesel_models::enums::Currency;
|
||||
use masking::Secret;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use url::Url;
|
||||
|
||||
use crate::{
|
||||
connector::utils::RouterData,
|
||||
core::errors,
|
||||
services,
|
||||
types::{self, api, domain, storage::enums},
|
||||
};
|
||||
|
||||
#[derive(Debug, Serialize, strum::Display, Eq, PartialEq)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
#[strum(serialize_all = "snake_case")]
|
||||
pub enum DummyConnectors {
|
||||
#[serde(rename = "phonypay")]
|
||||
#[strum(serialize = "phonypay")]
|
||||
PhonyPay,
|
||||
#[serde(rename = "fauxpay")]
|
||||
#[strum(serialize = "fauxpay")]
|
||||
FauxPay,
|
||||
#[serde(rename = "pretendpay")]
|
||||
#[strum(serialize = "pretendpay")]
|
||||
PretendPay,
|
||||
StripeTest,
|
||||
AdyenTest,
|
||||
CheckoutTest,
|
||||
PaypalTest,
|
||||
}
|
||||
|
||||
impl DummyConnectors {
|
||||
pub fn get_dummy_connector_id(self) -> &'static str {
|
||||
match self {
|
||||
Self::PhonyPay => "phonypay",
|
||||
Self::FauxPay => "fauxpay",
|
||||
Self::PretendPay => "pretendpay",
|
||||
Self::StripeTest => "stripe_test",
|
||||
Self::AdyenTest => "adyen_test",
|
||||
Self::CheckoutTest => "checkout_test",
|
||||
Self::PaypalTest => "paypal_test",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<u8> for DummyConnectors {
|
||||
fn from(value: u8) -> Self {
|
||||
match value {
|
||||
1 => Self::PhonyPay,
|
||||
2 => Self::FauxPay,
|
||||
3 => Self::PretendPay,
|
||||
4 => Self::StripeTest,
|
||||
5 => Self::AdyenTest,
|
||||
6 => Self::CheckoutTest,
|
||||
7 => Self::PaypalTest,
|
||||
_ => Self::PhonyPay,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Eq, PartialEq)]
|
||||
pub struct DummyConnectorPaymentsRequest<const T: u8> {
|
||||
amount: i64,
|
||||
currency: Currency,
|
||||
payment_method_data: PaymentMethodData,
|
||||
return_url: Option<String>,
|
||||
connector: DummyConnectors,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum PaymentMethodData {
|
||||
Card(DummyConnectorCard),
|
||||
Wallet(DummyConnectorWallet),
|
||||
PayLater(DummyConnectorPayLater),
|
||||
Upi(DummyConnectorUpi),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, serde::Serialize, Eq, PartialEq, serde::Deserialize)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum DummyConnectorUpi {
|
||||
UpiCollect(DummyConnectorUpiCollect),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq)]
|
||||
pub struct DummyConnectorUpiCollect {
|
||||
vpa_id: Secret<String, pii::UpiVpaMaskingStrategy>,
|
||||
}
|
||||
|
||||
impl TryFrom<domain::UpiCollectData> for DummyConnectorUpi {
|
||||
type Error = error_stack::Report<errors::ConnectorError>;
|
||||
fn try_from(value: domain::UpiCollectData) -> Result<Self, Self::Error> {
|
||||
Ok(Self::UpiCollect(DummyConnectorUpiCollect {
|
||||
vpa_id: value
|
||||
.vpa_id
|
||||
.ok_or(errors::ConnectorError::MissingRequiredField {
|
||||
field_name: "vpa_id",
|
||||
})?,
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq)]
|
||||
pub struct DummyConnectorCard {
|
||||
name: Secret<String>,
|
||||
number: cards::CardNumber,
|
||||
expiry_month: Secret<String>,
|
||||
expiry_year: Secret<String>,
|
||||
cvc: Secret<String>,
|
||||
}
|
||||
|
||||
impl TryFrom<(domain::Card, Option<Secret<String>>)> for DummyConnectorCard {
|
||||
type Error = error_stack::Report<errors::ConnectorError>;
|
||||
fn try_from(
|
||||
(value, card_holder_name): (domain::Card, Option<Secret<String>>),
|
||||
) -> Result<Self, Self::Error> {
|
||||
Ok(Self {
|
||||
name: card_holder_name.unwrap_or(Secret::new("".to_string())),
|
||||
number: value.card_number,
|
||||
expiry_month: value.card_exp_month,
|
||||
expiry_year: value.card_exp_year,
|
||||
cvc: value.card_cvc,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq)]
|
||||
pub enum DummyConnectorWallet {
|
||||
GooglePay,
|
||||
Paypal,
|
||||
WeChatPay,
|
||||
MbWay,
|
||||
AliPay,
|
||||
AliPayHK,
|
||||
}
|
||||
|
||||
impl TryFrom<domain::WalletData> for DummyConnectorWallet {
|
||||
type Error = error_stack::Report<errors::ConnectorError>;
|
||||
fn try_from(value: domain::WalletData) -> Result<Self, Self::Error> {
|
||||
match value {
|
||||
domain::WalletData::GooglePayRedirect(_) => Ok(Self::GooglePay),
|
||||
domain::WalletData::PaypalRedirect(_) => Ok(Self::Paypal),
|
||||
domain::WalletData::WeChatPayRedirect(_) => Ok(Self::WeChatPay),
|
||||
domain::WalletData::MbWayRedirect(_) => Ok(Self::MbWay),
|
||||
domain::WalletData::AliPayRedirect(_) => Ok(Self::AliPay),
|
||||
domain::WalletData::AliPayHkRedirect(_) => Ok(Self::AliPayHK),
|
||||
_ => Err(errors::ConnectorError::NotImplemented("Dummy wallet".to_string()).into()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq)]
|
||||
pub enum DummyConnectorPayLater {
|
||||
Klarna,
|
||||
Affirm,
|
||||
AfterPayClearPay,
|
||||
}
|
||||
|
||||
impl TryFrom<domain::payments::PayLaterData> for DummyConnectorPayLater {
|
||||
type Error = error_stack::Report<errors::ConnectorError>;
|
||||
fn try_from(value: domain::payments::PayLaterData) -> Result<Self, Self::Error> {
|
||||
match value {
|
||||
domain::payments::PayLaterData::KlarnaRedirect { .. } => Ok(Self::Klarna),
|
||||
domain::payments::PayLaterData::AffirmRedirect {} => Ok(Self::Affirm),
|
||||
domain::payments::PayLaterData::AfterpayClearpayRedirect { .. } => {
|
||||
Ok(Self::AfterPayClearPay)
|
||||
}
|
||||
_ => Err(errors::ConnectorError::NotImplemented("Dummy pay later".to_string()).into()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<const T: u8> TryFrom<&types::PaymentsAuthorizeRouterData>
|
||||
for DummyConnectorPaymentsRequest<T>
|
||||
{
|
||||
type Error = error_stack::Report<errors::ConnectorError>;
|
||||
fn try_from(item: &types::PaymentsAuthorizeRouterData) -> Result<Self, Self::Error> {
|
||||
let payment_method_data: Result<PaymentMethodData, Self::Error> = match item
|
||||
.request
|
||||
.payment_method_data
|
||||
{
|
||||
domain::PaymentMethodData::Card(ref req_card) => {
|
||||
let card_holder_name = item.get_optional_billing_full_name();
|
||||
Ok(PaymentMethodData::Card(DummyConnectorCard::try_from((
|
||||
req_card.clone(),
|
||||
card_holder_name,
|
||||
))?))
|
||||
}
|
||||
domain::PaymentMethodData::Upi(ref req_upi_data) => match req_upi_data {
|
||||
domain::UpiData::UpiCollect(data) => Ok(PaymentMethodData::Upi(
|
||||
DummyConnectorUpi::try_from(data.clone())?,
|
||||
)),
|
||||
domain::UpiData::UpiIntent(_) => {
|
||||
Err(errors::ConnectorError::NotImplemented("UPI Intent".to_string()).into())
|
||||
}
|
||||
},
|
||||
domain::PaymentMethodData::Wallet(ref wallet_data) => {
|
||||
Ok(PaymentMethodData::Wallet(wallet_data.clone().try_into()?))
|
||||
}
|
||||
domain::PaymentMethodData::PayLater(ref pay_later_data) => Ok(
|
||||
PaymentMethodData::PayLater(pay_later_data.clone().try_into()?),
|
||||
),
|
||||
_ => Err(errors::ConnectorError::NotImplemented("Payment methods".to_string()).into()),
|
||||
};
|
||||
Ok(Self {
|
||||
amount: item.request.amount,
|
||||
currency: item.request.currency,
|
||||
payment_method_data: payment_method_data?,
|
||||
return_url: item.request.router_return_url.clone(),
|
||||
connector: Into::<DummyConnectors>::into(T),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Auth Struct
|
||||
pub struct DummyConnectorAuthType {
|
||||
pub(super) api_key: Secret<String>,
|
||||
}
|
||||
|
||||
impl TryFrom<&types::ConnectorAuthType> for DummyConnectorAuthType {
|
||||
type Error = error_stack::Report<errors::ConnectorError>;
|
||||
fn try_from(auth_type: &types::ConnectorAuthType) -> Result<Self, Self::Error> {
|
||||
match auth_type {
|
||||
types::ConnectorAuthType::HeaderKey { api_key } => Ok(Self {
|
||||
api_key: api_key.to_owned(),
|
||||
}),
|
||||
_ => Err(errors::ConnectorError::FailedToObtainAuthType.into()),
|
||||
}
|
||||
}
|
||||
}
|
||||
// PaymentsResponse
|
||||
//TODO: Append the remaining status flags
|
||||
#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum DummyConnectorPaymentStatus {
|
||||
Succeeded,
|
||||
Failed,
|
||||
#[default]
|
||||
Processing,
|
||||
}
|
||||
|
||||
impl From<DummyConnectorPaymentStatus> for enums::AttemptStatus {
|
||||
fn from(item: DummyConnectorPaymentStatus) -> Self {
|
||||
match item {
|
||||
DummyConnectorPaymentStatus::Succeeded => Self::Charged,
|
||||
DummyConnectorPaymentStatus::Failed => Self::Failure,
|
||||
DummyConnectorPaymentStatus::Processing => Self::AuthenticationPending,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
|
||||
pub struct PaymentsResponse {
|
||||
status: DummyConnectorPaymentStatus,
|
||||
id: String,
|
||||
amount: i64,
|
||||
currency: Currency,
|
||||
created: String,
|
||||
payment_method_type: PaymentMethodType,
|
||||
next_action: Option<DummyConnectorNextAction>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum PaymentMethodType {
|
||||
Card,
|
||||
Upi(DummyConnectorUpiType),
|
||||
Wallet(DummyConnectorWallet),
|
||||
PayLater(DummyConnectorPayLater),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq)]
|
||||
pub enum DummyConnectorUpiType {
|
||||
UpiCollect,
|
||||
}
|
||||
|
||||
impl<F, T> TryFrom<types::ResponseRouterData<F, PaymentsResponse, T, types::PaymentsResponseData>>
|
||||
for types::RouterData<F, T, types::PaymentsResponseData>
|
||||
{
|
||||
type Error = error_stack::Report<errors::ConnectorError>;
|
||||
fn try_from(
|
||||
item: types::ResponseRouterData<F, PaymentsResponse, T, types::PaymentsResponseData>,
|
||||
) -> Result<Self, Self::Error> {
|
||||
let redirection_data = item
|
||||
.response
|
||||
.next_action
|
||||
.and_then(|redirection_data| redirection_data.get_url())
|
||||
.map(|redirection_url| {
|
||||
services::RedirectForm::from((redirection_url, services::Method::Get))
|
||||
});
|
||||
Ok(Self {
|
||||
status: enums::AttemptStatus::from(item.response.status),
|
||||
response: Ok(types::PaymentsResponseData::TransactionResponse {
|
||||
resource_id: types::ResponseId::ConnectorTransactionId(item.response.id),
|
||||
redirection_data: Box::new(redirection_data),
|
||||
mandate_reference: Box::new(None),
|
||||
connector_metadata: None,
|
||||
network_txn_id: None,
|
||||
connector_response_reference_id: None,
|
||||
incremental_authorization_allowed: None,
|
||||
charges: None,
|
||||
}),
|
||||
..item.data
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum DummyConnectorNextAction {
|
||||
RedirectToUrl(Url),
|
||||
}
|
||||
|
||||
impl DummyConnectorNextAction {
|
||||
fn get_url(&self) -> Option<Url> {
|
||||
match self {
|
||||
Self::RedirectToUrl(redirect_to_url) => Some(redirect_to_url.to_owned()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// REFUND :
|
||||
// Type definition for RefundRequest
|
||||
#[derive(Default, Debug, Serialize)]
|
||||
pub struct DummyConnectorRefundRequest {
|
||||
pub amount: i64,
|
||||
}
|
||||
|
||||
impl<F> TryFrom<&types::RefundsRouterData<F>> for DummyConnectorRefundRequest {
|
||||
type Error = error_stack::Report<errors::ConnectorError>;
|
||||
fn try_from(item: &types::RefundsRouterData<F>) -> Result<Self, Self::Error> {
|
||||
Ok(Self {
|
||||
amount: item.request.refund_amount,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Type definition for Refund Response
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[derive(Debug, Serialize, Default, Deserialize, Clone)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum RefundStatus {
|
||||
Succeeded,
|
||||
Failed,
|
||||
#[default]
|
||||
Processing,
|
||||
}
|
||||
|
||||
impl From<RefundStatus> for enums::RefundStatus {
|
||||
fn from(item: RefundStatus) -> Self {
|
||||
match item {
|
||||
RefundStatus::Succeeded => Self::Success,
|
||||
RefundStatus::Failed => Self::Failure,
|
||||
RefundStatus::Processing => Self::Pending,
|
||||
//TODO: Review mapping
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct RefundResponse {
|
||||
id: String,
|
||||
status: RefundStatus,
|
||||
currency: Currency,
|
||||
created: String,
|
||||
payment_amount: i64,
|
||||
refund_amount: i64,
|
||||
}
|
||||
|
||||
impl TryFrom<types::RefundsResponseRouterData<api::Execute, RefundResponse>>
|
||||
for types::RefundsRouterData<api::Execute>
|
||||
{
|
||||
type Error = error_stack::Report<errors::ConnectorError>;
|
||||
fn try_from(
|
||||
item: types::RefundsResponseRouterData<api::Execute, RefundResponse>,
|
||||
) -> Result<Self, Self::Error> {
|
||||
Ok(Self {
|
||||
response: Ok(types::RefundsResponseData {
|
||||
connector_refund_id: item.response.id.to_string(),
|
||||
refund_status: enums::RefundStatus::from(item.response.status),
|
||||
}),
|
||||
..item.data
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl TryFrom<types::RefundsResponseRouterData<api::RSync, RefundResponse>>
|
||||
for types::RefundsRouterData<api::RSync>
|
||||
{
|
||||
type Error = error_stack::Report<errors::ConnectorError>;
|
||||
fn try_from(
|
||||
item: types::RefundsResponseRouterData<api::RSync, RefundResponse>,
|
||||
) -> Result<Self, Self::Error> {
|
||||
Ok(Self {
|
||||
response: Ok(types::RefundsResponseData {
|
||||
connector_refund_id: item.response.id.to_string(),
|
||||
refund_status: enums::RefundStatus::from(item.response.status),
|
||||
}),
|
||||
..item.data
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Serialize, Deserialize, PartialEq)]
|
||||
pub struct DummyConnectorErrorResponse {
|
||||
pub error: ErrorData,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Serialize, Deserialize, PartialEq)]
|
||||
pub struct ErrorData {
|
||||
pub code: String,
|
||||
pub message: String,
|
||||
pub reason: Option<String>,
|
||||
}
|
||||
@ -1959,17 +1959,6 @@ where
|
||||
json.parse_value(std::any::type_name::<T>()).switch()
|
||||
}
|
||||
|
||||
pub fn construct_not_supported_error_report(
|
||||
capture_method: enums::CaptureMethod,
|
||||
connector_name: &'static str,
|
||||
) -> error_stack::Report<errors::ConnectorError> {
|
||||
errors::ConnectorError::NotSupported {
|
||||
message: capture_method.to_string(),
|
||||
connector: connector_name,
|
||||
}
|
||||
.into()
|
||||
}
|
||||
|
||||
impl ForeignTryFrom<String> for UsStatesAbbreviation {
|
||||
type Error = error_stack::Report<errors::ConnectorError>;
|
||||
fn foreign_try_from(value: String) -> Result<Self, Self::Error> {
|
||||
|
||||
@ -1383,7 +1383,7 @@ impl ConnectorAuthTypeAndMetadataValidation<'_> {
|
||||
| api_enums::Connector::DummyConnector5
|
||||
| api_enums::Connector::DummyConnector6
|
||||
| api_enums::Connector::DummyConnector7 => {
|
||||
dummyconnector::transformers::DummyConnectorAuthType::try_from(self.auth_type)?;
|
||||
hyperswitch_connectors::connectors::dummyconnector::transformers::DummyConnectorAuthType::try_from(self.auth_type)?;
|
||||
Ok(())
|
||||
}
|
||||
api_enums::Connector::Aci => {
|
||||
|
||||
@ -17,34 +17,13 @@ use async_trait::async_trait;
|
||||
use hyperswitch_domain_models::router_flow_types::{
|
||||
BillingConnectorInvoiceSync, BillingConnectorPaymentsSync, RecoveryRecordBack,
|
||||
};
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
use hyperswitch_domain_models::router_flow_types::{
|
||||
ExternalVaultCreateFlow, ExternalVaultDeleteFlow, ExternalVaultInsertFlow,
|
||||
ExternalVaultRetrieveFlow,
|
||||
};
|
||||
use hyperswitch_domain_models::{
|
||||
mandates::CustomerAcceptance,
|
||||
router_flow_types::{
|
||||
Authenticate, AuthenticationConfirmation, PostAuthenticate, PreAuthenticate,
|
||||
},
|
||||
router_request_types::PaymentsCaptureData,
|
||||
};
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
use hyperswitch_interfaces::api::vault::{
|
||||
ExternalVault, ExternalVaultCreate, ExternalVaultDelete, ExternalVaultInsert,
|
||||
ExternalVaultRetrieve,
|
||||
};
|
||||
use hyperswitch_interfaces::api::{
|
||||
payouts::Payouts, UasAuthentication, UasAuthenticationConfirmation, UasPostAuthentication,
|
||||
UasPreAuthentication, UnifiedAuthenticationService,
|
||||
mandates::CustomerAcceptance, router_request_types::PaymentsCaptureData,
|
||||
};
|
||||
|
||||
#[cfg(feature = "frm")]
|
||||
use crate::types::fraud_check as frm_types;
|
||||
use crate::{
|
||||
connector,
|
||||
core::{
|
||||
errors::{ApiErrorResponse, ConnectorError, CustomResult, RouterResult},
|
||||
errors::{ApiErrorResponse, RouterResult},
|
||||
payments::{self, helpers},
|
||||
},
|
||||
logger,
|
||||
@ -215,522 +194,6 @@ pub trait Feature<F, T> {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::PaymentsCompleteAuthorize for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::CompleteAuthorize,
|
||||
types::CompleteAuthorizeData,
|
||||
types::PaymentsResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::ConnectorVerifyWebhookSource for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::VerifyWebhookSource,
|
||||
types::VerifyWebhookSourceRequestData,
|
||||
types::VerifyWebhookSourceResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::ConnectorCustomer for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::CreateConnectorCustomer,
|
||||
types::ConnectorCustomerData,
|
||||
types::PaymentsResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> services::ConnectorRedirectResponse for connector::DummyConnector<T> {
|
||||
fn get_flow_type(
|
||||
&self,
|
||||
_query_params: &str,
|
||||
_json_payload: Option<serde_json::Value>,
|
||||
_action: services::PaymentAction,
|
||||
) -> CustomResult<payments::CallConnectorAction, ConnectorError> {
|
||||
Ok(payments::CallConnectorAction::Trigger)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::ConnectorTransactionId for connector::DummyConnector<T> {}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::Dispute for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::AcceptDispute for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::Accept,
|
||||
types::AcceptDisputeRequestData,
|
||||
types::AcceptDisputeResponse,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::FileUpload for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::UploadFile for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::Upload,
|
||||
types::UploadFileRequestData,
|
||||
types::UploadFileResponse,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::RetrieveFile for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::Retrieve,
|
||||
types::RetrieveFileRequestData,
|
||||
types::RetrieveFileResponse,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::SubmitEvidence for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::Evidence,
|
||||
types::SubmitEvidenceRequestData,
|
||||
types::SubmitEvidenceResponse,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::DefendDispute for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::Defend,
|
||||
types::DefendDisputeRequestData,
|
||||
types::DefendDisputeResponse,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::PaymentsPreProcessing for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::PreProcessing,
|
||||
types::PaymentsPreProcessingData,
|
||||
types::PaymentsResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::PaymentsPostProcessing for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::PostProcessing,
|
||||
types::PaymentsPostProcessingData,
|
||||
types::PaymentsResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> Payouts for connector::DummyConnector<T> {}
|
||||
|
||||
#[cfg(feature = "payouts")]
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::PayoutCreate for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "payouts")]
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<api::PoCreate, types::PayoutsData, types::PayoutsResponseData>
|
||||
for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "payouts")]
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::PayoutSync for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "payouts")]
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<api::PoSync, types::PayoutsData, types::PayoutsResponseData>
|
||||
for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "payouts")]
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::PayoutEligibility for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "payouts")]
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::PoEligibility,
|
||||
types::PayoutsData,
|
||||
types::PayoutsResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "payouts")]
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::PayoutFulfill for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "payouts")]
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<api::PoFulfill, types::PayoutsData, types::PayoutsResponseData>
|
||||
for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "payouts")]
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::PayoutCancel for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "payouts")]
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<api::PoCancel, types::PayoutsData, types::PayoutsResponseData>
|
||||
for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "payouts")]
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::PayoutQuote for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "payouts")]
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<api::PoQuote, types::PayoutsData, types::PayoutsResponseData>
|
||||
for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "payouts")]
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::PayoutRecipient for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "payouts")]
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<api::PoRecipient, types::PayoutsData, types::PayoutsResponseData>
|
||||
for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "payouts")]
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::PayoutRecipientAccount for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "payouts")]
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::PoRecipientAccount,
|
||||
types::PayoutsData,
|
||||
types::PayoutsResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::PaymentApprove for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::Approve,
|
||||
types::PaymentsApproveData,
|
||||
types::PaymentsResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::PaymentReject for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::Reject,
|
||||
types::PaymentsRejectData,
|
||||
types::PaymentsResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::FraudCheck for connector::DummyConnector<T> {}
|
||||
|
||||
#[cfg(all(feature = "frm", feature = "dummy_connector"))]
|
||||
impl<const T: u8> api::FraudCheckSale for connector::DummyConnector<T> {}
|
||||
#[cfg(all(feature = "frm", feature = "dummy_connector"))]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::Sale,
|
||||
frm_types::FraudCheckSaleData,
|
||||
frm_types::FraudCheckResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "frm", feature = "dummy_connector"))]
|
||||
impl<const T: u8> api::FraudCheckCheckout for connector::DummyConnector<T> {}
|
||||
#[cfg(all(feature = "frm", feature = "dummy_connector"))]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::Checkout,
|
||||
frm_types::FraudCheckCheckoutData,
|
||||
frm_types::FraudCheckResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "frm", feature = "dummy_connector"))]
|
||||
impl<const T: u8> api::FraudCheckTransaction for connector::DummyConnector<T> {}
|
||||
#[cfg(all(feature = "frm", feature = "dummy_connector"))]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::Transaction,
|
||||
frm_types::FraudCheckTransactionData,
|
||||
frm_types::FraudCheckResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "frm", feature = "dummy_connector"))]
|
||||
impl<const T: u8> api::FraudCheckFulfillment for connector::DummyConnector<T> {}
|
||||
#[cfg(all(feature = "frm", feature = "dummy_connector"))]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::Fulfillment,
|
||||
frm_types::FraudCheckFulfillmentData,
|
||||
frm_types::FraudCheckResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "frm", feature = "dummy_connector"))]
|
||||
impl<const T: u8> api::FraudCheckRecordReturn for connector::DummyConnector<T> {}
|
||||
#[cfg(all(feature = "frm", feature = "dummy_connector"))]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::RecordReturn,
|
||||
frm_types::FraudCheckRecordReturnData,
|
||||
frm_types::FraudCheckResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::PaymentIncrementalAuthorization for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::IncrementalAuthorization,
|
||||
types::PaymentsIncrementalAuthorizationData,
|
||||
types::PaymentsResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::ConnectorMandateRevoke for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::MandateRevoke,
|
||||
types::MandateRevokeRequestData,
|
||||
types::MandateRevokeResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::ExternalAuthentication for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::ConnectorPreAuthentication for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::ConnectorPreAuthenticationVersionCall for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::ConnectorAuthentication for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::ConnectorPostAuthentication for connector::DummyConnector<T> {}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::Authentication,
|
||||
types::authentication::ConnectorAuthenticationRequestData,
|
||||
types::authentication::AuthenticationResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::PreAuthentication,
|
||||
types::authentication::PreAuthNRequestData,
|
||||
types::authentication::AuthenticationResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::PreAuthenticationVersionCall,
|
||||
types::authentication::PreAuthNRequestData,
|
||||
types::authentication::AuthenticationResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::PostAuthentication,
|
||||
types::authentication::ConnectorPostAuthenticationRequestData,
|
||||
types::authentication::AuthenticationResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::PaymentAuthorizeSessionToken for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::AuthorizeSessionToken,
|
||||
types::AuthorizeSessionTokenData,
|
||||
types::PaymentsResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::TaxCalculation for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::CalculateTax,
|
||||
types::PaymentsTaxCalculationData,
|
||||
types::TaxCalculationResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::PaymentSessionUpdate for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::SdkSessionUpdate,
|
||||
types::SdkPaymentsSessionUpdateData,
|
||||
types::PaymentsResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::PaymentPostSessionTokens for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::PostSessionTokens,
|
||||
types::PaymentsPostSessionTokensData,
|
||||
types::PaymentsResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::PaymentsCreateOrder for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::CreateOrder,
|
||||
types::CreateOrderRequestData,
|
||||
types::PaymentsResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::PaymentUpdateMetadata for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
api::UpdateMetadata,
|
||||
types::PaymentsUpdateMetadataData,
|
||||
types::PaymentsResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> UasPreAuthentication for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> UnifiedAuthenticationService for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
PreAuthenticate,
|
||||
types::UasPreAuthenticationRequestData,
|
||||
types::UasAuthenticationResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> UasPostAuthentication for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
PostAuthenticate,
|
||||
types::UasPostAuthenticationRequestData,
|
||||
types::UasAuthenticationResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> UasAuthenticationConfirmation for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
AuthenticationConfirmation,
|
||||
types::UasConfirmationRequestData,
|
||||
types::UasAuthenticationResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> UasAuthentication for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
Authenticate,
|
||||
types::UasAuthenticationRequestData,
|
||||
types::UasAuthenticationResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
/// Determines whether a capture API call should be made for a payment attempt
|
||||
/// This function evaluates whether an authorized payment should proceed with a capture API call
|
||||
/// based on various payment parameters. It's primarily used in two-step (auth + capture) payment flows for CaptureMethod SequentialAutomatic
|
||||
@ -841,99 +304,3 @@ fn handle_post_capture_response(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::RevenueRecovery for connector::DummyConnector<T> {}
|
||||
|
||||
#[cfg(all(feature = "v2", feature = "revenue_recovery"))]
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::BillingConnectorPaymentsSyncIntegration for connector::DummyConnector<T> {}
|
||||
#[cfg(all(feature = "v2", feature = "revenue_recovery"))]
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
BillingConnectorPaymentsSync,
|
||||
types::BillingConnectorPaymentsSyncRequest,
|
||||
types::BillingConnectorPaymentsSyncResponse,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "v2", feature = "revenue_recovery"))]
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::RevenueRecoveryRecordBack for connector::DummyConnector<T> {}
|
||||
#[cfg(all(feature = "v2", feature = "revenue_recovery"))]
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
RecoveryRecordBack,
|
||||
types::RevenueRecoveryRecordBackRequest,
|
||||
types::RevenueRecoveryRecordBackResponse,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "v2", feature = "revenue_recovery"))]
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> api::BillingConnectorInvoiceSyncIntegration for connector::DummyConnector<T> {}
|
||||
#[cfg(all(feature = "v2", feature = "revenue_recovery"))]
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
BillingConnectorInvoiceSync,
|
||||
types::BillingConnectorInvoiceSyncRequest,
|
||||
types::BillingConnectorInvoiceSyncResponse,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> ExternalVault for connector::DummyConnector<T> {}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> ExternalVaultInsert for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
ExternalVaultInsertFlow,
|
||||
types::VaultRequestData,
|
||||
types::VaultResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> ExternalVaultRetrieve for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
ExternalVaultRetrieveFlow,
|
||||
types::VaultRequestData,
|
||||
types::VaultResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> ExternalVaultDelete for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
ExternalVaultDeleteFlow,
|
||||
types::VaultRequestData,
|
||||
types::VaultResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8> ExternalVaultCreate for connector::DummyConnector<T> {}
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
impl<const T: u8>
|
||||
services::ConnectorIntegration<
|
||||
ExternalVaultCreateFlow,
|
||||
types::VaultRequestData,
|
||||
types::VaultResponseData,
|
||||
> for connector::DummyConnector<T>
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user