NEXUS
Getting Started

Getting started with WAVit

From a fresh machine to a debug build of WAVit Payments on a Clover dev kit, a terminal set up against a test merchant, and a first test sale. Plan on about an hour. One step needs a teammate (setting up the terminal), so ask for it early.

Checked against master at 6653919 on .

What you need

WhatVersion or detailWhy
JDK17Gradle 7.6.4 does not run on newer JDKs, and the Clarity SDK ships Java 17 bytecode. The committed IDE settings call it ms-17.
Android StudioA release that supports Android Gradle Plugin 7.4.2To open and run CloverWAVitPayments/
Android SDKPlatform 31, plus the platform tools for adbcompileSdkVersion 31 in app/build.gradle (minSdk 17, targetSdk 29)
Gradle7.6.4, through the wrapperNothing to install
Clover dev kitActivated and logged into a Clover sandbox test merchantThe app reads the merchant and serial number from Clover at startup
AccessThe WavitSystems project in Azure DevOps, and a teammate who can set up terminals in the WAVit ConfiguratorTo clone the repo, and to give your dev kit its settings

Get the code

master is the main line: every change reaches it through a reviewed pull request, and the production pipeline builds each pull request into master. Branch from it as feature/<name>, or hotfix/<name> for a fix to a released version, and mention the work item as AB#<id> in your commit messages.

git clone https://micampdev.visualstudio.com/WavitSystems/_git/WAVitPayments
cd WAVitPayments
git switch -c feature/<short-name>
cd CloverWAVitPayments    # the Gradle project: open this folder in Android Studio

Point Gradle at JDK 17

The build does not pick a JDK for you, and the wrong one fails in a confusing way.

The shared gradle.properties leaves org.gradle.java.home out on purpose, because the path differs per machine. Set it in your own Gradle properties file, or choose a JDK 17 as the Gradle JDK in Android Studio. The pipelines get JDK 17 through JAVA_HOME instead.

%USERPROFILE%\.gradle\gradle.properties (your machine, not the repo)
org.gradle.java.home=C:/Users/<you>/.jdks/<jdk-17-folder>

Command-line builds also need to find the Android SDK. Android Studio writes local.properties the first time it opens the project, and the file is git-ignored. Without Android Studio, create it yourself:

CloverWAVitPayments/local.properties (git-ignored)
sdk.dir=<path to your Android SDK>
Check the toolchain
./gradlew --version
# Gradle 7.6.4
# JVM:          17.x    <- this line must say 17

Pick the development flavor

FlavorApplication idTalks toUse it for
developmentcom.micamp.wavitpayments.devDev MiPoint API, the PaymentsAgent test instance, Clover sandbox, Citcon UAT and DealerTrack staging. IS_PRODUCTION is false.All local work, as developmentDebug
productioncom.wavit.prodThe production instance of each of those. IS_PRODUCTION is true.Release builds from the pipeline

Each base URL is a buildConfigField. The values sit in the ext block of the root build.gradle and are mapped into the two flavors in app/build.gradle. Read them through BuildConfig (for example BuildConfig.TOKEN_API_BASE_URL) rather than writing a host into the code. The two application ids differ, so both flavors can be installed on one device side by side.

Signing and keys

A debug build needs no keystore, properties file or secret. The debug signing config in app/build.gradle sets no keystore, so Gradle signs with the default Android debug key on your machine, with v1 signing on and v2 off as Clover requires.

Release builds are signed only when the WAVIT_* environment variables are set, which the pipelines do. You do not need a release build for this guide; Signing on the Resources page covers it.

Build and install

  1. 1
    Connect the dev kitPlug it in over USB and check that adb devices lists it.
  2. 2
    BuildassembleDevelopmentDebug writes app/build/outputs/apk/development/debug/app-development-debug.apk. The first build downloads the project's dependencies, so it takes a while.
  3. 3
    InstallinstallDevelopmentDebug builds and installs in one go. To install an APK you already have, use adb install -r.
  4. 4
    LaunchTap WAVit Payments on the device, or start the launcher activity, com.view.AnimatedSplashActivity, from adb.
From CloverWAVitPayments/
adb devices
./gradlew assembleDevelopmentDebug
./gradlew installDevelopmentDebug
adb shell am start -n com.micamp.wavitpayments.dev/com.view.AnimatedSplashActivity

On Windows the same commands work in PowerShell as .\gradlew, or as gradlew in cmd. In Android Studio, choose developmentDebug in the Build Variants panel, pick the dev kit as the target and press Run.

Your first test sale

