Skip to content

Commit

Permalink
#2 Added new functionality
Browse files Browse the repository at this point in the history
- in backend is new checkbox under plugin settings
- default behavior of plugin not changed
- when unchecked orders will stay recorded
  • Loading branch information
jakubpolomsky committed Sep 26, 2016
1 parent fb742b2 commit e6ab6c4
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ protected function _getNextStep($iSuccess)
$aFormattedErrors[] = $error->getConsumerMessage();
}

$oOrder->delete();
if($config->getDeleteFailedOrCanceledOrders())
$oOrder->delete();

wirecardCheckoutSeamlessUtils::getInstance()->log(__METHOD__ . ':ERROR:' . print_r($aFormattedErrors, true));
return parent::_getNextStep(implode("<br/>\n", $aFormattedErrors));
Expand Down Expand Up @@ -196,6 +197,8 @@ public function wirecardConfirm()
{
wirecardCheckoutSeamlessUtils::getInstance()->log(__METHOD__ . ':' . print_r($_POST, true));

$config = wirecardCheckoutSeamlessConfig::getInstance();

$out = WirecardCEE_QMore_ReturnFactory::generateConfirmResponseString();

if (!isset($_POST['oxid_orderid'])) {
Expand Down Expand Up @@ -301,16 +304,27 @@ public function wirecardConfirm()
case WirecardCEE_QMore_ReturnFactory::STATE_CANCEL:
/** @var $return WirecardCEE_QMore_Return_Cancel */
wirecardCheckoutSeamlessUtils::getInstance()->log(__METHOD__ . ':CANCEL');
$oOrder->oxorder__oxtransstatus = new oxField('CANCELED');
$oOrder->cancelOrder();
$oOrder->save();

$oDbOrder->delete($aOrderData['OXID']);
$oOrder->delete();

if($config->getDeleteFailedOrCanceledOrders())
$oOrder->delete();
break;

case WirecardCEE_QMore_ReturnFactory::STATE_FAILURE:
/** @var $return WirecardCEE_QMore_Return_Failure */
wirecardCheckoutSeamlessUtils::getInstance()->log(__METHOD__ . ':FAILURE:' . print_r($return->getErrors(),
true));
$oOrder->oxorder__oxtransstatus = new oxField('FAILED');
$oOrder->cancelOrder();
$oOrder->save();

$oDbOrder->delete($aOrderData['OXID']);
$oOrder->delete();
if($config->getDeleteFailedOrCanceledOrders())
$oOrder->delete();

$consumerMessage = '';
/** var $e WirecardCEE_QMore_Error */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ public function getPassword()
}
}

public function getDeleteFailedOrCanceledOrders(){
return $this->_getConfig()->getConfigParam('sDeleteFailedOrCanceledOrders');
}

public function getServiceUrl()
{
return $this->_getConfig()->getConfigParam('sServiceUrl');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,13 +272,13 @@ public static function onDeactivate()
public static function addWirecardCheckoutSeamlessOrderTable()
{
$sSql = "CREATE TABLE IF NOT EXISTS `wirecardcheckoutseamless_order` (
`OXID` char(32) NOT NULL,
`OXORDERID` char(32) NOT NULL,
`OXID` char(32) NOT NULL COLLATE 'latin1_general_ci',
`OXORDERID` char(32) NOT NULL COLLATE 'latin1_general_ci',
`BASKET` TEXT NULL,
`TIMESTAMP` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
PRIMARY KEY (`OXID`),
KEY `WIRECARDCHECKOUTSEAMLESS_ORDER_OXORDERID` (`OXORDERID`)
);";
) COLLATE='utf8_general_ci'";

