Public Functions
initialize
Initializes contract state. Can only be invoked once.
admin: Account authorized to update fee configs and protocol settings.fee_recipient: Account that collects basis point protocol fees.fee_bps: Protocol fee in basis points (max1,000= 10%).
settle_payment
Executes an atomic transfer from payer to merchant, deducting the protocol fee.
- Reverts with
Error::InvalidNonceifnonce != current_nonce + 1. - Reverts with
Error::ExpiredSignatureifenv.ledger().timestamp() > valid_until. - Invokes
token::Client::new(&env, &token).transfer(...)atomically. - Emits
SettlementReceiptevent. - Returns the net amount transferred to the merchant (
i128).
verify_and_split
Splits a payment across multiple recipients according to basis points.
- Enforces that the sum of recipient basis points plus protocol fee equals
10,000(100%). - Atomically transfers each recipient’s share.