The terminal takes no payment until the server knows it. The first launch tells you exactly what to ask for.

  1. 1
    Read the terminal's identityLaunch the app. A terminal that is not set up yet stops at Device Not Set Up and shows its serial number and the name and id of the Clover merchant it is logged into. Note all three.
  2. 2
    Have the terminal set upAsk the teammate who manages test merchants to add that serial number to a test merchant in the WAVit Configurator, for the environment the development flavor talks to, with the Clover Id set to the merchant id from the dialog. For a first sale ask for a plain terminal: integrationType Standalone, integrated off, and a Card tender enabled.
  3. 3
    RetryTap Retry. The app trades the serial number for a device token (POST api/authenticate), loads the settings (GET api/SqlConfig), checks the Clover Id and lands on the idle tap-to-start screen.
  4. 4
    Key in an amountTap the screen, and enter a PIN or employee ID if the settings ask for one. The keypad works in cents, so 1, 0, 0 is $1.00. The invoice number is on and required by default (includeInvoice, invoiceRequired), so type any test reference, then tap Next.
  5. 5
    PayPick a tip if tipping is on, check the totals on the Review screen, choose the card tender and tap Pay. Clover's payment screen takes over: present a test card that works with your sandbox merchant.
  6. 6
    Sign and finishSign on WAVit's own signature pad (skipped when disableSignature is on), then choose None or Print on the receipt screen. The app goes back to the idle screen.
  7. 7
    Check the resultOpen the menu and choose Transactions. The sale is listed from Clover's payment history, with its status from the dev MiPoint API.

Run the tests

On master the only test is ExampleUnitTest. The real suites (JUnit tests for the money maths and Espresso tests for single screens) live on the espressoTesting branch, which is not merged yet. Switch to it to run them.

From CloverWAVitPayments/
git switch espressoTesting
./gradlew testDevelopmentDebugUnitTest                 # JVM, no device
./gradlew testDevelopmentDebugUnitTest --tests "com.base.CalculationTest"
./gradlew connectedDevelopmentDebugAndroidTest         # device or emulator, online
./gradlew connectedDevelopmentDebugAndroidTest \
  -Pandroid.testInstrumentationRunnerArguments.class=com.view.TransactionActivityTest
  • Filter unit tests by the class's package, not its folder: every unit test sits under com/micamp/wavitpayments/, but CalculationTest and CalculationTipDiscountTest declare package com.base.
  • The Espresso tests seed Configuration with settings and launch one screen each, so they need no Clover merchant and run on an emulator. The keypad tests need a network connection.
  • The pipelines only assemble. Run both suites yourself before you open a pull request.

Troubleshooting

What you seeWhyWhat to do
Unsupported class file major version when Gradle startsGradle is running on a JDK newer than 17Set org.gradle.java.home, or choose JDK 17 as the Gradle JDK in Android Studio
Android Studio cannot find the Gradle JDK ms-17The committed .idea/gradle.xml names a JDK by that namePick any JDK 17 under Settings > Build, Execution, Deployment > Build Tools > Gradle, and leave the changed .idea/gradle.xml out of your commits
SDK location not foundNo local.properties and no ANDROID_HOMEOpen the project once in Android Studio, or create local.properties as shown above
INSTALL_FAILED_UPDATE_INCOMPATIBLEThe device already has com.micamp.wavitpayments.dev signed with another key: the sandbox app from the Clover dashboard, or a teammate's debug buildadb uninstall com.micamp.wavitpayments.dev, then install again. This deletes the app's data, unsent payment records included.
Merchant not found on the splash screenNo Clover account on the device: an emulator, or a dev kit that is not activated and logged into a merchantUse an activated dev kit
Device Not Set Up: unable to retrieve the serial numberNo serial number from Clover, or one that does not start with CUse a Clover device
Device Not Set Up: not set up for merchantapi/authenticate answered 401, so the dev MiPoint API does not know the serial number. A terminal set up only in production does not count.Have it set up (first sale, step 2), then tap Retry
Device Not Set Up: registered but has no WAVit settingsThe device is known but has no settingsAsk for settings, then tap Retry
"Settings not fetched due to connectivity. Trying again"A network or server error on the token or settings callCheck the dev kit's network connection, then retry
The keypad ignores taps and shows a toastThe keypad is gated on connectivityConnect the device to the network

The app writes a log file per day, WAVitLog<MM_dd_yyyy>.txt, to its own external files folder, and the Status screen shows the last seven days. To read them on your machine:

Pull the app's log files
adb pull "/sdcard/Android/data/com.micamp.wavitpayments.dev/files/Log files/" ./wavit-logs

Next steps