oxDb::getDb()->execute($sSql);
}
Expand Down
3 changes: 2 additions & 1 deletion modules/wirecard/checkoutseamless/metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
'en' => 'Module for payment using Wirecard Checkout Seamless.<br /><br /><div id="helpPanel"><div class="bd"><strong>Support and sales information</strong><br /><a href="https://guides.wirecard.at/support" target="_blank">support</a><br /><a href="https://guides.wirecard.at/sales" target="_blank">sales</a></div></div>',
),
'thumbnail' => 'picture.jpg',
'version' => '2.1.4',
'version' => '2.1.5',
'author' => 'Wirecard CEE',
'url' => 'http://www.wirecard.at',
'email' => '[email protected]',
Expand Down Expand Up @@ -113,6 +113,7 @@
array('group' => 'wcs_plugin', 'name' => 'bSendAdditionalCustomerData', 'type' => 'bool', 'value' => '1'),
array('group' => 'wcs_plugin', 'name' => 'bSendAdditionalBasketData', 'type' => 'bool', 'value' => '1'),
array('group' => 'wcs_plugin', 'name' => 'bUseIframe', 'type' => 'bool', 'value' => '1'),
array('group' => 'wcs_plugin', 'name' => 'sDeleteFailedOrCanceledOrders', 'type' => 'bool', 'value' => '1'),

array('group' => 'wcs_installment_invoice_settings', 'name' => 'sInvoiceInstallmentProvider', 'type' => 'select', 'value' => 'PAYOLUTION', 'constraints' => 'PAYOLUTION|RATEPAY|WIRECARD'),
array('group' => 'wcs_installment_invoice_settings', 'name' => 'sPayolutionMId', 'type' => 'str', 'value' => ''),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
'HELP_SHOP_MODULE_sPluginMode' => 'Zum Testen der Integration eine vordefinierte Konfiguration ausw&auml;hlen. F&uuml;r Produktivsysteme "Production" ausw&auml;hlen.',
'SHOP_MODULE_bUseIframe' => 'Seite von Finanzdienstleistern in iFrame anzeigen',
'HELP_SHOP_MODULE_bUseIframe' => 'Andernfalls wird Ihr Konsument auf diese Seite weitergeleitet und danach zur&uuml;ck zu Ihrem Onlineshop geleitet.',
'SHOP_MODULE_sDeleteFailedOrCanceledOrders' => 'Bestellungen bei fehlgeschlagener oder abgebrochener Zahlung löschen',
'HELP_SHOP_MODULE_sDeleteFailedOrCanceledOrders' => 'Falls aktiviert, werden die Bestellungen bei fehlgeschlagener oder abgebrochener Zahlung gelöscht. Achtung: Diese Einstellung gilt für alle Wirecard-Zahlungsmittel.',
'SHOP_MODULE_bDssSaqAEnable' => 'SAQ A konform',
'HELP_SHOP_MODULE_bDssSaqAEnable' => 'Falls kein H&auml;kchen gesetzt ist, gilt der strengere SAQ A-EP. Falls ein H&auml;kchen gesetzt ist, wird in Wirecard Checkout Seamless das "PCI DSS SAQ A Compliance"-Feature verwendet und es gilt der SAQ A. <a href="https://guides.wirecard.at/wcs:pci3_fallback:start" target="_blank">Weitere Informationen</a>',
'SHOP_MODULE_bShowCreditcardCardholder' => 'Feld f&uuml;r Karteninhaber anzeigen',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
'HELP_SHOP_MODULE_sPluginMode' => 'For integration, select predefined configuration settings or "Production" for live systems.',
'SHOP_MODULE_bUseIframe' => 'Display page from financial service provides in an iframe',
'HELP_SHOP_MODULE_bUseIframe' => 'Otherwise your consumer will be forwarded to this page and then redirected to your online shop.',
'SHOP_MODULE_sDeleteFailedOrCanceledOrders' => 'Delete orders if payment fails or is canceled',
'HELP_SHOP_MODULE_sDeleteFailedOrCanceledOrders' => 'If enabled, pending orders will be deleted in the order list if payment fails or if payment gets canceled. Note that this setting applies to all Wirecard payment methods.',
'SHOP_MODULE_bDssSaqAEnable' => 'SAQ A compliance',
'HELP_SHOP_MODULE_bDssSaqAEnable' => 'Not checked, the stringent SAQ A-EP is applicable. Checked, Wirecard Checkout Seamless is integrated with the "PCI DSS SAQ A Compliance" feature and SAQ A is applicable. <a href="https://guides.wirecard.at/wcs:pci3_fallback:start" target="_blank">More information</a>',
'SHOP_MODULE_bShowCreditcardCardholder' => 'Display card holder field',
Expand Down

0 comments on commit e6ab6c4

Please sign in to comment.