CreateCustomerPaymentProfileRequest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 10
c 0
b 0
f 0
dl 0
loc 31
ccs 13
cts 13
cp 1
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A attachData() 0 5 1
A setPaymentProfile() 0 3 1
A setValidationMode() 0 3 1
A setCustomerProfileId() 0 3 1
1
<?php
2
3
namespace CommerceGuys\AuthNet;
4
5
use CommerceGuys\AuthNet\DataTypes\PaymentProfile;
6
use CommerceGuys\AuthNet\Request\RequestInterface;
7
8
/**
9
 * Create a new customer payment profile for an existing customer profile.
10
 *
11
 * @link http://developer.authorize.net/api/reference/index.html#customer-profiles-create-customer-payment-profile
12
 */
13
class CreateCustomerPaymentProfileRequest extends BaseApiRequest
14
{
15
    /**
16
     * @var \CommerceGuys\AuthNet\DataTypes\PaymentProfile
17
     */
18
    protected $paymentProfile;
19
20
    protected $customerProfileId;
21
22
    protected $validationMode = 'testMode';
23
24 2
    public function setPaymentProfile(PaymentProfile $profile)
25
    {
26 2
        $this->paymentProfile = $profile;
27 2
    }
28
29 2
    public function setCustomerProfileId($id)
30
    {
31 2
        $this->customerProfileId = $id;
32 2
    }
33
34 1
    public function setValidationMode($validationMode)
35
    {
36 1
        $this->validationMode = $validationMode;
37 1
    }
38
39 2
    protected function attachData(RequestInterface $request)
40
    {
41 2
        $request->addData('customerProfileId', $this->customerProfileId);
42 2
        $request->addDataType($this->paymentProfile);
43 2
        $request->addData('validationMode', $this->validationMode);
44 2
    }
45
}
46