-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathCheckPaymentMobileResponse.php
44 lines (39 loc) · 1.15 KB
/
CheckPaymentMobileResponse.php
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
<?php
declare(strict_types=1);
namespace SergeyNezbritskiy\PrivatBank\Response;
use SergeyNezbritskiy\PrivatBank\Base\AbstractResponse;
/**
* Class CheckPaymentMobileResponse
* @package SergeyNezbritskiy\PrivatBank\Response
*/
class CheckPaymentMobileResponse extends AbstractResponse
{
/**
* Response sample
* ```xml
* <?xml version="1.0" encoding="UTF-8"?>
* <response version="1.0">
* <merchant>
* <id>75482</id>
* <signature>553995c5ccc8c81815b58cf6374f68f00a28bbd7</signature>
* </merchant>
* <data>
* <oper>cmt</oper>
* <payment id="1234567" state="ok" message="Исполнен" />
* </data>
* </response>
* ```
* @return array
*/
public function getData(): array
{
$xml = $this->getXmlContent();
/** @var \DOMElement $payment */
$payment = $xml->getElementsByTagName('payment')[0];
return [
'id' => $payment->getAttribute('id'),
'state' => $payment->getAttribute('state'),
'message' => $payment->getAttribute('message'),
];
}
}