Creating a PaymentsClient instance

Create an instance of PaymentsClient in the onCreate method of your Activity to allow interaction with the PaymentsClient API.

private fun initPaymentsClient(activity: Activity, mode: String): PaymentsClient {
	val builder = Wallet.WalletOptions.Builder()
	if (mode == "TEST") {             
	} else {             
	return Wallet.getPaymentsClient(activity,

During the integration phase, if you are using the sample code, the PAYMENT_MODE variable must be set to TEST in the MainActivity.kt file.