Skip to content

Commit

Permalink
Merge pull request #359 from AuthorizeNet/nodependency-rc
Browse files Browse the repository at this point in the history
Minimal dependency SDK - 2.0.0
  • Loading branch information
kikmak42 authored Jan 14, 2019
2 parents 9ebe333 + d6d062d commit 7fa78e6
Show file tree
Hide file tree
Showing 15 changed files with 845 additions and 54 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ echo "Connection uses " . $json->tls_version ."\n";
### Composer
We recommend using [`Composer`](http://getcomposer.org). *(Note: we never recommend you
override the new secure-http default setting)*.
*Update your composer.json file as per the example below and then run for this specific ALPHA release
*Update your composer.json file as per the example below and then run for this specific release
`composer update`.*

```json
{
"require": {
"php": ">=5.6",
"authorizenet/authorizenet": "2.0.0-ALPHA"
"authorizenet/authorizenet": "2.0.0"
}
}
```
Expand Down
13 changes: 9 additions & 4 deletions classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@
'net\authorize\api\contract\v1\ListOfAUDetailsType' => $libDir . 'net/authorize/api/contract/v1/ListOfAUDetailsType.php',
'net\authorize\api\contract\v1\EmvTagType' => $libDir . 'net/authorize/api/contract/v1/EmvTagType.php',
'net\authorize\api\contract\v1\PaymentEmvType' => $libDir . 'net/authorize/api/contract/v1/PaymentEmvType.php',
'net\authorize\api\contract\v1\OtherTaxType' => $libDir . 'net/authorize/api/contract/v1/OtherTaxType.php',
'net\authorize\api\contract\v1\UpdateMerchantDetailsRequest' => $libDir . 'net/authorize/api/contract/v1/UpdateMerchantDetailsRequest.php',
'net\authorize\api\contract\v1\UpdateMerchantDetailsResponse' => $libDir . 'net/authorize/api/contract/v1/UpdateMerchantDetailsResponse.php',
'net\authorize\api\contract\v1\WebCheckOutDataTypeTokenType' => $libDir . 'net/authorize/api/contract/v1/WebCheckOutDataTypeTokenType.php',

//Controllers
'net\authorize\api\controller\ARBCancelSubscriptionController' => $libDir . 'net/authorize/api/controller/ARBCancelSubscriptionController.php',
Expand All @@ -265,6 +269,8 @@
'net\authorize\api\controller\DeleteCustomerPaymentProfileController' => $libDir . 'net/authorize/api/controller/DeleteCustomerPaymentProfileController.php',
'net\authorize\api\controller\DeleteCustomerProfileController' => $libDir . 'net/authorize/api/controller/DeleteCustomerProfileController.php',
'net\authorize\api\controller\DeleteCustomerShippingAddressController' => $libDir . 'net/authorize/api/controller/DeleteCustomerShippingAddressController.php',
'net\authorize\api\controller\GetAUJobDetailsController' => $libDir . 'net/authorize/api/controller/GetAUJobDetailsController.php',
'net\authorize\api\controller\GetAUJobSummaryController' => $libDir . 'net/authorize/api/controller/GetAUJobSummaryController.php',
'net\authorize\api\controller\GetBatchStatisticsController' => $libDir . 'net/authorize/api/controller/GetBatchStatisticsController.php',
'net\authorize\api\controller\GetCustomerPaymentProfileController' => $libDir . 'net/authorize/api/controller/GetCustomerPaymentProfileController.php',
'net\authorize\api\controller\GetCustomerPaymentProfileListController' => $libDir . 'net/authorize/api/controller/GetCustomerPaymentProfileListController.php',
Expand All @@ -277,6 +283,7 @@
'net\authorize\api\controller\GetSettledBatchListController' => $libDir . 'net/authorize/api/controller/GetSettledBatchListController.php',
'net\authorize\api\controller\GetTransactionDetailsController' => $libDir . 'net/authorize/api/controller/GetTransactionDetailsController.php',
'net\authorize\api\controller\GetTransactionListController' => $libDir . 'net/authorize/api/controller/GetTransactionListController.php',
'net\authorize\api\controller\GetTransactionListForCustomerController' => $libDir . 'net/authorize/api/controller/GetTransactionListForCustomerController.php',
'net\authorize\api\controller\GetUnsettledTransactionListController' => $libDir . 'net/authorize/api/controller/GetUnsettledTransactionListController.php',
'net\authorize\api\controller\IsAliveController' => $libDir . 'net/authorize/api/controller/IsAliveController.php',
'net\authorize\api\controller\LogoutController' => $libDir . 'net/authorize/api/controller/LogoutController.php',
Expand All @@ -288,10 +295,8 @@
'net\authorize\api\controller\UpdateCustomerProfileController' => $libDir . 'net/authorize/api/controller/UpdateCustomerProfileController.php',
'net\authorize\api\controller\UpdateCustomerShippingAddressController' => $libDir . 'net/authorize/api/controller/UpdateCustomerShippingAddressController.php',
'net\authorize\api\controller\UpdateHeldTransactionController' => $libDir . 'net/authorize/api/controller/UpdateHeldTransactionController.php',
'net\authorize\api\controller\UpdateMerchantDetailsController' => $libDir . 'net/authorize/api/controller/UpdateMerchantDetailsController.php',
'net\authorize\api\controller\UpdateSplitTenderGroupController' => $libDir . 'net/authorize/api/controller/UpdateSplitTenderGroupController.php',
'net\authorize\api\controller\ValidateCustomerPaymentProfileController' => $libDir . 'net/authorize/api/controller/ValidateCustomerPaymentProfileController.php',
'net\authorize\api\controller\GetTransactionListForCustomerController' => $libDir . 'net/authorize/api/controller/GetTransactionListForCustomerController.php',
'net\authorize\api\controller\GetAUJobDetailsController' => $libDir . 'net/authorize/api/controller/GetAUJobDetailsController.php',
'net\authorize\api\controller\GetAUJobSummaryController' => $libDir . 'net/authorize/api/controller/GetAUJobSummaryController.php'
'net\authorize\api\controller\ValidateCustomerPaymentProfileController' => $libDir . 'net/authorize/api/controller/ValidateCustomerPaymentProfileController.php'

);
261 changes: 261 additions & 0 deletions lib/net/authorize/api/contract/v1/OtherTaxType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,261 @@
<?php

