pub struct SqliteX402PaymentIntentRepository { /* private fields */ }Available on crate feature
sqlite only.Expand description
SQLite implementation of X402PaymentIntentRepository
Implementations§
Source§impl SqliteX402PaymentIntentRepository
impl SqliteX402PaymentIntentRepository
pub const fn new(pool: Pool<SqliteConnectionManager>) -> Self
Trait Implementations§
Source§impl X402PaymentIntentRepository for SqliteX402PaymentIntentRepository
impl X402PaymentIntentRepository for SqliteX402PaymentIntentRepository
Source§fn create(&self, input: CreateX402PaymentIntent) -> Result<X402PaymentIntent>
fn create(&self, input: CreateX402PaymentIntent) -> Result<X402PaymentIntent>
Create a new x402 payment intent
Source§fn get_by_idempotency_key(&self, key: &str) -> Result<Option<X402PaymentIntent>>
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>
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>
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>
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>
fn mark_failed(&self, id: Uuid, reason: &str) -> Result<X402PaymentIntent>
Mark intent as failed
Source§fn mark_expired(&self, id: Uuid) -> Result<X402PaymentIntent>
fn mark_expired(&self, id: Uuid) -> Result<X402PaymentIntent>
Mark intent as expired
Source§fn cancel(&self, id: Uuid) -> Result<X402PaymentIntent>
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>>
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>>
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>
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>>
fn list( &self, filter: X402PaymentIntentFilter, ) -> Result<Vec<X402PaymentIntent>>
List payment intents with filter
Source§fn count(&self, filter: X402PaymentIntentFilter) -> Result<u64>
fn count(&self, filter: X402PaymentIntentFilter) -> Result<u64>
Count payment intents matching filter
Source§fn expire_stale_intents(&self) -> Result<u64>
fn expire_stale_intents(&self) -> Result<u64>
Expire all intents that have passed their
valid_until timestampSource§fn create_batch(
&self,
inputs: Vec<CreateX402PaymentIntent>,
) -> Result<BatchResult<X402PaymentIntent>>
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>>
fn create_batch_atomic( &self, inputs: Vec<CreateX402PaymentIntent>, ) -> Result<Vec<X402PaymentIntent>>
Create multiple payment intents - atomic (all-or-nothing)
Auto Trait Implementations§
impl !RefUnwindSafe for SqliteX402PaymentIntentRepository
impl !UnwindSafe for SqliteX402PaymentIntentRepository
impl Freeze for SqliteX402PaymentIntentRepository
impl Send for SqliteX402PaymentIntentRepository
impl Sync for SqliteX402PaymentIntentRepository
impl Unpin for SqliteX402PaymentIntentRepository
impl UnsafeUnpin for SqliteX402PaymentIntentRepository
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