Android SDK Changelog

3.2.0 (2022-04-05)

Bug Fixes

  • Fixed an issue which caused transaction error responses to be sent in onSuccess callback method.

❗️

BREAKING CHANGE

TransactionResult sent in the onSuccess callback method, will no longer contain errorCode and errorMessage for a transaction.
The onError callback method will contain an additional optional parameter data.
The leadStatusListener has been refactored to contain only an onSuccess callback with the lead data in the response.

fun triggerTransaction(
  activity: Activity,
  transactionId: String,
  transactionResponseListener: TransactionResponseListener
)
  
interface TransactionResponseListener {
    fun onSuccess(transactionResult: TransactionResult)
    fun onError(errorCode: Int, errorMessage: String, data: String?)
}

data class TransactionResult(
    val transaction: SmallcaseGatewaySdk.Result,
    val data: String?
)
fun triggerLeadGen(
    activity: Activity,
    params: HashMap<String, String>?,
  leadStatusListener: LeadGenResponseListener
)

interface LeadGenResponseListener {
    fun onSuccess(leadResponse: String)
}
  • Fixed an issue which caused files of type .xlsx to fail downloading on smallcase module.

Dev improvements

  • Added a method to expose sdk version to the host module (internal-tracking).

Intents Impacted: All Transactional and Non-Transaction Intents (including smallcases module).

3.1.21 (2022-03-17)

Bug Fixes

  • Added intent_not_enabled_for_broker 3000 error in case a connected user's broker tries to launch show_orders even if it is not allowed to.

Intents Impacted: SHOW_ORDERS (Non Transactional Intent).

3.1.20 (2022-03-16)

Bug Fixes

  • Fixed an issue in show_orders which caused the SDK to launch user investments landing page for iframe brokers like AxisDirect and HDFC Sec.

Intents Impacted: SHOW_ORDERS (Non Transactional Intent).

3.1.19 (2022-03-15)

Bug Fixes

  • Fixed an issue which caused broker chooser to show more than allowed brokers for show_orders.

Intents Impacted: SHOW_ORDERS (Non Transactional Intent).

3.1.18 (2022-03-14)

Dev improvements

  • Refactored smallcase gateway branding in connect-ui
  • Updated copy content in connect-ui.
    (for more details, please refer this)

Intents Impacted: All Transactional Intents.

3.1.17 (2022-03-03)

Dev improvements

  • Refactored mobile SDK version sent to gateway api.

Intents Impacted: NA.

3.1.16 (2022-03-02)

Bug Fixes

  • Fixed an issue which caused broker chooser to show only 2 brokers when navigated from show_orders to transactional flow
  • Lead Gen status response from 5paisa PWA screen and broker redirection screen

Intents Impacted: All Transactional Intents.

3.1.15 (2022-02-09)

Features

  • Added SHOW_ORDERS non transactional intent

Intents Impacted: NA.

3.1.14 (2022-02-04)

Features

  • Added SMT AMO cancellation

Intents Impacted: TRANSACTION.

3.1.13 (2022-01-07)

Dev Improvements

  • Replaced Coil with Glide library for inflating remote images in ImageView

3.1.12 (2022-01-06)

Bug Fixes

  • Fixed an issue which caused SMT transactions to fail for a GUEST user.

Intents Impacted : TRANSACTION.

3.1.11 (2022-01-05)

Features

  • Integrated Mixpanel sdk to track user events.
  • Integrated Sentry sdk for logging exceptions and unknown error cases.

Bug Fixes

  • Removed redundant orderConfig while communicating with broker chooser.

Dev improvements

  • Removed deprecated R8 from gradle properties.

Intents Impacted : All Transactional Intents.

3.1.10 (2021-12-07)

Dev improvements

Intents Impacted : NA.

3.1.9 (2021-11-29)

Bug Fixes

  • Fixed an issue which caused an order to cancel when the app was minimised.

Intents Impacted : TRANSACTION.

3.1.8 (2021-11-01)

Bug Fixes

smallcase distribution
  • Fixed an issue which caused smallcase distribution window to close without any response if the app goes into background state and the device is running low on memory.
  • Fixed an issue which caused smallcase distribution to remain unresponsive when contact support cta was clicked

3.1.7 (2021-11-01)

Bug Fixes

smallcase distribution
  • Fixed a race condition between SDK initialisation from smallcase distribution and successful CONNECT transaction.

3.1.6 (2021-11-01)

Bug Fixes

