Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update paymentmethods, config params #50

Merged
merged 20 commits into from
Jun 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
446 changes: 296 additions & 150 deletions Frontend/WirecardCheckoutSeamless/Bootstrap.php

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ abstract class WirecardCEE_Stdlib_PaymentTypeAbstract
const INSTALLMENT = 'INSTALLMENT';
const INVOICE = 'INVOICE';
const MAESTRO = 'MAESTRO';
const MASTERPASS = 'MASTERPASS';
const MONETA = 'MONETA';
const MPASS = 'MPASS';
const P24 = 'PRZELEWY24';
Expand Down Expand Up @@ -81,16 +82,16 @@ abstract class WirecardCEE_Stdlib_PaymentTypeAbstract
'ARZ|AAB' => 'Austrian Anadi Bank AG',
'ARZ|BAF' => 'Ärztebank',
'BA-CA' => 'Bank Austria',
'ARZ|BCS' => 'Bankhaus Carl Spängler & Co. AG',
'ARZ|BSS' => 'Bankhaus Schelhammer & Schattera AG',
'Bawag|B' => 'BAWAG P.S.K. AG',
'ARZ|BCS' => 'Bankhaus Carl Spängler & Co. AG',
'ARZ|BSS' => 'Bankhaus Schelhammer & Schattera AG',
'Bawag|BG' => 'BAWAG P.S.K. AG',
'ARZ|BKS' => 'BKS Bank AG',
'ARZ|BKB' => 'Brüll Kallmus Bank AG',
'ARZ|BTV' => 'BTV VIER LÄNDER BANK',
'ARZ|CBGG' => 'Capital Bank Grawe Gruppe AB',
'ARZ|CBGG' => 'Capital Bank Grawe Gruppe AG',
'ARZ|VB' => 'Volksbank Gruppe',
'ARZ|DB' => 'Dolomitenbank',
'Bawag|E' => 'Easybank AG',
'Bawag|EB' => 'Easybank AG',
'Spardat|EBS' => 'Erste Bank und Sparkassen',
'ARZ|HAA' => 'Hypo Alpe-Adria-Bank International AG',
'ARZ|VLH' => 'Hypo Landesbank Vorarlberg',
Expand All @@ -105,7 +106,7 @@ abstract class WirecardCEE_Stdlib_PaymentTypeAbstract
'ARZ|OB' => 'Oberbank AG',
'Racon' => 'Raiffeisen Bankengruppe Österreich',
'ARZ|SB' => 'Schoellerbank AG',
'Bawag|S' => 'Sparda Bank Wien',
'Bawag|SBW' => 'Sparda Bank Wien',
'ARZ|SBA' => 'SPARDA-BANK AUSTRIA',
'ARZ|VKB' => 'Volkskreditbank AG',
'ARZ|VRB' => 'VR-Bank Braunau'
Expand All @@ -119,16 +120,16 @@ abstract class WirecardCEE_Stdlib_PaymentTypeAbstract
* @todo would be nice to get this values directly from the server so the data is in sync
*/
protected static $_idl_financial_institutions = Array(
'ABNAMROBANK' => 'ABN AMRO Bank',
'ASNBANK' => 'ASN Bank',
'BUNQ' => 'Bunq Bank',
'INGBANK' => 'ING',
'KNAB' => 'knab',
'RABOBANK' => 'Rabobank',
'SNSBANK' => 'SNS Bank',
'REGIOBANK' => 'RegioBank',
'TRIODOSBANK' => 'Triodos Bank',
'VANLANSCHOT' => 'Van Lanschot Bankiers'
'ABNAMROBANK' =>'ABN AMRO Bank',
'ASNBANK' =>'ASN Bank',
'BUNQ' =>'Bunq Bank',
'INGBANK' =>'ING',
'KNAB' =>'knab',
'RABOBANK' =>'Rabobank',
'SNSBANK' =>'SNS Bank',
'REGIOBANK' =>'RegioBank',
'TRIODOSBANK' =>'Triodos Bank',
'VANLANSCHOT' =>'Van Lanschot Bankiers'
);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,7 @@ public function indexAction()
)
);

if (Shopware()->Shop()->getTemplate()->getVersion() >= 3) {
$this->View()->loadTemplate('responsive/frontend/wirecard_checkout_seamless/index.tpl');
}
else {
$this->View()->loadTemplate('frontend/checkout/wirecard_seamless.tpl');
}
$this->View()->loadTemplate('responsive/frontend/wirecard_checkout_seamless/index.tpl');

$headerStyle = Shopware()->WirecardCheckoutSeamless()->Config()->WIRECARD_CONFIRM_HEADER_STYLE;
$headerTemplate = $headerStyle == 1 ? 'frontend/index/index.tpl' : 'frontend/checkout/confirm.tpl';
Expand Down Expand Up @@ -281,6 +276,8 @@ public function confirmAction()
'billing_lastname' => $userData['billingaddress']['lastname']
);

$message = null;

