Skip to content
This repository has been archived by the owner on Feb 16, 2022. It is now read-only.

Commit

Permalink
Merge pull request #12 from heidelpay/develop
Browse files Browse the repository at this point in the history
Release 20.04.08
  • Loading branch information
Sascha authored Apr 8, 2020
2 parents 3ea68aa + 1f88f08 commit c6598aa
Show file tree
Hide file tree
Showing 24 changed files with 678 additions and 632 deletions.
127 changes: 77 additions & 50 deletions Frontend/HeidelGateway/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Shopware_Plugins_Frontend_HeidelGateway_Bootstrap extends Shopware_Compone
* @return string version number
*/
public function getVersion(){
return '19.08.21';
return '20.04.08';
}

/**
Expand Down Expand Up @@ -106,7 +106,6 @@ public function install(){
throw new Enlight_Exception("This Plugin needs min shopware 4.3.7");
}

/* *************** Neuer Code ********************* */
$swVersion = Shopware()->Config()->version;

/* Major check Version */
Expand All @@ -120,19 +119,6 @@ public function install(){
throw new Enlight_Exception("This plugin requires the shopware plugin payment");
}
};
/* *************** Ende neuer Code ********************* */
/* Major check Version */
// if ($this->assertVersionGreaterThen('5.1.6')) {
// $swVersion = Shopware()->Config()->version;
//
// } else {
// $swVersion = Shopware()->Config()->version;
// if(!$this->assertRequiredPluginsPresent(array('Payment'))){
// $msg .= "This plugin requires the plugin payment<br />";
// $this->uninstall();
// throw new Enlight_Exception("This plugin requires the shopware plugin payment");
// }
// }

