Interface PaymentsClient
- All Superinterfaces:
AutoCloseable,AwsClient,SdkAutoCloseable,SdkClient
builder() method.
Amazon Web Services Payments manages how money moves between you and Amazon Web Services. It holds the payment instruments you use to pay Amazon Web Services and to receive money from Amazon Web Services, such as cards and bank accounts. It collects payment for your Amazon Web Services invoices, applies your payments and credit memos to them, and returns refunds.
A payment instrument is a channel that moves money between you and Amazon Web Services, and its payment method is the kind of instrument, such as a card or a bank account. A financial record is an invoice or credit memo. It shows how much of its amount is outstanding, processing, settled, and canceled as Amazon Web Services applies payments and credits.
With the Amazon Web Services Payments API, you can read your financial records and account balances, and read your payment instruments and their status.
The Amazon Web Services Payments API provides the following endpoint:
https://payments.us-east-1.api.aws
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringValue for looking up the service's metadata from theServiceMetadataProvider.static final String -
Method Summary
Modifier and TypeMethodDescriptiondefault BatchGetFinancialRecordResponsebatchGetFinancialRecord(Consumer<BatchGetFinancialRecordRequest.Builder> batchGetFinancialRecordRequest) Retrieves up to 100 financial records in one request, including the details that are specific to each record's type.default BatchGetFinancialRecordResponsebatchGetFinancialRecord(BatchGetFinancialRecordRequest batchGetFinancialRecordRequest) Retrieves up to 100 financial records in one request, including the details that are specific to each record's type.static PaymentsClientBuilderbuilder()Create a builder that can be used to configure and create aPaymentsClient.static PaymentsClientcreate()Create aPaymentsClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider.default GetAccountBalanceResponsegetAccountBalance(Consumer<GetAccountBalanceRequest.Builder> getAccountBalanceRequest) Retrieves one balance of your account, selected by balance type, as one amount for each merchant of record and currency.default GetAccountBalanceResponsegetAccountBalance(GetAccountBalanceRequest getAccountBalanceRequest) Retrieves one balance of your account, selected by balance type, as one amount for each merchant of record and currency.default GetAccountBalanceIterablegetAccountBalancePaginator(Consumer<GetAccountBalanceRequest.Builder> getAccountBalanceRequest) This is a variant ofgetAccountBalance(software.amazon.awssdk.services.payments.model.GetAccountBalanceRequest)operation.default GetAccountBalanceIterablegetAccountBalancePaginator(GetAccountBalanceRequest getAccountBalanceRequest) This is a variant ofgetAccountBalance(software.amazon.awssdk.services.payments.model.GetAccountBalanceRequest)operation.default GetFinancialRecordResponsegetFinancialRecord(Consumer<GetFinancialRecordRequest.Builder> getFinancialRecordRequest) Retrieves a single financial record, including the details that are specific to its type.default GetFinancialRecordResponsegetFinancialRecord(GetFinancialRecordRequest getFinancialRecordRequest) Retrieves a single financial record, including the details that are specific to its type.default GetPaymentInstrumentResponsegetPaymentInstrument(Consumer<GetPaymentInstrumentRequest.Builder> getPaymentInstrumentRequest) Retrieves a payment instrument on your account, including the details that are specific to its payment method, such as a card's last four digits.default GetPaymentInstrumentResponsegetPaymentInstrument(GetPaymentInstrumentRequest getPaymentInstrumentRequest) Retrieves a payment instrument on your account, including the details that are specific to its payment method, such as a card's last four digits.default ListFinancialRecordsResponselistFinancialRecords(Consumer<ListFinancialRecordsRequest.Builder> listFinancialRecordsRequest) Lists the financial records on your account, with the newest first by default.default ListFinancialRecordsResponselistFinancialRecords(ListFinancialRecordsRequest listFinancialRecordsRequest) Lists the financial records on your account, with the newest first by default.default ListFinancialRecordsIterablelistFinancialRecordsPaginator(Consumer<ListFinancialRecordsRequest.Builder> listFinancialRecordsRequest) This is a variant oflistFinancialRecords(software.amazon.awssdk.services.payments.model.ListFinancialRecordsRequest)operation.default ListFinancialRecordsIterablelistFinancialRecordsPaginator(ListFinancialRecordsRequest listFinancialRecordsRequest) This is a variant oflistFinancialRecords(software.amazon.awssdk.services.payments.model.ListFinancialRecordsRequest)operation.default ListPaymentInstrumentsResponselistPaymentInstruments(Consumer<ListPaymentInstrumentsRequest.Builder> listPaymentInstrumentsRequest) Lists the payment instruments on your account.default ListPaymentInstrumentsResponselistPaymentInstruments(ListPaymentInstrumentsRequest listPaymentInstrumentsRequest) Lists the payment instruments on your account.default ListPaymentInstrumentsIterablelistPaymentInstrumentsPaginator(Consumer<ListPaymentInstrumentsRequest.Builder> listPaymentInstrumentsRequest) This is a variant oflistPaymentInstruments(software.amazon.awssdk.services.payments.model.ListPaymentInstrumentsRequest)operation.default ListPaymentInstrumentsIterablelistPaymentInstrumentsPaginator(ListPaymentInstrumentsRequest listPaymentInstrumentsRequest) This is a variant oflistPaymentInstruments(software.amazon.awssdk.services.payments.model.ListPaymentInstrumentsRequest)operation.The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfigurationstatic ServiceMetadataMethods inherited from interface software.amazon.awssdk.utils.SdkAutoCloseable
closeMethods inherited from interface software.amazon.awssdk.core.SdkClient
serviceName
-
Field Details
-
SERVICE_NAME
- See Also:
-
SERVICE_METADATA_ID
Value for looking up the service's metadata from theServiceMetadataProvider.- See Also:
-
-
Method Details
-
batchGetFinancialRecord
default BatchGetFinancialRecordResponse batchGetFinancialRecord(BatchGetFinancialRecordRequest batchGetFinancialRecordRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, PaymentsException Retrieves up to 100 financial records in one request, including the details that are specific to each record's type. Identify each record by its ID or by its invoice ID. Results can be partial: each key that you request appears once in the response, either as a record in
financialRecordsor as an error inerrors. A key that matches no record on your account is returned inerrorsand doesn't fail the request. This operation provides strongly consistent reads.To use this operation, you must have Amazon Web Services Identity and Access Management (IAM) permission for both
payments:BatchGetFinancialRecordandpayments:GetPaymentStatus.- Parameters:
batchGetFinancialRecordRequest-- Returns:
- Result of the BatchGetFinancialRecord operation returned by the service.
- See Also:
-
batchGetFinancialRecord
default BatchGetFinancialRecordResponse batchGetFinancialRecord(Consumer<BatchGetFinancialRecordRequest.Builder> batchGetFinancialRecordRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, PaymentsException Retrieves up to 100 financial records in one request, including the details that are specific to each record's type. Identify each record by its ID or by its invoice ID. Results can be partial: each key that you request appears once in the response, either as a record in
financialRecordsor as an error inerrors. A key that matches no record on your account is returned inerrorsand doesn't fail the request. This operation provides strongly consistent reads.To use this operation, you must have Amazon Web Services Identity and Access Management (IAM) permission for both
payments:BatchGetFinancialRecordandpayments:GetPaymentStatus.
This is a convenience which creates an instance of the
BatchGetFinancialRecordRequest.Builderavoiding the need to create one manually viaBatchGetFinancialRecordRequest.builder()- Parameters:
batchGetFinancialRecordRequest- AConsumerthat will call methods onBatchGetFinancialRecordRequest.Builderto create a request.- Returns:
- Result of the BatchGetFinancialRecord operation returned by the service.
- See Also:
-
getAccountBalance
default GetAccountBalanceResponse getAccountBalance(GetAccountBalanceRequest getAccountBalanceRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, PaymentsException Retrieves one balance of your account, selected by balance type, as one amount for each merchant of record and currency. Each amount is the sum of the outstanding balances of your invoices or credit memos that have the status
OUTSTANDING. Amounts are never added together across merchants of record or currencies. This operation is eventually consistent. Results are paginated. UsenextTokento retrieve more results.To use this operation, you must have Amazon Web Services Identity and Access Management (IAM) permission for both
payments:GetAccountBalanceandpayments:GetPaymentStatus.- Parameters:
getAccountBalanceRequest-- Returns:
- Result of the GetAccountBalance operation returned by the service.
- See Also:
-
getAccountBalance
default GetAccountBalanceResponse getAccountBalance(Consumer<GetAccountBalanceRequest.Builder> getAccountBalanceRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, PaymentsException Retrieves one balance of your account, selected by balance type, as one amount for each merchant of record and currency. Each amount is the sum of the outstanding balances of your invoices or credit memos that have the status
OUTSTANDING. Amounts are never added together across merchants of record or currencies. This operation is eventually consistent. Results are paginated. UsenextTokento retrieve more results.To use this operation, you must have Amazon Web Services Identity and Access Management (IAM) permission for both
payments:GetAccountBalanceandpayments:GetPaymentStatus.
This is a convenience which creates an instance of the
GetAccountBalanceRequest.Builderavoiding the need to create one manually viaGetAccountBalanceRequest.builder()- Parameters:
getAccountBalanceRequest- AConsumerthat will call methods onGetAccountBalanceRequest.Builderto create a request.- Returns:
- Result of the GetAccountBalance operation returned by the service.
- See Also:
-
getAccountBalancePaginator
default GetAccountBalanceIterable getAccountBalancePaginator(GetAccountBalanceRequest getAccountBalanceRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, PaymentsException This is a variant of
getAccountBalance(software.amazon.awssdk.services.payments.model.GetAccountBalanceRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.payments.paginators.GetAccountBalanceIterable responses = client.getAccountBalancePaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.payments.paginators.GetAccountBalanceIterable responses = client .getAccountBalancePaginator(request); for (software.amazon.awssdk.services.payments.model.GetAccountBalanceResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.payments.paginators.GetAccountBalanceIterable responses = client.getAccountBalancePaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
getAccountBalance(software.amazon.awssdk.services.payments.model.GetAccountBalanceRequest)operation.- Parameters:
getAccountBalanceRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
getAccountBalancePaginator
default GetAccountBalanceIterable getAccountBalancePaginator(Consumer<GetAccountBalanceRequest.Builder> getAccountBalanceRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, PaymentsException This is a variant of
getAccountBalance(software.amazon.awssdk.services.payments.model.GetAccountBalanceRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.payments.paginators.GetAccountBalanceIterable responses = client.getAccountBalancePaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.payments.paginators.GetAccountBalanceIterable responses = client .getAccountBalancePaginator(request); for (software.amazon.awssdk.services.payments.model.GetAccountBalanceResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.payments.paginators.GetAccountBalanceIterable responses = client.getAccountBalancePaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
getAccountBalance(software.amazon.awssdk.services.payments.model.GetAccountBalanceRequest)operation.
This is a convenience which creates an instance of the
GetAccountBalanceRequest.Builderavoiding the need to create one manually viaGetAccountBalanceRequest.builder()- Parameters:
getAccountBalanceRequest- AConsumerthat will call methods onGetAccountBalanceRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
getFinancialRecord
default GetFinancialRecordResponse getFinancialRecord(GetFinancialRecordRequest getFinancialRecordRequest) throws InternalServerException, ResourceNotFoundException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, PaymentsException Retrieves a single financial record, including the details that are specific to its type. Specify exactly one of the following:
-
The ID that Amazon Web Services Payments issued for the record, in
identifier. -
The invoice ID that Amazon Web Services Invoicing issued for an invoice or a credit memo, in
invoiceIdentifier.
If you specify both or neither, the request fails with
ValidationException. If no record on your account matches, the request fails withResourceNotFoundException.This operation provides strongly consistent reads.
To use this operation, you must have Amazon Web Services Identity and Access Management (IAM) permission for both
payments:GetFinancialRecordandpayments:GetPaymentStatus.- Parameters:
getFinancialRecordRequest-- Returns:
- Result of the GetFinancialRecord operation returned by the service.
- See Also:
-
-
getFinancialRecord
default GetFinancialRecordResponse getFinancialRecord(Consumer<GetFinancialRecordRequest.Builder> getFinancialRecordRequest) throws InternalServerException, ResourceNotFoundException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, PaymentsException Retrieves a single financial record, including the details that are specific to its type. Specify exactly one of the following:
-
The ID that Amazon Web Services Payments issued for the record, in
identifier. -
The invoice ID that Amazon Web Services Invoicing issued for an invoice or a credit memo, in
invoiceIdentifier.
If you specify both or neither, the request fails with
ValidationException. If no record on your account matches, the request fails withResourceNotFoundException.This operation provides strongly consistent reads.
To use this operation, you must have Amazon Web Services Identity and Access Management (IAM) permission for both
payments:GetFinancialRecordandpayments:GetPaymentStatus.
This is a convenience which creates an instance of the
GetFinancialRecordRequest.Builderavoiding the need to create one manually viaGetFinancialRecordRequest.builder()- Parameters:
getFinancialRecordRequest- AConsumerthat will call methods onGetFinancialRecordRequest.Builderto create a request.- Returns:
- Result of the GetFinancialRecord operation returned by the service.
- See Also:
-
-
getPaymentInstrument
default GetPaymentInstrumentResponse getPaymentInstrument(GetPaymentInstrumentRequest getPaymentInstrumentRequest) throws InternalServerException, ResourceNotFoundException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, PaymentsException Retrieves a payment instrument on your account, including the details that are specific to its payment method, such as a card's last four digits. Identify the instrument by its Amazon Resource Name (ARN) or by its ID.
ListPaymentInstrumentsreturns both.To use this operation, you must have Amazon Web Services Identity and Access Management (IAM) permission for
payments:GetPaymentInstrument. You can scope this permission to the instrument's ARN.- Parameters:
getPaymentInstrumentRequest-- Returns:
- Result of the GetPaymentInstrument operation returned by the service.
- See Also:
-
getPaymentInstrument
default GetPaymentInstrumentResponse getPaymentInstrument(Consumer<GetPaymentInstrumentRequest.Builder> getPaymentInstrumentRequest) throws InternalServerException, ResourceNotFoundException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, PaymentsException Retrieves a payment instrument on your account, including the details that are specific to its payment method, such as a card's last four digits. Identify the instrument by its Amazon Resource Name (ARN) or by its ID.
ListPaymentInstrumentsreturns both.To use this operation, you must have Amazon Web Services Identity and Access Management (IAM) permission for
payments:GetPaymentInstrument. You can scope this permission to the instrument's ARN.
This is a convenience which creates an instance of the
GetPaymentInstrumentRequest.Builderavoiding the need to create one manually viaGetPaymentInstrumentRequest.builder()- Parameters:
getPaymentInstrumentRequest- AConsumerthat will call methods onGetPaymentInstrumentRequest.Builderto create a request.- Returns:
- Result of the GetPaymentInstrument operation returned by the service.
- See Also:
-
listFinancialRecords
default ListFinancialRecordsResponse listFinancialRecords(ListFinancialRecordsRequest listFinancialRecordsRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, PaymentsException Lists the financial records on your account, with the newest first by default. A financial record is an invoice or a credit memo. You must specify at least one record type in
types. You can narrow the results further by settlement status and issue date. This operation returns summaries. To get the details that are specific to a record's type, useGetFinancialRecordorBatchGetFinancialRecord. Results are paginated. UsenextTokento retrieve more results.To use this operation, you must have Amazon Web Services Identity and Access Management (IAM) permission for both
payments:ListFinancialRecordsandpayments:GetPaymentStatus.- Parameters:
listFinancialRecordsRequest-- Returns:
- Result of the ListFinancialRecords operation returned by the service.
- See Also:
-
listFinancialRecords
default ListFinancialRecordsResponse listFinancialRecords(Consumer<ListFinancialRecordsRequest.Builder> listFinancialRecordsRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, PaymentsException Lists the financial records on your account, with the newest first by default. A financial record is an invoice or a credit memo. You must specify at least one record type in
types. You can narrow the results further by settlement status and issue date. This operation returns summaries. To get the details that are specific to a record's type, useGetFinancialRecordorBatchGetFinancialRecord. Results are paginated. UsenextTokento retrieve more results.To use this operation, you must have Amazon Web Services Identity and Access Management (IAM) permission for both
payments:ListFinancialRecordsandpayments:GetPaymentStatus.
This is a convenience which creates an instance of the
ListFinancialRecordsRequest.Builderavoiding the need to create one manually viaListFinancialRecordsRequest.builder()- Parameters:
listFinancialRecordsRequest- AConsumerthat will call methods onListFinancialRecordsRequest.Builderto create a request.- Returns:
- Result of the ListFinancialRecords operation returned by the service.
- See Also:
-
listFinancialRecordsPaginator
default ListFinancialRecordsIterable listFinancialRecordsPaginator(ListFinancialRecordsRequest listFinancialRecordsRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, PaymentsException This is a variant of
listFinancialRecords(software.amazon.awssdk.services.payments.model.ListFinancialRecordsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.payments.paginators.ListFinancialRecordsIterable responses = client.listFinancialRecordsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.payments.paginators.ListFinancialRecordsIterable responses = client .listFinancialRecordsPaginator(request); for (software.amazon.awssdk.services.payments.model.ListFinancialRecordsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.payments.paginators.ListFinancialRecordsIterable responses = client.listFinancialRecordsPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listFinancialRecords(software.amazon.awssdk.services.payments.model.ListFinancialRecordsRequest)operation.- Parameters:
listFinancialRecordsRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listFinancialRecordsPaginator
default ListFinancialRecordsIterable listFinancialRecordsPaginator(Consumer<ListFinancialRecordsRequest.Builder> listFinancialRecordsRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, PaymentsException This is a variant of
listFinancialRecords(software.amazon.awssdk.services.payments.model.ListFinancialRecordsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.payments.paginators.ListFinancialRecordsIterable responses = client.listFinancialRecordsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.payments.paginators.ListFinancialRecordsIterable responses = client .listFinancialRecordsPaginator(request); for (software.amazon.awssdk.services.payments.model.ListFinancialRecordsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.payments.paginators.ListFinancialRecordsIterable responses = client.listFinancialRecordsPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listFinancialRecords(software.amazon.awssdk.services.payments.model.ListFinancialRecordsRequest)operation.
This is a convenience which creates an instance of the
ListFinancialRecordsRequest.Builderavoiding the need to create one manually viaListFinancialRecordsRequest.builder()- Parameters:
listFinancialRecordsRequest- AConsumerthat will call methods onListFinancialRecordsRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listPaymentInstruments
default ListPaymentInstrumentsResponse listPaymentInstruments(ListPaymentInstrumentsRequest listPaymentInstrumentsRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, PaymentsException Lists the payment instruments on your account. This operation returns summaries. To get the details that are specific to an instrument's payment method, use
GetPaymentInstrument. Results are paginated. UsenextTokento retrieve more results.To use this operation, you must have Amazon Web Services Identity and Access Management (IAM) permission for
payments:ListPaymentInstruments.- Parameters:
listPaymentInstrumentsRequest-- Returns:
- Result of the ListPaymentInstruments operation returned by the service.
- See Also:
-
listPaymentInstruments
default ListPaymentInstrumentsResponse listPaymentInstruments(Consumer<ListPaymentInstrumentsRequest.Builder> listPaymentInstrumentsRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, PaymentsException Lists the payment instruments on your account. This operation returns summaries. To get the details that are specific to an instrument's payment method, use
GetPaymentInstrument. Results are paginated. UsenextTokento retrieve more results.To use this operation, you must have Amazon Web Services Identity and Access Management (IAM) permission for
payments:ListPaymentInstruments.
This is a convenience which creates an instance of the
ListPaymentInstrumentsRequest.Builderavoiding the need to create one manually viaListPaymentInstrumentsRequest.builder()- Parameters:
listPaymentInstrumentsRequest- AConsumerthat will call methods onListPaymentInstrumentsRequest.Builderto create a request.- Returns:
- Result of the ListPaymentInstruments operation returned by the service.
- See Also:
-
listPaymentInstrumentsPaginator
default ListPaymentInstrumentsIterable listPaymentInstrumentsPaginator(ListPaymentInstrumentsRequest listPaymentInstrumentsRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, PaymentsException This is a variant of
listPaymentInstruments(software.amazon.awssdk.services.payments.model.ListPaymentInstrumentsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.payments.paginators.ListPaymentInstrumentsIterable responses = client.listPaymentInstrumentsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.payments.paginators.ListPaymentInstrumentsIterable responses = client .listPaymentInstrumentsPaginator(request); for (software.amazon.awssdk.services.payments.model.ListPaymentInstrumentsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.payments.paginators.ListPaymentInstrumentsIterable responses = client.listPaymentInstrumentsPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listPaymentInstruments(software.amazon.awssdk.services.payments.model.ListPaymentInstrumentsRequest)operation.- Parameters:
listPaymentInstrumentsRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listPaymentInstrumentsPaginator
default ListPaymentInstrumentsIterable listPaymentInstrumentsPaginator(Consumer<ListPaymentInstrumentsRequest.Builder> listPaymentInstrumentsRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, PaymentsException This is a variant of
listPaymentInstruments(software.amazon.awssdk.services.payments.model.ListPaymentInstrumentsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.payments.paginators.ListPaymentInstrumentsIterable responses = client.listPaymentInstrumentsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.payments.paginators.ListPaymentInstrumentsIterable responses = client .listPaymentInstrumentsPaginator(request); for (software.amazon.awssdk.services.payments.model.ListPaymentInstrumentsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.payments.paginators.ListPaymentInstrumentsIterable responses = client.listPaymentInstrumentsPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listPaymentInstruments(software.amazon.awssdk.services.payments.model.ListPaymentInstrumentsRequest)operation.
This is a convenience which creates an instance of the
ListPaymentInstrumentsRequest.Builderavoiding the need to create one manually viaListPaymentInstrumentsRequest.builder()- Parameters:
listPaymentInstrumentsRequest- AConsumerthat will call methods onListPaymentInstrumentsRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
create
Create aPaymentsClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider. -
builder
Create a builder that can be used to configure and create aPaymentsClient. -
serviceMetadata
-
serviceClientConfiguration
Description copied from interface:SdkClientThe SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfiguration- Specified by:
serviceClientConfigurationin interfaceAwsClient- Specified by:
serviceClientConfigurationin interfaceSdkClient- Returns:
- SdkServiceClientConfiguration
-