Integration Guide – Onemoney Standard Web SDK
- Place the build folder at the same level as your index.html
- Add these tags to the head of index.html
<link rel="stylesheet" href="./onemoneysdk/styles.css">
<script src="./assets/webSdkEnv.js"></script>
- 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>
- 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.
- Create an element with id `onemoney-aa`, where you want to mount the application.
<div id="onemoney-aa" class="websdk-customcss-body"></div>
- 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)
Parameter | Required/Optional | Type |
fiuID | required | string |
customCss | optional | object |
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. | Key | Value |
1 | customButtonBackgroundColor | #f54776 |
2 | customButtonFontColor | #fff |
3 | customFontColorHeading | #079aff |
4 | customFontColorSubHeading | #079aff |
5 | links | #079aff |
6 | customBodyBackgroundColor | #fff |
- 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
- 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
Status | Event | ErrorCode | VUA | Mobile | Message |
S | Registration | 0 | 9999999999@onemoney | 99999999999 | Registered Successfully |
F | Registration | 1 | – | – | Already linked with a valid OnemoneyVUA |
Example
{
detail: {
status: "S",
data: {
errorCode: 0,
event: "REGISTRATION",
message:"Registered successfully",
vua: "9999999999@onemoney",
mobile:"9999999999"
}
}
}
Consent Flow
status | event | error code | message |
S | CONSENT | 0 | Consent approved successfully |
F | CONSENT | 1 | Consent rejected successfully |
F | CONSENT | 2 | Exit 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"
]