Skip to content

Commit

Permalink
refactor: add null type in transaccion completa responses files
Browse files Browse the repository at this point in the history
  • Loading branch information
gasspper committed Jul 2, 2024
1 parent badef99 commit 434c17b
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class MallTransactionCreateResponse
{
public string $token;
public ?string $token;

public function __construct(array $json)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
class MallTransactionInstallmentsResponse
{
public ?float $installmentsAmount;
public string $idQueryInstallments;
public array $deferredPeriods;
public ?string $idQueryInstallments;
public ?array $deferredPeriods;

public function __construct(array $json)
{
Expand All @@ -26,17 +26,17 @@ public function getInstallmentsAmount(): ?float
}

/**
* @return string
* @return ?string
*/
public function getIdQueryInstallments(): string
public function getIdQueryInstallments(): ?string
{
return $this->idQueryInstallments;
}

/**
* @return array
* @return ?array
*/
public function getDeferredPeriods(): array
public function getDeferredPeriods(): ?array
{
return $this->deferredPeriods;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

class MallTransactionRefundResponse
{
public string $type;
public ?string $type;
public ?string $authorizationCode;
public ?string $authorizationDate;
public ?float $nullifiedAmount;
public ?float $balance;
public int $responseCode;
public ?int $responseCode;

public function __construct(array $json)
{
Expand All @@ -24,9 +24,9 @@ public function __construct(array $json)
}

/**
* @return string
* @return ?string
*/
public function getType(): string
public function getType(): ?string
{
return $this->type;
}
Expand Down Expand Up @@ -64,10 +64,10 @@ public function getBalance(): ?float
}

/**
* @return int
* @return ?int
*/
public function getResponseCode(): int
public function getResponseCode(): ?int
{
return (int) $this->responseCode;
return $this->responseCode;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

class MallTransactionStatusResponse
{
protected string $buyOrder;
protected array $cardDetail;
protected string $cardNumber;
protected string $accountingDate;
protected string $transactionDate;
protected array $details;
protected ?string $buyOrder;
protected ?array $cardDetail;
protected ?string $cardNumber;
protected ?string $accountingDate;
protected ?string $transactionDate;
protected ?array $details;

public function __construct(array $json)
{
Expand All @@ -30,49 +30,49 @@ public function __construct(array $json)
}

/**
* @return string
* @return ?string
*/
public function getBuyOrder(): string
public function getBuyOrder(): ?string
{
return $this->buyOrder;
}

/**
* @return array
* @return ?array
*/
public function getCardDetail(): array
public function getCardDetail(): ?array
{
return $this->cardDetail;
}

/**
* @return string
* @return ?string
*/
public function getAccountingDate(): string
public function getAccountingDate(): ?string
{
return $this->accountingDate;
}

/**
* @return string
* @return ?string
*/
public function getTransactionDate(): string
public function getTransactionDate(): ?string
{
return $this->transactionDate;
}

/**
* @return array
* @return ?array
*/
public function getDetails(): array
public function getDetails(): ?array
{
return $this->details;
}

/**
* @return string
* @return ?string
*/
public function getCardNumber(): string
public function getCardNumber(): ?string
{
return $this->cardNumber;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@

class TransactionCreateResponse
{
public string $token;
public ?string $token;

public function __construct(array $json)
{
$this->token = Utils::returnValueIfExists($json, 'token');
}

/**
* @return string
* @return ?string
*/
public function getToken(): string
public function getToken(): ?string
{
return $this->token;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
class TransactionInstallmentsResponse
{
public ?float $installmentsAmount;
public string $idQueryInstallments;
public array $deferredPeriods;
public ?string $idQueryInstallments;
public ?array $deferredPeriods;

public function __construct(array $json)
{
Expand All @@ -20,23 +20,23 @@ public function __construct(array $json)
/**
* @return ?float
*/
public function getInstallmentsAmount(): float
public function getInstallmentsAmount(): ?float
{
return $this->installmentsAmount;
}

/**
* @return string
* @return ?string
*/
public function getIdQueryInstallments(): string
public function getIdQueryInstallments(): ?string
{
return $this->idQueryInstallments;
}

/**
* @return array
* @return ?array
*/
public function getDeferredPeriods(): array
public function getDeferredPeriods(): ?array
{
return $this->deferredPeriods;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class TransactionRefundResponse
{
public string $type;
public ?string $type;
public ?string $authorizationCode;
public ?string $authorizationDate;
public ?float $nullifiedAmount;
Expand All @@ -24,9 +24,9 @@ public function __construct(array $json)
}

/**
* @return string
* @return ?string
*/
public function getType(): string
public function getType(): ?string
{
return $this->type;
}
Expand Down

0 comments on commit 434c17b

Please sign in to comment.