SubscriptionHandler

Trait SubscriptionHandler 

Source
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§

Source

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

Source

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.)

Source

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

Source

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

Source

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

Source

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

Implementors§