#Fixed Deposits SDK integration guide for Web
#Add a button
Add the following button at an appropriate location to your page. The function launchSDK
, which invokes the SDK, should be attached to click event of this button.
<button onclick="launchSDK()">Book FD</button>
#Add the script
Add both the scripts, Script 1 and Script 2 provided below, just before closing of body tag on your page.
Script 1
<scripttype="text/javascript"src="https://fd.setu.co/sdk.js"></script>
Script 2
Provide the following details when calling the function in the script—
- A valid SDK
secretKey
obtained from the bridge under-investment product has to be passed assecretKey
in the function call. - Provide
env
asMOCK
for mock environment andPROD
for production environment. - Provide these values to theme some parts of the SDK—
logoUrl
link to your logo
- Provide
redirectTo
as the URL object to which the user should be redirected after the transaction is completed.- on success or failure, we will redirect user to
success
orfailure
URL, provided inredirectTo
object with a query parameterapplicationId
with value as the application ID of the transaction. - this will help in easier way to map transactions with respect to one user and to check when one user has created multiple FDs with different providers
- on success or failure, we will redirect user to
provider
is the bank/NBFC offering the FD. Following are the values for various bank/NBFC partners—
provider | provider code |
---|---|
Ujjivan Small Finance Bank | UJVN |
Bajaj Finance NBFC | BAJAJ |
The details required vary across banks. Following are the details required for the above mentioned bank/NBFC partners–
All prefills aren't mandatory. Only email
, amount
, env
and tenure
are mandatory. If you choose to skip a prefill, simply don't include it in your code.
Note that the key provider
has a value of UJVN
, representing the FD providing bank.
Provide tenure
in days. For example, if you want to provide a tenure of 180 days, provide tenure: 180
. The range of tenure is 180 to 365 days.
Note that the key env
has a value of MOCK
, representing the current environment. The possible values are MOCK
, UAT
and PROD
.
To re-initate the SDK for user to restart from where the user left. You need to call this function once again.
<script type="text/javascript">function launchSDK() {document.Setu.FD.init({secretKey: "YOUR_SECRET_KEY",env: "MOCK", //ENUM values - "MOCK", "UAT", "PROD"partnerName: "YOUR_PARTNER_NAME", //Used for brandingtheme: {primaryColor: "#3742FA",secondaryColor: "#E2ECFC",primaryTextColor: "#1A202C",secondaryTextColor: "#A0AEC0",hoverOnPrimaryColor: "#2C3AFA",inputFieldBackgroundColor: "#F7FAFC",inputFieldBorderColor: "#3742FA",cardColor: "#FFFFFF",globalBackgroundColor: "#F7FAFC",logoUrl:"https://image.shutterstock.com/image-vector/abstract-vector-logo-design-template-600w-1971786323.jpg",},provider: "UJVN", //ENUM values - "UJVN", "BAJAJ"prefills: {amount: 25000,tenure: 180, //Range - 180 to 365 dayskycParams: {email: "ramesh@xyz.com",pan: "ABCD1234E",mobile: "9998887776",},personalParams: {mothersName: "Rhea",fathersName: "Kronos",maritalStatus: "MARRIED", //ENUM values - "SINGLE","MARRIED","DIVORCED","WIDOW","SEPARATED"spouseName: "Hera",qualification: "10TH",occupation: "EMPLOYED", //ENUM values - "SALARIED", "PROFESSIONAL", "SELF_EMPLOYED", "UNEMPLOYED", "STUDENT", "HOUSEWIFE", "RETIRED"designation: "SALARIED", //ENUM values - "DOCTOR", "CONSULTANT", "EDUCATOR", CHARTERED_ACCOUNTANT", "LAWYER", "STUDENT", "HOUSEWIFE", "RETIRED", "SALARIED", "SELF_EMPLOYED", "OTHERS"communicationAddress: "6th main, Subhash Nagar, Tumkur",communicationPinCode: "560023",},nomineeParams: {nomineeRelationship: "SON", //ENUM values - 'FATHER', 'MOTHER', 'DAUGHTER', 'SON', 'FATHER_IN_LAW', 'MOTHER_IN_LAW', 'DAUGHTER_IN_LAW', 'SON_IN_LAW', 'GRAND_FATHER', 'GRAND_MOTHER', 'HUSBAND', 'WIFE', 'BROTHER', 'SISTER', 'BROTHER_IN_LAW', 'SISTER_IN_LAW', 'AUNT', 'UNCLE', 'COUSIN', 'GUARDIAN', 'EMPLOYER', 'EMPLOYEE', 'FRIEND', 'COLLEAGUE', 'OTHER', 'SHG_MEMBER', 'SHG', 'NEPHEW', 'NIECE'nomineeName: "Suresh",nomineeDob: "1992-11-11",nomineeEmail: "suresh@xyz.com",nomineePincode: "560023",},maturityParams: {maturityIfsc: "SBIN0050432",maturityAccountNumber: "00112233445566",},redirectTo: {success: "https://my-website.co/success"failure: "https://my-website.co/failure"}},});}</script>
#Mock values for testing
Once you have successfully embedded the SDK on your page, use the following input values for testing the SDK journey in sandbox—
Verify your details screen
Use 111111 as the OTP for verifying mobile number and ABCD1234E as the PAN for verifying PAN.
Verify your Aadhaar screen
Use 1234-1234-1234 as the Aadhaar number and 111111 as the OTP for verifying mobile number.
Mock payment screen
On the payment page, please wait for a while—the payment is automatically mocked.
Was this page helpful?