namespace net\authorize\api\contract\v1;

/**
* Class representing OtherTaxType
*
*
* XSD Type: otherTaxType
*/
class OtherTaxType implements \JsonSerializable
{

/**
* @property float $nationalTaxAmount
*/
private $nationalTaxAmount = null;

/**
* @property float $localTaxAmount
*/
private $localTaxAmount = null;

/**
* @property float $alternateTaxAmount
*/
private $alternateTaxAmount = null;

/**
* @property string $alternateTaxId
*/
private $alternateTaxId = null;

/**
* @property float $vatTaxRate
*/
private $vatTaxRate = null;

/**
* @property float $vatTaxAmount
*/
private $vatTaxAmount = null;

/**
* Gets as nationalTaxAmount
*
* @return float
*/
public function getNationalTaxAmount()
{
return $this->nationalTaxAmount;
}

/**
* Sets a new nationalTaxAmount
*
* @param float $nationalTaxAmount
* @return self
*/
public function setNationalTaxAmount($nationalTaxAmount)
{
$this->nationalTaxAmount = $nationalTaxAmount;
return $this;
}

/**
* Gets as localTaxAmount
*
* @return float
*/
public function getLocalTaxAmount()
{
return $this->localTaxAmount;
}

/**
* Sets a new localTaxAmount
*
* @param float $localTaxAmount
* @return self
*/
public function setLocalTaxAmount($localTaxAmount)
{
$this->localTaxAmount = $localTaxAmount;
return $this;
}

/**
* Gets as alternateTaxAmount
*
* @return float
*/
public function getAlternateTaxAmount()
{
return $this->alternateTaxAmount;
}

/**
* Sets a new alternateTaxAmount
*
* @param float $alternateTaxAmount
* @return self
*/
public function setAlternateTaxAmount($alternateTaxAmount)
{
$this->alternateTaxAmount = $alternateTaxAmount;
return $this;
}

/**
* Gets as alternateTaxId
*
* @return string
*/
public function getAlternateTaxId()
{
return $this->alternateTaxId;
}

/**
* Sets a new alternateTaxId
*
* @param string $alternateTaxId
* @return self
*/
public function setAlternateTaxId($alternateTaxId)
{
$this->alternateTaxId = $alternateTaxId;
return $this;
}

/**
* Gets as vatTaxRate
*
* @return float
*/
public function getVatTaxRate()
{
return $this->vatTaxRate;
}

/**
* Sets a new vatTaxRate
*
* @param float $vatTaxRate
* @return self
*/
public function setVatTaxRate($vatTaxRate)
{
$this->vatTaxRate = $vatTaxRate;
return $this;
}

/**
* Gets as vatTaxAmount
*
* @return float
*/
public function getVatTaxAmount()
{
return $this->vatTaxAmount;
}

/**
* Sets a new vatTaxAmount
*
* @param float $vatTaxAmount
* @return self
*/
public function setVatTaxAmount($vatTaxAmount)
{
$this->vatTaxAmount = $vatTaxAmount;
return $this;
}


// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}

// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);

if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}

}

Loading

0 comments on commit 7fa78e6

Please sign in to comment.