feat: paygw_moneta 1.0.0, MONETA.Assistant payment gateway for Moodle
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user