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§
Sourcefn 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 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
Sourcefn 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_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
Sourcefn 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_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
Sourcefn 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_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
Sourcefn 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_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
Sourcefn 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_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
Sourcefn 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_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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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)
Sourcefn 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 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)