Skip to content

Commit

Permalink
Ajustes no metodo sendDiscount
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandobandeira authored Nov 19, 2017
1 parent 02738fa commit 0c20393
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Artistas/PagSeguroRecorrente.php
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ public function showPreApproval($preApprovalCode)
*
* @param array $discountSettings
*
* @return mixed
* @return string
*/
public function sendDiscount(array $discountSettings)
{
Expand All @@ -593,7 +593,7 @@ public function sendDiscount(array $discountSettings)
$this->validateDiscountSettings($discountSettings);
$data = $this->formatDiscountMethodData($discountSettings);

return (string) $this->sendJsonTransaction($data, $this->url['preApproval'].'/'.$this->plan.'/discount', 'PUT');
return (string) $this->sendJsonTransaction($data, $this->url['preApproval'].'/'.$this->preApprovalCode.'/discount', 'PUT');
}

/**
Expand Down Expand Up @@ -622,7 +622,6 @@ private function formatDiscountMethodData(array $discountSettings)
{
$data = [
'type' => $discountSettings['type'],
// Formato: Decimal, com duas casas decimais separadas por ponto, maior que 0.00
'value' => number_format($discountSettings['value'], 2, '.', ''),
];

Expand Down

0 comments on commit 0c20393

Please sign in to comment.