Skip to content

Commit

Permalink
Add new methods
Browse files Browse the repository at this point in the history
Add setDescription, setMobileNumber and setEmail methods.
  • Loading branch information
erfansahaf authored Oct 4, 2016
1 parent c329925 commit 0df36d9
Showing 1 changed file with 58 additions and 3 deletions.
61 changes: 58 additions & 3 deletions Zarinpal/Zarinpal.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,27 @@ class Zarinpal extends PortAbstract implements PortInterface
*/
protected $serverUrl;

/**
* Payment Description
*
* @var string
*/
protected $description;

/**
* Payer Email Address
*
* @var string
*/
protected $email;

/**
* Payer Mobile Number
*
* @var string
*/
protected $mobileNumber;

/**
* Address of gate for redirect
*
Expand Down Expand Up @@ -152,9 +173,9 @@ protected function sendPayRequest()
'MerchantID' => $this->config->get('gateway.zarinpal.merchant-id'),
'Amount' => $this->amount,
'CallbackURL' => $this->getCallback(),
'Description' => $this->config->get('gateway.zarinpal.description', ''),
'Email' => $this->config->get('gateway.zarinpal.email', ''),
'Mobile' => $this->config->get('gateway.zarinpal.mobile', ''),
'Description' => $this->description ? $this->description : $this->config->get('gateway.zarinpal.description', ''),
'Email' => $this->email ? $this->email :$this->config->get('gateway.zarinpal.email', ''),
'Mobile' => $this->mobileNumber ? $this->mobileNumber : $this->config->get('gateway.zarinpal.mobile', ''),
);

try {
Expand Down Expand Up @@ -260,4 +281,38 @@ protected function setServer()
break;
}
}


/**
* Set Description
*
* @param $description
* @return void
*/
public function setDescription($description)
{
$this->description = $description;
}

/**
* Set Payer Email Address
*
* @param $email
* @return void
*/
public function setEmail($email)
{
$this->email = $email;
}

/**
* Set Payer Mobile Number
*
* @param $number
* @return void
*/
public function setMobileNumber($number)
{
$this->mobileNumber = $number;
}
}

0 comments on commit 0df36d9

Please sign in to comment.