Skip to content

Commit 7fa78e6

Browse files
authored
Merge pull request #359 from AuthorizeNet/nodependency-rc
Minimal dependency SDK - 2.0.0
2 parents 9ebe333 + d6d062d commit 7fa78e6

15 files changed

+845
-54
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ echo "Connection uses " . $json->tls_version ."\n";
5050
### Composer
5151
We recommend using [`Composer`](http://getcomposer.org). *(Note: we never recommend you
5252
override the new secure-http default setting)*.
53-
*Update your composer.json file as per the example below and then run for this specific ALPHA release
53+
*Update your composer.json file as per the example below and then run for this specific release
5454
`composer update`.*
5555

5656
```json
5757
{
5858
"require": {
5959
"php": ">=5.6",
60-
"authorizenet/authorizenet": "2.0.0-ALPHA"
60+
"authorizenet/authorizenet": "2.0.0"
6161
}
6262
}
6363
```

classmap.php

+9-4
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,10 @@
246246
'net\authorize\api\contract\v1\ListOfAUDetailsType' => $libDir . 'net/authorize/api/contract/v1/ListOfAUDetailsType.php',
247247
'net\authorize\api\contract\v1\EmvTagType' => $libDir . 'net/authorize/api/contract/v1/EmvTagType.php',
248248
'net\authorize\api\contract\v1\PaymentEmvType' => $libDir . 'net/authorize/api/contract/v1/PaymentEmvType.php',
249+
'net\authorize\api\contract\v1\OtherTaxType' => $libDir . 'net/authorize/api/contract/v1/OtherTaxType.php',
250+
'net\authorize\api\contract\v1\UpdateMerchantDetailsRequest' => $libDir . 'net/authorize/api/contract/v1/UpdateMerchantDetailsRequest.php',
251+
'net\authorize\api\contract\v1\UpdateMerchantDetailsResponse' => $libDir . 'net/authorize/api/contract/v1/UpdateMerchantDetailsResponse.php',
252+
'net\authorize\api\contract\v1\WebCheckOutDataTypeTokenType' => $libDir . 'net/authorize/api/contract/v1/WebCheckOutDataTypeTokenType.php',
249253

250254
//Controllers
251255
'net\authorize\api\controller\ARBCancelSubscriptionController' => $libDir . 'net/authorize/api/controller/ARBCancelSubscriptionController.php',
@@ -265,6 +269,8 @@
265269
'net\authorize\api\controller\DeleteCustomerPaymentProfileController' => $libDir . 'net/authorize/api/controller/DeleteCustomerPaymentProfileController.php',
266270
'net\authorize\api\controller\DeleteCustomerProfileController' => $libDir . 'net/authorize/api/controller/DeleteCustomerProfileController.php',
267271
'net\authorize\api\controller\DeleteCustomerShippingAddressController' => $libDir . 'net/authorize/api/controller/DeleteCustomerShippingAddressController.php',
272+
'net\authorize\api\controller\GetAUJobDetailsController' => $libDir . 'net/authorize/api/controller/GetAUJobDetailsController.php',
273+
'net\authorize\api\controller\GetAUJobSummaryController' => $libDir . 'net/authorize/api/controller/GetAUJobSummaryController.php',
268274
'net\authorize\api\controller\GetBatchStatisticsController' => $libDir . 'net/authorize/api/controller/GetBatchStatisticsController.php',
269275
'net\authorize\api\controller\GetCustomerPaymentProfileController' => $libDir . 'net/authorize/api/controller/GetCustomerPaymentProfileController.php',
270276
'net\authorize\api\controller\GetCustomerPaymentProfileListController' => $libDir . 'net/authorize/api/controller/GetCustomerPaymentProfileListController.php',
@@ -277,6 +283,7 @@
277283
'net\authorize\api\controller\GetSettledBatchListController' => $libDir . 'net/authorize/api/controller/GetSettledBatchListController.php',
278284
'net\authorize\api\controller\GetTransactionDetailsController' => $libDir . 'net/authorize/api/controller/GetTransactionDetailsController.php',
279285
'net\authorize\api\controller\GetTransactionListController' => $libDir . 'net/authorize/api/controller/GetTransactionListController.php',
286+
'net\authorize\api\controller\GetTransactionListForCustomerController' => $libDir . 'net/authorize/api/controller/GetTransactionListForCustomerController.php',
280287
'net\authorize\api\controller\GetUnsettledTransactionListController' => $libDir . 'net/authorize/api/controller/GetUnsettledTransactionListController.php',
281288
'net\authorize\api\controller\IsAliveController' => $libDir . 'net/authorize/api/controller/IsAliveController.php',
282289
'net\authorize\api\controller\LogoutController' => $libDir . 'net/authorize/api/controller/LogoutController.php',
@@ -288,10 +295,8 @@
288295
'net\authorize\api\controller\UpdateCustomerProfileController' => $libDir . 'net/authorize/api/controller/UpdateCustomerProfileController.php',
289296
'net\authorize\api\controller\UpdateCustomerShippingAddressController' => $libDir . 'net/authorize/api/controller/UpdateCustomerShippingAddressController.php',
290297
'net\authorize\api\controller\UpdateHeldTransactionController' => $libDir . 'net/authorize/api/controller/UpdateHeldTransactionController.php',
298+
'net\authorize\api\controller\UpdateMerchantDetailsController' => $libDir . 'net/authorize/api/controller/UpdateMerchantDetailsController.php',
291299
'net\authorize\api\controller\UpdateSplitTenderGroupController' => $libDir . 'net/authorize/api/controller/UpdateSplitTenderGroupController.php',
292-
'net\authorize\api\controller\ValidateCustomerPaymentProfileController' => $libDir . 'net/authorize/api/controller/ValidateCustomerPaymentProfileController.php',
293-
'net\authorize\api\controller\GetTransactionListForCustomerController' => $libDir . 'net/authorize/api/controller/GetTransactionListForCustomerController.php',
294-
'net\authorize\api\controller\GetAUJobDetailsController' => $libDir . 'net/authorize/api/controller/GetAUJobDetailsController.php',
295-
'net\authorize\api\controller\GetAUJobSummaryController' => $libDir . 'net/authorize/api/controller/GetAUJobSummaryController.php'
300+
'net\authorize\api\controller\ValidateCustomerPaymentProfileController' => $libDir . 'net/authorize/api/controller/ValidateCustomerPaymentProfileController.php'
296301

