SDK
Initialize
Add Gradle dependency by adding the following code to your Android App
build.gradle
dependencies {
implementation "io.streampay:streampay-sdk:2.1.03"
} 2. Create a single instance of StreamPay object context wherever you need.
val streampay = StreamPay(this, AuthenticationData.UserEnter, Locale.getDefault(), Environments.SANDBOX)streamPay = new StreamPay(this, AuthenticationData.UserEnter.INSTANCE, Locale.getDefault(), Environments.SANDBOX);While creating an instance for StreamPay, you need to pass the following:
Context:
You need to pass the current context
AuthenticationData.
We have 4 methods for login
1. Login with JWT
AuthenticationData.Jwt("jwt here")2. Login with your existing mobile number
AuthenticationData.Mobile("+966500000000")3. Login with existing email
4. Let the user enter the mobile number or email to log in
Here is an explanation of how to use the client dashboard, you need to add users to terminals so they can use the SDK.
Link
Locale
Locale allows you to select the language to be used.
Environment
This will allow you to choose the environments so you need to choose sandbox and we will tell you when it needs to be changed.
StreamPay service is working inside Saudi Arabia only, if you are outside Saudi Arabia, please share your Static IP with StreamPay Team
if the package name of your android project is not registered in StreamPay system, you won't be able to communicate with our system.

SDK Flow
1. Once you call any function for the first time, it will ask you to install a payment plugin.
2. After the installation is done, we will check your device meets the requirements.
3. If you pass the health check then we will check the JWT and let you accept payment.
Setup
The setup allows you to install the payment plugin and login into our StreamPOS app.
Please don't use Setup before any other method like purchase, refund, reconcile and reverse.
Find Setup Errors here
Purchase
Please note the amount should be entered like this 100 which means 1.00 SAR so 1455 will be 14.55 SAR & max length is 12 digits including exponent ( 123456789012 ) which will result in 1,234,567,890.12
You may pass your Reference ID in customerReferenceNumber field to be attached to this transaction. or null otherwise.
enableReceiptUi is Boolean so you can set it to true or false.
Find the Transaction Receipt model here.
Find Purchase errors here.
Refund
pass the transactionReferenceRetrievalNumber of the transaction you want to refund
enableReceiptUi is Boolean so you can set it to true or false.
Find the Transaction Receipt model here.
Find Refund errors here.
Reconcile
To perform a reconciliation, Payment reconciliation is an accounting process that verifies account balances to ensure all sets of records are true, consistent, and up-to-date. Businesses can reconcile their accounts daily, weekly, or monthly.
enableReceiptUi is Boolean so you can set it to true or false.
Find Reconcile Data here.
Find Reconcile Error here.
Reverse
To perform a Reverse Transaction, it should be within one minute
enableReceiptUi is Boolean so you can set it to true or false.
Find the Transaction Receipt model here.
Find Reversal Error here.
Converting receipt to image for printing
You can convert the receipt to an image so you can print it.
Logout
When the user logs out of your application - the user must be logged out of the StreamPay POS SDK.
Find Logout Error types here.
Last updated