<?php

namespace Threepartment\Debitpayment\Model;

use Magento\Framework\Exception\LocalizedException;
/**
 * Pay In Store payment method model
 */
class Debitpayment extends \Magento\Payment\Model\Method\AbstractMethod
{
    /**
     * Payment method code
     *
     * @var string
     */
	const PAYMENT_METHOD_DEBITPAYMENT_CODE = 'debitpayment';
    protected $_code = self::PAYMENT_METHOD_DEBITPAYMENT_CODE;

        /**
     * @var string
     */
    protected $_formBlockType = \Threepartment\Debitpayment\Block\Form\Debitpayment::class;

    /**
     * @var string
     */
    protected $_infoBlockType = \Threepartment\Debitpayment\Block\Info\Debitpayment::class;

    /**
     * Availability option
     *
     * @var bool
     */
    protected $_isOffline = true;

    /**
     * Assign data to info model instance
     *
     * @param \Magento\Framework\DataObject|mixed $data
     * @return $this
     * @throws LocalizedException
     */
    public function assignData(\Magento\Framework\DataObject $data)
    {

        $this->getInfoInstance()->setAdditionalInformation($data->getData());
        return $this;
    }

	public function getInstructions()
    {
        return trim($this->getConfigData('instructions'));
    }
    public function getCheckbox()
    {
        return trim($this->getConfigData('checkbox'));
    }
    public function getCheckboxText()
    {
        return $this->getConfigData('checkboxtext') ? trim($this->getConfigData('checkboxtext')) : '';
    }
    public function getRemoteURL()
    {
        return trim($this->getConfigData('remoteURL'));
    }
    public function getAutoPopulate()
    {
        return trim($this->getConfigData('autopopulate'));
    }
    public function getMoreInfo()
    {
        return $this->getConfigData('moreinfo') ? trim($this->getConfigData('moreinfo')) : '';
    }
    public function getEnabledGroups()
    {
        return trim($this->getConfigData('enabledgroup'));
    }
}