Skip to content

Commit

Permalink
feat: remove capture expiration date attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
mvarlic committed Nov 24, 2023
1 parent 1817694 commit 91540e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
6 changes: 1 addition & 5 deletions src/Utils/HasTransactionStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ trait HasTransactionStatus
public $cardDetail;
public $transactionDate;
public $balance;
public $captureExpirationDate;

/**
* @param mixed $amount
Expand Down Expand Up @@ -203,10 +202,7 @@ public function setTransactionStatusFields($json)
$this->installmentsAmount = isset($json['installments_amount']) ? $json['installments_amount'] : null;
$this->installmentsNumber = isset($json['installments_number']) ? $json['installments_number'] : null;
$this->balance = isset($json['balance']) ? $json['balance'] : null;
$this->captureExpirationDate = isset($json['capture_expiration_date']) ? $json['capture_expiration_date'] : null;
if (is_null($this->captureExpirationDate)) {
unset($this->captureExpirationDate);
}

}

/**
Expand Down
12 changes: 2 additions & 10 deletions src/Webpay/WebpayPlus/Responses/TransactionDetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class TransactionDetail
public $installmentsAmount;
public $commerceCode;
public $buyOrder;
public $captureExpirationDate;

/**
* TransactionDetail constructor.
Expand All @@ -29,7 +28,6 @@ class TransactionDetail
* @param $installmentsNumber
* @param $commerceCode
* @param $buyOrder
* @param $captureExpirationDate
*/
public function __construct(
$amount,
Expand All @@ -40,8 +38,7 @@ public function __construct(
$installmentsNumber,
$installmentsAmount,
$commerceCode,
$buyOrder,
$captureExpirationDate
$buyOrder
) {
$this->amount = $amount;
$this->status = $status;
Expand All @@ -52,10 +49,6 @@ public function __construct(
$this->installmentsAmount = $installmentsAmount;
$this->commerceCode = $commerceCode;
$this->buyOrder = $buyOrder;
$this->captureExpirationDate = $captureExpirationDate;
if (is_null($captureExpirationDate)) {
unset($this->captureExpirationDate);
}
}

public static function createFromArray(array $array)
Expand All @@ -69,10 +62,9 @@ public static function createFromArray(array $array)
$installmentsAmount = isset($array['installments_amount']) ? $array['installments_amount'] : null;
$commerceCode = isset($array['commerce_code']) ? $array['commerce_code'] : null;
$buyOrder = isset($array['buy_order']) ? $array['buy_order'] : null;
$captureExpirationDate = isset($array['capture_expiration_date']) ? $array['capture_expiration_date'] : null;

return new static($amount, $status, $authorizationCode, $paymentTypeCode, $responseCode, $installmentsNumber,
$installmentsAmount, $commerceCode, $buyOrder, $captureExpirationDate);
$installmentsAmount, $commerceCode, $buyOrder);
}

public function isApproved()
Expand Down

0 comments on commit 91540e8

Please sign in to comment.