Skip to content

Commit

Permalink
Merge pull request #117 from gabriellucius/new-api-parameters
Browse files Browse the repository at this point in the history
Add new api parameters
  • Loading branch information
s2it-moscou authored Mar 19, 2018
2 parents f81b8b7 + 9af0efe commit 653f921
Show file tree
Hide file tree
Showing 12 changed files with 129 additions and 3 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
### 4.0.0 (25/01/2018)
### 4.2.0 (19/03/2018)

#### Funcionalidades
- **CreditorFees:** adicionados novos parâmetros da api do PagSeguro references às classes do CreditorFees
- **addParameter:** adicionada possibilidade de se usar a função addParameter ao criar checkout transparente

### 4.0.1 (13/03/2018)

#### Correções
- **dev (testes):** *downgrade* da versão mínima do PHPUnit

### 4.0.0 (31/01/2018)

#### Funcionalidades
- **pagamento recorrente (assinatura) transparente:** editar valor de cobrança de planos ja criados
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ Achou e corrigiu um bug ou tem alguma feature em mente e deseja contribuir?
* Rode um push para o branch (git push origin my-new-feature)
* Envie um Pull Request
* Obs.: Adicione exemplos para sua nova feature. Se seu Pull Request for relacionado a uma versão específica, o Pull Request não deve ser enviado para o branch master e sim para o branch correspondente a versão.
* Obs2: Não serão aceitos PR's na branch master. Utilizar a branch de desenvolvimento.

[requisições de assinaturas transparentes]: https://dev.pagseguro.uol.com.br/documentacao/pagamento-online/pagamentos/pagamento-recorrente-transparente
[requisições de assinaturas]: http://download.uol.com.br/pagseguro/docs/pagseguro-assinatura-automatica.pdf
Expand Down
65 changes: 65 additions & 0 deletions source/Domains/CreditorFees.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ class CreditorFees
* @var
*/
private $intermediationFeeAmount;
/**
* @var
*/
private $installmentFeeAmount;
/**
* @var
*/
private $operationalFeeAmount;
/**
* @var
*/
private $commissionFeeAmount;

/**
* @return mixed
Expand Down Expand Up @@ -74,4 +86,57 @@ public function setIntermediationRateAmount($intermediationRateAmount)
$this->intermediationRateAmount = $intermediationRateAmount;
return $this;
}

/**
* @return mixed
*/
public function getInstallmentFeeAmount()
{
return $this->installmentFeeAmount;
}

/**
* @param mixed $installmentFeeAmount
* @return CreditorFees
*/
public function setInstallmentFeeAmount($installmentFeeAmount)
{
$this->installmentFeeAmount = $installmentFeeAmount;
return $this;
}

/**
* @return mixed
*/
public function getOperationalFeeAmount()
{
return $this->operationalFeeAmount;
}

/**
* @param mixed $operationalFeeAmount
* @return CreditorFees
*/
public function setOperationalFeeAmount($operationalFeeAmount)
{
$this->operationalFeeAmount = $operationalFeeAmount;
return $this;
}

