Skip to content

Commit

Permalink
Currency not required. Remove currency RUB (default)
Browse files Browse the repository at this point in the history
  • Loading branch information
andchir committed Apr 30, 2019
1 parent 7d53ad2 commit 0a000fe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/Message/AbstractRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ public function setReceipt($value)
return $this->setParameter('receipt', $value);
}

public function getCurrency()
{
if ($this->getParameter('currency') === 'RUB') {
return '';
}
return $this->getParameter('currency');
}

/**
* Get the payment currency label.
*
Expand Down
6 changes: 4 additions & 2 deletions src/Message/PurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ public function generateSignature()
$params = [
$this->getPurse(),
$this->getAmount(),
$this->getInvId(),
$this->getCurrency()
$this->getInvId()
];
if ($this->getCurrency()) {
array_push($params, $this->getCurrency());
}
if ($this->getReceipt()) {
array_push($params, $this->getReceipt());
}
Expand Down

0 comments on commit 0a000fe

Please sign in to comment.