1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//! One payment API over any payment provider.
//!
//! Write against [`Provider`] and which provider takes the money becomes a
//! deployment decision rather than a rewrite. Stripe and iyzico ship with this
//! workspace; a provider that lives elsewhere is a first-class one — implement
//! [`Provider`], name it with [`ProviderId::new`]. Everything a caller needs is
//! re-exported here; the bundled adapters are behind features, one each.
//!
//! ```toml
//! kasapay = { version = "0.0.3", features = ["stripe", "iyzico"] }
//! ```
//!
//! # The one thing to understand first
//!
//! [`Provider::charge`] does not mean the money moved. It returns a [`Charge`]
//! whose [`Status`] is often [`Status::RequiresAction`], with a [`NextAction`]
//! saying what the payer must do — confirm in the browser for Stripe, follow a
//! deep link into iyzico's app for iyzico. Treating a returned `Charge` as a
//! completed payment is the mistake this crate is shaped to prevent.
//!
//! # Choosing a provider at runtime
//!
//! ```no_run
//! use std::sync::Arc;
//! use kasapay::{Provider, ProviderId};
//!
//! # #[cfg(all(feature = "stripe", feature = "iyzico"))]
//! # fn pick(
//! # id: ProviderId,
//! # stripe: kasapay::stripe::Stripe,
//! # iyzico: kasapay::iyzico::in_store::Client,
//! # )
//! # -> Option<Arc<dyn Provider>> {
//! match id {
//! ProviderId::STRIPE => Some(Arc::new(stripe)),
//! ProviderId::IYZICO => Some(Arc::new(iyzico)),
//! _ => None,
//! }
//! # }
//! ```
pub use ;
pub use kasapay_iyzico as iyzico;
pub use kasapay_mollie as mollie;
pub use kasapay_paypal as paypal;
pub use kasapay_paytr as paytr;
pub use kasapay_stripe as stripe;