/**
* @return mixed
*/
public function getCommissionFeeAmount()
{
return $this->commissionFeeAmount;
}
/**
* @param mixed $commissionFeeAmount
* @return CreditorFees
*/
public function setCommissionFeeAmount($commissionFeeAmount)
{
$this->commissionFeeAmount = $commissionFeeAmount;
return $this;
}
}
2 changes: 2 additions & 0 deletions source/Domains/Requests/DirectPayment/Boleto/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
use PagSeguro\Domains\Requests\DirectPayment\Sender;
use PagSeguro\Domains\Requests\Item;
use PagSeguro\Domains\Requests\Notification;
use PagSeguro\Domains\Requests\Parameter;
use PagSeguro\Domains\Requests\ReceiverEmail;
use PagSeguro\Domains\Requests\Redirect;
use PagSeguro\Domains\Requests\Reference;
Expand All @@ -50,6 +51,7 @@ class Request implements Requests
Notification::getUrl insteadof Redirect;
Notification::setUrl insteadof Redirect;
}
use Parameter;
use ReceiverEmail;
use Sender;
use Shipping;
Expand Down
2 changes: 2 additions & 0 deletions source/Domains/Requests/DirectPayment/CreditCard/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
use PagSeguro\Domains\Requests\DirectPayment\Sender;
use PagSeguro\Domains\Requests\Item;
use PagSeguro\Domains\Requests\Notification;
use PagSeguro\Domains\Requests\Parameter;
use PagSeguro\Domains\Requests\ReceiverEmail;
use PagSeguro\Domains\Requests\Redirect;
use PagSeguro\Domains\Requests\Reference;
Expand All @@ -55,6 +56,7 @@ class Request implements Requests
Notification::getUrl insteadof Redirect;
Notification::setUrl insteadof Redirect;
}
use Parameter;
use ReceiverEmail;
use Sender;
use Shipping;
Expand Down
2 changes: 2 additions & 0 deletions source/Domains/Requests/DirectPayment/OnlineDebit/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
use PagSeguro\Domains\Requests\DirectPayment\Sender;
use PagSeguro\Domains\Requests\Item;
use PagSeguro\Domains\Requests\Notification;
use PagSeguro\Domains\Requests\Parameter;
use PagSeguro\Domains\Requests\ReceiverEmail;
use PagSeguro\Domains\Requests\Redirect;
use PagSeguro\Domains\Requests\Reference;
Expand All @@ -50,6 +51,7 @@ class Request implements Requests
Notification::getUrl insteadof Redirect;
Notification::setUrl insteadof Redirect;
}
use Parameter;
use ReceiverEmail;
use Sender;
use Shipping;
Expand Down
3 changes: 3 additions & 0 deletions source/Parsers/DirectPayment/Boleto/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
use PagSeguro\Parsers\DirectPayment\Mode;
use PagSeguro\Parsers\Error;
use PagSeguro\Parsers\Item;
use PagSeguro\Parsers\Parameter;
use PagSeguro\Parsers\Parser;
use PagSeguro\Parsers\ReceiverEmail;
use PagSeguro\Parsers\Sender;
Expand All @@ -53,6 +54,7 @@ class Request extends Error implements Parser
use Item;
use Method;
use Mode;
use Parameter;
use ReceiverEmail;
use Sender;
use Shipping;
Expand All @@ -74,6 +76,7 @@ public static function getData(\PagSeguro\Domains\Requests\DirectPayment\Boleto
Item::getData($boleto, $properties),
Method::getData($properties),
Mode::getData($boleto, $properties),
Parameter::getData($boleto),
ReceiverEmail::getData($boleto, $properties),
Sender::getData($boleto, $properties),
Shipping::getData($boleto, $properties)
Expand Down
3 changes: 3 additions & 0 deletions source/Parsers/DirectPayment/CreditCard/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
use PagSeguro\Parsers\DirectPayment\Mode;
use PagSeguro\Parsers\Error;
use PagSeguro\Parsers\Item;
use PagSeguro\Parsers\Parameter;
use PagSeguro\Parsers\Parser;
use PagSeguro\Parsers\ReceiverEmail;
use PagSeguro\Parsers\Sender;
Expand All @@ -58,6 +59,7 @@ class Request extends Error implements Parser
use Item;
use Method;
use Mode;
use Parameter;
use ReceiverEmail;
use Sender;
use Shipping;
Expand All @@ -81,6 +83,7 @@ public static function getData(\PagSeguro\Domains\Requests\DirectPayment\CreditC
Item::getData($creditCard, $properties),
Method::getData($properties),
Mode::getData($creditCard, $properties),
Parameter::getData($creditCard),
ReceiverEmail::getData($creditCard, $properties),
Sender::getData($creditCard, $properties),
Shipping::getData($creditCard, $properties),
Expand Down
3 changes: 3 additions & 0 deletions source/Parsers/DirectPayment/OnlineDebit/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
use PagSeguro\Parsers\DirectPayment\Mode;
use PagSeguro\Parsers\Error;
use PagSeguro\Parsers\Item;
use PagSeguro\Parsers\Parameter;
use PagSeguro\Parsers\Parser;
use PagSeguro\Parsers\ReceiverEmail;
use PagSeguro\Parsers\Sender;
Expand All @@ -53,6 +54,7 @@ class Request extends Error implements Parser
use Item;
use Method;
use Mode;
use Parameter;
use ReceiverEmail;
use Sender;
use Shipping;
Expand All @@ -73,6 +75,7 @@ public static function getData(\PagSeguro\Domains\Requests\DirectPayment\OnlineD
Item::getData($onlineDebit, $properties),
Method::getData($properties),
Mode::getData($onlineDebit, $properties),
Parameter::getData($onlineDebit),
ReceiverEmail::getData($onlineDebit, $properties),
Sender::getData($onlineDebit, $properties),
Shipping::getData($onlineDebit, $properties)
Expand Down
12 changes: 12 additions & 0 deletions source/Parsers/Response/CreditorFees.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,18 @@ public function setCreditorFees($creditorFees)
$creditor->setIntermediationFeeAmount(current($creditorFees->intermediationFeeAmount));
}

if (!is_null($creditorFees->installmentFeeAmount)) {
$creditor->setInstallmentFeeAmount(current($creditorFees->installmentFeeAmount));
}

if (!is_null($creditorFees->operationalFeeAmount)) {
$creditor->setOperationalFeeAmount(current($creditorFees->operationalFeeAmount));
}

if (!is_null($creditorFees->commissionFeeAmount)) {
$creditor->setCommissionFeeAmount(current($creditorFees->commissionFeeAmount));
}

$this->creditorFees = $creditor;
return $this;
}
Expand Down
23 changes: 23 additions & 0 deletions source/Parsers/Transaction/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ class Response
*/
private $cancelationSource;

/**
* @var
*/
private $promoCode;

public function getCancelationSource()
{
return $this->cancelationSource;
Expand Down Expand Up @@ -216,4 +221,22 @@ public function setType($type)
$this->type = $type;
return $this;
}

/**
* @return mixed
*/
public function getPromoCode()
{
return $this->promoCode;
}

/**
* @param mixed $installmentCount
* @return Response
*/
public function setPromoCode($promoCode)
{
$this->promoCode = $promoCode;
return $this;
}
}
3 changes: 2 additions & 1 deletion source/Parsers/Transaction/Search/Code/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public static function success(Http $http)
->setItemCount(current($xml->itemCount))
->setItems($xml->items)
->setSender($xml->sender)
->setShipping($xml->shipping);
->setShipping($xml->shipping)
->setPromoCode(current($xml->promoCode));
return $response;
}

Expand Down

0 comments on commit 653f921

Please sign in to comment.