CompletePurchaseRequest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 16
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A sendData() 0 14 1
1
<?php
2
3
namespace Empatix\OmnipaySwedbank\Messages;
4
5
use Empatix\OmnipaySwedbank\Gateway;
6
use Empatix\OmnipaySwedbank\Messages\Response;
7
8
class CompletePurchaseRequest extends PurchaseRequest
9
{
10
    public function sendData($data)
11
    {
12
        $url = $this->getEndpoint() . $this->getTransactionReference();
13
14
        $httpResponse = $this->httpClient->request('GET', $url, [
15
            'Authorization' => 'Bearer ' . $this->getPassword(),
16
        ]);
17
18
        $this->response = new Response(
19
            $this,
20
            json_decode($httpResponse->getBody()->getContents(), true)
21
        );
22
23
        return $this->response;
24
    }
25
}
26