feat: paygw_moneta 1.0.0, MONETA.Assistant payment gateway for Moodle

This commit is contained in:
2026-09-25 16:42:38 +03:00
parent 70464af858
commit 14b386a550
65 changed files with 5377 additions and 59 deletions
+40
View File
@@ -0,0 +1,40 @@
<?php
declare(strict_types=1);
namespace paygw_moneta\local\protocol;
/**
* @package paygw_moneta
* @copyright 2026 Moneta Labs {@link https://moneta.ru/}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
enum PaymentServer: string
{
case Prod = 'PROD';
case Demo = 'DEMO';
/**
* Адрес платёжной формы MONETA.Assistant.
*/
public function url(): string
{
return match ($this) {
self::Prod => 'https://www.payanyway.ru/assistant.htm',
self::Demo => 'https://demo.moneta.ru/assistant.htm',
};
}
/**
* Ключ строки интерфейса (`server_prod`, `server_demo`).
*/
public function label(): string
{
return 'server_' . strtolower($this->value);
}
public static function fromSetting(?string $value): self
{
return self::tryFrom((string) $value) ?? self::Prod;
}
}