Olo Digital Wallets SDK
Welcome to the Olo Digital Wallets Android SDK
The Olo Digital Wallets SDK provides a simple and easy way to add digital wallet (Google Pay) payments to your app.
The primary purpose of the SDK is to facilitate payments with Olo's ordering ecosystem. It should be able to facilitate payments with any processor that accepts Google Pay, but functionality outside of Olo's ordering ecosystem has not been tested and is not guaranteed.
Useful Links:
Setup
The easiest way to get set up with using the Olo Digital Wallets SDK is to add it as a dependency in your build.gradle file, replacing X.Y.Z with the version of the SDK you want to use.
implementation 'com.olo.pay:digitalwallets-android-sdk:X.Y.Z'Getting Started
The Olo Digital Wallets SDK provides a simple way to get payment data needed for processing payments with Google Pay. This section provides a high-level description of how to use the SDK in your app.
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>Content copied to clipboardCreate a Configuration instance to configure Google Pay payments
Create a GooglePayLauncher instance and provide the configuration from the previous step
Create a Google Pay Button and add it to the app
See GooglePayButton (or use
PayButtondirectly)When the button is clicked, present the Google Pay Sheet using GooglePayLauncher.present()
Important: If Google Pay isn't ready at the time present() is called, an exception will be thrown.
Retrieve the Result created by GooglePayLauncher
Submit the Result data for payment processing (commonly the Basket Submit endpoint of the Ordering API)