forked from apoloz/alfa-bank-sdk
first commit
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace Gemini\AlfaBank\Sbp\Requests\DigitalRuble\CashLink;
|
||||
|
||||
use Gemini\AlfaBank\Sbp\Data\DigitalRuble\CashLink\ChangeAccForCashUniQrRequestData;
|
||||
use Gemini\AlfaBank\Sbp\Data\DigitalRuble\CashLink\ChangeAccForCashUniQrResponseData;
|
||||
use Saloon\Contracts\Body\HasBody;
|
||||
use Saloon\Enums\Method;
|
||||
use Saloon\Http\Request;
|
||||
use Saloon\Http\Response;
|
||||
use Saloon\Traits\Body\HasJsonBody;
|
||||
|
||||
class ChangeAccForCashUniQrRequest extends Request implements HasBody
|
||||
{
|
||||
use HasJsonBody;
|
||||
|
||||
protected Method $method = Method::POST;
|
||||
|
||||
public function __construct(
|
||||
protected ChangeAccForCashUniQrRequestData $data
|
||||
) {}
|
||||
|
||||
public function resolveEndpoint(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
protected function defaultBody(): array
|
||||
{
|
||||
$body = [
|
||||
'command' => 'ChangeAccForCashUniQr',
|
||||
'TermNo' => $this->data->TermNo,
|
||||
];
|
||||
|
||||
if ($this->data->messageID !== null) $body['messageID'] = $this->data->messageID;
|
||||
if ($this->data->qrcId !== null) $body['qrcId'] = $this->data->qrcId;
|
||||
if ($this->data->account !== null) $body['account'] = $this->data->account;
|
||||
if ($this->data->accountDR !== null) $body['accountDR'] = $this->data->accountDR;
|
||||
if ($this->data->NewTermNo !== null) $body['NewTermNo'] = $this->data->NewTermNo;
|
||||
if ($this->data->NewMerchantId !== null) $body['NewMerchantId'] = $this->data->NewMerchantId;
|
||||
if ($this->data->redirectUrl !== null) $body['redirectUrl'] = $this->data->redirectUrl;
|
||||
if ($this->data->paymentPageUrl !== null) $body['paymentPageUrl'] = $this->data->paymentPageUrl;
|
||||
if ($this->data->fraudScore !== null) $body['fraudScore'] = $this->data->fraudScore;
|
||||
|
||||
return $body;
|
||||
}
|
||||
|
||||
public function createDtoFromResponse(Response $response): ChangeAccForCashUniQrResponseData
|
||||
{
|
||||
return ChangeAccForCashUniQrResponseData::from($response->json());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user