Class AdyenCloudTerminal

java.lang.Object
com.codename1.payment.terminal.PaymentTerminal
com.codename1.payment.terminal.adyen.AdyenCloudTerminal
Direct Known Subclasses:
AdyenLocalTerminal

public class AdyenCloudTerminal extends PaymentTerminal

Any Adyen payment terminal, through Adyen's cloud Terminal API.

Each payment is one synchronous PaymentRequest to Adyen's /sync endpoint, answered once the customer has tapped (or after about 150 seconds). It is plain HTTPS and JSON, so it works on every platform -- the desktop ports, mobile and the web -- with no native SDK.

Credentials

The cloud Terminal API takes an API key, which must not ship in an app a customer can install. On a till you control, use a key whose only role is the Terminal API. Otherwise point setEndpoint(String) at your own server, which adds the key and forwards the body to Adyen.

String apiKey = null; // null: your endpoint adds the key
AdyenCloudTerminal terminal = new AdyenCloudTerminal(apiKey, "POS-1", "V400m-346403161");
terminal.collect(new TerminalPaymentRequest(1099, "EUR").setReference("order-7"))
        .ready(result -> System.out.println(result));

Starts against Adyen's test environment; call setLive(boolean) for production.

What else it does
  • Pre-authorizations (authorisationType=PreAuth); capture them from your server with Adyen's Checkout API, which needs the secret key this class must not hold.
  • reverse(String) reverses a payment by its PSP reference.
  • refund(TerminalRefundRequest) refunds a payment by its PSP reference, or, without one, pays the amount to whichever card is presented (an unlinked refund, which the merchant account must allow).
  • Tipping on the terminal and cashback.
  • lookup(String) asks the terminal what became of a payment this object started, by its reference.
  • Receipt lines and card fields from the terminal's PaymentReceipt.
  • Constructor Details

    • AdyenCloudTerminal

      public AdyenCloudTerminal(String apiKey, String saleId, String poiId)
      Parameters
      • apiKey: the Terminal API key, sent as X-API-Key; may be null when the transport or your own server authenticates instead

      • saleId: your identifier for this point of sale, such as a till number

      • poiId: the terminal's ID, [model]-[serial number]

  • Method Details