pub struct Payment {Show 27 fields
pub index: PaymentCreatedIndex,
pub rail: PaymentRail,
pub kind: PaymentKind,
pub direction: PaymentDirection,
pub hash: Option<PaymentHash>,
pub preimage: Option<PaymentPreimage>,
pub offer_id: Option<OfferId>,
pub txid: Option<Txid>,
pub amount: Option<Amount>,
pub fees: Amount,
pub partner_pk: Option<UserPk>,
pub partner_prop_fee: Option<Ppm>,
pub partner_base_fee: Option<Amount>,
pub status: PaymentStatus,
pub status_msg: String,
pub address: Option<Arc<Address<NetworkUnchecked>>>,
pub invoice: Option<Arc<Invoice>>,
pub tx: Option<Arc<Transaction>>,
pub client_pk: Option<PublicKey>,
pub payer_name: Option<String>,
pub message: Option<String>,
pub personal_note: Option<String>,
pub priority: Option<ConfirmationPriority>,
pub expires_at: Option<TimestampMs>,
pub finalized_at: Option<TimestampMs>,
pub created_at: TimestampMs,
pub updated_at: TimestampMs,
}Expand description
Information about a payment.
Fields§
§index: PaymentCreatedIndexThe payment’s index: its id prefixed with created_at.
Prefer to use this as the primary identifier for the payment, as you
can degenerate it into a String while retaining timestamp-based
lexicographic sorting for free. e.g. use BTreeMap<String, Payment> or
BTreeMap<PaymentCreatedIndex, Payment>.
See PaymentCreatedIndex for more details.
rail: PaymentRailThe technical ‘rail’ used to fulfill a payment: ‘onchain’, ‘invoice’, ‘offer’, ‘spontaneous’, ‘waived_fee’, etc.
kind: PaymentKindApplication-level payment kind.
direction: PaymentDirectionThe payment direction: "inbound", "outbound", or "info".
hash: Option<PaymentHash>(Lightning payments only) The payment hash.
preimage: Option<PaymentPreimage>(Lightning payments only) The payment preimage. Serves as proof-of-payment for outbound payments. For inbound payments, only populated if the payment succeeded.
offer_id: Option<OfferId>(Offer payments only) The id of the BOLT12 offer used in this payment.
txid: Option<Txid>(Onchain payments only) The hex-encoded Bitcoin txid.
amount: Option<Amount>The amount of this payment.
- If this is a completed inbound invoice payment, this is the amount we received.
- If this is a pending or failed inbound inbound invoice payment, this is the amount encoded in our invoice, which may be null.
- For all other payment types, an amount is always included.
fees: AmountThe fees for this payment.
- If
partner_pkis set, this means that the partner, not Lexe, determined the fee for this payment.
partner_pk: Option<UserPk>The partner’s user_pk, if the fees for this payment were set by a Lexe partner, instead of using Lexe’s default fees.
partner_prop_fee: Option<Ppm>The proportional fee set by the partner.
partner_base_fee: Option<Amount>The base fee set by the partner.
status: PaymentStatusThe status of this payment: [“pending”, “completed”, “failed”].
status_msg: StringThe payment status as a human-readable message. These strings are customized per payment type, e.g. “invoice generated”, “timed out”
address: Option<Arc<Address<NetworkUnchecked>>>(Onchain send only) The address that we’re sending to.
invoice: Option<Arc<Invoice>>(Invoice payments only) The BOLT 11 invoice used in this payment.
tx: Option<Arc<Transaction>>The on-chain transaction, if there is one.
Always Some for on-chain sends and receives.
client_pk: Option<PublicKey>The public key of the Lexe SDK client which created this payment.
(Inbound offer payments aren’t tracked yet.) None means either root
seed authentication was used, or the client was never recorded.
payer_name: Option<String>(Offer payments only) The payer’s self-reported human-readable name.
message: Option<String>(Offer payments, LNURL-pay invoices) A payer-provided note for this payment.
personal_note: Option<String>An optional personal note which a user can attach to any payment. A personal note can always be added or modified when a payment already exists, but this may not always be possible at creation time.
priority: Option<ConfirmationPriority>(Onchain send only) The confirmation priority used for this payment.
expires_at: Option<TimestampMs>The invoice or offer expiry time.
None otherwise, or if the timestamp overflows.
finalized_at: Option<TimestampMs>If this payment is finalized, meaning it is “completed” or “failed”, this is the time it was finalized, in milliseconds since the UNIX epoch.
created_at: TimestampMsWhen this payment was created.
updated_at: TimestampMsWhen this payment was last updated.
Implementations§
Source§impl Payment
impl Payment
Sourcepub fn updated_index(&self) -> PaymentUpdatedIndex
pub fn updated_index(&self) -> PaymentUpdatedIndex
This payment’s updated_at index.