Integration Docs

Comprehensive guide and documentation to help you start working with smallcase Gateway

Get Started

Cordova Integration

Cordova plugin is available as a private npm package on github.


step 1 - To integrate plugin run this command using cordova CLI.

cordova plugin add



Version can be changed according to the latest available version.

step 2 - Add redirect params to config.xml

<config-file target="AndroidManifest.xml" parent="/manifest/application">
   <activity android:name="com.smallcase.gateway.screens.transaction.activity.TransactionProcessActivity">
               <action android:name="android.intent.action.VIEW" />
               <category android:name="android.intent.category.BROWSABLE" />
               <category android:name="android.intent.category.DEFAULT" />
                   android:scheme="scgateway" />

Add this on your top level config.xml file.



Add your gateway name in place of ${GATEWAY_NAME}.

iOS setup

add these lines at the top of your Podfile

# private podspec for smallcase
source ''

# default source for all other pods
source ''

# update the ios version if it was previously below 11.0 
platform :ios, '11.0'

Setting up sdk for transaction

To start using the gateway setup the gateway with the desired configuration.

function(data){//Success callback required},
function(error){//Failure callback required},
ENVIRONMENT,//For selecting a particular environment.
GATEWAY_NAME,//Replace with your gateway name.
LEPRECHAUN_MODE,//Boolean for leprechaun mode.true for enabling
AMO_ENABLED,//Boolean for accepting amo orders.true for enabling
["broker name","broker name"]);//If selected brokers should be shown, pass broker name comma separated else ignore.
// Values - fivepaisa, aliceblue, edelweiss, hdfc,iifl, kotak, trustline, kite


ENVIRONMENT (required): This defines the Url environment to which all the gateway apis would point to.

scgateway.ENVIRONMENT = {
   PRODUCTION: 'production'

GATEWAY_NAME (required): This is a unique name given to every gateway consumer.
LEPRECHAUN_MODE (optional): For Testing purpose pass it as true else false.
Broker Config (optional): If you want to support only certain brokers use.



'brokers' key is optional: if not passed, the SDK will show all supported brokers.

Only pass the brokers key if you want to allow only selected brokers.

User Initialisation

User initialization starts a session between the distributor and the gateway. Whenever there is a change in user session.Call initSCGateway method from scgateway global variable.

scgateway.initSCGateway(function(data){//Successcallback required},
function(error){//Failure callback required},

Params :

authToken - (Required) JWT with the information of user signed using a shared secret between smallcase API and gateway backend.

completion - (Required) Get success or failure callback with JsonObject.

       dialogAlert('Success','Init gateway success ' + data)
       dialogAlert('Error','Init gateway failure' + error)

Example usage.

Trigger Transaction

Method using which broker connect and order flows can be triggered

scgateway.triggerTransaction(function(data){//success callback required},
function(error){//failure callback required},

Params :

transactionId - (Required) Transaction id to create a the transaction.

completion - (Required) Get JsonObject in success callback or failure callback.



TransactionId creation process remains same using Gateway backend APIs.
Read more about transaction Id at Creating Transactions

Creating Transactions

   dialogAlert('Success','Init gateway success ' + data)
   dialogAlert('Error','Set Config Failure ' + error)

Example usage.

Broker Account Opening

To trigger account opening call triggerLeadGen method which is available as a exported method on scgateway variable.

    'name':'NAME OF USER',
    'email': 'EMAIL OF USER',
    'contact': 'CONTACT OF USER',
    'pinCode': 'PIN CODE OF USER'

params -(Optional) pass user information as JSON.

Updated 2 months ago

Cordova Integration

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.