Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public class AdyenLocalTerminal

  1. Object
  2. PaymentTerminal
  3. AdyenCloudTerminal
  4. AdyenLocalTerminal

Any Adyen payment terminal, reached directly over the shop’s network with Adyen’s local Terminal API – no internet round trip, so a sale keeps working when the till’s connection to Adyen is slow.

It speaks the same messages as AdyenCloudTerminal and does everything it does. The difference is the transport: each message is encrypted and authenticated with a key shared with the terminal, configured in the Customer Area under the terminal’s Integrations settings (key identifier, passphrase and version).

String passphrase = null; // load from secure storage, never ship it in code
AdyenLocalTerminal terminal = new AdyenLocalTerminal("192.168.1.40", "POS-1", "V400m-346403161",
        "mykey", passphrase, 1);
terminal.collect(new TerminalPaymentRequest(1099, "EUR").setReference("order-7"))
        .ready(result -> System.out.println(result));

Trust

The terminal answers HTTPS on port 8443 with a certificate issued by Adyen’s own authority to a name no device can resolve, so the platform’s certificate check is skipped. What proves that an answer came from the terminal is the message itself: every answer must carry an HMAC made with the shared key, and one that does not is rejected. Keep the passphrase out of the app’s code and storage a customer can read.

Constructors

public AdyenLocalTerminal(String host, String saleId, String poiId, String keyIdentifier, String passphrase, int keyVersion)

Methods

public void setTransport(TerminalTransport transport)Replaces the transport underneath the encryption; every message still goes through it encrypted.

Inherited methods

Constructor details

AdyenLocalTerminal

public AdyenLocalTerminal(String host, String saleId, String poiId, String keyIdentifier, String passphrase, int keyVersion)

Parameters

host String
the terminal’s IP address or host name on the shop network
saleId String
your identifier for this point of sale, such as a till number
poiId String
the terminal’s ID, [model]-[serial number]
keyIdentifier String
the shared key’s identifier
passphrase String
the shared key’s passphrase
keyVersion int
the shared key’s version

Method details

setTransport

public void setTransport(TerminalTransport transport)
Replaces the transport underneath the encryption; every message still goes through it encrypted.

Parameters

transport TerminalTransport
the transport