Skip to content

Commit

Permalink
Fix creating signature and redirectUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
trejjam committed Aug 15, 2016
1 parent ff6f24b commit a3b6f15
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/Payment.php
Expand Up @@ -51,17 +51,24 @@ public function setBackToEshopUrl($backToEshopUrl = NULL, $params = [])
parent::setBackToEshopUrl($backToEshopUrl);
}

public function getRedirectUrl()
public function getArgs()
{
$queryArgs = $this->getArgs();
$queryArgs['signature'] = $this->getSignature();
$args = parent::getArgs();

foreach ($queryArgs as &$arg) {
foreach ($args as &$arg) {
if (is_float($arg) || is_double($arg)) {
$arg = number_format($arg, 2, '.', '');
$arg = str_replace(',', '.', (string)$arg);
}
}

return $args;
}

public function getRedirectUrl()
{
$queryArgs = $this->getArgs();
$queryArgs['signature'] = $this->getSignature();

return $this->getMerchantConfig()->gateUrl . '?' . http_build_query($queryArgs);
}

Expand Down

0 comments on commit a3b6f15

Please sign in to comment.