-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
73 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,7 +85,7 @@ public function getHashType() | |
case 132: | ||
return 'sign'; | ||
default: | ||
return; | ||
return null; | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,11 +9,37 @@ | |
* https://merchant.wmtransfer.com/conf/guide.asp. | ||
* | ||
* @author Alexander Fedra <[email protected]> | ||
* @copyright 2015 DerCoder | ||
* @copyright 2017 DerCoder | ||
* @license http://opensource.org/licenses/mit-license.php MIT | ||
*/ | ||
class PurchaseRequest extends AbstractRequest | ||
{ | ||
/** | ||
* @return int | ||
*/ | ||
public function getHold() | ||
{ | ||
if ($hold = $this->getParameter('hold')) { | ||
return (string) $hold; | ||
} | ||
|
||
return '0'; | ||
} | ||
|
||
/** | ||
* @param int $value | ||
* | ||
* @return $this | ||
*/ | ||
public function setHold($value) | ||
{ | ||
return $this->setParameter('hold', $value); | ||
} | ||
|
||
/** | ||
* @return array | ||
* @throws InvalidRequestException | ||
*/ | ||
public function getData() | ||
{ | ||
$this->validate( | ||
|
@@ -32,19 +58,25 @@ public function getData() | |
} | ||
|
||
return array( | ||
'LMI_PAYEE_PURSE' => $this->getMerchantPurse(), | ||
'LMI_PAYMENT_AMOUNT' => $this->getAmount(), | ||
'LMI_PAYMENT_NO' => $this->getTransactionId(), | ||
'LMI_PAYEE_PURSE' => $this->getMerchantPurse(), | ||
'LMI_PAYMENT_AMOUNT' => $this->getAmount(), | ||
'LMI_PAYMENT_NO' => $this->getTransactionId(), | ||
'LMI_PAYMENT_DESC_BASE64' => base64_encode($this->getDescription()), | ||
'LMI_SIM_MODE' => $this->getTestMode() ? '2' : '0', | ||
'LMI_RESULT_URL' => $this->getNotifyUrl(), | ||
'LMI_SUCCESS_URL' => $this->getReturnUrl(), | ||
'LMI_SUCCESS_METHOD' => $this->getReturnMethod(), | ||
'LMI_FAIL_URL' => $this->getCancelUrl(), | ||
'LMI_FAIL_METHOD' => $this->getCancelMethod(), | ||
'LMI_SIM_MODE' => $this->getTestMode() ? '2' : '0', | ||
'LMI_RESULT_URL' => $this->getNotifyUrl(), | ||
'LMI_SUCCESS_URL' => $this->getReturnUrl(), | ||
'LMI_SUCCESS_METHOD' => $this->getReturnMethod(), | ||
'LMI_FAIL_URL' => $this->getCancelUrl(), | ||
'LMI_FAIL_METHOD' => $this->getCancelMethod(), | ||
'LMI_HOLD' => $this->getHold() | ||
); | ||
} | ||
|
||
/** | ||
* @param array $data | ||
* | ||
* @return PurchaseResponse | ||
*/ | ||
public function sendData($data) | ||
{ | ||
return $this->response = new PurchaseResponse($this, $data); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters