An Online Installment Loan Module
We created a dedicated module to support selecting the terms of the online installment loan. The module in essence is a loan calculator where a customer may check the approximate monthly payment and the annual interest rate based on the cost of the shopping cart.
It is important to provide such information to a customer since the installment loan terms always vary and are based on on the agreement between the Bank of Georgia and Merchant and the terms depend on a campaign (including the 0% installment loan) and they differ from a standard installment loan terms. All this information can be found in the Online Installment Loan Module helping support a customer in decision making.
Thus before activating the installment loan, the loan calculator is needed, which is an independent microservise and requires integration with a Merchant’s website. Bank of Georgia offers you a ready SDK for the loan calculator which is compatible with all devices (Desktop, Mobile, Tablet) and requires adding a ready code snipped on the website.
მაგალითი:
Integration
To start the integration of the installment module SDK you should copy the below code into the HTML page. You should replace {client_id}
by your client_id.
<script src="https://webstatic.bog.ge/bog-sdk/bog-sdk.js?client_id={client_id}"></script>
Displaying the Modal
You should use BOG.Calculator.open
method for displaying the Online Installment modal.
Parameters
amountrequirednumber
onCloseoptionalfunction
onRequestoptionalfunction
A method which is called by SDK after a customer chooses the terms. In such case the following arguments should be passed to the Order Request method:
selected
- An object in which the terms chosen by a customer are passedamount
- A monthly payment amount of the installment loanmonth
- An installment loan duration in monthsdiscount_code
- A discount code of the installment loan
successCb
- A method that should be called if you wish SDK to continue an installment loan processcloseCb
- A method that should be called if you wish to close the module
onCompleteoptionalfunction
onComplete (optional; function) – A method which is called after SDK finishes the online installment loan process. In this case, a customer is being automatically redirected to the success page of a merchant. If you wish to not have the redirection, you should pass false
in the return
parameter. This method receives an object with a redirectUrl parameter.
redirectUrl
- URL on which a customer should be redirected.
There are two methods to continue the process.
If you wish SDK to continue the process, you should call
successCb
in theonRequest
method after generating the orderId, by passing this generatedorderId
parameter. After finishing the process you should call theonComplete
method.If you need the SDK only for the calculations and you wish to continue the process yourself after a customer chooses the terms, then you should pass
false
in thereturn
parameter of theonRequest
method. In such a case SDK will not continue the process anymore. The modal remains open and you have to call thecloseCb
or theBog.Calculator.close()
method if you wish to close the module.
BOG.Calculator.open({
amount: 500,
onClose: () => {
// Modal close callback
},
onRequest: (selected, successCb, closeCb) => {
const {
amount, month, discount_code
} = selected;
fetch('url-to-backend-api', {
method: 'POST',
body: JSON.stringify(selected)
})
.then(response => response.json())
.then(data => successCb(data.orderId))
.catch(err => closeCb());
},
onComplete: ({redirectUrl}) => {
return false;
}
})
SDK also gives you the possibility to add a Bank of Georgia’s button on your website. You should
<div class="bog-smart-button">
<script>
const button = BOG.SmartButton.render(document.querySelector('.bog-smart-button'), {
text: 'მოითხოვე სესხი',
onClick: () => {
// Open Installment Calculator Here
}
})
</script>