Class HttpTerminalTransport
- All Implemented Interfaces:
TerminalTransport
The default TerminalTransport, over ConnectionRequest.
Error statuses are answered like any other: a provider's error body is what says why a request failed, so it is read and handed on rather than turned into a dialog.
-
Nested Class Summary
Nested classes/interfaces inherited from interface TerminalTransport
TerminalTransport.Callback -
Field Summary
Fields inherited from interface TerminalTransport
IGNORE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidsend(String method, String url, Map<String, String> headers, String contentType, String body, TerminalTransport.Callback callback) Performs one request.voidsetInsecure(boolean insecure) Makes sure a request can run while a long one holds a network thread.voidsetTimeout(int timeout) The read timeout in milliseconds.
-
Constructor Details
-
HttpTerminalTransport
public HttpTerminalTransport()
-
-
Method Details
-
setTimeout
public void setTimeout(int timeout) The read timeout in milliseconds. Defaults to three minutes, because a synchronous terminal request is answered only once the customer has tapped (Adyen's
/syncwaits up to 150 seconds).Parameters
timeout: the timeout in milliseconds
-
setInsecure
public void setInsecure(boolean insecure) Makes sure a request can run while a long one holds a network thread. Adyen's
/syncpayment stays open until the customer taps; with the default single network thread, the abort that cancels it would wait behind it and arrive only after the payment had ended, and every other request of the app would wait too. Raises the thread count to two, only while the queue is idle, because restarting the threads drops whatever they are running. The count stays at two afterwards.Returns
true when two or more network threads are running Skips the platform's certificate check, for a terminal on the shop's network whose certificate names no host a device can verify. Only for a protocol that authenticates its messages itself, as Adyen's local Terminal API does with its shared key: without that, anyone on the network could answer in the terminal's place.
Parameters
insecure: true to skip the check
-
prepareForLongRequest
public boolean prepareForLongRequest() -
send
public void send(String method, String url, Map<String, String> headers, String contentType, String body, TerminalTransport.Callback callback) Description copied from interface:TerminalTransportPerforms one request. Exactly one of the callback's methods must be called, on the EDT.
Parameters
-
method:GETorPOST -
url: the absolute URL -
headers: request headers; may be empty, never null -
contentType: the body's content type, or null for a bodiless request -
body: the request body, or null -
callback: receives the outcome
- Specified by:
sendin interfaceTerminalTransport
-
-