Skip to content

Commit

Permalink
Removed get order process function
Browse files Browse the repository at this point in the history
  • Loading branch information
eusonlito committed Mar 4, 2015
1 parent c55fdf7 commit 99e9a01
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/Ceca/Tpv/Tpv.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ public function setFormHiddens(array $options)
{
$this->hidden = $this->values = array();

$options['Num_operacion'] = $this->getOrder($options['Num_operacion']);
$options['Importe'] = $this->getAmount($options['Importe']);

$this->setValueDefault($options, 'MerchantID', 9);
Expand Down Expand Up @@ -180,23 +179,6 @@ private function setValue(array $options, $option)
return $this;
}

public function getOrder($order)
{
if (preg_match('/^[0-9]+$/', $order)) {
$order = sprintf('%012d', $order);
}

$len = strlen($order);

if (($len < 4) || ($len > 12)) {
throw new Exception('Order code must have more than 4 digits and less than 12');
} elseif (!preg_match('/^[0-9]{4}[0-9a-zA-Z]{0,8}$/', $order)) {
throw new Exception('First four order digits must be numbers and then only are allowed numbers and letters');
}

return $order;
}

public function getAmount($amount)
{
if (empty($amount)) {
Expand Down

0 comments on commit 99e9a01

Please sign in to comment.