Links

Compliance element

Learn how to use the Compliance element.
With the DigitalRiver.js library, you can create a Compliance element that retrieves and renders Digital River's required compliance links. These links can be styled and placed on your page like other DigitalRiver.js elements.
For details on how to use the compliance element in checkout flows, refer to Displaying compliance disclosures on the Building checkouts page.

Creating a Compliance element

To create a compliance element, you should use the createElement() method exposed through the DigitalRiver object.
This version of createElement() has two required parameters: 'compliance' and a configuration object.
var compliance = digitalRiver.createElement('compliance', complianceOptions);

Compliance element configuration object

The element's configuration object consists of a nested classes and compliance.

classes

You can pass an optional classes object to stylize the compliance element. For more details, refer to Custom classes.

compliance

The required compliance object consists of:
  • businessEntityCode: An optional string that represents the transaction's designated selling entity.
  • locale: An optional string that combines a two-letter ISO 639-1 language code with an ISO 3166-1 alpha-2 country code. If you don't pass a value, then the disclosures are localized based on how you localize the DigitalRiver.js library. If you don't localize the library, then locale defaults to en-US. Accepted values: ar-EG, cs-CZ, da-DK, de-AT, de-CH, de-DE, el-GR, en-AU, en-BE, en-CA, en-CH, en-DK, en-FI, en-GB, en-IE, en-IN, en-MY, en-NL, en-NO, en-NZ, en-PR, en-SE, en-SG, en-US, en-ZA, es-AR, es-CL, es-CO, es-EC, es-ES, es-MX, es-PE, es-VE, et-EE, fi-FI, fr-BE, fr-CA, fr-CH, fr-FR, hu-HU, it-CH, it-IT, iw-IL, ja-JP, ko-KR, lt-LT, lv-LV, nl-BE, nl-NL, no-NO, pl-PL, pt-BR, pt-PT, ro-RO, ru-RU, sk-SK, sl-SI, sr-YU, sv-SE, th-TH, tr-TR, zh-CN, zh-HK, zh-TW
  • language: An optional string that consists of an ISO 639-1 language code.
  • country: An optional string that consists of an ISO 3166-1 alpha-2 country code.
Locale
Language + Country
The following configuration results in the Compliance element displaying the necessary disclosures in Spanish for transactions applicable to Spain that are facilitated by the Digital River Ireland Ltd. selling entity.
var complianceOptions = {
classes: {
base: 'DRElement'
},
compliance: {
entity: 'DR_IRELAND-ENTITY',
locale: 'es-ES'
}
}
var compliance = digitalRiver.createElement('compliance', complianceOptions);
The following configuration results in the Compliance element displaying the necessary disclosures in Spanish for transactions applicable to Germany that are facilitated by the Digital River Ireland Ltd. selling entity.
var complianceOptions = {
classes: {
base: 'DRElement'
},
compliance: {
entity: 'DR_IRELAND-ENTITY',
language: 'es',
country: 'DE'
}
}
var compliance = digitalRiver.createElement('compliance', complianceOptions);

compliance.mount();

Call this function to place the created Compliance element on your page.
Example
<div id="compliance"></div>
compliance.mount('compliance');

compliance.unmount();

Call this function to remove the Compliance element from your page. The element may be re-added to your page by calling mount().
Example
compliance.unmount();

compliance.destroy();

Call this function to remove the Compliance element from your page as well as remove its functionality. You cannot re-add the destroyed element to your page via mount().
Example
compliance.destroy();

compliance.update();

Call this function to update the Compliance element's data.
Example
let complianceOptions = {
classes: {
base: 'DRElement'
},
compliance: {
locale: 'ja-JP',
entity: 'DR_JAPAN-ENTITY'
}
}
compliance.update(complianceOptions);