Integration Guide – Onemoney Standard Web SDK

Integration Guide – Onemoney Standard Web SDK

  1. Place the build folder at the same level as your index.html
  1. Add these tags to the head of index.html
<link rel="stylesheet" href="./onemoneysdk/styles.css">
<script src="./assets/webSdkEnv.js"></script>
  1. Add these tags to the body of index.html
<script type="text/javascript" src="./onemoneysdk/scripts.js"></script>
<script type="text/javascript" src="./onemoneysdk/polyfills.js"></script>
  1. Create a folder named `assets` at the same level as your index.html. Copy the contents of the provided build assets content into the newly created `assets` folder.
  1. Create an element with id `onemoney-aa`, where you want to mount the application.
<div id="onemoney-aa" class="websdk-customcss-body"></div>
  1. Call initSDK to initialize the web SDK by passing fiuID and customCss as a parameter. Should call initSDK function before calling other functions.
initSDK(fiuID, customCss)
ParameterRequired/OptionalType
fiuIDrequiredstring
customCssoptionalobject

Custom CSS should consist of below key-value pairs. As it is an optional parameter, if not present then default color codes will be used.

customCss = {
customButtonBackgroundColor: "#f54776",   
customButtonFontColor: "#fff", 
customFontColorHeading: "#079aff", 
customFontColorSubHeading: "#079aff",
links: "#9c4f4a", 
customBodyBackgroundColor: "#fff"
}

Example

Sl.No.KeyValue
1customButtonBackgroundColor#f54776
2customButtonFontColor#fff
3customFontColorHeading#079aff
4customFontColorSubHeading#079aff
5links#079aff
6customBodyBackgroundColor#fff
  1. Call the below functions for respective pages
  • signup()
    • to go to the signup page.
  • continueSDK(consentHandle)
    • to go to the consent details page without login after registration.
    • consentHandle [string] is a required parameter
  • reset()
    • to reset/exit the OnemoneyAA application.
  • showConsentDetails(consentHandle)
    • to go to consent details page.
    • consentHandle [string] is a required parameter
  1. Listen to the event `OMcallbackTrigger` to get the operation status. This object contains a `detail` property which consists of the following flows in response.
window.addEventListener('OMcallbackTrigger', function (e) {
       // This is callback function that you can trigger
      
   }, false);

Registration Flow

StatusEventErrorCodeVUAMobileMessage
SRegistration09999999999@onemoney99999999999Registered Successfully
FRegistration1Already linked with a valid OnemoneyVUA

Example

{ 
  detail: {
      status: "S", 
      data: { 
        errorCode: 0, 
        event: "REGISTRATION", 
        message:"Registered successfully", 
        vua: "9999999999@onemoney", 
        mobile:"9999999999"
        }
    } 
}

Consent Flow

statuseventerror codemessage
SCONSENT0Consent approved successfully
FCONSENT1Consent rejected successfully
FCONSENT2Exit consent details

Example

{ "detail":{
      "status":"S",
      "data":{
         "errorCode":0,
         "event":"CONSENT",
         "message":"Consent approved successfully"
      }}
}

Note: If you are Integrating Onemoney Web SDK build in the Angular application, then onemoneysdk folder needs to be added in the assets section inside the angular.json file.

"assets": [
             "src/assets",
             "src/onemoneysdk"
          ]