// use Apoloz\AlfaBank\Sbp\Data\CashLink\ActivateCashQrRequestData; use Apoloz\AlfaBank\Utils\CmsSigner; use Saloon\Contracts\Body\HasBody; use Saloon\Enums\Method; use Saloon\Http\Request; use Saloon\Http\Response; use Saloon\Traits\Body\HasStringBody; // //
// class ActivateCashQrRequest extends Request implements HasBody { use HasStringBody; //
// protected Method $method = Method::POST; //
//
// public function __construct( protected ActivateCashQrRequestData $data ) {} //
// public function resolveEndpoint(): string { return ''; // Endpoint is determined by SbpConnector's base URL } //
//
// public function createDtoFromResponse(Response $response): array { return $response->json(); } //
//
// protected function defaultBody(): string { $bodyArray = [ 'command' => 'ActivateCashQRc', 'TermNo' => $this->data->TermNo, 'qrcId' => $this->data->qrcId, 'amount' => $this->data->amount, 'currency' => $this->data->currency, ]; if ($this->data->OrderNumber !== null) { $bodyArray['OrderNumber'] = $this->data->OrderNumber; } if ($this->data->paymentPurpose !== null) { $bodyArray['paymentPurpose'] = $this->data->paymentPurpose; } if ($this->data->qrTtl !== null) { $bodyArray['qrTtl'] = $this->data->qrTtl; } if ($this->data->redirectUrl !== null) { $bodyArray['redirectUrl'] = $this->data->redirectUrl; } if ($this->data->notificationUrl !== null) { $bodyArray['queryData'] = ['notificationUrl' => $this->data->notificationUrl]; } return CmsSigner::canonicalize($bodyArray); } //
}