Skip to main content

Sample App Code

2.1 Summary

This SDK documentation includes an example app on how to use and the best practice of using the SDK. The example app is delivered with the Java source code.

Prior knowledge of Android Java programming, Gradle build and Android Studio IDE are required to understand the sample app. Knowledge in Model-View-Presenter (MVP) design pattern is also a recommendation to understand the architecture of the example app. The code snippets of the example app are used throughout the document to describe how the SDK should be used.

2.2 Availability

The link to download the example app should be available and given with the documentation, otherwise please contact your Cashlez contact person to request one. Currently Cashlez have iOS SDK and Android SDK.

2.3 Implementation of Sample App/Code

Extract the sample rar code that has been provided from the Cashlez Product Team. Then open a new project in android studio or idx, select the extracted project.

figure 2.1

When the import is successful and the dependencies are resolved, the module can be deployed in an android mobile phone. The example app Login screen. To interact with the card reader dongle the example app must be deployed in a real device, currently using an android emulator is not yet supported.

2.4 Implementation of Cashlez Lib or SDK

  1. Download Cashlez Lib given by Cashlez Product Team.
  2. Download file github.properties given by Cashlez Product Team.
  3. Open your Gradle Project, then implements the github.properties into Gradle Project.
  4. Open your Gradle Project, then implements the Library SDK Cashlez
    com.cashlez.android:cashlez:x.x.x.x

2.5 Application Interface

In this version, the UI already revamped to a whole new fresh look. On this landing page, it has a new look and compact design. We re-design this to simplify the usage of the sample for our merchant.

figure 2.2

These are the components inside this landing page based on Figure Cashlez Lib Sunmi (after figure belows):

Home Page
No.NameDescription
1.Amount text boxthis will add amount to pay on the payment
2.Description text areaThis will add description to the payment details
3.UploadThis will upload image from local storage and put it inside to the cloud storage
4.Reader and printer statusThis will return the status of the reader and printer, whenever it's connected:
  • if the printer is ready, it will return the status of the printer which is true.
  • if it's disconnected, it will return false.
5.Pay buttonThis button will redirect user to the payment page
6.Check reader buttonReturn toast alert of the reader status
7.Check printer buttonReturn toast alert of the printer status Page 12

figure 2.3
figure 2.4

When redirected to the payment page, it will show the options for payment, and also the amount and payment description. Based on secondary figure from below. Several mandatory fields taken from the home page will appear on the payment page such as amount text, description text, printer, and reader status.

For each payment we have different UI, these are the list of our payment

Payment List
Payment OptionsPayment Name
International CardDebit/Credit Card
CashCash Money
Debit Transfer New ActivityMini ATM bersama (Bank Transfer)
LinkAja New ActivityPayment QRIS LinkAja
Go-Pay QR New ActivityPayment QRIS Go-Pay
OVO New ActivityPush to Pay OVO
Artajasa New ActivityVA (ATM Bersama)
Kredivo New ActivityPayment Paylater Kredivo QR
Shopee QR New ActivityPayment QRIS ShopeePay
Permata VA New ActivityPermata (ATM Bersama)
BCA VA New ActivityBCA VA
Vospay New ActivityPush to Pay (paylater)

On card mock features, the user will have capability to test the card reader using any card with chip or magnetic stripe. There are some default amounts for using the card mock:

Amount for card mock
AmountsDescription
100Success
50Decline or Rejected
105PIN Error
Other value than aboveBatch not ready

figure 2.5
figure 2.6
Payment History Detail
NoNameDescription
1.Void PaymentTo Void Payment
2.PrintTo Print Receipt Payment
3.Send ReceiptTo Send Receipt Payment