'GetQRCd', 'TermNo' => $this->data->TermNo, 'qrcType' => $this->data->qrcType, 'currency' => $this->data->currency, ]; // Common Fields if ($this->data->amount !== null) $body['amount'] = $this->data->amount; if ($this->data->paymentPurpose !== null) $body['paymentPurpose'] = $this->data->paymentPurpose; if ($this->data->redirectUrl !== null) $body['redirectUrl'] = $this->data->redirectUrl; if ($this->data->messageID !== null) $body['messageID'] = $this->data->messageID; if ($this->data->width !== null) $body['width'] = $this->data->width; if ($this->data->height !== null) $body['height'] = $this->data->height; // Dynamic QR Fields if ($this->data->OrderNumber !== null) $body['OrderNumber'] = $this->data->OrderNumber; if ($this->data->qrTtl !== null) $body['qrTtl'] = $this->data->qrTtl; if ($this->data->subscriptionServiceId !== null) $body['subscriptionServiceId'] = $this->data->subscriptionServiceId; if ($this->data->subscriptionServiceName !== null) $body['subscriptionServiceName'] = $this->data->subscriptionServiceName; // Query Data nesting $queryData = []; if ($this->data->notificationUrl !== null) $queryData['notificationUrl'] = $this->data->notificationUrl; if ($this->data->SenderFIO !== null) $queryData['SenderFIO'] = $this->data->SenderFIO; if ($this->data->SenderID !== null) $queryData['SenderID'] = $this->data->SenderID; if ($this->data->SenderBankBIC !== null) $queryData['SenderBankBIC'] = $this->data->SenderBankBIC; if (!empty($queryData)) { $body['queryData'] = $queryData; } return $body; } public function createDtoFromResponse(Response $response): QrCodeResponseData { return QrCodeResponseData::from($response->json()); } }