JavaScript Finance Calculator

There is a client-side Javascript reusable object for calculating the details of a finance deal for display on your website.

Script Source URL



To use it, simply include and configure this snippet of HTML between your website’s head elements:

<!-- You must include your merchant API key for the corresponding environment.
This can be found in the integration tab of your merchant backoffice account -->
<script type="text/javascript"src="[YOUR API KEY]"></script>

<!-- product code is a string, the codes for each finance product can be found 
on your rate card. The test rate card may differ from the live rate card and is
representative. All price fields have values in Pounds, for example 123.45. Deposit
percentage is the percentage of the full price that the deposit represents for
example 25 = 25% deposit -->
<script type="text/javascript">
    var my_fd_obj = new FinanceDetails("[PRODUCT CODE]", [GOODS PRICE], [DEPOSIT PERCENTAGE], [DEPOSIT AMOUNT]);

This table shows the properties of your FinanceDetails object and some example values:

Property NamePropertyExample Value
Product Namemy_fd_obj.p_name6 Months Interest Free Credit (0% APR)
Value of Goodsmy_fd_obj.goods_val500.00
Percentage of Depositmy_fd_obj.d_pc10.00
Amount of Depositmy_fd_obj.d_amount50.00
Amount of Loanmy_fd_obj.l_amount450.00
Term of Agreementmy_fd_obj.term6
Monthly Instalmentmy_fd_obj.m_inst75.00
Loan Repaymentmy_fd_obj.l_repay450.00
Total Amount Payablemy_fd_obj.total500.00
Cost of Loanmy_fd_obj.l_cost0.00
True Cost of LoanMy_fd_obj.l_truecost0.00


The below wording will need to be added to the Finance Calculator

  • This is to inform customers that there is a minor discrepancy in the calculations.

“ Please note that, due to calculations, your monthly repayment may differ very slightly from what you were expecting. Please check your monthly repayment figure before proceeding ”

  • There needs to be a Rep APR added onto the Interest bearing products. This Rep APR will need to represent more than half of the finance offers your customers will be accepted.
    Please note: This Rep APR will need to be as prominent as any incentives or Monthly payment amount shown on the page.

Example below:

Representative Example:
Cash price £x, Deposit £x, Total amount of credit £xxx over 12 months with an annual interest rate of 14.9%. Monthly repayments will be £x with a total repayable of £x. 14.9% APR representative.

Please note that the True Cost of Loan should not be displayed on your website or otherwise communicated to the consumer. It exists to show when rounding is in the consumers favour.
Use Cost of Loan.

A demonstration of the JavaScript finance calculator tool is available at

Did this page help you?