Skip to content

Commit

Permalink
Removed consumerIp from QRPayment
Browse files Browse the repository at this point in the history
  • Loading branch information
andy committed Oct 8, 2018
1 parent b77fbaa commit 2e10079
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 28 deletions.
3 changes: 1 addition & 2 deletions samples/transaction/qrPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@
'scanData' => '123456789123456789',
'amount' => 0.01,
'description' => 'QR payment test',
'consumerIp' => '10.0.0.5', // Use the ip of your POS here

'currency' => 'EUR'
));
} catch (\Paynl\Error\Error $e) {
die ($e->getMessage());
die ('Error: '.$e->getMessage());
}

echo "isPaid: " . ($result->isPaid() ? 'TRUE' : 'FALSE') . "\n";
Expand Down
24 changes: 1 addition & 23 deletions src/Api/Transaction/QRPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ class QRPayment extends Transaction
* @var string Description for the transaction. Max length of the description is 128 characters.
*/
private $_description;
/**
* @var string The IP of the consumer.
*/
private $_consumerIp;

/**
* @var string The currency of the transaction. If omitted, EUR is used. A list with available currency names and id's can be obtained at: API_Currency_v2::getAll()
*/
Expand Down Expand Up @@ -86,22 +83,6 @@ public function setAmount($amount)
$this->_amount = (int)$amount;
}

/**
* @return string|null
*/
public function getConsumerIp()
{
return $this->_consumerIp;
}

/**
* @param string $consumerIp
*/
public function setConsumerIp($consumerIp)
{
$this->_consumerIp = $consumerIp;
}

/**
* @return string|null
*/
Expand Down Expand Up @@ -142,13 +123,10 @@ protected function getData()
if (empty($this->getScanData())) throw new Required('scanData');
if (empty($this->getAmount())) throw new Required('amount');
if (empty($this->getDescription())) throw new Required('description');
if (empty($this->getConsumerIp())) throw new Required('consumerIp');

$this->data['scanData'] = $this->getScanData();
$this->data['amount'] = $this->getAmount();
$this->data['description'] = $this->getDescription();
$this->data['consumerIp'] = $this->getConsumerIp();

if($this->getCurrency() != null){
$this->data['currency'] = $this->getCurrency();
}
Expand Down
3 changes: 0 additions & 3 deletions src/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,6 @@ public static function QRPayment($options = array())
if (isset($options['description'])) {
$api->setDescription($options['description']);
}
if (isset($options['consumerIp'])) {
$api->setConsumerIp($options['consumerIp']);
}
if (isset($options['currency'])) {
$api->setCurrency($options['currency']);
}
Expand Down

0 comments on commit 2e10079

Please sign in to comment.