Documentation

Borgun, all rights reserved. 2017 ©

Updated 30.01.2017


eCommerce Loans
Version 1.2.25896

Introduction

This document describes the structure of Borgun's eCommerce loans which enables merchants to offer consumer loans through an eCommerce website. The process allows customers to apply for a loan during the checkout process. When providing an electronic identification they are prompted to allow Borgun to credit score them and if approved the customer will finalize the loan in one step.

eCommerce loan process

eCommerce loan is a process between merchant eCommerce website and Borgun consumer loan service and web.

  1. Customer adds products to his cart and proceeds to checkout. GetPaymentMethods is called to display available payment options. Customer enters personal information and selects payment option of choice.
  2. Merchant's eCommerce website stores information about product(s) and customer and any other relevant information (here is a good idea to create a reference id for the customer cart to include as a parameter for the successUrl).
  3. Authorize access for the customer by calling Borgun web services CreateOnlineLoanToken function.
  4. Redirect customer to Borgun consumer loan web.
  5. Customer provides credit card information and starts loan autorization process. The loan is authorized (if customer passes loan evaluation process) and the customer is redirected back to the merchant's website.
  6. Merchant's website receives token id for validation purpose.
  7. Merchant validates loan by calling Borgun web service ValidateOnlineLoan function (here is a good idea for merchant to update it's own eCommerce website transaction information).
  8. Display success text along with information about delivery or pickup location for the customer.

Online Loan Flow

Image 1 - This diagram shows webstore loan process. M = Merchant, B = Borgun

A live demonstration of the process can be found at Borgun Loan Store. Credentials are included in the Tech Sheet (sent speratly).


Webservice functions

Three webservice functions from Borgun Consumer Loans API are used for the webstore loan process:

  • GetPaymentMethods to display available payments options to customer.
  • CreateOnlineLoanToken to authorize to customer to create a Borgun consumer loan and pre-register information about loan and customer.
  • ValidateOnlineLoan to validate that customer has succesfully created a loan.

GetPaymentMethods

Displaying payment options for customer during checkout is crucial. It should include key information about proposed loan and Consumer Loans API webservice GetPaymentMethods helps achieving that goal. The function is simply called with cart amount and returns a list of payment methods that includes loan type name and loan key information. This can be enumerated along with other miscellaneous payment options as shown in image 2.

Payment Options

Image 2 - Payment options that customer can choose from (other miscellaneous payment options are included)

CreateOnlineLoanToken

CreateOnlineLoanToken is called with two objects. OnlineLoan that holdes information regarding the consumer loan, merchant information and redirect URLs and CustomerInfo that holds all personal data regarding the customer.

Example data for OnlineLoan

proxy.OnlineLoan onlineLoan = new proxy.OnlineLoan
{
    Amount = 64995, 
    Description = "Playstation 4",
    LoanTypeId = 24,
    MerchantNumber = "9635422",
    NumberOfPayments = 12,
    FlexibleNumberOfPayments = true,
    SuccessUrl = "https://www.bwebstore.is/CheckoutComplete?transactionId=a4c5gd64lod5",
    CancelUrl = "https://www.bwebstore.is/Shoppinghart",
    RequireIdentification = true
};

SuccessUrl should include a merchant reference id of customer's transaction for validation and status updates.

CancelUrl is used when the customer does not want to go ahead and create a loan. Sometimes he might want to add more items into his shopping cart. Redirecting him back to his shopping cart is ideal.

FlexibleNumberOfPayments allows the customer to choose from available number of payments. NumberOfPayments acts then as the maximum months allowed.

RequireIdentification allows merchants to allow their customers to confirm a loan with mobile electronic identification or with a token sent to an online bank as an electronic document. The loan contract is sent via email providing a paperless transaction.

Example data for CustomerInfo

proxy.CustomerInfo customerInfo = new proxy.CustomerInfo
{
    NationalRegistryId = "0101502479",
    Name = "Jón Borgunarson",
    Address = "Ármúla 30",
    PostalCode = "108",
    City = "Reykjavík",
    PhoneNumber = "8328500",
    Email = "radgreidslur@borgun.is"
};

The function returns a tokenstring that is used to authorize customer access to Borgun consumer loan website. The redirect URL is included in the Tech Sheet (sent speratly).

ValidateOnlineLoan

ValidateOnlineLoan is called with three parameters, token, returnUrl and merchantNumber.

token that is the same token received from CreateOnlineLoanToken. Borgun consumer loan web will pass it back to merchant webstore by adding it as a query parameter to the SuccessUrl supplied.

redirectUrl is the customer's request URL when he was redirected back to the merchant webstore. It should be the same URL as was submited from the CreateOnlineLoanToken function earlier (token string has been added automatically).

The validation is successful if the loan has been created and the incoming redirect URL has not been tampered with. Merchant should also validate that loan amount is the same amount as the customer's cart amount.

Loan advertisement

Most webstores adverties loan ratings that customer can have for all products that qualify. The Consumer Agency requires that certain information is shown. That can be done by calling the Consumer Loans API webservice LoanAdvert method and showing key information along with product price as shown in image 3.

Loan advertisement for product

Image 3 - Loan advertisement example for a product in an eCommerce website