smallcase distribution
  • Fixed an issue causing smallcase SIP order to fail after successful smallcase BUY order.
  • Fixed an issue which resulted in no lead data while launching broker's account opening page in the browser.

3.1.5 (2021-10-29)

Features

smallcase distribution

  • Download and view CSV files from smallcase distribution

3.1.4 (2021-10-27)

Bug Fixes

smallcase distribution
  • Fixed an issue which caused Distribution Module to operate in GUEST session even after a successful transaction.
  • Fixed an issue which caused custom tab to destroy as soon as user navigates away from the app.

Intents Impacted : All Transaction Intents.

3.1.3 (2021-10-14)

Features

  • External links inside Distribution Module are now opened in a custom tab.
  • PDF files from Distribution Module can now be viewed separately in a custom tab.
  • Pressing back button twice within a time frame of 3 seconds closes the Distribution Module.

Bug Fixes

  • Fixed Lead Gen flow initialisation from Distribution Module.
  • Fixed an issue which caused the sdk to be unresponsive when user clicks on back button on custom tab.
  • Fixed title and subtitle for connected users on gateway loading screen.

3.1.2 (2021-10-14)

Bug Fixes

  • Fixed an issue which caused transactions to fail on iFrame brokers.
  • Fixed the title text of Axis Direct consent screen for SMT transactions.

3.1.1 (2021-10-08)

Bug Fixes

  • Fixed leprechaun toggle flow in Broker Chooser. Clicking 10 times on Login with your broker will toggle the leprechaun mode for transactions.
  • Fixed an issue causing the SDK to return with init_sdk 3004 if the user logged out from the Broker Platform.

3.0.8 (2021-09-24)

Features

  • Added SUBSCRIPTION transaction intent enabling smallcase subscription via Gateway SDK.
  • Added Distribution Module to enable transactions without requiring a transactionId from the consumer. The consumer can launch the distribution module with a custom header text and a custom route along with any parameters.
  • Syntax:
fun launchSmallPlug(
        activity: Activity,
        smallplugData: SmallplugData?,
        smallPlugListener: SmallPlugResponseListener
    )
  
//SmallplugData
class SmallplugData(
    val targetEndpoint: String?,
    val params: String?
)

Dev improvements

  • Removed redundant network calls to check transactionId status.
  • Broker chooser would now close automatically once the transactionId expires (i.e. in 5 minutes)

3.0.1 (2021-08-24)

Features

  • Added Lead Id and Lead Status in LeadGen response. SDK will now send the leadId and status of the application in response to triggerLeadGen method invocation

  • Syntax:

fun triggerLeadGen(
        activity: Activity,
        params: HashMap<String, String>?,
        leadStatusListener: TransactionResponseListener
    )

Sample LeadGen response:

{
   "leadId":"600988900ccc05c1398f59df",
   "status":"PROCESSING"
}

📘

Note

This is not a breaking change. The developers can continue with the existing implementation of triggerLeadGen method. The json response containing leadId and status will be sent in the data key of TransactionResult.

Dev improvements

  • Removed hardcoded IP address used for internal testing of jetpack compose.

Intents Impacted : All Transaction Intents.

2.9.9 (2021-08-17)

Features

  • Added broker name in Transaction responses.
    Sample transaction response
{
  "data": {
    "batches": [
      {
        "filled": 1,
        "variety": "regular",
        "buyAmount": 121,
        "sellAmount": 0,
        "orders": [
          {
            "orderType": "MARKET",
            "product": "CNC",
            "exchange": "NSE",
            "status": "COMPLETE",
            "quantity": 11,
            "tradingsymbol": "YESBANK",
            "transactionType": "BUY",
            "filledQuantity": 11,
            "averagePrice": 11,
            "exchangeOrderId": "611f4c58053f50b5bca736de611f4ce9053f50b5bca736e2"
          }
        ],
        "unplaced": [],
        "batchId": "611f4ce96cc52ec2a55af32d",
        "quantity": 1,
        "status": "COMPLETED",
        "completedDate": "2021-08-20T06:34:20.796Z",
        "transactionId": "TRX_ac3d3d23eddc45a48c627d32b2fa0282"
      }
    ]
  },
  "signup": false,
  "broker": "kite-leprechaun",
  "transactionId": "TRX_ac3d3d23eddc45a48c627d32b2fa0282",
  "smallcaseAuthToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzbWFsbGNhc2VBdXRoSWQiOiI2MTFmNGNjNTAwMzIyY2E5NmIxOTVmZDciLCJpYXQiOjE2Mjk0NDEyNjUsImV4cCI6MTYyOTQ0NDg2NX0.sJkUtXGa8jg26XqyMcfHcdpRr_gm27gJ6qfr7NXm_E8"
}

