mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 00:49:42 +08:00
feat(subscriptions): add route for creating subscription intent (#9123)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -85,6 +85,7 @@ pub enum ApiEventsType {
|
||||
payment_id: Option<id_type::GlobalPaymentId>,
|
||||
},
|
||||
Routing,
|
||||
Subscription,
|
||||
ResourceListAPI,
|
||||
#[cfg(feature = "v1")]
|
||||
PaymentRedirectionResponse {
|
||||
|
||||
@ -17,6 +17,7 @@ mod profile_acquirer;
|
||||
mod refunds;
|
||||
mod relay;
|
||||
mod routing;
|
||||
mod subscription;
|
||||
mod tenant;
|
||||
|
||||
use std::{borrow::Cow, fmt::Debug};
|
||||
@ -55,6 +56,7 @@ pub use self::{
|
||||
refunds::RefundReferenceId,
|
||||
relay::RelayId,
|
||||
routing::RoutingId,
|
||||
subscription::SubscriptionId,
|
||||
tenant::TenantId,
|
||||
};
|
||||
use crate::{fp_utils::when, generate_id_with_default_len};
|
||||
|
||||
21
crates/common_utils/src/id_type/subscription.rs
Normal file
21
crates/common_utils/src/id_type/subscription.rs
Normal file
@ -0,0 +1,21 @@
|
||||
crate::id_type!(
|
||||
SubscriptionId,
|
||||
" A type for subscription_id that can be used for subscription ids"
|
||||
);
|
||||
|
||||
crate::impl_id_type_methods!(SubscriptionId, "subscription_id");
|
||||
|
||||
// This is to display the `SubscriptionId` as SubscriptionId(subs)
|
||||
crate::impl_debug_id_type!(SubscriptionId);
|
||||
crate::impl_try_from_cow_str_id_type!(SubscriptionId, "subscription_id");
|
||||
|
||||
crate::impl_generate_id_id_type!(SubscriptionId, "subscription");
|
||||
crate::impl_serializable_secret_id_type!(SubscriptionId);
|
||||
crate::impl_queryable_id_type!(SubscriptionId);
|
||||
crate::impl_to_sql_from_sql_id_type!(SubscriptionId);
|
||||
|
||||
impl crate::events::ApiEventMetric for SubscriptionId {
|
||||
fn get_api_event_type(&self) -> Option<crate::events::ApiEventsType> {
|
||||
Some(crate::events::ApiEventsType::Subscription)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user