Mobile SDKs

Android SDK Library

Usage

In order to run the demo correctly, please make sure to replace the StoreID and Key within the demo to the one provided by Telr. Also be sure to replace the email.

You can check your Store ID from the top header section of your merchant site, and the Key from the left side menu at the following path Integration -> Mobile API Settings.

Download the SDK library & demo

Download the SDK library and the demo from the attachment section at the end of this page.

Android 3.0
TelrSDK_Android_3.5.zip
TelrSDK_Android_3.3.zip
TelrSDK_Android_Demo_3.2.zip (Extract the zip file to find telrlibrary-release.aar )

Android Kotlin
TelrSDK_Android_Kotlin

Android X
TelrSDK_AndroidX

Android Legacy
TelrSDK_Android_Legacy

Add your library as a dependency

To use your Telr SDK library in your new project, proceed as follows:

  1. Add the library telrlibrary-release.aar to your project:
    • Add the  file:
      1. Click File > New Module.
      2. Click Import .JAR/.AAR Package then click Next.
      3. Enter the location of the AAR file then click Finish.
  2. Make sure the library is listed at the top of your settings.gradle file, as shown here for a library named “my-library-module”:
    include ':app', ':telrlibrary-release'
  3. Open the app module’s build.gradle file and add a new line to the dependencies block as shown in the following snippet:
    dependencies {
        compile project(":telrlibrary-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'
        })
    }
  4. Add the following lines inside your app module build.gradle
    packagingOptions {
        exclude 'META-INF/license.txt'
        exclude 'META-INF/notice.txt'
    }
  5. Rebuild your project.

How it works

The SDK will do all the internal work of calling all APIs and getting the proper response, so the developer can customize the look and feel of the checkout and the results screens to fit his design and requirments.

SDK

You’ll find three activities inside the demo project:

MainActivity: This sample screen represents your page of collecting user info and amunt from your shopping cart ready for checkout.

SuccessTransationActivity: This sample screen represents the success call back screen after the payment has been done successfuly.

FailedTransationActivity: This sample screen represents the failed call back screen after the payment has been failed for any reason.

You can try the Demo built in using Android Studio on your android device or simulator.

iOS SDK Library

Usage

In order to run the demo correctly, please make sure to replace the StoreID and Key within the demo to the one provided you though Telr admin site.

You can get the Store ID from the top header section of your admin site, and the Key from the left side menu Integration -> Mobile API Settings.

The project is built using the latest version of swift 3

The library only needs one empty view with reference to TelrController to start the process until the end and gives you the final feedback, so feel free to build your views and update the current ones as your requirements.

Download the demo

Download the demo and SDK based on your environment from the attachment section at the end of this page.

Swift 4.0
TelrSDK_Swift3.3_4.0_xcode9.4_v3.1.zip
TelrSDK_Swift4.2_xcode10_v4.zip

Swift 5.0
TelrSDK_Swift_5.2.4
TelrSDK_Swift_5.3.0

XCode : 12

Min iOS support : 9.0 / 11.1

Installation

  1. Unzip the SDK.
  2. Open the extracted demo project in Xcode.
  3. Open the swift file ViewController.swift and replace the key and store id with the one provided to you from the Telr team.
    The ResultController.swift file contains the response variables from Telr gateway.
    The Main.storyboard contains the UI.
  4. Feel free to update the ViewController, ResultController, Storyboard as your requirements, but just take care of the following:
    1. Use the libraries as mentioned in the project
    2. The storyboard ID must be “Main”.
    3. The ResultController name cannot be changed.
  5. The demo application contains all required configurations to run on XCode simulator; for release mode, please replace the TelrSDK simulator library at your project with the equivalent one in the zipped SDK folder.

PhoneGap and Cordova implementation

Usage

Note: This is a pure javascript implementation without any additional plugins, you can directly use the same code with other hybrid frameworks.

In order to run the demo correctly, please make sure to replace the StoreID and Key within the code with the one provided you through Telr admin site.
(Replace them in telr_Payment.js and telr_status.js)

You can get the Store ID from the top header section of your admin site, and the Key from the left side menu Integration -> Mobile API Settings.

PhoneGap CLI

First, You should have PhoneGap or Cordova installed on your machine

Find how to install Cordova on this link https://cordova.apache.org/docs/en/latest/guide/cli/

After installation, go to the folder that contains the project and do the following to run it.

Add platform, ‘android’, ‘ios’, ‘browser’ ; use the following command

phonegap platforms add browser

phonegap platforms add ios

phonegap platforms add android

Run the emulator

To use this feature, You should have android and ios emulator installed on your machine

To run the application on the emulator

phonegap serve browser

phonegap emulate ios

phonegap emulate android

you can use the chrome developer tools to debug and test the scripts on the browser.

Download the SDK

Download from the article attachment below

Updated on January 28, 2022

Article Attachments

Related Articles