Dev improvements

  • Refactored CONNECT Transaction response to a JSON string.
    Sample response for a new user on smallcase ecosystem
{
  "signup":true,
  "smallcaseAuthToken":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzbWFsbGNhc2VBdXRoSWQiOiI2MTFhMDMxYzAzMzY0YzgyNDdhYTVlNDgiLCJpYXQiOjE2MjkxMTA2MjAsImV4cCI6MTYyOTExNDIyMH0.c8CP9zjL9gKIFC1sTECaVpUTfmwrg0aTi1x89GXii5Q",
  "broker":"kite-leprechaun"
}

📘

Note

The signup key signifies whether a user is new to smallcase-ecosystem or not and it would only be visible to first-party gateway.

Bug Fixes

  • Fixed an issue which prevented LEAD_GEN window from getting closed.

Intents Impacted : CONNECT, SST, SMT, HOLDINGS IMPORT.

2.9.5(2021-06-16)

Bug Fixes

  • Fixed the issue of market_closed 4004 error while placing an order of type rebalance.
  • Fixed an issue which caused the host app to crash while capturing an image during account opening journey with 5paisa.
  • Fixed an issue which caused broker-login to fail on some android devices and responded with error user_cancelled, 1011.

Intents Impacted : TRANSACTION

2.9.3(2021-05-28)

Dev improvements

  • Gateway SDK android was using the ffmpeg library for compressing video captured during the IPV stage in 5paisa account opening journey. This library however increased the apk size by around 40 MB. It has been removed from the sdk and an alternative library CameraX is being used to capture video as well as compress it.

Intents Impacted : NA

2.9.2 (2021-05-21)

Dev improvements

  • Save UTMs and isRetargeted meta in Lead Gen
    For marketing channel attribution, smallcase app wants to save some attribution data in addition to the source that we already save
    . This is on /gateway-signup route only
    . We will now save addition field ‘utm’ in meta field of UserApplications document
    . It can contain five keys - source, medium, campaign, term, content
    . Gateway is now sending retargeting emails to dropped off users. We want to track the conversion rate of the same
    *. We will now save additional field ‘isRetargeted’ inside the meta field

  • Syntax:

fun triggerLeadGen(activity: Activity,
                   params:HashMap<String,String>?,
                   utmParams: HashMap<String, String>?,
                   retargeting: Boolean?
                  )
  • Intents Impacted: NA

2.9.1 (2021-05-10)

BUG FIXES

  • Fixed version number string in query parameter

    Fixed an issue that caused the version number of sdk used in query parameter in api requests
    being sent as the version number of the host app.

    Example: if the gateway sdk has version 2.9.0 and the smartinvesting (host app) has version 0.9.6,
    the api requests require the value 2.9.0 (sdk version), instead the value 0.9.6 (host app) was being
    sent.

    Intents Impacted : SST, SMT, HOLDINGS IMPORT.

  • Removed Order In Queue Screen

    For SST orders, if an order takes more than 30 seconds to get executed, that order is queued for
    execution with the broker and the user also receives acknowledgment via a popup.

  • Fixed Broker logout issue:

    While logging out the user from the broker, the smallcase session on the browser is terminated,
    however the user remains a connected user with his broker data available with gateway. The user.
    may or may not be logged out from the host app session. Hence, if the same user after logging out
    tries to place an order using gateway sdk, he should be redirected to the login screen of the broker
    from which he logged out. This has been fixed on gateway sdk android.

    Intents Impacted : SST, SMT, HOLDINGS IMPORT

2.9.0 (2021-04-29)

FEATURES

  • Logout broker session

    This functionality is used to terminate the smallcase session for the user’s broker.

    Example: If a user logged in with kite broker then an active session exists on
    smallcase.zerodha.com. This method can be used to terminate the broker session on
    smallcase.zerodha.com

    Intents Impacted : CONNECT, SST, SMT, HOLDINGS IMPORT

    Syntax

