pub struct TerminalEndpoints<T: HttpClient + Default> { /* private fields */ }Expand description
A struct to hold all the functions of the terminal API endpoint
Implementations§
Source§impl<T: HttpClient + Default> TerminalEndpoints<T>
impl<T: HttpClient + Default> TerminalEndpoints<T>
Sourcepub async fn send_event(
&self,
terminal_id: String,
event_request: EventRequest,
) -> PaystackResult<SendEventResponseData>
pub async fn send_event( &self, terminal_id: String, event_request: EventRequest, ) -> PaystackResult<SendEventResponseData>
Send an event from your application to the Paystack Terminal
Takes in the following:
- terminal_id: The ID of the Terminal the event should be sent to.
- EventRequest: A struct containing the information of the event to send to the terminal. It is created with the EventRequestBuilder.
Sourcepub async fn fetch_event_status(
&self,
terminal_id: String,
event_id: String,
) -> PaystackResult<FetchEventStatusResponseData>
pub async fn fetch_event_status( &self, terminal_id: String, event_id: String, ) -> PaystackResult<FetchEventStatusResponseData>
Check the status of an event sent to the Paystack Terminal
Takes in the following:
- terminal_id: The ID of the Terminal the event was sent to.
- event_id: The ID of the event that was sent to the Terminal.
Sourcepub async fn fetch_terminal_status(
&self,
terminal_id: String,
) -> PaystackResult<FetchTerminalStatusResponseData>
pub async fn fetch_terminal_status( &self, terminal_id: String, ) -> PaystackResult<FetchTerminalStatusResponseData>
Check the availiability of a Terminal before sending an event to it
Takes in the following:
- terminal_id: The ID of the Terminal you want to check.
Sourcepub async fn list_terminals(
&self,
per_page: Option<i32>,
) -> PaystackResult<Vec<TerminalData>>
pub async fn list_terminals( &self, per_page: Option<i32>, ) -> PaystackResult<Vec<TerminalData>>
List the Terminals available on your integration
Takes in the following:
- per_page: Specify how many records you want retrieved. Defaults to a value of 50
Sourcepub async fn fetch_terminal(
&self,
terminal_id: String,
) -> PaystackResult<TerminalData>
pub async fn fetch_terminal( &self, terminal_id: String, ) -> PaystackResult<TerminalData>
Get the details of a Terminal
Takes in the following:
- terminal_id: The ID of the Terminal the event was sent to.
Sourcepub async fn update_terminal(
&self,
terminal_id: String,
update_request: UpdateTerminalRequest,
) -> PaystackResult<PhantomData<String>>
pub async fn update_terminal( &self, terminal_id: String, update_request: UpdateTerminalRequest, ) -> PaystackResult<PhantomData<String>>
Update the details of a Terminal.
Takes in the following:
- terminal_id: The ID of the Terminal you want to update.
- UpdateTerminalRequest: Contains the datails to be updated in the terminal. Should be constructed using the UpdateTerminalRequestBuilder
NB: The generic for the result here is a String, because there is no data field in the response from the API.
The string will be ignored because the underlying data field in the response is an Option.
Sourcepub async fn commission_terminal(
&self,
serial_number: String,
) -> PaystackResult<PhantomData<String>>
pub async fn commission_terminal( &self, serial_number: String, ) -> PaystackResult<PhantomData<String>>
Activate your debug device by linking it to your integration
Take in the following:
- serial_number: The device serial number
NB: The generic for the result here is a String, because there is no data field in the response from the API.
The string will be ignored because the underlying data field in the response is an Option.
Sourcepub async fn decommission_terminal(
&self,
serial_number: String,
) -> PaystackResult<PhantomData<String>>
pub async fn decommission_terminal( &self, serial_number: String, ) -> PaystackResult<PhantomData<String>>
Unlink your debug device from your integration
Take in the following:
- serial_number: The device serial number
NB: The generic for the result here is a String, because there is no data field in the response from the API.
The string will be ignored because the underlying data field in the response is an Option.
Trait Implementations§
Source§impl<T: Clone + HttpClient + Default> Clone for TerminalEndpoints<T>
impl<T: Clone + HttpClient + Default> Clone for TerminalEndpoints<T>
Source§fn clone(&self) -> TerminalEndpoints<T>
fn clone(&self) -> TerminalEndpoints<T>
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source. Read more