Skip to content

Commit

Permalink
updated to include MethodRefresh
Browse files Browse the repository at this point in the history
  • Loading branch information
infurio committed May 17, 2021
1 parent b62a91b commit 78d7a0e
Show file tree
Hide file tree
Showing 11 changed files with 362 additions and 2 deletions.
13 changes: 13 additions & 0 deletions generated/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,19 @@ public function methodUpdate(string $token, \ChargeHive\Php\Sdk\Generated\Model\
{
return $this->executePsr7Endpoint(new \ChargeHive\Php\Sdk\Generated\Endpoint\MethodUpdate($token, $body), $fetch);
}
/**
*
*
* @param string $token
* @param \ChargeHive\Php\Sdk\Generated\Model\ChargehiveMethodRefreshRequest $body
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
*
* @return null|\ChargeHive\Php\Sdk\Generated\Model\ChargehiveMethodRefreshResponse|\ChargeHive\Php\Sdk\Generated\Model\RuntimeError|\Psr\Http\Message\ResponseInterface
*/
public function methodRefresh(string $token, \ChargeHive\Php\Sdk\Generated\Model\ChargehiveMethodRefreshRequest $body, string $fetch = self::FETCH_OBJECT)
{
return $this->executePsr7Endpoint(new \ChargeHive\Php\Sdk\Generated\Endpoint\MethodRefresh($token, $body), $fetch);
}
/**
*
*
Expand Down
49 changes: 49 additions & 0 deletions generated/Endpoint/MethodRefresh.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php

namespace ChargeHive\Php\Sdk\Generated\Endpoint;

class MethodRefresh extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint
{
protected $token;
/**
*
*
* @param string $token
* @param \ChargeHive\Php\Sdk\Generated\Model\ChargehiveMethodRefreshRequest $body
*/
public function __construct(string $token, \ChargeHive\Php\Sdk\Generated\Model\ChargehiveMethodRefreshRequest $body)
{
$this->token = $token;
$this->body = $body;
}
use \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait;
public function getMethod() : string
{
return 'PUT';
}
public function getUri() : string
{
return str_replace(array('{token}'), array($this->token), '/v1/method/{token}/refresh');
}
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null) : array
{
return $this->getSerializedBody($serializer);
}
public function getExtraHeaders() : array
{
return array('Accept' => array('application/json'));
}
/**
* {@inheritdoc}
*
*
* @return null|\ChargeHive\Php\Sdk\Generated\Model\ChargehiveMethodRefreshResponse|\ChargeHive\Php\Sdk\Generated\Model\RuntimeError
*/
protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
{
if (200 === $status) {
return $serializer->deserialize($body, 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChargehiveMethodRefreshResponse', 'json');
}
return $serializer->deserialize($body, 'ChargeHive\\Php\\Sdk\\Generated\\Model\\RuntimeError', 'json');
}
}
29 changes: 28 additions & 1 deletion generated/Model/ChargehiveConfigurationListRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ class ChargehiveConfigurationListRequest implements \JsonSerializable
* @var string
*/
protected $kind;
/**
*
*
* @var string
*/
protected $chargeId;
/**
*
*
Expand All @@ -31,8 +37,29 @@ public function setKind(string $kind)
$this->kind = $kind;
return $this;
}
/**
*
*
* @return string
*/
public function getChargeId()
{
return $this->chargeId;
}
/**
*
*
* @param string $chargeId
*
* @return self
*/
public function setChargeId(string $chargeId)
{
$this->chargeId = $chargeId;
return $this;
}
public function jsonSerialize()
{
return ['kind' => $this->kind];
return ['kind' => $this->kind, 'chargeId' => $this->chargeId];
}
}
65 changes: 65 additions & 0 deletions generated/Model/ChargehiveMethodRefreshRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php

namespace ChargeHive\Php\Sdk\Generated\Model;

class ChargehiveMethodRefreshRequest implements \JsonSerializable
{
/**
*
*
* @var string
*/
protected $token;
/**
*
*
* @var string
*/
protected $connectorId;
/**
*
*
* @return string
*/
public function getToken()
{
return $this->token;
}
/**
*
*
* @param string $token
*
* @return self
*/
public function setToken(string $token)
{
$this->token = $token;
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 ['token' => $this->token, 'connectorId' => $this->connectorId];
}
}
65 changes: 65 additions & 0 deletions generated/Model/ChargehiveMethodRefreshResponse.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php

namespace ChargeHive\Php\Sdk\Generated\Model;