fun logoutUser(activity: Activity,logoutListener: SmallcaseLogoutListener)
  • Broker Chooser Redesigned

    We have now redesigned the look and feel of the broker chooser on gateway. Rather than 9
    brokers + dropdown setup, we will now show brokers in the swipeable grid

    • Swipeable grid : users will now be able to see 8 brokers in the first fold, and a ‘more brokers’
      button. Clicking the more button will show the remaining brokers in the next fold. On touch
      devices, users can swipe over the grid to move back and forth.

    • How does this work card : we will now show the user how the user journey looks like. For this,
      we have a different UI for the first time and returning users.
      First Time User: Expanded card above broker grid
      Returning User: Collapsed card above broker grid

    • Broker order on the grid based on recency of selection : We will now start to store recent
      brokers per transaction intents in partner app’s local storage. The broker will be ordered in the
      broker grid based on the recency of selection

    • Broker Consent block : Axis consent block will now be displayed on top of the broker grid
      when Axis is selected. Users can navigate back to the grid with the back button

  • Basket name and image configuration on order popup & broker chooser for

    stock transactions
    This feature provides an option to the client to pass their custom Basket name and logo/image if
    any while placing an intent of type TRANSACTION. The order name and order logo will appear
    on the broker chooser popup & order popup. For this the client needs to pass the following meta
    object in the orderConfig while creating a transactionId

    Intents Impacted : TRANSACTION { type: SECURITIES }

    Sample curl below

curl --location --request POST 'https://gatewayapi.stag.smallcase.com/gateway/gatewaydemo/transaction' \
--header 'Content-Type: application/json' \
--header 'x-gateway-secret: gatewayDemo_secret' \
--header 'x-gateway-authtoken: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJndWVzdCI6InRydWUiLCJpYXQiOjE2MDI1NzAxOTR9.z8XSJbfipFbvpCzdhyKmvf708rUPXp6AJ9VEyPRVdZc' \
--data-raw '{
    "intent": "TRANSACTION",
    "orderConfig": {
        "type": "SECURITIES",
        "meta": {
            "orderName": "Rockstar Portfolio",
            "orderLogo": "https://avatars.dicebear.com/api/bottts/brrr.png"
        },
        "securities": [
            {
                "ticker": "INFY",
                "quantity": 10,
                "type": "BUY"
            },
            {
                "ticker": "TCS",
                "quantity": 10,
                "type": "BUY"
            }
        ]
    }
}'

Result

2.7.0 (2021-03-30)

FEATURES

  • 5paisa account opening - native PWA integration

    For users to complete the account opening application, earlier versions users were redirected to
    the installed browser outside the app. Now, Account opening with 5paisa will take place within the
    partner app via progresive web app.

FIXES & IMPROVEMENTS

Internal fixes and optimisations around partner identification and sdk versions

2.5.0 (2021-03-18)

FIXES & IMPROVEMENTS

  • Consistent transaction response for stock & smallcase transactions

    Earlier transactionId was returned under the key batches of a SST order response, In case of
    SMT order transactionId was not returned under the same key in response. This issue has been
    fixed and the transactionId is now returned as a part of success response in the
    TransactionResponseListener along with the data and the smallcaseAuthToken. For SST
    transaction, the transactionId will also be returned under the batches key as done earlier. \

    Intents Impacted: TRANSACTION, HOLDINGS IMPORT.

    Sample response - Stock orders

"success": {
               "data": {
                   "batches": [
                       {
                           "filled": 1,
                           "variety": "regular",
                           "buyAmount": 8,
                           "sellAmount": 0,
                           "orders": [
                               {
                                   "orderType": "MARKET",
                                   "product": "CNC",
                                   "exchange": "NSE",
                                   "status": "COMPLETE",
                                   "quantity": 1,
                                   "tradingsymbol": "IDEA",
                                   "transactionType": "BUY",
                                   "filledQuantity": 1,
                                   "averagePrice": 8,
                                   "exchangeOrderId": "605b5392f07c524a47323bc460915868a3538d4fdb004a5b"
                               }
                           ],
                           "unplaced": [],
                           "batchId": "6091586800f2813397e0523e",
                           "quantity": 1,
                           "status": "COMPLETED",
                           "completedDate": "2021-05-04T14:21:32.015Z",
                           "transactionId": "TRX_7768fe63bd8345e6a366fe3d8233fbd6"
                       }
                   ],
                   "notes": null
               },
               "transactionId": "TRX_7768fe63bd8345e6a366fe3d8233fbd6",
               "smallcaseAuthToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzbWFsbGNhc2VBdXRoSWQiOiI2MDViNTNjZmI3YjAwNjhiOTY2OTNiNzQiLCJpYXQiOjE2MjAxMzgwOTYsImV4cCI6MTYyMDE0MTY5Nn0.MZHAPCm7okB26BiiD0pgmGmGueA03CNMQdz9hFS24_0"
           }

