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>

source

pub fn new(key: &'a str) -> TransactionEndpoints<'a>

Constructor for the transaction object

source

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

source

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

source

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.

source

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

source

pub async fn charge_authorization( &self, charge: ChargeBody ) -> PaystackResult<TransactionStatusResponse>

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

source

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

source

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.

source

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.
source

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>

source§

fn clone(&self) -> TransactionEndpoints<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a> Debug for TransactionEndpoints<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more