mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 09:07:09 +08:00
feat(payment_charges): add support for collecting and refunding charges on payments (#4628)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Narayan Bhat <48803246+Narayanbhat166@users.noreply.github.com> Co-authored-by: Shankar Singh C <83439957+ShankarSinghC@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: YongJoon Kim <penubokim@gmail.com> Co-authored-by: Sanchith Hegde <22217505+SanchithHegde@users.noreply.github.com> Co-authored-by: chikke srujan <121822803+srujanchikke@users.noreply.github.com> Co-authored-by: Hrithikesh <61539176+hrithikesh026@users.noreply.github.com> Co-authored-by: Chethan Rao <70657455+Chethan-rao@users.noreply.github.com> Co-authored-by: Sampras Lopes <Sampras.lopes@juspay.in>
This commit is contained in:
@ -600,6 +600,50 @@ pub fn convert_authentication_connector(connector_name: &str) -> Option<Authenti
|
||||
AuthenticationConnectors::from_str(connector_name).ok()
|
||||
}
|
||||
|
||||
#[derive(
|
||||
Clone,
|
||||
Debug,
|
||||
Eq,
|
||||
PartialEq,
|
||||
serde::Deserialize,
|
||||
serde::Serialize,
|
||||
strum::Display,
|
||||
strum::EnumString,
|
||||
ToSchema,
|
||||
Hash,
|
||||
)]
|
||||
pub enum PaymentChargeType {
|
||||
#[serde(untagged)]
|
||||
Stripe(StripeChargeType),
|
||||
}
|
||||
|
||||
impl Default for PaymentChargeType {
|
||||
fn default() -> Self {
|
||||
Self::Stripe(StripeChargeType::default())
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(
|
||||
Clone,
|
||||
Debug,
|
||||
Default,
|
||||
Hash,
|
||||
Eq,
|
||||
PartialEq,
|
||||
ToSchema,
|
||||
serde::Serialize,
|
||||
serde::Deserialize,
|
||||
strum::Display,
|
||||
strum::EnumString,
|
||||
)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
#[strum(serialize_all = "lowercase")]
|
||||
pub enum StripeChargeType {
|
||||
#[default]
|
||||
Direct,
|
||||
Destination,
|
||||
}
|
||||
|
||||
#[cfg(feature = "frm")]
|
||||
pub fn convert_frm_connector(connector_name: &str) -> Option<FrmConnectors> {
|
||||
FrmConnectors::from_str(connector_name).ok()
|
||||
|
||||
Reference in New Issue
Block a user