Passed
Pull Request — master (#43)
by
unknown
01:45
created

setUnmaskExpirationDate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 0
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace CommerceGuys\AuthNet;
4
5
use GuzzleHttp\Client;
6
use CommerceGuys\AuthNet\Request\RequestInterface;
7
8
/**
9
 * Retrieve an existing customer profile.
10
 *
11
 * @link http://developer.authorize.net/api/reference/index.html#customer-profiles-get-customer-profile
12
 */
13
class GetCustomerProfileRequest extends BaseApiRequest
14
{
15
    protected $customerProfileId;
16
    protected $unmaskExpirationDate = false;
17
18
    public function __construct(
19
        Configuration $configuration,
20
        Client $client,
21
        $customerProfileId
22
    ) {
23
        parent::__construct($configuration, $client);
24
        $this->customerProfileId = $customerProfileId;
25
    }
26
27
    /**
28
     * @param boolean $unmaskExpirationDate
29
     */
30
    public function setUnmaskExpirationDate($unmaskExpirationDate)
31
    {
32
       $this->unmaskExpirationDate = $unmaskExpirationDate;
33
    }
34
35
	protected function attachData(RequestInterface $request)
36
    {
37
        $request->addData('customerProfileId', $this->customerProfileId);
38
        if ($this->unmaskExpirationDate) {
39
            $request->addData('unmaskExpirationDate', $this->unmaskExpirationDate);
40
        }
41
    }
42
}
43