Skip to main content

ReadersClient

Struct ReadersClient 

Source
pub struct ReadersClient<'a> { /* private fields */ }
Expand description

Client for the Readers API endpoints.

Implementations§

Source§

impl<'a> ReadersClient<'a>

Source

pub fn client(&self) -> &Client

Returns a reference to the underlying client.

Source

pub async fn list( &self, merchant_code: impl Into<String>, ) -> SdkResult<ListResponse, ListErrorBody>

List Readers

List all readers of the merchant.

Source

pub async fn create( &self, merchant_code: impl Into<String>, body: CreateBody, ) -> SdkResult<Reader, CreateErrorBody>

Create a Reader

Create a new Reader for the merchant account.

Source

pub async fn delete( &self, merchant_code: impl Into<String>, id: impl Into<String>, ) -> SdkResult<(), DeleteErrorBody>

Delete a reader

Delete a reader.

Source

pub async fn get( &self, merchant_code: impl Into<String>, id: impl Into<String>, ) -> SdkResult<Reader, GetErrorBody>

Retrieve a Reader

Retrieve a Reader.

Source

pub async fn update( &self, merchant_code: impl Into<String>, id: impl Into<String>, body: UpdateBody, ) -> SdkResult<Reader, UpdateErrorBody>

Update a Reader

Update a Reader.

Source

pub async fn create_checkout( &self, merchant_code: impl Into<String>, reader_id: impl Into<String>, body: CreateReaderCheckoutRequest, ) -> SdkResult<CreateReaderCheckoutResponse, CreateCheckoutErrorBody>

Create a Reader Checkout

Creates a Checkout for a Reader.

This process is asynchronous and the actual transaction may take some time to be stared on the device.

There are some caveats when using this endpoint:

  • The target device must be online, otherwise checkout won’t be accepted
  • After the checkout is accepted, the system has 60 seconds to start the payment on the target device. During this time, any other checkout for the same device will be rejected.

Note: If the target device is a Solo, it must be in version 3.3.24.3 or higher.

Source

pub async fn get_status( &self, merchant_code: impl Into<String>, reader_id: impl Into<String>, ) -> SdkResult<StatusResponse, GetStatusErrorBody>

Get a Reader Status

Provides the last known status for a Reader.

This endpoint allows you to retrieve updates from the connected card reader, including the current screen being displayed during the payment process and the device status (battery level, connectivity, and update state).

Supported States

  • IDLE – Reader ready for next transaction
  • SELECTING_TIP – Waiting for tip input
  • WAITING_FOR_CARD – Awaiting card insert/tap
  • WAITING_FOR_PIN – Waiting for PIN entry
  • WAITING_FOR_SIGNATURE – Waiting for customer signature
  • UPDATING_FIRMWARE – Firmware update in progress

Device Status

  • ONLINE – Device connected and operational
  • OFFLINE – Device disconnected (last state persisted)

Note: If the target device is a Solo, it must be in version 3.3.39.0 or higher.

Source

pub async fn terminate_checkout( &self, merchant_code: impl Into<String>, reader_id: impl Into<String>, ) -> SdkResult<(), TerminateCheckoutErrorBody>

Terminate a Reader Checkout

Terminate a Reader Checkout stops the current transaction on the target device.

This process is asynchronous and the actual termination may take some time to be performed on the device.

There are some caveats when using this endpoint:

  • The target device must be online, otherwise terminate won’t be accepted
  • The action will succeed only if the device is waiting for cardholder action: e.g: waiting for card, waiting for PIN, etc.
  • There is no confirmation of the termination.

If a transaction is successfully terminated and return_url was provided on Checkout, the transaction status will be sent as failed to the provided URL.

Note: If the target device is a Solo, it must be in version 3.3.28.0 or higher.

Trait Implementations§

Source§

impl<'a> Debug for ReadersClient<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for ReadersClient<'a>

§

impl<'a> !RefUnwindSafe for ReadersClient<'a>

§

impl<'a> Send for ReadersClient<'a>

§

impl<'a> Sync for ReadersClient<'a>

§

impl<'a> Unpin for ReadersClient<'a>

§

impl<'a> UnsafeUnpin for ReadersClient<'a>

§

impl<'a> !UnwindSafe for ReadersClient<'a>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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