@ExperimentalCoroutinesApi
public class PaymentStream
Abstract class containing communication streams for transaction events
public PaymentStream(@NotNull kotlinx.coroutines.channels.SendChannel<? super io.ktor.http.cio.websocket.Frame> outgoing, @NotNull kotlinx.coroutines.channels.ReceiveChannel<? extends io.ktor.http.cio.websocket.Frame> incoming)
Abstract class containing communication streams for transaction events
outgoing
- a channel that will send messages to a remote host.incoming
- a channel that will receive message from a remote host.@NotNull public kotlinx.coroutines.channels.BroadcastChannel<com.worldpay.websocket.api.payment.PaymentEvent> getEvents()
Received from the remote system.
@Nullable public java.lang.Object sendActionConfirmation(@NotNull PaymentActionComplete action, @NotNull kotlin.coroutines.Continuation<? super kotlin.Unit> p)
A queue for sending information back to the remote system in response to events.
@Nullable public java.lang.Object abortPayment(@NotNull PaymentAbort abort, @NotNull kotlin.coroutines.Continuation<? super kotlin.Unit> p)
Abort an in-flight payment.
abort
- the PaymentAbort object holding merchant's transaction reference.@Nullable public java.lang.Object proceedWithPayment(@NotNull CardPaymentRequest payment, @NotNull kotlin.coroutines.Continuation<? super kotlin.Unit> p)
Proceed with the payment of a previous CardCheckPayment request.
payment
- the payment to be made after a check card with payment.@NotNull public kotlinx.coroutines.CompletableDeferred<com.worldpay.error.UnhandledError> getError()
Will complete with the exception UnhandledError
with the reason for the error or exception ServerError
if the server reports an Error.
exception UnhandledError
,
exception ServerError
@Nullable public java.lang.Object close(@Nullable UnhandledError failure, @NotNull kotlin.coroutines.Continuation<? super kotlin.Unit> p)
Attempts to normally close down this payment stream.
failure
- an optional exception UnhandledError
that will be returned in the error property.