Usage
To run the demo correctly, follow these steps:
Replace the StoreID and Key:
- Update the demo's configuration to use your StoreID and Key as provided by Telr. These details are necessary for authenticating your transactions with the payment gateway.
- Ensure that you replace the placeholder email in the demo with your own.
You can find your Store ID at the top header of your merchant portal. The Key can be accessed by navigating to Integration → Mobile API Settings in the left side menu.
Download the SDK library & demo
You can download our SDKs from https://github.com/orgs/Telr-PG/repositories
Installation
To integrate the Telr SDK library into your project, follow these steps:
- Download and add the library
<<company_name_lower_case>>library-release.jar
to your project: - Add the file:Click File > New Module.
- Select Import .JAR/.AAR Package and click Next.
- Enter the location of the AAR file then click Finish.
Ensure the library is included at the top of your settings.gradle
file. Example for a module named "my-library-module":
include `':app', ':<<company_name_lower_case>>library-release'`
Open the app modulesbuild.gradle
file and add a new line to the dependencies block as shown in the following snippet and Rebuild your project.
dependencies {
compile project(":<<company_name_lower_case>>library-release")
compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE'
compile ('org.simpleframework:simple-xml:2.7.1',{
exclude group:'stax', module:'stax'
exclude group:'stax', module:'stax-api'
exclude group:'xpp3', module:'xpp3'
})
}
Add the following lines inside your app module build.gradle
packagingOptions {
exclude 'META-INF/license.txt'
exclude 'META-INF/notice.txt'
}
The demo project includes three key activities:
MainActivity
This screen is where you collect user information and the amount for checkout from the shopping cart. It's a representation of your cart's checkout page.
SuccessTransationActivity
This screen is displayed when the payment is successful. It acts as the success callback page, confirming that the transaction went through.
FailedTransationActivity
This screen appears when the payment fails. It represents the failure callback, displaying any error messages for unsuccessful transactions.
You can try the Demo built-in using Android Studio on your Android device or simulator.
How it works
The SDK handles all API interactions internally, including payment requests and responses. Developers only need to customize the user interface for the checkout and result screens to match their design needs.