pub struct CreatePayment {Show 23 fields
pub order_id: Option<OrderId>,
pub invoice_id: Option<Uuid>,
pub customer_id: Option<CustomerId>,
pub payment_method: PaymentMethodType,
pub amount: Decimal,
pub currency: Option<CurrencyCode>,
pub external_id: Option<String>,
pub idempotency_key: Option<String>,
pub processor: Option<String>,
pub card_brand: Option<CardBrand>,
pub card_last4: Option<String>,
pub card_exp_month: Option<i32>,
pub card_exp_year: Option<i32>,
pub blockchain_network: Option<BlockchainNetwork>,
pub stablecoin_type: Option<StablecoinType>,
pub from_wallet_address: Option<String>,
pub to_wallet_address: Option<String>,
pub token_address: Option<String>,
pub billing_email: Option<String>,
pub billing_name: Option<String>,
pub billing_address: Option<String>,
pub description: Option<String>,
pub metadata: Option<String>,
}Expand description
Input for creating a new payment
Fields§
§order_id: Option<OrderId>Associated order ID
invoice_id: Option<Uuid>Associated invoice ID
customer_id: Option<CustomerId>Customer ID
payment_method: PaymentMethodTypePayment method
amount: DecimalPayment amount
currency: Option<CurrencyCode>Currency code (defaults to USD)
external_id: Option<String>External payment processor ID
idempotency_key: Option<String>Idempotency key for safely retrying payment creation
processor: Option<String>Payment processor/gateway
card_brand: Option<CardBrand>Card brand
card_last4: Option<String>Last 4 digits of card
card_exp_month: Option<i32>Card expiry month
card_exp_year: Option<i32>Card expiry year
blockchain_network: Option<BlockchainNetwork>Blockchain network (solana, set_chain, base, etc.)
stablecoin_type: Option<StablecoinType>Stablecoin type (USDC, USDT, ssUSD)
from_wallet_address: Option<String>Sender wallet address
to_wallet_address: Option<String>Recipient wallet address
token_address: Option<String>Token contract/mint address
billing_email: Option<String>Billing email
billing_name: Option<String>Billing name
billing_address: Option<String>Billing address
description: Option<String>Payment description
metadata: Option<String>Additional metadata
Trait Implementations§
Source§impl Clone for CreatePayment
impl Clone for CreatePayment
Source§fn clone(&self) -> CreatePayment
fn clone(&self) -> CreatePayment
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CreatePayment
impl Debug for CreatePayment
Source§impl Default for CreatePayment
impl Default for CreatePayment
Source§fn default() -> CreatePayment
fn default() -> CreatePayment
Source§impl<'de> Deserialize<'de> for CreatePayment
impl<'de> Deserialize<'de> for CreatePayment
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CreatePayment, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CreatePayment, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for CreatePayment
impl Serialize for CreatePayment
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Source§impl Validate for CreatePayment
impl Validate for CreatePayment
Source§fn validate(&self) -> Result<(), CommerceError>
fn validate(&self) -> Result<(), CommerceError>
Validate a payment create request.
Rejects a negative amount and a malformed billing email (when present). A zero amount is permitted (e.g. a $0 authorization / free order); only a negative amount is rejected.