Skip to content

Commit

Permalink
Parameter Receipt
Browse files Browse the repository at this point in the history
  • Loading branch information
andchir committed Apr 27, 2019
1 parent 57a52d2 commit 8a40ebc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
17 changes: 17 additions & 0 deletions src/Message/AbstractRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,23 @@ public function setClient($value)
return $this->setParameter('client', $value);
}

/**
* @return string
*/
public function getReceipt()
{
return $this->getParameter('receipt');
}

/**
* @param $value
* @return \Omnipay\Common\Message\AbstractRequest
*/
public function setReceipt($value)
{
return $this->setParameter('receipt', $value);
}

/**
* Get the secret key.
*
Expand Down
4 changes: 3 additions & 1 deletion src/Message/PurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class PurchaseRequest extends AbstractRequest
public function getData()
{
$this->validate(
'purse', 'amount', 'currency', 'description'
'purse', 'amount', 'currency', 'description', 'receipt'
);

return [
Expand All @@ -26,6 +26,7 @@ public function getData()
'IncCurrLabel' => $this->getCurrency(),
'SignatureValue' => $this->generateSignature(),
'IsTest' => (int)$this->getTestMode(),
'Receipt' => $this->getReceipt(),
] + $this->getCustomFields();
}

Expand All @@ -35,6 +36,7 @@ public function generateSignature()
$this->getPurse(),
$this->getAmount(),
$this->getInvId(),
$this->getReceipt(),
$this->getSecretKey()
];

Expand Down

0 comments on commit 8a40ebc

Please sign in to comment.