Show/Hide Toolbars

CWT Software Configuration Handbook

Element        Path: <cwt><PURCHASERULES>

The CWT can be configured to have several purchase rules like “Allow only 5 purchases with Article id = 1000 or 1001 within a rolling period of 24h.” or “Allow only purchases up to $1000 with each code within a rolling period of 3h.”

The rules can  for example be used as an anti-pass-back for code input.

Note:
Rules are executed in the order based on the rule ID

The rules are always on terminal level independent of online or offline.

A rule always includes a time limit

A rule can include:

Number of purchases

Total ticks (amount)

Articles

Tariff Packages

Personal Accounts

Code.

The logic between including parts is defined as:

(<article> OR <article> etc.) AND (<tariffPackage> OR <tariffPackage> etc.) AND <personalAccount> AND <code> AND totalTimeMinute AND nOfPurchases AND totalTicks

In other words: Articles and Tariff Packages are OR:ed between themselves. Then all parts must be fulfilled for the rule to be taken into account.

Note:
If an element is not used it is considered to be true.

attributes

Description:

mode

Value:Online:
Only online validation. If CWT lost communication with WebOffice, no purchase is allowed. Validation is made in WebOffice against purchases made in a Company.
Offline:
Offline: Only offline. Validation is made against purchase made locally in this terminal.
OnlineOfflineFallback:
Online in first hand. If communication with WebOffice is lost, the validation is made offline.
Description:The mode attribute sets where the purchase is validated.
The rules are always on terminal level independent of online or offline.

Note:
When in Online or OnlineOfflineFallback mode, the CWT will verify a purchase against the data available in WebOffice. If for some reason the job SubmitStatistics has not been run, some of the purchases may not be available for validation. This may cause a purchase to be accepted where it should be denied

Example:<PURCHASERULES mode="Offline"/>

validation

Value:OnAccept, OnCodeinput, OnCodeInputAndAccept
Default:OnAccept
Description:The attribute controls when to validate against purchase rules.
OnCodeInput validation requires the payment service to use userIdentifer="Code" and it also requires an ARTICLE and TARIFFPACKAGE for validation to take place.
Note that a purchase can pass a validation on code input but be denied on accept due to several reasons; purchased amount, article or tariff package has changed after Code input.

Note: OnCodeInput is only suitable for nofPurchases rule.

Example:Only validate purchase rules on code input:

<PURCAHSERULES validation ="OnCodeInput"/>

Example:

Rule A:

“Allow only 5 purchases with Article id = 1000 or 1001 within a rolling period of 24h.”

Rule B:

“Allow only purchases up to $1000 with each code within a rolling period of 3h.”

<PURCHASERULES validation="OnCodeInputAndAcceptmode="Online">
  <rule id="0" name="A" nofPurchases="5" type="Rolling" cleared="1440">
    <article id="1000"/>
    <article id="1001"/>
  </rule>
  <rule id="1" name="B" totalTicks="1000" type="Rolling" cleared="180">
    <code/>
  </rule>
</PURCHASERULES>

Rule C:

“Allow total 2000 minutes with Article id = 0 or 1 and TariffPackage 1 within a week, Fixed period, cleared will be every Monday at 12:30.”

<rule id="1" name="B" totalTimeMinute="2000" type="Fixed" cleared="Weekly" weekday="Monday" time="12:30"/>
 <article id="0"/>
 <article id="1"/>
 <tariffPackage id="2"/>
</rule>