This example is an attempt to make a simple and more refined example of utilization the Google Pay API than in the google-pay/android-quickstart project (unfortunately, a lot of unstructured constants and json-objects (that can be encapsulated) might confuse a beginner).
This example is suitable for digital purchases when you decide to use your bank's processing. For start payment you should
/* get this data from your bank */
val merchantData = MerchantData(
merchantName = "example",
gateway = "example",
gatewayMerchantId = "example"
)
/* data about current item payment */
val paymentRequest = PaymentRequest(
itemToBuy.name, itemToBuy.description, itemToBuy.priceCents,
"USD", "US"
)
/* start Activity and enjoy */
PaymentActivity.openPaymentActivity(
applicationContext,
merchantData,
paymentRequest,
isTest
)