Skip to content

Commit

Permalink
refactor: add null type in webpay plus responses files
Browse files Browse the repository at this point in the history
  • Loading branch information
gasspper committed Jul 2, 2024
1 parent 434c17b commit 0dd1804
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 72 deletions.
40 changes: 20 additions & 20 deletions src/Webpay/WebpayPlus/Responses/MallTransactionStatusResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
*/
class MallTransactionStatusResponse
{
public string $vci;
public string $buyOrder;
public string $sessionId;
public string $cardNumber;
public array $cardDetail;
public ?string $vci;
public ?string $buyOrder;
public ?string $sessionId;
public ?string $cardNumber;
public ?array $cardDetail;
public ?string $expirationDate;
public string $accountingDate;
public string $transactionDate;
public array $details;
public ?string $accountingDate;
public ?string $transactionDate;
public ?array $details;

/**
* @var TransactionDetail[]
Expand Down Expand Up @@ -62,25 +62,25 @@ public function isApproved(): bool
}

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

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

/**
* @return string
* @return ?string
*/
public function getCardNumber(): string
public function getCardNumber(): ?string
{
return $this->cardNumber;
}
Expand All @@ -94,17 +94,17 @@ public function getExpirationDate(): ?string
}

/**
* @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;
}
Expand All @@ -118,9 +118,9 @@ public function getDetails(): ?array
}

/**
* @return string
* @return ?string
*/
public function getVci(): string
public function getVci(): ?string
{
return $this->vci;
}
Expand Down
24 changes: 12 additions & 12 deletions src/Webpay/WebpayPlus/Responses/TransactionCaptureResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ class TransactionCaptureResponse
*
* @param array $json
*/
public string $authorizationCode;
public string $authorizationDate;
public float $capturedAmount;
public int $responseCode;
public ?string $authorizationCode;
public ?string $authorizationDate;
public ?float $capturedAmount;
public ?int $responseCode;

public function __construct(array $json)
{
Expand All @@ -34,33 +34,33 @@ public function isApproved(): bool
}

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

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

/**
* @return float
* @return ?float
*/
public function getCapturedAmount(): float
public function getCapturedAmount(): ?float
{
return $this->capturedAmount;
}

/**
* @return int
* @return ?int
*/
public function getResponseCode(): int
public function getResponseCode(): ?int
{
return $this->responseCode;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Webpay/WebpayPlus/Responses/TransactionCreateResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ class TransactionCreateResponse
/**
* @var ?string
*/
public $token;
public ?string $token;

/**
* @var ?string
*/
public $url;
public ?string $url;

/**
* TransactionCreateResponse constructor.
Expand Down
50 changes: 25 additions & 25 deletions src/Webpay/WebpayPlus/Responses/TransactionDetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

class TransactionDetail
{
public float $amount;
public string $status;
public string $authorizationCode;
public string $paymentTypeCode;
public int $responseCode;
public int $installmentsNumber;
public ?float $amount;
public ?string $status;
public ?string $authorizationCode;
public ?string $paymentTypeCode;
public ?int $responseCode;
public ?int $installmentsNumber;
public ?float $installmentsAmount;
public ?string $commerceCode;
public string $buyOrder;
public ?string $buyOrder;
public ?float $balance;

public static function createFromArray(array $array)
Expand Down Expand Up @@ -58,65 +58,65 @@ public function isApproved(): bool
}

/**
* @return float
* @return ?float
*/
public function getAmount(): float
public function getAmount(): ?float
{
return $this->amount;
}

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

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

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

/**
* @return int
* @return ?int
*/
public function getResponseCode(): int
public function getResponseCode(): ?int
{
return $this->responseCode;
}

/**
* @return int
* @return ?int
*/
public function getInstallmentsNumber(): int
public function getInstallmentsNumber(): ?int
{
return $this->installmentsNumber;
}

/**
* @return int
* @return ?int
*/
public function getCommerceCode(): string
public function getCommerceCode(): ?string
{
return $this->commerceCode;
}

/**
* @return string
* @return ?string
*/
public function getBuyOrder(): string
public function getBuyOrder(): ?string
{
return $this->buyOrder;
}
Expand All @@ -130,9 +130,9 @@ public function getInstallmentsAmount(): ?float
}

/**
* @return float
* @return ?float
*/
public function getBalance(): float
public function getBalance(): ?float
{
return $this->balance;
}
Expand Down
20 changes: 10 additions & 10 deletions src/Webpay/WebpayPlus/Responses/TransactionRefundResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@ class TransactionRefundResponse
/**
* @var string
*/
public $type;
public ?string $type;
/**
* @var ?string
*/
public $authorizationCode;
public ?string $authorizationCode;
/**
* @var ?string
*/
public $authorizationDate;
public ?string $authorizationDate;
/**
* @var ?float
*/
public $nullifiedAmount;
public ?float $nullifiedAmount;
/**
* @var ?float
*/
public $balance;
public ?float $balance;
/**
* @var ?int
*/
public $responseCode;
public ?int $responseCode;

/**
* TransactionRefundResponse constructor.
Expand Down Expand Up @@ -75,15 +75,15 @@ public function getBalance(): ?float
/**
* @return ?int
*/
public function getResponseCode(): int
public function getResponseCode(): ?int
{
return $this->responseCode;
}

/**
* @return string
* @return ?string
*/
public function getType(): string
public function getType(): ?string
{
return $this->type;
}
Expand All @@ -99,7 +99,7 @@ public function getAuthorizationCode(): ?string
/**
* @return ?string
*/
public function getAuthorizationDate(): string
public function getAuthorizationDate(): ?string
{
return $this->authorizationDate;
}
Expand Down
6 changes: 3 additions & 3 deletions src/Webpay/WebpayPlus/Responses/TransactionStatusResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class TransactionStatusResponse
{
use HasTransactionStatus;
public string $vci;
public ?string $vci;

public function __construct(array $json)
{
Expand Down Expand Up @@ -42,9 +42,9 @@ public function isApproved(): bool
}

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

0 comments on commit 0dd1804

Please sign in to comment.