Passed
Pull Request — master (#57)
by
unknown
08:52
created

QuickPay::setHeaders()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
namespace QuickPay;
3
4
use QuickPay\API\Client;
5
use QuickPay\API\Request;
6
7
class QuickPay
8
{
9
    /**
10
     * Contains the QuickPay_Request object
11
     *
12
     * @access public
13
     **/
14
    public $request;
15
16
    /**
17
     * @access protected
18
     */
19
    protected $client;
20
21
    /**
22
    * __construct function.
23
    *
24
    * Instantiates the main class.
25
    * Creates a client which is passed to the request construct.
26
    *
27
    * @auth_string string Authentication string for QuickPay
28
    *
29
    * @access public
30
    */
31
    public function __construct($auth_string = '', $additional_headers = array())
32
    {
33
        $this->client = new Client($auth_string, $additional_headers);
34
        $this->request = new Request($this->client);
35
    }
36
37
    /**
38
     * Add additional headers to request.
39
     *
40
     * This could be used when need to test a callback url in dev mode
41
     *
42
     *      QuickPay-Callback-Url: http://text.url/callback
43
     *
44
     * @access public
45
     */
46
    public function setHeaders($additional_headers = array())
47
    {
48
        $this->client->setHeaders($additional_headers);
49
    }
50
}
51