Completed
Push — master ( 388f0e...e0ca1a )
by Aimeos
13s queued 11s
created

RefundRequest::createResponse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Omnipay\Sofort\Message;
6
7
use SimpleXMLElement;
8
9
class RefundRequest extends AbstractRequest
10
{
11
    public function getData()
12
    {
13
        $data = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><refunds/>');
14
15
        $data->addChild('project_id', $this->getProjectId());
16
17
        $refund = $data->addChild('refund');
18
19
        $refund->addChild('amount', $this->getAmount());
20
        $refund->addChild('transaction', $this->getTransactionReference());
21
22
        return $data;
23
    }
24
25
    protected function createResponse($response)
26
    {
27
        return $this->response = new RefundResponse($this, $response);
28
    }
29
}
30