mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 04:04:55 +08:00
feat(connector): [Celero] add Connector Template Code (#8489)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -74,6 +74,7 @@ pub enum RoutableConnectors {
|
||||
Boku,
|
||||
Braintree,
|
||||
Cashtocode,
|
||||
Celero,
|
||||
Chargebee,
|
||||
// Checkbook,
|
||||
Checkout,
|
||||
@ -232,6 +233,7 @@ pub enum Connector {
|
||||
Boku,
|
||||
Braintree,
|
||||
Cashtocode,
|
||||
Celero,
|
||||
Chargebee,
|
||||
// Checkbook,
|
||||
Checkout,
|
||||
@ -417,6 +419,7 @@ impl Connector {
|
||||
| Self::Boku
|
||||
| Self::Braintree
|
||||
| Self::Cashtocode
|
||||
| Self::Celero
|
||||
| Self::Chargebee
|
||||
// | Self::Checkbook
|
||||
| Self::Coinbase
|
||||
@ -580,6 +583,7 @@ impl From<RoutableConnectors> for Connector {
|
||||
RoutableConnectors::Boku => Self::Boku,
|
||||
RoutableConnectors::Braintree => Self::Braintree,
|
||||
RoutableConnectors::Cashtocode => Self::Cashtocode,
|
||||
RoutableConnectors::Celero => Self::Celero,
|
||||
RoutableConnectors::Chargebee => Self::Chargebee,
|
||||
// RoutableConnectors::Checkbook => Self::Checkbook,
|
||||
RoutableConnectors::Checkout => Self::Checkout,
|
||||
@ -701,6 +705,7 @@ impl TryFrom<Connector> for RoutableConnectors {
|
||||
Connector::Boku => Ok(Self::Boku),
|
||||
Connector::Braintree => Ok(Self::Braintree),
|
||||
Connector::Cashtocode => Ok(Self::Cashtocode),
|
||||
Connector::Celero => Ok(Self::Celero),
|
||||
Connector::Chargebee => Ok(Self::Chargebee),
|
||||
// Connector::Checkbook => Ok(Self::Checkbook),
|
||||
Connector::Checkout => Ok(Self::Checkout),
|
||||
|
||||
@ -190,6 +190,7 @@ pub struct ConnectorConfig {
|
||||
pub boku: Option<ConnectorTomlConfig>,
|
||||
pub braintree: Option<ConnectorTomlConfig>,
|
||||
pub cashtocode: Option<ConnectorTomlConfig>,
|
||||
pub celero: Option<ConnectorTomlConfig>,
|
||||
pub chargebee: Option<ConnectorTomlConfig>,
|
||||
pub checkbook: Option<ConnectorTomlConfig>,
|
||||
pub checkout: Option<ConnectorTomlConfig>,
|
||||
@ -381,6 +382,7 @@ impl ConnectorConfig {
|
||||
Connector::Boku => Ok(connector_data.boku),
|
||||
Connector::Braintree => Ok(connector_data.braintree),
|
||||
Connector::Cashtocode => Ok(connector_data.cashtocode),
|
||||
Connector::Celero => Ok(connector_data.celero),
|
||||
Connector::Chargebee => Ok(connector_data.chargebee),
|
||||
Connector::Checkout => Ok(connector_data.checkout),
|
||||
Connector::Coinbase => Ok(connector_data.coinbase),
|
||||
|
||||
@ -15,6 +15,7 @@ pub mod bluesnap;
|
||||
pub mod boku;
|
||||
pub mod braintree;
|
||||
pub mod cashtocode;
|
||||
pub mod celero;
|
||||
pub mod chargebee;
|
||||
pub mod checkbook;
|
||||
pub mod checkout;
|
||||
@ -116,26 +117,26 @@ pub use self::{
|
||||
amazonpay::Amazonpay, archipel::Archipel, authorizedotnet::Authorizedotnet, bambora::Bambora,
|
||||
bamboraapac::Bamboraapac, bankofamerica::Bankofamerica, barclaycard::Barclaycard,
|
||||
billwerk::Billwerk, bitpay::Bitpay, bluesnap::Bluesnap, boku::Boku, braintree::Braintree,
|
||||
cashtocode::Cashtocode, chargebee::Chargebee, checkbook::Checkbook, checkout::Checkout,
|
||||
coinbase::Coinbase, coingate::Coingate, cryptopay::Cryptopay, ctp_mastercard::CtpMastercard,
|
||||
cybersource::Cybersource, datatrans::Datatrans, deutschebank::Deutschebank,
|
||||
digitalvirgo::Digitalvirgo, dlocal::Dlocal, dwolla::Dwolla, ebanx::Ebanx, elavon::Elavon,
|
||||
facilitapay::Facilitapay, fiserv::Fiserv, fiservemea::Fiservemea, fiuu::Fiuu, forte::Forte,
|
||||
getnet::Getnet, globalpay::Globalpay, globepay::Globepay, gocardless::Gocardless,
|
||||
gpayments::Gpayments, helcim::Helcim, hipay::Hipay, hyperswitch_vault::HyperswitchVault,
|
||||
iatapay::Iatapay, inespay::Inespay, itaubank::Itaubank, jpmorgan::Jpmorgan,
|
||||
juspaythreedsserver::Juspaythreedsserver, klarna::Klarna, mifinity::Mifinity, mollie::Mollie,
|
||||
moneris::Moneris, multisafepay::Multisafepay, netcetera::Netcetera, nexinets::Nexinets,
|
||||
nexixpay::Nexixpay, nmi::Nmi, nomupay::Nomupay, noon::Noon, nordea::Nordea, novalnet::Novalnet,
|
||||
nuvei::Nuvei, opayo::Opayo, opennode::Opennode, paybox::Paybox, payeezy::Payeezy,
|
||||
payload::Payload, payme::Payme, payone::Payone, paypal::Paypal, paystack::Paystack, payu::Payu,
|
||||
placetopay::Placetopay, plaid::Plaid, powertranz::Powertranz, prophetpay::Prophetpay,
|
||||
rapyd::Rapyd, razorpay::Razorpay, recurly::Recurly, redsys::Redsys, riskified::Riskified,
|
||||
santander::Santander, shift4::Shift4, signifyd::Signifyd, square::Square, stax::Stax,
|
||||
stripe::Stripe, stripebilling::Stripebilling, taxjar::Taxjar, threedsecureio::Threedsecureio,
|
||||
thunes::Thunes, tokenio::Tokenio, trustpay::Trustpay, tsys::Tsys,
|
||||
unified_authentication_service::UnifiedAuthenticationService, vgs::Vgs, volt::Volt,
|
||||
wellsfargo::Wellsfargo, wellsfargopayout::Wellsfargopayout, wise::Wise, worldline::Worldline,
|
||||
worldpay::Worldpay, worldpayvantiv::Worldpayvantiv, worldpayxml::Worldpayxml, xendit::Xendit,
|
||||
zen::Zen, zsl::Zsl,
|
||||
cashtocode::Cashtocode, celero::Celero, chargebee::Chargebee, checkbook::Checkbook,
|
||||
checkout::Checkout, coinbase::Coinbase, coingate::Coingate, cryptopay::Cryptopay,
|
||||
ctp_mastercard::CtpMastercard, cybersource::Cybersource, datatrans::Datatrans,
|
||||
deutschebank::Deutschebank, digitalvirgo::Digitalvirgo, dlocal::Dlocal, dwolla::Dwolla,
|
||||
ebanx::Ebanx, elavon::Elavon, facilitapay::Facilitapay, fiserv::Fiserv, fiservemea::Fiservemea,
|
||||
fiuu::Fiuu, forte::Forte, getnet::Getnet, globalpay::Globalpay, globepay::Globepay,
|
||||
gocardless::Gocardless, gpayments::Gpayments, helcim::Helcim, hipay::Hipay,
|
||||
hyperswitch_vault::HyperswitchVault, iatapay::Iatapay, inespay::Inespay, itaubank::Itaubank,
|
||||
jpmorgan::Jpmorgan, juspaythreedsserver::Juspaythreedsserver, klarna::Klarna,
|
||||
mifinity::Mifinity, mollie::Mollie, moneris::Moneris, multisafepay::Multisafepay,
|
||||
netcetera::Netcetera, nexinets::Nexinets, nexixpay::Nexixpay, nmi::Nmi, nomupay::Nomupay,
|
||||
noon::Noon, nordea::Nordea, novalnet::Novalnet, nuvei::Nuvei, opayo::Opayo, opennode::Opennode,
|
||||
paybox::Paybox, payeezy::Payeezy, payload::Payload, payme::Payme, payone::Payone,
|
||||
paypal::Paypal, paystack::Paystack, payu::Payu, placetopay::Placetopay, plaid::Plaid,
|
||||
powertranz::Powertranz, prophetpay::Prophetpay, rapyd::Rapyd, razorpay::Razorpay,
|
||||
recurly::Recurly, redsys::Redsys, riskified::Riskified, santander::Santander, shift4::Shift4,
|
||||
signifyd::Signifyd, square::Square, stax::Stax, stripe::Stripe, stripebilling::Stripebilling,
|
||||
taxjar::Taxjar, threedsecureio::Threedsecureio, thunes::Thunes, tokenio::Tokenio,
|
||||
trustpay::Trustpay, tsys::Tsys, unified_authentication_service::UnifiedAuthenticationService,
|
||||
vgs::Vgs, volt::Volt, wellsfargo::Wellsfargo, wellsfargopayout::Wellsfargopayout, wise::Wise,
|
||||
worldline::Worldline, worldpay::Worldpay, worldpayvantiv::Worldpayvantiv,
|
||||
worldpayxml::Worldpayxml, xendit::Xendit, zen::Zen, zsl::Zsl,
|
||||
};
|
||||
|
||||
571
crates/hyperswitch_connectors/src/connectors/celero.rs
Normal file
571
crates/hyperswitch_connectors/src/connectors/celero.rs
Normal file
@ -0,0 +1,571 @@
|
||||
pub mod transformers;
|
||||
|
||||
use common_utils::{
|
||||
errors::CustomResult,
|
||||
ext_traits::BytesExt,
|
||||
request::{Method, Request, RequestBuilder, RequestContent},
|
||||
types::{AmountConvertor, StringMinorUnit, StringMinorUnitForConnector},
|
||||
};
|
||||
use error_stack::{report, ResultExt};
|
||||
use hyperswitch_domain_models::{
|
||||
router_data::{AccessToken, ConnectorAuthType, ErrorResponse, RouterData},
|
||||
router_flow_types::{
|
||||
access_token_auth::AccessTokenAuth,
|
||||
payments::{Authorize, Capture, PSync, PaymentMethodToken, Session, SetupMandate, Void},
|
||||
refunds::{Execute, RSync},
|
||||
},
|
||||
router_request_types::{
|
||||
AccessTokenRequestData, PaymentMethodTokenizationData, PaymentsAuthorizeData,
|
||||
PaymentsCancelData, PaymentsCaptureData, PaymentsSessionData, PaymentsSyncData,
|
||||
RefundsData, SetupMandateRequestData,
|
||||
},
|
||||
router_response_types::{PaymentsResponseData, RefundsResponseData},
|
||||
types::{
|
||||
PaymentsAuthorizeRouterData, PaymentsCaptureRouterData, PaymentsSyncRouterData,
|
||||
RefundSyncRouterData, RefundsRouterData,
|
||||
},
|
||||
};
|
||||
use hyperswitch_interfaces::{
|
||||
api::{
|
||||
self, ConnectorCommon, ConnectorCommonExt, ConnectorIntegration, ConnectorSpecifications,
|
||||
ConnectorValidation,
|
||||
},
|
||||
configs::Connectors,
|
||||
errors,
|
||||
events::connector_api_logs::ConnectorEvent,
|
||||
types::{self, Response},
|
||||
webhooks,
|
||||
};
|
||||
use masking::{ExposeInterface, Mask};
|
||||
use transformers as celero;
|
||||
|
||||
use crate::{constants::headers, types::ResponseRouterData, utils};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Celero {
|
||||
amount_converter: &'static (dyn AmountConvertor<Output = StringMinorUnit> + Sync),
|
||||
}
|
||||
|
||||
impl Celero {
|
||||
pub fn new() -> &'static Self {
|
||||
&Self {
|
||||
amount_converter: &StringMinorUnitForConnector,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl api::Payment for Celero {}
|
||||
impl api::PaymentSession for Celero {}
|
||||
impl api::ConnectorAccessToken for Celero {}
|
||||
impl api::MandateSetup for Celero {}
|
||||
impl api::PaymentAuthorize for Celero {}
|
||||
impl api::PaymentSync for Celero {}
|
||||
impl api::PaymentCapture for Celero {}
|
||||
impl api::PaymentVoid for Celero {}
|
||||
impl api::Refund for Celero {}
|
||||
impl api::RefundExecute for Celero {}
|
||||
impl api::RefundSync for Celero {}
|
||||
impl api::PaymentToken for Celero {}
|
||||
|
||||
impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData>
|
||||
for Celero
|
||||
{
|
||||
// Not Implemented (R)
|
||||
}
|
||||
|
||||
impl<Flow, Request, Response> ConnectorCommonExt<Flow, Request, Response> for Celero
|
||||
where
|
||||
Self: ConnectorIntegration<Flow, Request, Response>,
|
||||
{
|
||||
fn build_headers(
|
||||
&self,
|
||||
req: &RouterData<Flow, Request, Response>,
|
||||
_connectors: &Connectors,
|
||||
) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
|
||||
let mut header = vec![(
|
||||
headers::CONTENT_TYPE.to_string(),
|
||||
self.get_content_type().to_string().into(),
|
||||
)];
|
||||
let mut api_key = self.get_auth_header(&req.connector_auth_type)?;
|
||||
header.append(&mut api_key);
|
||||
Ok(header)
|
||||
}
|
||||
}
|
||||
|
||||
impl ConnectorCommon for Celero {
|
||||
fn id(&self) -> &'static str {
|
||||
"celero"
|
||||
}
|
||||
|
||||
fn get_currency_unit(&self) -> api::CurrencyUnit {
|
||||
api::CurrencyUnit::Base
|
||||
// TODO! Check connector documentation, on which unit they are processing the currency.
|
||||
// If the connector accepts amount in lower unit ( i.e cents for USD) then return api::CurrencyUnit::Minor,
|
||||
// if connector accepts amount in base unit (i.e dollars for USD) then return api::CurrencyUnit::Base
|
||||
}
|
||||
|
||||
fn common_get_content_type(&self) -> &'static str {
|
||||
"application/json"
|
||||
}
|
||||
|
||||
fn base_url<'a>(&self, connectors: &'a Connectors) -> &'a str {
|
||||
connectors.celero.base_url.as_ref()
|
||||
}
|
||||
|
||||
fn get_auth_header(
|
||||
&self,
|
||||
auth_type: &ConnectorAuthType,
|
||||
) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
|
||||
let auth = celero::CeleroAuthType::try_from(auth_type)
|
||||
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
|
||||
Ok(vec![(
|
||||
headers::AUTHORIZATION.to_string(),
|
||||
auth.api_key.expose().into_masked(),
|
||||
)])
|
||||
}
|
||||
|
||||
fn build_error_response(
|
||||
&self,
|
||||
res: Response,
|
||||
event_builder: Option<&mut ConnectorEvent>,
|
||||
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
|
||||
let response: celero::CeleroErrorResponse = res
|
||||
.response
|
||||
.parse_struct("CeleroErrorResponse")
|
||||
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
|
||||
|
||||
event_builder.map(|i| i.set_response_body(&response));
|
||||
router_env::logger::info!(connector_response=?response);
|
||||
|
||||
Ok(ErrorResponse {
|
||||
status_code: res.status_code,
|
||||
code: response.code,
|
||||
message: response.message,
|
||||
reason: response.reason,
|
||||
attempt_status: None,
|
||||
connector_transaction_id: None,
|
||||
network_decline_code: None,
|
||||
network_advice_code: None,
|
||||
network_error_message: None,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl ConnectorValidation for Celero {
|
||||
//TODO: implement functions when support enabled
|
||||
}
|
||||
|
||||
impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Celero {
|
||||
//TODO: implement sessions flow
|
||||
}
|
||||
|
||||
impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Celero {}
|
||||
|
||||
impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Celero {}
|
||||
|
||||
impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Celero {
|
||||
fn get_headers(
|
||||
&self,
|
||||
req: &PaymentsAuthorizeRouterData,
|
||||
connectors: &Connectors,
|
||||
) -> CustomResult<Vec<(String, masking::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: &PaymentsAuthorizeRouterData,
|
||||
_connectors: &Connectors,
|
||||
) -> CustomResult<String, errors::ConnectorError> {
|
||||
Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into())
|
||||
}
|
||||
|
||||
fn get_request_body(
|
||||
&self,
|
||||
req: &PaymentsAuthorizeRouterData,
|
||||
_connectors: &Connectors,
|
||||
) -> CustomResult<RequestContent, errors::ConnectorError> {
|
||||
let amount = utils::convert_amount(
|
||||
self.amount_converter,
|
||||
req.request.minor_amount,
|
||||
req.request.currency,
|
||||
)?;
|
||||
|
||||
let connector_router_data = celero::CeleroRouterData::from((amount, req));
|
||||
let connector_req = celero::CeleroPaymentsRequest::try_from(&connector_router_data)?;
|
||||
Ok(RequestContent::Json(Box::new(connector_req)))
|
||||
}
|
||||
|
||||
fn build_request(
|
||||
&self,
|
||||
req: &PaymentsAuthorizeRouterData,
|
||||
connectors: &Connectors,
|
||||
) -> CustomResult<Option<Request>, errors::ConnectorError> {
|
||||
Ok(Some(
|
||||
RequestBuilder::new()
|
||||
.method(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: &PaymentsAuthorizeRouterData,
|
||||
event_builder: Option<&mut ConnectorEvent>,
|
||||
res: Response,
|
||||
) -> CustomResult<PaymentsAuthorizeRouterData, errors::ConnectorError> {
|
||||
let response: celero::CeleroPaymentsResponse = res
|
||||
.response
|
||||
.parse_struct("Celero PaymentsAuthorizeResponse")
|
||||
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
|
||||
event_builder.map(|i| i.set_response_body(&response));
|
||||
router_env::logger::info!(connector_response=?response);
|
||||
RouterData::try_from(ResponseRouterData {
|
||||
response,
|
||||
data: data.clone(),
|
||||
http_code: res.status_code,
|
||||
})
|
||||
}
|
||||
|
||||
fn get_error_response(
|
||||
&self,
|
||||
res: Response,
|
||||
event_builder: Option<&mut ConnectorEvent>,
|
||||
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
|
||||
self.build_error_response(res, event_builder)
|
||||
}
|
||||
}
|
||||
|
||||
impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Celero {
|
||||
fn get_headers(
|
||||
&self,
|
||||
req: &PaymentsSyncRouterData,
|
||||
connectors: &Connectors,
|
||||
) -> CustomResult<Vec<(String, masking::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: &PaymentsSyncRouterData,
|
||||
_connectors: &Connectors,
|
||||
) -> CustomResult<String, errors::ConnectorError> {
|
||||
Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into())
|
||||
}
|
||||
|
||||
fn build_request(
|
||||
&self,
|
||||
req: &PaymentsSyncRouterData,
|
||||
connectors: &Connectors,
|
||||
) -> CustomResult<Option<Request>, errors::ConnectorError> {
|
||||
Ok(Some(
|
||||
RequestBuilder::new()
|
||||
.method(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: &PaymentsSyncRouterData,
|
||||
event_builder: Option<&mut ConnectorEvent>,
|
||||
res: Response,
|
||||
) -> CustomResult<PaymentsSyncRouterData, errors::ConnectorError> {
|
||||
let response: celero::CeleroPaymentsResponse = res
|
||||
.response
|
||||
.parse_struct("celero PaymentsSyncResponse")
|
||||
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
|
||||
event_builder.map(|i| i.set_response_body(&response));
|
||||
router_env::logger::info!(connector_response=?response);
|
||||
RouterData::try_from(ResponseRouterData {
|
||||
response,
|
||||
data: data.clone(),
|
||||
http_code: res.status_code,
|
||||
})
|
||||
}
|
||||
|
||||
fn get_error_response(
|
||||
&self,
|
||||
res: Response,
|
||||
event_builder: Option<&mut ConnectorEvent>,
|
||||
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
|
||||
self.build_error_response(res, event_builder)
|
||||
}
|
||||
}
|
||||
|
||||
impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Celero {
|
||||
fn get_headers(
|
||||
&self,
|
||||
req: &PaymentsCaptureRouterData,
|
||||
connectors: &Connectors,
|
||||
) -> CustomResult<Vec<(String, masking::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: &PaymentsCaptureRouterData,
|
||||
_connectors: &Connectors,
|
||||
) -> CustomResult<String, errors::ConnectorError> {
|
||||
Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into())
|
||||
}
|
||||
|
||||
fn get_request_body(
|
||||
&self,
|
||||
_req: &PaymentsCaptureRouterData,
|
||||
_connectors: &Connectors,
|
||||
) -> CustomResult<RequestContent, errors::ConnectorError> {
|
||||
Err(errors::ConnectorError::NotImplemented("get_request_body method".to_string()).into())
|
||||
}
|
||||
|
||||
fn build_request(
|
||||
&self,
|
||||
req: &PaymentsCaptureRouterData,
|
||||
connectors: &Connectors,
|
||||
) -> CustomResult<Option<Request>, errors::ConnectorError> {
|
||||
Ok(Some(
|
||||
RequestBuilder::new()
|
||||
.method(Method::Post)
|
||||
.url(&types::PaymentsCaptureType::get_url(self, req, connectors)?)
|
||||
.attach_default_headers()
|
||||
.headers(types::PaymentsCaptureType::get_headers(
|
||||
self, req, connectors,
|
||||
)?)
|
||||
.set_body(types::PaymentsCaptureType::get_request_body(
|
||||
self, req, connectors,
|
||||
)?)
|
||||
.build(),
|
||||
))
|
||||
}
|
||||
|
||||
fn handle_response(
|
||||
&self,
|
||||
data: &PaymentsCaptureRouterData,
|
||||
event_builder: Option<&mut ConnectorEvent>,
|
||||
res: Response,
|
||||
) -> CustomResult<PaymentsCaptureRouterData, errors::ConnectorError> {
|
||||
let response: celero::CeleroPaymentsResponse = res
|
||||
.response
|
||||
.parse_struct("Celero PaymentsCaptureResponse")
|
||||
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
|
||||
event_builder.map(|i| i.set_response_body(&response));
|
||||
router_env::logger::info!(connector_response=?response);
|
||||
RouterData::try_from(ResponseRouterData {
|
||||
response,
|
||||
data: data.clone(),
|
||||
http_code: res.status_code,
|
||||
})
|
||||
}
|
||||
|
||||
fn get_error_response(
|
||||
&self,
|
||||
res: Response,
|
||||
event_builder: Option<&mut ConnectorEvent>,
|
||||
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
|
||||
self.build_error_response(res, event_builder)
|
||||
}
|
||||
}
|
||||
|
||||
impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Celero {}
|
||||
|
||||
impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Celero {
|
||||
fn get_headers(
|
||||
&self,
|
||||
req: &RefundsRouterData<Execute>,
|
||||
connectors: &Connectors,
|
||||
) -> CustomResult<Vec<(String, masking::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: &RefundsRouterData<Execute>,
|
||||
_connectors: &Connectors,
|
||||
) -> CustomResult<String, errors::ConnectorError> {
|
||||
Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into())
|
||||
}
|
||||
|
||||
fn get_request_body(
|
||||
&self,
|
||||
req: &RefundsRouterData<Execute>,
|
||||
_connectors: &Connectors,
|
||||
) -> CustomResult<RequestContent, errors::ConnectorError> {
|
||||
let refund_amount = utils::convert_amount(
|
||||
self.amount_converter,
|
||||
req.request.minor_refund_amount,
|
||||
req.request.currency,
|
||||
)?;
|
||||
|
||||
let connector_router_data = celero::CeleroRouterData::from((refund_amount, req));
|
||||
let connector_req = celero::CeleroRefundRequest::try_from(&connector_router_data)?;
|
||||
Ok(RequestContent::Json(Box::new(connector_req)))
|
||||
}
|
||||
|
||||
fn build_request(
|
||||
&self,
|
||||
req: &RefundsRouterData<Execute>,
|
||||
connectors: &Connectors,
|
||||
) -> CustomResult<Option<Request>, errors::ConnectorError> {
|
||||
let request = RequestBuilder::new()
|
||||
.method(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: &RefundsRouterData<Execute>,
|
||||
event_builder: Option<&mut ConnectorEvent>,
|
||||
res: Response,
|
||||
) -> CustomResult<RefundsRouterData<Execute>, errors::ConnectorError> {
|
||||
let response: celero::RefundResponse =
|
||||
res.response
|
||||
.parse_struct("celero RefundResponse")
|
||||
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
|
||||
event_builder.map(|i| i.set_response_body(&response));
|
||||
router_env::logger::info!(connector_response=?response);
|
||||
RouterData::try_from(ResponseRouterData {
|
||||
response,
|
||||
data: data.clone(),
|
||||
http_code: res.status_code,
|
||||
})
|
||||
}
|
||||
|
||||
fn get_error_response(
|
||||
&self,
|
||||
res: Response,
|
||||
event_builder: Option<&mut ConnectorEvent>,
|
||||
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
|
||||
self.build_error_response(res, event_builder)
|
||||
}
|
||||
}
|
||||
|
||||
impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Celero {
|
||||
fn get_headers(
|
||||
&self,
|
||||
req: &RefundSyncRouterData,
|
||||
connectors: &Connectors,
|
||||
) -> CustomResult<Vec<(String, masking::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: &RefundSyncRouterData,
|
||||
_connectors: &Connectors,
|
||||
) -> CustomResult<String, errors::ConnectorError> {
|
||||
Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into())
|
||||
}
|
||||
|
||||
fn build_request(
|
||||
&self,
|
||||
req: &RefundSyncRouterData,
|
||||
connectors: &Connectors,
|
||||
) -> CustomResult<Option<Request>, errors::ConnectorError> {
|
||||
Ok(Some(
|
||||
RequestBuilder::new()
|
||||
.method(Method::Get)
|
||||
.url(&types::RefundSyncType::get_url(self, req, connectors)?)
|
||||
.attach_default_headers()
|
||||
.headers(types::RefundSyncType::get_headers(self, req, connectors)?)
|
||||
.set_body(types::RefundSyncType::get_request_body(
|
||||
self, req, connectors,
|
||||
)?)
|
||||
.build(),
|
||||
))
|
||||
}
|
||||
|
||||
fn handle_response(
|
||||
&self,
|
||||
data: &RefundSyncRouterData,
|
||||
event_builder: Option<&mut ConnectorEvent>,
|
||||
res: Response,
|
||||
) -> CustomResult<RefundSyncRouterData, errors::ConnectorError> {
|
||||
let response: celero::RefundResponse = res
|
||||
.response
|
||||
.parse_struct("celero RefundSyncResponse")
|
||||
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
|
||||
event_builder.map(|i| i.set_response_body(&response));
|
||||
router_env::logger::info!(connector_response=?response);
|
||||
RouterData::try_from(ResponseRouterData {
|
||||
response,
|
||||
data: data.clone(),
|
||||
http_code: res.status_code,
|
||||
})
|
||||
}
|
||||
|
||||
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 webhooks::IncomingWebhook for Celero {
|
||||
fn get_webhook_object_reference_id(
|
||||
&self,
|
||||
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
|
||||
) -> CustomResult<api_models::webhooks::ObjectReferenceId, errors::ConnectorError> {
|
||||
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
|
||||
}
|
||||
|
||||
fn get_webhook_event_type(
|
||||
&self,
|
||||
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
|
||||
) -> CustomResult<api_models::webhooks::IncomingWebhookEvent, errors::ConnectorError> {
|
||||
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
|
||||
}
|
||||
|
||||
fn get_webhook_resource_object(
|
||||
&self,
|
||||
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
|
||||
) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
|
||||
Err(report!(errors::ConnectorError::WebhooksNotImplemented))
|
||||
}
|
||||
}
|
||||
|
||||
impl ConnectorSpecifications for Celero {}
|
||||
@ -0,0 +1,228 @@
|
||||
use common_enums::enums;
|
||||
use common_utils::types::StringMinorUnit;
|
||||
use hyperswitch_domain_models::{
|
||||
payment_method_data::PaymentMethodData,
|
||||
router_data::{ConnectorAuthType, RouterData},
|
||||
router_flow_types::refunds::{Execute, RSync},
|
||||
router_request_types::ResponseId,
|
||||
router_response_types::{PaymentsResponseData, RefundsResponseData},
|
||||
types::{PaymentsAuthorizeRouterData, RefundsRouterData},
|
||||
};
|
||||
use hyperswitch_interfaces::errors;
|
||||
use masking::Secret;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{
|
||||
types::{RefundsResponseRouterData, ResponseRouterData},
|
||||
utils::PaymentsAuthorizeRequestData,
|
||||
};
|
||||
|
||||
//TODO: Fill the struct with respective fields
|
||||
pub struct CeleroRouterData<T> {
|
||||
pub amount: StringMinorUnit, // The type of amount that a connector accepts, for example, String, i64, f64, etc.
|
||||
pub router_data: T,
|
||||
}
|
||||
|
||||
impl<T> From<(StringMinorUnit, T)> for CeleroRouterData<T> {
|
||||
fn from((amount, item): (StringMinorUnit, T)) -> Self {
|
||||
//Todo : use utils to convert the amount to the type of amount that a connector accepts
|
||||
Self {
|
||||
amount,
|
||||
router_data: item,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: Fill the struct with respective fields
|
||||
#[derive(Default, Debug, Serialize, PartialEq)]
|
||||
pub struct CeleroPaymentsRequest {
|
||||
amount: StringMinorUnit,
|
||||
card: CeleroCard,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Serialize, Eq, PartialEq)]
|
||||
pub struct CeleroCard {
|
||||
number: cards::CardNumber,
|
||||
expiry_month: Secret<String>,
|
||||
expiry_year: Secret<String>,
|
||||
cvc: Secret<String>,
|
||||
complete: bool,
|
||||
}
|
||||
|
||||
impl TryFrom<&CeleroRouterData<&PaymentsAuthorizeRouterData>> for CeleroPaymentsRequest {
|
||||
type Error = error_stack::Report<errors::ConnectorError>;
|
||||
fn try_from(
|
||||
item: &CeleroRouterData<&PaymentsAuthorizeRouterData>,
|
||||
) -> Result<Self, Self::Error> {
|
||||
match item.router_data.request.payment_method_data.clone() {
|
||||
PaymentMethodData::Card(req_card) => {
|
||||
let card = CeleroCard {
|
||||
number: req_card.card_number,
|
||||
expiry_month: req_card.card_exp_month,
|
||||
expiry_year: req_card.card_exp_year,
|
||||
cvc: req_card.card_cvc,
|
||||
complete: item.router_data.request.is_auto_capture()?,
|
||||
};
|
||||
Ok(Self {
|
||||
amount: item.amount.clone(),
|
||||
card,
|
||||
})
|
||||
}
|
||||
_ => Err(errors::ConnectorError::NotImplemented("Payment method".to_string()).into()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: Fill the struct with respective fields
|
||||
// Auth Struct
|
||||
pub struct CeleroAuthType {
|
||||
pub(super) api_key: Secret<String>,
|
||||
}
|
||||
|
||||
impl TryFrom<&ConnectorAuthType> for CeleroAuthType {
|
||||
type Error = error_stack::Report<errors::ConnectorError>;
|
||||
fn try_from(auth_type: &ConnectorAuthType) -> Result<Self, Self::Error> {
|
||||
match auth_type {
|
||||
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 CeleroPaymentStatus {
|
||||
Succeeded,
|
||||
Failed,
|
||||
#[default]
|
||||
Processing,
|
||||
}
|
||||
|
||||
impl From<CeleroPaymentStatus> for common_enums::AttemptStatus {
|
||||
fn from(item: CeleroPaymentStatus) -> Self {
|
||||
match item {
|
||||
CeleroPaymentStatus::Succeeded => Self::Charged,
|
||||
CeleroPaymentStatus::Failed => Self::Failure,
|
||||
CeleroPaymentStatus::Processing => Self::Authorizing,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: Fill the struct with respective fields
|
||||
#[derive(Default, Debug, Clone, Serialize, Deserialize, PartialEq)]
|
||||
pub struct CeleroPaymentsResponse {
|
||||
status: CeleroPaymentStatus,
|
||||
id: String,
|
||||
}
|
||||
|
||||
impl<F, T> TryFrom<ResponseRouterData<F, CeleroPaymentsResponse, T, PaymentsResponseData>>
|
||||
for RouterData<F, T, PaymentsResponseData>
|
||||
{
|
||||
type Error = error_stack::Report<errors::ConnectorError>;
|
||||
fn try_from(
|
||||
item: ResponseRouterData<F, CeleroPaymentsResponse, T, PaymentsResponseData>,
|
||||
) -> Result<Self, Self::Error> {
|
||||
Ok(Self {
|
||||
status: common_enums::AttemptStatus::from(item.response.status),
|
||||
response: Ok(PaymentsResponseData::TransactionResponse {
|
||||
resource_id: ResponseId::ConnectorTransactionId(item.response.id),
|
||||
redirection_data: Box::new(None),
|
||||
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
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: Fill the struct with respective fields
|
||||
// REFUND :
|
||||
// Type definition for RefundRequest
|
||||
#[derive(Default, Debug, Serialize)]
|
||||
pub struct CeleroRefundRequest {
|
||||
pub amount: StringMinorUnit,
|
||||
}
|
||||
|
||||
impl<F> TryFrom<&CeleroRouterData<&RefundsRouterData<F>>> for CeleroRefundRequest {
|
||||
type Error = error_stack::Report<errors::ConnectorError>;
|
||||
fn try_from(item: &CeleroRouterData<&RefundsRouterData<F>>) -> Result<Self, Self::Error> {
|
||||
Ok(Self {
|
||||
amount: item.amount.to_owned(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Type definition for Refund Response
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[derive(Debug, Serialize, Default, Deserialize, Clone)]
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: Fill the struct with respective fields
|
||||
#[derive(Default, Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct RefundResponse {
|
||||
id: String,
|
||||
status: RefundStatus,
|
||||
}
|
||||
|
||||
impl TryFrom<RefundsResponseRouterData<Execute, RefundResponse>> for RefundsRouterData<Execute> {
|
||||
type Error = error_stack::Report<errors::ConnectorError>;
|
||||
fn try_from(
|
||||
item: RefundsResponseRouterData<Execute, RefundResponse>,
|
||||
) -> Result<Self, Self::Error> {
|
||||
Ok(Self {
|
||||
response: Ok(RefundsResponseData {
|
||||
connector_refund_id: item.response.id.to_string(),
|
||||
refund_status: enums::RefundStatus::from(item.response.status),
|
||||
}),
|
||||
..item.data
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl TryFrom<RefundsResponseRouterData<RSync, RefundResponse>> for RefundsRouterData<RSync> {
|
||||
type Error = error_stack::Report<errors::ConnectorError>;
|
||||
fn try_from(
|
||||
item: RefundsResponseRouterData<RSync, RefundResponse>,
|
||||
) -> Result<Self, Self::Error> {
|
||||
Ok(Self {
|
||||
response: Ok(RefundsResponseData {
|
||||
connector_refund_id: item.response.id.to_string(),
|
||||
refund_status: enums::RefundStatus::from(item.response.status),
|
||||
}),
|
||||
..item.data
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: Fill the struct with respective fields
|
||||
#[derive(Default, Debug, Serialize, Deserialize, PartialEq)]
|
||||
pub struct CeleroErrorResponse {
|
||||
pub status_code: u16,
|
||||
pub code: String,
|
||||
pub message: String,
|
||||
pub reason: Option<String>,
|
||||
}
|
||||
@ -159,6 +159,7 @@ default_imp_for_authorize_session_token!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -283,6 +284,7 @@ default_imp_for_calculate_tax!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -408,6 +410,7 @@ default_imp_for_session_update!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -533,6 +536,7 @@ default_imp_for_post_session_tokens!(
|
||||
connectors::Boku,
|
||||
connectors::Billwerk,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -657,6 +661,7 @@ default_imp_for_create_order!(
|
||||
connectors::Boku,
|
||||
connectors::Billwerk,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -782,6 +787,7 @@ default_imp_for_update_metadata!(
|
||||
connectors::Boku,
|
||||
connectors::Billwerk,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -905,6 +911,7 @@ default_imp_for_complete_authorize!(
|
||||
connectors::Bitpay,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -1015,6 +1022,7 @@ default_imp_for_incremental_authorization!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -1140,6 +1148,7 @@ default_imp_for_create_customer!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -1259,6 +1268,7 @@ default_imp_for_connector_redirect_response!(
|
||||
connectors::Barclaycard,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Coinbase,
|
||||
@ -1367,6 +1377,7 @@ default_imp_for_pre_processing_steps!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -1483,6 +1494,7 @@ default_imp_for_post_processing_steps!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -1609,6 +1621,7 @@ default_imp_for_approve!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -1736,6 +1749,7 @@ default_imp_for_reject!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -1863,6 +1877,7 @@ default_imp_for_webhook_source_verification!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -1989,6 +2004,7 @@ default_imp_for_accept_dispute!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Coinbase,
|
||||
@ -2114,6 +2130,7 @@ default_imp_for_submit_evidence!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Coinbase,
|
||||
@ -2238,6 +2255,7 @@ default_imp_for_defend_dispute!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Coinbase,
|
||||
@ -2372,6 +2390,7 @@ default_imp_for_file_upload!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Coinbase,
|
||||
@ -2488,6 +2507,7 @@ default_imp_for_payouts!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -2608,6 +2628,7 @@ default_imp_for_payouts_create!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -2732,6 +2753,7 @@ default_imp_for_payouts_retrieve!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -2858,6 +2880,7 @@ default_imp_for_payouts_eligibility!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -2982,6 +3005,7 @@ default_imp_for_payouts_fulfill!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -3103,6 +3127,7 @@ default_imp_for_payouts_cancel!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -3228,6 +3253,7 @@ default_imp_for_payouts_quote!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -3354,6 +3380,7 @@ default_imp_for_payouts_recipient!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -3479,6 +3506,7 @@ default_imp_for_payouts_recipient_account!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -3606,6 +3634,7 @@ default_imp_for_frm_sale!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -3733,6 +3762,7 @@ default_imp_for_frm_checkout!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -3860,6 +3890,7 @@ default_imp_for_frm_transaction!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -3987,6 +4018,7 @@ default_imp_for_frm_fulfillment!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -4114,6 +4146,7 @@ default_imp_for_frm_record_return!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -4237,6 +4270,7 @@ default_imp_for_revoking_mandates!(
|
||||
connectors::Bluesnap,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -4360,6 +4394,7 @@ default_imp_for_uas_pre_authentication!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -4484,6 +4519,7 @@ default_imp_for_uas_post_authentication!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -4609,6 +4645,7 @@ default_imp_for_uas_authentication_confirmation!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -4726,6 +4763,7 @@ default_imp_for_connector_request_id!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -4845,6 +4883,7 @@ default_imp_for_fraud_check!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -4994,6 +5033,7 @@ default_imp_for_connector_authentication!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -5116,6 +5156,7 @@ default_imp_for_uas_authentication!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -5233,6 +5274,7 @@ default_imp_for_revenue_recovery!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -5361,6 +5403,7 @@ default_imp_for_billing_connector_payment_sync!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -5488,6 +5531,7 @@ default_imp_for_revenue_recovery_record_back!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
connectors::Coinbase,
|
||||
@ -5613,6 +5657,7 @@ default_imp_for_billing_connector_invoice_sync!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -5733,6 +5778,7 @@ default_imp_for_external_vault!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -5859,6 +5905,7 @@ default_imp_for_external_vault_insert!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -5985,6 +6032,7 @@ default_imp_for_external_vault_retrieve!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -6111,6 +6159,7 @@ default_imp_for_external_vault_delete!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -6237,6 +6286,7 @@ default_imp_for_external_vault_create!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
|
||||
@ -264,6 +264,7 @@ default_imp_for_new_connector_integration_payment!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -391,6 +392,7 @@ default_imp_for_new_connector_integration_refund!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -513,6 +515,7 @@ default_imp_for_new_connector_integration_connector_access_token!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -641,6 +644,7 @@ default_imp_for_new_connector_integration_accept_dispute!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -767,6 +771,7 @@ default_imp_for_new_connector_integration_submit_evidence!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -893,6 +898,7 @@ default_imp_for_new_connector_integration_defend_dispute!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -1030,6 +1036,7 @@ default_imp_for_new_connector_integration_file_upload!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -1159,6 +1166,7 @@ default_imp_for_new_connector_integration_payouts_create!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -1288,6 +1296,7 @@ default_imp_for_new_connector_integration_payouts_eligibility!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -1417,6 +1426,7 @@ default_imp_for_new_connector_integration_payouts_fulfill!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -1546,6 +1556,7 @@ default_imp_for_new_connector_integration_payouts_cancel!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -1675,6 +1686,7 @@ default_imp_for_new_connector_integration_payouts_quote!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -1804,6 +1816,7 @@ default_imp_for_new_connector_integration_payouts_recipient!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -1933,6 +1946,7 @@ default_imp_for_new_connector_integration_payouts_sync!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -2062,6 +2076,7 @@ default_imp_for_new_connector_integration_payouts_recipient_account!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -2189,6 +2204,7 @@ default_imp_for_new_connector_integration_webhook_source_verification!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -2318,6 +2334,7 @@ default_imp_for_new_connector_integration_frm_sale!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -2447,6 +2464,7 @@ default_imp_for_new_connector_integration_frm_checkout!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -2576,6 +2594,7 @@ default_imp_for_new_connector_integration_frm_transaction!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -2705,6 +2724,7 @@ default_imp_for_new_connector_integration_frm_fulfillment!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -2834,6 +2854,7 @@ default_imp_for_new_connector_integration_frm_record_return!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -2960,6 +2981,7 @@ default_imp_for_new_connector_integration_revoking_mandates!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
@ -3074,6 +3096,7 @@ default_imp_for_new_connector_integration_frm!(
|
||||
connectors::Bluesnap,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Checkbook,
|
||||
connectors::Coinbase,
|
||||
connectors::Cryptopay,
|
||||
@ -3200,6 +3223,7 @@ default_imp_for_new_connector_integration_connector_authentication!(
|
||||
connectors::Bluesnap,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Checkbook,
|
||||
connectors::Coinbase,
|
||||
connectors::Cryptopay,
|
||||
@ -3315,6 +3339,7 @@ default_imp_for_new_connector_integration_revenue_recovery!(
|
||||
connectors::Bluesnap,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Checkbook,
|
||||
connectors::Coinbase,
|
||||
connectors::Cryptopay,
|
||||
@ -3446,6 +3471,7 @@ default_imp_for_new_connector_integration_external_vault!(
|
||||
connectors::Braintree,
|
||||
connectors::Boku,
|
||||
connectors::Cashtocode,
|
||||
connectors::Celero,
|
||||
connectors::Chargebee,
|
||||
connectors::Checkbook,
|
||||
connectors::Checkout,
|
||||
|
||||
@ -29,6 +29,7 @@ pub struct Connectors {
|
||||
pub boku: ConnectorParams,
|
||||
pub braintree: ConnectorParams,
|
||||
pub cashtocode: ConnectorParams,
|
||||
pub celero: ConnectorParams,
|
||||
pub chargebee: ConnectorParams,
|
||||
pub checkbook: ConnectorParams,
|
||||
pub checkout: ConnectorParams,
|
||||
|
||||
@ -9,31 +9,32 @@ pub use hyperswitch_connectors::connectors::{
|
||||
bamboraapac::Bamboraapac, bankofamerica, bankofamerica::Bankofamerica, barclaycard,
|
||||
barclaycard::Barclaycard, billwerk, billwerk::Billwerk, bitpay, bitpay::Bitpay, bluesnap,
|
||||
bluesnap::Bluesnap, boku, boku::Boku, braintree, braintree::Braintree, cashtocode,
|
||||
cashtocode::Cashtocode, chargebee, chargebee::Chargebee, checkbook, checkbook::Checkbook,
|
||||
checkout, checkout::Checkout, coinbase, coinbase::Coinbase, coingate, coingate::Coingate,
|
||||
cryptopay, cryptopay::Cryptopay, ctp_mastercard, ctp_mastercard::CtpMastercard, cybersource,
|
||||
cybersource::Cybersource, datatrans, datatrans::Datatrans, deutschebank,
|
||||
deutschebank::Deutschebank, digitalvirgo, digitalvirgo::Digitalvirgo, dlocal, dlocal::Dlocal,
|
||||
dwolla, dwolla::Dwolla, ebanx, ebanx::Ebanx, elavon, elavon::Elavon, facilitapay,
|
||||
facilitapay::Facilitapay, fiserv, fiserv::Fiserv, fiservemea, fiservemea::Fiservemea, fiuu,
|
||||
fiuu::Fiuu, forte, forte::Forte, getnet, getnet::Getnet, globalpay, globalpay::Globalpay,
|
||||
globepay, globepay::Globepay, gocardless, gocardless::Gocardless, gpayments,
|
||||
gpayments::Gpayments, helcim, helcim::Helcim, hipay, hipay::Hipay, hyperswitch_vault,
|
||||
hyperswitch_vault::HyperswitchVault, iatapay, iatapay::Iatapay, inespay, inespay::Inespay,
|
||||
itaubank, itaubank::Itaubank, jpmorgan, jpmorgan::Jpmorgan, juspaythreedsserver,
|
||||
juspaythreedsserver::Juspaythreedsserver, klarna, klarna::Klarna, mifinity, mifinity::Mifinity,
|
||||
mollie, mollie::Mollie, moneris, moneris::Moneris, multisafepay, multisafepay::Multisafepay,
|
||||
netcetera, netcetera::Netcetera, nexinets, nexinets::Nexinets, nexixpay, nexixpay::Nexixpay,
|
||||
nmi, nmi::Nmi, nomupay, nomupay::Nomupay, noon, noon::Noon, nordea, nordea::Nordea, novalnet,
|
||||
novalnet::Novalnet, nuvei, nuvei::Nuvei, opayo, opayo::Opayo, opennode, opennode::Opennode,
|
||||
paybox, paybox::Paybox, payeezy, payeezy::Payeezy, payload, payload::Payload, payme,
|
||||
payme::Payme, payone, payone::Payone, paypal, paypal::Paypal, paystack, paystack::Paystack,
|
||||
payu, payu::Payu, placetopay, placetopay::Placetopay, plaid, plaid::Plaid, powertranz,
|
||||
powertranz::Powertranz, prophetpay, prophetpay::Prophetpay, rapyd, rapyd::Rapyd, razorpay,
|
||||
razorpay::Razorpay, recurly, recurly::Recurly, redsys, redsys::Redsys, riskified,
|
||||
riskified::Riskified, santander, santander::Santander, shift4, shift4::Shift4, signifyd,
|
||||
signifyd::Signifyd, square, square::Square, stax, stax::Stax, stripe, stripe::Stripe,
|
||||
stripebilling, stripebilling::Stripebilling, taxjar, taxjar::Taxjar, threedsecureio,
|
||||
cashtocode::Cashtocode, celero, celero::Celero, chargebee, chargebee::Chargebee, checkbook,
|
||||
checkbook::Checkbook, checkout, checkout::Checkout, coinbase, coinbase::Coinbase, coingate,
|
||||
coingate::Coingate, cryptopay, cryptopay::Cryptopay, ctp_mastercard,
|
||||
ctp_mastercard::CtpMastercard, cybersource, cybersource::Cybersource, datatrans,
|
||||
datatrans::Datatrans, deutschebank, deutschebank::Deutschebank, digitalvirgo,
|
||||
digitalvirgo::Digitalvirgo, dlocal, dlocal::Dlocal, dwolla, dwolla::Dwolla, ebanx,
|
||||
ebanx::Ebanx, elavon, elavon::Elavon, facilitapay, facilitapay::Facilitapay, fiserv,
|
||||
fiserv::Fiserv, fiservemea, fiservemea::Fiservemea, fiuu, fiuu::Fiuu, forte, forte::Forte,
|
||||
getnet, getnet::Getnet, globalpay, globalpay::Globalpay, globepay, globepay::Globepay,
|
||||
gocardless, gocardless::Gocardless, gpayments, gpayments::Gpayments, helcim, helcim::Helcim,
|
||||
hipay, hipay::Hipay, hyperswitch_vault, hyperswitch_vault::HyperswitchVault, iatapay,
|
||||
iatapay::Iatapay, inespay, inespay::Inespay, itaubank, itaubank::Itaubank, jpmorgan,
|
||||
jpmorgan::Jpmorgan, juspaythreedsserver, juspaythreedsserver::Juspaythreedsserver, klarna,
|
||||
klarna::Klarna, mifinity, mifinity::Mifinity, mollie, mollie::Mollie, moneris,
|
||||
moneris::Moneris, multisafepay, multisafepay::Multisafepay, netcetera, netcetera::Netcetera,
|
||||
nexinets, nexinets::Nexinets, nexixpay, nexixpay::Nexixpay, nmi, nmi::Nmi, nomupay,
|
||||
nomupay::Nomupay, noon, noon::Noon, nordea, nordea::Nordea, novalnet, novalnet::Novalnet,
|
||||
nuvei, nuvei::Nuvei, opayo, opayo::Opayo, opennode, opennode::Opennode, paybox, paybox::Paybox,
|
||||
payeezy, payeezy::Payeezy, payload, payload::Payload, payme, payme::Payme, payone,
|
||||
payone::Payone, paypal, paypal::Paypal, paystack, paystack::Paystack, payu, payu::Payu,
|
||||
placetopay, placetopay::Placetopay, plaid, plaid::Plaid, powertranz, powertranz::Powertranz,
|
||||
prophetpay, prophetpay::Prophetpay, rapyd, rapyd::Rapyd, razorpay, razorpay::Razorpay, recurly,
|
||||
recurly::Recurly, redsys, redsys::Redsys, riskified, riskified::Riskified, santander,
|
||||
santander::Santander, shift4, shift4::Shift4, signifyd, signifyd::Signifyd, square,
|
||||
square::Square, stax, stax::Stax, stripe, stripe::Stripe, stripebilling,
|
||||
stripebilling::Stripebilling, taxjar, taxjar::Taxjar, threedsecureio,
|
||||
threedsecureio::Threedsecureio, thunes, thunes::Thunes, tokenio, tokenio::Tokenio, trustpay,
|
||||
trustpay::Trustpay, tsys, tsys::Tsys, unified_authentication_service,
|
||||
unified_authentication_service::UnifiedAuthenticationService, vgs, vgs::Vgs, volt, volt::Volt,
|
||||
|
||||
@ -136,7 +136,10 @@ impl ConnectorAuthTypeAndMetadataValidation<'_> {
|
||||
}
|
||||
api_enums::Connector::Chargebee => {
|
||||
chargebee::transformers::ChargebeeAuthType::try_from(self.auth_type)?;
|
||||
chargebee::transformers::ChargebeeMetadata::try_from(self.connector_meta_data)?;
|
||||
Ok(())
|
||||
}
|
||||
api_enums::Connector::Celero => {
|
||||
celero::transformers::CeleroAuthType::try_from(self.auth_type)?;
|
||||
Ok(())
|
||||
}
|
||||
// api_enums::Connector::Checkbook => {
|
||||
|
||||
@ -372,6 +372,9 @@ impl ConnectorData {
|
||||
enums::Connector::Cashtocode => {
|
||||
Ok(ConnectorEnum::Old(Box::new(connector::Cashtocode::new())))
|
||||
}
|
||||
enums::Connector::Celero => {
|
||||
Ok(ConnectorEnum::Old(Box::new(connector::Celero::new())))
|
||||
}
|
||||
enums::Connector::Chargebee => {
|
||||
Ok(ConnectorEnum::Old(Box::new(connector::Chargebee::new())))
|
||||
}
|
||||
|
||||
@ -223,6 +223,7 @@ impl ForeignTryFrom<api_enums::Connector> for common_enums::RoutableConnectors {
|
||||
api_enums::Connector::Boku => Self::Boku,
|
||||
api_enums::Connector::Braintree => Self::Braintree,
|
||||
api_enums::Connector::Cashtocode => Self::Cashtocode,
|
||||
api_enums::Connector::Celero => Self::Celero,
|
||||
api_enums::Connector::Chargebee => Self::Chargebee,
|
||||
// api_enums::Connector::Checkbook => Self::Checkbook,
|
||||
api_enums::Connector::Checkout => Self::Checkout,
|
||||
|
||||
420
crates/router/tests/connectors/celero.rs
Normal file
420
crates/router/tests/connectors/celero.rs
Normal file
@ -0,0 +1,420 @@
|
||||
use masking::Secret;
|
||||
use router::types::{self, api, domain, storage::enums};
|
||||
use test_utils::connector_auth;
|
||||
|
||||
use crate::utils::{self, ConnectorActions};
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
struct CeleroTest;
|
||||
impl ConnectorActions for CeleroTest {}
|
||||
impl utils::Connector for CeleroTest {
|
||||
fn get_data(&self) -> api::ConnectorData {
|
||||
use router::connector::Celero;
|
||||
utils::construct_connector_data_old(
|
||||
Box::new(Celero::new()),
|
||||
types::Connector::Celero,
|
||||
api::GetToken::Connector,
|
||||
None,
|
||||
)
|
||||
}
|
||||
|
||||
fn get_auth_token(&self) -> types::ConnectorAuthType {
|
||||
utils::to_connector_auth_type(
|
||||
connector_auth::ConnectorAuthentication::new()
|
||||
.celero
|
||||
.expect("Missing connector authentication configuration")
|
||||
.into(),
|
||||
)
|
||||
}
|
||||
|
||||
fn get_name(&self) -> String {
|
||||
"celero".to_string()
|
||||
}
|
||||
}
|
||||
|
||||
static CONNECTOR: CeleroTest = CeleroTest {};
|
||||
|
||||
fn get_default_payment_info() -> Option<utils::PaymentInfo> {
|
||||
None
|
||||
}
|
||||
|
||||
fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {
|
||||
None
|
||||
}
|
||||
|
||||
// Cards Positive Tests
|
||||
// Creates a payment using the manual capture flow (Non 3DS).
|
||||
#[actix_web::test]
|
||||
async fn should_only_authorize_payment() {
|
||||
let response = CONNECTOR
|
||||
.authorize_payment(payment_method_details(), get_default_payment_info())
|
||||
.await
|
||||
.expect("Authorize payment response");
|
||||
assert_eq!(response.status, enums::AttemptStatus::Authorized);
|
||||
}
|
||||
|
||||
// Captures a payment using the manual capture flow (Non 3DS).
|
||||
#[actix_web::test]
|
||||
async fn should_capture_authorized_payment() {
|
||||
let response = CONNECTOR
|
||||
.authorize_and_capture_payment(payment_method_details(), None, get_default_payment_info())
|
||||
.await
|
||||
.expect("Capture payment response");
|
||||
assert_eq!(response.status, enums::AttemptStatus::Charged);
|
||||
}
|
||||
|
||||
// Partially captures a payment using the manual capture flow (Non 3DS).
|
||||
#[actix_web::test]
|
||||
async fn should_partially_capture_authorized_payment() {
|
||||
let response = CONNECTOR
|
||||
.authorize_and_capture_payment(
|
||||
payment_method_details(),
|
||||
Some(types::PaymentsCaptureData {
|
||||
amount_to_capture: 50,
|
||||
..utils::PaymentCaptureType::default().0
|
||||
}),
|
||||
get_default_payment_info(),
|
||||
)
|
||||
.await
|
||||
.expect("Capture payment response");
|
||||
assert_eq!(response.status, enums::AttemptStatus::Charged);
|
||||
}
|
||||
|
||||
// Synchronizes a payment using the manual capture flow (Non 3DS).
|
||||
#[actix_web::test]
|
||||
async fn should_sync_authorized_payment() {
|
||||
let authorize_response = CONNECTOR
|
||||
.authorize_payment(payment_method_details(), get_default_payment_info())
|
||||
.await
|
||||
.expect("Authorize payment response");
|
||||
let txn_id = utils::get_connector_transaction_id(authorize_response.response);
|
||||
let response = CONNECTOR
|
||||
.psync_retry_till_status_matches(
|
||||
enums::AttemptStatus::Authorized,
|
||||
Some(types::PaymentsSyncData {
|
||||
connector_transaction_id: types::ResponseId::ConnectorTransactionId(
|
||||
txn_id.unwrap(),
|
||||
),
|
||||
..Default::default()
|
||||
}),
|
||||
get_default_payment_info(),
|
||||
)
|
||||
.await
|
||||
.expect("PSync response");
|
||||
assert_eq!(response.status, enums::AttemptStatus::Authorized,);
|
||||
}
|
||||
|
||||
// Voids a payment using the manual capture flow (Non 3DS).
|
||||
#[actix_web::test]
|
||||
async fn should_void_authorized_payment() {
|
||||
let response = CONNECTOR
|
||||
.authorize_and_void_payment(
|
||||
payment_method_details(),
|
||||
Some(types::PaymentsCancelData {
|
||||
connector_transaction_id: String::from(""),
|
||||
cancellation_reason: Some("requested_by_customer".to_string()),
|
||||
..Default::default()
|
||||
}),
|
||||
get_default_payment_info(),
|
||||
)
|
||||
.await
|
||||
.expect("Void payment response");
|
||||
assert_eq!(response.status, enums::AttemptStatus::Voided);
|
||||
}
|
||||
|
||||
// Refunds a payment using the manual capture flow (Non 3DS).
|
||||
#[actix_web::test]
|
||||
async fn should_refund_manually_captured_payment() {
|
||||
let response = CONNECTOR
|
||||
.capture_payment_and_refund(
|
||||
payment_method_details(),
|
||||
None,
|
||||
None,
|
||||
get_default_payment_info(),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
response.response.unwrap().refund_status,
|
||||
enums::RefundStatus::Success,
|
||||
);
|
||||
}
|
||||
|
||||
// Partially refunds a payment using the manual capture flow (Non 3DS).
|
||||
#[actix_web::test]
|
||||
async fn should_partially_refund_manually_captured_payment() {
|
||||
let response = CONNECTOR
|
||||
.capture_payment_and_refund(
|
||||
payment_method_details(),
|
||||
None,
|
||||
Some(types::RefundsData {
|
||||
refund_amount: 50,
|
||||
..utils::PaymentRefundType::default().0
|
||||
}),
|
||||
get_default_payment_info(),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
response.response.unwrap().refund_status,
|
||||
enums::RefundStatus::Success,
|
||||
);
|
||||
}
|
||||
|
||||
// Synchronizes a refund using the manual capture flow (Non 3DS).
|
||||
#[actix_web::test]
|
||||
async fn should_sync_manually_captured_refund() {
|
||||
let refund_response = CONNECTOR
|
||||
.capture_payment_and_refund(
|
||||
payment_method_details(),
|
||||
None,
|
||||
None,
|
||||
get_default_payment_info(),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
let response = CONNECTOR
|
||||
.rsync_retry_till_status_matches(
|
||||
enums::RefundStatus::Success,
|
||||
refund_response.response.unwrap().connector_refund_id,
|
||||
None,
|
||||
get_default_payment_info(),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
response.response.unwrap().refund_status,
|
||||
enums::RefundStatus::Success,
|
||||
);
|
||||
}
|
||||
|
||||
// Creates a payment using the automatic capture flow (Non 3DS).
|
||||
#[actix_web::test]
|
||||
async fn should_make_payment() {
|
||||
let authorize_response = CONNECTOR
|
||||
.make_payment(payment_method_details(), get_default_payment_info())
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(authorize_response.status, enums::AttemptStatus::Charged);
|
||||
}
|
||||
|
||||
// Synchronizes a payment using the automatic capture flow (Non 3DS).
|
||||
#[actix_web::test]
|
||||
async fn should_sync_auto_captured_payment() {
|
||||
let authorize_response = CONNECTOR
|
||||
.make_payment(payment_method_details(), get_default_payment_info())
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(authorize_response.status, enums::AttemptStatus::Charged);
|
||||
let txn_id = utils::get_connector_transaction_id(authorize_response.response);
|
||||
assert_ne!(txn_id, None, "Empty connector transaction id");
|
||||
let response = CONNECTOR
|
||||
.psync_retry_till_status_matches(
|
||||
enums::AttemptStatus::Charged,
|
||||
Some(types::PaymentsSyncData {
|
||||
connector_transaction_id: types::ResponseId::ConnectorTransactionId(
|
||||
txn_id.unwrap(),
|
||||
),
|
||||
capture_method: Some(enums::CaptureMethod::Automatic),
|
||||
..Default::default()
|
||||
}),
|
||||
get_default_payment_info(),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(response.status, enums::AttemptStatus::Charged,);
|
||||
}
|
||||
|
||||
// Refunds a payment using the automatic capture flow (Non 3DS).
|
||||
#[actix_web::test]
|
||||
async fn should_refund_auto_captured_payment() {
|
||||
let response = CONNECTOR
|
||||
.make_payment_and_refund(payment_method_details(), None, get_default_payment_info())
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
response.response.unwrap().refund_status,
|
||||
enums::RefundStatus::Success,
|
||||
);
|
||||
}
|
||||
|
||||
// Partially refunds a payment using the automatic capture flow (Non 3DS).
|
||||
#[actix_web::test]
|
||||
async fn should_partially_refund_succeeded_payment() {
|
||||
let refund_response = CONNECTOR
|
||||
.make_payment_and_refund(
|
||||
payment_method_details(),
|
||||
Some(types::RefundsData {
|
||||
refund_amount: 50,
|
||||
..utils::PaymentRefundType::default().0
|
||||
}),
|
||||
get_default_payment_info(),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
refund_response.response.unwrap().refund_status,
|
||||
enums::RefundStatus::Success,
|
||||
);
|
||||
}
|
||||
|
||||
// Creates multiple refunds against a payment using the automatic capture flow (Non 3DS).
|
||||
#[actix_web::test]
|
||||
async fn should_refund_succeeded_payment_multiple_times() {
|
||||
CONNECTOR
|
||||
.make_payment_and_multiple_refund(
|
||||
payment_method_details(),
|
||||
Some(types::RefundsData {
|
||||
refund_amount: 50,
|
||||
..utils::PaymentRefundType::default().0
|
||||
}),
|
||||
get_default_payment_info(),
|
||||
)
|
||||
.await;
|
||||
}
|
||||
|
||||
// Synchronizes a refund using the automatic capture flow (Non 3DS).
|
||||
#[actix_web::test]
|
||||
async fn should_sync_refund() {
|
||||
let refund_response = CONNECTOR
|
||||
.make_payment_and_refund(payment_method_details(), None, get_default_payment_info())
|
||||
.await
|
||||
.unwrap();
|
||||
let response = CONNECTOR
|
||||
.rsync_retry_till_status_matches(
|
||||
enums::RefundStatus::Success,
|
||||
refund_response.response.unwrap().connector_refund_id,
|
||||
None,
|
||||
get_default_payment_info(),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
response.response.unwrap().refund_status,
|
||||
enums::RefundStatus::Success,
|
||||
);
|
||||
}
|
||||
|
||||
// Cards Negative scenarios
|
||||
// Creates a payment with incorrect CVC.
|
||||
#[actix_web::test]
|
||||
async fn should_fail_payment_for_incorrect_cvc() {
|
||||
let response = CONNECTOR
|
||||
.make_payment(
|
||||
Some(types::PaymentsAuthorizeData {
|
||||
payment_method_data: domain::PaymentMethodData::Card(domain::Card {
|
||||
card_cvc: Secret::new("12345".to_string()),
|
||||
..utils::CCardType::default().0
|
||||
}),
|
||||
..utils::PaymentAuthorizeType::default().0
|
||||
}),
|
||||
get_default_payment_info(),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
response.response.unwrap_err().message,
|
||||
"Your card's security code is invalid.".to_string(),
|
||||
);
|
||||
}
|
||||
|
||||
// Creates a payment with incorrect expiry month.
|
||||
#[actix_web::test]
|
||||
async fn should_fail_payment_for_invalid_exp_month() {
|
||||
let response = CONNECTOR
|
||||
.make_payment(
|
||||
Some(types::PaymentsAuthorizeData {
|
||||
payment_method_data: domain::PaymentMethodData::Card(domain::Card {
|
||||
card_exp_month: Secret::new("20".to_string()),
|
||||
..utils::CCardType::default().0
|
||||
}),
|
||||
..utils::PaymentAuthorizeType::default().0
|
||||
}),
|
||||
get_default_payment_info(),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
response.response.unwrap_err().message,
|
||||
"Your card's expiration month is invalid.".to_string(),
|
||||
);
|
||||
}
|
||||
|
||||
// Creates a payment with incorrect expiry year.
|
||||
#[actix_web::test]
|
||||
async fn should_fail_payment_for_incorrect_expiry_year() {
|
||||
let response = CONNECTOR
|
||||
.make_payment(
|
||||
Some(types::PaymentsAuthorizeData {
|
||||
payment_method_data: domain::PaymentMethodData::Card(domain::Card {
|
||||
card_exp_year: Secret::new("2000".to_string()),
|
||||
..utils::CCardType::default().0
|
||||
}),
|
||||
..utils::PaymentAuthorizeType::default().0
|
||||
}),
|
||||
get_default_payment_info(),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
response.response.unwrap_err().message,
|
||||
"Your card's expiration year is invalid.".to_string(),
|
||||
);
|
||||
}
|
||||
|
||||
// Voids a payment using automatic capture flow (Non 3DS).
|
||||
#[actix_web::test]
|
||||
async fn should_fail_void_payment_for_auto_capture() {
|
||||
let authorize_response = CONNECTOR
|
||||
.make_payment(payment_method_details(), get_default_payment_info())
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(authorize_response.status, enums::AttemptStatus::Charged);
|
||||
let txn_id = utils::get_connector_transaction_id(authorize_response.response);
|
||||
assert_ne!(txn_id, None, "Empty connector transaction id");
|
||||
let void_response = CONNECTOR
|
||||
.void_payment(txn_id.unwrap(), None, get_default_payment_info())
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
void_response.response.unwrap_err().message,
|
||||
"You cannot cancel this PaymentIntent because it has a status of succeeded."
|
||||
);
|
||||
}
|
||||
|
||||
// Captures a payment using invalid connector payment id.
|
||||
#[actix_web::test]
|
||||
async fn should_fail_capture_for_invalid_payment() {
|
||||
let capture_response = CONNECTOR
|
||||
.capture_payment("123456789".to_string(), None, get_default_payment_info())
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
capture_response.response.unwrap_err().message,
|
||||
String::from("No such payment_intent: '123456789'")
|
||||
);
|
||||
}
|
||||
|
||||
// Refunds a payment with refund amount higher than payment amount.
|
||||
#[actix_web::test]
|
||||
async fn should_fail_for_refund_amount_higher_than_payment_amount() {
|
||||
let response = CONNECTOR
|
||||
.make_payment_and_refund(
|
||||
payment_method_details(),
|
||||
Some(types::RefundsData {
|
||||
refund_amount: 150,
|
||||
..utils::PaymentRefundType::default().0
|
||||
}),
|
||||
get_default_payment_info(),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
response.response.unwrap_err().message,
|
||||
"Refund amount (₹1.50) is greater than charge amount (₹1.00)",
|
||||
);
|
||||
}
|
||||
|
||||
// Connector dependent test cases goes here
|
||||
|
||||
// [#478]: add unit tests for non 3DS, wallets & webhooks in connector tests
|
||||
@ -23,6 +23,7 @@ mod bitpay;
|
||||
mod bluesnap;
|
||||
mod boku;
|
||||
mod cashtocode;
|
||||
mod celero;
|
||||
mod chargebee;
|
||||
mod checkbook;
|
||||
mod checkout;
|
||||
|
||||
@ -29,6 +29,7 @@ pub struct ConnectorAuthentication {
|
||||
pub bluesnap: Option<BodyKey>,
|
||||
pub boku: Option<BodyKey>,
|
||||
pub cashtocode: Option<BodyKey>,
|
||||
pub celero: Option<HeaderKey>,
|
||||
pub chargebee: Option<HeaderKey>,
|
||||
pub checkbook: Option<BodyKey>,
|
||||
pub checkout: Option<SignatureKey>,
|
||||
|
||||
Reference in New Issue
Block a user