PaymentMethodRepository

Trait PaymentMethodRepository 

Source
pub trait PaymentMethodRepository: Send + Sync {
Show 13 methods // Required methods fn create<'life0, 'life1, 'async_trait>( &'life0 self, payment_method: &'life1 PaymentMethod, ) -> Pin<Box<dyn Future<Output = Result<PaymentMethod, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn find_by_id<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<PaymentMethod>, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn find_by_stripe_payment_method_id<'life0, 'life1, 'async_trait>( &'life0 self, stripe_payment_method_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<PaymentMethod>, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn find_by_owner<'life0, 'async_trait>( &'life0 self, owner_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentMethod>, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn find_active_by_owner<'life0, 'async_trait>( &'life0 self, owner_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentMethod>, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn find_default_by_owner<'life0, 'async_trait>( &'life0 self, owner_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<PaymentMethod>, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn find_by_organization<'life0, 'async_trait>( &'life0 self, organization_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentMethod>, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn find_by_owner_and_type<'life0, 'async_trait>( &'life0 self, owner_id: Uuid, method_type: PaymentMethodType, ) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentMethod>, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn update<'life0, 'life1, 'async_trait>( &'life0 self, payment_method: &'life1 PaymentMethod, ) -> Pin<Box<dyn Future<Output = Result<PaymentMethod, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn delete<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn set_as_default<'life0, 'async_trait>( &'life0 self, id: Uuid, owner_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<PaymentMethod, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn count_active_by_owner<'life0, 'async_trait>( &'life0 self, owner_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn has_active_payment_methods<'life0, 'async_trait>( &'life0 self, owner_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait;
}

Required Methods§

Source

fn create<'life0, 'life1, 'async_trait>( &'life0 self, payment_method: &'life1 PaymentMethod, ) -> Pin<Box<dyn Future<Output = Result<PaymentMethod, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create a new payment method

Source

fn find_by_id<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<PaymentMethod>, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Find payment method by ID

Source

fn find_by_stripe_payment_method_id<'life0, 'life1, 'async_trait>( &'life0 self, stripe_payment_method_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<PaymentMethod>, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Find payment method by Stripe payment method ID

Source

fn find_by_owner<'life0, 'async_trait>( &'life0 self, owner_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentMethod>, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Find all payment methods for an owner

Source

fn find_active_by_owner<'life0, 'async_trait>( &'life0 self, owner_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentMethod>, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Find active payment methods for an owner

Source

fn find_default_by_owner<'life0, 'async_trait>( &'life0 self, owner_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<PaymentMethod>, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Find default payment method for an owner

Source

fn find_by_organization<'life0, 'async_trait>( &'life0 self, organization_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentMethod>, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Find all payment methods for an organization

Source

fn find_by_owner_and_type<'life0, 'async_trait>( &'life0 self, owner_id: Uuid, method_type: PaymentMethodType, ) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentMethod>, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Find payment methods by type

Source

fn update<'life0, 'life1, 'async_trait>( &'life0 self, payment_method: &'life1 PaymentMethod, ) -> Pin<Box<dyn Future<Output = Result<PaymentMethod, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Update payment method

Source

fn delete<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Delete payment method (soft delete recommended)

Source

fn set_as_default<'life0, 'async_trait>( &'life0 self, id: Uuid, owner_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<PaymentMethod, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Set payment method as default (unsets other defaults for owner)

Source

fn count_active_by_owner<'life0, 'async_trait>( &'life0 self, owner_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Count active payment methods for owner

Source

fn has_active_payment_methods<'life0, 'async_trait>( &'life0 self, owner_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Check if owner has any active payment methods

Implementors§