This commit is contained in:
2026-05-15 17:13:17 +03:00
committed by Git Moneta
parent 5e54d4fc2c
commit cbed6b96ee
14 changed files with 1559 additions and 68 deletions
+354
View File
@@ -0,0 +1,354 @@
<?php
declare(strict_types=1);
namespace Opencart\Admin\Controller\Extension\PayAnyWay\Payment;
/**
* Class PayAnyWay
*
* @package Opencart\Admin\Controller\Extension\PayAnyWay\Payment
*/
class PayAnyWay extends \Opencart\System\Engine\Controller
{
public const CMS_NAME = 'OpenCart';
public const MODULE_NAME = 'payanyway';
public const MODULE_VERSION = '1.0.0';
public const MODULE_DEFAULT_SORT_ORDER = 0;
private const SUPPORTED_CURRENCIES = ['RUB'];
private const AVAILABLE_VAT_RATES = [
'vat_none' => '1105',
'vat0' => '1104',
'vat5' => '1108',
'vat7' => '1109',
'vat10' => '1103',
'vat22' => '1113',
'vat105' => '1110',
'vat107' => '1111',
'vat110' => '1107',
'vat122' => '1114',
];
private array $errors = [];
/**
* @throws \Exception
*/
public function index(): void
{
$this->load->language('extension/payanyway/payment/payanyway');
$this->document->setTitle($this->language->get('heading_title'));
$data = [];
$this->applyValidationErrors($data);
$data['breadcrumbs'] = $this->getBreadcrumbs();
$data['save'] = $this->url->link('extension/payanyway/payment/payanyway.save', 'user_token=' . $this->session->data['user_token']);
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=payment');
$data['payment_payanyway_status'] = $this->retrieveValue('payment_payanyway_status');
$data['payment_payanyway_account'] = $this->retrieveValue('payment_payanyway_account');
$data['payment_payanyway_integrity_code'] = $this->getIntegrityCode();
$data['payment_payanyway_server'] = $this->retrieveValue('payment_payanyway_server');
$data['payment_payanyway_vat_rates'] = $this->getModuleVatRates();
$data['payment_payanyway_vat_rate'] = $this->retrieveValue('payment_payanyway_vat_rate');
$data['payment_payanyway_currencies'] = $this->getModuleCurrencies();
$data['payment_payanyway_currency'] = $this->retrieveValue('payment_payanyway_currency');
$data['order_statuses'] = $this->getAvailableOrderStatuses();
$data['payment_payanyway_pending_order_status_id'] = $this->retrieveValue('payment_payanyway_pending_order_status_id');
$data['payment_payanyway_success_order_status_id'] = $this->retrieveValue('payment_payanyway_success_order_status_id');
$data['payment_payanyway_error_order_status_id'] = $this->retrieveValue('payment_payanyway_error_order_status_id');
$data['geo_zones'] = $this->getAvailableGeoZones();
$data['payment_payanyway_geo_zone_id'] = $this->retrieveValue('payment_payanyway_geo_zone_id');
$data['payment_payanyway_sort_order'] = $this->retrieveValue('payment_payanyway_sort_order');
$data['payment_payanyway_cms_module_version'] = $this->getCmsModuleVersion();
$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');
$this->response->setOutput($this->load->view('extension/payanyway/payment/payanyway', $data));
}
public function save(): void
{
$this->load->language('extension/payanyway/payment/payanyway');
$json = [];
if (!$this->user->hasPermission('modify', 'extension/payanyway/payment/payanyway')) {
$json['error'] = $this->language->get('error_permission');
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
return;
}
if (!$this->validate()) {
$errorString = $this->language->get('error_validation') .
"<p style='white-space: pre-wrap; margin: 0;'>\n";
foreach ($this->errors as $error) {
$errorString .= $error . "\n";
}
$errorString = substr($errorString, 0, -1) . "</p>";
$json['error'] = $errorString;
}
if (!$json) {
$this->load->model('setting/setting');
$this->model_setting_setting->editSetting('payment_payanyway', $this->request->post);
$json['success'] = $this->language->get('text_success');
}
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
/**
* @throws \Exception
*/
public function install(): void
{
if (!$this->user->hasPermission('modify', 'extension/payment')) {
return;
}
$defaultSettings = [
'payment_payanyway_status' => 0,
'payment_payanyway_account' => '',
'payment_payanyway_integrity_code' => '',
'payment_payanyway_server' => 'prod',
'payment_payanyway_sort_order' => 0,
'payment_payanyway_cms_module_version' => $this->getCmsModuleVersion(),
];
$orderStatuses = $this->getAvailableOrderStatuses();
$pendingStatus = array_filter($orderStatuses, function ($status) {
return (int)$status['order_status_id'] === 1;
});
if (!empty($pendingStatus)) {
$pendingKey = key($pendingStatus);
$defaultSettings['payment_payanyway_pending_order_status_id'] = $pendingStatus[$pendingKey]['order_status_id'];
}
$successStatus = array_filter($orderStatuses, function ($status) {
return (int)$status['order_status_id'] === 5;
});
if (!empty($successStatus)) {
$successKey = key($successStatus);
$defaultSettings['payment_payanyway_success_order_status_id'] = $successStatus[$successKey]['order_status_id'];
}
$errorStatus = array_filter($orderStatuses, function ($status) {
return (int)$status['order_status_id'] === 10;
});
if (!empty($errorStatus)) {
$errorKey = key($errorStatus);
$defaultSettings['payment_payanyway_error_order_status_id'] = $errorStatus[$errorKey]['order_status_id'];
}
$this->load->model('setting/setting');
$this->model_setting_setting->editSetting('payment_payanyway', $defaultSettings);
}
public function uninstall(): void
{
if (!$this->user->hasPermission('modify', 'extension/payment')) {
return;
}
$this->load->model('setting/setting');
$this->model_setting_setting->deleteSetting('payment_payanyway');
}
private function validate(): bool
{
$this->errors = [];
if (!isset($this->request->post['payment_payanyway_account']) ||
((int)$this->request->post['payment_payanyway_account'] <= 0)
) {
$this->errors['account'] = $this->language->get('error_account');
}
if (empty($this->request->post['payment_payanyway_integrity_code'])) {
$this->errors['integrity_code'] = $this->language->get('error_integrity_code');
}
if (empty($this->request->post['payment_payanyway_pending_order_status_id'])) {
$this->errors['pending_order_status'] = $this->language->get('error_pending_order_status');
}
if (empty($this->request->post['payment_payanyway_success_order_status_id'])) {
$this->errors['success_order_status'] = $this->language->get('error_success_order_status');
}
if (empty($this->request->post['payment_payanyway_error_order_status_id'])) {
$this->errors['error_order_status'] = $this->language->get('error_error_order_status');
}
$sortOrder = isset($this->request->post['payment_payanyway_sort_order'])
? (int)$this->request->post['payment_payanyway_sort_order']
: self::MODULE_DEFAULT_SORT_ORDER;
$this->request->post['payment_payanyway_sort_order'] = $sortOrder;
$this->request->post['payment_payanyway_cms_module_version'] = $this->getCmsModuleVersion();
return empty($this->errors);
}
/** @param array<string, mixed> $data */
private function applyValidationErrors(array &$data): void
{
$data['error_warning'] = $this->errors['warning'] ?? '';
$data['error_account'] = $this->errors['account'] ?? '';
$data['error_integrity_code'] = $this->errors['integrity_code'] ?? '';
$data['error_pending_order_status'] = $this->errors['pending_order_status'] ?? '';
$data['error_success_order_status'] = $this->errors['success_order_status'] ?? '';
$data['error_error_order_status'] = $this->errors['error_order_status'] ?? '';
}
/** @return array<int, array{text: string, href: string}> */
private function getBreadcrumbs(): array
{
return [
[
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token']),
],
[
'text' => $this->language->get('text_extension'),
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=payment'),
],
[
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('extension/payanyway/payment/payanyway', 'user_token=' . $this->session->data['user_token']),
],
];
}
private function getIntegrityCode(): string
{
$value = $this->retrieveValue('payment_payanyway_integrity_code');
if (null === $value) {
return '';
}
return htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
}
/** @return array<string, mixed> */
private function getModuleVatRates(): array
{
$result = array();
foreach (self::AVAILABLE_VAT_RATES as $vat => $value) {
$label = 'entry_' . $vat . '_label';
$result[$value] = $this->language->get($label);
}
return $result;
}
/**
* @return array<string, mixed>
* @throws \Exception
*/
private function getModuleCurrencies(): array
{
$this->load->model('localisation/currency');
$shopCurrencies = $this->model_localisation_currency->getCurrencies();
$result = array();
foreach (self::SUPPORTED_CURRENCIES as $currencyCode) {
$result[$currencyCode] = $shopCurrencies[$currencyCode] ?? $this->getDefaultCurrencyDefinition($currencyCode);
}
return $result;
}
/** @return array<string, mixed> */
private function getDefaultCurrencyDefinition(string $currencyCode): array
{
$definitions = [
'RUB' => [
'currency_id' => 0,
'title' => 'Рубль',
'code' => 'RUB',
'symbol_left' => '',
'symbol_right' => '₽',
'decimal_place' => '2',
'value' => 1.00000000,
'status' => '1',
'date_modified' => date('Y-m-d H:i:s'),
],
];
return $definitions[$currencyCode] ?? [];
}
/**
* @return array<string, mixed>
* @throws \Exception
*/
private function getAvailableOrderStatuses(): array
{
$this->load->model('localisation/order_status');
return $this->model_localisation_order_status->getOrderStatuses();
}
/**
* @return array<string, mixed>
* @throws \Exception
*/
private function getAvailableGeoZones(): array
{
$this->load->model('localisation/geo_zone');
return $this->model_localisation_geo_zone->getGeoZones();
}
/** @return string */
private function getCmsModuleVersion(): string
{
$this->load->language('common/footer');
$textFooter = $this->language->get('text_footer');
$textFooter = is_string($textFooter) ? $textFooter : '';
$cmsName = $this->detectCmsByPatterns($textFooter);
$cmsVersion = defined('VERSION') ? constant('VERSION') : '.unknown';
return sprintf('%s v%s | %s v%s',
$cmsName,
$cmsVersion,
self::MODULE_NAME,
self::MODULE_VERSION
);
}
private function detectCmsByPatterns($textFooter): string
{
$patterns = [
'ocStore' => '/ocStore/i',
'Russian OpenCart' => '/opencart-russia/i',
self::CMS_NAME => '/opencart\.com/i'
];
if (!empty($textFooter)) {
foreach ($patterns as $cms => $pattern) {
if (preg_match($pattern, $textFooter)) {
return $cms;
}
}
}
return self::CMS_NAME;
}
private function retrieveValue(string $name): mixed
{
return $this->request->post[$name] ?? $this->config->get($name);
}
}
+62
View File
@@ -0,0 +1,62 @@
<?php
// Heading
$_['heading_title'] = 'PayAnyWay';
// Text
$_['text_extension'] = 'Extensions';
$_['text_success'] = 'Settings for the PayAnyWay payment method have been saved successfully';
$_['text_edit'] = 'Editing module settings';
$_['text_payanyway'] = '<a href="https://www.payanyway.ru/" target="_blank"><img src="../extension/payanyway/admin/view/image/payment/payanyway.png" alt="PayAnyWay" title="PayAnyWay" width="163" height="18"></a>';
// Entry
$_['entry_status_label'] = 'Status';
$_['entry_account_label'] = 'Account number';
$_['entry_account_description'] = 'Your extended account number in the MONETA.RU system';
$_['entry_integrity_code_label'] = 'Integrity Code';
$_['entry_integrity_code_description'] = 'Data integrity verification code specified in the extended account settings in the MONETA.RU system';
$_['entry_server_label'] = 'Payment server';
$_['entry_server_prod_label'] = 'Production';
$_['entry_server_demo_label'] = 'Demo';
$_['entry_vat_rate_label'] = 'VAT';
$_['entry_vat_none_label'] = 'Without VAT';
$_['entry_vat0_label'] = '0%';
$_['entry_vat5_label'] = '5%';
$_['entry_vat7_label'] = '7%';
$_['entry_vat10_label'] = '10%';
$_['entry_vat22_label'] = '22%';
$_['entry_vat105_label'] = '5% (calculated rate 5/105)';
$_['entry_vat107_label'] = '7% (calculated rate 7/107)';
$_['entry_vat110_label'] = '10% (calculated rate 10/110)';
$_['entry_vat122_label'] = '22% (calculated rate 22/122)';
$_['entry_currency_label'] = 'Payment acceptance';
$_['entry_currency_rub_label'] = 'Russian Ruble';
$_['entry_currency_description'] = 'The currencies in the MONETA.RU system and in the store must match';
$_['entry_select_order_status_label'] = ' --- Select status --- ';
$_['entry_order_statuses_label'] = 'Order Statuses';
$_['entry_pending_order_status_label'] = 'Pending';
$_['entry_success_order_status_label'] = 'Success';
$_['entry_error_order_status_label'] = 'Error';
$_['entry_geo_zone_label'] = 'Area of display';
$_['entry_sort_order_label'] = 'Sort Order';
// Help
$_['help_status'] = 'Enable or disable the payment module';
$_['help_pending_order_status'] = 'Specify the order status that is set when the order is created';
$_['help_success_order_status'] = 'Specify the order status that is set upon successful payment';
$_['help_error_order_status'] = 'Specify the order status that is set upon payment error';
$_['help_geo_zone'] = 'Geographic area where the payment method will be displayed';
$_['help_sort_order'] = 'Determines the display order of the payment method. The smaller the number, the higher the position in the list';
// Error
$_['error_permission'] = 'Warning: You do not have permission to modify PayAnyWay payment method!';
$_['error_validation'] = 'Warning: To modify the PayAnyWay payment method, you need to fill in all required fields!';
$_['error_account'] = 'Account Number is required and must be greater than 0';
$_['error_integrity_code'] = 'Account Integrity Code Required';
$_['error_pending_order_status'] = 'Select Pending order status';
$_['error_success_order_status'] = 'Select Success order status';
$_['error_error_order_status'] = 'Select Error order status';
+62
View File
@@ -0,0 +1,62 @@
<?php
// Heading
$_['heading_title'] = 'PayAnyWay';
// Text
$_['text_extension'] = 'Расширения';
$_['text_success'] = 'Настройки для способа оплаты PayAnyWay успешно сохранены';
$_['text_edit'] = 'Редактирование настроек модуля';
$_['text_payanyway'] = '<a href="https://www.payanyway.ru/" target="_blank"><img src="../extension/payanyway/admin/view/image/payment/payanyway.png" alt="PayAnyWay" title="PayAnyWay" width="163" height="18"></a>';
// Entry
$_['entry_status_label'] = 'Статус';
$_['entry_account_label'] = 'Номер счёта';
$_['entry_account_description'] = 'Ваш номер расширенного счёта в системе MONETA.RU';
$_['entry_integrity_code_label'] = 'Код проверки целостности данных';
$_['entry_integrity_code_description'] = 'Код проверки целостности данных, указанный в настройках расширенного счёта в системе MONETA.RU';
$_['entry_server_label'] = 'Сервер платежей';
$_['entry_server_prod_label'] = 'Боевой';
$_['entry_server_demo_label'] = 'Тестовый';
$_['entry_vat_rate_label'] = 'НДС';
$_['entry_vat_none_label'] = 'Без НДС';
$_['entry_vat0_label'] = '0%';
$_['entry_vat5_label'] = '5%';
$_['entry_vat7_label'] = '7%';
$_['entry_vat10_label'] = '10%';
$_['entry_vat22_label'] = '22%';
$_['entry_vat105_label'] = '5% (расчётная ставка 5/105)';
$_['entry_vat107_label'] = '7% (расчётная ставка 7/107)';
$_['entry_vat110_label'] = '10% (расчётная ставка 10/110)';
$_['entry_vat122_label'] = '22% (расчётная ставка 22/122)';
$_['entry_currency_label'] = 'Валюта платежа';
$_['entry_currency_rub_label'] = 'Рубль';
$_['entry_currency_description'] = 'Валюты в системе MONETA.RU и в магазине должны совпадать';
$_['entry_select_order_status_label'] = ' --- Выберите статус --- ';
$_['entry_order_statuses_label'] = 'Статусы заказа';
$_['entry_pending_order_status_label'] = 'Обрабатываемый';
$_['entry_success_order_status_label'] = 'Успешный';
$_['entry_error_order_status_label'] = 'Неуспешный';
$_['entry_geo_zone_label'] = 'Регион отображения';
$_['entry_sort_order_label'] = 'Порядок сортировки';
// Help
$_['help_status'] = 'Включите или выключите модуль оплаты';
$_['help_pending_order_status'] = 'Укажите статус заказа, который выставляется при его создании';
$_['help_success_order_status'] = 'Укажите статус заказа, который выставляется при успешной оплате';
$_['help_error_order_status'] = 'Укажите статус заказа, который выставляется при ошибке оплаты';
$_['help_geo_zone'] = 'Географическая зона, в которой будет отображаться способ оплаты';
$_['help_sort_order'] = 'Определяет порядок отображения платежного метода в списке методов оплаты при оформлении заказа. Чем меньше число, тем выше позиция в списке';
// Error
$_['error_permission'] = 'Внимание: У вас нет прав на изменение платежного метода PayAnyWay!';
$_['error_validation'] = 'Внимание: Чтобы изменить платежный метод PayAnyWay, вам необходимо заполнить все обязательные поля!';
$_['error_account'] = 'Номер счёта обязателен';
$_['error_integrity_code'] = 'Код проверки целостности данных обязателен';
$_['error_pending_order_status'] = 'Выберите статус Обрабатываемого заказа';
$_['error_success_order_status'] = 'Выберите статус Успешного заказа';
$_['error_error_order_status'] = 'Выберите статус Неуспешного заказа';
Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

+241
View File
@@ -0,0 +1,241 @@
{{ header }}
{{ column_left }}
<div id="content">
<div class="page-header">
<div class="container-fluid">
<div class="float-end">
<button type="submit" form="form-payment" data-bs-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary">
<i class="fa-solid fa-save"></i>
</button>
<a href="{{ back }}" data-bs-toggle="tooltip" title="{{ button_back }}" class="btn btn-light">
<i class="fa-solid fa-reply"></i>
</a>
</div>
<h1>{{ heading_title }}</h1>
<ol class="breadcrumb">
{% for breadcrumb in breadcrumbs %}
<li class="breadcrumb-item">
<a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a>
</li>
{% endfor %}
</ol>
</div>
</div>
<div class="container-fluid">
<div class="card">
<div class="card-header">
<i class="fa-solid fa-pencil"></i>
{{ text_edit }}
</div>
<div class="card-header text-center">
<a href="https://www.payanyway.ru/" target="_blank"><img src="../extension/payanyway/admin/view/image/payment/payanyway.png" alt="PayAnyWay" title="PayAnyWay" width="250" height="29" /></a>
</div>
<div class="card-body">
<form id="form-payment" action="{{ save }}" method="post" data-oc-toggle="ajax">
<div class="tab-content">
<div id="tab-general" class="tab-pane active">
{# Статус модуля #}
<div class="row mb-3">
{# <label class="col-sm-2 col-form-label" for="input-account">{{ entry_status_label }}</label>#}
<label class="col-sm-2 col-form-label" for="input-pending-order-status">
<span>{{ entry_status_label }}</span>
<i class="fa-regular fa-circle-question text-info"
data-bs-toggle="tooltip"
title="{{ help_status }}"
></i>
</label>
<div class="col-sm-10">
<div class="form-check form-switch form-switch-lg">
<input type="hidden" name="payment_payanyway_status" value="0"/>
<input type="checkbox" name="payment_payanyway_status" value="1" id="input-status"
class="form-check-input" {% if payment_payanyway_status == "1" %} checked{% endif %}>
</div>
</div>
</div>
{# Номер счета #}
<div class="row mb-3 required">
<label class="col-sm-2 col-form-label" for="input-account">{{ entry_account_label }}</label>
<div class="col-sm-10">
<input type="number" oninput="this.value = this.value.replace(/[^0-9]/g, '')" step="1"
name="payment_payanyway_account" value="{{ payment_payanyway_account }}"
placeholder="{{ entry_account_description }}" id="input-account" class="form-control"/>
</div>
</div>
{# Код проверки целостности данных #}
<div class="row mb-3 required">
<label class="col-sm-2 col-form-label" for="input-integrity-code">{{ entry_integrity_code_label }}</label>
<div class="col-sm-10">
<input type="text" name="payment_payanyway_integrity_code" value="{{ payment_payanyway_integrity_code }}"
placeholder="{{ entry_integrity_code_description }}" id="input-integrity-code" class="form-control"/>
</div>
</div>
{# Сервер платежей #}
<div class="row mb-3">
<label class="col-sm-2 col-form-label" for="input-server">{{ entry_server_label }}</label>
<div class="col-sm-10">
<select name="payment_payanyway_server" id="input-server" class="form-select">
<option value="prod" {% if payment_payanyway_server == 'prod' %} selected="selected" {% endif %}>{{ entry_server_prod_label }}</option>
<option value="demo" {% if payment_payanyway_server == 'demo' %} selected="selected" {% endif %}>{{ entry_server_demo_label }}</option>
</select>
</div>
</div>
{# НДС #}
<div class="row mb-3">
<label class="col-sm-2 col-form-label" for="input-vat-rate">{{ entry_vat_rate_label }}</label>
<div class="col-sm-10">
<select name="payment_payanyway_vat_rate" id="input-vat-rate" class="form-select">
{% for vat_id, label in payment_payanyway_vat_rates %}
<option value="{{ vat_id }}" {% if vat_id == payment_payanyway_vat_rate %}selected="selected"{% endif %}>{{ label }}</option>
{% endfor %}
</select>
</div>
</div>
{# Валюта платежа #}
<div class="row mb-3">
<label class="col-sm-2 col-form-label" for="input-currency">{{ entry_currency_label }}</label>
<div class="col-sm-10">
<select name="payment_payanyway_currency" id="input-currency" class="form-select">
{% for code, data in payment_payanyway_currencies %}
<option value="{{ code }}" {% if code == payment_payanyway_currency %}selected="selected"{% endif %}>{{ data.code }} ({{ entry_currency_rub_label }})</option>
{% endfor %}
</select>
<p class="help-block">{{ entry_currency_description }}</p>
</div>
</div>
{# Статусы заказа #}
<div class="row mb-3 required">
<label class="col-sm-2 col-form-label">{{ entry_order_statuses_label }}</label>
<div class="col-sm-10">
<div class="card" style="margin-bottom: 0;">
<div class="card-body">
{# pending #}
<div class="row mb-3">
<label class="col-sm-3 col-form-label" for="input-pending-order-status">
<span>{{ entry_pending_order_status_label }}</span>
<i class="fa-regular fa-circle-question text-info"
data-bs-toggle="tooltip"
title="{{ help_pending_order_status }}"
></i>
</label>
<div class="col-sm-9">
<select name="payment_payanyway_pending_order_status_id" id="input-pending-order-status" class="form-select">
<option value="" disabled selected="selected">
{{ entry_select_order_status_label|default(text_select) }}
</option>
{% for order_status in order_statuses %}
<option value="{{ order_status.order_status_id }}"
{% if order_status.order_status_id == payment_payanyway_pending_order_status_id %}selected="selected"{% endif %}>
{{ order_status.name }}
</option>
{% endfor %}
</select>
</div>
</div>
{# success #}
<div class="row mb-3">
<label class="col-sm-3 col-form-label" for="input-success-order-status">
<span>{{ entry_success_order_status_label }}</span>
<i class="fa-regular fa-circle-question text-info"
data-bs-toggle="tooltip"
title="{{ help_success_order_status }}"
></i>
</label>
<div class="col-sm-9">
<select name="payment_payanyway_success_order_status_id" id="input-success-order-status"
class="form-select">
<option value="" disabled
selected="selected">{{ entry_select_order_status_label|default(text_select) }}</option>
{% for order_status in order_statuses %}
<option value="{{ order_status.order_status_id }}"
{% if order_status.order_status_id == payment_payanyway_success_order_status_id %}selected="selected"{% endif %}>
{{ order_status.name }}
</option>
{% endfor %}
</select>
</div>
</div>
{# error #}
<div class="row mb-3">
<label class="col-sm-3 col-form-label" for="input-error-order-status">
<span>{{ entry_error_order_status_label }}</span>
<i class="fa-regular fa-circle-question text-info"
data-bs-toggle="tooltip"
title="{{ help_error_order_status }}"
></i>
</label>
<div class="col-sm-9">
<select name="payment_payanyway_error_order_status_id" id="input-error-order-status"
class="form-select">
<option value="" disabled
selected="selected">{{ entry_select_order_status_label|default(text_select) }}</option>
{% for order_status in order_statuses %}
<option value="{{ order_status.order_status_id }}"
{% if order_status.order_status_id == payment_payanyway_error_order_status_id %}selected="selected"{% endif %}>
{{ order_status.name }}
</option>
{% endfor %}
</select>
</div>
</div>
</div>
</div>
</div>
</div>
{# module_geo_zone #}
<div class="row mb-3">
<label class="col-sm-2 col-form-label" for="input-geo-zone">
<span>{{ entry_geo_zone_label }}</span>
<i class="fa-regular fa-circle-question text-info"
data-bs-toggle="tooltip"
title="{{ help_geo_zone }}"
></i>
</label>
<div class="col-sm-10">
<select name="payment_payanyway_geo_zone_id" id="input-geo-zone" class="form-select">
<option value="0">{{ text_all_zones }}</option>
{% for geo_zone in geo_zones %}
{% if geo_zone.geo_zone_id == payment_payanyway_geo_zone_id %}
<option value="{{ geo_zone.geo_zone_id }}" selected="selected">{{ geo_zone.name }}</option>
{% else %}
<option value="{{ geo_zone.geo_zone_id }}">{{ geo_zone.name }}</option>
{% endif %}
{% endfor %}
</select>
<p class="help-block">{{ entry_geo_zone_description }}</p>
</div>
</div>
{# sort-order #}
<div class="row mb-3">
<label class="col-sm-2 col-form-label" for="input-sort-order">
<span>{{ entry_sort_order_label }}</span>
<i class="fa-regular fa-circle-question text-info"
data-bs-toggle="tooltip"
title="{{ help_sort_order }}"
></i>
</label>
<div class="col-sm-10">
<input type="number" oninput="this.value = this.value.replace(/[^-0-9]/g, '').replace(/(?!^-)-/g, '')"
step="1" name="payment_payanyway_sort_order" value="{{ payment_payanyway_sort_order }}"
placeholder="{{ module_sort_order_label }}" id="input-sort-order" class="form-control"/>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{{ footer }}