pub struct Payment {Show 13 fields
pub asset: Option<AssetId>,
pub amount: String,
pub currency_code: Option<String>,
pub supported_assets: Option<Vec<AssetId>>,
pub customer: Option<Party>,
pub merchant: Party,
pub transaction_id: String,
pub memo: Option<String>,
pub expiry: Option<String>,
pub invoice: Option<Invoice>,
pub agents: Vec<Agent>,
pub connection_id: Option<String>,
pub metadata: HashMap<String, Value>,
}Expand description
Payment message body (TAIP-14).
A Payment is a DIDComm message initiated by the merchant’s agent and sent to the customer’s agent to request a blockchain payment. It must include either an asset or a currency to denominate the payment, along with the amount and recipient information.
Fields§
§asset: Option<AssetId>Asset identifier (CAIP-19 format).
amount: StringPayment amount.
currency_code: Option<String>Currency code for fiat amounts (e.g., USD).
supported_assets: Option<Vec<AssetId>>Supported assets for this payment (when currency_code is specified)
customer: Option<Party>Customer (payer) details.
merchant: PartyMerchant (payee) details.
transaction_id: StringTransaction identifier.
memo: Option<String>Memo for the payment (optional).
expiry: Option<String>Expiration time in ISO 8601 format (optional).
invoice: Option<Invoice>Invoice details (optional) per TAIP-16
agents: Vec<Agent>Other agents involved in the payment.
connection_id: Option<String>Connection ID for linking to Connect messages
metadata: HashMap<String, Value>Additional metadata (optional).
Implementations§
Source§impl Payment
impl Payment
Sourcepub fn with_asset(
asset: AssetId,
amount: String,
merchant: Party,
agents: Vec<Agent>,
) -> Self
pub fn with_asset( asset: AssetId, amount: String, merchant: Party, agents: Vec<Agent>, ) -> Self
Creates a new Payment with an asset
Sourcepub fn with_currency(
currency_code: String,
amount: String,
merchant: Party,
agents: Vec<Agent>,
) -> Self
pub fn with_currency( currency_code: String, amount: String, merchant: Party, agents: Vec<Agent>, ) -> Self
Creates a new Payment with a currency