isPositive()) { throw new InvalidArgumentException('Сумма платежа должна быть больше нуля.'); } } public function getActionUrl(): string { return $this->server->url(); } /** * @return array */ public function getFields(): array { return [ 'MNT_ID' => $this->accountId, 'MNT_TRANSACTION_ID' => $this->transactionId, 'MNT_AMOUNT' => $this->amount->toDecimal(), 'MNT_CURRENCY_CODE' => AssistantProtocol::CURRENCY, 'MNT_SUBSCRIBER_ID' => $this->subscriberId, 'MNT_TEST_MODE' => AssistantProtocol::testModeFlag($this->testMode), 'MNT_DESCRIPTION' => mb_substr($this->description, 0, self::DESCRIPTION_MAX_LENGTH), 'MNT_SUCCESS_URL' => $this->successUrl, 'MNT_FAIL_URL' => $this->failUrl, 'MNT_RETURN_URL' => $this->returnUrl, 'moneta.locale' => $this->locale, 'MNT_CMS' => $this->cms, 'MNT_SIGNATURE' => $this->signature->forPaymentForm( accountId: $this->accountId, transactionId: $this->transactionId, amount: $this->amount, currency: AssistantProtocol::CURRENCY, subscriberId: $this->subscriberId, testMode: $this->testMode, ), ]; } }