Skip to content

Commit

Permalink
Merge pull request #47 from wirecard/confirmationreturn
Browse files Browse the repository at this point in the history
Handle confirmation return
  • Loading branch information
jpy authored Jul 24, 2017
2 parents 7286237 + 35b6137 commit 6b0914b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 24 deletions.
16 changes: 5 additions & 11 deletions Frontend/WirecardCheckoutPage/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function getCapabilities()
*/
public function getVersion()
{
return '1.5.1';
return '1.5.2';
}

/**
Expand Down Expand Up @@ -208,14 +208,6 @@ protected function createForm()
$form = $this->Form();
$i = 0;

$repository = Shopware()->Models()->getRepository('Shopware\Models\Shop\Shop');
$shop = $repository->findOneBy(['id' => 1]);
$currencies = array();
foreach ($shop->getCurrencies() as $elem) {
$currency = array($elem->getCurrency(), $elem->getName());
array_push($currencies, $currency);
}

$form->setElement(
'text',
'CUSTOMERID',
Expand Down Expand Up @@ -493,7 +485,8 @@ protected function createForm()
array(
'label' => 'Akzeptierte Währungen für Kauf auf Rechnung',
'value' => '',
'store' => $currencies,
'store' => 'base.Currency',
'valueField' => 'currency',
'multiSelect' => true,
'description' => 'Bitte wählen Sie mindestens eine gültige Währung für Kauf auf Rechnung.',
'scope' => \Shopware\Models\Config\Element::SCOPE_SHOP,
Expand Down Expand Up @@ -524,7 +517,8 @@ protected function createForm()
array(
'label' => 'Akzeptierte Währungen für Kauf auf Raten',
'value' => '',
'store' => $currencies,
'store' => 'base.Currency',
'valueField' => 'currency',
'multiSelect' => true,
'description' => 'Bitte wählen Sie mindestens eine gültige Währung für Kauf auf Raten.',
'scope' => \Shopware\Models\Config\Element::SCOPE_SHOP,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,7 @@ public function confirmAction()

if ( ! $return->validate()) {
Shopware()->Pluginlogger()->info('WirecardCheckoutPage: ' . __METHOD__ . ':Validation error: invalid response');
print WirecardCEE_QPay_ReturnFactory::generateConfirmResponseString('Validation error: invalid response');

return;
die(WirecardCEE_QPay_ReturnFactory::generateConfirmResponseString('Validation error: invalid response'));
}

$oOrder = $this->getOrderByUniqueId($paymentUniqueId);
Expand Down Expand Up @@ -332,9 +330,7 @@ public function confirmAction()

if (($existingOrder[0] instanceof \Shopware\Models\Order\Order) && $existingOrder[0]->getPaymentStatus()->getId() !== Shopware()->WirecardCheckoutPage()->getPaymentStatusId(WirecardCEE_QPay_ReturnFactory::STATE_PENDING)) {
Shopware()->Pluginlogger()->info('WirecardCheckoutPage: ' . __METHOD__ . ': do not modify payment status as the order is in a final state!');
print WirecardCEE_QPay_ReturnFactory::generateConfirmResponseString('Can not overwrite payment status as the order is in a final state!');

return;
die(WirecardCEE_QPay_ReturnFactory::generateConfirmResponseString('Can not overwrite payment status as the order is in a final state!'));
} else if ($existingOrder[0] instanceof \Shopware\Models\Order\Order) {
$status = $existingOrder[0]->getPaymentStatus();
if ($status->getId() === Shopware()->WirecardCheckoutPage()->getPaymentStatusId(WirecardCEE_QPay_ReturnFactory::STATE_PENDING)) {
Expand Down Expand Up @@ -385,14 +381,10 @@ public function confirmAction()

} catch (Exception $e) {
Shopware()->Pluginlogger()->info('WirecardCheckoutPage: ' . __METHOD__ . '.--' . __LINE__ . ':' . $e->getMessage());
print WirecardCEE_QPay_ReturnFactory::generateConfirmResponseString(htmlspecialchars($e->getMessage()));

return;
die(WirecardCEE_QPay_ReturnFactory::generateConfirmResponseString(htmlspecialchars($e->getMessage())));
}

print WirecardCEE_QPay_ReturnFactory::generateConfirmResponseString($message);

return;
die(WirecardCEE_QPay_ReturnFactory::generateConfirmResponseString($message));
}

/**
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Our [Online Guides](https://guides.wirecard.at/shop_plugins:shopware_wcp:start "

Be careful after installing/updating the plugin from the GitHub master branch. Your Shopware installation will notify you about an upgrade at the [Shopware store](http://store.shopware.com/wirecard01501/wirecard-checkout-page.html). **This upgrade will revert the plugin to the latest version on the Shopware store.**

**For Shopware versions higher than 5.2.8 our plugin is incompatible with the _statistics plugin_ from Shopware AG.**
**For Shopware versions 5.2.22 - 5.2.24 there can be problems with the shopversion from Shopware AG.**

## Wirecard Checkout Page
Expand Down

0 comments on commit 6b0914b

Please sign in to comment.