PageRenderTime 54ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 1ms

/www/shop/engine/Shopware/Plugins/Default/Frontend/HeidelPayment/Bootstrap.php

https://bitbucket.org/weberlars/sot-shopware
PHP | 525 lines | 395 code | 59 blank | 71 comment | 17 complexity | c78bb20e7e5efe550174da696d695d34 MD5 | raw file
Possible License(s): AGPL-3.0, MIT, BSD-3-Clause, LGPL-2.1, LGPL-3.0
  1. <?php
  2. /**
  3. * Heidelpay
  4. *
  5. * @link http://www.heidelpay.de
  6. * @copyright Copyright (c) 2011, Heidelberger Payment AG
  7. * @author Jens Richter
  8. * @package Shopware
  9. * @subpackage Plugins
  10. */
  11. class Shopware_Plugins_Frontend_HeidelPayment_Bootstrap extends Shopware_Components_Plugin_Bootstrap
  12. {
  13. private static $_moduleDesc = 'HeidelPayment';
  14. var $version = "12.08" ;
  15. var $modulType = "Standard" ;
  16. public function getInfo() {
  17. $img = base64_encode(file_get_contents(dirname(__FILE__) . '/img/heidelpay.png'));
  18. return array(
  19. 'version' => $this->version ,
  20. 'autor' => 'Heidelberger Payment GmbH',
  21. 'label' => "Heidelpay Payment ".$this->modulType ,
  22. 'source' => "Default",
  23. 'description' => '<p><img src="data:image/png;base64,' . $img . '" /></p> <p style="font-size:12px; font-weight: bold;">Heidelberger Payment GmbH - Ihr Full Service Payment Provider - alles aus einer Hand <p></p> <p style="font-size:12px">Die Heidelberger Payment GmbH kurz: heidelpay bietet als BaFin-zertifizierter Payment Service Provider alles was zum Online-Payment geh&ouml;rt.<br><br><a href="http://testshops.heidelpay.de/contactform/?campaign=shopware4.0&shop=shopware4.0" target="_blank" style="font-size: 12px; color: #000; font-weight: bold;">&gt;&gt;&gt; Informationen anfordern &lt;&lt;&lt;</a><br/><p><br /> <p style="font-size:12px">Das Leistungsspektrum des PCI DSS zertifizierten Unternehmens reicht von weltweiten e-Payment L&ouml;sungen, inklusive eines vollst&auml;ndigen Debitorenmanagement-, Risk- und Fraud- Systems bis hin zu einem breiten Angebot alternativer Bezahlverfahren - schnell, sicher, einfach und umfassend - alles aus einer Hand.</p><br/> <a href="http://www.heidelpay.de" style="font-size: 12px; color: #000; font-weight: bold;">www.heidelpay.de</a><br/> <br/> <p style="font-size: 12px; color: #f00"; font-weight: bold;">Hinweis:</p><p style="font-size:12px">Um unser "Heidelpay Actions Standard" Plug-in nutzen zu k&ouml;nnen, beantragen Sie bitte die Aufschaltung von push Benachrichtigungen bei unserem Technischen Support. Wenden Sie sich hierf&uuml;r bitte per email an technik@heidelpay.de oder Telefon +49 (0) 6221 65170-10 an uns. Bitte notieren Sie sich Sie sich vorher die URL ihres e-Shops plus dem Webpfad zur Heidelpay Action und teilen Sie uns diese dann mit, als Beispiel<br/><br/> <b>https://www.meinshop.de/payment_heidelpay/rawnotify</b></p>',
  24. 'license' => 'commercial',
  25. 'copyright' => 'Copyright ? 2012, Heidelberger Payment GmbH',
  26. 'support' => 'technik@heidelpay.de',
  27. 'link' => 'http://www.heidelpay.de/'
  28. );
  29. }/*}*
  30. /**
  31. * Install plugin method
  32. *
  33. * @return bool
  34. */
  35. public function install()
  36. {
  37. if (!$this->assertVersionGreaterThen("3.5.5")){
  38. throw new Enlight_Exception("This Plugin needs min shopware 3.5.5");
  39. }
  40. $plugins = array("Payment");
  41. if (!$this->assertRequiredPluginsPresent($plugins)){
  42. $this->Logging("This plugin requires the plugin payment","ERROR");
  43. $this->uninstall();
  44. throw new Enlight_Exception("This plugin requires the plugin payment");
  45. }
  46. if (ini_get('always_populate_raw_post_data') == 0) {
  47. $this->Logging("Unable to install plugin due to missing always_populate_raw_post_data.","ERROR");
  48. throw new Enlight_Exception('
  49. DE:<br />
  50. Dieses Plugin benoetig die PHP Einstellung "alwasy_populate_raw_post_data". Bitte setzen Sie diese auf "On". Sollten
  51. Sie weitere Informationen benoetigen, schreiben Sie bitte eine E-Mail an technik@heidelpay.de .
  52. <br/>
  53. <br/>
  54. EN:<br/>
  55. This Plugin needs the php setting "always_populate_raw_post_data". Please switch it to "On".
  56. If you need more information please send an email to technik@heidelpay.de.'
  57. );
  58. };
  59. $this->Logging('Install Heidelpay '.$this->modulType.' Plugin', 'INFO');
  60. $this->createEvents();
  61. $this->Logging(' * register eventhandler', 'INFO');
  62. $this->createPayments();
  63. $this->Logging('* install payments', 'INFO');
  64. // $this->createTable();
  65. $this->createForm();
  66. $this->Logging('* create form', 'INFO');
  67. $this->addsnippets();
  68. return true;
  69. }
  70. protected function createEvents()
  71. {
  72. $event = $this->createEvent(
  73. 'Enlight_Controller_Dispatcher_ControllerPath_Frontend_PaymentHeidelpay',
  74. 'onGetControllerPathFrontend'
  75. );
  76. $this->subscribeEvent($event);
  77. }
  78. /**
  79. * Create and save payments
  80. */
  81. protected function createPayments()
  82. {
  83. $inst = $this->paymentMethod();
  84. foreach ($inst as $key => $val ) {
  85. //$getOldPayments = Shopware()->Payments()->fetchAll(array('name'=>"heidelpay_".$val['name'],));
  86. $getOldPayments = Shopware()->Payments()->fetchRow(array('name=?'=>"heidelpay_".$val['name']));
  87. if (!empty($getOldPayments['id'])) {
  88. $newData = array( "pluginID" => (int)$this->getId() );
  89. $where = array( "id = ".(int)$getOldPayments['id'] );
  90. Shopware()->Payments()->update($newData, $where);
  91. } else {
  92. $paymentRow = Shopware()->Payments()->createRow(array(
  93. 'name' => "heidelpay_".$val['name'],
  94. 'description' => "Heidelpay ".$val['description'],
  95. 'action' => 'payment_heidelpay',
  96. 'active' => 0,
  97. 'pluginID' => $this->getId(),
  98. 'position' => "1".$key
  99. ))->save();
  100. }
  101. };
  102. }
  103. /**
  104. * Create payment table
  105. */
  106. protected function createTable()
  107. {
  108. }
  109. /**
  110. * Create payment config form
  111. */
  112. protected function createForm()
  113. {
  114. $form = $this->Form();
  115. $form->setElement('text', 'HEIDELPAY_LIVE_URL', array('label'=>'LIVE_URL','value'=>'https://heidelpay.hpcgw.net/sgw/gtwu', 'scope'=>Shopware_Components_Form::SCOPE_SHOP));
  116. $form->setElement('text', 'HEIDELPAY_TEST_URL', array('label'=>'TEST_URL','value'=>'https://test-heidelpay.hpcgw.net/sgw/gtwu', 'scope'=>Shopware_Components_Form::SCOPE_SHOP));
  117. $form->setElement('text', 'HEIDELPAY_SECURITY_SENDER', array('label'=>'SECURITY_SENDER','value'=>'31HA07BC8124AD82A9E96D9A35FAFD2A', 'scope'=>Shopware_Components_Form::SCOPE_SHOP));
  118. $form->setElement('text', 'HEIDELPAY_USER_LOGIN', array('label'=>'USER_LOGIN','value'=>'31ha07bc8124ad82a9e96d486d19edaa', 'scope'=>Shopware_Components_Form::SCOPE_SHOP));
  119. $form->setElement('text', 'HEIDELPAY_USER_PW', array('label'=>'USER_PW','value'=>'password', 'scope'=>Shopware_Components_Form::SCOPE_SHOP));
  120. $form->setElement('combo', 'HEIDELPAY_TRANSACTION_MODE', array('label'=>'TRANSACTION_MODE','value'=>'CONNECTOR_TEST','attributes'=>array(
  121. 'valueField'=>'myId','displayField'=>'displayText',
  122. 'mode' => 'local',
  123. 'triggerAction' => 'all',
  124. 'store' => 'new Ext.data.ArrayStore({
  125. id: 0,
  126. fields: [
  127. "myId",
  128. "displayText"
  129. ],
  130. data: [[1, "INTEGRATOR_TEST"], [2, "CONNECTOR_TEST"], [3, "LIVE"]]
  131. })
  132. '
  133. ), 'scope'=>Shopware_Components_Form::SCOPE_SHOP));
  134. //$form->setElement('', 'Channel', array('label'=>'Channel','value'=>''));
  135. $form->setElement('text', 'HEIDELPAY_CC_CHANNEL', array('label'=> 'Kreditkarten Channel','value'=>'31HA07BC81A71E2A47DA94B6ADC524D8', 'scope'=>Shopware_Components_Form::SCOPE_SHOP));
  136. $form->setElement('text', 'HEIDELPAY_DC_CHANNEL', array('label'=>'Debitkarten Channel','value'=>'31HA07BC81A71E2A47DA94B6ADC524D8', 'scope'=>Shopware_Components_Form::SCOPE_SHOP));
  137. $form->setElement('text', 'HEIDELPAY_DD_CHANNEL', array('label'=>'Lastschrift Channel','value'=>'31HA07BC81A71E2A47DA94B6ADC524D8', 'scope'=>Shopware_Components_Form::SCOPE_SHOP));
  138. $form->setElement('text', 'HEIDELPAY_PP_CHANNEL', array('label'=>'Vorkasse Channel','value'=>'31HA07BC81A71E2A47DA94B6ADC524D8', 'scope'=>Shopware_Components_Form::SCOPE_SHOP));
  139. $form->setElement('text', 'HEIDELPAY_IV_CHANNEL', array('label'=>'Rechnungs Channel','value'=>'31HA07BC81A71E2A47DA94B6ADC524D8', 'scope'=>Shopware_Components_Form::SCOPE_SHOP));
  140. $form->setElement('text', 'HEIDELPAY_SUE_CHANNEL', array('label'=>'Sofort?berweisungs Channel','value'=>'31HA07BC81A71E2A47DA94B6ADC524D8', 'scope'=>Shopware_Components_Form::SCOPE_SHOP));
  141. $form->setElement('text', 'HEIDELPAY_GIR_CHANNEL', array('label'=>'Giropay Channel','value'=>'31HA07BC81A71E2A47DA662C5EDD1112', 'scope'=>Shopware_Components_Form::SCOPE_SHOP));
  142. $form->setElement('text', 'HEIDELPAY_PAY_CHANNEL', array('label'=>'PayPal Channel','value'=>'31HA07BC81A71E2A47DA94B6ADC524D8', 'scope'=>Shopware_Components_Form::SCOPE_SHOP));
  143. $form->setElement('text', 'HEIDELPAY_IDE_CHANNEL', array('label'=>'Ideal Channel','value'=>'31HA07BC81A71E2A47DA804F6CABDC59', 'scope'=>Shopware_Components_Form::SCOPE_SHOP));
  144. $form->setElement('text', 'HEIDELPAY_EPS_CHANNEL', array('label'=>'EPS Channel','value'=>'31HA07BC812125981B4F52033DE486AB', 'scope'=>Shopware_Components_Form::SCOPE_SHOP));
  145. $form->setElement('combo', 'HEIDELPAY_CC_BOOKING_MODE', array('label'=>'Kreditkarten Buchungsmodus','value'=>'Sofortbuchung','attributes'=>array(
  146. 'valueField'=>'myId','displayField'=>'displayText',
  147. 'mode' => 'local',
  148. 'triggerAction' => 'all',
  149. 'store' => 'new Ext.data.ArrayStore({
  150. id: 0,
  151. fields: [
  152. "myId",
  153. "displayText"
  154. ],
  155. data: [[1, "Sofortbuchung"], [2, "Reservierung"]]
  156. })
  157. '
  158. ), 'scope'=>Shopware_Components_Form::SCOPE_SHOP));
  159. $form->setElement('combo', 'HEIDELPAY_DC_BOOKING_MODE', array('label'=>'Debitkarten Buchungsmodus','value'=>'Sofortbuchung','attributes'=>array(
  160. 'valueField'=>'myId','displayField'=>'displayText',
  161. 'mode' => 'local',
  162. 'triggerAction' => 'all',
  163. 'store' => 'new Ext.data.ArrayStore({
  164. id: 0,
  165. fields: [
  166. "myId",
  167. "displayText"
  168. ],
  169. data: [[1, "Sofortbuchung"], [2, "Reservierung"]]
  170. })
  171. '
  172. ), 'scope'=>Shopware_Components_Form::SCOPE_SHOP));
  173. $form->setElement('combo', 'HEIDELPAY_DD_BOOKING_MODE', array('label'=>'Lastschrift Buchungsmodus','value'=>'Sofortbuchung','attributes'=>array(
  174. 'valueField'=>'myId','displayField'=>'displayText',
  175. 'mode' => 'local',
  176. 'triggerAction' => 'all',
  177. 'store' => 'new Ext.data.ArrayStore({
  178. id: 0,
  179. fields: [
  180. "myId",
  181. "displayText"
  182. ],
  183. data: [[1, "Sofortbuchung"], [2, "Reservierung"]]
  184. })
  185. '
  186. ), 'scope'=>Shopware_Components_Form::SCOPE_SHOP));
  187. // $form->setElement('combo', 'HEIDELPAY_CANCEL_ORDER', array('label'=>'Warenkorb bei Abbruch in Bestellung umwandeln','value'=>'1','attributes'=>array(
  188. //'valueField'=>'myId','displayField'=>'displayText',
  189. //'mode' => 'local',
  190. //'triggerAction' => 'all',
  191. //'store' => '
  192. //new Ext.data.ArrayStore({
  193. //id: 0,
  194. //fields: [
  195. // "myId",
  196. // "displayText"
  197. //],
  198. //data: [[1, "Nein"], [2, "Ja"]]
  199. //})
  200. //'
  201. //)));
  202. // $form->setElement('combo', 'HEIDELPAY_FAIL_ORDER', array('label'=>'Warenkorb bei Fehler in Bestellung umwandeln','value'=>'1','attributes'=>array(
  203. //'valueField'=>'myId','displayField'=>'displayText',
  204. //'mode' => 'local',
  205. //'triggerAction' => 'all',
  206. //'store' => '
  207. //new Ext.data.ArrayStore({
  208. //id: 0,
  209. //fields: [
  210. // "myId",
  211. // "displayText"
  212. //],
  213. //data: [[1, "Nein"], [2, "Ja"]]
  214. //})
  215. //'
  216. //)));
  217. $form->setElement('combo', 'HEIDELPAY_DEBUG', array('label'=>'DEBUG MODE','value'=>'Nein','attributes'=>array(
  218. 'valueField'=>'myId','displayField'=>'displayText',
  219. 'mode' => 'local',
  220. 'triggerAction' => 'all',
  221. 'store' => 'new Ext.data.ArrayStore({
  222. id: 0,
  223. fields: [
  224. "myId",
  225. "displayText"
  226. ],
  227. data: [[1, "Nein"], [2, "Ja"]]
  228. })
  229. '
  230. ), 'scope'=>Shopware_Components_Form::SCOPE_SHOP));
  231. $secret= strtoupper(sha1(mt_rand(10000, mt_getrandmax())));
  232. $form->setElement('text', 'HEIDELPAY_SECRET', array('label'=>'SECRET','value'=>''.$secret.'', 'scope'=>Shopware_Components_Form::SCOPE_SHOP));
  233. $form->setElement('text', 'HEIDELPAY_ERRORMAIL', array('label'=>'Error E-Mail Adresse','value'=>'', 'scope'=>Shopware_Components_Form::SCOPE_SHOP));
  234. $form->setElement('text', 'HEIDELPAY_NOTIFY_IP', array('label'=>'IP der Heidelpay Notify Server','value'=>'217.68.2.209,217.7.205.227', 'scope'=>Shopware_Components_Form::SCOPE_SHOP));
  235. $form->save();
  236. }
  237. /**
  238. * Uninstall plugin method
  239. *
  240. * @return bool
  241. */
  242. public function uninstall()
  243. {
  244. //Shopware()->Payments()->update(array("active"=>0), array("pluginID=?"=>$this->getId()));
  245. $newData = array("active" => 0 );
  246. $where = array("pluginID = ".(int)$this->getId());
  247. Shopware()->Payments()->update($newData, $where);
  248. $this->Logging('uninstall Heidelpay '.$this->modulType.' Modul', 'INFO');
  249. return true;
  250. }/*}*/
  251. public static function onGetControllerPathFrontend(Enlight_Event_EventArgs $args)
  252. {
  253. Shopware()->Template()->addTemplateDir(dirname(__FILE__).'/Views/');
  254. return dirname(__FILE__).'/Controllers/Frontend/PaymentHeidelpay.php';
  255. }
  256. public static function onPostDispatch(Enlight_Event_EventArgs $args)
  257. {
  258. $request = $args->getSubject()->Request();
  259. $response = $args->getSubject()->Response();
  260. $view = $args->getSubject()->View();
  261. if(!$request->isDispatched()
  262. || $response->isException()
  263. || $request->getModuleName()!='frontend') {
  264. return;
  265. }
  266. $view->addTemplateDir(dirname(__FILE__).'/Views/');
  267. }
  268. /*
  269. * function for loggin information
  270. * posible log levels are: DEBUG , INFO , WARN , ERROR
  271. */
  272. public function Logging($message, $level = "ERROR" ) {
  273. $path = "files/log/heidelpay.log";
  274. $dir = dirname($path);
  275. if (!file_exists($dir)) {
  276. mkdir($dir);
  277. }
  278. $MessageDate = date("M j Y H:i:s");
  279. $Message= $MessageDate." ".$_SERVER['SERVER_NAME']." : ".self::$_moduleDesc." (".$level.") : ".$message ;
  280. $file = fopen ($path, "a+");
  281. if ($file) {
  282. fwrite($file, $Message."\n");
  283. fclose($file);
  284. }
  285. /*
  286. * Send error mail if mail addresse set
  287. */
  288. if (!empty($this->Config()->HEIDELPAY_ERRORMAIL)) {
  289. if ( $level == "ERROR") mail($this->Config()->HEIDELPAY_ERRORMAIL , 'Shopware Heidelpay Plugin error', self::$_moduleDesc." (".$level.") : ".$message );
  290. }
  291. } /*}*/
  292. public function paymentMethod()
  293. {
  294. $inst = array();
  295. $inst[] = array(
  296. 'name' => 'cc',
  297. 'description' => 'Kreditkarte',
  298. );
  299. $inst[] = array(
  300. 'name' => 'dc',
  301. 'description' => 'Debitkarte',
  302. );
  303. $inst[] = array(
  304. 'name' => 'dd',
  305. 'description' => 'Lastschrift',
  306. );
  307. $inst[] = array(
  308. 'name' => 'iv',
  309. 'description' => 'Rechnung',
  310. );
  311. $inst[] = array(
  312. 'name' => 'pp',
  313. 'description' => 'Vorkasse',
  314. );
  315. $inst[] = array(
  316. 'name' => 'sue',
  317. 'description' => 'Sofort?berweisung',
  318. );
  319. $inst[] = array(
  320. 'name' => 'gir',
  321. 'description' => 'Giropay',
  322. );
  323. $inst[] = array(
  324. 'name' => 'pay',
  325. 'description' => 'PayPal',
  326. );
  327. $inst[] = array(
  328. 'name' => 'ide',
  329. 'description' => 'Ideal',
  330. );
  331. $inst[] = array(
  332. 'name' => 'eps',
  333. 'description' => 'EPS',
  334. );
  335. return $inst ;
  336. }
  337. public function addsnippets()
  338. {
  339. $snippets = $this->snippets();
  340. foreach ($snippets as $key => $value) {
  341. if (!empty($value[0])) {
  342. $sql = " SELECT id FROM s_core_snippets WHERE namespace = \"".$value[0]."\" AND shopID = 1 AND localeID = ".$value[1]." AND name = \"".$value[2]."\"" ;
  343. $data = Shopware()->Db()->fetchAll($sql);
  344. $sql = "";
  345. if ($data[0][id] > 0)
  346. {
  347. $sql = "UPDATE s_core_snippets SET namespace = \"".$value[0]."\",
  348. shopID = 1,
  349. localeID = ".$value[1].",
  350. name = \"".$value[2]."\",
  351. value = \"".$value[3]."\"
  352. WHERE id=".$data[0]['id']." ";
  353. } else {
  354. $sql = "INSERT s_core_snippets SET namespace = \"".$value[0]."\",
  355. shopID = 1,
  356. localeID = ".$value[1].",
  357. name = \"".$value[2]."\",
  358. value = \"".$value[3]."\"
  359. ";
  360. }
  361. Shopware()->Db()->query($sql);
  362. }
  363. }
  364. return true ;
  365. }
  366. private function snippets()
  367. {
  368. $snippets = array();
  369. $snippets[] = array('frontend/payment_heidelpay/prepayment','1','OrderOverview','Weiter zur Bestell&uuml;bersicht');
  370. $snippets[] = array('frontend/payment_heidelpay/prepayment','2','OrderOverview','go to order summary');
  371. $snippets[] = array('frontend/payment_heidelpay/gateway','1','PaymentHeader','Bitte f&uuml;hren Sie nun die Zahlung durch:');
  372. $snippets[] = array('frontend/payment_heidelpay/gateway','2','PaymentHeader','Please confirm your payment:');
  373. $snippets[] = array('frontend/payment_heidelpay/gateway','1','PaymentInfoWait','Bitte warten...');
  374. $snippets[] = array('frontend/payment_heidelpay/gateway','2','PaymentInfoWait','Please wait ..');
  375. $snippets[] = array('frontend/payment_heidelpay/prepayment','1','PaymentSuccess','Ihr Bezahlvorgang war erfolgreich!');
  376. $snippets[] = array('frontend/payment_heidelpay/prepayment','2','PaymentSuccess','Your transaction was successfull!');
  377. $snippets[] = array('frontend/payment_heidelpay/fail','1','PaymentProcess','Bezahlvorgang');
  378. $snippets[] = array('frontend/payment_heidelpay/fail','2','PaymentProcess','Payment process');
  379. $snippets[] = array('frontend/payment_heidelpay/fail','1','basket','Zur&uuml;ck zum Warenkorb');
  380. $snippets[] = array('frontend/payment_heidelpay/fail','2','basket','back to basket');
  381. $snippets[] = array('frontend/payment_heidelpay/prepayment','1','PaymentProcess','Bezahlvorgang');
  382. $snippets[] = array('frontend/payment_heidelpay/prepayment','2','PaymentProcess','Payment process');
  383. $snippets[] = array('frontend/payment_heidelpay/error','1','basket','Zur&uuml;ck zum Warenkorb');
  384. $snippets[] = array('frontend/payment_heidelpay/error','2','basket','back to basket');
  385. $snippets[] = array('frontend/payment_heidelpay/fail','1','PaymentFailed','Ihr Bezahlvorgang konnte aus folgenden Grund nicht bearbeitet werden:');
  386. $snippets[] = array('frontend/payment_heidelpay/fail','2','PaymentFailed','Your payment process could not be finished, because of the following reason:');
  387. $snippets[] = array('frontend/payment_heidelpay/cancel','1','PaymentProcess','Bezahlvorgang');
  388. $snippets[] = array('frontend/payment_heidelpay/cancel','2','PaymentProcess','Payment process');
  389. $snippets[] = array('frontend/payment_heidelpay/cancel','1','PaymentCancel','Der Bezahlvorgang wurde von Ihnen abgebrochen.');
  390. $snippets[] = array('frontend/payment_heidelpay/cancel','2','PaymentCancel','The payment process was canceled by you.');
  391. $snippets[] = array('frontend/payment_heidelpay/cancel','1','basket','Zur&uuml;ck zum Warenkorb');
  392. $snippets[] = array('frontend/payment_heidelpay/cancel','2','basket','back to basket');
  393. $snippets[] = array('frontend/payment_heidelpay/error','1','PaymentProcess','Bezahlvorgang');
  394. $snippets[] = array('frontend/payment_heidelpay/error','2','PaymentProcess','Payment process');
  395. $snippets[] = array('frontend/payment_heidelpay/error','1','PaymentError','Es ist ein Fehler bei Ihrem Bezahlvorgang aufgetreten. Bitte wenden Sie sich an den Shopbetreiber.');
  396. $snippets[] = array('frontend/payment_heidelpay/error','2','PaymentError','An error occurred during your payment process. Please contact the shop owner.');
  397. $snippets[] = array('frontend/payment_heidelpay/success','1','PaymentSuccess','Ihr Bezahlvorgang war erfolgreich!');
  398. $snippets[] = array('frontend/payment_heidelpay/success','2','PaymentSuccess','Your transaction was successfull!');
  399. $snippets[] = array('frontend/payment_heidelpay/success','1','PaymentProcess','Bezahlvorgang');
  400. $snippets[] = array('frontend/payment_heidelpay/success','2','PaymentProcess','Payment process');
  401. $snippets[] = array('frontend/payment_heidelpay/success','1','PrepaymentText','Bitte ?berweisen Sie uns den Betrag von {AMOUNT} {CURRENCY} auf folgendes Konto:'."\n"
  402. .'Land: {CONNECTOR_ACCOUNT_COUNTRY}'."\n"
  403. .'Kontoinhaber: {CONNECTOR_ACCOUNT_HOLDER}'."\n"
  404. .'Konto-Nr.: {CONNECTOR_ACCOUNT_NUMBER}'."\n"
  405. .'Bankleitzahl: {CONNECTOR_ACCOUNT_BANK}'."\n"
  406. .'IBAN: {CONNECTOR_ACCOUNT_IBAN}'."\n"
  407. .'BIC: {CONNECTOR_ACCOUNT_BIC}'."\n"
  408. .'Geben sie bitte im Verwendungszweck UNBEDINGT die Identifikationsnummer'."\n"
  409. .'{IDENTIFICATION_SHORTID}'."\n"
  410. .'und NICHTS ANDERES an.');
  411. $snippets[] = array('frontend/payment_heidelpay/success','2','PrepaymentText','Please transfer the amount of {AMOUNT} {CURRENCY} to the following account:'."\n"
  412. .'Country: {CONNECTOR_ACCOUNT_COUNTRY}'."\n"
  413. .'Account holder: {CONNECTOR_ACCOUNT_HOLDER}'."\n"
  414. .'Account No.: {CONNECTOR_ACCOUNT_NUMBER}'."\n"
  415. .'Bank Code: {CONNECTOR_ACCOUNT_BANK}'."\n"
  416. .'IBAN: {CONNECTOR_ACCOUNT_IBAN}'."\n"
  417. .'BIC: {CONNECTOR_ACCOUNT_BIC}'."\n"
  418. .'When you transfer the money you HAVE TO use the identification number'."\n"
  419. .'{IDENTIFICATION_SHORTID}'."\n"
  420. .'as the descriptor and nothing else. Otherwise we cannot match your transaction!');
  421. $snippets[] = array('frontend/payment_heidelpay/success','1','InvoiceHeader','Rechnungsinformation');
  422. $snippets[] = array('frontend/payment_heidelpay/success','2','InvoiceHeader','Invoiceinformation');
  423. return $snippets ;
  424. }
  425. public function checkTable($table)/*{{{*/
  426. {
  427. $sql = 'SHOW TABLES LIKE "'.$table.'"';
  428. #echo $sql;
  429. $exists = Shopware()->Db()->fetchAll($sql);
  430. return $exists;
  431. }/*}}}*/
  432. public function createSenderTable($table)/*{{{*/
  433. {
  434. $sql = 'CREATE TABLE IF NOT EXISTS `'.$table.'` (
  435. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  436. `meth` char(2) NOT NULL,
  437. `typ` char(2) NOT NULL,
  438. `IDENTIFICATION_UNIQUEID` varchar(32) NOT NULL,
  439. `IDENTIFICATION_SHORTID` varchar(14) NOT NULL,
  440. `IDENTIFICATION_TRANSACTIONID` varchar(255) NOT NULL,
  441. `IDENTIFICATION_REFERENCEID` varchar(32) NOT NULL,
  442. `PROCESSING_RESULT` varchar(20) NOT NULL,
  443. `PROCESSING_RETURN_CODE` varchar(11) NOT NULL,
  444. `PROCESSING_CODE` varchar(11) NOT NULL,
  445. `TRANSACTION_SOURCE` varchar(10) NOT NULL,
  446. `TRANSACTION_CHANNEL` varchar(32) NOT NULL,
  447. `TRANSACTION_RESPONSE` varchar(5) NOT NULL,
  448. `TRANSACTION_MODE` varchar(15) NOT NULL,
  449. `CRITERION_RESPONSE_URL` varchar(255) NOT NULL,
  450. `created` datetime NOT NULL,
  451. `SERIAL` mediumtext NOT NULL,
  452. `XML` mediumtext NOT NULL,
  453. `RESPONSE` mediumtext NOT NULL,
  454. `CAPTURED` int(1) NOT NULL,
  455. PRIMARY KEY (`id`),
  456. KEY `typ` (`typ`),
  457. KEY `meth` (`meth`),
  458. KEY `IDENTIFICATION_UNIQUEID` (`IDENTIFICATION_UNIQUEID`),
  459. KEY `IDENTIFICATION_SHORTID` (`IDENTIFICATION_SHORTID`),
  460. KEY `IDENTIFICATION_TRANSACTIONID` (`IDENTIFICATION_TRANSACTIONID`),
  461. KEY `IDENTIFICATION_REFERENCEID` (`IDENTIFICATION_REFERENCEID`)
  462. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;';
  463. return Shopware()->Db()->query($sql);
  464. }/*}}}*/
  465. }