paystack-transaction

Crates.iopaystack-transaction
lib.rspaystack-transaction
version0.1.4
sourcesrc
created_at2023-10-16 08:23:33.413151
updated_at2023-10-21 15:40:27.536074
descriptionPaystack Rust Client
homepagehttps://oluseun.dev
repositoryhttps://github.com/seun-ja/paystack-transaction
max_upload_size
id1004557
size19,036
Aminu 'Seun Joshua (seun-ja)

documentation

README

Paystack Transaction

A Simple package to use Paystack with Rust

Usage

#[tokio::main]
async fn main() {
    let key = cred_from_env("SECRET_KEY".to_string()).unwrap();

    let mut builder = Payment::builder(
        "test@example.com".to_string(),
        100.0,
        key,
    );

    builder.mobile_money(
        MobileMoney {
           phone: "08123456789".to_string(),
           provider: "MTN".to_string(),
        }
    );
    builder.label("label".to_string());
    builder.reference("reference".to_string());

    builder.build().send().await.unwrap();
}

Installation

[dependencies]
paystack-transaction = "0.1.2"
Commit count: 17

cargo fmt