InvoiceCreatedRequest::getEndpoint()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Omnipay\BillPay\Message;
4
5
use Omnipay\BillPay\Message\RequestData\InvoiceTrait;
6
use Omnipay\Common\Exception\InvalidRequestException;
7
use Omnipay\Common\Message\ResponseInterface;
8
use SimpleXMLElement;
9
10
/**
11
 * Message InvoiceCreatedRequest
12
 *
13
 * @link      https://techdocs.billpay.de/en/For_developers/XML_API/InvoiceCreated.html
14
 *
15
 * @author    Andreas Lange <[email protected]>
16
 * @copyright 2016, Connox GmbH
17
 * @license   MIT
18
 */
19
class InvoiceCreatedRequest extends AbstractRequest
20
{
21
    use InvoiceTrait;
22
23
    /**
24
     * Get the raw data array for this message. The format of this varies from gateway to
25
     * gateway, but will usually be either an associative array, or a SimpleXMLElement.
26
     *
27
     * @throws InvalidRequestException
28
     *
29
     * @return SimpleXMLElement
30
     */
31 2
    public function getData()
32
    {
33 2
        $data = $this->getBaseData();
34
35 2
        $this->appendInvoice($data);
36
37 2
        return $data;
38
    }
39
40
    /**
41
     * @param SimpleXMLElement $response
42
     *
43
     * @return ResponseInterface
44
     */
45 1
    protected function createResponse($response)
46
    {
47 1
        return $this->response = new InvoiceCreatedResponse($this, $response);
48
    }
49
50
    /**
51
     * @return string
52
     */
53 1
    protected function getEndpoint()
54
    {
55 1
        return parent::getEndpoint() . '/invoiceCreated';
56
    }
57
}
58