public class TransactionServiceProvider extends AbstractServiceProvider
InteractiveTransactiongameClient| Constructor and Description |
|---|
TransactionServiceProvider(GameClient gameClient)
Initializes a new
TransactionServiceProvider. |
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Boolean> |
capture(String transactionID)
Attempt to complete a spark transaction from the participant that initiated the transaction.
|
equals, hashCodepublic TransactionServiceProvider(GameClient gameClient)
TransactionServiceProvider.gameClient - The GameClient that owns this service providerpublic CompletableFuture<Boolean> capture(String transactionID)
Attempt to complete a spark transaction from the participant that initiated the transaction. The Interactive service makes a best-effort to validate the charge before it’s created, blocking obviously invalid ones outright, but when possible the client SHOULD await a successful reply before effecting any associated action.
The result of the CompletableFuture may include checked exceptions that were thrown in the event
that there was a problem with the reply from the Interactive service. Specifically, two types of checked
exceptions may be thrown:
InteractiveRequestNoReplyException may be thrown if no reply is received from the Interactive
service.InteractiveReplyWithErrorException may be thrown if the reply received from the Interactive service
contains an InteractiveError.Considerations should be made for these possibilities when interpreting the results of the returned
CompletableFuture.
transactionID - Identifier for a Spark transactionCompletableFuture that when complete returns true if the
capture method call completes with no errorsInteractiveControlInput,
InteractiveTransactionCopyright © 2018. All rights reserved.