Skip to main content

intasend/
lib.rs

1#![allow(unused_imports)]
2
3mod intasend;
4
5// Checkout functionality - available for both `client` and `server` environments
6#[cfg(any(feature = "client", feature = "server"))]
7pub use self::intasend::checkout::{
8    CheckoutDetailsRequest, CheckoutDetailsResponse, CheckoutMethod, CheckoutRequest,
9    CheckoutResponse, CheckoutsAPI,
10};
11
12// Collection functionality - `server` only
13#[cfg(feature = "server")]
14pub use self::intasend::collection::{
15    CollectionsAPI, MpesaStkPushRequest, MpesaStkPushResponse, StkPushStatusRequest,
16    StkPushStatusResponse,
17};
18
19// Payout functionality - `server` only
20#[cfg(feature = "server")]
21pub use self::intasend::payouts::{
22    Payout, PayoutApproval, PayoutApprovalRequest, PayoutRequest, PayoutRequestTransaction,
23    PayoutResponseTransaction, PayoutStatusRequest, PayoutsAPI,
24};
25
26// Refund functionality - `server` only
27#[cfg(feature = "server")]
28pub use self::intasend::refunds::{
29    Refund, RefundListResponse, RefundReason, RefundRequest, RefundsAPI,
30};
31
32// Wallet functionality - `server` only
33#[cfg(feature = "server")]
34pub use self::intasend::wallets::{
35    FundCheckoutRequest, FundCheckoutResponse, FundMpesaRequest, FundMpesaResponse, Wallet,
36    WalletCreateDetails, WalletDetailsRequest, WalletIntraTransferRequest,
37    WalletIntraTransferResponse, WalletListResponse, WalletTransactionsResponse, WalletType,
38    WalletsAPI,
39};
40
41// Payment Links functionality - `server` only
42#[cfg(feature = "server")]
43pub use self::intasend::payment_links::{
44    PaymentLink, PaymentLinksAPI, PaymentLinksCreateDetails, PaymentLinksDetailsRequest,
45    PaymentLinksListRequest, PaymentLinksListResponse, PaymentLinksUpdateDetails,
46};
47
48// Subscription functionality - `server` only
49#[cfg(feature = "server")]
50pub use self::intasend::subscriptions::{
51    FrequencyUnit, Subscription, SubscriptionStatus, SubscriptionsAPI, SubscriptionsCreateDetails,
52    SubscriptionsCustomer, SubscriptionsCustomerCreateDetails, SubscriptionsCustomerListResponse,
53    SubscriptionsListResponse, SubscriptionsPlan, SubscriptionsPlanCreateRequest,
54    SubscriptionsPlanListResponse, SubscriptionsTransactionListResponse,
55};
56
57// Core types - available for both `client` and `server` environments
58#[cfg(any(feature = "client", feature = "server"))]
59pub use self::intasend::{
60    Currency, Customer, Intasend, IntasendApiError, IntasendApiErrorDetail, IntasendClientError,
61    PayoutProvider, Provider, Tarrif, Transaction, TransactionStatus, TransactionType,
62};
63
64// Money type re-exports. `Decimal` is used for every monetary `amount`/balance field in this
65// crate's request and response types. We re-export the whole `rust_decimal` crate as-is (so
66// `intasend::rust_decimal::...` is available) plus the `Decimal` type directly, letting
67// downstream users construct amounts with `intasend::Decimal::from(1000)`,
68// `intasend::Decimal::from_str("10.00")`, etc. without adding `rust_decimal` to their own
69// `Cargo.toml`. This is additive: existing users importing `rust_decimal::Decimal` directly
70// are unaffected.
71#[cfg(any(feature = "client", feature = "server"))]
72pub use rust_decimal::{self, Decimal};
73
74#[cfg(test)]
75mod tests {
76    use super::*;
77
78    #[test]
79    fn it_works() {
80        // Run tests here
81    }
82}