| @@ 8-39 (lines=32) @@ | ||
| 5 | use function Personnage\Tinkoff\SDK\message_get_body; |
|
| 6 | use Psr\Http\Message\ResponseInterface; |
|
| 7 | ||
| 8 | final class Charge extends Response |
|
| 9 | { |
|
| 10 | use HasPsr7Response; |
|
| 11 | ||
| 12 | private $body; |
|
| 13 | ||
| 14 | public function __construct(ResponseInterface $response) |
|
| 15 | { |
|
| 16 | $this->body = message_get_body($response); |
|
| 17 | $this->setPsr7Response($response); |
|
| 18 | } |
|
| 19 | ||
| 20 | public function getAmount() |
|
| 21 | { |
|
| 22 | return $this->body['Amount'] ?? null; |
|
| 23 | } |
|
| 24 | ||
| 25 | public function getStatus() |
|
| 26 | { |
|
| 27 | return $this->body['Status'] ?? null; |
|
| 28 | } |
|
| 29 | ||
| 30 | public function getOrderId() |
|
| 31 | { |
|
| 32 | return $this->body['OrderId'] ?? null; |
|
| 33 | } |
|
| 34 | ||
| 35 | public function getPaymentId() |
|
| 36 | { |
|
| 37 | return $this->body['PaymentId'] ?? null; |
|
| 38 | } |
|
| 39 | } |
|
| 40 | ||
| @@ 8-34 (lines=27) @@ | ||
| 5 | use function Personnage\Tinkoff\SDK\message_get_body; |
|
| 6 | use Psr\Http\Message\ResponseInterface; |
|
| 7 | ||
| 8 | final class Confirm extends Response |
|
| 9 | { |
|
| 10 | use HasPsr7Response; |
|
| 11 | ||
| 12 | private $body; |
|
| 13 | ||
| 14 | public function __construct(ResponseInterface $response) |
|
| 15 | { |
|
| 16 | $this->body = message_get_body($response); |
|
| 17 | $this->setPsr7Response($response); |
|
| 18 | } |
|
| 19 | ||
| 20 | public function getStatus() |
|
| 21 | { |
|
| 22 | return $this->body['Status'] ?? null; |
|
| 23 | } |
|
| 24 | ||
| 25 | public function getOrderId() |
|
| 26 | { |
|
| 27 | return $this->body['OrderId'] ?? null; |
|
| 28 | } |
|
| 29 | ||
| 30 | public function getPaymentId() |
|
| 31 | { |
|
| 32 | return $this->body['PaymentId'] ?? null; |
|
| 33 | } |
|
| 34 | } |
|
| 35 | ||
| @@ 8-34 (lines=27) @@ | ||
| 5 | use function Personnage\Tinkoff\SDK\message_get_body; |
|
| 6 | use Psr\Http\Message\ResponseInterface; |
|
| 7 | ||
| 8 | final class Payment extends Response |
|
| 9 | { |
|
| 10 | use HasPsr7Response; |
|
| 11 | ||
| 12 | private $body; |
|
| 13 | ||
| 14 | public function __construct(ResponseInterface $response) |
|
| 15 | { |
|
| 16 | $this->body = message_get_body($response); |
|
| 17 | $this->setPsr7Response($response); |
|
| 18 | } |
|
| 19 | ||
| 20 | public function getStatus() |
|
| 21 | { |
|
| 22 | return $this->body['Status'] ?? null; |
|
| 23 | } |
|
| 24 | ||
| 25 | public function getOrderId() |
|
| 26 | { |
|
| 27 | return $this->body['OrderId'] ?? null; |
|
| 28 | } |
|
| 29 | ||
| 30 | public function getPaymentId() |
|
| 31 | { |
|
| 32 | return $this->body['PaymentId'] ?? null; |
|
| 33 | } |
|
| 34 | } |
|
| 35 | ||
| @@ 8-34 (lines=27) @@ | ||
| 5 | use function Personnage\Tinkoff\SDK\message_get_body; |
|
| 6 | use Psr\Http\Message\ResponseInterface; |
|
| 7 | ||
| 8 | final class State extends Response |
|
| 9 | { |
|
| 10 | use HasPsr7Response; |
|
| 11 | ||
| 12 | private $body; |
|
| 13 | ||
| 14 | public function __construct(ResponseInterface $response) |
|
| 15 | { |
|
| 16 | $this->body = message_get_body($response); |
|
| 17 | $this->setPsr7Response($response); |
|
| 18 | } |
|
| 19 | ||
| 20 | public function getStatus() |
|
| 21 | { |
|
| 22 | return $this->body['Status'] ?? null; |
|
| 23 | } |
|
| 24 | ||
| 25 | public function getOrderId() |
|
| 26 | { |
|
| 27 | return $this->body['OrderId'] ?? null; |
|
| 28 | } |
|
| 29 | ||
| 30 | public function getPaymentId() |
|
| 31 | { |
|
| 32 | return $this->body['PaymentId'] ?? null; |
|
| 33 | } |
|
| 34 | } |
|
| 35 | ||