CheckVNE
This section describes one of the fraud screening methods used in the development of fraud screening plugins that allow CloudBlue Commerce to integrate with third-party fraud screening systems. For more information, refer to Overview and How to Develop Fraud Screening Plugins.
Method naming convention
%PluginName%_CheckVNE
Purpose
This method checks whether an account, order, or pay tool details are valid and hence whether the customer is eligible to place the order. This method is called when a customer places an order or presses the Validate button on the checkout screen.
Mandatory / optional
This method is mandatory for all validation and eligibility plugins. However, this method is not used in blacklist or non-blacklist plugins. Refer to How to Develop Fraud Screening Plug-ins and fraud screening methods.
Input Parameters
config
: an associative array of the values of configuration parameters entered by the user on the Edit Plug-in Configuration screen.accountAttributes
: an associative array of values with which the customer completes the account attribute fields on the checkout screen.orderAttributes
: an associative array of order details.paytoolAttributes
: an associative array of payment tool details. The payment tool is chosen or created by the user when making a purchase.-
orderLines
– associative array of order line details related to service plan periods (the parameters are grouped logically in the list below):- Order Line ID:
- LineID
- Service Plan:
- plan ID
- plan Name
- service Template ID
- service Template Name
- Service Plan Period:
- period in seconds
- is Trial
- setup Fee
- subscription Fee
- renewal Fee
- transfer Fee
- deposit Fee
- Order Line ID:
-
resourceLines
– associative array of resource rate details:-
Order Line ID:
- LineID
-
Service Plan:
- plan ID
- plan Name
- service Template ID
- service Template Name
-
Resource Rate:
- setup Fee
- recurring Fee
- cost For Additional
-
Return Parameters
check_result
: the result of the validation and eligibility check. Object of the\FraudSDK\CheckVneResult
type.
Relationship with other methods
This method uses the attribute types returned by GetAccountAttributes together with other attribute types.
Implementation example. V&E plugin
function VNEDemo_CheckVne($config, $accountAttributes, $orderItems, $paytoolItems) { $pin_validated = \FraudSDK\mapGetValue($accountAttributes, 'VNEDEMO_PIN_VALIDATED', NULL); if ($pin_validated === '1') { return \FraudSDK\createCheckVneResult() ->setSucceed(); } $msisdn = \FraudSDK\mapGetValue($accountAttributes, 'VNEDEMO_PHONE', NULL); if (is_null($msisdn)) { return \FraudSDK\createCheckVneResult() ->setFailed() ->setMessage('Please, specify MSISDN.') ->hideAttribute('VNEDEMO_PIN') ->showAttribute('VNEDEMO_PHONE'); } $pin = \FraudSDK\mapGetValue($accountAttributes, 'VNEDEMO_PIN', NULL); if (!is_string($pin) || (trim($pin) == '')) { return \FraudSDK\createCheckVneResult() ->setFailed() ->setMessage('PIN code is sent to you via SMS. Please fill in corresponding field.') ->showAttribute('VNEDEMO_PHONE') ->showAttribute('VNEDEMO_PIN'); } if ($pin !== '7777') { return \FraudSDK\createCheckVneResult() ->setFailed() ->setMessage('Invalid PIN Code!') ->showAttribute('VNEDEMO_PHONE') ->showAttribute('VNEDEMO_PIN'); } return \FraudSDK\createCheckVneResult() ->setAttributeValue('VNEDEMO_PIN', '') ->setAttributeValue('VNEDEMO_PIN_VALIDATED', '1') ->setSucceed(); }