Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/Rede/Authorization.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ class Authorization
*/
private $tid;

/**
* @var object
*/
private $brand;

/**
* @return string
*/
Expand Down Expand Up @@ -417,4 +422,20 @@ public function setTid($tid)
$this->tid = $tid;
return $this;
}

/**
* @return object
*/
public function getBrand()
{
return $this->brand;
}

/**
* @param object $brand
*/
public function setBrand($brand): void
{
$this->brand = $brand;
}
}
23 changes: 23 additions & 0 deletions src/Rede/Brand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ class Brand
*/
private $returnMessage;

/**
* @var string
*/
private $authorizationCode;

/**
* @return string
*/
Expand Down Expand Up @@ -78,5 +83,23 @@ public function setReturnMessage(string $returnMessage): Brand
return $this;
}

/**
* @param string $authorizationCode
*
* @return Brand
*/
public function setAuthorizationCode(string $authorizationCode): Brand
{
$this->authorizationCode = $authorizationCode;
return $this;
}

/**
* @return string
*/
public function getAuthorizationCode(): string
{
return $this->authorizationCode;
}

}
29 changes: 29 additions & 0 deletions src/Rede/Exception/RedeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,37 @@

namespace Rede\Exception;

use Rede\Transaction;
use RuntimeException;
use Throwable;

class RedeException extends RuntimeException
{
private ?string $response = null;

private ?Transaction $transaction = null;

public function __construct($message = "", $code = 0, ?Throwable $previous = null, string $response = null, ?Transaction $transaction = null)
{
parent::__construct($message, $code, $previous);

$this->response = $response;
$this->transaction = $transaction;
}

/**
* @return string|null
*/
public function getResponse(): ?string
{
return $this->response;
}

/**
* @return Transaction|null
*/
public function getTransaction(): ?Transaction
{
return $this->transaction;
}
}
4 changes: 3 additions & 1 deletion src/Rede/Service/AbstractTransactionsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ protected function parseResponse($response, $statusCode)
throw new RedeException(
$this->transaction->getReturnMessage(),
$this->transaction->getReturnCode(),
$previous
$previous,
$response,
$this->transaction
);
}

Expand Down