forked from payuru/php-payu4
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathQst.php
More file actions
55 lines (45 loc) · 1.08 KB
/
Qst.php
File metadata and controls
55 lines (45 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
declare(strict_types=1);
namespace Ypmn;
use JsonSerializable;
/**
* Анкета продавца
**/
class Qst implements QstInterface, JsonSerializable
{
private string $inn;
private QstSchemaInterface $schema;
/** @inheritdoc */
public function getInn(): string
{
return $this->inn;
}
/** @inheritdoc */
public function setInn(string $inn): self
{
$this->inn = $inn;
return $this;
}
/** @inheritdoc */
public function getSchema(): QstSchemaInterface
{
return $this->schema;
}
/** @inheritdoc */
public function setSchema(QstSchemaInterface $schema): self
{
$this->schema = $schema;
return $this;
}
/**
* @return string
*/
public function jsonSerialize(): string
{
$requestData = [
'inn' => $this->getInn(),
'schema' => $this->getSchema()->toArray()
];
return json_encode($requestData, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_LINE_TERMINATORS);
}
}