public final class DefaultPaymentsApi extends BaseApi implements PaymentsApi
AUTHENTICATION_KEY, GLOBAL_ERROR_CASES| Constructor and Description |
|---|
DefaultPaymentsApi(io.apimatic.core.GlobalConfiguration globalConfig)
Initializes the controller.
|
| 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.
|
getClientInstance, getGlobalConfiguration, getHttpCallbackpublic DefaultPaymentsApi(io.apimatic.core.GlobalConfiguration globalConfig)
globalConfig - Configurations added in client.public ListPaymentsResponse listPayments(String beginTime, String endTime, String sortOrder, String cursor, String locationId, Long total, String last4, String cardBrand, Integer limit) throws ApiException, IOException
listPayments in interface PaymentsApibeginTime - Optional parameter: Indicates the start of the time range to retrieve
payments for, in RFC 3339 format. The range is determined using the `created_at`
field for each Payment. Inclusive. Default: The current time minus one year.endTime - Optional parameter: Indicates the end of the time range to retrieve payments
for, in RFC 3339 format. The range is determined using the `created_at` field for
each Payment. Default: The current time.sortOrder - Optional parameter: The order in which results are listed by
`Payment.created_at`: - `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/build-basics/common-api-patterns/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.public CompletableFuture<ListPaymentsResponse> listPaymentsAsync(String beginTime, String endTime, String sortOrder, String cursor, String locationId, Long total, String last4, String cardBrand, Integer limit)
listPaymentsAsync in interface PaymentsApibeginTime - Optional parameter: Indicates the start of the time range to retrieve
payments for, in RFC 3339 format. The range is determined using the `created_at`
field for each Payment. Inclusive. Default: The current time minus one year.endTime - Optional parameter: Indicates the end of the time range to retrieve payments
for, in RFC 3339 format. The range is determined using the `created_at` field for
each Payment. Default: The current time.sortOrder - Optional parameter: The order in which results are listed by
`Payment.created_at`: - `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/build-basics/common-api-patterns/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`public CreatePaymentResponse createPayment(CreatePaymentRequest body) throws ApiException, IOException
createPayment in interface PaymentsApibody - 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.public CompletableFuture<CreatePaymentResponse> createPaymentAsync(CreatePaymentRequest body)
createPaymentAsync in interface PaymentsApibody - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public CancelPaymentByIdempotencyKeyResponse cancelPaymentByIdempotencyKey(CancelPaymentByIdempotencyKeyRequest body) throws ApiException, IOException
cancelPaymentByIdempotencyKey in interface PaymentsApibody - 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.public CompletableFuture<CancelPaymentByIdempotencyKeyResponse> cancelPaymentByIdempotencyKeyAsync(CancelPaymentByIdempotencyKeyRequest body)
cancelPaymentByIdempotencyKeyAsync in interface PaymentsApibody - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public GetPaymentResponse getPayment(String paymentId) throws ApiException, IOException
getPayment in interface PaymentsApipaymentId - 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.public CompletableFuture<GetPaymentResponse> getPaymentAsync(String paymentId)
getPaymentAsync in interface PaymentsApipaymentId - Required parameter: A unique ID for the desired payment.public UpdatePaymentResponse updatePayment(String paymentId, UpdatePaymentRequest body) throws ApiException, IOException
updatePayment in interface PaymentsApipaymentId - 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.public CompletableFuture<UpdatePaymentResponse> updatePaymentAsync(String paymentId, UpdatePaymentRequest body)
updatePaymentAsync in interface PaymentsApipaymentId - 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.public CancelPaymentResponse cancelPayment(String paymentId) throws ApiException, IOException
cancelPayment in interface PaymentsApipaymentId - 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.public CompletableFuture<CancelPaymentResponse> cancelPaymentAsync(String paymentId)
cancelPaymentAsync in interface PaymentsApipaymentId - Required parameter: The ID of the payment to cancel.public CompletePaymentResponse completePayment(String paymentId, CompletePaymentRequest body) throws ApiException, IOException
completePayment in interface PaymentsApipaymentId - 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.public CompletableFuture<CompletePaymentResponse> completePaymentAsync(String paymentId, CompletePaymentRequest body)
completePaymentAsync in interface PaymentsApipaymentId - 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 © 2023. All rights reserved.