Class StripeReaderTerminal

java.lang.Object
com.codename1.payment.terminal.PaymentTerminal
com.codename1.payment.terminal.stripe.StripeReaderTerminal

public class StripeReaderTerminal extends PaymentTerminal

A Stripe smart reader (WisePOS E, S700, S710) on the counter, driven through Stripe's server-driven integration.

The reader is on the store's network and registered to a Stripe location; nothing here talks to it directly. Each payment is a request to Stripe's API that hands a PaymentIntent to the reader, followed by polling the reader's action until the customer has tapped. That is plain HTTPS, so this works on every platform -- the desktop ports, mobile and the web -- with no native SDK.

Credentials

Stripe's API takes a secret key, which must not ship in an app a customer can install. For a point-of-sale app on a till you control, use a restricted key limited to Terminal readers and PaymentIntents. Otherwise point setApiBase(String) at your own server, which adds the key and forwards the same paths to https://api.stripe.com -- the API key passed here can then be your own session token, or null.

String restrictedKey = null; // null: your server adds the key
StripeReaderTerminal reader = new StripeReaderTerminal("tmr_FDOt2wlRZEdpd7", restrictedKey);
reader.collect(new TerminalPaymentRequest(1250, "USD")).ready(result -> {
    if (result.isApproved()) {
        // Confirm result.getTransactionId() on your server, then fulfill.
    }
});

A request with a TerminalPaymentRequest.getProviderReference() uses that PaymentIntent (pi_...), created by your server, as it is: its amount, capture method and metadata are the server's. Without one, a card-present PaymentIntent is created first, with manual capture for a pre-authorization and the request's reference in its metadata, where lookup(String) finds it.

What else it does
  • capture(String, long, String) captures a pre-authorization.
  • reverse(String) cancels a PaymentIntent that is not captured yet.
  • refund(TerminalRefundRequest) refunds a payment by its PaymentIntent ID. Stripe refunds a card-present payment to the card without the reader, so unlinked refunds are not supported.
  • lookup(String) reads a PaymentIntent by ID (pi_...), or finds one by the reference a sale was started with. The ID is the reliable key: Stripe's search trails its writes by up to a minute, and a PaymentIntent your server created carries no reference unless it set metadata[reference].
  • Tipping on the reader needs a tipping configuration on the reader's Stripe location.

Settlement happens on Stripe's side, so there is no reconciliation, and cashback is not offered.