1 | <?php |
||
2 | |||
3 | /** |
||
4 | * Apache OSL-2 |
||
5 | * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. |
||
6 | */ |
||
7 | |||
8 | namespace SprykerEco\Zed\AmazonPay\Business\Api\Adapter; |
||
9 | |||
10 | use AmazonPay\IpnHandlerInterface; |
||
11 | use SprykerEco\Zed\AmazonPay\Business\Api\Converter\Ipn\IpnConverterInterface; |
||
12 | |||
13 | class IpnRequestAdapter implements IpnRequestAdapterInterface |
||
14 | { |
||
15 | /** |
||
16 | * @var \AmazonPay\IpnHandlerInterface |
||
17 | */ |
||
18 | protected $ipnHandler; |
||
19 | |||
20 | /** |
||
21 | * @var \SprykerEco\Zed\AmazonPay\Business\Api\Converter\Ipn\IpnConverterInterface |
||
22 | */ |
||
23 | protected $ipnArrayConverter; |
||
24 | |||
25 | /** |
||
26 | * @param \AmazonPay\IpnHandlerInterface $ipnHandler |
||
27 | * @param \SprykerEco\Zed\AmazonPay\Business\Api\Converter\Ipn\IpnConverterInterface $ipnArrayConverter |
||
28 | */ |
||
29 | public function __construct( |
||
30 | IpnHandlerInterface $ipnHandler, |
||
31 | IpnConverterInterface $ipnArrayConverter |
||
32 | ) { |
||
33 | $this->ipnHandler = $ipnHandler; |
||
34 | $this->ipnArrayConverter = $ipnArrayConverter; |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * @param string $body |
||
39 | * |
||
40 | * @return \Generated\Shared\Transfer\AmazonpayIpnPaymentRequestTransfer |
||
41 | */ |
||
42 | public function getIpnRequest($body) |
||
43 | { |
||
44 | return $this->ipnArrayConverter->convert( |
||
45 | $this->ipnHandler->toArray(), |
||
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
46 | $body |
||
47 | ); |
||
48 | } |
||
49 | } |
||
50 |