#[non_exhaustive]pub enum PaymentMethod {
Card(CardPaymentMethod),
Stablecoin(StablecoinPaymentMethod),
Crypto(CryptoPaymentMethod),
PayPal(PayPalPaymentMethod),
MobileMoney(MobileMoneyPaymentMethod),
}Expand description
Provider-neutral payment method.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Card(CardPaymentMethod)
Card payment.
Stablecoin(StablecoinPaymentMethod)
Stablecoin payment.
Crypto(CryptoPaymentMethod)
Crypto payment.
PayPal(PayPalPaymentMethod)
PayPal order.
MobileMoney(MobileMoneyPaymentMethod)
Mobile Money collection.
Implementations§
Source§impl PaymentMethod
impl PaymentMethod
Sourcepub fn stablecoin(asset: StablecoinAsset) -> Self
pub fn stablecoin(asset: StablecoinAsset) -> Self
Creates a stablecoin payment method for an asset.
Sourcepub fn stablecoin_usdc() -> Self
pub fn stablecoin_usdc() -> Self
Creates a USDC stablecoin method.
Sourcepub fn stablecoin_usdt() -> Self
pub fn stablecoin_usdt() -> Self
Creates a USDT stablecoin method.
Sourcepub const fn crypto(asset: CryptoAsset) -> Self
pub const fn crypto(asset: CryptoAsset) -> Self
Creates a crypto payment method for an asset.
Sourcepub const fn crypto_on(asset: CryptoAsset, network: CryptoNetwork) -> Self
pub const fn crypto_on(asset: CryptoAsset, network: CryptoNetwork) -> Self
Creates a crypto payment method for an asset on a specific network.
Sourcepub const fn usdc_on(network: CryptoNetwork) -> Self
pub const fn usdc_on(network: CryptoNetwork) -> Self
Creates a USDC crypto payment method on a specific network.
Sourcepub const fn usdt_on(network: CryptoNetwork) -> Self
pub const fn usdt_on(network: CryptoNetwork) -> Self
Creates a USDT crypto payment method on a specific network.
Sourcepub fn mobile_money_zambia(
phone_number: impl AsRef<str>,
) -> Result<Self, PaymentError>
pub fn mobile_money_zambia( phone_number: impl AsRef<str>, ) -> Result<Self, PaymentError>
Creates a Zambia Mobile Money payment method.
§Errors
Returns an error when the phone number or country code is invalid.
Trait Implementations§
Source§impl Clone for PaymentMethod
impl Clone for PaymentMethod
Source§fn clone(&self) -> PaymentMethod
fn clone(&self) -> PaymentMethod
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PaymentMethod
impl Debug for PaymentMethod
Source§impl PartialEq for PaymentMethod
impl PartialEq for PaymentMethod
impl Eq for PaymentMethod
impl StructuralPartialEq for PaymentMethod
Auto Trait Implementations§
impl Freeze for PaymentMethod
impl RefUnwindSafe for PaymentMethod
impl Send for PaymentMethod
impl Sync for PaymentMethod
impl Unpin for PaymentMethod
impl UnsafeUnpin for PaymentMethod
impl UnwindSafe for PaymentMethod
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more