switch ($return->getPaymentState()) {

case WirecardCEE_QMore_ReturnFactory::STATE_SUCCESS:
Expand Down Expand Up @@ -450,18 +447,7 @@ public function confirmAction()
if(($existingOrder[0] instanceof \Shopware\Models\Order\Order) && $existingOrder[0]->getPaymentStatus()->getId() !== Shopware()->WirecardCheckoutSeamless()->Config()->getPaymentStatusId('pending')) {
Shopware()->Pluginlogger()->info('WirecardCheckoutSeamless: '.__METHOD__ . ': failure: do not modify payment status as the order is in a final state');
break;
}

if(Shopware()->WirecardCheckoutSeamless()->Config()->keep_unsuccessful_orders) {
Shopware()->Pluginlogger()->info('WirecardCheckoutSeamless: '.__METHOD__ . ': failure: update order state: ' . $data['orderId']);
$this->savePaymentStatus(
$data['transactionId'],
$paymentUniqueId,
Shopware()->WirecardCheckoutSeamless()->Config()->getPaymentStatusId('failure'),
false
);
} else if($existingOrder[0] instanceof \Shopware\Models\Order\Order) {
Shopware()->Pluginlogger()->info('WirecardCheckoutSeamless: '.__METHOD__ . ': failure: delete order: ' . $data['orderId']);
$this->savePaymentStatus(
$data['transactionId'],
$paymentUniqueId,
Expand All @@ -470,10 +456,6 @@ public function confirmAction()
);

$status = $existingOrder[0]->getPaymentStatus();

Shopware()->Models()->remove($existingOrder[0]);
Shopware()->Models()->flush();

$orderDate = date("d.m.Y");

if($details != null){
Expand Down Expand Up @@ -503,6 +485,13 @@ public function confirmAction()
Shopware()->Session()->offsetSet('sOrderVariables', $variables);
}
}

$errors = array();
foreach ( $return->getErrors() as $error ) {
$errors[] = $error->getConsumerMessage();
$message = $error->getConsumerMessage();
}

$update['session'] = '';
}
break;
Expand All @@ -523,7 +512,7 @@ public function confirmAction()
return;
}

print WirecardCEE_QMore_ReturnFactory::generateConfirmResponseString();
print WirecardCEE_QMore_ReturnFactory::generateConfirmResponseString($message);
}

/**
Expand All @@ -540,12 +529,7 @@ public function returnAction()
->where('uniqueId = ?', array(Shopware()->WirecardCheckoutSeamless()->wWirecardCheckoutSeamlessId));
$result = Shopware()->Db()->fetchRow($sql);

if (Shopware()->Shop()->getTemplate()->getVersion() >= 3) {
$this->View()->loadTemplate('responsive/frontend/wirecard_checkout_seamless/return.tpl');
}
else {
$this->View()->loadTemplate('frontend/checkout/return.tpl');
}
$this->View()->loadTemplate('responsive/frontend/wirecard_checkout_seamless/return.tpl');

$this->View()->redirectUrl = $this->Front()->Router()->assemble(Array('controller' => 'checkout', 'action' => 'confirm', 'sUseSSL' => true));

Expand Down Expand Up @@ -677,13 +661,7 @@ public function successAction()
);
Shopware()->WirecardCheckoutSeamless()->wWirecardCheckoutSeamlessId = $this->createTransactionUniqueId();

if (Shopware()->Shop()->getTemplate()->getVersion() >= 3) {
$this->View()->loadTemplate('responsive/frontend/wirecard_checkout_seamless/return.tpl');
}
else {
$this->View()->loadTemplate('frontend/checkout/return.tpl');
}

$this->View()->loadTemplate('responsive/frontend/wirecard_checkout_seamless/return.tpl');
$this->View()->redirectUrl = $this->Front()->Router()->assemble(Array('controller' => 'checkout', 'action' => 'finish', 'sUseSSL' => true));
}

Expand Down Expand Up @@ -761,13 +739,7 @@ public function dsStoreReturnAction()
die('Parameter not found');
}

if (Shopware()->Shop()->getTemplate()->getVersion() >= 3) {
$this->View()->loadTemplate('responsive/frontend/wirecard_checkout_seamless/storeReturn.tpl');
}
else {
$this->View()->loadTemplate('frontend/checkout/dsStoreReturn.tpl');
}

$this->View()->loadTemplate('responsive/frontend/wirecard_checkout_seamless/storeReturn.tpl');
$this->View()->wirecardResponse = (true == get_magic_quotes_gpc()) ? $post['response'] : addslashes(
$post['response']
);
Expand Down
8 changes: 0 additions & 8 deletions Frontend/WirecardCheckoutSeamless/Models/Basket.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ public static function getSingleton()
*/
public function getBasket()
{
if (FALSE == Shopware()->WirecardCheckoutSeamless()->Config()->restoreBasket()) {
return NULL;
}

Shopware()->Pluginlogger()->info('WirecardCheckoutSeamless: ID: ' . Shopware()->SessionID());
$sql = Shopware()->Db()->select()
->from('s_order_basket')
->where('sessionID = ?', array(Shopware()->SessionID()));
Expand All @@ -89,9 +84,6 @@ public function getSerializedBasket()
*/
public function setBasket($basket = array())
{
if (FALSE == Shopware()->WirecardCheckoutSeamless()->Config()->restoreBasket()) {
return FALSE;
}
Shopware()->Db()->delete('s_order_basket', array('sessionID = ?' => Shopware()->SessionID()));
foreach ($basket as $row) {
Shopware()->Db()->insert('s_order_basket', $row);
Expand Down
Loading