Skip to content

Commit

Permalink
Payment_gross is empty for non-USD payments
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverFire committed May 17, 2024
1 parent b9c5bd3 commit 60f379b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Message/CompletePurchaseResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
}

/**
Expand All @@ -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'];
}

/**
Expand Down

0 comments on commit 60f379b

Please sign in to comment.