pub struct ReadersClient<'a> { /* private fields */ }Expand description
Client for the Readers API endpoints.
Implementations§
Source§impl<'a> ReadersClient<'a>
impl<'a> ReadersClient<'a>
Sourcepub async fn list(
&self,
merchant_code: impl Into<String>,
) -> SdkResult<ListResponse, ListErrorBody>
pub async fn list( &self, merchant_code: impl Into<String>, ) -> SdkResult<ListResponse, ListErrorBody>
List Readers
List all readers of the merchant.
Sourcepub async fn create(
&self,
merchant_code: impl Into<String>,
body: CreateBody,
) -> SdkResult<Reader, CreateErrorBody>
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.
Sourcepub async fn delete(
&self,
merchant_code: impl Into<String>,
id: impl Into<String>,
) -> SdkResult<(), DeleteErrorBody>
pub async fn delete( &self, merchant_code: impl Into<String>, id: impl Into<String>, ) -> SdkResult<(), DeleteErrorBody>
Delete a reader
Delete a reader.
Sourcepub async fn get(
&self,
merchant_code: impl Into<String>,
id: impl Into<String>,
) -> SdkResult<Reader, GetErrorBody>
pub async fn get( &self, merchant_code: impl Into<String>, id: impl Into<String>, ) -> SdkResult<Reader, GetErrorBody>
Retrieve a Reader
Retrieve a Reader.
Sourcepub async fn update(
&self,
merchant_code: impl Into<String>,
id: impl Into<String>,
body: UpdateBody,
) -> SdkResult<Reader, UpdateErrorBody>
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.
Sourcepub async fn create_checkout(
&self,
merchant_code: impl Into<String>,
reader_id: impl Into<String>,
body: CreateReaderCheckoutRequest,
) -> SdkResult<CreateReaderCheckoutResponse, CreateCheckoutErrorBody>
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.
Sourcepub async fn get_status(
&self,
merchant_code: impl Into<String>,
reader_id: impl Into<String>,
) -> SdkResult<StatusResponse, GetStatusErrorBody>
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 transactionSELECTING_TIP– Waiting for tip inputWAITING_FOR_CARD– Awaiting card insert/tapWAITING_FOR_PIN– Waiting for PIN entryWAITING_FOR_SIGNATURE– Waiting for customer signatureUPDATING_FIRMWARE– Firmware update in progress
Device Status
ONLINE– Device connected and operationalOFFLINE– Device disconnected (last state persisted)
Note: If the target device is a Solo, it must be in version 3.3.39.0 or higher.
Sourcepub async fn terminate_checkout(
&self,
merchant_code: impl Into<String>,
reader_id: impl Into<String>,
) -> SdkResult<(), TerminateCheckoutErrorBody>
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.