diff --git a/src/Message/CompletePurchaseResponse.php b/src/Message/CompletePurchaseResponse.php index 930aea0..7d67e23 100644 --- a/src/Message/CompletePurchaseResponse.php +++ b/src/Message/CompletePurchaseResponse.php @@ -93,7 +93,11 @@ public function getTransactionStatus(): string */ public function getAmount(): string { - return $this->data['payment_gross'] ?? $this->data['mc_gross']; + if (isset($this->data['payment_gross']) && $this->data['payment_gross'] !== "") { + return $this->data['payment_gross']; + } + + return $this->data['mc_gross']; } /** @@ -111,7 +115,11 @@ public function getResult() */ public function getFee(): string { - return $this->data['payment_fee'] ?? $this->data['mc_fee']; + if (isset($this->data['payment_fee']) && $this->data['payment_fee'] !== "") { + return $this->data['payment_fee']; + } + + return $this->data['mc_fee']; } /**