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

RefundRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 2
cbo 2
dl 0
loc 21
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getData() 0 13 1
A createResponse() 0 4 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