<?php
/**
 * Credorax Payments For WooCommerce
 * https://www.credorax.com/
 *
 * @category Credorax
 * @package  WC_Credorax
 * @author   Girit-Interactive (https://www.girit-tech.com/)
 */

 if (! defined('ABSPATH')) {
     exit; // Exit if accessed directly.
 }

/**
 * Credorax Credorax void gateway request model.
 */
class WC_Credorax_Model_Request_Gateway_Cancel extends WC_Credorax_Model_Request_AbstractGateway implements WC_Credorax_Model_RequestInterface
{
    /**
     * Credorax Operation Code
     * @var integer
     */
    const CREDORAX_O = 4;

    /**
     * {@inheritdoc}
     *
     * @return string
     */
    protected function getRequestMethod()
    {
        return WC_Credorax_Model_Request_AbstractGateway::GATEWAY_VOID_METHOD;
    }

    /**
     * {@inheritdoc}
     *
     * @return string
     */
    protected function getResponseHandlerType()
    {
        return WC_Credorax_Model_Response_AbstractGateway::GATEWAY_VOID_HANDLER;
    }

    /**
     * {@inheritdoc}
     *
     * @return array
     * @throws \Exception
     */
    protected function getParams()
    {
        return array_replace_recursive(
            parent::getParams(),
            [
                'O' => self::CREDORAX_O,
                'a4' => $this->amountFormat($this->_order->get_total(), $this->_order->get_currency()),
            ]
        );
    }
}