class ChargehiveMethodRefreshResponse implements \JsonSerializable
{
/**
*
*
* @var bool
*/
protected $success;
/**
*
*
* @var string
*/
protected $errMessage;
/**
*
*
* @return bool
*/
public function getSuccess()
{
return $this->success;
}
/**
*
*
* @param bool $success
*
* @return self
*/
public function setSuccess(bool $success)
{
$this->success = $success;
return $this;
}
/**
*
*
* @return string
*/
public function getErrMessage()
{
return $this->errMessage;
}
/**
*
*
* @param string $errMessage
*
* @return self
*/
public function setErrMessage(string $errMessage)
{
$this->errMessage = $errMessage;
return $this;
}
public function jsonSerialize()
{
return ['success' => $this->success, 'errMessage' => $this->errMessage];
}
}
29 changes: 28 additions & 1 deletion generated/Model/ChtypeTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ class ChtypeTransaction implements \JsonSerializable
* @var string
*/
protected $paymentInputType = 'INPUT_TYPE_INVALID';
/**
*
*
* @var string
*/
protected $authCode;
/**
*
*
Expand Down Expand Up @@ -760,8 +766,29 @@ public function setPaymentInputType(string $paymentInputType)
$this->paymentInputType = $paymentInputType;
return $this;
}
/**
*
*
* @return string
*/
public function getAuthCode()
{
return $this->authCode;
}
/**
*
*
* @param string $authCode
*
* @return self
*/
public function setAuthCode(string $authCode)
{
$this->authCode = $authCode;
return $this;
}
public function jsonSerialize()
{
return ['tokenId' => $this->tokenId, 'transactionId' => $this->transactionId, 'details' => $this->details, 'paymentType' => $this->paymentType, 'paymentScheme' => $this->paymentScheme, 'transactionType' => $this->transactionType, 'requestAmount' => $this->requestAmount, 'transactedAmount' => $this->transactedAmount, 'contract' => $this->contract, 'statementDescriptor' => $this->statementDescriptor, 'result' => $this->result, 'verifyRequest' => $this->verifyRequest, 'failureType' => $this->failureType, 'arn' => $this->arn, 'verified' => $this->verified, 'liability' => $this->liability, 'attemptDetail' => $this->attemptDetail, 'fraudResults' => $this->fraudResults, 'response' => $this->response, 'sourceTransactionId' => $this->sourceTransactionId, 'paymentMethodId' => $this->paymentMethodId, 'transactionSubType' => $this->transactionSubType, 'ancillaryTransactions' => $this->ancillaryTransactions, 'requestedConnectorId' => $this->requestedConnectorId, 'requestedConnectorLibrary' => $this->requestedConnectorLibrary, 'transactionTime' => $this->transactionTime, 'paymentProvider' => $this->paymentProvider, 'paymentInputType' => $this->paymentInputType];
return ['tokenId' => $this->tokenId, 'transactionId' => $this->transactionId, 'details' => $this->details, 'paymentType' => $this->paymentType, 'paymentScheme' => $this->paymentScheme, 'transactionType' => $this->transactionType, 'requestAmount' => $this->requestAmount, 'transactedAmount' => $this->transactedAmount, 'contract' => $this->contract, 'statementDescriptor' => $this->statementDescriptor, 'result' => $this->result, 'verifyRequest' => $this->verifyRequest, 'failureType' => $this->failureType, 'arn' => $this->arn, 'verified' => $this->verified, 'liability' => $this->liability, 'attemptDetail' => $this->attemptDetail, 'fraudResults' => $this->fraudResults, 'response' => $this->response, 'sourceTransactionId' => $this->sourceTransactionId, 'paymentMethodId' => $this->paymentMethodId, 'transactionSubType' => $this->transactionSubType, 'ancillaryTransactions' => $this->ancillaryTransactions, 'requestedConnectorId' => $this->requestedConnectorId, 'requestedConnectorLibrary' => $this->requestedConnectorLibrary, 'transactionTime' => $this->transactionTime, 'paymentProvider' => $this->paymentProvider, 'paymentInputType' => $this->paymentInputType, 'authCode' => $this->authCode];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public function denormalize($data, $class, $format = null, array $context = arra
if (property_exists($data, 'kind')) {
$object->setKind($data->{'kind'});
}
if (property_exists($data, 'charge_id')) {
$object->setChargeId($data->{'charge_id'});
}
return $object;
}
public function normalize($object, $format = null, array $context = array())
Expand All @@ -39,6 +42,9 @@ public function normalize($object, $format = null, array $context = array())
if (null !== $object->getKind()) {
$data->{'kind'} = $object->getKind();
}
if (null !== $object->getChargeId()) {
$data->{'charge_id'} = $object->getChargeId();
}
return $data;
}
}
50 changes: 50 additions & 0 deletions generated/Normalizer/ChargehiveMethodRefreshRequestNormalizer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?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 ChargehiveMethodRefreshRequestNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface
{
use DenormalizerAwareTrait;
use NormalizerAwareTrait;
public function supportsDenormalization($data, $type, $format = null)
{
return $type === 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChargehiveMethodRefreshRequest';
}
public function supportsNormalization($data, $format = null)
{
return get_class($data) === 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChargehiveMethodRefreshRequest';
}
public function denormalize($data, $class, $format = null, array $context = array())
{
if (!is_object($data)) {
throw new InvalidArgumentException();
}
$object = new \ChargeHive\Php\Sdk\Generated\Model\ChargehiveMethodRefreshRequest();
if (property_exists($data, 'token')) {
$object->setToken($data->{'token'});
}
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->getToken()) {
$data->{'token'} = $object->getToken();
}
if (null !== $object->getConnectorId()) {
$data->{'connector_id'} = $object->getConnectorId();
}
return $data;
}
}
Loading

0 comments on commit 78d7a0e

Please sign in to comment.