GetCustomerPaymentProfileRequest   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Test Coverage

Coverage 71.43%

Importance

Changes 0
Metric Value
eloc 11
c 0
b 0
f 0
dl 0
loc 38
ccs 10
cts 14
cp 0.7143
rs 10
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setCustomerPaymentProfileId() 0 3 1
A setCustomerProfileId() 0 3 1
A setUnmaskExpirationDate() 0 3 1
A attachData() 0 6 2
1
<?php
2
3
namespace CommerceGuys\AuthNet;
4
5
use CommerceGuys\AuthNet\Request\RequestInterface;
6
7
/**
8
 * Retrieve a customer payment profile for an existing customer profile.
9
 *
10
 * @link http://developer.authorize.net/api/reference/index.html#customer-profiles-get-customer-payment-profile
11
 */
12
class GetCustomerPaymentProfileRequest extends BaseApiRequest
13
{
14
    protected $customerProfileId;
15
    protected $customerPaymentProfileId;
16
    protected $unmaskExpirationDate = false;
17
18
    /**
19
     * @param mixed $customerProfileId
20
     */
21 1
    public function setCustomerProfileId($customerProfileId)
22
    {
23 1
        $this->customerProfileId = $customerProfileId;
24 1
    }
25
26
    /**
27
     * @param mixed $customerPaymentProfileId
28
     */
29 1
    public function setCustomerPaymentProfileId($customerPaymentProfileId)
30
    {
31 1
        $this->customerPaymentProfileId = $customerPaymentProfileId;
32 1
    }
33
34
    /**
35
     * @param boolean $unmaskExpirationDate
36
     */
37
    public function setUnmaskExpirationDate($unmaskExpirationDate)
38
    {
39
        $this->unmaskExpirationDate = $unmaskExpirationDate;
40
    }
41
42
43
44 1
    protected function attachData(RequestInterface $request)
45
    {
46 1
        $request->addData('customerProfileId', $this->customerProfileId);
47 1
        $request->addData('customerPaymentProfileId', $this->customerPaymentProfileId);
48 1
        if ($this->unmaskExpirationDate) {
49
            $request->addData('unmaskExpirationDate', $this->unmaskExpirationDate);
50
        }
51 1
    }
52
}
53