Skip to content

Commit

Permalink
Merge pull request #70 from wirecard/TPWDCEE-522
Browse files Browse the repository at this point in the history
Tpwdcee 522
  • Loading branch information
jpy authored Nov 29, 2017
2 parents 61b8448 + 4a3a3fd commit d3fb288
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 26 deletions.
2 changes: 1 addition & 1 deletion Frontend/WirecardCheckoutSeamless/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function getCapabilities()
*/
public function getVersion()
{
return '1.10.8';
return '1.10.9';
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,13 @@ public function saveOrderAction()
'failure' => $returnUrl,
'confirm' => $confirmUrl
);

if(strlen($_SESSION["wcs_redirect_url"]))
die(json_encode(array('redirectUrl' => $_SESSION["wcs_redirect_url"], 'useIframe' => true)));
if(strlen($_SESSION["wcs_redirect_url"])) {
if ($paymentType == WirecardCEE_Stdlib_PaymentTypeAbstract::SOFORTUEBERWEISUNG) {
die(json_encode(array('redirectUrl' => $_SESSION["wcs_redirect_url"], 'useIframe' => false)));
} else {
die(json_encode(array('redirectUrl' => $_SESSION["wcs_redirect_url"], 'useIframe' => true)));
}
}

// Set customer data like name, address
$response = Shopware()->WirecardCheckoutSeamless()->Seamless()->getResponse(
Expand Down Expand Up @@ -198,7 +202,11 @@ public function saveOrderAction()
die($dataFail);
}
$_SESSION["wcs_redirect_url"] = $response->getRedirectUrl();
die(json_encode(array('redirectUrl' => $response->getRedirectUrl(), 'useIframe' => true)));
if ($paymentType == WirecardCEE_Stdlib_PaymentTypeAbstract::SOFORTUEBERWEISUNG) {
die(json_encode(array('redirectUrl' => $response->getRedirectUrl(), 'useIframe' => false)));
} else {
die(json_encode(array('redirectUrl' => $response->getRedirectUrl(), 'useIframe' => true)));
}
}

public function datastorageReadAction()
Expand Down Expand Up @@ -236,16 +244,14 @@ public function confirmAction()

Shopware()->Plugins()->Controller()->ViewRenderer()->setNoRender();

$post = $this->processHTTPRequest();

Shopware()->Pluginlogger()->info('WirecardCheckoutSeamless: '. __METHOD__ . ':' . print_r($post, 1));
Shopware()->Pluginlogger()->info('WirecardCheckoutSeamless: '. __METHOD__ . ':' . print_r($_POST, 1));

$return = WirecardCEE_QMore_ReturnFactory::getInstance(
$post,
$_POST,
Shopware()->WirecardCheckoutSeamless()->Config()->SECRET
);

if( strlen($this->Request()->getParam('reservedItems'))) {
if (strlen($this->Request()->getParam('reservedItems'))) {
$reservedItems = unserialize(base64_decode($this->Request()->getParam('reservedItems')));

foreach ($reservedItems as $articleId => $quantity) {
Expand Down Expand Up @@ -526,7 +532,7 @@ public function confirmAction()
default:
}

$update['data'] = serialize($post);
$update['data'] = serialize($_POST);

Shopware()->Db()->update(
'wirecard_checkout_seamless',
Expand Down Expand Up @@ -692,17 +698,6 @@ public function successAction()
$this->View()->redirectUrl = $this->Front()->Router()->assemble(Array('controller' => 'checkout', 'action' => 'finish', 'sUseSSL' => true));
}

/**
* Returns array with post parameters
* fix for Shopware input filter
*/
public static function processHTTPRequest()
{
$get_string = file_get_contents('php://input');
parse_str($get_string, $post);
return $post;
}

/**
* Save return data
*
Expand Down Expand Up @@ -760,15 +755,14 @@ protected function saveComments(WirecardCEE_Stdlib_Return_ReturnAbstract $return
public function dsStoreReturnAction()
{
Shopware()->Pluginlogger()->info('WirecardCheckoutSeamless: Called: dsStoreReturnAction');
$post = $this->processHTTPRequest();
if (empty($post['response'])) {
if (empty($_POST['response'])) {
Shopware()->Pluginlogger()->error('WirecardCheckoutSeamless: dsStoreReturnAction: Parameter not found');
die('Parameter not found');
}

$this->View()->loadTemplate('responsive/frontend/wirecard_checkout_seamless/storeReturn.tpl');
$this->View()->wirecardResponse = (true == get_magic_quotes_gpc()) ? $post['response'] : addslashes(
$post['response']
$this->View()->wirecardResponse = (true == get_magic_quotes_gpc()) ? $_POST['response'] : addslashes(
$_POST['response']
);
Shopware()->Pluginlogger()->info(
'WirecardCheckoutSeamless: Response: ' . print_r($this->View()->wirecardResponse, 1)
Expand Down

0 comments on commit d3fb288

Please sign in to comment.