pub trait SubscriptionHandler:
Send
+ Sync
+ 'static {
// Required methods
fn on_subscription_created<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 SubscriptionEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn on_subscription_updated<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 SubscriptionEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn on_subscription_deleted<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 SubscriptionEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn on_payment_succeeded<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 InvoiceEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn on_payment_failed<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 InvoiceEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn on_customer_created<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 CustomerEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Handler trait for subscription events
Required Methods§
Sourcefn on_subscription_created<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 SubscriptionEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_subscription_created<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 SubscriptionEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Handle new subscription created
Sourcefn on_subscription_updated<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 SubscriptionEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_subscription_updated<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 SubscriptionEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Handle subscription updated (plan change, status change, etc.)
Sourcefn on_subscription_deleted<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 SubscriptionEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_subscription_deleted<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 SubscriptionEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Handle subscription deleted/canceled
Sourcefn on_payment_succeeded<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 InvoiceEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_payment_succeeded<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 InvoiceEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Handle invoice payment succeeded
Sourcefn on_payment_failed<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 InvoiceEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_payment_failed<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 InvoiceEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Handle invoice payment failed
Sourcefn on_customer_created<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 CustomerEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_customer_created<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 CustomerEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Handle new customer created