Quick Links

How to Install and Set Up the Kount Magento Extension

Provide comprehensive security for your Magento ecommerce transactions by using the Kount Magento extension as part of your integration to Kount.

Kount aggregates and evaluates data from two primary sources, the Device Data Collector (DDC) and the Risk Inquiry Service (RIS).

The DDC gathers information about an end user’s device, then covertly passes the information to Kount. Kount's interaction is concealed to the end user and does not affect the end user experience.

The RIS evaluates the DDC information in conjunction with order form data, and then compares it to data in Kount's Identity Trust Global Network™ to create a fraud score. Customer-specified rules are also assessed for each transaction during this evaluation process.

Once an order has been evaluated, a response string of key value pairs is returned and includes a score, a device fingerprint, and an automated response code. Upon receipt of this response data, the customer can then disposition orders according to their specific policies.

Every transaction travels through the sources listed above, is filtered through any applicable customer defined rules, and then is returned to the customer with a risk score and response.

The Magento Workflow Diagram below provides an overview of how a transaction flows through Magento once the Kount extension is installed.

mceclip0.png

The Kount Magento extension was written and is supported by a third-party development firm. Support and point releases are ongoing. If additional extensions or customizations have been added to your instance of Magento, conflicts might occur and can result in additional support and/or maintenance fees outside the Kount standard integration.

Kount Environments

Kount has separate environments for testing and production. The initial integration takes place in the Kount TEST environment. Boarding documents containing the information for the TEST environment are emailed to the customer.

The TEST environment does not support load testing; its purpose is to verify connectivity and proper data submission. Certain features such as order linking, scoring, device location, and persona-related information are disabled or limited in the TEST environment. PRODUCTION traffic should not be sent to the TEST environment due to the possibility of skewed scoring from the test orders.

Test credit cards can be passed into the TEST environment but fail in the PRODUCTION environment.

Port 443/HTTPS is required for submission and receipt of data in both the TEST and PRODUCTION environments.

API keys are required to authenticate to Kount when using RIS, making an API call, or for various system integrations. Each customer is assigned a 32-character hash key that acts as a password for their API calls. API keys are unique per customer and environment.

This key must be kept private. If the customer – or Kount – believes the API key has been compromised, a new key must be issued.

Steps for creating an API key

  1. Log into the Agent Web Console.

  2. Click Admin, and then select API Keys.

  3. Click Create API Key.

  4. Enter a Key Name, select your desired Key Permissions (typically RIS and API), and then click Create API Key. If the key is successfully created, a confirmation displays.

  5. The new key displays on the API Key Management screen.

  6. Copy and paste the API key into other applications, as necessary.

Integration Certification

Upon verification that the correct data is being passed for both the DDC and RIS, the merchant is issued a certification letter along with an additional boarding document providing the PRODUCTION environment information.

Any customized data created in the test environment must be recreated in the PRODUCTION environment. This includes users, rules, site IDs, user defined fields, and API keys.

The TEST environment is available to the merchant for testing purposes and must not be used for production transactional traffic.

Installing the Kount Magento extension

To troubleshoot any potential issues encountered during installation, enable logging before starting the installation process. This setting can enable/disable logging for the Kount Extension.

Kount extension logging is also dependent on the Magento global logging settings. The download link enables direct download access to the log files. Check your configuration file and make sure that logging is enabled in Magento.

Note: Go to Magento 2 System Requirements for supplemental information to complete the following steps.

There are two methods for installing the Kount Magento Extension:

  • Composer – (KOUNT RECOMMENDED) Use the Composer package manager to define the Kount Magento Extension as a dependency in your project. Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on, and it installs and updates them for you. This installation method is useful if you are a developer already using Composer in your project or are interested in easily managing upgrades.

  • Manual copy – Decompress the extension archive and place the files in the appropriate file structure within your Magento installation. This method assumes the required SDK is also installed via composer found in the GitHub SDK repository. Installing the SDK with composer is the easiest path. Additional support is at the expense of the customer.

Note: Missing a step can cause unexpected results and/or issues in your Magento installation. If you encounter an issue that causes your installation to fail or you are seeing error messages, reinstall the module and then restart from the first step.

Merchant IDs and URLs associated with the DDC and RIS processes are sent within the Sandbox Boarding Information document during the initial kick-off call.

Installing using Composer

The module can be installed two different ways when using composer.

Install the Kount Magento 2 module using composer

Copy the code below to install the Magento module and its dependencies.

    composer require kount/magento2-kount

    php bin/magento module:enable kount

    php bin/magento setup:upgrade

