pub struct Payment {Show 26 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 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: PaymentCreatedIndexUnique payment identifier, ordered by created_at.
This implements Ord and is generally the thing you want to key your
payments by, e.g. BTreeMap<PaymentCreatedIndex, Payment>.
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.
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.