Skip to content

Commit

Permalink
add InitialTransactionData
Browse files Browse the repository at this point in the history
  • Loading branch information
TomK committed Jul 27, 2022
1 parent a928085 commit 1f25fb6
Show file tree
Hide file tree
Showing 5 changed files with 191 additions and 1 deletion.
29 changes: 28 additions & 1 deletion generated/Model/ChargehiveChargeCreateRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ class ChargehiveChargeCreateRequest implements \JsonSerializable
* @var ChargehivechtypeLabel[]
*/
protected $labels;
/**
*
*
* @var ChtypeInitialTransactionData[]
*/
protected $initialTransactions;
/**
*
*
Expand Down Expand Up @@ -220,8 +226,29 @@ public function setLabels(array $labels)
$this->labels = $labels;
return $this;
}
/**
*
*
* @return ChtypeInitialTransactionData[]
*/
public function getInitialTransactions()
{
return $this->initialTransactions;
}
/**
*
*
* @param ChtypeInitialTransactionData[] $initialTransactions
*
* @return self
*/
public function setInitialTransactions(array $initialTransactions)
{
$this->initialTransactions = $initialTransactions;
return $this;
}
public function jsonSerialize()
{
return ['merchantReference' => $this->merchantReference, 'amount' => $this->amount, 'paymentMethodIds' => $this->paymentMethodIds, 'expiryTime' => $this->expiryTime, 'contractType' => $this->contractType, 'environment' => $this->environment, 'chargeMeta' => $this->chargeMeta, 'labels' => $this->labels];
return ['merchantReference' => $this->merchantReference, 'amount' => $this->amount, 'paymentMethodIds' => $this->paymentMethodIds, 'expiryTime' => $this->expiryTime, 'contractType' => $this->contractType, 'environment' => $this->environment, 'chargeMeta' => $this->chargeMeta, 'labels' => $this->labels, 'initialTransactions' => $this->initialTransactions];
}
}
92 changes: 92 additions & 0 deletions generated/Model/ChtypeInitialTransactionData.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?php

namespace ChargeHive\Php\Sdk\Generated\Model;

class ChtypeInitialTransactionData implements \JsonSerializable
{
/**
*
*
* @var string
*/
protected $chargeId;
/**
*
*
* @var string
*/
protected $transactionId;
/**
*
*
* @var string
*/
protected $connectorId;
/**
*
*
* @return string
*/
public function getChargeId()
{
return $this->chargeId;
}
/**
*
*
* @param string $chargeId
*
* @return self
*/
public function setChargeId(string $chargeId)
{
$this->chargeId = $chargeId;
return $this;
}
/**
*
*
* @return string
*/
public function getTransactionId()
{
return $this->transactionId;
}
/**
*
*
* @param string $transactionId
*
* @return self
*/
public function setTransactionId(string $transactionId)
{
$this->transactionId = $transactionId;
return $this;
}
/**
*
*
* @return string
*/
public function getConnectorId()
{
return $this->connectorId;
}
/**
*
*
* @param string $connectorId
*
* @return self
*/
public function setConnectorId(string $connectorId)
{
$this->connectorId = $connectorId;
return $this;
}
public function jsonSerialize()
{
return ['chargeId' => $this->chargeId, 'transactionId' => $this->transactionId, 'connectorId' => $this->connectorId];
}
}
14 changes: 14 additions & 0 deletions generated/Normalizer/ChargehiveChargeCreateRequestNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ public function denormalize($data, $class, $format = null, array $context = arra
}
$object->setLabels($values_1);
}
if (property_exists($data, 'initial_transactions')) {
$values_2 = array();
foreach ($data->{'initial_transactions'} as $value_2) {
$values_2[] = $this->denormalizer->denormalize($value_2, 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChtypeInitialTransactionData', 'json', $context);
}
$object->setInitialTransactions($values_2);
}
return $object;
}
public function normalize($object, $format = null, array $context = array())
Expand Down Expand Up @@ -97,6 +104,13 @@ public function normalize($object, $format = null, array $context = array())
}
$data->{'labels'} = $values_1;
}
if (null !== $object->getInitialTransactions()) {
$values_2 = array();
foreach ($object->getInitialTransactions() as $value_2) {
$values_2[] = $this->normalizer->normalize($value_2, 'json', $context);
}
$data->{'initial_transactions'} = $values_2;
}
return $data;
}
}
56 changes: 56 additions & 0 deletions generated/Normalizer/ChtypeInitialTransactionDataNormalizer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php

namespace ChargeHive\Php\Sdk\Generated\Normalizer;

use Jane\JsonSchemaRuntime\Reference;
use Symfony\Component\Serializer\Exception\InvalidArgumentException;
use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface;
use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
class ChtypeInitialTransactionDataNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface
{
use DenormalizerAwareTrait;
use NormalizerAwareTrait;
public function supportsDenormalization($data, $type, $format = null)
{
return $type === 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChtypeInitialTransactionData';
}
public function supportsNormalization($data, $format = null)
{
return get_class($data) === 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChtypeInitialTransactionData';
}
public function denormalize($data, $class, $format = null, array $context = array())
{
if (!is_object($data)) {
throw new InvalidArgumentException();
}
$object = new \ChargeHive\Php\Sdk\Generated\Model\ChtypeInitialTransactionData();
if (property_exists($data, 'charge_id')) {
$object->setChargeId($data->{'charge_id'});
}
if (property_exists($data, 'transaction_id')) {
$object->setTransactionId($data->{'transaction_id'});
}
if (property_exists($data, 'connector_id')) {
$object->setConnectorId($data->{'connector_id'});
}
return $object;
}
public function normalize($object, $format = null, array $context = array())
{
$data = new \stdClass();
if (null !== $object->getChargeId()) {
$data->{'charge_id'} = $object->getChargeId();
}
if (null !== $object->getTransactionId()) {
$data->{'transaction_id'} = $object->getTransactionId();
}
if (null !== $object->getConnectorId()) {
$data->{'connector_id'} = $object->getConnectorId();
}
return $data;
}
}
1 change: 1 addition & 0 deletions generated/Normalizer/NormalizerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public static function create()
$normalizers[] = new ChtypeFraudFactorNormalizer();
$normalizers[] = new ChtypeFraudResultNormalizer();
$normalizers[] = new ChtypeFraudScoreNormalizer();
$normalizers[] = new ChtypeInitialTransactionDataNormalizer();
$normalizers[] = new ChtypePaymentMethodNormalizer();
$normalizers[] = new ChtypePaymentMethodInfoNormalizer();
$normalizers[] = new ChtypePaymentMethodSchemaCardNormalizer();
Expand Down

0 comments on commit 1f25fb6

Please sign in to comment.