public interface PaymentsApi
| Modifier and Type | Method and Description |
|---|---|
CancelPaymentResponse |
cancelPayment(String paymentId)
Cancels (voids) a payment.
|
CompletableFuture<CancelPaymentResponse> |
cancelPaymentAsync(String paymentId)
Cancels (voids) a payment.
|
CancelPaymentByIdempotencyKeyResponse |
cancelPaymentByIdempotencyKey(CancelPaymentByIdempotencyKeyRequest body)
Cancels (voids) a payment identified by the idempotency key that is specified in the request.
|
CompletableFuture<CancelPaymentByIdempotencyKeyResponse> |
cancelPaymentByIdempotencyKeyAsync(CancelPaymentByIdempotencyKeyRequest body)
Cancels (voids) a payment identified by the idempotency key that is specified in the request.
|
CompletePaymentResponse |
completePayment(String paymentId,
CompletePaymentRequest body)
Completes (captures) a payment.
|
CompletableFuture<CompletePaymentResponse> |
completePaymentAsync(String paymentId,
CompletePaymentRequest body)
Completes (captures) a payment.
|
CreatePaymentResponse |
createPayment(CreatePaymentRequest body)
Creates a payment using the provided source.
|
CompletableFuture<CreatePaymentResponse> |
createPaymentAsync(CreatePaymentRequest body)
Creates a payment using the provided source.
|
GetPaymentResponse |
getPayment(String paymentId)
Retrieves details for a specific payment.
|
CompletableFuture<GetPaymentResponse> |
getPaymentAsync(String paymentId)
Retrieves details for a specific payment.
|
ListPaymentsResponse |
listPayments(String beginTime,
String endTime,
String sortOrder,
String cursor,
String locationId,
Long total,
String last4,
String cardBrand,
Integer limit)
Retrieves a list of payments taken by the account making the request.
|
CompletableFuture<ListPaymentsResponse> |
listPaymentsAsync(String beginTime,
String endTime,
String sortOrder,
String cursor,
String locationId,
Long total,
String last4,
String cardBrand,
Integer limit)
Retrieves a list of payments taken by the account making the request.
|
UpdatePaymentResponse |
updatePayment(String paymentId,
UpdatePaymentRequest body)
Updates a payment with the APPROVED status.
|
CompletableFuture<UpdatePaymentResponse> |
updatePaymentAsync(String paymentId,
UpdatePaymentRequest body)
Updates a payment with the APPROVED status.
|
ListPaymentsResponse listPayments(String beginTime, String endTime, String sortOrder, String cursor, String locationId, Long total, String last4, String cardBrand, Integer limit) throws ApiException, IOException
beginTime - Optional parameter: The timestamp for the beginning of the reporting
period, in RFC 3339 format. Inclusive. Default: The current time minus one year.endTime - Optional parameter: The timestamp for the end of the reporting period, in
RFC 3339 format. Default: The current time.sortOrder - Optional parameter: The order in which results are listed: - `ASC` -
Oldest to newest. - `DESC` - Newest to oldest (default).cursor - Optional parameter: A pagination cursor returned by a previous call to this
endpoint. Provide this cursor to retrieve the next set of results for the original
query. For more information, see
[Pagination](https://developer.squareup.com/docs/basics/api101/pagination).locationId - Optional parameter: Limit results to the location supplied. By default,
results are returned for the default (main) location associated with the seller.total - Optional parameter: The exact amount in the `total_money` for a payment.last4 - Optional parameter: The last four digits of a payment card.cardBrand - Optional parameter: The brand of the payment card (for example, VISA).limit - Optional parameter: The maximum number of results to be returned in a single
page. It is possible to receive fewer results than the specified limit on a given
page. The default value of 100 is also the maximum allowed value. If the provided
value is greater than 100, it is ignored and the default value is used instead.
Default: `100`ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.CompletableFuture<ListPaymentsResponse> listPaymentsAsync(String beginTime, String endTime, String sortOrder, String cursor, String locationId, Long total, String last4, String cardBrand, Integer limit)
beginTime - Optional parameter: The timestamp for the beginning of the reporting
period, in RFC 3339 format. Inclusive. Default: The current time minus one year.endTime - Optional parameter: The timestamp for the end of the reporting period, in
RFC 3339 format. Default: The current time.sortOrder - Optional parameter: The order in which results are listed: - `ASC` -
Oldest to newest. - `DESC` - Newest to oldest (default).cursor - Optional parameter: A pagination cursor returned by a previous call to this
endpoint. Provide this cursor to retrieve the next set of results for the original
query. For more information, see
[Pagination](https://developer.squareup.com/docs/basics/api101/pagination).locationId - Optional parameter: Limit results to the location supplied. By default,
results are returned for the default (main) location associated with the seller.total - Optional parameter: The exact amount in the `total_money` for a payment.last4 - Optional parameter: The last four digits of a payment card.cardBrand - Optional parameter: The brand of the payment card (for example, VISA).limit - Optional parameter: The maximum number of results to be returned in a single
page. It is possible to receive fewer results than the specified limit on a given
page. The default value of 100 is also the maximum allowed value. If the provided
value is greater than 100, it is ignored and the default value is used instead.
Default: `100`CreatePaymentResponse createPayment(CreatePaymentRequest body) throws ApiException, IOException
body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.CompletableFuture<CreatePaymentResponse> createPaymentAsync(CreatePaymentRequest body)
body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.CancelPaymentByIdempotencyKeyResponse cancelPaymentByIdempotencyKey(CancelPaymentByIdempotencyKeyRequest body) throws ApiException, IOException
body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.CompletableFuture<CancelPaymentByIdempotencyKeyResponse> cancelPaymentByIdempotencyKeyAsync(CancelPaymentByIdempotencyKeyRequest body)
body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.GetPaymentResponse getPayment(String paymentId) throws ApiException, IOException
paymentId - Required parameter: A unique ID for the desired payment.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.CompletableFuture<GetPaymentResponse> getPaymentAsync(String paymentId)
paymentId - Required parameter: A unique ID for the desired payment.UpdatePaymentResponse updatePayment(String paymentId, UpdatePaymentRequest body) throws ApiException, IOException
paymentId - Required parameter: The ID of the payment to update.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.CompletableFuture<UpdatePaymentResponse> updatePaymentAsync(String paymentId, UpdatePaymentRequest body)
paymentId - Required parameter: The ID of the payment to update.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.CancelPaymentResponse cancelPayment(String paymentId) throws ApiException, IOException
paymentId - Required parameter: The ID of the payment to cancel.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.CompletableFuture<CancelPaymentResponse> cancelPaymentAsync(String paymentId)
paymentId - Required parameter: The ID of the payment to cancel.CompletePaymentResponse completePayment(String paymentId, CompletePaymentRequest body) throws ApiException, IOException
paymentId - Required parameter: The unique ID identifying the payment to be completed.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.CompletableFuture<CompletePaymentResponse> completePaymentAsync(String paymentId, CompletePaymentRequest body)
paymentId - Required parameter: The unique ID identifying the payment to be completed.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.Copyright © 2022. All rights reserved.