pub struct Payments<'a> { /* private fields */ }Implementations§
Source§impl<'a> Payments<'a>
impl<'a> Payments<'a>
Sourcepub async fn list(
self,
parameters: Option<Vec<(String, String)>>,
) -> Result<SquareResponse, SquareError>
pub async fn list( self, parameters: Option<Vec<(String, String)>>, ) -> Result<SquareResponse, SquareError>
Retrieves a list of payments taken by the account making the request. Open in API Reference
§Arguments
parameters- A vector of parameters created through the ListPaymentsParametersBuilder
Sourcepub async fn create(
self,
payment: PaymentRequest,
) -> Result<SquareResponse, SquareError>
pub async fn create( self, payment: PaymentRequest, ) -> Result<SquareResponse, SquareError>
Sourcepub async fn cancel_by_idempotency_key(
self,
idempotency_key: String,
) -> Result<SquareResponse, SquareError>
pub async fn cancel_by_idempotency_key( self, idempotency_key: String, ) -> Result<SquareResponse, SquareError>
Cancels (voids) a payment identified by the idempotency key that is specified in the request. Open in API Reference
§Arguments
idempotency_key- The idempotency key identifying the payment to be canceled.
Sourcepub async fn get(
self,
payment_id: String,
) -> Result<SquareResponse, SquareError>
pub async fn get( self, payment_id: String, ) -> Result<SquareResponse, SquareError>
Retrieves details for a specific payment. Open in API Reference
§Arguments
payment_id- The idempotency key identifying the payment to be canceled.
Sourcepub async fn update(
self,
payment_id: String,
body: UpdatePaymentBody,
) -> Result<SquareResponse, SquareError>
pub async fn update( self, payment_id: String, body: UpdatePaymentBody, ) -> Result<SquareResponse, SquareError>
Updates a payment with the APPROVED status.
You can update the amount_money and tip_money using this endpoint.
Open in API Reference
§Arguments
payment_id- The idempotency key identifying the payment to be updated.body- The request body with the updated Payment object.
Sourcepub async fn cancel(
self,
payment_id: String,
) -> Result<SquareResponse, SquareError>
pub async fn cancel( self, payment_id: String, ) -> Result<SquareResponse, SquareError>
Cancels (voids) a payment. Open in API Reference
§Arguments
payment_id- The idempotency key identifying the payment to be canceled.
Sourcepub async fn complete(
self,
payment_id: String,
version_token: Option<String>,
) -> Result<SquareResponse, SquareError>
pub async fn complete( self, payment_id: String, version_token: Option<String>, ) -> Result<SquareResponse, SquareError>
Cancels (voids) a payment. Open in API Reference
§Arguments
payment_id- The idempotency key identifying the payment to be completed.version_token- Used for optimistic concurrency. This opaque token identifies the current Payment version that the caller expects. If the server has a different version of the Payment, the update fails and a response with a VERSION_MISMATCH error is returned.
Auto Trait Implementations§
impl<'a> Freeze for Payments<'a>
impl<'a> RefUnwindSafe for Payments<'a>
impl<'a> Send for Payments<'a>
impl<'a> Sync for Payments<'a>
impl<'a> Unpin for Payments<'a>
impl<'a> UnwindSafe for Payments<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more