<?php
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */

namespace Sibs\Sibs\Model\Config\Source\CreditCard;

use Magento\Framework\Option\ArrayInterface;
use Sibs\Sibs\Model\SibsConstants;

class PaymentType implements ArrayInterface
{
    const UNDEFINED_OPTION = '';

    const DEBIT_OPTION = SibsConstants::SIBS_PAYMENT_TYPE_PURS;

    const AUTHORIZATION_OPTION = SibsConstants::SIBS_PAYMENT_TYPE_AUTH;

    /**
     * @var string[]
     */
    protected $_paymentTypes = [
        self::DEBIT_OPTION         => 'Debit',
        self::AUTHORIZATION_OPTION => 'Authorization',
    ];

    /**
     * @return array
     */
    public function toOptionArray()
    {
        $options = [
            [
                'value' => self::UNDEFINED_OPTION,
                'label' => __('-- Please Select --'),
            ],
        ];

        foreach ($this->_paymentTypes as $code => $label) {
            $options[] = [
                'value' => $code,
                'label' => __($label),
            ];
        }

        return $options;
    }
}