if($this->assertRequiredPluginsPresent(array('HeidelActions'))){
throw new Enlight_Exception("Please delete Heidelpay Backend Plugin (HeidelActions) from your Server");
Expand Down Expand Up @@ -1007,8 +993,35 @@ public function update($oldVersion){
} catch (Exception $e) {
$this->logError($msg,$e);
}

// Compatibility for SW 5.6
// Fix for no additional E-Mail for invoice B2B is sent after an order
// Feature setting article in stock in case of an order without session
// Fix for redirect after saving registered paymentdata in savePaymentAction
case '19.08.21':
case '19.09.16':
case '19.10.31':
try{
$msg .= '* update 19.10.31<br />';
} catch (Exception $e) {
$this->logError($msg,$e);
}

// Fix for switching to paymentmethod dd with reg
// Fix for a php-fatal exception could be thrown in case of incoming pushes "Call to a member function getPrevious() on null"
// Fix for Mobile-browsers with Card-transactions
// Fix for PayPal registrations
// Fix for B2B-invoice form in JS
// added params for evaluation
// added EventHook in convertOrder to get notified after convertOrder has finshed
// activated refunds for eps payment method in backend
// Bugfix for EPS-Connector issues
case '20.01.15':
case '20.04.08':
try{
$msg .= '* update 20.03.10<br />';
} catch (Exception $e){
$this->logError($msg,$e);
}

// overwrite $msg if update was successful
$msg = 'Update auf Version '.$this->getVersion().' erfolgreich.';
Expand Down Expand Up @@ -1413,13 +1426,15 @@ protected function createPayments(){
$payId = $translation['payId'];
}

$translationObject = new Shopware_Components_Translation();
$translationObject->write(
$shopId, 'config_payment', $payId, array(
'description' => $translation['trans_desc'],
'additionalDescription' => $translation['trans_addDesc'],
), true
);
if(Shopware()->Config()->version <= "5.5.10"){
$translationObject = new Shopware_Components_Translation();
$translationObject->write(
$shopId, 'config_payment', $payId, array(
'description' => $translation['trans_desc'],
'additionalDescription' => $translation['trans_addDesc'],
), true
);
}
}
}
}catch(Exception $e){
Expand Down Expand Up @@ -1867,6 +1882,7 @@ public static function onGetControllerPathFrontend(Enlight_Event_EventArgs $args

/**
* Hook for custom code before document is renderd
*
*/
public function onBeforeRenderDocument(Enlight_Hook_HookArgs $args){
try{
Expand Down Expand Up @@ -1919,8 +1935,8 @@ public function onBeforeRenderDocument(Enlight_Hook_HookArgs $args){
$rawFooter = $this->getInvoiceContentInfo($containers, $orderData, 'SAN');
$containers['Hgw_SAN_Content_Info']['value'] = $rawFooter['value'];
} elseif (
$document->_order->payment['name'] == 'hgw_ivpd' ||
$document->_order->payment['name'] == 'hgw_ivb2b'
$document->_order->payment['name'] == 'hgw_ivpd'
// || $document->_order->payment['name'] == 'hgw_ivb2b'
){
$rawFooter = $this->getInvoiceContentInfo($containers, $orderData, 'IVPD');
$containers['Hgw_IVPD_Content_Info']['value'] = $rawFooter['value'];
Expand Down Expand Up @@ -1956,8 +1972,8 @@ public function onBeforeRenderDocument(Enlight_Hook_HookArgs $args){
$containerData['Content_Info']['value'] = $document->_template->fetch('string:' . $containerData['Content_Info']['value']);
$view->assign('Containers', $containerData);
} elseif(
($document->_order->payment['name'] == 'hgw_ivpd') ||
($document->_order->payment['name'] == 'hgw_ivb2b')
($document->_order->payment['name'] == 'hgw_ivpd')
// ||($document->_order->payment['name'] == 'hgw_ivb2b')
) {
$containerData['Content_Info'] = $containerData['Hgw_IVPD_Content_Info'];
$containerData['Content_Info']['value'] = $document->_template->fetch('string:' . $containerData['Content_Info']['value']);
Expand Down Expand Up @@ -2141,25 +2157,27 @@ public function onPostDispatch(Enlight_Event_EventArgs $args){
widerrufen. Ausführliche Informationen zu dieser Einwilligung sowie die Möglichkeit zum Widerruf
finde ich </strong><a href="https://www.santander.de/applications/rechnungskauf/werbewiderspruch/" target="_blank">hier</a>.
</strong>';
$recoveryTextPrivacyPolicy = '<strong>Ich willige in die Übermittlung meiner personenbezogenen Daten an die Santander Consumer Bank AG
gemäß den näheren Bestimmungen des beigefügten <a href="https://www.santander.de/applications/rechnungskauf/datenschutzbestimmungen" target="_blank">Einwilligungserklärungstextes</a> sowie an die darin
genannten Auskunfteien und in die Durchführung einer automatisierten Entscheidung ein.</strong>
</br>
Nähere Informationen finden Sie in den <a href="https://www.santander.de/applications/rechnungskauf/datenschutzbestimmungen" target="_blank">Datenschutzhinweisen</a>
';
$recoveryTextPrivacyPolicy = '
<strong>Das Anklicken des Buttons “Jetzt kaufen” löst eine Übermittlung Ihrer
personenberzogenen Daten an die Santander Consumer Bank AG zum Zweck der Bonitätsprüfung aus.
<br />Nähere Informationen finden Sie in den Datenschutzhinweisen der Santander für den
<a href=\"https://www.santander.de/static/datenschutzhinweise/rechnungskauf/datenschutzhinweise.html\" target=\"blank\">Rechnungs-/Ratenkauf</a>.
Der Kunde ist mit <a href=\"https://applications.santander.de/applications/rechnungskauf/werbehinweise\" target=\"_blank\">werblicher Kommunikation</a>
durch die Santander einverstanden. Die Erteilung dieser Einwilligung ist freiwillig und kann jederzeit <u>widerrufen</u> werden.
<strong>';

$sanJson = json_decode($getFormUrl['CONFIG_OPTIN_TEXT'],true);
$sanJsonPrivPol = json_decode($getFormUrl['CONFIG_OPTIN_TEXT_SCB_2'],true);

$view->optin_San_logoUrl = empty($sanJson['logolink']) ? $recoveryLogoUrl : $sanJson['logolink'];
$view->optin_San_adv = empty($sanJson['optin']) ? $recoveryTextOptin : $sanJson['optin'];
$view->optin_San_privpol = empty($sanJson['privacy_policy']) ? $recoveryTextPrivacyPolicy: $sanJson['privacy_policy'];
$view->optin_San_logoUrl = empty($sanJson['logolink']) ? $recoveryLogoUrl : $sanJson['logolink'];
$view->optin_San_adv = empty($sanJson['optin']) ? $recoveryTextOptin : $sanJson['optin'];
$view->optin_San_privpol = empty($sanJsonPrivPol['optin'])? $recoveryTextPrivacyPolicy: $sanJsonPrivPol['optin'];

$view->accountHolder_San = $getFormUrl['ACCOUNT_HOLDER'];
$view->checkOptin_San = strtoupper($dobSan['CUSTOMER_OPTIN']);
$view->checkPrivacyPolicy_San = strtoupper($dobSan['CUSTOMER_ACCEPT_PRIVACY_POLICY']);

$view->logoLink_San = isset($sanJson['santander_iv_logo_link']) ? $sanJson['santander_iv_logo_link'] : $sanJson['santander_iv_img_link'];

}


Expand Down Expand Up @@ -2276,6 +2294,25 @@ public function onPostDispatch(Enlight_Event_EventArgs $args){
}
}

// Case for PayPal registration
if(
($request->getControllerName() == 'checkout' && $action == 'saveShippingPayment') ||
($request->getControllerName() == 'account' && $action == 'savePayment')
){
$user = Shopware()->Modules()->Admin()->sGetUserData();

if(
($user['additional']['payment']['name'] == "hgw_pay") &&
(($config->HGW_VA_BOOKING_MODE == '3') || ($config->HGW_VA_BOOKING_MODE == '4'))
) {
$user = Shopware()->Modules()->Admin()->sGetUserData();
$postData = $request->getPost();
if (!empty($postData['heidelFormUrlPayPal'])){
return $args->getSubject()->redirect($postData['heidelFormUrlPayPal']);
}
}
}

// Case for Santander to save Values to DB to use them in Request on gatewayAction()
if(
($request->getControllerName() == 'checkout' && $action == 'saveShippingPayment') ||
Expand Down Expand Up @@ -2496,16 +2533,6 @@ public function onPostDispatch(Enlight_Event_EventArgs $args){
$view->extendsTemplate('register/hp_checkout_confirmreg.tpl');
break;
}
// if(
// ($user['additional']['payment']['name'] == 'hgw_mpa')
//// ||
//// ($user['additional']['payment']['name'] == 'hgw_cc') ||
//// ($user['additional']['payment']['name'] == 'hgw_dc') ||
//// ($user['additional']['payment']['name'] == 'hgw_dd')
//
// ){ // or every other wallet
// $view->extendsTemplate('register/hp_checkout_confirm.tpl');
// }
}

if($_SESSION['Shopware']['HPWallet'] == '1'){
Expand Down Expand Up @@ -3562,7 +3589,9 @@ public function ppd_config($bookingMode, $pm, $uid = NULL, $gateway = NULL, $isa
if($pm == 'hpr' || $pm == 'hps') {$pm = 'HP';}
$ppd_config['PAYMENT.METHOD'] = $pm;
$ppd_config['SHOP.TYPE'] = 'Shopware - '. Shopware()->Config()->Version;
$ppd_config['CRITERION.SHOP.TYPE'] = 'Shopware - '. Shopware()->Config()->Version;
$ppd_config['SHOPMODULE.VERSION'] = $this->moduleType ." ". $this->getVersion();
$ppd_config['CRITERION.SHOPMODULE.VERSION'] = $this->moduleType ." ". $this->getVersion();

return $ppd_config;

Expand Down Expand Up @@ -3938,7 +3967,6 @@ public function getRegData($userId, $activePayment = NULL){
*/
public function doRequest($params = array(), $url = NULL){
try{

if($url == NULL){ $url = self::$requestUrl; }
$client = new Zend_Http_Client($url, array(
'useragent' => 'Shopware/' . Shopware()->Config()->Version,
Expand Down Expand Up @@ -5093,13 +5121,12 @@ public function saveRes($data){
try {
Shopware()->Db()->query($sql, $params);
} catch (Exception $e) {
// if entry is in db yet do not write again
// if entry is in db yet do not write again
if($e->getPrevious()->errorInfo['1'] != '1062'){
Shopware()->Plugins()->Frontend()->HeidelGateway()->Logging('saveRes | '.$e->getMessage());
}
return;
}

}

/**
Expand Down
Loading

0 comments on commit c6598aa

Please sign in to comment.