Android SDK

1. Installation

Download the SDK
Github - Tamara Android SDK

2. Setup

  1. Copy tamara-sdk.aar file to your app libs folder.
  2. In app level build.gradle, add tamara-sdk.aar as libary:
implementation (name:'tamara-sdk', ext:'aar')
  1. Add library required by SDK:
implementation ''  
implementation ""  
implementation 'com.squareup.retrofit2:retrofit:2.4.0'  
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'  
implementation "com.squareup.okhttp3:logging-interceptor:4.0.1"  
implementation "androidx.navigation:navigation-fragment-ktx:2.2.2"  
kapt ''  
kapt ''
  1. Update proguard file
-keep class co.tamara.sdk.** { *; }
  1. Add this code at the beginning of build.gradle:
apply plugin: 'kotlin-android'  
apply plugin: 'kotlin-android-extensions'  
apply plugin: 'kotlin-kapt'
  1. In project level build.gradle:
allprojects {
    repositories {
        flatDir {
            dirs 'libs'
  1. Sync the project with Gradle.

3. Pay without creating order

If you created an order from your backend, use the checkout URL to process the payment:

TamaraPayment.startPayment(activity, checkoutURL, successUrl, failureUrl, cancelUrl)

For Java:

TamaraPayment.Companion.startPayment(activity, checkoutURL, successUrl, failureUrl, cancelUrl);

Please refer to the documentation for Creating order and processing payment, in case you want to create an order first.

4. Get status of the payment

Use TamaraPaymentHelper to handle the data returned from the SDK:

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {  
    super.onActivityResult(requestCode, resultCode, data)  
    if(TamaraPaymentHelper.shouldHandleActivityResult(requestCode, resultCode, data)){  
        var result = TamaraPaymentHelper.getData(data!!)  
            PaymentResult.STATUS_CANCEL ->{  
                //Payment has been cancelled  
            PaymentResult.STATUS_FAILURE -> {  
                //Payment has occurred an error  
            PaymentResult.STATUS_SUCCESS -> {  
                //Payment has been made successfully  

For Java:

protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {  
    super.onActivityResult(requestCode, resultCode, data);  
    if(TamaraPaymentHelper.Companion.shouldHandleActivityResult(requestCode, resultCode, data)){  
        PaymentResult result = TamaraPaymentHelper.Companion.getData(data);  
        if(PaymentResult.STATUS_CANCEL == result.getStatus()){  
            Toast.makeText(this, R.string.payment_cancel, Toast.LENGTH_LONG).show();  
        } else if(PaymentResult.STATUS_FAILURE == result.getStatus()){  
            Toast.makeText(this,  result.getMessage() != null ? result.getMessage() : getString(R.string.payment_error), Toast.LENGTH_LONG).show();  
        } else if(PaymentResult.STATUS_SUCCESS == result.getStatus()){  
            Toast.makeText(this, R.string.payment_success, Toast.LENGTH_LONG).show();  

5. Add Tamara Widget to your view