Skip to content

Commit

Permalink
Added M_INFO field
Browse files Browse the repository at this point in the history
  • Loading branch information
rosen4o committed Jul 15, 2024
1 parent a09c523 commit a894561
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ $saleRequest = (new SaleRequest())
->setTerminalID('<TID - V*******>')
->setMerchantId('<MID - 15 chars>')
->setPrivateKey('\<path to certificate.key>', '<password / or use method from bottom>')
->setMInfo(array(
'email'=>'[email protected]',
'cardholderName'=>'Ivan Ivanov',
'mobilePhone'=>'359888123456'
))
//->setSigningSchemaMacGeneral(); // use MAC_GENERAL
//->setSigningSchemaMacExtended(); // use MAC_EXTENDED
//->setSigningSchemaMacAdvanced(); // use MAC_ADVANCED
Expand Down
23 changes: 23 additions & 0 deletions src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ abstract class Request extends Base
*/
private $nonce;

/**
* @array
*/
private $mInfo;
/**
* Get description
*
Expand Down Expand Up @@ -265,4 +269,23 @@ public function setNonce($nonce)
$this->nonce = $nonce;
return $this;
}

/**
* @return array
*/
public function getMInfo()
{
return $this->mInfo;
}

/**
* @param string $nonce Nonce.
*
* @return Request
*/
public function setMInfo($mInfo)
{
$this->mInfo = $mInfo;
return $this;
}
}
7 changes: 7 additions & 0 deletions src/SaleRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ class SaleRequest extends Request implements RequestInterface
*/
protected $adCustBorOrderId;

/**
* @array
*/
protected $mInfo;

/**
* Sale constructor.
*/
Expand Down Expand Up @@ -126,6 +131,8 @@ public function getData()

'TERMINAL' => $this->getTerminalID(),
'BACKREF' => $this->getBackRefUrl(),

'M_INFO' => base64_encode(json_encode($this->getMInfo())),
] + $this->generateAdCustBorOrderId();
}

Expand Down

0 comments on commit a894561

Please sign in to comment.