297302
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,261 @@
1+
<?php
2+
3+
namespace net\authorize\api\contract\v1;
4+
5+
/**
6+
* Class representing OtherTaxType
7+
*
8+
*
9+
* XSD Type: otherTaxType
10+
*/
11+
class OtherTaxType implements \JsonSerializable
12+
{
13+
14+
/**
15+
* @property float $nationalTaxAmount
16+
*/
17+
private $nationalTaxAmount = null;
18+
19+
/**
20+
* @property float $localTaxAmount
21+
*/
22+
private $localTaxAmount = null;
23+
24+
/**
25+
* @property float $alternateTaxAmount
26+
*/
27+
private $alternateTaxAmount = null;
28+
29+
/**
30+
* @property string $alternateTaxId
31+
*/
32+
private $alternateTaxId = null;
33+
34+
/**
35+
* @property float $vatTaxRate
36+
*/
37+
private $vatTaxRate = null;
38+
39+
/**
40+
* @property float $vatTaxAmount
41+
*/
42+
private $vatTaxAmount = null;
43+
44+
/**
45+
* Gets as nationalTaxAmount
46+
*
47+
* @return float
48+
*/
49+
public function getNationalTaxAmount()
50+
{
51+
return $this->nationalTaxAmount;
52+
}
53+
54+
/**
55+
* Sets a new nationalTaxAmount
56+
*
57+
* @param float $nationalTaxAmount
58+
* @return self
59+
*/
60+
public function setNationalTaxAmount($nationalTaxAmount)
61+
{
62+
$this->nationalTaxAmount = $nationalTaxAmount;
63+
return $this;
64+
}
65+
66+
/**
67+
* Gets as localTaxAmount
68+
*
69+
* @return float
70+
*/
71+
public function getLocalTaxAmount()
72+
{
73+
return $this->localTaxAmount;
74+
}
75+
76+
/**
77+
* Sets a new localTaxAmount
78+
*
79+
* @param float $localTaxAmount
80+
* @return self
81+
*/
82+
public function setLocalTaxAmount($localTaxAmount)
83+
{
84+
$this->localTaxAmount = $localTaxAmount;
85+
return $this;
86+
}
87+
88+
/**
89+
* Gets as alternateTaxAmount
90+
*
91+
* @return float
92+
*/
93+
public function getAlternateTaxAmount()
94+
{
95+
return $this->alternateTaxAmount;
96+
}
97+
98+
/**
99+
* Sets a new alternateTaxAmount
100+
*
101+
* @param float $alternateTaxAmount
102+
* @return self
103+
*/
104+
public function setAlternateTaxAmount($alternateTaxAmount)
105+
{
106+
$this->alternateTaxAmount = $alternateTaxAmount;
107+
return $this;
108+
}
109+
110+
/**
111+
* Gets as alternateTaxId
112+
*
113+
* @return string
114+
*/
115+
public function getAlternateTaxId()
116+
{
117+
return $this->alternateTaxId;
118+
}
119+
120+
/**
121+
* Sets a new alternateTaxId
122+
*
123+
* @param string $alternateTaxId
124+
* @return self
125+
*/
126+
public function setAlternateTaxId($alternateTaxId)
127+
{
128+
$this->alternateTaxId = $alternateTaxId;
129+
return $this;
130+
}
131+
132+
/**
133+
* Gets as vatTaxRate
134+
*
135+
* @return float
136+
*/
137+
public function getVatTaxRate()
138+
{
139+
return $this->vatTaxRate;
140+
}
141+
142+
/**
143+
* Sets a new vatTaxRate
144+
*
145+
* @param float $vatTaxRate
146+
* @return self
147+
*/
148+
public function setVatTaxRate($vatTaxRate)
149+
{
150+
$this->vatTaxRate = $vatTaxRate;
151+
return $this;
152+
}
153+
154+
/**
155+
* Gets as vatTaxAmount
156+
*
157+
* @return float
158+
*/
159+
public function getVatTaxAmount()
160+
{
161+
return $this->vatTaxAmount;
162+
}
163+
164+
/**
165+
* Sets a new vatTaxAmount
166+
*
167+
* @param float $vatTaxAmount
168+
* @return self
169+
*/
170+
public function setVatTaxAmount($vatTaxAmount)
171+
{
172+
$this->vatTaxAmount = $vatTaxAmount;
173+
return $this;
174+
}
175+
176+
177+
// Json Serialize Code
178+
public function jsonSerialize(){
179+
$values = array_filter((array)get_object_vars($this),
180+
function ($val){
181+
return !is_null($val);
182+
});
183+
$mapper = \net\authorize\util\Mapper::Instance();
184+
foreach($values as $key => $value){
185+
$classDetails = $mapper->getClass(get_class() , $key);
186+
if (isset($value)){
187+
if ($classDetails->className === 'Date'){
188+
$dateTime = $value->format('Y-m-d');
189+
$values[$key] = $dateTime;
190+
}
191+
else if ($classDetails->className === 'DateTime'){
192+
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
193+
$values[$key] = $dateTime;
194+
}
195+
if (is_array($value)){
196+
if (!$classDetails->isInlineArray){
197+
$subKey = $classDetails->arrayEntryname;
198+
$subArray = [$subKey => $value];
199+
$values[$key] = $subArray;
200+
}
201+
}
202+
}
203+
}
204+
if (get_parent_class() == ""){
205+
return $values;
206+
}
207+
else{
208+
return array_merge(parent::jsonSerialize(), $values);
209+
}
210+
}
211+
212+
// Json Set Code
213+
public function set($data)
214+
{
215+
if(is_array($data) || is_object($data)) {
216+
$mapper = \net\authorize\util\Mapper::Instance();
217+
foreach($data AS $key => $value) {
218+
$classDetails = $mapper->getClass(get_class() , $key);
219+
220+
if($classDetails !== NULL ) {
221+
if ($classDetails->isArray) {
222+
if ($classDetails->isCustomDefined) {
223+
foreach($value AS $keyChild => $valueChild) {
224+
$type = new $classDetails->className;
225+
$type->set($valueChild);
226+
$this->{'addTo' . $key}($type);
227+
}
228+
}
229+
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
230+
foreach($value AS $keyChild => $valueChild) {
231+
$type = new \DateTime($valueChild);
232+
$this->{'addTo' . $key}($type);
233+
}
234+
}
235+
else {
236+
foreach($value AS $keyChild => $valueChild) {
237+
$this->{'addTo' . $key}($valueChild);
238+
}
239+
}
240+
}
241+
else {
242+
if ($classDetails->isCustomDefined){
243+
$type = new $classDetails->className;
244+
$type->set($value);
245+
$this->{'set' . $key}($type);
246+
}
247+
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
248+
$type = new \DateTime($value);
249+
$this->{'set' . $key}($type);
250+
}
251+
else {
252+
$this->{'set' . $key}($value);
253+
}
254+
}
255+
}
256+
}
257+
}
258+
}
259+
260+
}
261+

0 commit comments

Comments
 (0)