mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 01:57:45 +08:00 
			
		
		
		
	feat(router): add open router integration for debit routing (#7907)
Co-authored-by: Sayak Bhattacharya <sayak.b@Sayak-Bhattacharya-G092THXJ34.local> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
		| @ -2310,6 +2310,130 @@ pub enum CardNetwork { | ||||
|     RuPay, | ||||
|     #[serde(alias = "MAESTRO")] | ||||
|     Maestro, | ||||
|     #[serde(alias = "STAR")] | ||||
|     Star, | ||||
|     #[serde(alias = "PULSE")] | ||||
|     Pulse, | ||||
|     #[serde(alias = "ACCEL")] | ||||
|     Accel, | ||||
|     #[serde(alias = "NYCE")] | ||||
|     Nyce, | ||||
| } | ||||
|  | ||||
| #[derive( | ||||
|     Clone, | ||||
|     Debug, | ||||
|     Eq, | ||||
|     Hash, | ||||
|     PartialEq, | ||||
|     serde::Deserialize, | ||||
|     serde::Serialize, | ||||
|     strum::Display, | ||||
|     strum::EnumIter, | ||||
|     strum::EnumString, | ||||
|     utoipa::ToSchema, | ||||
| )] | ||||
| #[router_derive::diesel_enum(storage_type = "db_enum")] | ||||
| #[serde(rename_all = "snake_case")] | ||||
| pub enum RegulatedName { | ||||
|     #[serde(rename = "GOVERNMENT NON-EXEMPT INTERCHANGE FEE (WITH FRAUD)")] | ||||
|     #[strum(serialize = "GOVERNMENT NON-EXEMPT INTERCHANGE FEE (WITH FRAUD)")] | ||||
|     NonExemptWithFraud, | ||||
|  | ||||
|     #[serde(untagged)] | ||||
|     #[strum(default)] | ||||
|     Unknown(String), | ||||
| } | ||||
|  | ||||
| #[derive( | ||||
|     Clone, | ||||
|     Debug, | ||||
|     Eq, | ||||
|     Hash, | ||||
|     PartialEq, | ||||
|     serde::Deserialize, | ||||
|     serde::Serialize, | ||||
|     strum::Display, | ||||
|     strum::EnumIter, | ||||
|     strum::EnumString, | ||||
|     utoipa::ToSchema, | ||||
|     Copy, | ||||
| )] | ||||
| #[router_derive::diesel_enum(storage_type = "db_enum")] | ||||
| #[serde(rename_all = "snake_case")] | ||||
| #[strum(serialize_all = "lowercase")] | ||||
| pub enum PanOrToken { | ||||
|     Pan, | ||||
|     Token, | ||||
| } | ||||
|  | ||||
| #[derive( | ||||
|     Clone, | ||||
|     Debug, | ||||
|     Eq, | ||||
|     Hash, | ||||
|     PartialEq, | ||||
|     serde::Deserialize, | ||||
|     serde::Serialize, | ||||
|     strum::Display, | ||||
|     strum::EnumIter, | ||||
|     strum::EnumString, | ||||
|     utoipa::ToSchema, | ||||
|     Copy, | ||||
| )] | ||||
| #[router_derive::diesel_enum(storage_type = "db_enum")] | ||||
| #[strum(serialize_all = "UPPERCASE")] | ||||
| #[serde(rename_all = "snake_case")] | ||||
| pub enum CardType { | ||||
|     Credit, | ||||
|     Debit, | ||||
| } | ||||
|  | ||||
| #[derive(Debug, Clone, Serialize, Deserialize, strum::EnumString, strum::Display)] | ||||
| #[serde(rename_all = "snake_case")] | ||||
| pub enum MerchantCategoryCode { | ||||
|     #[serde(rename = "merchant_category_code_0001")] | ||||
|     Mcc0001, | ||||
| } | ||||
|  | ||||
| impl CardNetwork { | ||||
|     pub fn is_global_network(&self) -> bool { | ||||
|         match self { | ||||
|             Self::Interac | ||||
|             | Self::Star | ||||
|             | Self::Pulse | ||||
|             | Self::Accel | ||||
|             | Self::Nyce | ||||
|             | Self::CartesBancaires => false, | ||||
|  | ||||
|             Self::Visa | ||||
|             | Self::Mastercard | ||||
|             | Self::AmericanExpress | ||||
|             | Self::JCB | ||||
|             | Self::DinersClub | ||||
|             | Self::Discover | ||||
|             | Self::UnionPay | ||||
|             | Self::RuPay | ||||
|             | Self::Maestro => true, | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     pub fn is_us_local_network(&self) -> bool { | ||||
|         match self { | ||||
|             Self::Star | Self::Pulse | Self::Accel | Self::Nyce => true, | ||||
|             Self::Interac | ||||
|             | Self::CartesBancaires | ||||
|             | Self::Visa | ||||
|             | Self::Mastercard | ||||
|             | Self::AmericanExpress | ||||
|             | Self::JCB | ||||
|             | Self::DinersClub | ||||
|             | Self::Discover | ||||
|             | Self::UnionPay | ||||
|             | Self::RuPay | ||||
|             | Self::Maestro => false, | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| /// Stage of the dispute | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Shankar Singh C
					Shankar Singh C