How to integrate short legal notice?

Last update: April 12, 2024

Overview

As a credit institution, the Oney Payment Method is legally controlled. In order to give your customers all info they need to proceed with the payment, we provide a dynamic Short Legal Notice. Once integrated, it allows you to stay up to date and legally compliant without any more developments.

Getting started

  1. Add a script tag linking to the loader javascript file found at: “loader.min.js (187 bytes) in the page where the Simulation Popin is to be displayed. You can remove the "-staging" for Production environment.

    Example:

    <script type="text/javascript" src="https://assets-staging.oney.io/build/loader.min.js"></script>
    
  2. In your javascript create a function that will be called on click of the button to load the Short Legal Notice. For this example, this is called showShortLegalNotice but can be changed to any desired name.

  3. Set the onclick function for the button that loads the Oney Short Legal Notice to the showShortLegalNotice function created in step 2 above.

  4. In the showShortLegalNotice function created in step 2, create a variable named options, with the following mandatory fields:

Field nameMandatory - OptionalDescription
countryMMerchant Country code in ISO 3166-1 alpha-2 format
languageMMerchant Language code in ISO 3166-1 alpha-2 format
merchant_guidMMerchant global unique identifier given by Oney to the partner
payment_amountMAmount of asked payment
let options = {        
    country: "FR",
    language: "FR",
    merchant_guid: "4ee34660-1659-4d8e-8849-544c46f4954b",
    payment_amount: 560.00,
    free_bts: true
};

Sample ‘options’ object for easier integration

5. In the showShortLegalNotice function created in step 2, include the following call to the loadOneyWidget function which is found in the “loader.min.js” file included in step 1 above:

loadOneyWidget(function () {
    oneyMerchantApp.loadShortLegalNotice({ options });
});

The showOneyWidget function should look like the following sample:

let options = {        
    country: "FR",
    language: "FR",
    merchant_guid: "4ee34660-1659-4d8e-8849-544c46f4954b",
    payment_amount: 560.00,
    free_bts: true
};

loadOneyWidget(function () {
    oneyMerchantApp.loadShortLegalNotice({ options });
});

6. You can now click on the button to show the Oney Short Legal Notice Popin (step 3 above) and the layer should display.

Country-specific parameters

These parameters can be added to the ‘options’ object above and will be displayed exactly as passed in.

 

Field nameMandatory - OptionalDescription
document_typeMpossible value "3x4xCB", "10x12xCB" or "10x12xIBAN". If you selected 10x12 CB or 10x12 IBAN, you need to provide specific information linked to an Orias registration. Registration is valid until 28th February of the following year and must be renewed each year by the 31st of January the latest. Our teams remain at your disposal to guide you.
merchant_orias_numberMThe Orias number of the merchant, to be displayed in the legal text
merchant_nameMThe name of the merchant to be displayed in the legal text
merchant_addressMThe merchant head office address to be displayed in the legal text
free_btsMBoolean value
  • document_type
    possible value "3x4xCB", "10x12xCB" or "10x12xIBAN". If you selected 10x12 CB or 10x12 IBAN, you need to provide specific information linked to an Orias registration. Registration is valid until 28th February of the following year and must be renewed each year by the 31st of January the latest. Our teams remain at your disposal to guide you.

    • merchant_orias_number
      The Orias number of the merchant, to be displayed in the legal text.

    • merchant_name
      The name of the merchant to be displayed in the legal text.

    • merchant_address
      The merchant head office address to be displayed in the legal text.

Advanced Configuration

The ‘options’ object above can be expanded with the following optional fields:

  • showAsModal
    A boolean value which will determine whether a popup modal is displayed with the result

  • responseType
    Can be one of two values, “html” or “json”, depending on whether the rendered or unrendered input is required

  • successCallback
    Has to be a function accepting two parameters:

    • status
      An integer with the HTTP status code of the response

    • response
      A string (which can be a stringified JSON object, or the rendered HTML) with the details of the response

  • errorCallback
    The options object can be expanded to receive a response that can be handled by the developer when something goes wrong.
    This will be especially useful when setting up, or to have the possibility to log errors.

    The correct value to pass in is a function accepting two parameters:

    • status
      An integer with the HTTP status code of the response

    • response
      A string (which can be a stringified JSON object) with the details of the response

    The errorCallback function will look something like the following example:

    options.errorCallback = function (status, response) {
        console.log(status + " - " + response);
    }
    
    loadOneyWidget(function() {
        oneyMerchanApp.loadShortLegalNotice({ options });
    });
    

    In this case, the only action being performed is outputting the error to the console, but this can be changed to fit your needs.

Full example

Sample with all options, with the returned HTML being injected directly into a page element:

<html>
    <head>    
    </head>
    <body>
        <h2>Merchant Website</h2>
        <button onclick="showShortLegalNotice()">
            Load short legal notice
        </button>
        <div class="shortLegalNoticeOney"></div>
        <script type="text/javascript" src="https://assets.oney.io/build/loader.min.js"></script>
        <script>
            function showShortLegalNotice () {

                let options = {        
                    country: "FR",
                    language: "FR",
                    merchant_guid: "4ee34660-1659-4d8e-8849-544c46f4954b",
                    payment_amount: 560.00,
                    document_type: "3x4xCB",
                    free_bts: true,
                    showAsModal: false,
                    responseType: "html"
                };

                options.successCallback = function (status, response) {
                    document.getElementsByClassName("shortLegalNoticeOney")[0].innerHTML = response;                
                };

                options.errorCallback = function (status, response) {
                    console.log(status + " - " + response);
                };

                loadOneyWidget(function () {
                    oneyMerchantApp.loadShortLegalNotice({ options });
                });
            }
        </script>
    </body>
</html>