Passed
Push — master ( b7c0cf...4514bd )
by Matt
02:18
created

setPaymentProfile()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace CommerceGuys\AuthNet;
4
5
use CommerceGuys\AuthNet\DataTypes\PaymentProfile;
6
use CommerceGuys\AuthNet\Request\RequestInterface;
7
8
/**
9
 * Update an existing customer payment profile.
10
 *
11
 * @link http://developer.authorize.net/api/reference/index.html#customer-profiles-update-customer-payment-profile
12
 */
13
class UpdateCustomerPaymentProfileRequest extends BaseApiRequest
14
{
15
16
    /**
17
     * @var \CommerceGuys\AuthNet\DataTypes\PaymentProfile
18
     */
19
    protected $paymentProfile;
20
21
    protected $customerProfileId;
22
23
    protected $validationMode = 'testMode';
24
25 1
    public function setPaymentProfile(PaymentProfile $profile)
26
    {
27 1
        $this->paymentProfile = $profile;
28 1
    }
29
30 1
    public function setCustomerProfileId($id)
31
    {
32 1
        $this->customerProfileId = $id;
33 1
    }
34
35 1
    public function setValidationMode($validationMode)
36
    {
37 1
        $this->validationMode = $validationMode;
38 1
    }
39
40 1
    protected function attachData(RequestInterface $request)
41
    {
42 1
        $request->addData('customerProfileId', $this->customerProfileId);
43 1
        $request->addDataType($this->paymentProfile);
44 1
        $request->addData('validationMode', $this->validationMode);
45 1
    }
46
}
47