Skip to content

Commit

Permalink
Updated contract classes after XSD updates (Oct 2, 2018 version).
Browse files Browse the repository at this point in the history
Lines removed are shown only because if-check was added in scripts/appendsetcode.txt
  • Loading branch information
ashtru committed Dec 11, 2018
1 parent 7449c2a commit 50b1aed
Show file tree
Hide file tree
Showing 6 changed files with 1,452 additions and 252 deletions.
167 changes: 125 additions & 42 deletions lib/net/authorize/api/contract/v1/CreditCardType.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/**
* Class representing CreditCardType
*
*
*
* XSD Type: creditCardType
*/
class CreditCardType extends CreditCardSimpleType implements \JsonSerializable
Expand All @@ -26,6 +26,21 @@ class CreditCardType extends CreditCardSimpleType implements \JsonSerializable
*/
private $cryptogram = null;

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

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

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

/**
* Gets as cardCode
*
Expand Down Expand Up @@ -92,6 +107,72 @@ public function setCryptogram($cryptogram)
return $this;
}

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

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

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

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

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

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


// Json Serialize Code
public function jsonSerialize(){
Expand Down Expand Up @@ -131,47 +212,49 @@ function ($val){
// Json Set Code
public function set($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);
}
}
}
}
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);
}
}
}
}
}
}

}
Expand Down
Loading

0 comments on commit 50b1aed

Please sign in to comment.