<commit_before><?php
/**
 * Checkout.com
 * Authorized and regulated as an electronic money institution
 * by the UK Financial Conduct Authority (FCA) under number 900816.
 *
 * PHP version 7
 *
 * @category  Magento2
 * @package   Checkout.com
 * @author    Platforms Development Team <<EMAIL>>
 * @copyright 2010-2019 Checkout.com
 * @license   https://opensource.org/licenses/mit-license.html MIT License
 * @link      https://docs.checkout.com/
 */

namespace CheckoutCom\Magento2\Plugin\Backend;

use Magento\Sales\Api\OrderRepositoryInterface;

/**
 * Class PaymentAfterVoid.
 */
class PaymentAfterVoid
{
    /**
     * @var Session
     */
    public $backendAuthSession;

    /**
     * @var WebhookHandlerService
     */
    public $webhookHandler;

    /**
     * @var Config
     */
    public $config;

    /**
     * PaymentAfterVoid constructor.
     */
    public function __construct(
        \Magento\Backend\Model\Auth\Session $backendAuthSession,
        \CheckoutCom\Magento2\Model\Service\WebhookHandlerService $webhookHandler,
        \CheckoutCom\Magento2\Gateway\Config\Config $config
    ) {
        $this->backendAuthSession = $backendAuthSession;
        $this->webhookHandler = $webhookHandler;
        $this->config = $config;
    }

    /**
     * Create transactions for the order.
     */
    public function afterVoid(\Magento\Payment\Model\Method\AbstractMethod $method)
    {
        if ($this->backendAuthSession->isLoggedIn()) { 
            // Get the payment
            $payment = $method->getInfoInstance();

            // Get the order
            $order = $payment->getOrder();

            // Get the method id
            $methodId = $payment->getMethodInstance()->getCode();

            // Process the webhooks
            if (in_array($methodId, $this->config->getMethodsList())) {
                $this->webhookHandler->processAllWebhooks($order);
            }
        }

        return $order;
    }
}<commit_msg>Updated the after void plugin class<commit_after><?php
/**
 * Checkout.com
 * Authorized and regulated as an electronic money institution
 * by the UK Financial Conduct Authority (FCA) under number 900816.
 *
 * PHP version 7
 *
 * @category  Magento2
 * @package   Checkout.com
 * @author    Platforms Development Team <<EMAIL>>
 * @copyright 2010-2019 Checkout.com
 * @license   https://opensource.org/licenses/mit-license.html MIT License
 * @link      https://docs.checkout.com/
 */

namespace CheckoutCom\Magento2\Plugin\Backend;

/**
 * Class PaymentAfterVoid.
 */
class PaymentAfterVoid
{
    /**
     * @var Session
     */
    public $backendAuthSession;

    /**
     * @var WebhookHandlerService
     */
    public $webhookHandler;

    /**
     * @var Config
     */
    public $config;

    /**
     * PaymentAfterVoid constructor.
     */
    public function __construct(
        \Magento\Backend\Model\Auth\Session $backendAuthSession,
        \CheckoutCom\Magento2\Model\Service\WebhookHandlerService $webhookHandler,
        \CheckoutCom\Magento2\Gateway\Config\Config $config
    ) {
        $this->backendAuthSession = $backendAuthSession;
        $this->webhookHandler = $webhookHandler;
        $this->config = $config;
    }

    /**
     * Create transactions for the order.
     */
    public function afterVoid(\Magento\Payment\Model\Method\AbstractMethod $method)
    {
        if ($this->backendAuthSession->isLoggedIn()) { 
            // Get the payment
            $payment = $method->getInfoInstance();

            // Get the order
            $order = $payment->getOrder();

            // Get the method id
            $methodId = $payment->getMethodInstance()->getCode();

            // Process the webhooks
            if (in_array($methodId, $this->config->getMethodsList())) {
                $this->webhookHandler->processAllWebhooks($order);
            }
        }

        return $method;
    }
}
{'fraction_non_alphanumeric': 0.11987704918032786, 'fraction_numerical': 0.00973360655737705, 'mean_word_length': 2.3149405772495757, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 33, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4313829', 'n_tokens_mistral': 1125, 'n_tokens_neox': 1106, 'n_words': 231}