Struct paystack::PaystackClient
source · pub struct PaystackClient { /* private fields */ }Expand description
This is the struct that allows you to authenticate to the PayStack API. It contains the API key which allows you to interact with the API.
Implementations§
source§impl PaystackClient
impl PaystackClient
sourcepub fn new<S: Into<String>>(key: S) -> Self
pub fn new<S: Into<String>>(key: S) -> Self
Create a new PayStack client with the specified API key.
It takes the following parameters: - key: Paystack API key.
sourcepub async fn initialize_transaction(
&self,
transaction_body: TransactionBody
) -> PaystackResult<TransactionResponse>
pub async fn initialize_transaction( &self, transaction_body: TransactionBody ) -> PaystackResult<TransactionResponse>
Initalize a new transaction using the Paystack API.
The function takes a TransactionBody type as its parameter
sourcepub async fn verify_transaction(
&self,
reference: String
) -> PaystackResult<TransactionStatus>
pub async fn verify_transaction( &self, reference: String ) -> PaystackResult<TransactionStatus>
This function confirms the status of a transaction.
It takes the following parameters: - reference: The transaction reference used to intiate the transaction
Trait Implementations§
source§impl Clone for PaystackClient
impl Clone for PaystackClient
source§fn clone(&self) -> PaystackClient
fn clone(&self) -> PaystackClient
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for PaystackClient
impl Send for PaystackClient
impl Sync for PaystackClient
impl Unpin for PaystackClient
impl !UnwindSafe for PaystackClient
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more