Skip to content

Commit

Permalink
Recurrence Flag on Mark1-V5 (#47)
Browse files Browse the repository at this point in the history
* updating exception throw when http status is 401

* Recurrence Flag on Mark1-V5
  • Loading branch information
mateus-picoloto authored Jun 19, 2023
1 parent 6b694a1 commit 1e6caa9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Controllers/BaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ protected function validateResponse(HttpResponse $response, HttpContext $_httpCo
throw new Exceptions\ErrorException('Invalid request', $_httpContext);
}
if ($response->getStatusCode() == 401) {
throw new Exceptions\ErrorException('Invalid API key', $_httpContext);
throw new APIException('Invalid API key', $_httpContext);
}
if ($response->getStatusCode() == 404) {
throw new Exceptions\ErrorException('An informed resource was not found', $_httpContext);
Expand Down
14 changes: 12 additions & 2 deletions src/Models/CreateCreditCardPaymentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ class CreateCreditCardPaymentRequest implements JsonSerializable
*/
public $recurrencyCycle;

/**
* Defines whether the card has been used one or more times.
* @maps recurrence_cycle
* @var string|null $recurrenceCycle public property
*/
public $recurrenceCycle;

/**
* Constructor to set initial or default values of member properties
* @param integer $installments Initialization value for $this->installments
Expand All @@ -136,11 +143,13 @@ class CreateCreditCardPaymentRequest implements JsonSerializable
* @param string $operationType Initialization value for $this->operationType
* @param string $recurrencyCycle Initialization value for $this-
* >recurrencyCycle
* @param string $recurrenceCycle Initialization value for $this-
* >recurrenceCycle
*/
public function __construct()
{
switch (func_num_args()) {
case 15:
case 16:
$this->installments = func_get_arg(0);
$this->statementDescriptor = func_get_arg(1);
$this->card = func_get_arg(2);
Expand All @@ -156,6 +165,7 @@ public function __construct()
$this->autoRecovery = func_get_arg(12);
$this->operationType = func_get_arg(13);
$this->recurrencyCycle = func_get_arg(14);
$this->recurrenceCycle = func_get_arg(15);
break;

default:
Expand All @@ -165,7 +175,6 @@ public function __construct()
}
}


/**
* Encode this object to JSON
*/
Expand All @@ -188,6 +197,7 @@ public function jsonSerialize()
$json['auto_recovery'] = $this->autoRecovery;
$json['operation_type'] = $this->operationType;
$json['recurrency_cycle'] = $this->recurrencyCycle;
$json['recurrence_cycle'] = $this->recurrenceCycle;

return $json;
}
Expand Down

0 comments on commit 1e6caa9

Please sign in to comment.