Skip to content

Commit

Permalink
Fixes for Omnipay 3.0
Browse files Browse the repository at this point in the history
Update PurchaseRequest.php
Update PurchaseResponse.php
Update CompletePurchaseResponse.php
  • Loading branch information
WGQI authored and SilverFire committed Jan 11, 2019
1 parent 02c1a29 commit 380eac0
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
22 changes: 22 additions & 0 deletions src/Message/AbstractRequest.php
Expand Up @@ -17,6 +17,28 @@ abstract class AbstractRequest extends \Omnipay\Common\Message\AbstractRequest
{
protected $zeroAmountAllowed = false;

/**
* Get the purse.
*
* @return integer invid
*/
public function getInvId()
{
return $this->getParameter('invid');
}

/**
* Set the purse.
*
* @param integer $invid invid
*
* @return self
*/
public function setInvId($value)
{
return $this->setParameter('invid', $value);
}

/**
* Get the purse.
*
Expand Down
3 changes: 1 addition & 2 deletions src/Message/CompletePurchaseResponse.php
Expand Up @@ -50,9 +50,8 @@ public function generateSignature()
public function getCustomFields()
{
$fields = array_filter([
'Shp_TransactionId' => $this->getTransactionId(),
'Shp_Client' => $this->getClient(),
'Shp_Currency' => $this->getCurrency(),
'Shp_TransactionId' => $this->getTransactionId(),
]);

ksort($fields);
Expand Down
6 changes: 3 additions & 3 deletions src/Message/PurchaseRequest.php
Expand Up @@ -19,7 +19,7 @@ public function getData()
);

return [
'InvId' => '0',
'InvId' => $this->getInvId(),
'MrchLogin' => $this->getPurse(),
'OutSum' => $this->getAmount(),
'Desc' => $this->getDescription(),
Expand All @@ -32,9 +32,9 @@ public function getData()
public function generateSignature()
{
$params = [
$this->getAmount(),
$this->getPurse(),
'0',
$this->getAmount(),
$this->getInvId(),
$this->getSecretKey()
];

Expand Down

0 comments on commit 380eac0

Please sign in to comment.