mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 01:57:45 +08:00 
			
		
		
		
	feat(connector): Add support for chargebee recovery webhooks (#7110)
Co-authored-by: Chikke Srujan <chikke.srujan@Chikke-Srujan-N7WRTY72X7.local> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
		| @ -14,6 +14,7 @@ use diesel_models::configs; | ||||
| #[cfg(all(any(feature = "v1", feature = "v2"), feature = "olap"))] | ||||
| use diesel_models::{business_profile::CardTestingGuardConfig, organization::OrganizationBridge}; | ||||
| use error_stack::{report, FutureExt, ResultExt}; | ||||
| use hyperswitch_connectors::connectors::chargebee; | ||||
| use hyperswitch_domain_models::merchant_connector_account::{ | ||||
|     FromRequestEncryptableMerchantConnectorAccount, UpdateEncryptableMerchantConnectorAccount, | ||||
| }; | ||||
| @ -1310,6 +1311,10 @@ impl ConnectorAuthTypeAndMetadataValidation<'_> { | ||||
|                 cashtocode::transformers::CashtocodeAuthType::try_from(self.auth_type)?; | ||||
|                 Ok(()) | ||||
|             } | ||||
|             api_enums::Connector::Chargebee => { | ||||
|                 chargebee::transformers::ChargebeeAuthType::try_from(self.auth_type)?; | ||||
|                 Ok(()) | ||||
|             } | ||||
|             api_enums::Connector::Checkout => { | ||||
|                 checkout::transformers::CheckoutAuthType::try_from(self.auth_type)?; | ||||
|                 Ok(()) | ||||
| @ -1844,6 +1849,8 @@ impl ConnectorTypeAndConnectorName<'_> { | ||||
|             api_enums::convert_authentication_connector(self.connector_name.to_string().as_str()); | ||||
|         let tax_connector = | ||||
|             api_enums::convert_tax_connector(self.connector_name.to_string().as_str()); | ||||
|         let billing_connector = | ||||
|             api_enums::convert_billing_connector(self.connector_name.to_string().as_str()); | ||||
|  | ||||
|         if pm_auth_connector.is_some() { | ||||
|             if self.connector_type != &api_enums::ConnectorType::PaymentMethodAuth | ||||
| @ -1868,6 +1875,13 @@ impl ConnectorTypeAndConnectorName<'_> { | ||||
|                 } | ||||
|                 .into()); | ||||
|             } | ||||
|         } else if billing_connector.is_some() { | ||||
|             if self.connector_type != &api_enums::ConnectorType::BillingProcessor { | ||||
|                 return Err(errors::ApiErrorResponse::InvalidRequestData { | ||||
|                     message: "Invalid connector type given".to_string(), | ||||
|                 } | ||||
|                 .into()); | ||||
|             } | ||||
|         } else { | ||||
|             let routable_connector_option = self | ||||
|                 .connector_name | ||||
|  | ||||
| @ -359,9 +359,11 @@ impl ConnectorData { | ||||
|                     Ok(ConnectorEnum::Old(Box::new(connector::Braintree::new()))) | ||||
|                 } | ||||
|                 enums::Connector::Cashtocode => { | ||||
|                     // enums::Connector::Chargebee => Ok(ConnectorEnum::Old(Box::new(connector::Chargebee))), | ||||
|                     Ok(ConnectorEnum::Old(Box::new(connector::Cashtocode::new()))) | ||||
|                 } | ||||
|                 enums::Connector::Chargebee => { | ||||
|                     Ok(ConnectorEnum::Old(Box::new(connector::Chargebee::new()))) | ||||
|                 } | ||||
|                 enums::Connector::Checkout => { | ||||
|                     Ok(ConnectorEnum::Old(Box::new(connector::Checkout::new()))) | ||||
|                 } | ||||
|  | ||||
| @ -225,7 +225,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::Chargebee => Self::Chargebee, | ||||
|             api_enums::Connector::Chargebee => Self::Chargebee, | ||||
|             api_enums::Connector::Checkout => Self::Checkout, | ||||
|             api_enums::Connector::Coinbase => Self::Coinbase, | ||||
|             api_enums::Connector::Coingate => Self::Coingate, | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 chikke srujan
					chikke srujan