Completed
Push — master ( 2b4e07...cec605 )
by Marco
01:05
created

ShipmentRequest::getData()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
namespace Omnipay\Heidelpay\Message;
3
4
/**
5
 * Charge Request
6
 *
7
 * @method Response send()
8
 */
9
class ShipmentRequest extends AbstractRequest
10
{
11
    public function getData()
12
    {
13
        $this->validate('transactionId');
14
15
        $data = [];
16
17
        if ($this->getTransactionReference()) {
18
            $data['invoiceId'] = $this->getTransactionReference();
19
        }
20
21
        return $data;
22
    }
23
24
    public function getEndpoint()
25
    {
26
        return parent::getEndpoint() . 'payments/' . $this->getTransactionId() . '/shipments';
27
    }
28
29
30
    protected function createResponse($data)
31
    {
32
        return $this->response = new ShipmentResponse($this, $data);
33
    }
34
}
35