pub struct PostgresPaymentMethodRepository { /* private fields */ }Expand description
PostgreSQL implementation of PaymentMethodRepository
Implementations§
Trait Implementations§
Source§impl PaymentMethodRepository for PostgresPaymentMethodRepository
impl PaymentMethodRepository for PostgresPaymentMethodRepository
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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)
Auto Trait Implementations§
impl Freeze for PostgresPaymentMethodRepository
impl !RefUnwindSafe for PostgresPaymentMethodRepository
impl Send for PostgresPaymentMethodRepository
impl Sync for PostgresPaymentMethodRepository
impl Unpin for PostgresPaymentMethodRepository
impl !UnwindSafe for PostgresPaymentMethodRepository
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Chain<T> for T
impl<T> Chain<T> for T
§impl<T> Fake for T
impl<T> Fake for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.