Skip to content

Commit

Permalink
fixed path
Browse files Browse the repository at this point in the history
  • Loading branch information
emtudo committed Oct 7, 2020
1 parent b1efe68 commit 92d1861
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 26 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -9,7 +9,7 @@ Devido ao autor original do pacote não fazer merge em várias PR e nem responde
Forkei este para adicionar os métodos que são necessários para trabalhar com recorrência.

Alterar ou adicionar a linha
`"developercielo/api-3.0-php": "^2.0",` no seu composer, ela tem que ter a versão 2.0
`"developercielo/api-3.0-php": "^2.1",` no seu composer, ela tem que ter a versão 2.1

Adicione também ao composer a chave:

Expand Down Expand Up @@ -55,7 +55,7 @@ Se já possui um arquivo `composer.json`, basta adicionar a seguinte dependênci

```json
"require": {
"developercielo/api-3.0-php": "^2.0"
"developercielo/api-3.0-php": "^2.1"
}
"repositories": [
{
Expand Down
45 changes: 21 additions & 24 deletions src/Cielo/API30/Ecommerce/Request/UpdateRecurrentPaymentRequest.php
Expand Up @@ -7,54 +7,39 @@
use Cielo\API30\Merchant;
use Psr\Log\LoggerInterface;

/**
* @package Cielo\API30\Ecommerce\Request
*/
class UpdateRecurrentPaymentRequest extends AbstractRequest
{
protected $kind;
private $environment;
private $logger;
protected $kind;

/**
* UpdateRecurrentPaymentRequest constructor.
*
* @param Merchant $merchant
* @param Environment $environment
* @param LoggerInterface|null $logger
*/
* UpdateRecurrentPaymentRequest constructor.
*/
public function __construct(Merchant $merchant, Environment $environment, LoggerInterface $logger = null)
{
parent::__construct($merchant);

$this->environment = $environment;
$this->content = null;
$this->logger = $logger;
$this->logger = $logger;
}

/**
* @param $recurrentPaymentId
*
* @return null
* @throws \Cielo\API30\Ecommerce\Request\CieloRequestException
* @throws \RuntimeException
*
* @return null
*/
public function execute($recurrentPaymentId)
{
$url = $this->environment->getApiURL() . "1/RecurrentPayment/{$recurrentPaymentId}}/{$this->kind}";
$url = $this->environment->getApiURL()."1/RecurrentPayment/{$recurrentPaymentId}/{$this->kind}";

return $this->sendRequest('PUT', $url, $this->content);
}

/**
* @param $json
* @return RecurrentPayment
*/
protected function unserialize($json)
{
return RecurrentPayment::fromJson($json);
}

/**
* @return mixed
*/
Expand All @@ -65,11 +50,23 @@ public function getContent()

/**
* @param mixed $content
* @return mixed|null
*
* @return null|mixed
*/
public function setContent($content)
{
$this->content = $content;

return $this->content;
}

/**
* @param $json
*
* @return RecurrentPayment
*/
protected function unserialize($json)
{
return RecurrentPayment::fromJson($json);
}
}

0 comments on commit 92d1861

Please sign in to comment.