Completed
Pull Request — master (#21)
by
unknown
03:38
created

UpdateCustomerPaymentProfileRequest::attachData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 9.4285
c 1
b 0
f 1
cc 1
eloc 4
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