<?php

use Assist\Pay\Helper;
use Bitrix\Main\Localization\Loc;
use Bitrix\Sale\OrderStatus;

Loc::loadMessages(__FILE__);

$data = [
    'NAME' => \COption::GetOptionString('assist.pay', 'name') ?: Loc::getMessage('PAYMENT_SYSTEM_DEFAULT_VALUE'),
    'SORT' => 500,
    'CODES' => [
        Helper::PS_OPTION_TEST_MODE => [
            'NAME' => Loc::getMessage('TEST_MODE_NAME'),
            'DESCRIPTION' => Loc::getMessage('TEST_MODE_DESCRIPTION'),
            'SORT' => 100,
            'GROUP' => Loc::getMessage('MAIN_GROUP'),
            'INPUT'       => [
                'TYPE' => 'Y/N',
            ],
            'DEFAULT'     => [
                'PROVIDER_KEY'   => 'INPUT',
                'PROVIDER_VALUE' => Helper::DEFAULT_TEST_MODE,
            ],
        ],
        Helper::PS_OPTION_MERCHANT_ID => [
            'NAME' => Loc::getMessage('MERCHANT_ID_NAME'),
            'DESCRIPTION' => Loc::getMessage('MERCHANT_ID_DESCRIPTION'),
            'SORT' => 200,
            'GROUP' => Loc::getMessage('CONNECTION_SETTINGS'),
        ],
        Helper::PS_OPTION_LOGIN => [
            'NAME' => Loc::getMessage('LOGIN_NAME'),
            'DESCRIPTION' => Loc::getMessage('LOGIN_DESCRIPTION'),
            'SORT' => 300,
            'GROUP' => Loc::getMessage('CONNECTION_SETTINGS'),
        ],
        Helper::PS_OPTION_PASSWORD => [
            'NAME' => Loc::getMessage('PASSWORD_NAME'),
            'DESCRIPTION' => Loc::getMessage('PASSWORD_DESCRIPTION'),
            'SORT' => 350,
            'GROUP' => Loc::getMessage('CONNECTION_SETTINGS'),
        ],
        Helper::PS_OPTION_API_URL => [
            'NAME' => Loc::getMessage('API_URL_NAME'),
            'DESCRIPTION' => Loc::getMessage('API_URL_DESCRIPTION'),
            'SORT' => 400,
            'GROUP' => Loc::getMessage('CONNECTION_SETTINGS'),
            'DEFAULT' => [
                'PROVIDER_KEY' => 'VALUE',
                'PROVIDER_VALUE' => Helper::DEFAULT_API_URL,
            ]
        ],
        Helper::PS_OPTION_SECRET => [
            'NAME' => Loc::getMessage('SECRET_NAME'),
            'DESCRIPTION' => Loc::getMessage('SECRET_DESCRIPTION'),
            'SORT' => 500,
            'GROUP' => Loc::getMessage('CONNECTION_SETTINGS'),
        ],
        Helper::PS_OPTION_SUCCESS_PAYMENT_URL => [
            'NAME' => Loc::getMessage('SUCCESS_PAYMENT_URL_NAME'),
            'DESCRIPTION' => Loc::getMessage('SUCCESS_PAYMENT_URL_DESCRIPTION'),
            'SORT' => 600,
            'GROUP' => Loc::getMessage('CONNECTION_SETTINGS'),
        ],
        Helper::PS_OPTION_ERROR_PAYMENT_URL => [
            'NAME' => Loc::getMessage('ERROR_PAYMENT_URL_NAME'),
            'DESCRIPTION' => Loc::getMessage('ERROR_PAYMENT_URL_DESCRIPTION'),
            'SORT' => 700,
            'GROUP' => Loc::getMessage('CONNECTION_SETTINGS'),
        ],
        Helper::PS_OPTION_RECURRENT_PAYMENT => [
            'NAME' => Loc::getMessage('RECURRENT_PAYMENT_NAME'),
            'DESCRIPTION' => Loc::getMessage('RECURRENT_PAYMENT_DESCRIPTION'),
            'SORT' => 800,
            'GROUP' => Loc::getMessage('CONNECTION_SETTINGS'),
            'INPUT' => [
                'TYPE' => 'Y/N'
            ],
            'DEFAULT' => [
                'PROVIDER_KEY' => 'INPUT',
                'PROVIDER_VALUE' => 'N',
            ]
        ],
        Helper::PS_OPTION_SAVE_CARD_DATA => [
            'NAME' => Loc::getMessage('SAVE_CARD_DATA_NAME'),
            'DESCRIPTION' => Loc::getMessage('SAVE_CARD_DATA_DESCRIPTION'),
            'SORT' => 900,
            'GROUP' => Loc::getMessage('CONNECTION_SETTINGS'),
            'INPUT' => [
                'TYPE' => 'Y/N'
            ],
            'DEFAULT' => [
                'PROVIDER_KEY' => 'INPUT',
                'PROVIDER_VALUE' => 'N',
            ]
        ],
        Helper::PS_OPTION_ORDER_CONFIRMATION => [
            'NAME' => Loc::getMessage('ORDER_CONFIRMATION_NAME'),
            'DESCRIPTION' => Loc::getMessage('ORDER_CONFIRMATION_DESCRIPTION'),
            'SORT' => 1000,
            'GROUP' => Loc::getMessage('CONNECTION_SETTINGS'),
            'INPUT' => [
                'TYPE' => 'Y/N'
            ],
            'DEFAULT' => [
                'PROVIDER_KEY' => 'INPUT',
                'PROVIDER_VALUE' => 'N',
            ]
        ],
        Helper::PS_OPTION_ORDER_STATE_AFTER_PAYMENT_WITH_CONFIRM => [
            'NAME' => Loc::getMessage('ORDER_STATE_AFTER_PAYMENT_WITH_CONFIRM_NAME'),
            'DESCRIPTION' => Loc::getMessage('ORDER_STATE_AFTER_PAYMENT_WITH_CONFIRM_DESCRIPTION'),
            'SORT' => 1010,
            'GROUP' => Loc::getMessage('CONNECTION_SETTINGS'),
            'INPUT' => [
                'TYPE' => 'ENUM',
                'VALUE' => 'P',
                'OPTIONS' => OrderStatus::getAllStatusesNames(),
            ],
        ],
        Helper::PS_OPTION_AUTO_ORDER_CONFIRMATION => [
            'NAME' => Loc::getMessage('AUTO_ORDER_CONFIRMATION_NAME'),
            'DESCRIPTION' => Loc::getMessage('AUTO_ORDER_CONFIRMATION_DESCRIPTION'),
            'SORT' => 1050,
            'GROUP' => Loc::getMessage('CONNECTION_SETTINGS'),
            'INPUT' => [
                'TYPE' => 'Y/N'
            ],
            'DEFAULT' => [
                'PROVIDER_KEY' => 'INPUT',
                'PROVIDER_VALUE' => 'N',
            ]
        ],
        Helper::PS_OPTION_PAYMENT_TYPE_CARD => [
            'NAME' => Loc::getMessage('PAYMENT_TYPE_CARD_NAME'),
            'SORT' => 1100,
            'GROUP' => Loc::getMessage('PAYMENT_TYPE'),
            'INPUT' => [
                'TYPE' => 'Y/N'
            ],
            'DEFAULT' => [
                'PROVIDER_KEY' => 'INPUT',
                'PROVIDER_VALUE' => 'Y',
            ]
        ],
        Helper::PS_OPTION_PAYMENT_TYPE_UMONEY => [
            'NAME' => Loc::getMessage('PAYMENT_TYPE_YMONEY_NAME'),
            'SORT' => 1110,
            'GROUP' => Loc::getMessage('PAYMENT_TYPE'),
            'INPUT' => [
                'TYPE' => 'Y/N'
            ],
            'DEFAULT' => [
                'PROVIDER_KEY' => 'INPUT',
                'PROVIDER_VALUE' => 'N',
            ]
        ],
        Helper::PS_OPTION_PAYMENT_TYPE_WEBMONEY => [
            'NAME' => Loc::getMessage('PAYMENT_TYPE_WEBMONEY_NAME'),
            'SORT' => 1120,
            'GROUP' => Loc::getMessage('PAYMENT_TYPE'),
            'INPUT' => [
                'TYPE' => 'Y/N'
            ],
            'DEFAULT' => [
                'PROVIDER_KEY' => 'INPUT',
                'PROVIDER_VALUE' => 'N',
            ]
        ],
        Helper::PS_OPTION_PAYMENT_TYPE_QIWI => [
            'NAME' => Loc::getMessage('PAYMENT_TYPE_QIWI_NAME'),
            'SORT' => 1130,
            'GROUP' => Loc::getMessage('PAYMENT_TYPE'),
            'INPUT' => [
                'TYPE' => 'Y/N'
            ],
            'DEFAULT' => [
                'PROVIDER_KEY' => 'INPUT',
                'PROVIDER_VALUE' => 'N',
            ]
        ],
        Helper::PS_OPTION_PAYMENT_TYPE_APPLE_PAY => [
            'NAME' => Loc::getMessage('PAYMENT_TYPE_APPLE_PAY_NAME'),
            'SORT' => 1140,
            'GROUP' => Loc::getMessage('PAYMENT_TYPE'),
            'INPUT' => [
                'TYPE' => 'Y/N'
            ],
            'DEFAULT' => [
                'PROVIDER_KEY' => 'INPUT',
                'PROVIDER_VALUE' => 'N',
            ]
        ],
        Helper::PS_OPTION_PAYMENT_TYPE_GOOGLE_PAY => [
            'NAME' => Loc::getMessage('PAYMENT_TYPE_GOOGLE_PAY_NAME'),
            'SORT' => 1150,
            'GROUP' => Loc::getMessage('PAYMENT_TYPE'),
            'INPUT' => [
                'TYPE' => 'Y/N'
            ],
            'DEFAULT' => [
                'PROVIDER_KEY' => 'INPUT',
                'PROVIDER_VALUE' => 'N',
            ]
        ],
        Helper::PS_OPTION_PAYMENT_TYPE_MIR_PAY => [
            'NAME' => Loc::getMessage('PAYMENT_TYPE_MIR_PAY_NAME'),
            'SORT' => 1160,
            'GROUP' => Loc::getMessage('PAYMENT_TYPE'),
            'INPUT' => [
                'TYPE' => 'Y/N'
            ],
            'DEFAULT' => [
                'PROVIDER_KEY' => 'INPUT',
                'PROVIDER_VALUE' => 'N',
            ]
        ],
        Helper::PS_OPTION_PAYMENT_TYPE_SAMSUNG_PAY => [
            'NAME' => Loc::getMessage('PAYMENT_TYPE_SAMSUNG_PAY_NAME'),
            'SORT' => 1170,
            'GROUP' => Loc::getMessage('PAYMENT_TYPE'),
            'INPUT' => [
                'TYPE' => 'Y/N'
            ],
            'DEFAULT' => [
                'PROVIDER_KEY' => 'INPUT',
                'PROVIDER_VALUE' => 'N',
            ]
        ],
        Helper::PS_OPTION_PAYMENT_TYPE_SPB => [
            'NAME' => Loc::getMessage('PAYMENT_TYPE_SPB_NAME'),
            'SORT' => 1180,
            'GROUP' => Loc::getMessage('PAYMENT_TYPE'),
            'INPUT' => [
                'TYPE' => 'Y/N'
            ],
            'DEFAULT' => [
                'PROVIDER_KEY' => 'INPUT',
                'PROVIDER_VALUE' => 'N',
            ]
        ],
        Helper::PS_OPTION_PAYMENT_TYPE_ERIP => [
            'NAME' => Loc::getMessage('PAYMENT_TYPE_ERIP_NAME'),
            'SORT' => 1190,
            'GROUP' => Loc::getMessage('PAYMENT_TYPE'),
            'INPUT' => [
                'TYPE' => 'Y/N'
            ],
            'DEFAULT' => [
                'PROVIDER_KEY' => 'INPUT',
                'PROVIDER_VALUE' => 'N',
            ]
        ],
        Helper::PS_OPTION_PREPARE_ONLINE_CHEQUE => [
            'NAME' => Loc::getMessage('PREPARE_ONLINE_CHEQUE_NAME'),
            'SORT' => 1200,
            'GROUP' => Loc::getMessage('CHEQUE_SETTINGS'),
            'INPUT' => [
                'TYPE' => 'Y/N'
            ],
            'DEFAULT' => [
                'PROVIDER_KEY' => 'INPUT',
                'PROVIDER_VALUE' => 'N',
            ]
        ],
        Helper::PS_OPTION_SEND_CHEQUE_WITH_CONFIRM => [
            'NAME' => Loc::getMessage('SEND_CHEQUE_WITH_CONFIRM'),
            'SORT' => 1250,
            'GROUP' => Loc::getMessage('CHEQUE_SETTINGS'),
            'INPUT' => [
                'TYPE' => 'Y/N'
            ],
            'DEFAULT' => [
                'PROVIDER_KEY' => 'INPUT',
                'PROVIDER_VALUE' => 'N',
            ]
        ],
        Helper::PS_OPTION_TAX_RATE_FROM_PRODUCT_SETTINGS => [
            'NAME' => Loc::getMessage('TAX_RATE_FROM_PRODUCT_SETTINGS'),
            'SORT' => 1250,
            'GROUP' => Loc::getMessage('CHEQUE_SETTINGS'),
            'INPUT' => [
                'TYPE' => 'Y/N'
            ],
            'DEFAULT' => [
                'PROVIDER_KEY' => 'INPUT',
                'PROVIDER_VALUE' => 'N',
            ]
        ],
        Helper::PS_OPTION_TAX_RATE => [
            'NAME' => Loc::getMessage('TAX_RATE_NAME'),
            'DESCRIPTION' => Loc::getMessage('TAX_RATE_NAME_DESCRIPTION'),
            'SORT' => 1300,
            'GROUP' => Loc::getMessage('CHEQUE_SETTINGS'),
            'INPUT' => [
                'TYPE' => 'ENUM',
                'OPTIONS' => [
                    Helper::TAX_RATE_NO_VAT => Loc::getMessage('TAX_RATE_NO_VAT_VALUE'),
                    Helper::TAX_RATE_VAT_0 => Loc::getMessage('TAX_RATE_VAT_0_VALUE'),
                    Helper::TAX_RATE_VAT_10 => Loc::getMessage('TAX_RATE_VAT_10_VALUE'),
                    Helper::TAX_RATE_VAT_20 => Loc::getMessage('TAX_RATE_VAT_20_VALUE'),
                    Helper::TAX_RATE_VAT_110 => Loc::getMessage('TAX_RATE_VAT_110_VALUE'),
                    Helper::TAX_RATE_VAT_120 => Loc::getMessage('TAX_RATE_VAT_120_VALUE'),
                ]
            ],
        ],
        Helper::PS_OPTION_TAX_SYSTEM => [
            'NAME' => Loc::getMessage('TAX_SYSTEM_NAME'),
            'DESCRIPTION' => Loc::getMessage('TAX_SYSTEM_DESCRIPTION'),
            'SORT' => 1300,
            'GROUP' => Loc::getMessage('CHEQUE_SETTINGS'),
            'INPUT' => [
                'TYPE' => 'ENUM',
                'OPTIONS' => [
                    Helper::TAX_SYSTEM_GENERAL => Loc::getMessage('TAX_SYSTEM_GENERAL_VALUE'),
                    Helper::TAX_SYSTEM_SIMPLIFIED_INCOME => Loc::getMessage('TAX_SYSTEM_SIMPLIFIED_INCOME_VALUE'),
                    Helper::TAX_SYSTEM_SIMPLIFIED_INCOME_LESS_EXPENSE => Loc::getMessage('TAX_SYSTEM_SIMPLIFIED_INCOME_LESS_EXPENSE_VALUE'),
                    Helper::TAX_SYSTEM_SINGLE_IMPUTED_INCOME_TAX => Loc::getMessage('TAX_SYSTEM_SINGLE_IMPUTED_INCOME_TAX_VALUE'),
                    Helper::TAX_SYSTEM_SINGLE_AGRICULTURAL_TAX => Loc::getMessage('TAX_SYSTEM_SINGLE_AGRICULTURAL_TAX_VALUE'),
                    Helper::TAX_SYSTEM_PATENT_TAX_SYSTEM => Loc::getMessage('TAX_SYSTEM_PATENT_TAX_SYSTEM_VALUE'),
                ]
            ],
        ],
        Helper::PS_OPTION_PAYMENT_METHOD => [
            'NAME' => Loc::getMessage('PAYMENT_METHOD_NAME'),
            'DESCRIPTION' => Loc::getMessage('PAYMENT_METHOD_DESCRIPTION'),
            'SORT' => 1400,
            'GROUP' => Loc::getMessage('CHEQUE_SETTINGS'),
            'INPUT' => [
                'TYPE' => 'ENUM',
                'OPTIONS' => [
                    Helper::CALCULATION_METHOD_FULL_PREPAYMENT => Loc::getMessage('CALCULATION_METHOD_FULL_PREPAYMENT_VALUE'),
                    Helper::CALCULATION_METHOD_PREPAYMENT => Loc::getMessage('CALCULATION_METHOD_PREPAYMENT_VALUE'),
                    Helper::CALCULATION_METHOD_ADVANCE => Loc::getMessage('CALCULATION_METHOD_ADVANCE_VALUE'),
                    Helper::CALCULATION_METHOD_FULL_CALCULATION => Loc::getMessage('CALCULATION_METHOD_FULL_CALCULATION_VALUE'),
                    Helper::CALCULATION_METHOD_PARTIAL_PAYMENT_AND_CREDIT => Loc::getMessage('CALCULATION_METHOD_PARTIAL_PAYMENT_AND_CREDIT_VALUE'),
                    Helper::CALCULATION_METHOD_CREDIT_TRANSFER => Loc::getMessage('CALCULATION_METHOD_CREDIT_TRANSFER_VALUE'),
                    Helper::CALCULATION_METHOD_CREDIT_PAYMENT => Loc::getMessage('CALCULATION_METHOD_CREDIT_PAYMENT_VALUE'),
                ]
            ],
        ],
        Helper::PS_OPTION_SUBJECT_FEATURE => [
            'NAME' => Loc::getMessage('SUBJECT_FEATURE_NAME'),
            'DESCRIPTION' => Loc::getMessage('SUBJECT_FEATURE_DESCRIPTION'),
            'SORT' => 1400,
            'GROUP' => Loc::getMessage('CHEQUE_SETTINGS'),
            'INPUT' => [
                'TYPE' => 'ENUM',
                'VALUE' => Helper::ITEM_ATTRIBUTE_PRODUCT,
                'OPTIONS' => [
                    Helper::ITEM_ATTRIBUTE_PRODUCT => Loc::getMessage('ITEM_ATTRIBUTE_PRODUCT'),
                    Helper::ITEM_ATTRIBUTE_EXCISABLE_GOODS => Loc::getMessage('ITEM_ATTRIBUTE_EXCISABLE_GOODS'),
                    Helper::ITEM_ATTRIBUTE_WORK => Loc::getMessage('ITEM_ATTRIBUTE_WORK'),
                    Helper::ITEM_ATTRIBUTE_SERVICE => Loc::getMessage('ITEM_ATTRIBUTE_SERVICE'),
                    Helper::ITEM_ATTRIBUTE_GAMBLING_BET => Loc::getMessage('ITEM_ATTRIBUTE_GAMBLING_BET'),
                    Helper::ITEM_ATTRIBUTE_GAMBLING_WINNING => Loc::getMessage('ITEM_ATTRIBUTE_GAMBLING_WINNING'),
                    Helper::ITEM_ATTRIBUTE_LOTTERY_TICKET_OR_WAGER => Loc::getMessage('ITEM_ATTRIBUTE_LOTTERY_TICKET_OR_WAGER'),
                    Helper::ITEM_ATTRIBUTE_LOTTERY_WINNING => Loc::getMessage('ITEM_ATTRIBUTE_LOTTERY_WINNING'),
                    Helper::ITEM_ATTRIBUTE_PROVISION_RID => Loc::getMessage('ITEM_ATTRIBUTE_PROVISION_RID'),
                    Helper::ITEM_ATTRIBUTE_PAYMENT => Loc::getMessage('ITEM_ATTRIBUTE_PAYMENT'),
                    Helper::ITEM_ATTRIBUTE_AGENCY_FEE => Loc::getMessage('ITEM_ATTRIBUTE_AGENCY_FEE'),
                    Helper::ITEM_ATTRIBUTE_COMPONENT_SUBJECT_OF_CALCULATION => Loc::getMessage('ITEM_ATTRIBUTE_COMPONENT_SUBJECT_OF_CALCULATION'),
                    Helper::ITEM_ATTRIBUTE_OTHER_SUBJECT_OF_CALCULATION => Loc::getMessage('ITEM_ATTRIBUTE_OTHER_SUBJECT_OF_CALCULATION'),
                    Helper::ITEM_ATTRIBUTE_PROPERTY_LAW => Loc::getMessage('ITEM_ATTRIBUTE_PROPERTY_LAW'),
                    Helper::ITEM_ATTRIBUTE_NONOPERATING_INCOME => Loc::getMessage('ITEM_ATTRIBUTE_NONOPERATING_INCOME'),
                    Helper::ITEM_ATTRIBUTE_INSURANCE_PREMIUMS => Loc::getMessage('ITEM_ATTRIBUTE_INSURANCE_PREMIUMS'),
                    Helper::ITEM_ATTRIBUTE_TRADE_TAX => Loc::getMessage('ITEM_ATTRIBUTE_TRADE_TAX'),
                    Helper::ITEM_ATTRIBUTE_RESORT_TAX => Loc::getMessage('ITEM_ATTRIBUTE_RESORT_TAX'),
                    Helper::ITEM_ATTRIBUTE_BAIL => Loc::getMessage('ITEM_ATTRIBUTE_BAIL'),
                    Helper::ITEM_ATTRIBUTE_EXPENDITURE => Loc::getMessage('ITEM_ATTRIBUTE_EXPENDITURE'),
                    Helper::ITEM_ATTRIBUTE_CONTRIBUTIONS_COMPULSORY_PENSION_INSURANCE_IE => Loc::getMessage('ITEM_ATTRIBUTE_CONTRIBUTIONS_COMPULSORY_PENSION_INSURANCE_IE'),
                    Helper::ITEM_ATTRIBUTE_CONTRIBUTIONS_COMPULSORY_PENSION_INSURANCE => Loc::getMessage('ITEM_ATTRIBUTE_CONTRIBUTIONS_COMPULSORY_PENSION_INSURANCE'),
                    Helper::ITEM_ATTRIBUTE_CONTRIBUTIONS_COMPULSORY_MEDICAL_INSURANCE_IE => Loc::getMessage('ITEM_ATTRIBUTE_CONTRIBUTIONS_COMPULSORY_MEDICAL_INSURANCE_IE'),
                    Helper::ITEM_ATTRIBUTE_CONTRIBUTIONS_COMPULSORY_MEDICAL_INSURANCE => Loc::getMessage('ITEM_ATTRIBUTE_CONTRIBUTIONS_COMPULSORY_MEDICAL_INSURANCE'),
                    Helper::ITEM_ATTRIBUTE_CONTRIBUTIONS_COMPULSORY_SOCIAL_INSURANCE => Loc::getMessage('ITEM_ATTRIBUTE_CONTRIBUTIONS_COMPULSORY_SOCIAL_INSURANCE'),
                    Helper::ITEM_ATTRIBUTE_CASINO_PAYMENT => Loc::getMessage('ITEM_ATTRIBUTE_CASINO_PAYMENT'),
                    Helper::ITEM_ATTRIBUTE_CASH_DISBURSEMENT => Loc::getMessage('ITEM_ATTRIBUTE_CASH_DISBURSEMENT'),
                    Helper::ITEM_ATTRIBUTE_ATNM => Loc::getMessage('ITEM_ATTRIBUTE_ATNM'),
                    Helper::ITEM_ATTRIBUTE_ATM => Loc::getMessage('ITEM_ATTRIBUTE_ATM'),
                    Helper::ITEM_ATTRIBUTE_TNM => Loc::getMessage('ITEM_ATTRIBUTE_TNM'),
                    Helper::ITEM_ATTRIBUTE_TM => Loc::getMessage('ITEM_ATTRIBUTE_TM'),
                ]
            ],
        ],
    ],
];

$description = array(
    'MAIN' => \COption::GetOptionString('assist.pay', 'description')
);
