paystack-client 0.1.2

A simple Rust client for Paystack payments (initialize & verify).
Documentation
use serde::{Deserialize, Serialize};


#[derive(Debug, Serialize)]
pub struct PaymentInitializePayload {
    pub email: String,
    pub amount: i64,
    pub reference: String,
    pub callback_url: String,
}


#[derive(Debug, Deserialize)]
pub struct PaymentInitializeResponse {
    pub status: bool,
    pub message: String,
    pub data: Option<InitData>,
}

#[derive(Debug, Deserialize)]
pub struct InitData {
    pub authorization_url: String,
    pub access_code: String,
    pub reference: String,
}

#[derive(Debug, Deserialize)]
pub struct PaymentVerifyResponse {
    pub status: bool,
    pub message: String,
    pub data: Option<PaymentVerifyData>,
}

#[derive(Debug, Deserialize)]
pub struct PaymentVerifyData {
    pub status: String,
    pub reference: String,
    pub amount: i64,
    pub gateway_response: String,
    #[serde(rename = "customer")]
    pub customer: PaymentCustomer,
}

#[derive(Debug, Deserialize)]
pub struct PaymentCustomer {
    pub email: String,
}