From 78d7a0ec1ed47eeae33f0704286445b36c230ca1 Mon Sep 17 00:00:00 2001 From: Steve Barrow Date: Mon, 17 May 2021 14:09:29 +0100 Subject: [PATCH] updated to include MethodRefresh --- generated/Client.php | 13 ++++ generated/Endpoint/MethodRefresh.php | 49 ++++++++++++++ .../ChargehiveConfigurationListRequest.php | 29 ++++++++- .../Model/ChargehiveMethodRefreshRequest.php | 65 +++++++++++++++++++ .../Model/ChargehiveMethodRefreshResponse.php | 65 +++++++++++++++++++ generated/Model/ChtypeTransaction.php | 29 ++++++++- ...hiveConfigurationListRequestNormalizer.php | 6 ++ ...argehiveMethodRefreshRequestNormalizer.php | 50 ++++++++++++++ ...rgehiveMethodRefreshResponseNormalizer.php | 50 ++++++++++++++ .../ChtypeTransactionNormalizer.php | 6 ++ generated/Normalizer/NormalizerFactory.php | 2 + 11 files changed, 362 insertions(+), 2 deletions(-) create mode 100644 generated/Endpoint/MethodRefresh.php create mode 100644 generated/Model/ChargehiveMethodRefreshRequest.php create mode 100644 generated/Model/ChargehiveMethodRefreshResponse.php create mode 100644 generated/Normalizer/ChargehiveMethodRefreshRequestNormalizer.php create mode 100644 generated/Normalizer/ChargehiveMethodRefreshResponseNormalizer.php diff --git a/generated/Client.php b/generated/Client.php index 26999fc..056ac7e 100644 --- a/generated/Client.php +++ b/generated/Client.php @@ -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); + } /** * * diff --git a/generated/Endpoint/MethodRefresh.php b/generated/Endpoint/MethodRefresh.php new file mode 100644 index 0000000..1015b55 --- /dev/null +++ b/generated/Endpoint/MethodRefresh.php @@ -0,0 +1,49 @@ +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'); + } +} \ No newline at end of file diff --git a/generated/Model/ChargehiveConfigurationListRequest.php b/generated/Model/ChargehiveConfigurationListRequest.php index b5c0f47..b7285d5 100644 --- a/generated/Model/ChargehiveConfigurationListRequest.php +++ b/generated/Model/ChargehiveConfigurationListRequest.php @@ -10,6 +10,12 @@ class ChargehiveConfigurationListRequest implements \JsonSerializable * @var string */ protected $kind; + /** + * + * + * @var string + */ + protected $chargeId; /** * * @@ -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]; } } \ No newline at end of file diff --git a/generated/Model/ChargehiveMethodRefreshRequest.php b/generated/Model/ChargehiveMethodRefreshRequest.php new file mode 100644 index 0000000..f4b17fa --- /dev/null +++ b/generated/Model/ChargehiveMethodRefreshRequest.php @@ -0,0 +1,65 @@ +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]; + } +} \ No newline at end of file diff --git a/generated/Model/ChargehiveMethodRefreshResponse.php b/generated/Model/ChargehiveMethodRefreshResponse.php new file mode 100644 index 0000000..8ed9d67 --- /dev/null +++ b/generated/Model/ChargehiveMethodRefreshResponse.php @@ -0,0 +1,65 @@ +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]; + } +} \ No newline at end of file diff --git a/generated/Model/ChtypeTransaction.php b/generated/Model/ChtypeTransaction.php index c1dc0fb..2807eb4 100644 --- a/generated/Model/ChtypeTransaction.php +++ b/generated/Model/ChtypeTransaction.php @@ -172,6 +172,12 @@ class ChtypeTransaction implements \JsonSerializable * @var string */ protected $paymentInputType = 'INPUT_TYPE_INVALID'; + /** + * + * + * @var string + */ + protected $authCode; /** * * @@ -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]; } } \ No newline at end of file diff --git a/generated/Normalizer/ChargehiveConfigurationListRequestNormalizer.php b/generated/Normalizer/ChargehiveConfigurationListRequestNormalizer.php index e937de1..3b81ab6 100644 --- a/generated/Normalizer/ChargehiveConfigurationListRequestNormalizer.php +++ b/generated/Normalizer/ChargehiveConfigurationListRequestNormalizer.php @@ -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()) @@ -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; } } \ No newline at end of file diff --git a/generated/Normalizer/ChargehiveMethodRefreshRequestNormalizer.php b/generated/Normalizer/ChargehiveMethodRefreshRequestNormalizer.php new file mode 100644 index 0000000..5f7b1ef --- /dev/null +++ b/generated/Normalizer/ChargehiveMethodRefreshRequestNormalizer.php @@ -0,0 +1,50 @@ +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; + } +} \ No newline at end of file diff --git a/generated/Normalizer/ChargehiveMethodRefreshResponseNormalizer.php b/generated/Normalizer/ChargehiveMethodRefreshResponseNormalizer.php new file mode 100644 index 0000000..c4f3d48 --- /dev/null +++ b/generated/Normalizer/ChargehiveMethodRefreshResponseNormalizer.php @@ -0,0 +1,50 @@ +setSuccess($data->{'success'}); + } + if (property_exists($data, 'err_message')) { + $object->setErrMessage($data->{'err_message'}); + } + return $object; + } + public function normalize($object, $format = null, array $context = array()) + { + $data = new \stdClass(); + if (null !== $object->getSuccess()) { + $data->{'success'} = $object->getSuccess(); + } + if (null !== $object->getErrMessage()) { + $data->{'err_message'} = $object->getErrMessage(); + } + return $data; + } +} \ No newline at end of file diff --git a/generated/Normalizer/ChtypeTransactionNormalizer.php b/generated/Normalizer/ChtypeTransactionNormalizer.php index bc5d482..80f52e0 100644 --- a/generated/Normalizer/ChtypeTransactionNormalizer.php +++ b/generated/Normalizer/ChtypeTransactionNormalizer.php @@ -124,6 +124,9 @@ public function denormalize($data, $class, $format = null, array $context = arra if (property_exists($data, 'payment_input_type')) { $object->setPaymentInputType($data->{'payment_input_type'}); } + if (property_exists($data, 'auth_code')) { + $object->setAuthCode($data->{'auth_code'}); + } return $object; } public function normalize($object, $format = null, array $context = array()) @@ -225,6 +228,9 @@ public function normalize($object, $format = null, array $context = array()) if (null !== $object->getPaymentInputType()) { $data->{'payment_input_type'} = $object->getPaymentInputType(); } + if (null !== $object->getAuthCode()) { + $data->{'auth_code'} = $object->getAuthCode(); + } return $data; } } \ No newline at end of file diff --git a/generated/Normalizer/NormalizerFactory.php b/generated/Normalizer/NormalizerFactory.php index afc19a2..445a8ed 100644 --- a/generated/Normalizer/NormalizerFactory.php +++ b/generated/Normalizer/NormalizerFactory.php @@ -38,6 +38,8 @@ public static function create() $normalizers[] = new ChargehiveConnectionConfirmRequestNormalizer(); $normalizers[] = new ChargehiveConnectionValidateRequestNormalizer(); $normalizers[] = new ChargehiveConnectionValidateResponseNormalizer(); + $normalizers[] = new ChargehiveMethodRefreshRequestNormalizer(); + $normalizers[] = new ChargehiveMethodRefreshResponseNormalizer(); $normalizers[] = new ChargehiveMethodTokenizeRequestNormalizer(); $normalizers[] = new ChargehiveMethodTokenizeResponseNormalizer(); $normalizers[] = new ChargehiveMethodUnlockRequestNormalizer();