Struct paystack::TransactionEndpoints
source · pub struct TransactionEndpoints<'a> { /* private fields */ }
Expand description
A Struct to hold all the functions of the transaction API route
Implementations§
source§impl<'a> TransactionEndpoints<'a>
impl<'a> TransactionEndpoints<'a>
sourcepub fn new(key: &'a str) -> TransactionEndpoints<'a>
pub fn new(key: &'a str) -> TransactionEndpoints<'a>
Constructor for the transaction object
sourcepub async fn initialize_transaction(
&self,
transaction_body: InitializeTransactionBody
) -> PaystackResult<TransactionResponse>
pub async fn initialize_transaction( &self, transaction_body: InitializeTransactionBody ) -> PaystackResult<TransactionResponse>
Initialize a transaction from your backend.
It takes a Transaction type as its parameter
sourcepub async fn verify_transaction(
&self,
reference: &str
) -> PaystackResult<TransactionStatusResponse>
pub async fn verify_transaction( &self, reference: &str ) -> PaystackResult<TransactionStatusResponse>
Confirm the status of a transaction.
It takes the following parameters: - reference: The transaction reference used to initiate the transaction
sourcepub async fn list_transactions(
&self,
number_of_transactions: Option<u32>,
status: Option<Status>
) -> PaystackResult<TransactionStatusListResponse>
pub async fn list_transactions( &self, number_of_transactions: Option<u32>, status: Option<Status> ) -> PaystackResult<TransactionStatusListResponse>
List transactions carried out on your integration.
The method takes the following parameters: - perPage (Optional): Number of transactions to return. If None is passed as the parameter, the last 10 transactions are returned. - status (Optional): Filter transactions by status, defaults to Success if no status is passed.
sourcepub async fn fetch_transactions(
&self,
transaction_id: u32
) -> PaystackResult<TransactionStatusResponse>
pub async fn fetch_transactions( &self, transaction_id: u32 ) -> PaystackResult<TransactionStatusResponse>
Get details of a transaction carried out on your integration.
This methods take the Id of the desired transaction as a parameter
All authorizations marked as reusable can be charged with this endpoint whenever you need to receive payments.
This function takes a Charge Struct as parameter
sourcepub async fn view_transaction_timeline(
&self,
id: Option<u32>,
reference: Option<&str>
) -> PaystackResult<TransactionTimelineResponse>
pub async fn view_transaction_timeline( &self, id: Option<u32>, reference: Option<&str> ) -> PaystackResult<TransactionTimelineResponse>
View the timeline of a transaction.
This method takes in the Transaction id or reference as a parameter
sourcepub async fn total_transactions(
&self
) -> PaystackResult<TransactionTotalsResponse>
pub async fn total_transactions( &self ) -> PaystackResult<TransactionTotalsResponse>
Total amount received on your account.
This route normally takes a perPage or page query, However in this case it is ignored. If you need it in your work please open an issue and it will be implemented.
sourcepub async fn export_transaction(
&self,
status: Option<Status>,
currency: Option<Currency>,
settled: Option<bool>
) -> PaystackResult<ExportTransactionResponse>
pub async fn export_transaction( &self, status: Option<Status>, currency: Option<Currency>, settled: Option<bool> ) -> PaystackResult<ExportTransactionResponse>
Export a list of transactions carried out on your integration.
This method takes the following parameters
- Status (Optional): The status of the transactions to export. Defaults to all
- Currency (Optional): The currency of the transactions to export. Defaults to NGN
- Settled (Optional): To state of the transactions to export. Defaults to False.
sourcepub async fn partial_debit(
&self,
transaction_body: PartialDebitTransactionBody
) -> PaystackResult<TransactionStatusResponse>
pub async fn partial_debit( &self, transaction_body: PartialDebitTransactionBody ) -> PaystackResult<TransactionStatusResponse>
Retrieve part of a payment from a customer.
It takes a PartialDebitTransaction type as a parameter.
NB: it must be created with the PartialDebitTransaction Builder.
Trait Implementations§
source§impl<'a> Clone for TransactionEndpoints<'a>
impl<'a> Clone for TransactionEndpoints<'a>
source§fn clone(&self) -> TransactionEndpoints<'a>
fn clone(&self) -> TransactionEndpoints<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more