File tree Expand file tree Collapse file tree 5 files changed +55
-3
lines changed Expand file tree Collapse file tree 5 files changed +55
-3
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ public function getDefaultParameters()
28
28
'developerMode ' => false ,
29
29
'liveEndpoint ' => 'https://api.authorize.net/xml/v1/request.api ' ,
30
30
'developerEndpoint ' => 'https://apitest.authorize.net/xml/v1/request.api ' ,
31
+ 'deviceType ' => 1 // Device used to make the transaction. Required for card present. "1" = Unknown.
31
32
);
32
33
}
33
34
@@ -97,6 +98,35 @@ public function setDuplicateWindow($value)
97
98
return $ this ->setParameter ('duplicateWindow ' , $ value );
98
99
}
99
100
101
+ public function getDeviceType ()
102
+ {
103
+ return $ this ->getParameter ('deviceType ' );
104
+ }
105
+
106
+ /**
107
+ * Sets the type of device used to collect the credit card data. A device type is required for card present
108
+ * transactions.
109
+ *
110
+ * 1 = Unknown
111
+ * 2 = Unattended Terminal
112
+ * 3 = Self Service Terminal
113
+ * 4 = Electronic Cash Register
114
+ * 5 = Personal Computer-Based Terminal
115
+ * 6 = AirPay
116
+ * 7 = Wireless POS
117
+ * 8 = Website
118
+ * 9 = Dial Terminal
119
+ * 10 = Virtual Terminal
120
+ *
121
+ * @see http://developer.authorize.net/api/reference/#payment-transactions-charge-a-credit-card
122
+ * @param $value
123
+ * @return $this
124
+ */
125
+ public function setDeviceType ($ value )
126
+ {
127
+ return $ this ->setParameter ('deviceType ' , $ value );
128
+ }
129
+
100
130
/**
101
131
* @param array $parameters
102
132
* @return AIMAuthorizeRequest
Original file line number Diff line number Diff line change @@ -100,6 +100,16 @@ public function getEndpoint()
100
100
return $ this ->getDeveloperMode () ? $ this ->getDeveloperEndpoint () : $ this ->getLiveEndpoint ();
101
101
}
102
102
103
+ public function getDeviceType ()
104
+ {
105
+ return $ this ->getParameter ('deviceType ' );
106
+ }
107
+
108
+ public function setDeviceType ($ value )
109
+ {
110
+ return $ this ->setParameter ('deviceType ' , $ value );
111
+ }
112
+
103
113
/**
104
114
* @return TransactionReference
105
115
*/
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ protected function addRetail(\SimpleXMLElement $data)
59
59
if ($ this ->isCardPresent ()) {
60
60
// Retail element is required for card present transactions
61
61
$ data ->transactionRequest ->retail ->marketType = 2 ;
62
- $ data ->transactionRequest ->retail ->deviceType = 1 ;
62
+ $ data ->transactionRequest ->retail ->deviceType = $ this -> getDeviceType () ;
63
63
}
64
64
}
65
65
}
Original file line number Diff line number Diff line change @@ -84,6 +84,16 @@ public function getDeveloperEndpoint()
84
84
return $ this ->getParameter ('developerEndpoint ' );
85
85
}
86
86
87
+ public function getDeviceType ()
88
+ {
89
+ return $ this ->getParameter ('deviceType ' );
90
+ }
91
+
92
+ public function setDeviceType ($ value )
93
+ {
94
+ return $ this ->setParameter ('deviceType ' , $ value );
95
+ }
96
+
87
97
/**
88
98
* Base data used only for the AIM API.
89
99
*/
Original file line number Diff line number Diff line change @@ -63,7 +63,8 @@ public function testGetDataCardPresentTrack1()
63
63
$ card ['tracks ' ] = '%B4242424242424242^SMITH/JOHN ^2511126100000000000000444000000?;4242424242424242=25111269999944401? ' ;
64
64
$ this ->request ->initialize (array (
65
65
'amount ' => '12.12 ' ,
66
- 'card ' => $ card
66
+ 'card ' => $ card ,
67
+ 'deviceType ' => 1
67
68
));
68
69
69
70
$ data = $ this ->request ->getData ();
@@ -83,7 +84,8 @@ public function testGetDataCardPresentTrack2()
83
84
$ card ['tracks ' ] = ';4242424242424242=25111269999944401? ' ;
84
85
$ this ->request ->initialize (array (
85
86
'amount ' => '12.12 ' ,
86
- 'card ' => $ card
87
+ 'card ' => $ card ,
88
+ 'deviceType ' => 1
87
89
));
88
90
89
91
$ data = $ this ->request ->getData ();
You can’t perform that action at this time.
0 commit comments