setCustomerProfileId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
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