hasGooglePayJava

fun hasGooglePayJava(context: Context, supportedNetworks: List<PaymentMethodType>, authenticationMethods: List<GooglePayConfig.AuthenticationMethodType>, existingPaymentMethodRequired: Boolean, areCreditCardsAllowed: Boolean, arePrepaidCardsAllowed: Boolean, isTesting: Boolean): LiveData<Boolean>

As the Kotlin version uses coroutines because the Google's method to check availability is asynchronous, this is a workaround of the same method but for Java developers.

Return

A LiveData object which is true if Google Pay is available on the device and false if it is unavailable.

Parameters

context

Android context

supportedNetworks

Supported card acquirers

authenticationMethods

Supported authentication methods (e.g. PAN_ONLY)

existingPaymentMethodRequired

If user has to have a payment method already added to Google Wallet (default is false)

areCreditCardsAllowed

If credit cards are allowed (default is true)

arePrepaidCardsAllowed

If prepaid cards are allowed (default is true)

isTesting

True if running on sandbox, false otherwise. (default is false)