Skip to content

Commit 1f25fb6

Browse files
committed
add InitialTransactionData
1 parent a928085 commit 1f25fb6

File tree

5 files changed

+191
-1
lines changed

5 files changed

+191
-1
lines changed

generated/Model/ChargehiveChargeCreateRequest.php

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ class ChargehiveChargeCreateRequest implements \JsonSerializable
5252
* @var ChargehivechtypeLabel[]
5353
*/
5454
protected $labels;
55+
/**
56+
*
57+
*
58+
* @var ChtypeInitialTransactionData[]
59+
*/
60+
protected $initialTransactions;
5561
/**
5662
*
5763
*
@@ -220,8 +226,29 @@ public function setLabels(array $labels)
220226
$this->labels = $labels;
221227
return $this;
222228
}
229+
/**
230+
*
231+
*
232+
* @return ChtypeInitialTransactionData[]
233+
*/
234+
public function getInitialTransactions()
235+
{
236+
return $this->initialTransactions;
237+
}
238+
/**
239+
*
240+
*
241+
* @param ChtypeInitialTransactionData[] $initialTransactions
242+
*
243+
* @return self
244+
*/
245+
public function setInitialTransactions(array $initialTransactions)
246+
{
247+
$this->initialTransactions = $initialTransactions;
248+
return $this;
249+
}
223250
public function jsonSerialize()
224251
{
225-
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];
252+
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];
226253
}
227254
}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<?php
2+
3+
namespace ChargeHive\Php\Sdk\Generated\Model;
4+
5+
class ChtypeInitialTransactionData implements \JsonSerializable
6+
{
7+
/**
8+
*
9+
*
10+
* @var string
11+
*/
12+
protected $chargeId;
13+
/**
14+
*
15+
*
16+
* @var string
17+
*/
18+
protected $transactionId;
19+
/**
20+
*
21+
*
22+
* @var string
23+
*/
24+
protected $connectorId;
25+
/**
26+
*
27+
*
28+
* @return string
29+
*/
30+
public function getChargeId()
31+
{
32+
return $this->chargeId;
33+
}
34+
/**
35+
*
36+
*
37+
* @param string $chargeId
38+
*
39+
* @return self
40+
*/
41+
public function setChargeId(string $chargeId)
42+
{
43+
$this->chargeId = $chargeId;
44+
return $this;
45+
}
46+
/**
47+
*
48+
*
49+
* @return string
50+
*/
51+
public function getTransactionId()
52+
{
53+
return $this->transactionId;
54+
}
55+
/**
56+
*
57+
*
58+
* @param string $transactionId
59+
*
60+
* @return self
61+
*/
62+
public function setTransactionId(string $transactionId)
63+
{
64+
$this->transactionId = $transactionId;
65+
return $this;
66+
}
67+
/**
68+
*
69+
*
70+
* @return string
71+
*/
72+
public function getConnectorId()
73+
{
74+
return $this->connectorId;
75+
}
76+
/**
77+
*
78+
*
79+
* @param string $connectorId
80+
*
81+
* @return self
82+
*/
83+
public function setConnectorId(string $connectorId)
84+
{
85+
$this->connectorId = $connectorId;
86+
return $this;
87+
}
88+
public function jsonSerialize()
89+
{
90+
return ['chargeId' => $this->chargeId, 'transactionId' => $this->transactionId, 'connectorId' => $this->connectorId];
91+
}
92+
}

generated/Normalizer/ChargehiveChargeCreateRequestNormalizer.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ public function denormalize($data, $class, $format = null, array $context = arra
6060
}
6161
$object->setLabels($values_1);
6262
}
63+
if (property_exists($data, 'initial_transactions')) {
64+
$values_2 = array();
65+
foreach ($data->{'initial_transactions'} as $value_2) {
66+
$values_2[] = $this->denormalizer->denormalize($value_2, 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChtypeInitialTransactionData', 'json', $context);
67+
}
68+
$object->setInitialTransactions($values_2);
69+
}
6370
return $object;
6471
}
6572
public function normalize($object, $format = null, array $context = array())
@@ -97,6 +104,13 @@ public function normalize($object, $format = null, array $context = array())
97104
}
98105
$data->{'labels'} = $values_1;
99106
}
107+
if (null !== $object->getInitialTransactions()) {
108+
$values_2 = array();
109+
foreach ($object->getInitialTransactions() as $value_2) {
110+
$values_2[] = $this->normalizer->normalize($value_2, 'json', $context);
111+
}
112+
$data->{'initial_transactions'} = $values_2;
113+
}
100114
return $data;
101115
}
102116
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?php
2+
3+
namespace ChargeHive\Php\Sdk\Generated\Normalizer;
4+
5+
use Jane\JsonSchemaRuntime\Reference;
6+
use Symfony\Component\Serializer\Exception\InvalidArgumentException;
7+
use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface;
8+
use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait;
9+
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
10+
use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
11+
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;
12+
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
13+
class ChtypeInitialTransactionDataNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface
14+
{
15+
use DenormalizerAwareTrait;
16+
use NormalizerAwareTrait;
17+
public function supportsDenormalization($data, $type, $format = null)
18+
{
19+
return $type === 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChtypeInitialTransactionData';
20+
}
21+
public function supportsNormalization($data, $format = null)
22+
{
23+
return get_class($data) === 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChtypeInitialTransactionData';
24+
}
25+
public function denormalize($data, $class, $format = null, array $context = array())
26+
{
27+
if (!is_object($data)) {
28+
throw new InvalidArgumentException();
29+
}
30+
$object = new \ChargeHive\Php\Sdk\Generated\Model\ChtypeInitialTransactionData();
31+
if (property_exists($data, 'charge_id')) {
32+
$object->setChargeId($data->{'charge_id'});
33+
}
34+
if (property_exists($data, 'transaction_id')) {
35+
$object->setTransactionId($data->{'transaction_id'});
36+
}
37+
if (property_exists($data, 'connector_id')) {
38+
$object->setConnectorId($data->{'connector_id'});
39+
}
40+
return $object;
41+
}
42+
public function normalize($object, $format = null, array $context = array())
43+
{
44+
$data = new \stdClass();
45+
if (null !== $object->getChargeId()) {
46+
$data->{'charge_id'} = $object->getChargeId();
47+
}
48+
if (null !== $object->getTransactionId()) {
49+
$data->{'transaction_id'} = $object->getTransactionId();
50+
}
51+
if (null !== $object->getConnectorId()) {
52+
$data->{'connector_id'} = $object->getConnectorId();
53+
}
54+
return $data;
55+
}
56+
}

generated/Normalizer/NormalizerFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public static function create()
7474
$normalizers[] = new ChtypeFraudFactorNormalizer();
7575
$normalizers[] = new ChtypeFraudResultNormalizer();
7676
$normalizers[] = new ChtypeFraudScoreNormalizer();
77+
$normalizers[] = new ChtypeInitialTransactionDataNormalizer();
7778
$normalizers[] = new ChtypePaymentMethodNormalizer();
7879
$normalizers[] = new ChtypePaymentMethodInfoNormalizer();
7980
$normalizers[] = new ChtypePaymentMethodSchemaCardNormalizer();

0 commit comments

Comments
 (0)