Package com.olo.olopay.googlepay

Classes for adding Google Pay support to your app.


Setting up Google Pay

  1. Enable Google Pay in your app manifest in the application tag

     <application>
    ...
    <meta-data
    android:name="com.google.android.gms.wallet.api.enabled"
    android:value="true" />
    </application>
  2. Implement Google Pay: Refer to GooglePayContext SDK documentation for implementation details

  3. Build and test your app with the Google Pay Test environment

  4. Reach out to Google Support and send the APK built with the Test environment when requested

    • Google assesses the app and provides feedback if needed

    • Google provides instructions on how to agree to their Terms of Service and ensure production access is granted

  5. Send your final production APK using the Google Pay Production environment to Google for a real-world test which includes a few transactions

  6. If all tests pass, Google clears you to publish the APK

  7. Notify Google when your APK is 100% visible to users

Types

Config
Link copied to clipboard
data class Config @JvmOverloads constructor(environment: Environment, companyName: String, companyCountryCode: String, existingPaymentMethodRequired: Boolean, emailRequired: Boolean, phoneNumberRequired: Boolean, addressFormat: Config.AddressFormat)

Google Pay Configuration class

Environment
Link copied to clipboard
enum Environment : Enum<Environment>

Enum for determining what environment Google Pay will use

GooglePayContext
Link copied to clipboard
class GooglePayContext : IGooglePayContext

A drop-in class that presents a Google Pay sheet to collect a customer's payment details. When successful, will return an IPaymentMethod via Result.Completed.paymentMethod

GooglePayErrorType
Link copied to clipboard
enum GooglePayErrorType : Enum<GooglePayErrorType>

An enum representing types of Google Pay Errors

IGooglePayContext
Link copied to clipboard
interface IGooglePayContext

Interface for mocking/testing purposes

ReadyCallback
Link copied to clipboard
fun interface ReadyCallback

Callback to know when Google Pay is ready

Result
Link copied to clipboard
sealed class Result : Parcelable

Result class for generating payment methods via Google Pay

ResultCallback
Link copied to clipboard
fun interface ResultCallback

Callback for Google Pay results