Sample Code
Including the eLayaway Calculator on Your Pages
In order to collect the months and payment frequency for the eLayaway™ purchase, it's useful to include the eLayaway™ calculator. Including the calculator for use with ECI is a really easy two-step process.
Include the eLayaway™ client library in your page's head section. (eLayaway™ uses a single namespace and will have no effect on existing javascript)
Include the image you want to use as your eLayaway™ button, with a custom javascript hook.
Here's an explanation of those options:
- amount
- This value lets you specify a string containing DOM Id's or classes that are inspected to determine the eLayaway™ amount. (e.g. '#amount_1 * quantity_1')
- merchant_name
- This is the value that will appear within the eLayaway™ calculator
- max_lay_length
- This value lets you specify the maximum eLayaway™ term.
- return
- This is an internet address of a page to return the customer to, after their purchase.
- eci_form
- This is the DOM ID of the HTML form that contains your ECI fields.
- months_field
- This is the DOM ID of field named 'months' that will be posted as part of the ECI transaction. (The customer chosen months value is written to this field just before the form is submitted)
- payment_frequency_field
- This is the DOM ID of field named 'payment_frequency' that will be posted as part of the ECI transaction. (The customer chosen payment frequency is written to this field just before the form is submitted)
- currency_code
- The code for the type of currency used in the calculator.