Comment on page
Compliance element
Gain a better understanding of what the compliance element does and how to use it.
The compliance element displays the selling entity facilitating a transaction and renders links to applicable disclosures, such as terms of sale, cookie policies, and cancellation rights.

For details on using the element in checkout flows, refer to Displaying compliance disclosures on the Building checkouts page.
To create a compliance element, pass
'compliance'
and its configuration object to createElement()
, which is exposed by the DigitalRiver
object.var compliance = digitalRiver.createElement('compliance', complianceOptions);
Call this function to place the created compliance element on your page.
<div id="compliance"></div>
compliance.mount('compliance');
Call this function to remove the compliance element from your page. The element may be re-added to your page by calling
mount()
.compliance.unmount();
Call this function to remove both the compliance element and its functionality from your page. You cannot re-add a destroyed element to your page via
mount()
.compliance.destroy();
let complianceOptions = {
compliance: {
entity: 'DR_JAPAN-ENTITY'
}
}
compliance.update(complianceOptions);
To stylize the compliance element, define the optional
classes
. For details, refer to Custom classes.var complianceOptions = {
classes: {
base: 'DRElement'
},
...
}
var compliance = digitalRiver.createElement('compliance', complianceOptions);
For example, the following configuration results in the compliance element displaying the required disclosures, translated into Spanish, when customers are shopping in Germany, and Digital River Ireland Ltd. is facilitating the transaction.
var complianceOptions = {
compliance: {
entity: 'DR_IRELAND-ENTITY',
language: 'es',
country: 'DE'
}
}
var compliance = digitalRiver.createElement('compliance', complianceOptions);
This required string determines the language of the text displayed in the element as well as the linked-to disclosure documents. The value you assign
language
doesn't affect what disclosures are displayed, only how their text is rendered. A required string, formatted as an ISO 3166-1 alpha-2 code, represents the customer's shopping country. Since legal requirements vary slightly from country to country, the value you assign to this property determines which specific disclosures are rendered in the element. For example, some
country
values display a link to the customer's cancellation rights, while others do not.If the transaction involves physical products,
country
should ideally be the same as the customer’s ship to country. If customers only purchase digital products, you can use their billing country.A required string that represents the transaction's designated selling entity. Like
compliance.country
, this property affects which disclosures are displayed in the element.If
compliance.country
is jp
, then the element displays a link to a disclosure that pertains to Japanese commercial transaction law.If you'd like to replace the default URL behind this link with your own, use
jpCommerceLawPageUrl
.var complianceOptions = {
classes: {
base: 'DRElement'
},
compliance: {
...
country: 'JP',
jpCommerceLawPageUrl: 'https://acme.com/JapaneseCommerceLaw'
}
}
var compliance = digitalRiver.createElement('compliance', complianceOptions);
Last modified 3mo ago