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

public interface PlatformPay.Provider

The wallet integration of a port that needs a dependency the port jar cannot carry. The Android build installs the Google Pay provider; apps and tests may install their own.

Methods

public abstract void isReadyToPay(String googlePayJson, boolean test, SuccessCallback<Boolean> callback)Answers whether the user can pay with the wallet.
public abstract void requestPayment(String googlePayJson, boolean test, SuccessCallback<String> callback)Shows the payment sheet.

Method details

isReadyToPay

public abstract void isReadyToPay(String googlePayJson, boolean test, SuccessCallback<Boolean> callback)
Answers whether the user can pay with the wallet.

Parameters

googlePayJson String
the Google Pay IsReadyToPayRequest JSON
test boolean
true for the wallet’s test environment
callback SuccessCallback<Boolean>
receives the answer

requestPayment

public abstract void requestPayment(String googlePayJson, boolean test, SuccessCallback<String> callback)
Shows the payment sheet.

Parameters

googlePayJson String
the Google Pay PaymentDataRequest JSON
test boolean
true for the wallet’s test environment
callback SuccessCallback<String>
receives the encoded result, see Result#decode(String)