Skip to content

Instantly share code, notes, and snippets.

@hitherejoe
Last active January 3, 2019 13:52
Show Gist options
  • Save hitherejoe/80a5206f562a5ed00e7d5cc93273ced4 to your computer and use it in GitHub Desktop.
Save hitherejoe/80a5206f562a5ed00e7d5cc93273ced4 to your computer and use it in GitHub Desktop.
val request = IsReadyToPayRequest.fromJson(isReadyToPayRequest.toString())
request?.let {
val task = paymentsClient?.isReadyToPay(request)
task?.addOnCompleteListener { completedTask ->
val result = completedTask.getResult(ApiException::class.java)
result?.let {
button_google_pay.setOnClickListener { view -> requestPayment(view) }
button_google_pay.visibility = View.VISIBLE
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment