Skip to main content

SqlitePaymentRepository

Struct SqlitePaymentRepository 

Source
pub struct SqlitePaymentRepository { /* private fields */ }
Available on crate feature sqlite only.

Implementations§

Trait Implementations§

Source§

impl Debug for SqlitePaymentRepository

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PaymentRepository for SqlitePaymentRepository

Source§

fn create(&self, input: CreatePayment) -> Result<Payment>

Create a new payment
Source§

fn get(&self, id: PaymentId) -> Result<Option<Payment>>

Get payment by ID
Source§

fn get_by_number(&self, payment_number: &str) -> Result<Option<Payment>>

Get payment by payment number
Source§

fn get_by_external_id(&self, external_id: &str) -> Result<Option<Payment>>

Get payment by external ID (e.g., Stripe payment intent)
Source§

fn update(&self, id: PaymentId, input: UpdatePayment) -> Result<Payment>

Update a payment
Source§

fn list(&self, filter: PaymentFilter) -> Result<Vec<Payment>>

List payments with filter
Source§

fn for_order(&self, order_id: OrderId) -> Result<Vec<Payment>>

Get payments for an order
Source§

fn for_invoice(&self, invoice_id: InvoiceId) -> Result<Vec<Payment>>

Get payments for an invoice
Source§

fn mark_processing(&self, id: PaymentId) -> Result<Payment>

Mark payment as processing
Source§

fn mark_completed(&self, id: PaymentId) -> Result<Payment>

Mark payment as completed (paid)
Source§

fn mark_failed( &self, id: PaymentId, reason: &str, code: Option<&str>, ) -> Result<Payment>

Mark payment as failed
Source§

fn cancel(&self, id: PaymentId) -> Result<Payment>

Cancel payment
Source§

fn create_refund(&self, input: CreateRefund) -> Result<Refund>

Create a refund for a payment
Source§

fn get_refund(&self, id: Uuid) -> Result<Option<Refund>>

Get refund by ID
Source§

fn get_refunds(&self, payment_id: PaymentId) -> Result<Vec<Refund>>

Get refunds for a payment
Source§

fn complete_refund(&self, id: Uuid) -> Result<Refund>

Process refund (mark as completed)
Source§

fn fail_refund(&self, id: Uuid, reason: &str) -> Result<Refund>

Fail refund
Source§

fn create_payment_method( &self, input: CreatePaymentMethod, ) -> Result<PaymentMethod>

Create a payment method for a customer
Source§

fn get_payment_methods( &self, customer_id: CustomerId, ) -> Result<Vec<PaymentMethod>>

Get payment methods for a customer
Source§

fn delete_payment_method(&self, id: Uuid) -> Result<()>

Delete a payment method
Source§

fn set_default_payment_method( &self, customer_id: CustomerId, method_id: Uuid, ) -> Result<()>

Set default payment method
Source§

fn count(&self, filter: PaymentFilter) -> Result<u64>

Count payments matching filter
Source§

fn create_batch( &self, inputs: Vec<CreatePayment>, ) -> Result<BatchResult<Payment>>

Create multiple payments - partial success allowed
Source§

fn create_batch_atomic( &self, inputs: Vec<CreatePayment>, ) -> Result<Vec<Payment>>

Create multiple payments - atomic (all-or-nothing)
Source§

fn update_batch( &self, updates: Vec<(PaymentId, UpdatePayment)>, ) -> Result<BatchResult<Payment>>

Update multiple payments - partial success allowed
Source§

fn update_batch_atomic( &self, updates: Vec<(PaymentId, UpdatePayment)>, ) -> Result<Vec<Payment>>

Update multiple payments - atomic (all-or-nothing)
Source§

fn delete_batch(&self, ids: Vec<PaymentId>) -> Result<BatchResult<Uuid>>

Delete multiple payments - partial success allowed
Source§

fn delete_batch_atomic(&self, ids: Vec<PaymentId>) -> Result<()>

Delete multiple payments - atomic (all-or-nothing)
Source§

fn get_batch(&self, ids: Vec<PaymentId>) -> Result<Vec<Payment>>

Get multiple payments by ID

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more