Skip to main content

SqliteX402PaymentIntentRepository

Struct SqliteX402PaymentIntentRepository 

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

SQLite implementation of X402PaymentIntentRepository

Implementations§

Trait Implementations§

Source§

impl Debug for SqliteX402PaymentIntentRepository

Source§

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

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

impl X402PaymentIntentRepository for SqliteX402PaymentIntentRepository

Source§

fn create(&self, input: CreateX402PaymentIntent) -> Result<X402PaymentIntent>

Create a new x402 payment intent
Source§

fn get(&self, id: Uuid) -> Result<Option<X402PaymentIntent>>

Get payment intent by ID
Source§

fn get_by_idempotency_key(&self, key: &str) -> Result<Option<X402PaymentIntent>>

Get payment intent by idempotency key
Source§

fn sign( &self, id: Uuid, input: SignX402PaymentIntent, ) -> Result<X402PaymentIntent>

Sign a payment intent (records signature and public key)
Source§

fn mark_sequenced( &self, id: Uuid, sequence_number: u64, batch_id: Uuid, ) -> Result<X402PaymentIntent>

Mark intent as sequenced (submitted to sequencer)
Source§

fn mark_settled( &self, id: Uuid, tx_hash: &str, block_number: u64, ) -> Result<X402PaymentIntent>

Mark intent as settled (confirmed on-chain)
Source§

fn mark_failed(&self, id: Uuid, reason: &str) -> Result<X402PaymentIntent>

Mark intent as failed
Source§

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

Mark intent as expired
Source§

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

Cancel a payment intent (only if not yet sequenced)
Source§

fn for_cart(&self, cart_id: Uuid) -> Result<Vec<X402PaymentIntent>>

Get payment intents for a cart
Source§

fn for_order(&self, order_id: Uuid) -> Result<Vec<X402PaymentIntent>>

Get payment intents for an order
Source§

fn get_next_nonce(&self, payer_address: &str) -> Result<u64>

Get the next nonce for a payer address
Source§

fn list( &self, filter: X402PaymentIntentFilter, ) -> Result<Vec<X402PaymentIntent>>

List payment intents with filter
Source§

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

Count payment intents matching filter
Source§

fn expire_stale_intents(&self) -> Result<u64>

Expire all intents that have passed their valid_until timestamp
Source§

fn create_batch( &self, inputs: Vec<CreateX402PaymentIntent>, ) -> Result<BatchResult<X402PaymentIntent>>

Create multiple payment intents - partial success allowed
Source§

fn create_batch_atomic( &self, inputs: Vec<CreateX402PaymentIntent>, ) -> Result<Vec<X402PaymentIntent>>

Create multiple payment intents - atomic (all-or-nothing)
Source§

fn get_batch(&self, ids: Vec<Uuid>) -> Result<Vec<X402PaymentIntent>>

Get multiple payment intents 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