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

GetCustomerProfileRequest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 27
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A attachData() 0 5 2
A setUnmaskExpirationDate() 0 3 1
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