1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace CommerceGuys\AuthNet; |
4
|
|
|
|
5
|
|
|
use CommerceGuys\AuthNet\Request\RequestInterface; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Verifies an existing customer payment profile. |
9
|
|
|
* |
10
|
|
|
* @link http://developer.authorize.net/api/reference/index.html#customer-profiles-validate-customer-payment-profile |
11
|
|
|
*/ |
12
|
|
|
class ValidateCustomerPaymentProfileRequest extends BaseApiRequest |
13
|
|
|
{ |
14
|
|
|
protected $customerProfileId; |
15
|
|
|
protected $customerPaymentProfileId; |
16
|
|
|
protected $customerShippingAddressId; |
17
|
|
|
protected $cardCode; |
18
|
|
|
protected $validationMode = 'testMode'; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* @param mixed $customerProfileId |
22
|
|
|
*/ |
23
|
1 |
|
public function setCustomerProfileId($customerProfileId) |
24
|
|
|
{ |
25
|
1 |
|
$this->customerProfileId = $customerProfileId; |
26
|
1 |
|
} |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @param mixed $customerPaymentProfileId |
30
|
|
|
*/ |
31
|
1 |
|
public function setCustomerPaymentProfileId($customerPaymentProfileId) |
32
|
|
|
{ |
33
|
1 |
|
$this->customerPaymentProfileId = $customerPaymentProfileId; |
34
|
1 |
|
} |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @param mixed $customerShippingAddressId |
38
|
|
|
*/ |
39
|
|
|
public function setCustomerShippingAddressId($customerShippingAddressId) |
40
|
|
|
{ |
41
|
|
|
$this->customerShippingAddressId = $customerShippingAddressId; |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @param mixed $cardCode |
46
|
|
|
*/ |
47
|
|
|
public function setCardCode($cardCode) |
48
|
|
|
{ |
49
|
|
|
$this->cardCode = $cardCode; |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
public function setValidationMode($validationMode) |
53
|
|
|
{ |
54
|
|
|
$this->validationMode = $validationMode; |
55
|
|
|
} |
56
|
|
|
|
57
|
1 |
|
protected function attachData(RequestInterface $request) |
58
|
|
|
{ |
59
|
1 |
|
$request->addData('customerProfileId', $this->customerProfileId); |
60
|
1 |
|
$request->addData('customerPaymentProfileId', $this->customerPaymentProfileId); |
61
|
|
|
|
62
|
1 |
|
if (isset($this->customerShippingAddressId)) { |
63
|
|
|
$request->addData('customerShippingAddressId', $this->customerShippingAddressId); |
64
|
|
|
} |
65
|
1 |
|
if (isset($this->cardCode)) { |
66
|
|
|
$request->addData('cardCode', $this->cardCode); |
67
|
|
|
} |
68
|
1 |
|
$request->addData('validationMode', $this->validationMode); |
69
|
1 |
|
} |
70
|
|
|
} |
71
|
|
|
|