/
Sample response - smallcase BUY order

"success": {
               "data": {
                   "name": "ICICI Prudential Smart",
                   "scid": "ICIET_0003",
                   "userId": "605b53cf66c547395751abc2",
                   "source": "PROFESSIONAL",
                   "batches": [
                       {
                           "label": "INVESTMORE",
                           "originalLabel": "INVESTMORE",
                           "status": "COMPLETED",
                           "variety": "regular",
                           "buyAmount": 194.01,
                           "sellAmount": 0,
                           "completedDate": "2021-05-04T12:55:24.455Z",
                           "quantity": 2,
                           "filled": 2,
                           "batchId": "60914439a6681179478bec1d",
                           "orders": [
                               {
                                   "orderType": "MARKET",
                                   "product": "CNC",
                                   "exchange": "NSE",
                                   "status": "COMPLETE",
                                   "quantity": 1,
                                   "tradingsymbol": "ICICILOVOL",
                                   "transactionType": "BUY",
                                   "filledQuantity": 1,
                                   "averagePrice": 117.01
                               },
                               {
                                   "orderType": "MARKET",
                                   "product": "CNC",
                                   "exchange": "NSE",
                                   "status": "COMPLETE",
                                   "quantity": 1,
                                   "tradingsymbol": "ICICINV20",
                                   "transactionType": "BUY",
                                   "filledQuantity": 1,
                                   "averagePrice": 77
                               }
                           ],
                           "unplaced": []
                       }
                   ],
                   "iscid": "605b53d666c547395751abc3",
                   "imageUrl": "https://assets.smallcase.com/images/smallcases/200/ICIET_0003.png"
               },
               "transactionId": "TRX_c94162c499154d378d40d3814ab58a65",
               "smallcaseAuthToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzbWFsbGNhc2VBdXRoSWQiOiI2MDViNTNjZmI3YjAwNjhiOTY2OTNiNzQiLCJpYXQiOjE2MjAxMzI5MzIsImV4cCI6MTYyMDEzNjUzMn0.98QYsQfCOSld7LcRl_QX-mmXR5TB59h_4zMcNwCtxDQ"
}

2.3.0 (2021-03-12)

FEATURES

  • Added archive smallcase order

    If an SMT transaction is partially filled or unfilled, the user is given an option to either -

    • Repair : retry unfilled stock orders
    • Archive: accept smallcase as is

    Repair is done by creating a transactionId
    We have now exposed the markSmallcaseArchived method to facilitate archive functionality.

    Intents Impacted: TRANSACTION \

    Syntax:

fun markSmallcaseArchived(iScid: String, archivedSmallcaseListener: DataListener<SmallcaseGatewayDataResponse>)

2.2.0 (2021-02-10)

FEATURES

  • Added optional parameter preProvidedBrokers to triggerTransaction Method

    Up until now a custom list of brokers could be passed to gateway sdk only during the setup
    method call. This feature provides an option to pass a custom list of brokers in triggerTransaction
    method after creating a transaction. This is applicable for all the transaction intents. \

    Intents Impacted: CONNECT, TRANSACTION, HOLDINGS IMPORT

    Syntax:

fun triggerTransaction(
        activity: Activity,
        transactionId: String,
        transactionResponseListener: TransactionResponseListener,
        utmParams:HashMap<String,String>?=null,
        preProvidedBrokers : List<String>? = null
      )

FIXES & IMPROVEMENTS

  • Added crash logger
    If the gateway sdk encounters any exception, it is captured and logged by us. This is independent of the host app. \

  • DeviceId will be stored on internal storage instead of Shared Preference DeviceId is now stored on internal storage, this internal storage file is then combined with the crash logs which is finally uploaded to our crash logger .

Bug Fixes

  • Changed redirect route from generic to gateway partner’s app specific route
    Earlier the host specified a generic route in the android manifest file to be redirected from the Broker’s web portal post order placement, this causes a UX issue if the user has multiple apps using gateway sdk. This is now changed to the gateway partner’s unique Id for identification of different partner apps within the same android device.

    Intents Impacted: CONNECT, SST, SMT, HOLDINGS IMPORT.

    Syntax:
<intent-filter>

<data
   android:host="gatewaydemo"
   android:scheme="scgatewayredirect"
 />

<intent-filter>