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.
- Payment
Reference - A non-empty payment reference.
Enums§
- Payment
Direction - Payment direction.
- Payment
Error - Errors returned by payment primitives.
- Payment
Method - Conservative payment method vocabulary.
- Payment
Status - Payment lifecycle status.