Skip to main content

Crate use_payment

Crate use_payment 

Source
Expand description

§use-payment

Payment primitives for RustUse finance crates.

use-payment provides payment references, methods, directions, statuses, and money amounts without implementing payment network protocols.

§Example

use use_amount::Amount;
use use_currency::CurrencyCode;
use use_money::Money;
use use_payment::{Payment, PaymentDirection, PaymentMethod, PaymentReference};

let payment = Payment::new(
    PaymentReference::new("pay-1001")?,
    Money::new(Amount::from_minor_units(12_345, 2)?, CurrencyCode::new("USD")?),
    PaymentMethod::Ach,
    PaymentDirection::Inbound,
);

assert_eq!(payment.reference().as_str(), "pay-1001");

§Scope

Use this crate for payment vocabulary and local state. It does not implement ACH files, wire formats, card processing, payment gateways, bank APIs, async runtimes, or settlement systems.

§License

Licensed under either MIT or Apache-2.0.

Modules§

prelude
Common payment primitives.

Structs§

Payment
A payment value with reference, amount, method, direction, and status.
PaymentReference
A non-empty payment reference.

Enums§

PaymentDirection
Payment direction.
PaymentError
Errors returned by payment primitives.
PaymentMethod
Conservative payment method vocabulary.
PaymentStatus
Payment lifecycle status.