Contents

Using our JavaScript Library

 

Rules can be activated for individual transactions by updating the payload submitted within the JWT to include the unique ruleidentifier. Rules specified in the JWT will instruct our system to perform certain actions if pre-defined criteria are met (regardless of whether the rules have been set to active in MyST). The following is an example of a JWT where two rules STR-1 and UDR-23 are specified:

 


{"payload":{"accounttypedescription":"ECOM","baseamount":"1050","currencyiso3a":"GBP","sitereference":"test_site12345","ruleidentifier":["STR-1","UDR-23"]},"iat":1559033849,"iss":"jwt.user"}

Info
Rules cannot be inherited in child requests.

 

Field specification

Key

 

Field name Type Request Description
ruleidentifier Alphanumeric including hyphens As shown in the example request above, you can submit unique identifiers for rules to be applied to this request (e.g. STR-1).

 


 

Was the action performed?

If a rule was applied to a request and the criteria specified in the condition were met, resulting in the action being triggered, the response JWT contains additional fields to confirm this has taken place. Please refer to the example response JWT below, where two rules were applied and their actions were performed.

Info
If a condition is not met, the action will not be performed and no additional fields will be returned in the response JWT.

 


{
  'requestreference': 'A0bxh87wt',
    'version': '1.00',
    'response': [{
      'transactionstartedtimestamp': '2016-12-07 11:32:44',

#### OTHER FIELDS NORMALLY RETURNED IN AUTH RESPONSE ####

            'rules': [{
              'ruleidentifier': 'STR-1',
              'ruledescription': 'Auth security code not matched - Merchant decline'
            }, {
              'ruleidentifier': 'UDR-23',
              'ruledescription': 'successful Visa AUTH - server 1'
            }],
    }]
}

 

Key

Field name Type Response Description
rules If any actions were performed, rules is returned in the response JWT.

This contains information for each rule where an action was performed.

ruleidentifier Alphanumeric including hyphens For each rule where action was performed, the unique rule identifier (e.g. STR-1) will be returned in the response JWT.

Always returned if an action has been triggered, otherwise not returned.

ruledescription Alphanumeric For each rule where action was performed, the rule description will be returned in the response JWT. This consists of the condition name and action name in a string, both separated with a hyphen, as shown in the response example above.