Concepts
Payments
On-chain payment records and atomic settlement states (Pending vs Settled).
A Payment represents an intent to distribute a specific amount of a Stellar asset to a target pool.
Payment Lifecycle & Statuses
Payments transition through two statuses governed by PaymentStatus:
- Pending (1): Created via
create_payment. The record exists on-chain awaiting settlement. - Settled (2): Finalized via
settle_payment. Assets have been transferred and distributions permanently recorded.
On-Chain Payment Data Structure
rustcontracts/splitpay/src/types.rs
#[contracttype]#[derive(Clone, Debug, Eq, PartialEq)]pub struct Payment { pub id: u64, pub pool_id: u64, pub payer: Address, pub asset: Address, pub amount: i128, pub status: PaymentStatus, pub created_at: u64,}Historical Immutability Guarantee
Settled Payments are Final
A payment marked
Settled cannot be settled a second time (Error::PaymentAlreadySettled). Its historical distribution records cannot be overwritten, modified, or deleted.