<?php

namespace Sibs\Sibs\Controller\Payment;

use Sibs\Sibs\Model\SibsConstants;

class Creditcard extends SibsPayment
{
    /**
     * @param \Magento\Framework\App\Action\Context $context,
     * @param \Magento\Checkout\Model\Session $checkoutSession,
     * @param \Sibs\Sibs\Helper\DataHelper $sibsHelper,
     * @param \Sibs\Sibs\Model\SibsOrderFactory $sibsOrderFactory,
     * @param \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory
     */
    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Checkout\Model\Session $checkoutSession,
        \Sibs\Sibs\Helper\DataHelper $sibsHelper,
        \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory
    ) {
        parent::__construct(
            $context,
            $checkoutSession,
            $sibsHelper,
            $resultJsonFactory,
            SibsConstants::SIBS_API_METHOD_CREDITCARD,
            SibsConstants::SIBS_PAYMENT_METHOD_CREDITCARD
        );
    }

    protected function transactionData()
    {
        $paymentMethod = [$this->_paymentMethod];
        $paymentType   = (string) $this->_sibsHelper->getCCPaymentType();

        $checkoutDefaultData = $this->getCheckoutData($paymentMethod, $paymentType);

        return array_merge_recursive($checkoutDefaultData, []);
    }
}