Install the Kount Magento 2 module using composer artifacts

  1. Enable the cache by going to System and then Cache Management before installing any extension.

  2. Download the extension ZIP archive and save it somewhere outside of your Magento project.

    Note: Download the SDK and the Magento Kount Module.

  3. Navigate to your Magento project root.

  4. Run the following composer command:

    composer config repositories.artifacts
        artifact </full/path/to/folder/with/extension/archive>

    The command adds the following code into the composer.json file in the repositories node. If the node does not exist, it is created.

    “artifacts”: {
        “type”: “artifact”,
        “url”: “/full/path/to/folder/with/extension/
        archive>” }
        
  5. Add composer artifact data to your composer.lock. Your composer.lock file

    looks similar to this: File example forcomposer.lock

    "name": "kount/kount-ris-php-sdk",
    "version": "7.3.9",
    "dist": {
    "type": "zip",
    "url": "artifacts/kount-ris-php-sdk.zip",
    "shasum": "4cb57a7c6ad2f168fec5fc6bf78bf763b5688e80"
    },
    "require": {
    "ext-curl": "*",
    "ext-json": "*",
    "ext-mbstring": "*",
    "ext-xml": "*",
    "php": ">=7.2.5"
    },
    "require-dev": {
    "phpdocumentor/phpdocumentor": ">=2.0",
    "phpunit/php-code-coverage": "^9.2.3",
    "phpunit/phpunit": "^9.5.3"
    },
    "type": "library",
    "autoload": {
    "classmap": [
    "./src/"
    ]
    },
    "notification-url": "https://packagist.org/downloads/", "license": [
    "proprietary"
    ],
    "authors": [
    {
    "name": "Kount",
    "email": "support@kount.com"
    }
    ],
    "description": "PHP client for Kount Risk Inquiry Service.",
    "homepage": "https://github.com/Kount/kount-ris-php-sdk",
    "keywords": [
    "payments",
    "sdk",
    "test"
    ],
    "support": {
    "issues": "https://github.com/Kount/kount-ris-php-sdk/issues",
    "source": "https://github.com/Kount/kount-ris-php-sdk/tree/7.3.9"
    },
    "time": "2021-03-26T12:46:42+00:00"
    },
    {
    "name": "kount/magento2-kount",
    "version": "4.3.4",
    "dist": {
    "type": "zip",
    "url": "artifacts/magento2-kount.zip",
    "shasum": "4cb57a7c6ad2f168fec5fc6bf78bf763b5688e80"
    },
    "require": {
    "kount/kount-ris-php-sdk": "^7.2",
    "magento/framework": "^102.0.0|^103.0.0",
    "magento/module-backend": "^100.0.0|^101.0.0|^102.0.0",
    "magento/module-checkout": "^100.0.0",
    "magento/module-config": "^100.0.0|^101.0.0", "magento/module-customer": "^100.0.0|^101.0.0|^102.0.0|^103.0.0",
    "magento/module-directory": "^100.0.0",
    "magento/module-payment": "^100.0.0",
    "magento/module-paypal": "^100.0.0|^101.0.0",
    "magento/module-sales": "^100.0.0|^101.0.0|^102.0.0|^103.0.0",
    "magento/module-store": "^100.0.0|^101.0.0"
    },
    "type": "magento2-module",
    "autoload": {
    "files": [
    "registration.php"
    ],
    "psr-4": {
    "Kount\\Kount\\": ""
    }
    },
    "notification-url": "https://packagist.org/downloads/", "license": [
    "proprietary"
    ],
    "authors": [
    {
    "name": "Kount",
    "homepage": "https://kount.com"
    }
    ],
    "description": "Magento 2 Kount Integration",
    "keywords": [
    "kount",
    "magento2"
    ],
    "support": {
    "issues": "https://github.com/Kount/magento2-kount/issues",
    "source": "https://github.com/Kount/magento2-kount/tree/4.3.4"
    },
    "time": "2021-10-04T14:50:30+00:00"
  6. Run composer command:

    composer require kount/magento2-kount
  7. Enable the module and upgrade the database by running the following commands:

        php bin/magento module:enable Kount_Kount
        php bin/magento setup:upgrade
        

Copying files

  1. Enable the cache by going to System, and then Cache Management before installing any extension.

  2. Open the extension ZIP file you downloaded from the Magento Marketplace and extract it to a directory on your computer.

  3. Using the files extracted, copy <magento_root>/app/code/Kount/Kount of the Magento project.

  4. Enter the following commands from the root of Magento project in a command line, or terminal:

        php bin/magento module:enable Kount_Kount
        php bin/magento setup:upgrade
        

Troubleshooting Installation

  • Module is not showing up in the admin panel or does not work as intended:

    Try manually deleting content of the /var/cache/, /var/generation/ and /var/di/ (/generated/ for Magento 2.2) directories. Remember that these directories are in the root of your Magento installation.

  • Module continues being hidden or inactive from your Magento installation:

    Double-check that all files are in their correct respective locations per the file structure of the module and the official file structure of Magento. It is imperative that you do not forget to upload any single file as this could cause errors and/or unexpected behavior that you may be experiencing.

  • Module continues to remain inactive after the previous two attempts:

    Make sure your Magento installation has the correct file permissions for each uploaded file. Remember that the files must be readable by the web server to run properly.

  • Receiving errors that Class XYZ could not be found:

    Reinstall your module, making sure that you have triple-checked all the correct files have been uploaded.

  • Receiving blank pages, 50x errors, or Exception printing is disabled:

    Enable developer mode in Magento to see the real error messages that are displaying.

Contact Kount Support if you continue to receive errors.

Configuration

The configuration of the Kount Magento Extension occurs within the Magento Admin Panel. You must have admin access to view and administer the Kount Magento Extension.

Once the Kount Magento Extension has been installed, follow the instructions below to configure Magento for Kount Command or Kount Control.

Configuring Magento for Kount Command

  1. Log into the Magento Admin Panel.

    mceclip0 (1).png
  2. Configure Kount Integration Options by going to Stores and then Configuration.

    mceclip3.png
  3. Click the Kount Integration Options.

  4. Click on the arrows to expand each configuration section on the Kount Integration Options page. Fill out the configuration settings using the information in the following sections.

Account Information

Fill out the Account Information section using the following information:

Enabled: Toggle the Kount extension from being Enabled or Disabled in the Magento Order Management workflow.

Merchant Number: The merchant number issued by Kount. This merchant number is the same regardless if it is in the Kount Test or Production environment.

Website ID: On the initial install this field is set as Default. This allows multiple sites within the Magento instance to be managed by Kount. Different rules and searching features can be created for different sites.

Environment: is setting determines to which Kount environment the Magento instance is posting data.

API Key: The Kount Command API key is used for authentication and is created and visible within the AWC by going to Admin and then API Keys.

Payment Review Workflow

Fill out the Payment Review Workflow section using the following information:

Payment Review Workflow Mode: Specify when Kount is queried.

  • Pre-Authorization Payment Review: Query Kount before the payment gateway.

  • Post-Authorization Payment Review: Query Kount after the payment gateway.

    Note: For Post-Authorization transactions, there is not a notification presented to the end user upon checkout if a decline rule is triggered.

Decline Action: The Decline Action options are specific to Post-Authorization transactions. Based on the authorization strategy a customer has chosen – whether to authorize and capture later or authorize and capture together – different decline actions are required to configure.

Hold Order/Decline Status: This places the order in a hold state but sets the status to decline within Magento. This allows customers to release the order if the transaction was a false decline without making the end user resubmit the transaction.

  • Cancel Order/Void Payment: Select this option to cancel orders only when authorization happens at checkout and capture is separate.

  • Refund/Credit Order: Select this option to cancel orders where the transaction is authorized and captured at the same time.

Disable Payment Methods

Fill out the Disable Payment Methods section using the following information:

Disable Payment Method Codes: If any of these payment methods are selected, a query is not sent to Kount for analysis. This functionality provides customers the ability to whitelist payment methods that they do not want to be evaluated by Kount.

We recommend that you whitelist the Kount scripts to bypass Content Security Policies (CSP), if the CSP Module is enabled.

CSP implementation example:

<?xml version="1.0" encoding="UTF-8"?>

<csp_whitelist

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 9 xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Csp:etc/csp_whitelist.xsd">

<policies>

<policy id="script-src">

<values>

<value id="kount" type="host">.kaptcha.com</value>

</values>

</policy>

<policy id="connect-src">

<values>

<value id="kount" type="host">.kaptcha.com</value>

</values>

</policy>

</policies>

</csp_whitelist>

Phone to Web: Admin Ordering

When a customer submits phone orders with the same web page interface as an end user, the customer’s device data – not the end user’s device data – is sent to Kount. This causes order linking to occur and, in time, elevates the score of all orders associated with the persona.

Do not send Kount your internal device data. To block the device data of customer service representatives from being sent to Kount, set the Phone To Web Enable configuration to enabled by selecting Yes and then add the IP addresses associated with the customer service network(s) to the IP Address Exclude text box.

Logging

The logging functionality enables or disables logging Kount information to the server. Select Yes or No to enable or disable logging.

Configuring Magento for Kount Control

  1. Go to the Configuration page and then select Kount 2FA.

  2. Under General Configuration, click the Enable drop-down menu.

    mceclip0 (2).png
  3. Click Yes.

  4. Click Save Configuration.

  5. Click Kount Integration.

    mceclip1 (1).png
  6. Fill out the Account Information.

    • Enabled: Use the drop-down menu to select Yes.

    • Merchant Number: The merchant number issued by Kount. This merchant number is the same regardless if it is in the Kount Test or Production environment.

    • Website ID: During the initial install, this field is set as Default. This allows multiple sites within the Magento instance to be managed by Kount. Different rules and searching features can be created for different sites.

    • API Key: The Kount Control API key is generated by Kount and provided by your Solutions or Implementation Engineer.

  7. Fill out the Services Information form.

    mceclip2 (1).png
    • Is Login API enabled: Use the drop-down menu to select Yes.

    • Is Trusted Device API enabled: The Trusted Device service might store a trust relationship between a device and a specific end user. End users typically use a few devices to log in to various systems. By identifying these devices (cell phones, work laptops, home computers, etc) for specific end users, policies can be created to reduce login times.

    • Amount of failed attempts to pass 2FA: Select the use system default checkbox for the default setting. The default value is zero.

    • Is Sign-up API enabled: This option is responsible for an end user's registration validation. If an end user with decline@mail.com wants to register a new account, the email exists in AWC, and the status is set to Decline, registration will fail with an error message:

      mceclip3 (2).png

      If a new end user's email status is set to Approve or Review in AWC, then registration will continue to the next screen without an error code.

Policies

In order to change the module's behavior for testing purposes after logging in, create a Kount Test Portal account.

  1. After logging in, select Decision Manager, and then select Policies to edit the Demo Challenge policy.

    mceclip4.png
  2. In the Condition section, use the drop-down menu to select an option within the THEN section. Refer to the Conditions section for information about specific condition options.

    mceclip5 (2).png
  3. Click Save Policy.

    Note: Wait two to five minutes while the policy is applied.

Conditions

If conditions are true and the apply no decision option is selected, the end user logs in without any checks and restrictions.

If conditions are true and the block option is selected, the end user is redirected to the login page when they try to log in. This displays a message: "The sign-in is not available for your customer account."

If conditions are true and challenge is selected, then the end user is prompted with the 2FA Setup page. The Log Out link is the only available link from this page. When the user tries to log in again 2FA Setup page will be open.

  1. When entering an invalid code, this message displays: "Invalid 2FA Authentication Code."

  2. When entering an invalid code N times (path to the config: Admin > Stores > Configuration > Kount > Kount Control Integration > Amount of failed attempts to pass 2FA). If the checkbox Use system value is selected, then N = 0.

It redirects to the login page and show the message: "Invalid 2FA Authentication Code. You have spent all possible tries to enter valid 2FA code. Please log in again!"

When a user tries to log in again 2FA Setup page is open. Scan QR-code (for example, via app “Google Authenticator”) and enter valid code. It can enter to customer account and show the message: "2FA successfully set up."

Payment Workflow

Option 1: Pre-Authorization Payment Review

mceclip6.png

Option 2: Post-Authorization Payment Review

Picture2.png

Ability to Disable Payment Methods

mceclip7 (1).png

Notifications

mceclip8 (1).png

Logging

mceclip9 (1).png

Admin Ordering

mceclip10 (1).png

Ordering Settings

When an order is marked for review, the Kount module’s default state is set to automatically hide orders for end users on the front-end of the Magento store.

  1. To change the default state, go to the Admin panel.

  2. Change the answers to Yes to display the order to an end user after they have been marked for review.

    Picture3.png

As illustrated in the Magento Payments Workflow Diagram, Kount is involved prior to or after the payment processor is queried for authorization. In the Pre-Authorization scenario, all transactions are processed by Kount. In the Post-Authorization scenario, the customer chooses whether to pass on orders that were declined by the payment processor. Based upon the rules created by the customer, one of four actions are returned from Kount: Decline, Approve, Escalate, or Review.

Pre-Authorization

Decline

When a transaction is evaluated by Kount and one or more customer-created decline rule conditions are triggered, the order does not continue to the payment processor for authorization, and a failure message is presented to the end user. This allows customers to create Decline rule conditions and automatically stop transactions from being submitted to the payment processor.

Similar to when a transaction is declined by the payment processor, when transactions are declined by Kount, no reference of that transaction is found in the Magento Order Management panel. Since Kount is queried before the processor, declined transactions are displayed in the AWC..

Approve

When a transaction is evaluated by Kount and no customer-created rule conditions for Decline, Review, or Escalate are triggered, the order is flagged with a status of Approve and continues to the payment processor for authorization. The default status within Magento for a Kount Approve order is Processing.

mceclip11.png

Post-Authorization

Decline

Unlike the Pre-Authorization workflow, when a transaction is evaluated by Kount and one or more customer-created Decline rule conditions are triggered, the end user is not presented with an error popup or notification that the transaction failed.

Within Magento, the inventory is replaced. The order is then refunded if it was authorized and captured. If the order was only authorized during checkout, it is canceled.

The third option is to change the order status to On Hold.

Approve

When a transaction is evaluated by Kount and no customer-created rule conditions are triggered, the order is flagged with a status of Approved. The default status within Magento for a Kount Approve order is Processing.

mceclip13.png

Review and Escalate

When a transaction is evaluated by Kount and one or more customer-created rule conditions for Review or Escalate are triggered, the order is flagged as a status of Review or Escalate and continues to the payment processor for authorization. The default status within Magento for a Kount Review or Escalate Order is Review.

mceclip14.png

Managing Review Transactions

If the Event Notification Service (ENS) has been enabled, transactions administered within the AWC can interact with Magento. To enable the ENS, refer to the Configuration section.

The transaction is placed in an On Hold state within Magento and labeled with a status of Review when a transaction is flagged by Kount for Review or Escalate. Upon reviewing the transaction details within the AWC, each transaction can be manually approved or declined.

If ENS is configured, when changing the status of an order either approving or declining, an event is sent from Kount to the Magento server, and the order is removed from the Review status and placed back into the status prior to being placed in the On Hold state.

Manual Approve

When a transaction is manually approved within the AWC, an event is sent from Kount to Magento indicating an approved status. Within the Magento order management framework, the transaction is removed from the Review status and returned to the status within Magento prior to being placed On Hold, which is normally Processing.

Manual Decline

When assigning a transaction to a Decline status within the AWC, an event is sent to Magento releasing the order from the Review status resulting in a Closed status and attempts to cancel the authorization and refund the charge.

Transactions flagged for Manual Review:

mceclip15.png

Transactions Manually Approved, Manually Declined, still in Review:

mceclip16.png

Inventory Management

No inventory is allocated from within Magento when a transaction is declined by either Kount or the payment processor. For orders that are flagged as Review, inventory is reserved for that item. If a transaction is being held and manually declined, the inventory item is returned and inventory incremented. Otherwise, if the transaction being held for review is manually approved the inventory remains decremented.

Payment Refunds

Pre-Authorization

Normally there are two options regarding credit card payment authorization: authorization and capture of funds together or capturing funds later.

If the online refund is not possible (typically when no payment has yet been made on the order and no invoice created), the extension attempts to cancel the order.

If an online refund is not possible or not successful, and it is not possible to cancel an order; the order is not set to the Kount Decline order status and placed in the On Hold order state.

Post-Authorization

A decline action must be specified when Post-Authorization is chosen within the Kount Integration Options.

For authorization, only the Cancel Order and Void Payment options are selected. When authorization and capture happens at the same time, the Refund/Credit Order option must be selected. This creates a credit memo and refund or it voids the payment record, depending on the payment method used on the order.

Orders submitted by Customer Service Representatives

There are two methods when submitting orders by customer service representatives. The first method is to create an order within the Magento Admin Console and the second is to submit the order as a customer through the site’s checkout page.

If orders are submitted through the Magento Admin Console and need to be evaluated by Kount, configure the Kount integration option for Admin Ordering to be enabled.

mceclip17.png

The Phone To Web option must be configured when orders are submitted through the customer checkout page. The IP address(es) of the service center must be added to the configuration. Once the IP address(es) is added, all device information related to the IP address is no longer associated with the transaction. This ensures that order linking based on the device does not occur.

Configuring Multiple Sites

Each site can be administered independently by Kount if multiple sites are administered within a single Magento instance. This can be accomplished by creating additional site IDs in the AWC and configuring the Magento Kount Integration Options.

  1. Click the Default Config drop-down menu and select Second Store View to access the additional site configuration within Magento.

    mceclip18.png
  2. In the Website ID field, deselect the Use Default checkbox and input the new Site ID that was created in the AWC.

    mceclip19.png
  3. Click Save Config.

ENS

Kount provides the ability to manually approve or decline transactions within the AWC, then have that action POST back to the Magento instance. This interaction is dependent upon the ENS URL being configured within the AWC.

A load balancer is part of the network infrastructure and can be configured with Magento Admin Console. Within the Kount extension, security measures are implemented to protect against unauthorized submissions. Only ENS events sent from Kount are accepted. The ENS events are queued within Kount and then pushed out to the customer. There can be up to a 30 second delay for the information to be updated between systems.

To begin, go to the Event Notifications section of the Kount Integration Options menu within the Magento Admin Panel. A portion of the URL string that is displayed is used for the configuration.

mceclip0 (3).png

Note: Additional IP addresses and IP ranges can be added in the Additional IPs for Load Balancer textbox.

Customizing the ENS Path Within the AWC

  1. Log into the AWC and go to Fraud Control and then the Websites menu:

    mceclip1 (2).png
  2. If multiple sites are being hosted, choose the appropriate site, and click Edit (gear icon).

    mceclip2 (2).png
  3. Choose the ENS Enabled radio button and then paste in the portion of the URL that was selected from the Event Notifications.

    mceclip3 (3).png
  4. Click Update Website.

    Note: When adding or editing the ENS URL, there is a five-minute delay before the URL takes effect. It might be necessary to whitelist specific IP addresses for notifications to be delivered to the server. Contact a Customer Success Manager to obtain the ENS IP addresses.

Test ENS Communication

To ensure ENS communication occurs between Kount and Magento:

  1. Submit an order that triggers a rule to Review or Escalate the transaction.

  2. Locate the rule, and then change the Review/Escalate status to Approve or Decline. ENS then communicates with Magento and update the status.

Note: The ENS service is designed to trigger only when an order triggers a Review/Escalate Rule. ENS events are not generated for orders that did not initially trigger a Review/Escalate status.

Rule Actions that do communicate back to Magento for a status change:

  • Review to Approve

  • Review to Decline

  • Escalate to Approve

  • Escalate to Decline

Rule Actions that do not communicate back to Magento for a status change:

  • Approve to Decline

  • Approve to Review

  • Approve to Escalate

  • Decline to Approve

  • Decline to Review

  • Decline to Escalate

Integrating Kount with a Custom Payment Method

Note: This documentation is meant for developers. You must be familiar with extending Magento functionality to integrate Kount with a custom payment method.

The extension defines a workflow interface, implemented for Pre-Authorization and Post-Authorization workflows.

interface WorkflowInterface

{
/**


* @param \Magento\Sales\Model\Order\Payment $payment

* @throws LocalizedException

*/

public function start(Payment $payment);

/**

* @param \Magento\Sales\Model\Order $order

* @throws LocalizedException

*/

public function failure(Order $order);

/**

* @param \Magento\Sales\Model\Order $order

* @throws LocalizedException

*/

public function success(Order $order);
  • The start method is called on the sales_order_payment_place_start event.

  • The success method is called on the checkout_submit_all_after event.

  • The failure method is called on the sales_model_service_quote_submit_failure event.

Standard Magento Payment Workflow

Kount works with all default Magento payment methods out of the box. The Kount extension collects all necessary data except payment (credit card) data. By default, it sets a no payment flag.

You need to add a custom RIS payment builder to send additional payment data to Kount. There are two payment builders available:

Note: If a custom payment workflow is not created, the default workflow is used \Kount\Kount\Model\Ris\Inquiry\Builder\Payment\NoPayment.

  • Inquiry builder: used for initial requests to Kount in both workflows (Pre-Authorization and Post-Authorization).

  • Update builder: used for updating a Kount account after a successful or failed order is placed. Should only be used with Pre-Authorization workflow.

Both RIS payment builders must implement the \Kount\Kount\Model\Ris\Base\Builder\PaymentInterface interface. It has one method, process(), which expects the RIS request and order payment objects as parameters.

The second step is an addition of these builders into RIS inquiry and update builders by using dependency injection (DI).

<virtualType

name="Kount\Kount\Model\Ris\Inquiry\Builder\Payment"

type="Kount\Kount\Model\Ris\Base\Builder\Payment">

<arguments>

<argument name="payments" xsi:type="array">

<item name="custom_payment_code" xsi:type="string">Custom\Inquiry\Payment\Builder</item>

</argument>

</arguments>

</virtualType>

<virtualType

name="Kount\Kount\Model\Ris\Update\Builder\Payment"

type="Kount\Kount\Model\Ris\Base\Builder\Payment">

<arguments>

<argument name="payments" xsi:type="array">

<item name="custom_payment_code" xsi:type="string">Custom\Inquiry\Payment\Builder</item>

</argument>

</arguments>

</virtualType>

Payment information which could be added to the RIS

request:

$request->setCardPayment() // card number

$request->setExpirationYear(); // expiration year

$request->setExpirationMonth(); //expiration month

$request->setAvst(); // AVS street address reply from

payment

$request->setAvsz(); // AVS zip code reply from payment

$request->setCvvr(); //CVV/CVC/CVV2 reply from payment

Note: Non-standard workflows include Authorize.Net, DirectPost, and PayPal Express Checkout.

Disabling calling workflow methods on default events

It might be necessary to disable calling workflow methods on the standard events and instead call them during other events.

Each observer for these events has a dependency on \Kount\Kount\Model\Observer\ConditionInterface. The default condition allows to execute an observer, and it's possible to configure conditions for each payment method via dependency injection. An example of this is done for Authorize.Net DirectPost on the checkout_submit_all_after event:

<virtualType name="Kount\Kount\Model\Observer\SubmitAllAfter\Condition" type="Kount\Kount\Model\Observer\Condition">

<arguments>

<argument name="conditions" xsi:type="array">

<item name="authorizenet_directpost" xsi:type="string">Kount\Kount\Model\Observer\Condition\Negative</item>

</argument>

</arguments>

</virtualType>

This disables the workflow method call on the checkout_submit_all_after event.

There are two already-implemented conditions in the extension, Negative and Positive, which could be used for enabling/disabling the calling of methods on events. If you want to use any custom logic to determine the positive or negative conditional, simply create your own implementation of \Kount\Kount\Model\Observer\ConditionInterface.

Calling Workflow Methods on Custom Events

An example of calling workflow methods on custom events can be seen in the

\Kount\Kount\Plugin\PayPal\Controller\Payflow\ReturnUrl class. You need to add three dependencies to the custom observer:

/**

* @var \Kount\Kount\Helper\Workflow

*/

protected $helperWorkflow;

/**

* @var \Kount\Kount\Model\Config\Workflow

*/

protected $configWorkflow;



/**

* @var \Kount\Kount\Model\WorkflowFactory

*/

protected $workflowFactory;


And use them as such:

if (!$this->helperWorkflow->isProcessable($order))

{ return $result;

}


$workFlowType = $this->configWorkflow-

>getWorkflowMode($or- der->getStoreId());

$workFlow = $this->workflowFactory-

>create($workFlowType);


$workFlow->success($order); // or $workFlow-

>failure($order);

The success() and failure() methods require a \Magento\Sales\Model\Order $order object as a parameter. The start() method requires a \Magento\Sales\Model\Order\Payment $payment object as a parameter.

Keep in mind that the custom event must call the workflow’s methods for a specific payment method only. It is possible to reuse conditional logic with a default false condition, as it is done for \Kount\Kount\Observer\PaymentPlaceEnd observer (customization for Authorize.Net DirectPost):

Note: Authorize.net direct post is no longer supported.

<virtualType

name="Kount\Kount\Model\Observer\PaymentPlaceEnd\Conditio

n" type="Kount\Kount\Model\Observer\Condition">

<arguments>

<argument name="default" xsi:type="boolean">false</argument>

<argument name="conditions" xsi:type="array">

<item name="authorizenet_directpost" xsi:type="string">Kount\Kount\Observer\PaymentPlaceEnd\Condition\AuthorizeDirectPost</item>

</argument>

</arguments>

</virtualType>

Troubleshooting

  • The extension can be downloaded on the Kount Support Resource Center along with the TEST environment boarding information.

  • Ensure that the API key is used in the correct Kount environment. The TEST and PRODUCTION environments are completely isolated. It is impossible to utilize the correct API key between the two environments.

  • If the payment authorization rejection from the processor pop-up window keeps appearing when submitting an order, check in the kount.log file where the warnings or errors are displayed.

    mceclip4 (1).png

    The default log location for the Kount extension is found in the following path:

    /var/www/magento/var/log

    Log file names: kount.log, exception.log, system.log

  • Data Collector Issues: The Kount Magento plugin by default adds the device data collector pixel to your checkout page. While this should result in 95-99% of your orders reflecting device data collector information, there are times when it may fail to function correctly. When troubleshooting this issue it is advisable to uninstall and reinstall the Kount Magento plugin and ensure it is the most recent extension installed. This will help correct any issues related to other extensions in preventing the pixel from firing.

Frequently Asked Questions

Where can I download the v1 Magento extension? If you are looking to implement the legacy extension, download the Zip file. Where can I find a list of RIS error codes? Refer to RIS Error Codes. What are the default Magento defined fields? The Kount Magento Extension pre-populates default UDFs. These fields need to be created in the AWC in order to display them within the Transaction Details page. Below is the list of default fields for the latest release of the Kount Magento Extension.

  • ACCOUNT_NAME – Saved name in the Magento account

  • CARRIER – Shipping carrier sent from Magento

  • COUPON_CODE – Coupon code passed in from Magento

  • EXT – Magento Extension Version

  • METHOD – Shipping Method sent from Magento

  • PLATFORM – Magento Platform

  • AVS – AVS response from gateway

  • CVV – CVV response from gateway

For additional information, refer to How to Manage User Defined Fields.

What are some test scenarios for Magento?

Approve

  1. Add JohnDoeApprove@Acme.com email address to the VIP Approve list in the Kount Test environment.

  2. Place a test order using any item, via the front end of the test website.

    1. When filling out the customer information, please use JohnDoeApprove@Acme.com as the email address.

    2. Fill in necessary Test Credit Card information.

  3. Confirm that after the order has been placed that the proper customer experience message is displaying.

  4. Confirm that appears as approved in the Agent Web Console.

Decline

  1. Add JohnDoeDecline@Acme.com email address to the VIP Decline list in the Kount Test environment.

  2. Place a test order using any item, via the front end of the test website.

    1. When filling out the customer information, please use JohnDoeDecline@Acme.com as the email address.

    2. Fill in necessary Test Credit Card information.

  3. Confirm that after the order has been placed that the proper customer experience message is displaying.

  4. Confirm that appears as declined in the Agent Web Console.

Review

  1. Add JohnDoeReview@Acme.com email address to the VIP Decline list in the Kount Test environment.

  2. Place a test order using any item, via the front end of the test website.

    1. When filling out the customer information, please use JohnDoeReview@Acme.com as the email address.

    2. Fill in necessary Test Credit Card information.

  3. Confirm that after the order has been placed that the proper customer experience message is displaying.

  4. Confirm that appears as declined in the Agent Web Console.

    Note: Merchants are responsible for checking interaction with their OMS to validate expected behavior.

Optional Test Scenarios

Shipping/Billing Address Test Scenario

  1. Add JohnDoeReview@Acme.com email address to the VIP Review list in the Kount Test environment.

  2. Place a test order using any item, via the front end of the test website.

    1. When filling out the customer information, please use JohnDoeReview@Acme.com as the email address.

    2. Enter 1234 Main Street, Any Town, ID, USA 83705 for the Shipping Address.

    3. Enter 5678 Oak Street, Any Town, ID 83705 for the Billing Address.

    4. Fill in necessary Test Credit Card information.

  3. Confirm that after the order has been placed that the proper customer experience message is displaying.

  4. Confirm that the order is held as review in the Agent Web Console.

  5. Confirm the Shipping Address passed correctly.

  6. Confirm the Billing Address passed correctly.

Shipping Phone/Billing Phone Test Scenario

  1. Add JohnDoeReview@Acme.com email address to the VIP Review list in the Kount TEST environment.

  2. Place a test order using any item, via the front end of the test website.

    1. When filling out the customer information, please use JohnDoeReview@Acme.com as the email address.

    2. Enter 123-456-7890 for the Shipping Phone Number.

    3. Enter 102-345-6789 for the Billing Phone Number.

    4. Fill in necessary Test Credit Card information.

  3. Confirm that after the order has been placed that the proper customer experience message is displaying.

  4. Confirm that the order is held as review in the Agent Web Console.

  5. Confirm the Shipping Phone passed correctly.

  6. Confirm the Billing Phone passed correctly.

Order Number Test Scenario

  1. Add JohnDoeReview@Acme.com email address to the VIP Review list in the Kount Test environment.

  2. Place a test order using any item, via the front end of the test website.

    1. When filling out the customer information, please use JohnDoeReview@Acme.com as the email address.

  3. Confirm that after the order has been placed that the proper customer experience message is displaying.

  4. Confirm that the order is held as review in the Agent Web Console.

  5. Confirm that the order number has populated correctly.

    Note: Merchants are responsible for validating proper process management and testing interaction with their OMS to validate expected behavior.

What are the RIS payment types for Magento? Kount is integrated with Magento with the following payment types supported natively within the Kount Magento Extension that provides cross-merchant linking with the Kount network:

  • Braintree

  • Authorize.net Direct Post

  • PayPal Express Checkout

  • PayPal Payflow Link

  • PayPal Payflow Pro

  • PayPal Payments Standard

  • PayPal Payments Pro

  • PayPal Payments Advanced

  • eWay (Magento Enterprise Edition)

Was this article helpful?
0 out of 0 found this helpful