Interface TapToPayBridge
What a port implements to read a card with the phone itself. Not for
applications, which use com.codename1.payment.terminal.tap.TapToPay.
Ports answer every request through
com.codename1.payment.terminal.tap.TapToPayCallbacks, from any thread;
the callbacks move to the EDT themselves.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcancel(int requestId) Cancels the collectionrequestIdif it is still waiting for a card.voidcollect(int requestId, String clientSecret, long amount, String currency, String locationId, String merchantDisplayName, boolean simulated) Takes one payment: set up the SDK if needed, connect the phone as a reader atlocationId, retrieve the PaymentIntent and collect and confirm it.voidconnectionTokenReady(int tokenRequestId, String token, String error) Answers aTapToPayCallbacks.fetchConnectionTokenrequest.booleanTrue when this device can read a card at all (the right hardware and OS version, NFC present).
-
Method Details
-
isDeviceSupported
boolean isDeviceSupported()True when this device can read a card at all (the right hardware and OS version, NFC present). Answers quickly, with no network.
Returns
whether Tap to Pay can run here
-
collect
void collect(int requestId, String clientSecret, long amount, String currency, String locationId, String merchantDisplayName, boolean simulated) Takes one payment: set up the SDK if needed, connect the phone as a reader at
locationId, retrieve the PaymentIntent and collect and confirm it. Answered byTapToPayCallbacks.deliverResult.Parameters
-
requestId: echoed back with the outcome -
clientSecret: the PaymentIntent's client secret -
amount: the amount in minor units, as the app asked; the PaymentIntent is authoritative, this is for simulators and logs -
currency: the ISO 4217 code, as the app asked -
locationId: the Stripe location the phone acts as a reader for -
merchantDisplayName: the name on the payment sheet, or null -
simulated: connect Stripe's simulated reader instead of the phone
-
-
cancel
void cancel(int requestId) Cancels the collection
requestIdif it is still waiting for a card.Parameters
requestId: the request to cancel
-
connectionTokenReady
-