shopgate_module - Version 2.9.18

Version Notes

Shopgate Modul

Download this release

Release Info

Developer Stephan Recknagel
Extension shopgate_module
Version 2.9.18
Comparing to
See all releases


Code changes from version 2.9.17 to 2.9.18

Files changed (59) hide show
  1. app/code/community/Shopgate/Framework/Block/Payment/MobilePayment.php +32 -1
  2. app/code/community/Shopgate/Framework/Helper/Config.php +23 -4
  3. app/code/community/Shopgate/Framework/Helper/Data.php +58 -9
  4. app/code/community/Shopgate/Framework/Helper/Payment/Payone.php +66 -0
  5. app/code/community/Shopgate/Framework/Model/Export/Settings.php +2 -2
  6. app/code/community/Shopgate/Framework/Model/Observer.php +37 -0
  7. app/code/community/Shopgate/Framework/Model/Payment/Abstract.php +356 -12
  8. app/code/community/Shopgate/Framework/Model/Payment/Amazon.php +15 -134
  9. app/code/community/Shopgate/Framework/Model/Payment/Authorize.php +8 -180
  10. app/code/community/Shopgate/Framework/Model/Payment/Billsafe.php +13 -61
  11. app/code/community/Shopgate/Framework/Model/Payment/Cc.php +50 -0
  12. app/code/community/Shopgate/Framework/Model/Payment/Cc/Abstract.php +96 -0
  13. app/code/community/Shopgate/Framework/Model/Payment/Cc/Authn.php +180 -0
  14. app/code/community/Shopgate/Framework/Model/Payment/Cc/AuthnAbstract.php +54 -0
  15. app/code/community/Shopgate/Framework/Model/Payment/Cc/Authncim.php +381 -0
  16. app/code/community/Shopgate/Framework/Model/Payment/Cc/Authncim/Gateway.php +107 -0
  17. app/code/community/Shopgate/Framework/Model/Payment/Cc/Authncim/Method.php +54 -0
  18. app/code/community/Shopgate/Framework/Model/Payment/Cc/Usaepay.php +125 -0
  19. app/code/community/Shopgate/Framework/Model/Payment/Express.php +11 -152
  20. app/code/community/Shopgate/Framework/Model/Payment/Factory.php +201 -0
  21. app/code/community/Shopgate/Framework/Model/Payment/Interface.php +90 -0
  22. app/code/community/Shopgate/Framework/Model/Payment/MobilePayment.php +2 -2
  23. app/code/community/Shopgate/Framework/Model/Payment/Payone/Abstract.php +528 -0
  24. app/code/community/Shopgate/Framework/Model/Payment/Payone/BankAbstract.php +51 -0
  25. app/code/community/Shopgate/Framework/Model/Payment/Payone/Cc.php +80 -0
  26. app/code/community/Shopgate/Framework/Model/Payment/Payone/Dbt.php +38 -0
  27. app/code/community/Shopgate/Framework/Model/Payment/Payone/Gp.php +44 -0
  28. app/code/community/Shopgate/Framework/Model/Payment/Payone/Idl.php +42 -0
  29. app/code/community/Shopgate/Framework/Model/Payment/Payone/Inv.php +119 -0
  30. app/code/community/Shopgate/Framework/Model/Payment/Payone/Klv.php +39 -0
  31. app/code/community/Shopgate/Framework/Model/Payment/Payone/Pp.php +46 -0
  32. app/code/community/Shopgate/Framework/Model/Payment/Payone/Prp.php +118 -0
  33. app/code/community/Shopgate/Framework/Model/Payment/Payone/Sue.php +44 -0
  34. app/code/community/Shopgate/Framework/Model/Payment/Pp.php +33 -0
  35. app/code/community/Shopgate/Framework/Model/Payment/Pp/Abstract.php +111 -0
  36. app/code/community/Shopgate/Framework/Model/Payment/Pp/Paypal.php +251 -0
  37. app/code/community/Shopgate/Framework/Model/Payment/Pp/Wspp.php +232 -0
  38. app/code/community/Shopgate/Framework/Model/Payment/Router.php +183 -0
  39. app/code/community/Shopgate/Framework/Model/Payment/Simple.php +39 -0
  40. app/code/community/Shopgate/Framework/Model/Payment/Simple/Billsafe.php +86 -0
  41. app/code/community/Shopgate/Framework/Model/Payment/Simple/Mws.php +234 -0
  42. app/code/community/Shopgate/Framework/Model/Payment/Simple/Paypal.php +31 -0
  43. app/code/community/Shopgate/Framework/Model/Payment/Simple/Sue.php +51 -0
  44. app/code/community/Shopgate/Framework/Model/Payment/Simple/Sue/Abstract.php +85 -0
  45. app/code/community/Shopgate/Framework/Model/Payment/Simple/Sue/Sue118.php +37 -0
  46. app/code/community/Shopgate/Framework/Model/Payment/Simple/Sue/Sue300.php +38 -0
  47. app/code/community/Shopgate/Framework/Model/Payment/Usaepay.php +8 -95
  48. app/code/community/Shopgate/Framework/Model/Payment/Wspp.php +28 -156
  49. app/code/community/Shopgate/Framework/Model/Shopgate/Plugin.php +110 -174
  50. app/code/community/Shopgate/Framework/changelog.txt +13 -887
  51. app/code/community/Shopgate/Framework/etc/config.xml +15 -5
  52. app/design/adminhtml/default/default/template/shopgate/payment/mobile_payment.phtml +15 -27
  53. lib/Shopgate/changelog.txt +12 -0
  54. lib/Shopgate/classes/core.php +1 -1
  55. lib/Shopgate/classes/models/XmlEmptyObject.php +45 -0
  56. lib/Shopgate/classes/models/catalog/Product.php +9 -7
  57. lib/Shopgate/classes/orders.php +4 -0
  58. lib/Shopgate/shopgate.php +1 -0
  59. package.xml +4 -4
app/code/community/Shopgate/Framework/Block/Payment/MobilePayment.php CHANGED
@@ -18,7 +18,7 @@
18
  * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
  * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
  *
21
- * @author Shopgate GmbH <interfaces@shopgate.com>
22
  */
23
 
24
  /**
@@ -96,4 +96,35 @@ class Shopgate_Framework_Block_Payment_MobilePayment extends Mage_Payment_Block_
96
 
97
  return $isDifferent;
98
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  }
18
  * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
  * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
  *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
  */
23
 
24
  /**
96
 
97
  return $isDifferent;
98
  }
99
+
100
+ /**
101
+ * Helper function to print PaymentInfo
102
+ * recursively
103
+ *
104
+ * @param $list
105
+ * @param $html - don't pass anything, recrusive helper
106
+ * @return string
107
+ */
108
+ public function printPaymentInfo($list = null, $html = '')
109
+ {
110
+ if (empty($list)) {
111
+ $list = $this->getPaymentInfos();
112
+ }
113
+
114
+ if (is_array($list)) {
115
+ foreach ($list as $_key => $_value) {
116
+ if (is_array($_value)) {
117
+ return $this->printPaymentInfo($_value, $html);
118
+ } else {
119
+ $html .= '<span style="font-weight: bold">'
120
+ . $this->__(uc_words($_key, ' ') . "</span> : "
121
+ . uc_words($_value, ' ') . "<br />");
122
+ }
123
+ }
124
+ } else {
125
+ $html .= $this->__($this->escapeHtml($list)) . "<br />";
126
+ }
127
+
128
+ return $html;
129
+ }
130
  }
app/code/community/Shopgate/Framework/Helper/Config.php CHANGED
@@ -42,10 +42,16 @@ class Shopgate_Framework_Helper_Config extends Mage_Core_Helper_Abstract
42
  const COMMUNITY_EDITION = 'Community';
43
 
44
  /**
45
- * const for community
46
  */
47
  const ENTERPRISE_EDITION = 'Enterprise';
48
 
 
 
 
 
 
 
49
  /**
50
  * @var string
51
  */
@@ -66,6 +72,7 @@ class Shopgate_Framework_Helper_Config extends Mage_Core_Helper_Abstract
66
  */
67
  public function __construct()
68
  {
 
69
  $this->_magentoVersion15 = ($this->getEdition() == 'Enterprise') ? '1.9.1.0' : '1.5';
70
  $this->_magentoVersion1410 = ($this->getEdition() == 'Enterprise') ? '1.9.0.0' : '1.4.1.0';
71
  }
@@ -92,7 +99,7 @@ class Shopgate_Framework_Helper_Config extends Mage_Core_Helper_Abstract
92
  }
93
 
94
  /**
95
- * Checks if current magento ver. is lower than param
96
  *
97
  * @param string $version - magento version e.g "1.9.1.1"
98
  * @return bool
@@ -103,7 +110,17 @@ class Shopgate_Framework_Helper_Config extends Mage_Core_Helper_Abstract
103
  }
104
 
105
  /**
106
- * compare version if it is lower than 1.5
 
 
 
 
 
 
 
 
 
 
107
  *
108
  * @return mixed
109
  */
@@ -165,6 +182,8 @@ class Shopgate_Framework_Helper_Config extends Mage_Core_Helper_Abstract
165
  }
166
 
167
  /* a shopnumber has a default store view set exactly like the base store view for the new shopnumber */
 
 
168
  $collection = Mage::getModel('core/config_data')->getCollection()
169
  ->addFieldToFilter(
170
  '`main_table`.`path`',
@@ -178,7 +197,7 @@ class Shopgate_Framework_Helper_Config extends Mage_Core_Helper_Abstract
178
  )
179
  ->getSelect()
180
  ->joinInner(
181
- array('dsv' => 'core_config_data'),
182
  '`dsv`.`scope` = `main_table`.`scope` AND `dsv`.`scope_id` = `main_table`.`scope_id`',
183
  array('default_store_view' => 'value')
184
  )->query()
42
  const COMMUNITY_EDITION = 'Community';
43
 
44
  /**
45
+ * const for enterprise
46
  */
47
  const ENTERPRISE_EDITION = 'Enterprise';
48
 
49
+ /**
50
+ * When PayPal UI was updated
51
+ * @var string
52
+ */
53
+ protected $_magentoVersion1701 = '';
54
+
55
  /**
56
  * @var string
57
  */
72
  */
73
  public function __construct()
74
  {
75
+ $this->_magentoVersion1701 = ($this->getEdition() == 'Enterprise') ? '1.12.0.2' : '1.7.0.1';
76
  $this->_magentoVersion15 = ($this->getEdition() == 'Enterprise') ? '1.9.1.0' : '1.5';
77
  $this->_magentoVersion1410 = ($this->getEdition() == 'Enterprise') ? '1.9.0.0' : '1.4.1.0';
78
  }
99
  }
100
 
101
  /**
102
+ * TODO: redo comparison check to be scalable
103
  *
104
  * @param string $version - magento version e.g "1.9.1.1"
105
  * @return bool
110
  }
111
 
112
  /**
113
+ * compare version if it is lower than 1.7.0.1
114
+ *
115
+ * @return bool
116
+ */
117
+ public function getIsMagentoVersionLower1701()
118
+ {
119
+ return $this->getIsMagentoVersionLower($this->_magentoVersion1701);
120
+ }
121
+
122
+ /**
123
+ * Compare version if it is lower than 1.5
124
  *
125
  * @return mixed
126
  */
182
  }
183
 
184
  /* a shopnumber has a default store view set exactly like the base store view for the new shopnumber */
185
+ $resource = Mage::getSingleton('core/resource');
186
+ $table_config_data = $resource->getTableName('core/config_data');
187
  $collection = Mage::getModel('core/config_data')->getCollection()
188
  ->addFieldToFilter(
189
  '`main_table`.`path`',
197
  )
198
  ->getSelect()
199
  ->joinInner(
200
+ array('dsv' => $table_config_data),
201
  '`dsv`.`scope` = `main_table`.`scope` AND `dsv`.`scope_id` = `main_table`.`scope_id`',
202
  array('default_store_view' => 'value')
203
  )->query()
app/code/community/Shopgate/Framework/Helper/Data.php CHANGED
@@ -43,6 +43,17 @@ class Shopgate_Framework_Helper_Data extends Mage_Core_Helper_Abstract
43
  */
44
  protected $_config;
45
 
 
 
 
 
 
 
 
 
 
 
 
46
  /**
47
  * get QR Code directory
48
  *
@@ -373,9 +384,10 @@ class Shopgate_Framework_Helper_Data extends Mage_Core_Helper_Abstract
373
  public function getStateForStatus($status)
374
  {
375
  if (Mage::helper("shopgate/config")->getIsMagentoVersionLower15() ||
376
- (Mage::helper("shopgate/config")->getEdition() == 'Enterprise' &&
377
- version_compare(Mage::getVersion(),'1.9.1.2','<'))) {
378
- return $this->_getStateForStatusMagento14x($status);
 
379
  }
380
 
381
  $resource = Mage::getSingleton('core/resource');
@@ -388,6 +400,35 @@ class Shopgate_Framework_Helper_Data extends Mage_Core_Helper_Abstract
388
  return $result;
389
  }
390
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
391
  /**
392
  * return the sate of status for magento 1.4
393
  * if status not in mapping-array state will set to status!
@@ -396,14 +437,22 @@ class Shopgate_Framework_Helper_Data extends Mage_Core_Helper_Abstract
396
  *
397
  * @return string
398
  */
399
- protected function _getStateForStatusMagento14x($status)
400
  {
401
- $map = array(
402
- "pending" => "new",
403
- "fraud" => "payment_review"
404
- );
405
 
406
- return in_array($status, $map) ? $map[$status] : $status;
 
 
 
 
 
 
 
 
 
407
  }
408
 
409
  /**
43
  */
44
  protected $_config;
45
 
46
+ protected $_mage14xStates = array(
47
+ Mage_Sales_Model_Order::STATE_NEW => "pending",
48
+ Mage_Sales_Model_Order::STATE_PENDING_PAYMENT => "pending",
49
+ Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW => "payment_review",
50
+ Mage_Sales_Model_Order::STATE_PROCESSING => "processing",
51
+ Mage_Sales_Model_Order::STATE_COMPLETE => "complete",
52
+ Mage_Sales_Model_Order::STATE_CLOSED => "closed",
53
+ Mage_Sales_Model_Order::STATE_CANCELED => "canceled",
54
+ Mage_Sales_Model_Order::STATE_HOLDED => "holded",
55
+ );
56
+
57
  /**
58
  * get QR Code directory
59
  *
384
  public function getStateForStatus($status)
385
  {
386
  if (Mage::helper("shopgate/config")->getIsMagentoVersionLower15() ||
387
+ (Mage::helper("shopgate/config")->getEdition() == 'Enterprise' &&
388
+ version_compare(Mage::getVersion(), '1.9.1.2', '<'))
389
+ ) {
390
+ return $this->_getStateFromStatusMagento14x($status);
391
  }
392
 
393
  $resource = Mage::getSingleton('core/resource');
400
  return $result;
401
  }
402
 
403
+ /**
404
+ * Returns status from state
405
+ *
406
+ * @param string $state
407
+ *
408
+ * @return string
409
+ */
410
+ public function getStatusFromState($state)
411
+ {
412
+ if (Mage::helper("shopgate/config")->getIsMagentoVersionLower15() ||
413
+ (Mage::helper("shopgate/config")->getEdition() == 'Enterprise' &&
414
+ version_compare(Mage::getVersion(), '1.9.1.2', '<'))
415
+ ) {
416
+ return $this->_getStatusFromStateMagento14x($state);
417
+ }
418
+
419
+ $resource = Mage::getSingleton('core/resource');
420
+ $db = $resource->getConnection('core_read');
421
+ $table = $resource->getTableName('sales/order_status_state');
422
+ $result = $db->fetchOne("SELECT state FROM {$table} WHERE state = '{$state}' AND is_default = 1");
423
+ if (!$result) {
424
+ $result = $db->fetchOne("SELECT state FROM {$table} WHERE state = '{$state}'");
425
+ }
426
+ if(!$result) {
427
+ $result = $this->_getStatusFromStateMagento14x($state);
428
+ }
429
+ return $result;
430
+ }
431
+
432
  /**
433
  * return the sate of status for magento 1.4
434
  * if status not in mapping-array state will set to status!
437
  *
438
  * @return string
439
  */
440
+ protected function _getStateFromStatusMagento14x($status)
441
  {
442
+ $state = array_search($status, $this->_mage14xStates);
443
+ return $state !== false ? $state : Mage_Sales_Model_Order::STATE_PROCESSING;
444
+ }
 
445
 
446
+ /**
447
+ * Mage 1.4 non DB support for all states
448
+ *
449
+ * @param $state - status returned
450
+ *
451
+ * @return string
452
+ */
453
+ protected function _getStatusFromStateMagento14x($state)
454
+ {
455
+ return isset($this->_mage14xStates[$state]) ? $this->_mage14xStates[$state] : Mage_Sales_Model_Order::STATE_PROCESSING;
456
  }
457
 
458
  /**
app/code/community/Shopgate/Framework/Helper/Payment/Payone.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Class Shopgate_Framework_Helper_Payment_Payone
26
+ *
27
+ * @author awesselburg <wesselburg@me.com>
28
+ * @author Konstantin K <konstantin@kiritsenko.com>
29
+ */
30
+ class Shopgate_Framework_Helper_Payment_Payone extends Shopgate_Framework_Helper_Payment_Abstract
31
+ {
32
+ /**
33
+ * @param Payone_Core_Model_Config $config
34
+ * @param string $methodType
35
+ *
36
+ * @return int
37
+ */
38
+ public function getMethodId($config, $methodType)
39
+ {
40
+ if ($methodType) {
41
+
42
+ $methods = $config->getPayment()->getMethodsByType($methodType);
43
+
44
+ if (!empty($methods)) {
45
+ /** @var Payone_Core_Model_Config_Payment_Method $method */
46
+ foreach ($methods as $method) {
47
+ $id = $method->getScope() === 'websites'
48
+ ? Mage::app()->getWebsite()->getId() : Mage::app()->getStore()->getStoreId();
49
+
50
+ if ($method->getScopeId() === $id) {
51
+ return $method->getId();
52
+ }
53
+ }
54
+ $error = $this->__('PayOne: could not match config scope with any of the active methods');
55
+ } else {
56
+ $error = $this->__('PayOne: could not find an enabled config for mapping: %s', $methodType);
57
+ }
58
+ } else {
59
+ $error = $this->__('PayOne: method type not set in the called class');
60
+ }
61
+
62
+ ShopgateLogger::getInstance()->log($error, ShopgateLogger::LOGTYPE_ERROR);
63
+ return false;
64
+ }
65
+
66
+ }
app/code/community/Shopgate/Framework/Model/Export/Settings.php CHANGED
@@ -161,8 +161,8 @@ class Shopgate_Framework_Model_Export_Settings extends Shopgate_Framework_Model_
161
  }
162
  $methodInstance->setStore($store);
163
  $shopgatePaymentMethod = array();
164
- $shopgatePaymentMethod['id'] = $methodInstance->getCode();
165
- $shopgatePaymentMethod['title'] = $methodInstance->getTitle();
166
  $shopgatePaymentMethod['is_active'] = (int)$methodInstance->isAvailable();
167
  $shopgatePaymentMethods[] = $shopgatePaymentMethod;
168
  }
161
  }
162
  $methodInstance->setStore($store);
163
  $shopgatePaymentMethod = array();
164
+ $shopgatePaymentMethod['id'] = $code;
165
+ $shopgatePaymentMethod['title'] = $methodConfig['title'];
166
  $shopgatePaymentMethod['is_active'] = (int)$methodInstance->isAvailable();
167
  $shopgatePaymentMethods[] = $shopgatePaymentMethod;
168
  }
app/code/community/Shopgate/Framework/Model/Observer.php CHANGED
@@ -843,4 +843,41 @@ class Shopgate_Framework_Model_Observer
843
 
844
  return $this;
845
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
846
  }
843
 
844
  return $this;
845
  }
846
+
847
+ /**
848
+ * Triggers when order becomes paid.
849
+ * Main purpose is to set a different sequence number
850
+ * after we capture an invoice. Else we cannot refund
851
+ * because PayOne plugin is not setting it correctly.
852
+ *
853
+ * @param Varien_Event_Observer $event
854
+ * @return $this
855
+ * @throws Exception
856
+ */
857
+ public function preparePayoneOrderForRefund(Varien_Event_Observer $event)
858
+ {
859
+ $factory = Mage::getModel('payone_core/factory');
860
+ if(!$factory) return $this;
861
+ /** @var Mage_Sales_Model_Order_Invoice $invoice */
862
+ $invoice = $event['invoice'];
863
+ $transaction = $factory->getModelTransaction();
864
+ $transStatus = $factory->getModelApi();
865
+ if($transaction->load($invoice->getTransactionId(), 'txid')->hasData()) {
866
+ $collection = $transStatus
867
+ ->getCollection()
868
+ ->addFieldToFilter('order_id', $transaction->getOrderId())
869
+ ->addFieldToFilter('response', 'APPROVED')
870
+ ->addFieldToFilter('request', 'capture');
871
+ /**
872
+ * If we have an approval on capture in API
873
+ * call database, set next sequence as refund
874
+ */
875
+ if($collection->getSize() > 0) {
876
+ $transaction->setLastSequencenumber(1);
877
+ $transaction->save();
878
+ }
879
+ }
880
+
881
+ return $this;
882
+ }
883
  }
app/code/community/Shopgate/Framework/Model/Payment/Abstract.php CHANGED
@@ -22,26 +22,370 @@
22
  */
23
 
24
  /**
25
- * User: pliebig
26
- * Date: 02.12.14
27
- * Time: 09:58
28
- * E-Mail: p.liebig@me.com, peter.liebig@magcorp.de
29
- */
30
-
31
- /**
32
- * abstracht payment model
33
  *
34
  * @package Shopgate_Framework_Model_Payment_Abstract
35
- * @author Peter Liebig <p.liebig@me.com, peter.liebig@magcorp.de>
36
- */
37
-
38
- class Shopgate_Framework_Model_Payment_Abstract
39
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  /**
41
  * @var null|Mage_Sales_Model_Order
42
  */
43
  protected $_order = null;
44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  /**
46
  * @return Shopgate_Framework_Helper_Payment_Abstract
47
  */
22
  */
23
 
24
  /**
25
+ * Abstract payment model
 
 
 
 
 
 
 
26
  *
27
  * @package Shopgate_Framework_Model_Payment_Abstract
28
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
29
+ */
30
+ class Shopgate_Framework_Model_Payment_Abstract extends Mage_Core_Model_Abstract
 
31
  {
32
+ /**
33
+ * Has to match the payment_method coming from API call
34
+ */
35
+ const PAYMENT_IDENTIFIER = '';
36
+
37
+ /**
38
+ * Model code of the class that inherits mage's Payment_Method_Abstract
39
+ * Defaults to Shopgate's Mobile payment block
40
+ */
41
+ const PAYMENT_MODEL = '';
42
+
43
+ /**
44
+ * The config path to module enabled
45
+ */
46
+ const XML_CONFIG_ENABLED = '';
47
+
48
+ /**
49
+ * The config path to module's paid status
50
+ */
51
+ const XML_CONFIG_STATUS_PAID = '';
52
+
53
+ /**
54
+ * The config path to module's not paid status
55
+ */
56
+ const XML_CONFIG_STATUS_NOT_PAID = '';
57
+
58
+ /**
59
+ * The name of the module, as defined in etc/modules/*.xml
60
+ */
61
+ const MODULE_CONFIG = '';
62
+
63
  /**
64
  * @var null|Mage_Sales_Model_Order
65
  */
66
  protected $_order = null;
67
 
68
+ /**
69
+ * Comes from payment_type of API
70
+ */
71
+ protected $_payment_method;
72
+
73
+ /**
74
+ * Shopgate order inserted upon instantiation
75
+ *
76
+ * @var ShopgateOrder
77
+ */
78
+ protected $_shopgate_order;
79
+
80
+ /**
81
+ * $this->_data contains constructor param
82
+ * Pass it into the Mage:getModel('',$param)
83
+ *
84
+ * @return ShopgateOrder
85
+ * @throws Exception
86
+ */
87
+ public function _construct()
88
+ {
89
+ if ($this->_shopgate_order) {
90
+ return $this->_shopgate_order;
91
+ }
92
+
93
+ $shopgateOrder = $this->_data;
94
+ if (!$shopgateOrder instanceof ShopgateOrder) {
95
+ $error = $this->_getHelper()->__('Incorrect class provided to: %s::_constructor()', get_class($this));
96
+ ShopgateLogger::getInstance()->log($error, ShopgateLogger::LOGTYPE_ERROR);
97
+ throw new Exception($error);
98
+ }
99
+
100
+ return $this->setShopgateOrder($shopgateOrder);
101
+ }
102
+
103
+ /**
104
+ * @param $shopgateOrder ShopgateOrder
105
+ * @return $this
106
+ */
107
+ public function setShopgateOrder(ShopgateOrder $shopgateOrder)
108
+ {
109
+ $this->_shopgate_order = $shopgateOrder;
110
+ return $this;
111
+ }
112
+
113
+ /**
114
+ * @return ShopgateOrder
115
+ */
116
+ public function getShopgateOrder()
117
+ {
118
+ return $this->_shopgate_order;
119
+ }
120
+
121
+ /**
122
+ * @param $paymentMethod string
123
+ * @return $this
124
+ */
125
+ public function setPaymentMethod($paymentMethod)
126
+ {
127
+ $this->_payment_method = $paymentMethod;
128
+ return $this;
129
+ }
130
+
131
+ /**
132
+ * @return string
133
+ */
134
+ public function getPaymentMethod()
135
+ {
136
+ if (!$this->_payment_method) {
137
+ $this->_payment_method = $this->getShopgateOrder()->getPaymentMethod();
138
+ }
139
+ return $this->_payment_method;
140
+ }
141
+
142
+ /**
143
+ * Magento order getter
144
+ *
145
+ * @return Mage_Sales_Model_Order
146
+ */
147
+ public function getOrder()
148
+ {
149
+ return $this->_order;
150
+ }
151
+
152
+ /**
153
+ * Helps initialize magento order
154
+ *
155
+ * @param Mage_Sales_Model_Order $order
156
+ * @return Mage_Sales_Model_Order
157
+ */
158
+ public function setOrder(Mage_Sales_Model_Order $order)
159
+ {
160
+ return $this->_order = $order;
161
+ }
162
+
163
+ /**
164
+ * Get version of plugin
165
+ *
166
+ * @return mixed
167
+ */
168
+ protected function _getVersion()
169
+ {
170
+ return Mage::getConfig()->getModuleConfig($this::MODULE_CONFIG)->version;
171
+ }
172
+
173
+ /**
174
+ * ===========================================
175
+ * ============= Active Checkers =============
176
+ * ===========================================
177
+ */
178
+
179
+ /**
180
+ * All around check for whether module is the one to use
181
+ *
182
+ * @return bool
183
+ */
184
+ public function isValid()
185
+ {
186
+ return $this->isPayment() && $this->isEnabled() && $this->isModuleActive() && $this->checkGenericValid();
187
+ }
188
+
189
+ /**
190
+ * Checks that api->payment_method is equals to class constant
191
+ *
192
+ * @return bool
193
+ */
194
+ public function isPayment()
195
+ {
196
+ $flag = $this->getPaymentMethod() === $this::PAYMENT_IDENTIFIER;
197
+
198
+ if (!$flag) {
199
+ $debug = $this->_getHelper()->__(
200
+ 'Payment method "%s" does not equal to identifier "%s" in class "%s"',
201
+ $this->getPaymentMethod(),
202
+ $this::PAYMENT_IDENTIFIER,
203
+ get_class($this)
204
+ );
205
+ ShopgateLogger::getInstance()->log($debug, ShopgateLogger::LOGTYPE_DEBUG);
206
+ }
207
+
208
+ return $flag;
209
+ }
210
+
211
+ /**
212
+ * Checks store config to be active
213
+ * //todo: can we check storeId on import?
214
+ *
215
+ * @return bool
216
+ */
217
+ public function isEnabled()
218
+ {
219
+ $val = Mage::getStoreConfig($this::XML_CONFIG_ENABLED);
220
+ $enabled = !empty($val);
221
+ if (!$enabled) {
222
+ $debug = $this->_getHelper()->__(
223
+ 'Enabled check by path "%s" was evaluated as empty: "%s" in class "%s"',
224
+ $this::XML_CONFIG_ENABLED,
225
+ $val,
226
+ get_class($this)
227
+ );
228
+ ShopgateLogger::getInstance()->log($debug, ShopgateLogger::LOGTYPE_DEBUG);
229
+ }
230
+ return $enabled;
231
+ }
232
+
233
+ /**
234
+ * Checks module node to be active
235
+ *
236
+ * @return mixed
237
+ */
238
+ public function isModuleActive()
239
+ {
240
+ $active = Mage::getConfig()->getModuleConfig($this::MODULE_CONFIG)->is('active', 'true');
241
+
242
+ if (!$active) {
243
+ $debug = $this->_getHelper()->__(
244
+ 'Module by config "%s" was not active in class "%s"',
245
+ $this::MODULE_CONFIG,
246
+ get_class($this)
247
+ );
248
+ ShopgateLogger::getInstance()->log($debug, ShopgateLogger::LOGTYPE_DEBUG);
249
+ }
250
+
251
+ return $active;
252
+ }
253
+
254
+ /**
255
+ * Implement any custom validation
256
+ *
257
+ * @return bool
258
+ */
259
+ public function checkGenericValid()
260
+ {
261
+ return true;
262
+ }
263
+
264
+ /**
265
+ * ===========================================
266
+ * ======== Payment necessary methods ========
267
+ * ===========================================
268
+ */
269
+
270
+ /**
271
+ * Default order creation if no payment matches
272
+ *
273
+ * @param Mage_Sales_Model_Quote $quote
274
+ * @return Mage_Sales_Model_Order
275
+ * @throws Exception
276
+ */
277
+ public function createNewOrder($quote)
278
+ {
279
+ $service = Mage::getModel('sales/service_quote', $quote);
280
+ if (!Mage::helper("shopgate/config")->getIsMagentoVersionLower15()) {
281
+ $service->submitAll();
282
+ return $this->setOrder($service->getOrder());
283
+ } else {
284
+ return $this->setOrder($service->submit());
285
+ }
286
+ }
287
+
288
+ /**
289
+ * Generic order manipulation, taken originally from Plugin::_setOrderPayment()
290
+ *
291
+ * @param Mage_Sales_Model_Order $magentoOrder
292
+ * @return Mage_Sales_Model_Order
293
+ */
294
+ public function manipulateOrderWithPaymentData($magentoOrder)
295
+ {
296
+ $shopgateOrder = $this->getShopgateOrder();
297
+
298
+ if ($shopgateOrder->getIsPaid()) {
299
+
300
+ if ($magentoOrder->getBaseTotalDue()) {
301
+ $magentoOrder->getPayment()->setShouldCloseParentTransaction(true);
302
+ $magentoOrder->getPayment()->registerCaptureNotification($shopgateOrder->getAmountComplete());
303
+
304
+ $magentoOrder->addStatusHistoryComment($this->_getHelper()->__("[SHOPGATE] Payment received."), false)
305
+ ->setIsCustomerNotified(false);
306
+ }
307
+ }
308
+
309
+ $magentoOrder->getPayment()->setLastTransId($shopgateOrder->getPaymentTransactionNumber());
310
+
311
+ return $magentoOrder;
312
+ }
313
+
314
+ /**
315
+ * Default quote prepare handler
316
+ *
317
+ * @param Mage_Sales_Model_Quote $quote
318
+ * @param $info
319
+ * @return Mage_Sales_Model_Quote
320
+ */
321
+ public function prepareQuote($quote, $info)
322
+ {
323
+ return $quote;
324
+ }
325
+
326
+ /**
327
+ * Setting for default magento status
328
+ *
329
+ * @param $magentoOrder Mage_Sales_Model_Order
330
+ * @return mixed
331
+ */
332
+ public function setOrderStatus($magentoOrder)
333
+ {
334
+ if ($this->getShopgateOrder()->getIsPaid()) {
335
+ $status = Mage::getStoreConfig($this::XML_CONFIG_STATUS_PAID, $magentoOrder->getStoreId());
336
+ } else {
337
+ if ($this::XML_CONFIG_STATUS_NOT_PAID) {
338
+ $status = Mage::getStoreConfig($this::XML_CONFIG_STATUS_NOT_PAID, $magentoOrder->getStoreId());
339
+ } else {
340
+ $status = Mage::getStoreConfig($this::XML_CONFIG_STATUS_PAID, $magentoOrder->getStoreId());
341
+ }
342
+ }
343
+
344
+ if ($status) {
345
+ $state = $this->_getHelper()->getStateForStatus($status);
346
+ $message = $this->_getHelper()->__('[SHOPGATE] Using native plugin status');
347
+ $magentoOrder->setState($state, $status, $message);
348
+ $magentoOrder->setShopgateStatusSet(true);
349
+ }
350
+
351
+ return $magentoOrder;
352
+ }
353
+
354
+ /**
355
+ * Payment method return
356
+ * method and don't use it anymore.
357
+ *
358
+ * @return bool|mixed
359
+ */
360
+ public function getPaymentModel()
361
+ {
362
+ $model = Mage::getModel($this::PAYMENT_MODEL);
363
+ if (!$model) {
364
+ /*$debug = $this->_getHelper()->__(
365
+ 'Could not find PAYMENT_MODEL %s in class %s',
366
+ $this::PAYMENT_MODEL,
367
+ get_class($this)
368
+ );
369
+ ShopgateLogger::getInstance()->log($debug, ShopgateLogger::LOGTYPE_DEBUG);
370
+ return Mage::getModel(self::PAYMENT_MODEL);*/
371
+ }
372
+ return $model;
373
+ }
374
+
375
+ /**
376
+ * =======================================
377
+ * ============ Helpers ==================
378
+ * =======================================
379
+ */
380
+
381
+ /**
382
+ * @return Shopgate_Framework_Helper_Data
383
+ */
384
+ protected function _getHelper()
385
+ {
386
+ return Mage::helper('shopgate');
387
+ }
388
+
389
  /**
390
  * @return Shopgate_Framework_Helper_Payment_Abstract
391
  */
app/code/community/Shopgate/Framework/Model/Payment/Amazon.php CHANGED
@@ -7,150 +7,44 @@
7
  */
8
 
9
  /**
10
- * class to manipulate the order payment data with amazon payment data
11
  *
 
12
  * @package Shopgate_Framework_Model_Payment_Amazon
13
  * @author Peter Liebig <p.liebig@me.com, peter.liebig@magcorp.de>
 
14
  */
15
  class Shopgate_Framework_Model_Payment_Amazon
16
  {
17
  /**
18
- * create new order for amazon payment
19
  *
 
20
  * @param $quote Mage_Sales_Model_Quote
21
  * @return Mage_Sales_Model_Order
22
  * @throws Exception
23
  */
24
  public function createNewOrder($quote)
25
  {
26
- $convert = Mage::getModel('sales/convert_quote');
27
- $transaction = Mage::getModel('core/resource_transaction');
28
-
29
- if ($quote->getCustomerId()) {
30
- $transaction->addObject($quote->getCustomer());
31
- }
32
-
33
- $transaction->addObject($quote);
34
- if ($quote->isVirtual()) {
35
- $order = $convert->addressToOrder($quote->getBillingAddress());
36
- } else {
37
- $order = $convert->addressToOrder($quote->getShippingAddress());
38
- }
39
- $order->setBillingAddress($convert->addressToOrderAddress($quote->getBillingAddress()));
40
- if ($quote->getBillingAddress()->getCustomerAddress()) {
41
- $order->getBillingAddress()->setCustomerAddress($quote->getBillingAddress()->getCustomerAddress());
42
- }
43
- if (!$quote->isVirtual()) {
44
- $order->setShippingAddress($convert->addressToOrderAddress($quote->getShippingAddress()));
45
- if ($quote->getShippingAddress()->getCustomerAddress()) {
46
- $order->getShippingAddress()->setCustomerAddress($quote->getShippingAddress()->getCustomerAddress());
47
- }
48
- }
49
- $order->setPayment($convert->paymentToOrderPayment($quote->getPayment()));
50
- $order->getPayment()->setTransactionId($quote->getPayment()->getTransactionId());
51
- $order->getPayment()->setAdditionalInformation('amazon_order_reference_id', $quote->getPayment()
52
- ->getTransactionId());
53
-
54
- foreach ($quote->getAllItems() as $item) {
55
- /** @var Mage_Sales_Model_Order_Item $item */
56
- $orderItem = $convert->itemToOrderItem($item);
57
- if ($item->getParentItem()) {
58
- $orderItem->setParentItem($order->getItemByQuoteItemId($item->getParentItem()->getId()));
59
- }
60
- $order->addItem($orderItem);
61
- }
62
- $order->setQuote($quote);
63
- $order->setExtOrderId($quote->getPayment()->getTransactionId());
64
- $order->setCanSendNewEmailFlag(false);
65
-
66
- $transaction->addObject($order);
67
- $transaction->addCommitCallback(array($order, 'save'));
68
-
69
- Mage::dispatchEvent('checkout_type_onepage_save_order', array('order' => $order, 'quote' => $quote));
70
- Mage::dispatchEvent('sales_model_service_quote_submit_before', array('order' => $order, 'quote' => $quote));
71
-
72
- try {
73
- $transaction->save();
74
- Mage::dispatchEvent('sales_model_service_quote_submit_success', array(
75
- 'order' => $order,
76
- 'quote' => $quote
77
- ));
78
- } catch (Exception $e) {
79
- //reset order ID's on exception, because order not saved
80
- $order->setId(null);
81
- /** @var $item Mage_Sales_Model_Order_Item */
82
- foreach ($order->getItemsCollection() as $item) {
83
- $item->setOrderId(null);
84
- $item->setItemId(null);
85
- }
86
-
87
- Mage::dispatchEvent('sales_model_service_quote_submit_failure', array(
88
- 'order' => $order,
89
- 'quote' => $quote
90
- ));
91
- throw $e;
92
- }
93
- Mage::dispatchEvent('checkout_submit_all_after', array('order' => $order, 'quote' => $quote));
94
- Mage::dispatchEvent('sales_model_service_quote_submit_after', array('order' => $order, 'quote' => $quote));
95
-
96
- return $order;
97
  }
98
 
99
  /**
 
 
100
  * @param $order Mage_Sales_Model_Order
101
  * @param $shopgateOrder ShopgateOrder
102
- * // TODO Refund
103
  * @return Mage_Sales_Model_Order
104
  */
105
  public function manipulateOrderWithPaymentData($order, $shopgateOrder)
106
  {
107
- $paymentInfos = $shopgateOrder->getPaymentInfos();
108
- try {
109
- $orderTrans = Mage::getModel('sales/order_payment_transaction');
110
- $orderTrans->setOrderPaymentObject($order->getPayment());
111
- $orderTrans->setIsClosed(false);
112
- $orderTrans->setTxnId($paymentInfos['mws_order_id']);
113
- $orderTrans->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_ORDER);
114
- $orderTrans->save();
115
- $order->getPayment()->importTransactionInfo($orderTrans);
116
- $order->getPayment()->setLastTransId($paymentInfos['mws_order_id']);
117
-
118
- if (!empty($paymentInfos['mws_auth_id'])) {
119
- $authTrans = Mage::getModel('sales/order_payment_transaction');
120
- $authTrans->setOrderPaymentObject($order->getPayment());
121
- $authTrans->setParentTxnId($orderTrans->getTxnId(), $paymentInfos['mws_auth_id']);
122
- $authTrans->setIsClosed(false);
123
- $authTrans->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
124
- $authTrans->save();
125
- $order->getPayment()->importTransactionInfo($authTrans);
126
- $order->getPayment()->setAmountAuthorized($order->getTotalDue());
127
- $order->getPayment()->setLastTransId($paymentInfos['mws_auth_id']);
128
-
129
- if (!empty($paymentInfos['mws_capture_id'])) {
130
- $transaction = Mage::getModel('sales/order_payment_transaction');
131
- $transaction->setOrderPaymentObject($order->getPayment());
132
- $transaction->setParentTxnId($authTrans->getTxnId(), $paymentInfos['mws_capture_id']);
133
- $transaction->setIsClosed(false);
134
- $transaction->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE);
135
- $transaction->save();
136
- $order->getPayment()->importTransactionInfo($transaction);
137
- $order->getPayment()->capture(null);
138
- /** @var Mage_Sales_Model_Resource_Order_Invoice_Collection $invoiceCollection */
139
- $invoiceCollection = $order->getInvoiceCollection();
140
- $invoiceCollection->getFirstItem()->setTransactionId($paymentInfos['mws_capture_id']);
141
- $order->getPayment()->setAmountAuthorized($order->getTotalDue());
142
- $order->getPayment()->setBaseAmountAuthorized($order->getBaseTotalDue());
143
- $order->getPayment()->setLastTransId($paymentInfos['mws_capture_id']);
144
- }
145
- }
146
- } catch (Exception $x) {
147
- Mage::logException($x);
148
- }
149
-
150
- return $order;
151
  }
152
 
153
  /**
 
 
 
154
  * @param $quote Mage_Sales_Model_Quote
155
  * @param $payment Mage_Payment_Model_Method_Abstract|Creativestyle_AmazonPayments_Model_Payment_Advanced
156
  * @param $info array
@@ -158,20 +52,7 @@ class Shopgate_Framework_Model_Payment_Amazon
158
  */
159
  public function prepareQuote($quote, $payment, $info)
160
  {
161
- if ($quote->isVirtual()) {
162
- $quote->getBillingAddress()->setPaymentMethod($payment->getCode() ? $payment->getCode() : null);
163
- } else {
164
- $quote->getShippingAddress()->setPaymentMethod($payment->getCode() ? $payment->getCode() : null);
165
- }
166
-
167
- $data = array( 'method' => $payment->getCode(),
168
- 'checks' => Creativestyle_AmazonPayments_Model_Payment_Abstract::CHECK_USE_FOR_COUNTRY
169
- | Creativestyle_AmazonPayments_Model_Payment_Abstract::CHECK_USE_FOR_CURRENCY
170
- | Creativestyle_AmazonPayments_Model_Payment_Abstract::CHECK_ORDER_TOTAL_MIN_MAX
171
- );
172
-
173
- $quote->getPayment()->importData($data);
174
- $quote->getPayment()->setTransactionId($info['mws_order_id']);
175
- return $quote;
176
  }
177
- }
 
7
  */
8
 
9
  /**
10
+ * Deprecating as all simple payment methods will be handled inside Simple folder
11
  *
12
+ * @deprecated v.2.9.18 - use Shopgate_Framework_Model_Payment_Simple_Mws instead
13
  * @package Shopgate_Framework_Model_Payment_Amazon
14
  * @author Peter Liebig <p.liebig@me.com, peter.liebig@magcorp.de>
15
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
16
  */
17
  class Shopgate_Framework_Model_Payment_Amazon
18
  {
19
  /**
20
+ * Passing a fake ShopgateOrder to avoid error thrown
21
  *
22
+ * @deprecated v.2.9.18
23
  * @param $quote Mage_Sales_Model_Quote
24
  * @return Mage_Sales_Model_Order
25
  * @throws Exception
26
  */
27
  public function createNewOrder($quote)
28
  {
29
+ return Mage::getModel('shopgate/payment_simple_mws', new ShopgateOrder())->createNewOrder($quote);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  }
31
 
32
  /**
33
+ *
34
+ * @deprecated v.2.9.18
35
  * @param $order Mage_Sales_Model_Order
36
  * @param $shopgateOrder ShopgateOrder
 
37
  * @return Mage_Sales_Model_Order
38
  */
39
  public function manipulateOrderWithPaymentData($order, $shopgateOrder)
40
  {
41
+ return Mage::getModel('shopgate/payment_simple_mws', $shopgateOrder)->manipulateOrderWithPaymentData($order);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  }
43
 
44
  /**
45
+ * Passing a fake ShopgateOrder to avoid error thrown
46
+ *
47
+ * @deprecated v.2.9.18
48
  * @param $quote Mage_Sales_Model_Quote
49
  * @param $payment Mage_Payment_Model_Method_Abstract|Creativestyle_AmazonPayments_Model_Payment_Advanced
50
  * @param $info array
52
  */
53
  public function prepareQuote($quote, $payment, $info)
54
  {
55
+ return Mage::getModel('shopgate/payment_simple_mws', new ShopgateOrder())->prepareQuote($quote, $info);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  }
57
+ }
58
+
app/code/community/Shopgate/Framework/Model/Payment/Authorize.php CHANGED
@@ -22,195 +22,23 @@
22
  */
23
 
24
  /**
25
- * native implementation of authorize.net payment
26
  *
 
27
  * @package Shopgate_Framework_Model_Payment_Authorize
28
  * @author Peter Liebig <p.liebig@me.com, peter.liebig@magcorp.de>
 
29
  */
30
- class Shopgate_Framework_Model_Payment_Authorize extends Shopgate_Framework_Model_Payment_Abstract
31
  {
32
  /**
33
- * const for transaction types of shopgate
34
- */
35
- const SHOPGATE_PAYMENT_STATUS_AUTH_ONLY = 'auth_only';
36
- const SHOPGATE_PAYMENT_STATUS_AUTH_CAPTURE = 'auth_capture';
37
-
38
- /**
39
- * const for response codes
40
- */
41
- const RESPONSE_CODE_APPROVED = 1;
42
- const RESPONSE_CODE_DECLINED = 2;
43
- const RESPONSE_CODE_ERROR = 3;
44
- const RESPONSE_CODE_HELD = 4;
45
-
46
- const RESPONSE_REASON_CODE_APPROVED = 1;
47
- const RESPONSE_REASON_CODE_NOT_FOUND = 16;
48
- const RESPONSE_REASON_CODE_PARTIAL_APPROVE = 295;
49
- const RESPONSE_REASON_CODE_PENDING_REVIEW_AUTHORIZED = 252;
50
- const RESPONSE_REASON_CODE_PENDING_REVIEW = 253;
51
- const RESPONSE_REASON_CODE_PENDING_REVIEW_DECLINED = 254;
52
-
53
- /**
54
- * @param $order Mage_Sales_Model_Order
55
- * @param $shopgateOrder ShopgateOrder
56
- *
57
  * @return Mage_Sales_Model_Order
58
  */
59
  public function manipulateOrderWithPaymentData($order, $shopgateOrder)
60
  {
61
- $paymentInfos = $shopgateOrder->getPaymentInfos();
62
- $paymentAuthorize = Mage::getModel('paygate/authorizenet');
63
- $order->getPayment()->setMethod($paymentAuthorize->getCode());
64
- $paymentAuthorize->setInfoInstance($order->getPayment());
65
- $order->getPayment()->setMethodInstance($paymentAuthorize);
66
- $order->save();
67
-
68
- $lastFour = substr($paymentInfos['credit_card']['masked_number'], -4);
69
- $order->getPayment()->setCcTransId($paymentInfos['transaction_id']);
70
- $order->getPayment()->setCcApproval($paymentInfos['authorization_code']);
71
- $cardStorage = $paymentAuthorize->getCardsStorage($order->getPayment());
72
- $card = $cardStorage->registerCard();
73
- $card->setRequestedAmount($shopgateOrder->getAmountComplete())
74
- ->setBalanceOnCard("")
75
- ->setLastTransId($paymentInfos['transaction_id'])
76
- ->setProcessedAmount($shopgateOrder->getAmountComplete())
77
- ->setCcType($this->_getCcTypeName($paymentInfos['credit_card']['type']))
78
- ->setCcOwner($paymentInfos['credit_card']['holder'])
79
- ->setCcLast4($lastFour)
80
- ->setCcExpMonth("")
81
- ->setCcExpYear("")
82
- ->setCcSsIssue("")
83
- ->setCcSsStartMonth("")
84
- ->setCcSsStartYear("");
85
-
86
- $transactionType = $paymentInfos['transaction_type'];
87
- $responseCode = $paymentInfos['response_code'];
88
- switch ($transactionType) {
89
- case self::SHOPGATE_PAYMENT_STATUS_AUTH_ONLY:
90
- $newTransactionType = Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH;
91
- $defaultExceptionMessage = Mage::helper('paygate')->__('Payment authorization error.');
92
- break;
93
- case self::SHOPGATE_PAYMENT_STATUS_AUTH_CAPTURE:
94
- $newTransactionType = Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE;
95
- $defaultExceptionMessage = Mage::helper('paygate')->__('Payment capturing error.');
96
- break;
97
- }
98
-
99
- try {
100
- switch ($responseCode) {
101
- case self::RESPONSE_CODE_APPROVED:
102
- $formattedPrice = $order->getBaseCurrency()->formatTxt($order->getTotalDue());
103
- $order->getPayment()->setAmountAuthorized($order->getGrandTotal());
104
- $order->getPayment()->setBaseAmountAuthorized($order->getBaseGrandTotal());
105
- $order->getPayment()->setIsTransactionPending(true);
106
- $this->_createTransaction($order->getPayment(), $card, $newTransactionType);
107
- $message = Mage::helper('paypal')->__('Authorized amount of %s.', $formattedPrice);
108
- if ($transactionType == self::SHOPGATE_PAYMENT_STATUS_AUTH_CAPTURE) {
109
- $invoice = $this->_getPaymentHelper()->createOrderInvoice($order);
110
- $invoice->setTransactionId(1);
111
- $order->getPayment()->setIsTransactionPending(false);
112
- $amountToCapture = $order->getBaseCurrency()->formatTxt($invoice->getBaseGrandTotal());
113
- $order->getPayment()->setBaseAmountPaidOnline($invoice->getBaseGrandTotal());
114
- $card->setCapturedAmount($card->getProcessedAmount());
115
- $message = Mage::helper('sales')->__('Captured amount of %s online.', $amountToCapture);
116
- $invoice->setIsPaid(true);
117
- $invoice->pay();
118
- $invoice->save();
119
- $order->addRelatedObject($invoice);
120
- }
121
- $cardStorage->updateCard($card);
122
-
123
- $status = $order->getPayment()->getMethodInstance()->getConfigData('order_status');
124
- $state = Mage::helper('shopgate')->getStateForStatus($status);
125
- $order->setState($state, $status, $message);
126
- break;
127
- case self::RESPONSE_CODE_HELD:
128
- if (array_key_exists('response_reason_code', $paymentInfos) && (
129
- $paymentInfos['response_reason_code'] == self::RESPONSE_REASON_CODE_PENDING_REVIEW_AUTHORIZED
130
- || $paymentInfos['response_reason_code'] == self::RESPONSE_REASON_CODE_PENDING_REVIEW
131
- )
132
- ) {
133
- $this->_createTransaction($order->getPayment(), $card, $newTransactionType, array('is_transaction_fraud' => true));
134
- $invoice = $this->_getPaymentHelper()->createOrderInvoice($order);
135
- $invoice->setTransactionId(1);
136
- $invoice->setIsPaid(false);
137
- $invoice->save();
138
- $order->addRelatedObject($invoice);
139
- $amountToCapture = $order->getBaseCurrency()->formatTxt($invoice->getBaseGrandTotal());
140
- $message = Mage::helper('sales')->__('Capturing amount of %s is pending approval on gateway.', $amountToCapture);
141
- if ($transactionType == self::SHOPGATE_PAYMENT_STATUS_AUTH_CAPTURE) {
142
- $card->setCapturedAmount($card->getProcessedAmount());
143
- $cardStorage->updateCard($card);
144
- }
145
- $order->getPayment()->setIsTransactionPending(true)->setIsFraudDetected(true);
146
- $order->setState(Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW, true, $message);
147
- }
148
- break;
149
- case self::RESPONSE_CODE_DECLINED:
150
- case self::RESPONSE_CODE_ERROR:
151
- Mage::throwException($paymentInfos['response_reason_text']);
152
- default:
153
- Mage::throwException($defaultExceptionMessage);
154
- }
155
- } catch (Exception $x) {
156
- $order->addStatusHistoryComment(Mage::helper('sales')->__('Note: %s', $x->getMessage()));
157
- Mage::logException($x);
158
- }
159
- return $order;
160
- }
161
-
162
- /**
163
- * Retrieve credit card type by mapping
164
- *
165
- * @param $ccType string
166
- * @return string
167
- */
168
- protected function _getCcTypeName($ccType)
169
- {
170
- switch ($ccType) {
171
- case 'visa':
172
- $ccType = 'VI';
173
- break;
174
- case 'mastercard':
175
- $ccType = 'MC';
176
- break;
177
- case 'american_express':
178
- $ccType = 'AE';
179
- break;
180
- case 'discover':
181
- $ccType = 'DI';
182
- break;
183
- case 'jcb':
184
- $ccType = 'JCB';
185
- break;
186
- case 'maestro':
187
- $ccType = 'SM';
188
- break;
189
- default:
190
- $ccType = 'OT';
191
- break;
192
- }
193
- return $ccType;
194
- }
195
-
196
- /**
197
- * @param $orderPayment
198
- * @param $card
199
- * @param $type
200
- * @param $additionalInformation
201
- */
202
- protected function _createTransaction($orderPayment, $card, $type, $additionalInformation = array())
203
- {
204
- $transaction = Mage::getModel('sales/order_payment_transaction');
205
- $transaction->setOrderPaymentObject($orderPayment);
206
- $transaction->setTxnId($card->getLastTransId());
207
- $transaction->setIsClosed(false);
208
- $transaction->setTxnType($type);
209
- $transaction->setData('is_transaciton_closed', '0');
210
- $transaction->setAdditionalInformation('real_transaction_id', $card->getLastTransId());
211
- foreach ($additionalInformation as $key =>$value) {
212
- $transaction->setAdditionalInformation($key, $value);
213
- }
214
- $transaction->save();
215
  }
216
  }
22
  */
23
 
24
  /**
25
+ * Used to be a native implementation of Authorize
26
  *
27
+ * @deprecated 2.9.18 - use Shopgate_Framework_Model_Payment_Cc_Authn instead
28
  * @package Shopgate_Framework_Model_Payment_Authorize
29
  * @author Peter Liebig <p.liebig@me.com, peter.liebig@magcorp.de>
30
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
31
  */
32
+ class Shopgate_Framework_Model_Payment_Authorize
33
  {
34
  /**
35
+ * @deprecated 2.9.18
36
+ * @param $order Mage_Sales_Model_Order
37
+ * @param $shopgateOrder ShopgateOrder
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  * @return Mage_Sales_Model_Order
39
  */
40
  public function manipulateOrderWithPaymentData($order, $shopgateOrder)
41
  {
42
+ return Mage::getModel('shopgate/payment_cc_authn', $shopgateOrder)->manipulateOrderWithPaymentData($order);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  }
44
  }
app/code/community/Shopgate/Framework/Model/Payment/Billsafe.php CHANGED
@@ -22,73 +22,25 @@
22
  */
23
 
24
  /**
25
- * User: pliebig
26
- * Date: 14.11.14
27
- * Time: 10:25
28
- * E-Mail: p.liebig@me.com, peter.liebig@magcorp.de
29
  */
30
-
31
- /**
32
- * class to manipulate the order payment data with billsafe payment data
33
- *
34
- * @package Shopgate_Framework_Model_Payment_Billsafe
35
- * @author Peter Liebig <p.liebig@me.com, peter.liebig@magcorp.de>
36
- */
37
- class Shopgate_Framework_Model_Payment_Billsafe extends Shopgate_Framework_Model_Payment_Abstract
38
  {
39
  /**
40
- * @param $order Mage_Sales_Model_Order
41
- * @param $shopgateOrder ShopgateOrder
42
- *
 
 
 
43
  * @return Mage_Sales_Model_Order
44
  */
45
  public function manipulateOrderWithPaymentData($order, $shopgateOrder)
46
  {
47
- $paymentBillsafe = Mage::getModel('billsafe/payment');
48
- $order->getPayment()->setMethod($paymentBillsafe->getCode());
49
- $paymentBillsafe->setInfoInstance($order->getPayment());
50
- $order->getPayment()->setMethodInstance($paymentBillsafe);
51
- $order->save();
52
- $orderObject = new Varien_Object(array('increment_id' => $shopgateOrder->getOrderNumber()));
53
- $data = Mage::getSingleton('billsafe/client')->getPaymentInstruction($orderObject);
54
- if ($data) {
55
- $order->getPayment()->setAdditionalInformation(
56
- 'BillsafeStatus', Netresearch_Billsafe_Model_Payment::BILLSAFE_STATUS_ACTIVE
57
- );
58
- $order->getPayment()->setAdditionalInformation('Recipient', $data->recipient);
59
- $order->getPayment()->setAdditionalInformation('BankCode', $data->bankCode);
60
- $order->getPayment()->setAdditionalInformation('AccountNumber', $data->accountNumber);
61
- $order->getPayment()->setAdditionalInformation('BankName', $data->bankName);
62
- $order->getPayment()->setAdditionalInformation('Bic', $data->bic);
63
- $order->getPayment()->setAdditionalInformation('Iban', $data->iban);
64
- $order->getPayment()->setAdditionalInformation('Reference', $data->reference);
65
- $order->getPayment()->setAdditionalInformation('Amount', $data->amount);
66
- $order->getPayment()->setAdditionalInformation('CurrencyCode', $data->currencyCode);
67
- $order->getPayment()->setAdditionalInformation('Note', $data->note);
68
- $order->getPayment()->setAdditionalInformation('legalNote', $data->legalNote);
69
- } else {
70
- $order->getPayment()->setAdditionalInformation(
71
- 'BillsafeStatus', Netresearch_Billsafe_Model_Payment::BILLSAFE_STATUS_CANCELLED
72
- );
73
- }
74
- $paymentInfos = $shopgateOrder->getPaymentInfos();
75
- $orderTrans = Mage::getModel('sales/order_payment_transaction');
76
- $orderTrans->setOrderPaymentObject($order->getPayment());
77
- $orderTrans->setIsClosed(false);
78
- $orderTrans->setTxnId($paymentInfos['billsafe_transaction_id']);
79
- $orderTrans->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
80
- $orderTrans->save();
81
- $order->getPayment()->importTransactionInfo($orderTrans);
82
- $order->getPayment()->setDataChanges(true);
83
-
84
- $status = Mage::getModel('billsafe/config')->getBillSafeOrderStatus($order->getStoreId());
85
- if ('pending' == $status) {
86
- $status = Mage_Sales_Model_Order::STATE_PENDING_PAYMENT;
87
- }
88
- $text = 'Successful BillSAFE payment.<br/>Transaction ID: %d.<br/>BillSAFE Transaction Status: ACCEPTED.';
89
- $notice = $this->_getPaymentHelper()->__($text, $paymentInfos['billsafe_transaction_id']);
90
- $state = Mage::helper('shopgate')->getStateForStatus($status);
91
- $order->setState($state, $status, $notice);
92
- return $order;
93
  }
94
  }
22
  */
23
 
24
  /**
25
+ * @deprecated v2.9.18 - use Shopgate_Framework_Model_Payment_Simple_Billsafe instead
26
+ * @package Shopgate_Framework_Model_Payment_Billsafe
27
+ * @author Peter Liebig <p.liebig@me.com>
28
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
29
  */
30
+ class Shopgate_Framework_Model_Payment_Billsafe extends Shopgate_Framework_Model_Payment_Simple
 
 
 
 
 
 
 
31
  {
32
  /**
33
+ * Backward compatible forwarder to new systmem
34
+ *
35
+ * @deprecated v2.9.18
36
+ * @param Mage_Sales_Model_Order $order
37
+ * @param ShopgateOrder $shopgateOrder
38
+ *
39
  * @return Mage_Sales_Model_Order
40
  */
41
  public function manipulateOrderWithPaymentData($order, $shopgateOrder)
42
  {
43
+ return Mage::getModel('shopgate/payment_simple_billsafe', $shopgateOrder)
44
+ ->manipulateOrderWithPaymentData($order);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  }
46
  }
app/code/community/Shopgate/Framework/Model/Payment/Cc.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Forwarder for all Credit Card payment methods that contain CC in payment_method
26
+ * Inherits from Simple class to use the first part of payment_method.
27
+ * Meaning use Authn in Authn_CC to make Cc/Auth.php call
28
+ *
29
+ * Class Shopgate_Framework_Model_Payment_Cc
30
+ *
31
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
32
+ */
33
+ class Shopgate_Framework_Model_Payment_Cc extends Shopgate_Framework_Model_Payment_Simple
34
+ {
35
+ /**
36
+ * Temp rewrite for edge case where AUTHN_CC needs to be
37
+ * handled by AuthorizeCIM.
38
+ *
39
+ * @return false|Shopgate_Framework_Model_Payment_Abstract
40
+ * @throws Exception
41
+ */
42
+ public function getModelByPaymentMethod()
43
+ {
44
+ if (Mage::getModel('shopgate/payment_cc_authncim', $this->getShopgateOrder())->isValid()) {
45
+ $this->setPaymentMethod('AUTHNCIM_CC');
46
+ }
47
+
48
+ return parent::getModelByPaymentMethod();
49
+ }
50
+ }
app/code/community/Shopgate/Framework/Model/Payment/Cc/Abstract.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Handles all CC defaults
26
+ *
27
+ * Class Shopgate_Framework_Model_Payment_Cc_Abstract
28
+ *
29
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
30
+ */
31
+ class Shopgate_Framework_Model_Payment_Cc_Abstract
32
+ extends Shopgate_Framework_Model_Payment_Abstract
33
+ implements Shopgate_Framework_Model_Payment_Interface
34
+ {
35
+ /**
36
+ * @var $_order Mage_Sales_Model_Order
37
+ */
38
+ protected $_order;
39
+
40
+ /**
41
+ * Simple setter
42
+ *
43
+ * @param $order Mage_Sales_Model_Order
44
+ * @return Mage_Sales_Model_Order
45
+ */
46
+ public function setOrder($order)
47
+ {
48
+ if ($this->_order) {
49
+ return $this->_order;
50
+ }
51
+
52
+ return $this->_order = $order;
53
+ }
54
+
55
+ /**
56
+ * Retrieve credit card type by mapping
57
+ *
58
+ * @param $ccType string
59
+ * @return string
60
+ */
61
+ protected function _getCcTypeName($ccType)
62
+ {
63
+ switch ($ccType) {
64
+ case 'visa':
65
+ $ccType = 'VI';
66
+ break;
67
+ case 'mastercard':
68
+ $ccType = 'MC';
69
+ break;
70
+ case 'american_express':
71
+ $ccType = 'AE';
72
+ break;
73
+ case 'discover':
74
+ $ccType = 'DI';
75
+ break;
76
+ case 'jcb':
77
+ $ccType = 'JCB';
78
+ break;
79
+ case 'maestro':
80
+ $ccType = 'SM';
81
+ break;
82
+ default:
83
+ $ccType = 'OT';
84
+ break;
85
+ }
86
+ return $ccType;
87
+ }
88
+
89
+ /**
90
+ * @return Shopgate_Framework_Helper_Data
91
+ */
92
+ protected function _getHelper()
93
+ {
94
+ return Mage::helper('shopgate');
95
+ }
96
+ }
app/code/community/Shopgate/Framework/Model/Payment/Cc/Authn.php ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Native implementation of Authorize.net
26
+ *
27
+ * @package Shopgate_Framework_Model_Payment_Cc_Authn
28
+ * @author Peter Liebig <p.liebig@me.com, peter.liebig@magcorp.de>
29
+ * @author Konstantin Kiritenko <konstantin@kiritsenko.com>
30
+ */
31
+ class Shopgate_Framework_Model_Payment_Cc_Authn
32
+ extends Shopgate_Framework_Model_Payment_Cc_AuthnAbstract
33
+ implements Shopgate_Framework_Model_Payment_Interface
34
+ {
35
+ const XML_CONFIG_ENABLED = 'payment/authorizenet/active';
36
+ const MODULE_CONFIG = 'Mage_Paygate';
37
+
38
+ /**
39
+ * Use AuthnCIM as guide to refactor this class
40
+ * todo: refactor status setting
41
+ * todo: move invoice setting out
42
+ *
43
+ * @param $order Mage_Sales_Model_Order
44
+ *
45
+ * @return Mage_Sales_Model_Order
46
+ */
47
+ public function manipulateOrderWithPaymentData($order)
48
+ {
49
+ $shopgateOrder = $this->getShopgateOrder();
50
+ $paymentInfos = $shopgateOrder->getPaymentInfos();
51
+ $paymentAuthorize = Mage::getModel('paygate/authorizenet');
52
+ $order->getPayment()->setMethod($paymentAuthorize->getCode());
53
+ $paymentAuthorize->setInfoInstance($order->getPayment());
54
+ $order->getPayment()->setMethodInstance($paymentAuthorize);
55
+ $order->save();
56
+
57
+ $lastFour = substr($paymentInfos['credit_card']['masked_number'], -4);
58
+ $order->getPayment()->setCcTransId($paymentInfos['transaction_id']);
59
+ $order->getPayment()->setCcApproval($paymentInfos['authorization_number']);
60
+ $order->getPayment()->setLastTransId($paymentInfos['transaction_id']);
61
+ $cardStorage = $paymentAuthorize->getCardsStorage($order->getPayment());
62
+ $card = $cardStorage->registerCard();
63
+ $card->setRequestedAmount($shopgateOrder->getAmountComplete())
64
+ ->setBalanceOnCard("")
65
+ ->setLastTransId($paymentInfos['transaction_id'])
66
+ ->setProcessedAmount($shopgateOrder->getAmountComplete())
67
+ ->setCcType($this->_getCcTypeName($paymentInfos['credit_card']['type']))
68
+ ->setCcOwner($paymentInfos['credit_card']['holder'])
69
+ ->setCcLast4($lastFour)
70
+ ->setCcExpMonth("")
71
+ ->setCcExpYear("")
72
+ ->setCcSsIssue("")
73
+ ->setCcSsStartMonth("")
74
+ ->setCcSsStartYear("");
75
+
76
+ $transactionType = $paymentInfos['transaction_type'];
77
+ $responseCode = $paymentInfos['response_code'];
78
+ switch ($transactionType) {
79
+ case self::SHOPGATE_PAYMENT_STATUS_AUTH_CAPTURE:
80
+ $newTransactionType = Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE;
81
+ $defaultExceptionMessage = Mage::helper('paygate')->__('Payment capturing error.');
82
+ break;
83
+ case self::SHOPGATE_PAYMENT_STATUS_AUTH_ONLY:
84
+ default:
85
+ $newTransactionType = Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH;
86
+ $defaultExceptionMessage = Mage::helper('paygate')->__('Payment authorization error.');
87
+ break;
88
+ }
89
+
90
+ try {
91
+ switch ($responseCode) {
92
+ case self::RESPONSE_CODE_APPROVED:
93
+ $formattedPrice = $order->getBaseCurrency()->formatTxt($order->getTotalDue());
94
+ $order->getPayment()->setAmountAuthorized($order->getGrandTotal());
95
+ $order->getPayment()->setBaseAmountAuthorized($order->getBaseGrandTotal());
96
+ $order->getPayment()->setIsTransactionPending(true);
97
+ $this->_createTransaction($order->getPayment(), $card, $newTransactionType);
98
+ $message = Mage::helper('paypal')->__('Authorized amount of %s.', $formattedPrice);
99
+ $state = Mage_Sales_Model_Order::STATE_PROCESSING;
100
+ if ($transactionType == self::SHOPGATE_PAYMENT_STATUS_AUTH_CAPTURE) {
101
+ $invoice = $this->_getPaymentHelper()->createOrderInvoice($order);
102
+ $invoice->setTransactionId(1);
103
+ $order->getPayment()->setIsTransactionPending(false);
104
+ $amountToCapture = $order->getBaseCurrency()->formatTxt($invoice->getBaseGrandTotal());
105
+ $order->getPayment()->setBaseAmountPaidOnline($invoice->getBaseGrandTotal());
106
+ $card->setCapturedAmount($card->getProcessedAmount());
107
+ $message = Mage::helper('sales')->__('Captured amount of %s online.', $amountToCapture);
108
+ $invoice->setIsPaid(true);
109
+ $invoice->pay();
110
+ $invoice->save();
111
+ $order->addRelatedObject($invoice);
112
+ }
113
+ $cardStorage->updateCard($card);
114
+ $order->setState($state, $this->_getHelper()->getStatusFromState($state), $message);
115
+ break;
116
+ case self::RESPONSE_CODE_HELD:
117
+ if (array_key_exists('response_reason_code', $paymentInfos) && (
118
+ $paymentInfos['response_reason_code'] == self::RESPONSE_REASON_CODE_PENDING_REVIEW_AUTHORIZED
119
+ || $paymentInfos['response_reason_code'] == self::RESPONSE_REASON_CODE_PENDING_REVIEW
120
+ )
121
+ ) {
122
+ $this->_createTransaction(
123
+ $order->getPayment(),
124
+ $card,
125
+ $newTransactionType,
126
+ array('is_transaction_fraud' => true)
127
+ );
128
+ $invoice = $this->_getPaymentHelper()->createOrderInvoice($order);
129
+ $invoice->setTransactionId(1);
130
+ $invoice->setIsPaid(false);
131
+ $invoice->save();
132
+ $order->addRelatedObject($invoice);
133
+ $amountToCapture = $order->getBaseCurrency()->formatTxt($invoice->getBaseGrandTotal());
134
+ $message = Mage::helper('sales')->__(
135
+ 'Capturing amount of %s is pending approval on gateway.',
136
+ $amountToCapture
137
+ );
138
+ if ($transactionType == self::SHOPGATE_PAYMENT_STATUS_AUTH_CAPTURE) {
139
+ $card->setCapturedAmount($card->getProcessedAmount());
140
+ $cardStorage->updateCard($card);
141
+ }
142
+ $order->getPayment()->setIsTransactionPending(true)->setIsFraudDetected(true);
143
+ $order->setState(Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW, true, $message);
144
+ }
145
+ break;
146
+ case self::RESPONSE_CODE_DECLINED:
147
+ case self::RESPONSE_CODE_ERROR:
148
+ Mage::throwException($paymentInfos['response_reason_text']);
149
+ default:
150
+ Mage::throwException($defaultExceptionMessage);
151
+ }
152
+ } catch (Exception $x) {
153
+ $order->addStatusHistoryComment(Mage::helper('sales')->__('Note: %s', $x->getMessage()));
154
+ Mage::logException($x);
155
+ }
156
+ $order->setShopgateStatusSet(true);
157
+ return $order;
158
+ }
159
+
160
+ /**
161
+ * @param $orderPayment
162
+ * @param $card
163
+ * @param $type
164
+ * @param $additionalInformation
165
+ */
166
+ protected function _createTransaction($orderPayment, $card, $type, $additionalInformation = array())
167
+ {
168
+ $transaction = Mage::getModel('sales/order_payment_transaction');
169
+ $transaction->setOrderPaymentObject($orderPayment);
170
+ $transaction->setTxnId($card->getLastTransId());
171
+ $transaction->setIsClosed(false);
172
+ $transaction->setTxnType($type);
173
+ $transaction->setData('is_transaciton_closed', '0');
174
+ $transaction->setAdditionalInformation('real_transaction_id', $card->getLastTransId());
175
+ foreach ($additionalInformation as $key => $value) {
176
+ $transaction->setAdditionalInformation($key, $value);
177
+ }
178
+ $transaction->save();
179
+ }
180
+ }
app/code/community/Shopgate/Framework/Model/Payment/Cc/AuthnAbstract.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Class Shopgate_Framework_Model_Payment_Cc_AuthnAbstract
26
+ *
27
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
28
+ */
29
+ class Shopgate_Framework_Model_Payment_Cc_AuthnAbstract extends Shopgate_Framework_Model_Payment_Cc_Abstract
30
+ {
31
+ const PAYMENT_IDENTIFIER = ShopgateOrder::AUTHN_CC;
32
+
33
+ /**
34
+ * const for transaction types of shopgate
35
+ */
36
+ const SHOPGATE_PAYMENT_STATUS_AUTH_ONLY = 'auth_only';
37
+ const SHOPGATE_PAYMENT_STATUS_AUTH_CAPTURE = 'auth_capture';
38
+
39
+ /**
40
+ * const for response codes
41
+ */
42
+ const RESPONSE_CODE_APPROVED = 1;
43
+ const RESPONSE_CODE_DECLINED = 2;
44
+ const RESPONSE_CODE_ERROR = 3;
45
+ const RESPONSE_CODE_HELD = 4;
46
+
47
+ const RESPONSE_REASON_CODE_APPROVED = 1;
48
+ const RESPONSE_REASON_CODE_NOT_FOUND = 16;
49
+ const RESPONSE_REASON_CODE_PARTIAL_APPROVE = 295;
50
+ const RESPONSE_REASON_CODE_PENDING_REVIEW_AUTHORIZED = 252;
51
+ const RESPONSE_REASON_CODE_PENDING_REVIEW = 253;
52
+ const RESPONSE_REASON_CODE_PENDING_REVIEW_DECLINED = 254;
53
+
54
+ }
app/code/community/Shopgate/Framework/Model/Payment/Cc/Authncim.php ADDED
@@ -0,0 +1,381 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Class Shopgate_Framework_Model_Payment_Authorize
26
+ *
27
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
28
+ */
29
+ class Shopgate_Framework_Model_Payment_Cc_Authncim extends Shopgate_Framework_Model_Payment_Cc_AuthnAbstract
30
+ {
31
+ const XML_CONFIG_ENABLED = 'payment/authnetcim/active';
32
+ const MODULE_CONFIG = 'ParadoxLabs_AuthorizeNetCim';
33
+
34
+ /**
35
+ * Order initialization values
36
+ */
37
+ protected $_orderInitialized = false;
38
+ protected $_transactionType = '';
39
+ protected $_responseCode = '';
40
+
41
+ /**
42
+ * Initialize public method
43
+ *
44
+ * @param $order Mage_Sales_Model_Order
45
+ * @return $this
46
+ */
47
+ protected function _initOrder($order)
48
+ {
49
+ if ($this->_orderInitialized) {
50
+ return $this;
51
+ }
52
+ $this->setOrder($order);
53
+ $customer = $this->_getCustomer();
54
+ $paymentInfos = $this->getShopgateOrder()->getPaymentInfos();
55
+ $this->_transactionType = $paymentInfos['transaction_type'];
56
+ $this->_responseCode = $paymentInfos['response_code'];
57
+ $this->_orderInitialized = true;
58
+ $this->_order->getPayment()->setCustomer($customer);
59
+ return $this;
60
+ }
61
+
62
+ /**
63
+ * @param $order Mage_Sales_Model_Order
64
+ *
65
+ * @return Mage_Sales_Model_Order
66
+ */
67
+ public function manipulateOrderWithPaymentData($order)
68
+ {
69
+ $this->_initOrder($order);
70
+ $paymentInfos = $this->getShopgateOrder()->getPaymentInfos();
71
+ $lastFour = substr($paymentInfos['credit_card']['masked_number'], -4);
72
+
73
+ $this->_order->getPayment()->setCcTransId($paymentInfos['transaction_id']);
74
+ $this->_order->getPayment()->setCcApproval($paymentInfos['authorization_number']);
75
+ $this->_order->getPayment()->setLastTransId($paymentInfos['transaction_id']);
76
+ $this->_order->getPayment()->setCcType($this->_getCcTypeName($paymentInfos['credit_card']['type']));
77
+ $this->_order->getPayment()->setCcLast4($lastFour);
78
+ $this->_order->getPayment()->setAdditionalInformation('transaction_id', $paymentInfos['transaction_id']);
79
+ $authorizeCim = $this->_handleCard();
80
+ $this->_order->getPayment()->setMethod($authorizeCim->getCode());
81
+ $this->_order->getPayment()->setMethodInstance($authorizeCim);
82
+
83
+ switch ($this->_transactionType) {
84
+ case self::SHOPGATE_PAYMENT_STATUS_AUTH_CAPTURE:
85
+ $newTransactionType = Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE;
86
+ $defaultExceptionMessage = Mage::helper('paygate')->__('Payment capturing error.');
87
+ break;
88
+ case self::SHOPGATE_PAYMENT_STATUS_AUTH_ONLY:
89
+ default:
90
+ $newTransactionType = Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH;
91
+ $defaultExceptionMessage = Mage::helper('paygate')->__('Payment authorization error.');
92
+ break;
93
+ }
94
+
95
+ try {
96
+ switch ($this->_responseCode) {
97
+ case self::RESPONSE_CODE_APPROVED:
98
+ $this->_order->getPayment()->setAmountAuthorized($this->_order->getGrandTotal());
99
+ $this->_order->getPayment()->setBaseAmountAuthorized($this->_order->getBaseGrandTotal());
100
+ $this->_order->getPayment()->setIsTransactionPending(true);
101
+ $this->_createTransaction($newTransactionType);
102
+
103
+ if ($this->_transactionType == self::SHOPGATE_PAYMENT_STATUS_AUTH_CAPTURE) {
104
+ $this->_order->getPayment()->setIsTransactionPending(false);
105
+ }
106
+ break;
107
+ case self::RESPONSE_CODE_HELD:
108
+ if ($this->_isOrderPendingReview()) {
109
+ $this->_createTransaction($newTransactionType, array('is_transaction_fraud' => true));
110
+ $this->_order->getPayment()->setIsTransactionPending(true)->setIsFraudDetected(true);
111
+ }
112
+ break;
113
+ case self::RESPONSE_CODE_DECLINED:
114
+ case self::RESPONSE_CODE_ERROR:
115
+ Mage::throwException($paymentInfos['response_reason_text']);
116
+ break;
117
+ default:
118
+ Mage::throwException($defaultExceptionMessage);
119
+ }
120
+ } catch (Exception $x) {
121
+ $this->_order->addStatusHistoryComment(Mage::helper('sales')->__('Note: %s', $x->getMessage()));
122
+ Mage::logException($x);
123
+ }
124
+
125
+ $this->_createInvoice();
126
+ $this->_order->save();
127
+ return $this->_order;
128
+ }
129
+
130
+ /**
131
+ * Creates transaction for order
132
+ *
133
+ * @param $type
134
+ * @param $additionalInformation
135
+ */
136
+ protected function _createTransaction($type, $additionalInformation = array())
137
+ {
138
+ $orderPayment = $this->_order->getPayment();
139
+ $transaction = Mage::getModel('sales/order_payment_transaction');
140
+ $transaction->setOrderPaymentObject($orderPayment);
141
+ $transaction->setTxnId($orderPayment->getCcTransId());
142
+ $transaction->setIsClosed(false);
143
+ $transaction->setTxnType($type);
144
+ $transaction->setData('is_transaciton_closed', '0');
145
+ $transaction->setAdditionalInformation('real_transaction_id', $orderPayment->getCcTransId());
146
+ foreach ($additionalInformation as $key => $value) {
147
+ $transaction->setAdditionalInformation($key, $value);
148
+ }
149
+ $transaction->save();
150
+ }
151
+
152
+ /**
153
+ * Handles invoice creation
154
+ *
155
+ * @return $this
156
+ * @throws Exception
157
+ */
158
+ protected function _createInvoice()
159
+ {
160
+ $paymentInfos = $this->getShopgateOrder()->getPaymentInfos();
161
+
162
+ switch ($this->_responseCode) {
163
+ case self::RESPONSE_CODE_APPROVED:
164
+ if ($this->_transactionType == self::SHOPGATE_PAYMENT_STATUS_AUTH_CAPTURE) {
165
+ $invoice = $this->_getPaymentHelper()->createOrderInvoice($this->_order);
166
+ $invoice->setTransactionId($paymentInfos['transaction_id']); //needed for refund
167
+ $this->_order->getPayment()->setBaseAmountPaidOnline($invoice->getBaseGrandTotal());
168
+ $invoice->setIsPaid(true);
169
+ $invoice->pay();
170
+ $invoice->save();
171
+ $this->_order->addRelatedObject($invoice);
172
+ }
173
+ break;
174
+ case self::RESPONSE_CODE_HELD:
175
+ if ($this->_isOrderPendingReview()) {
176
+ $invoice = $this->_getPaymentHelper()->createOrderInvoice($this->_order);
177
+ $invoice->setTransactionId($paymentInfos['transaction_id']);
178
+ $invoice->setIsPaid(false);
179
+ $invoice->save();
180
+ $this->_order->addRelatedObject($invoice);
181
+ }
182
+ break;
183
+ }
184
+
185
+ return $this;
186
+ }
187
+
188
+ /**
189
+ * Sets order status
190
+ *
191
+ * @param Mage_Sales_Model_Order $order
192
+ * @return Mage_Sales_Model_Order
193
+ */
194
+ public function setOrderStatus($order = null)
195
+ {
196
+ $this->_initOrder($order);
197
+ $captured = $this->_order->getBaseCurrency()->formatTxt($this->_order->getBaseTotalInvoiced());
198
+ $state = Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW;
199
+ $status = $this->_getHelper()->getStatusFromState($state);
200
+ $message = '';
201
+
202
+ switch ($this->_responseCode) {
203
+ case self::RESPONSE_CODE_APPROVED:
204
+ $duePrice = $this->_order->getBaseCurrency()->formatTxt($this->_order->getTotalDue());
205
+ $message = Mage::helper('paypal')->__('Authorized amount of %s.', $duePrice);
206
+
207
+ if ($this->_transactionType == self::SHOPGATE_PAYMENT_STATUS_AUTH_CAPTURE) {
208
+ $message = Mage::helper('sales')->__('Captured amount of %s online.', $captured);
209
+ $status = Mage::getModel('authnetcim/method')->getConfigData('order_status');
210
+
211
+ if (!$status) {
212
+ $state = Mage_Sales_Model_Order::STATE_PROCESSING;
213
+ $status = $this->_getHelper()->getStatusFromState($state);
214
+ }
215
+ $state = $this->_getHelper()->getStateForStatus($status);
216
+ }
217
+ break;
218
+ case self::RESPONSE_CODE_HELD:
219
+ if ($this->_isOrderPendingReview()) {
220
+ $message = Mage::helper('sales')->__(
221
+ 'Capturing amount of %s is pending approval on gateway.',
222
+ $captured
223
+ );
224
+ $this->_order->setState($state, $status, $message);
225
+ }
226
+ break;
227
+ }
228
+ $this->_order->setState($state, $status, $message);
229
+ $order->setShopgateStatusSet(true);
230
+ return $order;
231
+ }
232
+
233
+ /**
234
+ * Handles the creation of AuthnCIM card & profile
235
+ *
236
+ * @return ParadoxLabs_AuthorizeNetCim_Model_Method
237
+ * @throws Exception
238
+ */
239
+ protected function _handleCard()
240
+ {
241
+ $shopgateOrder = $this->getShopgateOrder();
242
+ $paymentInfos = $shopgateOrder->getPaymentInfos();
243
+ $authorizeCim = Mage::getModel('authnetcim/method');
244
+ $card = $this->getCustomerCard();
245
+
246
+ $card->setMethodInstance($authorizeCim);
247
+ $card->importPaymentInfo($this->_order->getPayment());
248
+ $card->setAdditional('request_amount', $shopgateOrder->getAmountComplete());
249
+ $card->setAdditional('last_transaction_id', $paymentInfos['transaction_id']);
250
+ $card->setAdditional('processed_amount', $shopgateOrder->getAmountComplete());
251
+ $card->setAddress($this->_order->getBillingAddress());
252
+
253
+ if ($this->_transactionType == self::SHOPGATE_PAYMENT_STATUS_AUTH_CAPTURE) {
254
+ if ($this->_responseCode === self::RESPONSE_CODE_APPROVED || $this->_responseCode === self::RESPONSE_CODE_HELD) {
255
+ $card->setAdditional('captured_amount', $card->getAdditional('processed_amount'));
256
+ }
257
+ }
258
+ $card->save();
259
+ $authorizeCim->setCard($card);
260
+ return $authorizeCim;
261
+ }
262
+
263
+ /**
264
+ * Handles adding the correct customer to the order.
265
+ * Required for AuthnCIM creation. Call before _handleCard().
266
+ *
267
+ * @return Mage_Customer_Model_Customer
268
+ * @throws Mage_Core_Exception
269
+ */
270
+ protected function _getCustomer()
271
+ {
272
+ $shopgateOrder = $this->getShopgateOrder();
273
+ $customer = Mage::getModel('customer/customer');
274
+ $customer->setWebsiteId(Mage::app()->getWebsite()->getId());
275
+ $customer->loadByEmail($shopgateOrder->getMail());
276
+ if (!$customer->getId()) {
277
+ //no save, card will do that for us
278
+ $customer
279
+ ->setStore(Mage::app()->getStore())
280
+ ->setFirstname($shopgateOrder->getInvoiceAddress()->getFirstName())
281
+ ->setLastname($shopgateOrder->getInvoiceAddress()->getLastName())
282
+ ->setEmail($shopgateOrder->getMail())
283
+ ->setPassword(Mage::helper('core')->getRandomString(9));
284
+ }
285
+ return $customer;
286
+ }
287
+
288
+ /**
289
+ * Checks if the order response is pending review
290
+ *
291
+ * @return bool
292
+ */
293
+ private function _isOrderPendingReview()
294
+ {
295
+ $paymentInfos = $this->getShopgateOrder()->getPaymentInfos();
296
+ return array_key_exists('response_reason_code', $paymentInfos) && (
297
+ $paymentInfos['response_reason_code'] == self::RESPONSE_REASON_CODE_PENDING_REVIEW_AUTHORIZED
298
+ || $paymentInfos['response_reason_code'] == self::RESPONSE_REASON_CODE_PENDING_REVIEW
299
+ );
300
+ }
301
+
302
+ /**
303
+ * Needs to be the right customer, active and last four match
304
+ *
305
+ * @param $lastFour - last four digits of the credit card
306
+ * @return ParadoxLabs_TokenBase_Model_Card
307
+ */
308
+ private function _getCardByLastFour($lastFour)
309
+ {
310
+ $card = Mage::getModel('tokenbase/card')->getCollection();
311
+ $card->addFieldToFilter('active', array('eq' => 1));
312
+ $card->addFieldToFilter('customer_id', array('eq' => $this->_getCustomer()->getId()));
313
+ $card->addFieldToFilter('additional', array('like' => '%s:8:"cc_last4";s:4:"' . $lastFour . '";%'));
314
+ return $card->getFirstItem();
315
+ }
316
+
317
+ /**
318
+ * Use this method to check if we can get a $card object
319
+ * Then use regular Authorize when we cannot
320
+ *
321
+ * @return bool
322
+ */
323
+ public function checkGenericValid()
324
+ {
325
+ $card = $this->getCustomerCard();
326
+ if (!$card
327
+ || ($card instanceof Varien_Object
328
+ && !$card->getId())
329
+ ) {
330
+ return false;
331
+ }
332
+ return true;
333
+ }
334
+
335
+ /**
336
+ * Pulls a card from the database using last 4 digits
337
+ * or creates on from transaction_id. On most errors,
338
+ * returns false.
339
+ *
340
+ * @return false|ParadoxLabs_TokenBase_Model_Card
341
+ */
342
+ public function getCustomerCard()
343
+ {
344
+ $paymentInfos = $this->getShopgateOrder()->getPaymentInfos();
345
+ $lastFour = substr($paymentInfos['credit_card']['masked_number'], -4);
346
+ $card = $this->_getCardByLastFour($lastFour);
347
+
348
+ if (!$card->getData()) {
349
+ /** @var ParadoxLabs_TokenBase_Model_Card $card */
350
+ $card = Mage::getModel('authnetcim/card'); //for actual authentication
351
+ $card->setAdditional('cc_owner', $paymentInfos['credit_card']['holder']);
352
+ $card->setAdditional('customer_email', $this->getShopgateOrder()->getMail());
353
+ $card->setAdditional('cc_number', $lastFour);
354
+ $card->setAdditional('cc_last4', $lastFour);
355
+ $card->setMethod('authnetcim');
356
+ $card->setCustomer($this->_getCustomer());
357
+
358
+ /** @var Shopgate_Framework_Model_Payment_Cc_Authncim_Gateway $gateway */
359
+ $gateway = Mage::getModel('shopgate/payment_cc_authncim_method')->gateway();
360
+ try {
361
+ $response = $gateway->setParameter('transId', $paymentInfos['transaction_id'])
362
+ ->setParameter('cardNumber', 'XXXX' . $lastFour)
363
+ ->createCustomerProfileFromTransactionRequest();
364
+ } catch (Exception $e) {
365
+ ShopgateLogger::getInstance()->log($e->getMessage(), ShopgateLogger::LOGTYPE_DEBUG);
366
+ return false;
367
+ }
368
+
369
+ if (!isset($response['customerPaymentProfileId'])) {
370
+ $error = $this->_getHelper()->__('Could not retrieve AuthorizeCIM ProfileID from response');
371
+ ShopgateLogger::getInstance()->log($error, ShopgateLogger::LOGTYPE_DEBUG);
372
+ return false;
373
+ }
374
+ $card->setProfileId($response['customerProfileId']);
375
+ $card->setPaymentId($response['customerPaymentProfileId']);
376
+ $card->save();
377
+ }
378
+
379
+ return $card;
380
+ }
381
+ }
app/code/community/Shopgate/Framework/Model/Payment/Cc/Authncim/Gateway.php ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Added an additional call for AuthorizeCim gateway API
26
+ *
27
+ * Class Shopgate_Framework_Model_Payment_Cc_Authncim_Gateway
28
+ *
29
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
30
+ */
31
+ class Shopgate_Framework_Model_Payment_Cc_Authncim_Gateway extends ParadoxLabs_AuthorizeNetCim_Model_Gateway
32
+ {
33
+ protected $recursion_counter = 0;
34
+
35
+ /**
36
+ * AuthnCIM extension library did not allow us to make this
37
+ * request at the time. Had to inherit from gateway to use
38
+ * protected _runTransaction() method. We are creating a
39
+ * profileId and profilePaymentId base off of transactionId.
40
+ *
41
+ * @return array
42
+ */
43
+ public function createCustomerProfileFromTransactionRequest()
44
+ {
45
+ $result = array();
46
+ $params = array(
47
+ 'transId' => $this->getParameter('transId'),
48
+ );
49
+ $response = $this->_runTransaction('createCustomerProfileFromTransactionRequest', $params);
50
+ $errorCode = $response['messages']['message']['code'];
51
+ $errorText = $response['messages']['message']['text'];
52
+
53
+ if (isset($response['customerProfileId'], $response['customerPaymentProfileIdList']['numericString'])) {
54
+ $result['customerProfileId'] = $response['customerProfileId'];
55
+ $result['customerPaymentProfileId'] = $response['customerPaymentProfileIdList']['numericString'];
56
+ } elseif (isset($errorText)
57
+ && strpos($errorText, 'duplicate') !== false
58
+ ) {
59
+ $profileId = preg_replace('/[^0-9]/', '', $errorText);
60
+ /**
61
+ * If we have profileID from error, try to get paymentID based on card's last 4 digits
62
+ */
63
+ if (!empty($profileId)) {
64
+ $this->setParameter('customerProfileId', $profileId);
65
+ $profile = $this->getCustomerProfile();
66
+ $result['customerProfileId'] = $profileId;
67
+
68
+ if (isset($profile['profile']['paymentProfiles'])
69
+ && count($profile['profile']['paymentProfiles']) > 0
70
+ ) {
71
+ $lastFour = $this->getParameter('cardNumber');
72
+ //match profile that has the same last 4 card digits
73
+ foreach ($profile['profile']['paymentProfiles'] as $card) {
74
+ if (isset($card['payment']['creditCard'])
75
+ && $lastFour == substr($card['payment']['creditCard']['cardNumber'], -4)
76
+ ) {
77
+ $result['customerPaymentProfileId'] = $card['customerPaymentProfileId'];
78
+ break;
79
+ }
80
+ }
81
+ } else {
82
+ /**
83
+ * They don't have any cards in profile! Remove CIM profile & recurse.
84
+ * This can fail on refunding if original payment card bound to transaction
85
+ * does not match the imported card via Shopgate.
86
+ */
87
+ $this->deleteCustomerProfile();
88
+ if ($this->recursion_counter < 2) {
89
+ $result = $this->createCustomerProfileFromTransactionRequest();
90
+ $this->recursion_counter++; //not necessary, but protects from recursion leaks
91
+ }
92
+ }
93
+ } else {
94
+ /**
95
+ * weird gateway error that passed _runTransaction() error throw
96
+ */
97
+ $error = mage::helper('shopgate')->__(
98
+ 'Unknown error passed through _runTransaction validation. Code "%s" Message: "%s"',
99
+ $errorCode,
100
+ $errorText
101
+ );
102
+ ShopgateLogger::getInstance()->log($error, ShopgateLogger::LOGTYPE_ERROR);
103
+ }
104
+ }
105
+ return $result;
106
+ }
107
+ }
app/code/community/Shopgate/Framework/Model/Payment/Cc/Authncim/Method.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Extending method class for gateway initialization
26
+ *
27
+ * Class Shopgate_Framework_Model_Payment_Cc_Authncim_Method
28
+ *
29
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
30
+ */
31
+ class Shopgate_Framework_Model_Payment_Cc_Authncim_Method extends ParadoxLabs_AuthorizeNetCim_Model_Method
32
+ {
33
+ /**
34
+ * Call our rewritten Gateway and initialize login credentials
35
+ *
36
+ * @return null|Shopgate_Framework_Model_Payment_Cc_Authncim_Gateway
37
+ */
38
+ public function gateway()
39
+ {
40
+ if (is_null($this->_gateway)) {
41
+ $this->_gateway = Mage::getModel('shopgate/payment_cc_authncim_gateway');
42
+ $this->_gateway->init(
43
+ array(
44
+ 'login' => $this->getConfigData('login'),
45
+ 'password' => $this->getConfigData('trans_key'),
46
+ 'secret_key' => $this->getConfigData('secrey_key'),
47
+ 'test_mode' => $this->getConfigData('test')
48
+ )
49
+ );
50
+ }
51
+
52
+ return $this->_gateway;
53
+ }
54
+ }
app/code/community/Shopgate/Framework/Model/Payment/Cc/Usaepay.php ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Native model for usa epay
26
+ *
27
+ * @package Shopgate_Framework_Model_Payment_Usaepay
28
+ * @author Peter Liebig <p.liebig@me.com, peter.liebig@magcorp.de>
29
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
30
+ */
31
+ class Shopgate_Framework_Model_Payment_Cc_Usaepay extends Shopgate_Framework_Model_Payment_Cc_Abstract
32
+ {
33
+ const PAYMENT_IDENTIFIER = ShopgateOrder::USAEPAY_CC;
34
+ const XML_CONFIG_ENABLED = 'payment/usaepay/active';
35
+ const XML_CONFIG_STATUS_PAID = 'payment/usaepay/order_status';
36
+ const MODULE_CONFIG = 'Mage_Usaepay';
37
+
38
+ /**
39
+ * @param $order Mage_Sales_Model_Order
40
+ *
41
+ * @return Mage_Sales_Model_Order
42
+ */
43
+ public function manipulateOrderWithPaymentData($order)
44
+ {
45
+ $paymentInfos = $this->getShopgateOrder()->getPaymentInfos();
46
+ // changing order payment method here cause otherwise validation fails cause not CC number, no expiration date
47
+ $paymentUsaepay = Mage::getModel('usaepay/CCPaymentAction');
48
+ $order->getPayment()->setMethod($paymentUsaepay->getCode());
49
+ $paymentUsaepay->setInfoInstance($order->getPayment());
50
+ $order->getPayment()->setMethodInstance($paymentUsaepay);
51
+ $order->save();
52
+
53
+ $lastFour = substr($paymentInfos['credit_card']['masked_number'], -4);
54
+ $order->getPayment()->setCcNumberEnc($paymentInfos['credit_card']['masked_number']);
55
+ $order->getPayment()->setCCLast4($lastFour);
56
+ $order->getPayment()->setCcTransId($paymentInfos['reference_number']);
57
+ $order->getPayment()->setCcApproval($paymentInfos['authorization_number']);
58
+ $order->getPayment()->setCcType($this->_getCcTypeName($paymentInfos['credit_card']['type']));
59
+ $order->getPayment()->setCcOwner($paymentInfos['credit_card']['holder']);
60
+ $order->getPayment()->setLastTransId($paymentInfos['reference_number']);
61
+
62
+ // C or A type. no const in usa epay model for this
63
+ $paymentStatus = $this->getShopgateOrder()->getIsPaid() ? 'C' : 'A';
64
+ try {
65
+ $invoice = $this->_getPaymentHelper()->createOrderInvoice($order);
66
+ switch ($paymentStatus) {
67
+ case 'C':
68
+ $order->getPayment()->setAmountAuthorized($invoice->getGrandTotal());
69
+ $order->getPayment()->setBaseAmountAuthorized($invoice->getBaseGrandTotal());
70
+ $order->getPayment()->setBaseAmountPaidOnline($invoice->getBaseGrandTotal());
71
+ $invoice->setIsPaid(true);
72
+ $invoice->setTransactionId($paymentInfos['reference_number']);
73
+ $invoice->pay();
74
+ $invoice->save();
75
+ $order->addRelatedObject($invoice);
76
+ break;
77
+ case 'A':
78
+ $order->getPayment()->setAmountAuthorized($order->getGrandTotal());
79
+ $order->getPayment()->setBaseAmountAuthorized($order->getBaseGrandTotal());
80
+ $order->getPayment()->setIsTransactionPending(true);
81
+ $invoice->setIsPaid(false);
82
+ $invoice->save();
83
+ $order->addRelatedObject($invoice);
84
+ break;
85
+ default:
86
+ throw new Exception("Cannot handle payment status '{$paymentStatus}'.");
87
+ }
88
+ } catch (Exception $x) {
89
+ $order->addStatusHistoryComment(Mage::helper('sales')->__('Note: %s', $x->getMessage()));
90
+ Mage::logException($x);
91
+ }
92
+ return $order;
93
+ }
94
+
95
+ /**
96
+ * A bit dirty, but status setting can be complicated
97
+ *
98
+ * @param Mage_Sales_Model_Order $magentoOrder
99
+ * @return Mage_Sales_Model_Order
100
+ */
101
+ public function setOrderStatus($magentoOrder)
102
+ {
103
+ if ($this->getShopgateOrder()->getIsPaid()) {
104
+ $total = $magentoOrder->getBaseCurrency()->formatTxt($magentoOrder->getBaseGrandTotal());
105
+ $status = Mage::getStoreConfig(self::XML_CONFIG_STATUS_PAID, $magentoOrder->getStoreId());
106
+ if (!$status) {
107
+ $state = Mage_Sales_Model_Order::STATE_PROCESSING;
108
+ $status = Mage::helper('shopgate')->getStatusFromState($state);
109
+ } else {
110
+ $state = Mage::helper('shopgate')->getStateForStatus($status);
111
+ }
112
+ $message = Mage::helper('sales')->__('Captured amount of %s online.', $total);
113
+ } else {
114
+ $state = Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW;
115
+ $status = Mage::helper('shopgate')->getStatusFromState($state);
116
+ $due = $magentoOrder->getBaseCurrency()->formatTxt($magentoOrder->getTotalDue());
117
+ $message = Mage::helper('paypal')->__('Authorized amount of %s.', $due);
118
+ }
119
+
120
+ $magentoOrder->setState($state, $status, $message);
121
+ $magentoOrder->setShopgateStatusSet(true);
122
+
123
+ return $magentoOrder;
124
+ }
125
+ }
app/code/community/Shopgate/Framework/Model/Payment/Express.php CHANGED
@@ -18,191 +18,51 @@
18
  * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
  * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
  *
21
- * @author Shopgate GmbH <interfaces@shopgate.com>
22
- */
23
-
24
-
25
- /**
26
- * User: pliebig
27
- * Date: 10.09.14
28
- * Time: 10:05
29
- * E-Mail: p.liebig@me.com, peter.liebig@magcorp.de
30
  */
31
 
32
  /**
33
- * class to manipulate the order payment data with express data if wspp is active
34
- *
35
  * @package Shopgate_Framework_Model_Payment_Express
36
- * @author Peter Liebig <p.liebig@me.com, peter.liebig@magcorp.de>
 
37
  */
38
  class Shopgate_Framework_Model_Payment_Express
39
  {
 
40
  /**
41
  * create new order for paypal express (type wspp)
42
  *
 
43
  * @param $quote Mage_Sales_Model_Quote
44
  * @return Mage_Sales_Model_Order
45
  * @throws Exception
46
  */
47
  public function createNewOrder($quote)
48
  {
49
- $convert = Mage::getModel('sales/convert_quote');
50
- $transaction = Mage::getModel('core/resource_transaction');
51
-
52
- if ($quote->getCustomerId()) {
53
- $transaction->addObject($quote->getCustomer());
54
- }
55
- $quote->setTotalsCollectedFlag(true);
56
- $transaction->addObject($quote);
57
- if ($quote->isVirtual()) {
58
- $order = $convert->addressToOrder($quote->getBillingAddress());
59
- } else {
60
- $order = $convert->addressToOrder($quote->getShippingAddress());
61
- }
62
- $order->setBillingAddress($convert->addressToOrderAddress($quote->getBillingAddress()));
63
- if ($quote->getBillingAddress()->getCustomerAddress()) {
64
- $order->getBillingAddress()->setCustomerAddress($quote->getBillingAddress()->getCustomerAddress());
65
- }
66
- if (!$quote->isVirtual()) {
67
- $order->setShippingAddress($convert->addressToOrderAddress($quote->getShippingAddress()));
68
- if ($quote->getShippingAddress()->getCustomerAddress()) {
69
- $order->getShippingAddress()->setCustomerAddress($quote->getShippingAddress()->getCustomerAddress());
70
- }
71
- }
72
-
73
- $order->setPayment($convert->paymentToOrderPayment($quote->getPayment()));
74
- $order->getPayment()->setTransactionId($quote->getPayment()->getTransactionId());
75
-
76
- foreach ($quote->getAllItems() as $item) {
77
- /** @var Mage_Sales_Model_Order_Item $item */
78
- $orderItem = $convert->itemToOrderItem($item);
79
- if ($item->getParentItem()) {
80
- $orderItem->setParentItem($order->getItemByQuoteItemId($item->getParentItem()->getId()));
81
- }
82
- $order->addItem($orderItem);
83
- }
84
- $order->setQuote($quote);
85
- $order->setExtOrderId($quote->getPayment()->getTransactionId());
86
- $order->setCanSendNewEmailFlag(false);
87
- $transaction->addObject($order);
88
- $transaction->addCommitCallback(array($order, 'save'));
89
-
90
- try {
91
- $transaction->save();
92
- Mage::dispatchEvent(
93
- 'sales_model_service_quote_submit_success',
94
- array(
95
- 'order' => $order,
96
- 'quote' => $quote
97
- )
98
- );
99
- } catch (Exception $e) {
100
- //reset order ID's on exception, because order not saved
101
- $order->setId(null);
102
- /** @var $item Mage_Sales_Model_Order_Item */
103
- foreach ($order->getItemsCollection() as $item) {
104
- $item->setOrderId(null);
105
- $item->setItemId(null);
106
- }
107
-
108
- Mage::dispatchEvent(
109
- 'sales_model_service_quote_submit_failure',
110
- array(
111
- 'order' => $order,
112
- 'quote' => $quote
113
- )
114
- );
115
- throw $e;
116
- }
117
- Mage::dispatchEvent('checkout_submit_all_after', array('order' => $order, 'quote' => $quote));
118
- Mage::dispatchEvent('sales_model_service_quote_submit_after', array('order' => $order, 'quote' => $quote));
119
-
120
- return $order;
121
  }
122
 
123
  /**
 
124
  * @param $order Mage_Sales_Model_Order
125
  * @param $shopgateOrder ShopgateOrder
126
  * @return Mage_Sales_Model_Order
127
  */
128
  public function manipulateOrderWithPaymentData($order, $shopgateOrder)
129
  {
130
- $paymentInfos = $shopgateOrder->getPaymentInfos();
131
- $paymentStatus = $this->_getPaymentHelper()->filterPaymentStatus($paymentInfos['payment_status']);
132
- $trans = Mage::getModel('sales/order_payment_transaction');
133
- $trans->setOrderPaymentObject($order->getPayment());
134
- $trans->setTxnId($paymentInfos['transaction_id']);
135
- $trans->setIsClosed(false);
136
-
137
- try {
138
- switch ($paymentStatus) {
139
- // paid
140
- case Mage_Paypal_Model_Info::PAYMENTSTATUS_COMPLETED:
141
- $invoice = $this->_getPaymentHelper()->createOrderInvoice($order);
142
- $trans->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE);
143
-
144
- if ($order->getPayment()->getIsTransactionPending()) {
145
- $invoice->setIsPaid(false);
146
- } else { // normal online capture: invoice is marked as "paid"
147
- $invoice->setIsPaid(true);
148
- $invoice->pay();
149
- }
150
- $invoice->setTransactionId($paymentInfos['transaction_id']);
151
- $invoice->save();
152
- $order->addRelatedObject($invoice);
153
- break;
154
- case Mage_Paypal_Model_Info::PAYMENTSTATUS_PENDING:
155
- if(isset($paymentInfos['reason_code'])) {
156
- $order->getPayment()->setIsTransactionPending(true);
157
- $order->getPayment()->setIsFraudDetected(true);
158
- }
159
- $trans->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
160
- $order->getPayment()->setAmountAuthorized($order->getTotalDue());
161
- break;
162
- default:
163
- throw new Exception("Cannot handle payment status '{$paymentStatus}'.");
164
- }
165
- $trans->save();
166
- $this->_getPaymentHelper()->importPaymentInformation($order->getPayment(), $paymentInfos);
167
- $order->getPayment()->setTransactionAdditionalInfo(
168
- Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS,
169
- $paymentInfos
170
- );
171
-
172
- $order->getPayment()->setLastTransId($paymentInfos['transaction_id']);
173
- $this->_getPaymentHelper()->orderStatusManager($order, $paymentStatus);
174
-
175
- } catch (Exception $x) {
176
- $comment = $this->_getPaymentHelper()->createIpnComment(
177
- $order,
178
- Mage::helper('paypal')->__('Note: %s', $x->getMessage()),
179
- true
180
- );
181
- $comment->save();
182
- Mage::logException($x);
183
- }
184
- return $order;
185
  }
186
 
187
  /**
 
188
  * @param $quote Mage_Sales_Model_Quote
189
  * @param $data array
190
  * @return Mage_Sales_Model_Quote
191
  */
192
  public function prepareQuote($quote, $data)
193
  {
194
- $this->_getPaymentHelper()->importToPayment(
195
- $data,
196
- $quote->getPayment()->getMethodInstance()->getInfoInstance()
197
- );
198
- $quote->getPayment()->setTransactionId($data['transaction_id']);
199
- $quote->getPayment()->setLastTransId($data['transaction_id']);
200
- $quote->getPayment()->setPaypalPayerId($data['payer_id']);
201
- $quote->getPayment()->setPaypalPayerStatus($data['payer_status']);
202
- $quote->getPayment()->setAdditionalInformation('paypal_express_checkout_payer_id', $data['transaction_id']);
203
- $quote->getPayment()->setAdditionalInformation('paypal_pending_reason', $data['pending_reason']);
204
-
205
- return $quote;
206
  }
207
 
208
  /**
@@ -212,5 +72,4 @@ class Shopgate_Framework_Model_Payment_Express
212
  {
213
  return Mage::helper('shopgate/payment_wspp');
214
  }
215
-
216
  }
18
  * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
  * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
  *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
 
 
 
 
 
 
 
 
22
  */
23
 
24
  /**
25
+ * @deprecated v.2.9.18 - use Shopgate_Framework_Model_Payment_Pp_Paypal instead
 
26
  * @package Shopgate_Framework_Model_Payment_Express
27
+ * @author Peter Liebig <p.liebig@me.com, peter.liebig@magcorp.de
28
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
29
  */
30
  class Shopgate_Framework_Model_Payment_Express
31
  {
32
+
33
  /**
34
  * create new order for paypal express (type wspp)
35
  *
36
+ * @deprecated v.2.9.18
37
  * @param $quote Mage_Sales_Model_Quote
38
  * @return Mage_Sales_Model_Order
39
  * @throws Exception
40
  */
41
  public function createNewOrder($quote)
42
  {
43
+ return Mage::getModel('shopgate/payment_pp_paypal', new ShopgateOrder())->createNewOrder($quote);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  }
45
 
46
  /**
47
+ * @deprecated v.2.9.18
48
  * @param $order Mage_Sales_Model_Order
49
  * @param $shopgateOrder ShopgateOrder
50
  * @return Mage_Sales_Model_Order
51
  */
52
  public function manipulateOrderWithPaymentData($order, $shopgateOrder)
53
  {
54
+ return Mage::getModel('shopgate/payment_pp_paypal', $shopgateOrder)->manipulateOrderWithPaymentData($order);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  }
56
 
57
  /**
58
+ * @deprecated v.2.9.18
59
  * @param $quote Mage_Sales_Model_Quote
60
  * @param $data array
61
  * @return Mage_Sales_Model_Quote
62
  */
63
  public function prepareQuote($quote, $data)
64
  {
65
+ return Mage::getModel('shopgate/payment_pp_paypal', new ShopgateOrder())->prepareQuote($quote, $data);
 
 
 
 
 
 
 
 
 
 
 
66
  }
67
 
68
  /**
72
  {
73
  return Mage::helper('shopgate/payment_wspp');
74
  }
 
75
  }
app/code/community/Shopgate/Framework/Model/Payment/Factory.php ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Route methods to a correct Payment Class & its method
26
+ *
27
+ * Class Shopgate_Framework_Model_Payment_Factory
28
+ *
29
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
30
+ */
31
+ class Shopgate_Framework_Model_Payment_Factory extends Shopgate_Framework_Model_Payment_Abstract
32
+ {
33
+ protected $_payment_class = null;
34
+
35
+ /**
36
+ * @return bool|Shopgate_Framework_Model_Payment_Abstract
37
+ */
38
+ public function getPaymentClass()
39
+ {
40
+ if (!$this->_payment_class) {
41
+ $this->_payment_class = $this->calculatePaymentClass();
42
+ }
43
+ return $this->_payment_class;
44
+ }
45
+
46
+ /**
47
+ * @param Shopgate_Framework_Model_Payment_Abstract $paymentClass
48
+ */
49
+ public function setPaymentClass(Shopgate_Framework_Model_Payment_Abstract $paymentClass)
50
+ {
51
+ $this->_payment_class = $paymentClass;
52
+ }
53
+
54
+ /**
55
+ * Calculates the correct payment class needed
56
+ * Note: any class added here must inherit from Payment_Abstract
57
+ *
58
+ * @return bool|Shopgate_Framework_Model_Payment_Interface
59
+ * @throws Exception
60
+ */
61
+ public function calculatePaymentClass()
62
+ {
63
+ if ($this->isSimpleClass()):
64
+ return Mage::getModel('shopgate/payment_simple', $this->getShopgateOrder())->getMethodModel();
65
+ elseif ($this->isComplexClass()):
66
+ return Mage::getModel('shopgate/payment_router', $this->getShopgateOrder())->getMethodModel();
67
+ else:
68
+ return false;
69
+ endif;
70
+ }
71
+
72
+ /**
73
+ * Create order router
74
+ *
75
+ * @param Mage_Sales_Model_Quote $quote
76
+ * @return Mage_Sales_Model_Order
77
+ */
78
+ public function createNewOrder($quote)
79
+ {
80
+ if ($this->validatePaymentClass()) {
81
+ return $this->getPaymentClass()->createNewOrder($quote);
82
+ }
83
+ return parent::createNewOrder($quote);
84
+ }
85
+
86
+ /**
87
+ * Manipulate order router
88
+ *
89
+ * @param Mage_Sales_Model_Order $magentoOrder
90
+ * @return Mage_Sales_Model_Order
91
+ */
92
+ public function manipulateOrderWithPaymentData($magentoOrder)
93
+ {
94
+ if ($this->validatePaymentClass()) {
95
+ return $this->getPaymentClass()->manipulateOrderWithPaymentData($magentoOrder);
96
+ }
97
+ return parent::manipulateOrderWithPaymentData($magentoOrder);
98
+ }
99
+
100
+ /**
101
+ * Router for quoute preparation
102
+ *
103
+ * @param Mage_Sales_Model_Quote $quote
104
+ * @param $info
105
+ * @return Mage_Sales_Model_Quote
106
+ */
107
+ public function prepareQuote($quote, $info)
108
+ {
109
+ if ($this->validatePaymentClass()) {
110
+ return $this->getPaymentClass()->prepareQuote($quote, $info);
111
+ }
112
+ return parent::prepareQuote($quote, $info);
113
+ }
114
+
115
+ /**
116
+ * Router for order status setting
117
+ *
118
+ * @param Mage_Sales_Model_Order $magentoOrder
119
+ * @return mixed
120
+ */
121
+ public function setOrderStatus($magentoOrder)
122
+ {
123
+ if ($this->validatePaymentClass()) {
124
+ return $this->getPaymentClass()->setOrderStatus($magentoOrder);
125
+ }
126
+ return parent::setOrderStatus($magentoOrder);
127
+ }
128
+
129
+ /**
130
+ * Router for grabbing the correct payment model
131
+ *
132
+ * @return bool|mixed
133
+ */
134
+ public function getPaymentModel()
135
+ {
136
+ if ($this->validatePaymentClass()) {
137
+ return $this->getPaymentClass()->getPaymentModel();
138
+ }
139
+ return parent::getPaymentModel();
140
+ }
141
+
142
+ /**
143
+ * Checks if payment class exists, it is valid & has method
144
+ *
145
+ * @return bool
146
+ */
147
+ public function validatePaymentClass()
148
+ {
149
+ /** @var Shopgate_Framework_Model_Payment_Abstract $paymentClass */
150
+ $paymentClass = $this->getPaymentClass();
151
+
152
+ if ($paymentClass instanceof Shopgate_Framework_Model_Payment_Interface) {
153
+ if ($paymentClass && $paymentClass->isValid()) {
154
+ return true;
155
+ }
156
+ }
157
+ return false;
158
+ }
159
+
160
+ /**
161
+ * Check for identifier containment instead of equality
162
+ *
163
+ * @param $identifier - payment_id to test against
164
+ * @return bool
165
+ */
166
+ public function isPayment($identifier)
167
+ {
168
+ $parts = explode('_', $this->getPaymentMethod());
169
+ return in_array($identifier, $parts, true);
170
+ }
171
+
172
+ /**
173
+ * A simple class will contain only one word
174
+ * inside payment_method, e.g. PAYPAL
175
+ *
176
+ * @return bool
177
+ */
178
+ protected function isSimpleClass()
179
+ {
180
+ if ($this->getPaymentMethod()) {
181
+ $parts = explode('_', $this->getPaymentMethod());
182
+ return count($parts) === 1;
183
+ }
184
+ return false;
185
+ }
186
+
187
+ /**
188
+ * A complex class will contain more than one word
189
+ * inside a payment_method, e.g. AUTHN_CC
190
+ *
191
+ * @return bool
192
+ */
193
+ protected function isComplexClass()
194
+ {
195
+ if ($this->getPaymentMethod()) {
196
+ $parts = explode('_', $this->getPaymentMethod());
197
+ return count($parts) > 1;
198
+ }
199
+ return false;
200
+ }
201
+ }
app/code/community/Shopgate/Framework/Model/Payment/Interface.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Interface Shopgate_Framework_Model_Payment_Interface
26
+ *
27
+ * @author awesselburg <wesselburg@me.com>
28
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
29
+ */
30
+ interface Shopgate_Framework_Model_Payment_Interface
31
+ {
32
+ /**
33
+ * @param Mage_Sales_Model_Order $order
34
+ *
35
+ * @return Mage_Sales_Model_Order
36
+ */
37
+ public function manipulateOrderWithPaymentData($order);
38
+
39
+ /**
40
+ * @param Mage_Sales_Model_Quote $quote
41
+ *
42
+ * @return Mage_Sales_Model_Order
43
+ */
44
+ public function createNewOrder($quote);
45
+
46
+ /**
47
+ * @param Mage_Sales_Model_Quote $quote
48
+ * @param array $data
49
+ *
50
+ * @return Mage_Sales_Model_Quote
51
+ */
52
+ public function prepareQuote($quote, $data);
53
+
54
+ /**
55
+ * Used to set magento order status
56
+ *
57
+ * @param $magentoOrder
58
+ * @return mixed
59
+ */
60
+ public function setOrderStatus($magentoOrder);
61
+
62
+ /**
63
+ * Checks isValid, isEnabled, isModuleActive & checkGenericValid
64
+ *
65
+ * @return bool
66
+ */
67
+ public function isValid();
68
+
69
+ /**
70
+ * Checks if module is enabled based on XML_CONFIG_ENABLED constant
71
+ *
72
+ * @return mixed
73
+ */
74
+ public function isEnabled();
75
+
76
+ /**
77
+ * Checks if module is active based on MODULE_CONFIG constant
78
+ *
79
+ * @return bool
80
+ */
81
+ public function isModuleActive();
82
+
83
+ /**
84
+ * Generic validity check that can be overridden
85
+ *
86
+ * @return bool
87
+ */
88
+ public function checkGenericValid();
89
+
90
+ }
app/code/community/Shopgate/Framework/Model/Payment/MobilePayment.php CHANGED
@@ -18,7 +18,7 @@
18
  * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
  * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
  *
21
- * @author Shopgate GmbH <interfaces@shopgate.com>
22
  */
23
 
24
  /**
@@ -88,7 +88,7 @@ class Shopgate_Framework_Model_Payment_MobilePayment extends Mage_Payment_Model_
88
  * @var ShopgateOrder
89
  */
90
  protected $_shopgateOrder = null;
91
-
92
  /**
93
  * Payment code name
94
  *
18
  * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
  * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
  *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
  */
23
 
24
  /**
88
  * @var ShopgateOrder
89
  */
90
  protected $_shopgateOrder = null;
91
+
92
  /**
93
  * Payment code name
94
  *
app/code/community/Shopgate/Framework/Model/Payment/Payone/Abstract.php ADDED
@@ -0,0 +1,528 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+
25
+ /**
26
+ * This class is a fallback for all PayOne payment.
27
+ *
28
+ * Class Shopgate_Framework_Model_Payment_Payone_Abstract
29
+ *
30
+ * @author awesselburg <wesselburg@me.com>
31
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
32
+ */
33
+ class Shopgate_Framework_Model_Payment_Payone_Abstract extends Shopgate_Framework_Model_Payment_Abstract
34
+ {
35
+ const PAYONE_CORE_MODEL_CONFIG_IDENTIFIER = false;
36
+
37
+ const PAYMENT_IDENTIFIER = 'PAYONE';
38
+ const XML_CONFIG_ENABLED = 'payone_license_key';
39
+ const MODULE_CONFIG = 'Payone_Core';
40
+
41
+ /**
42
+ * @var Payone_Core_Model_Config
43
+ */
44
+ protected $_config;
45
+
46
+ /**
47
+ * @var Payone_Core_Model_System_Config_Abstract
48
+ */
49
+ protected $_systemConfig;
50
+
51
+ /** @var Varien_Object */
52
+ protected $_statusMapping = false;
53
+
54
+ /** @var null|int */
55
+ protected $_methodId;
56
+
57
+ /** @var null|bool */
58
+ protected $_transExists;
59
+
60
+ /**
61
+ * @param ShopgateOrder $shopgateOrder
62
+ */
63
+ public function __construct(ShopgateOrder $shopgateOrder)
64
+ {
65
+ $this->setShopgateOrder($shopgateOrder);
66
+ $this->_initConfigs();
67
+ }
68
+
69
+ /**
70
+ * @return $this
71
+ */
72
+ protected function _initConfigs()
73
+ {
74
+ $factory = Mage::getModel('payone_core/factory');
75
+ if (!$factory) {
76
+ return false;
77
+ }
78
+
79
+ /**
80
+ * prepare the system config model
81
+ */
82
+ switch ($this::PAYONE_CORE_MODEL_CONFIG_IDENTIFIER) {
83
+ case Payone_Core_Model_System_Config_PaymentMethodCode::ONLINEBANKTRANSFER :
84
+ $this->_systemConfig = $factory->getModelSystemConfigOnlinebanktransferType();
85
+ $this->_statusMapping = new Varien_Object(
86
+ $this->getConfig()->getGeneral()->getStatusMapping()->getOnlinebanktransfer()
87
+ );
88
+ break;
89
+ case Payone_Core_Model_System_Config_PaymentMethodCode::CREDITCARD :
90
+ $this->_systemConfig = $factory->getModelSystemConfigCreditCardType();
91
+ $this->_statusMapping = new Varien_Object(
92
+ $this->getConfig()->getGeneral()->getStatusMapping()->getCreditcard()
93
+ );
94
+ break;
95
+ case Payone_Core_Model_System_Config_PaymentMethodCode::DEBITPAYMENT :
96
+ $this->_systemConfig = $factory->getModelSystemConfigPaymentMethodType();
97
+ $this->_statusMapping = new Varien_Object(
98
+ $this->getConfig()->getGeneral()->getStatusMapping()->getDebitPayment()
99
+ );
100
+ break;
101
+ case Payone_Core_Model_System_Config_PaymentMethodCode::SAFEINVOICE :
102
+ $this->_systemConfig = $factory->getModelSystemConfigSafeInvoiceType();
103
+ $this->_statusMapping = new Varien_Object(
104
+ $this->getConfig()->getGeneral()->getStatusMapping()->getSafeInvoice()
105
+ );
106
+ break;
107
+ case Payone_Core_Model_System_Config_PaymentMethodCode::ADVANCEPAYMENT :
108
+ //$this->_systemConfig = $factory->getModelConfigType();
109
+ $this->_statusMapping = new Varien_Object(
110
+ $this->getConfig()->getGeneral()->getStatusMapping()->getAdvancepayment()
111
+ );
112
+ break;
113
+ case Payone_Core_Model_System_Config_PaymentMethodCode::INVOICE :
114
+ //todo: not sure if it's needed for all payment methods
115
+ //$this->_systemConfig = $factory->getInvoice();
116
+ $this->_statusMapping = new Varien_Object(
117
+ $this->getConfig()->getGeneral()->getStatusMapping()->getInvoice()
118
+ );
119
+ break;
120
+ case Payone_Core_Model_System_Config_PaymentMethodCode::WALLET :
121
+ $this->_systemConfig = $factory->getModelSystemConfigWalletType();
122
+ $this->_statusMapping = new Varien_Object(
123
+ $this->getConfig()->getGeneral()->getStatusMapping()->getWallet()
124
+ );
125
+ break;
126
+ }
127
+
128
+ return $this;
129
+ }
130
+
131
+ /**
132
+ * @return Payone_Core_Model_Config
133
+ */
134
+ public function getConfig()
135
+ {
136
+ if (!$this->_config) {
137
+ $service = Mage::getSingleton('payone_core/service_initializeConfig');
138
+ $service->setFactory(Mage::getModel('payone_core/factory'));
139
+ $this->_config = $service->execute();
140
+ }
141
+ return $this->_config;
142
+ }
143
+
144
+ /**
145
+ * @return Payone_Core_Model_System_Config_Abstract
146
+ */
147
+ public function getSystemConfig()
148
+ {
149
+ return $this->_systemConfig;
150
+ }
151
+
152
+ /**
153
+ * @return ShopgateOrder
154
+ */
155
+ public function getShopgateOrder()
156
+ {
157
+ return $this->_shopgate_order;
158
+ }
159
+
160
+ /**
161
+ * Left blank on purpose, no fallback
162
+ *
163
+ * @return false
164
+ */
165
+ public function getMethodType()
166
+ {
167
+ return $this->getPaymentModel()->getMethodType();
168
+ }
169
+
170
+ /**
171
+ * @return bool
172
+ */
173
+ protected function _getConfigCode()
174
+ {
175
+ return false;
176
+ }
177
+
178
+ /**
179
+ * @return Shopgate_Framework_Helper_Payment_Payone
180
+ */
181
+ protected function _getPaymentHelper()
182
+ {
183
+ return Mage::helper('shopgate/payment_payone');
184
+ }
185
+
186
+ /**
187
+ * @param Mage_Sales_Model_Quote $quote
188
+ *
189
+ * @return Mage_Sales_Model_Order
190
+ */
191
+ public function createNewOrder($quote)
192
+ {
193
+ $shopgateOrder = $this->getShopgateOrder();
194
+ $convert = Mage::getModel('sales/convert_quote');
195
+ $transaction = Mage::getModel('core/resource_transaction');
196
+ $SgPaymentInfos = $shopgateOrder->getPaymentInfos();
197
+
198
+ if ($quote->getCustomerId()) {
199
+ $transaction->addObject($quote->getCustomer());
200
+ }
201
+ $quote->setTotalsCollectedFlag(true);
202
+ $transaction->addObject($quote);
203
+ if ($quote->isVirtual()) {
204
+ $order = $convert->addressToOrder($quote->getBillingAddress());
205
+ } else {
206
+ $order = $convert->addressToOrder($quote->getShippingAddress());
207
+ }
208
+ $order->setBillingAddress($convert->addressToOrderAddress($quote->getBillingAddress()));
209
+ if ($quote->getBillingAddress()->getCustomerAddress()) {
210
+ $order->getBillingAddress()->setCustomerAddress($quote->getBillingAddress()->getCustomerAddress());
211
+ }
212
+ if (!$quote->isVirtual()) {
213
+ $order->setShippingAddress($convert->addressToOrderAddress($quote->getShippingAddress()));
214
+ if ($quote->getShippingAddress()->getCustomerAddress()) {
215
+ $order->getShippingAddress()->setCustomerAddress($quote->getShippingAddress()->getCustomerAddress());
216
+ }
217
+ }
218
+
219
+ $order->setPayment($convert->paymentToOrderPayment($quote->getPayment()));
220
+ $order->getPayment()->setTransactionId($quote->getPayment()->getLastTransId());
221
+
222
+ $order->getPayment()->setLastTransId($quote->getPayment()->getLastTransId());
223
+ $order->setPayoneTransactionStatus($SgPaymentInfos['status']);
224
+
225
+ foreach ($quote->getAllItems() as $item) {
226
+ /** @var Mage_Sales_Model_Order_Item $item */
227
+ $orderItem = $convert->itemToOrderItem($item);
228
+ if ($item->getParentItem()) {
229
+ $orderItem->setParentItem($order->getItemByQuoteItemId($item->getParentItem()->getId()));
230
+ }
231
+ $order->addItem($orderItem);
232
+ }
233
+ $order->setQuote($quote);
234
+ $order->setExtOrderId($quote->getPayment()->getTransactionId());
235
+ $order->setCanSendNewEmailFlag(false);
236
+
237
+ $order->getPayment()->setData('payone_config_payment_method_id', $this->_getMethodId());
238
+
239
+ return $this->setOrder($order);
240
+ }
241
+
242
+ /**
243
+ * @param Mage_Sales_Model_Order $order
244
+ *
245
+ * @return Mage_Sales_Model_Order
246
+ */
247
+ public function manipulateOrderWithPaymentData($order = null)
248
+ {
249
+ $paymentPayone = $this->getPaymentModel();
250
+
251
+ if ($paymentPayone) {
252
+ $this->getOrder()->getPayment()->setMethod($paymentPayone->getCode());
253
+ $paymentPayone->setInfoInstance($this->getOrder()->getPayment());
254
+ $this->getOrder()->getPayment()->setMethodInstance($paymentPayone);
255
+ }
256
+
257
+ /**
258
+ * Bank account detail setter
259
+ */
260
+ $info = $this->getShopgateOrder()->getPaymentInfos();
261
+ if (isset($info['bank_account'])) {
262
+ foreach ($info['bank_account'] as $key => $value) {
263
+ /** @var $field ShopgateOrderCustomField */
264
+ switch ($key) {
265
+ case 'bic':
266
+ $this->getOrder()->getPayment()->setPayoneSepaBic($value);
267
+ break;
268
+ case 'bank_code':
269
+ $this->getOrder()->getPayment()->setPayoneBankCode($value);
270
+ break;
271
+ case 'iban':
272
+ $this->getOrder()->getPayment()->setPayoneSepaIban($value);
273
+ break;
274
+ case 'bank_account_number':
275
+ $this->getOrder()->getPayment()->setPayoneAccountNumber($value);
276
+ break;
277
+ case 'bank_account_holder':
278
+ $this->getOrder()->getPayment()->setPayoneAccountOwner($value);
279
+ break;
280
+ }
281
+ }
282
+ }
283
+ $this->getOrder()->save();
284
+ $this->_addTransaction();
285
+
286
+ return $this->getOrder();
287
+ }
288
+
289
+ /**
290
+ * Crates PayOne transaction for refund purposes
291
+ *
292
+ * @throws Payone_Core_Exception_TransactionAlreadyExists
293
+ */
294
+ protected function _addTransaction()
295
+ {
296
+ /**
297
+ * Faking a response from gateway
298
+ */
299
+ $this->getOrder()->getPayment()->setMethodInstance($this->getPaymentModel());
300
+ $request = $this->_createFakeRequest();
301
+ $response = $this->_createFakeResponse();
302
+
303
+ /** @var Payone_Core_Model_Handler_Payment_Abstract $handler */
304
+ $handler = $this->_getPayoneHandler();
305
+ $handler->setConfigStore($this->getConfig());
306
+ $handler->setPayment($this->getOrder()->getPayment());
307
+ $handler->setRequest($request);
308
+ $handler->handle($response);
309
+ }
310
+
311
+ /**
312
+ * Creates fake initial request object
313
+ *
314
+ * @param null|Payone_Api_Request_Authorization|Payone_Api_Request_Preauthorization $request
315
+ * @return Payone_Api_Request_Authorization|Payone_Api_Request_Preauthorization
316
+ */
317
+ protected function _createFakeRequest($request = null)
318
+ {
319
+ $factory = Mage::getModel('payone_core/factory');
320
+ $info = $this->getShopgateOrder()->getPaymentInfos();
321
+
322
+ if (!$request) {
323
+ if ($info['request_type'] === 'authorization') {
324
+ $request = $factory->getRequestPaymentAuthorization();
325
+ } else {
326
+ $request = $factory->getRequestPaymentPreauthorize();
327
+ }
328
+ }
329
+
330
+ $request->setClearingtype($info['clearing_type']);
331
+ $request->setMode($info['mode']);
332
+ $request->setMid($info['mid']);
333
+ $request->setAid($info['aid']);
334
+ $request->setPortalid($info['portalid']);
335
+
336
+ return $request;
337
+ }
338
+
339
+ /**
340
+ * Crete fake response object to feed PayOne handler
341
+ *
342
+ * @param null|Payone_Api_Response_Authorization_Approved|Payone_Api_Response_Preauthorization_Approved $response
343
+ * @return Payone_Api_Response_Authorization_Approved|Payone_Api_Response_Preauthorization_Approved
344
+ */
345
+ protected function _createFakeResponse($response = null)
346
+ {
347
+ $info = $this->getShopgateOrder()->getPaymentInfos();
348
+
349
+ if (!$response) {
350
+ $response = $this->_getPayoneResponse();
351
+ }
352
+
353
+ foreach ($info as $key => $val) {
354
+ switch ($key) {
355
+ case 'txid':
356
+ $response->setTxid($info[$key]);
357
+ break;
358
+ case 'userid':
359
+ $response->setUserid($info[$key]);
360
+ break;
361
+ case 'status':
362
+ $response->setStatus($info[$key]);
363
+ break;
364
+ }
365
+ }
366
+ return $response;
367
+ }
368
+
369
+ /**
370
+ * @param Mage_Sales_Model_Quote $quote
371
+ * @param array $data
372
+ *
373
+ * @return Mage_Sales_Model_Quote
374
+ */
375
+ public function prepareQuote($quote, $data)
376
+ {
377
+ $quote->getPayment()->setLastTransId($data['txid']);
378
+ return $quote;
379
+ }
380
+
381
+ /**
382
+ * Setting for default magento status
383
+ *
384
+ * @param $magentoOrder Mage_Sales_Model_Order
385
+ * @return mixed
386
+ */
387
+ public function setOrderStatus($magentoOrder)
388
+ {
389
+ $paid = $this->getShopgateOrder()->getIsPaid() ? 'paid' : 'appointed';
390
+ $mapping = $this->_getPayoneStateMapping($paid);
391
+ $message = $this->_getHelper()->__('[SHOPGATE] Using PayOne configured status');
392
+
393
+ //status fallback
394
+ if (empty($mapping)) {
395
+ $mapping['state'] = Mage_Sales_Model_Order::STATE_PROCESSING;
396
+ $mapping['status'] = $this->_getHelper()->getStatusFromState($mapping['state']);
397
+ $message = $this->_getHelper()->__('[SHOPGATE] Using default order status');
398
+ }
399
+
400
+ $magentoOrder->setState($mapping['state'], $mapping['status'], $message);
401
+ $magentoOrder->setShopgateStatusSet(true);
402
+
403
+ return $magentoOrder;
404
+ }
405
+
406
+ /**
407
+ * @param $key
408
+ *
409
+ * @return mixed
410
+ */
411
+ protected function _getPayoneStateMapping($key)
412
+ {
413
+ if ($this->_statusMapping instanceof Varien_Object) {
414
+ return $this->_statusMapping->hasData($key)
415
+ ? $this->_statusMapping->getData($key)
416
+ : false;
417
+ }
418
+
419
+ return false;
420
+ }
421
+
422
+ public function isEnabled()
423
+ {
424
+ if (version_compare($this->_getVersion(), '3.3.0', '>=')) {
425
+ parent::isEnabled();
426
+ }
427
+ $val = Mage::getStoreConfig('payone_general/global/key');
428
+ return !empty($val);
429
+ }
430
+
431
+ /**
432
+ * Checks if config is found for this method
433
+ * && transaction does not already exists
434
+ * && payOne API response is APPROVED
435
+ * Else fallback import with Shogate Mobile Payment Method
436
+ *
437
+ * @return bool
438
+ */
439
+ public function checkGenericValid()
440
+ {
441
+ $methodId = $this->_getMethodId();
442
+ $transExists = $this->_getPayoneTransactionExist();
443
+ $response = $this->_getPayoneResponse();
444
+ return !empty($methodId) && !$transExists && $response;
445
+ }
446
+
447
+ /**
448
+ * Gets method ID if it is possible
449
+ *
450
+ * @return int|false
451
+ */
452
+ protected function _getMethodId()
453
+ {
454
+ if ($this->_methodId === null) {
455
+ $this->_methodId = $this->_getPaymentHelper()
456
+ ->getMethodId($this->getConfig(), $this->getMethodType());
457
+ }
458
+ return $this->_methodId;
459
+ }
460
+
461
+ /**
462
+ * Checks if PayOne transaction already exists
463
+ *
464
+ * @return bool
465
+ */
466
+ protected function _getPayoneTransactionExist()
467
+ {
468
+ if ($this->_transExists === null) {
469
+ $info = $this->getShopgateOrder()->getPaymentInfos();
470
+ $factory = Mage::getModel('payone_core/factory');
471
+
472
+ if (isset($info['txid']) && $factory) {
473
+ $transaction = $factory->getModelTransaction();
474
+ if ($transaction->load($info['txid'], 'txid')->hasData()) {
475
+ $debug = $this->_getHelper()->__('PayOne transaction "%s" already exists', $transaction->getTxid());
476
+ ShopgateLogger::getInstance()->log($debug, ShopgateLogger::LOGTYPE_DEBUG);
477
+ return $this->_transExists = true;
478
+ }
479
+ } else {
480
+ $debug = $this->_getHelper()->__('Either "txid" or PayOne: Factory cannot be loaded');
481
+ ShopgateLogger::getInstance()->log($debug, ShopgateLogger::LOGTYPE_DEBUG);
482
+ }
483
+ } else {
484
+ return $this->_transExists;
485
+ }
486
+ return $this->_transExists = false;
487
+ }
488
+
489
+ /**
490
+ * Retrieve PayOne response based on ShopgateOrder
491
+ *
492
+ * @return Payone_Api_Response_Authorization_Approved|Payone_Api_Response_Preauthorization_Approved|false
493
+ */
494
+ protected function _getPayoneResponse()
495
+ {
496
+ $info = $this->getShopgateOrder()->getPaymentInfos();
497
+ if ($info['status'] == 'APPROVED') {
498
+ if ($info['request_type'] === 'authorization') {
499
+ return new Payone_Api_Response_Authorization_Approved();
500
+ } else {
501
+ return new Payone_Api_Response_Preauthorization_Approved();
502
+ }
503
+ }
504
+ $debug = mage::helper('shopgate')->__('Order "status" was not approved');
505
+ ShopgateLogger::getInstance()->log($debug, ShopgateLogger::LOGTYPE_ERROR);
506
+ return false;
507
+ }
508
+
509
+ /**
510
+ * Get proper handler
511
+ *
512
+ * @return Payone_Core_Model_Handler_Payment_Authorize|Payone_Core_Model_Handler_Payment_Preauthorize
513
+ */
514
+ private function _getPayoneHandler()
515
+ {
516
+ /** @var Payone_Core_Model_Factory $factory */
517
+ $factory = Mage::getModel('payone_core/factory');
518
+ $paymentConfig = Mage::getModel('payone_core/config_payment_method');
519
+ $info = $this->getShopgateOrder()->getPaymentInfos();
520
+ $type = $info['request_type'];
521
+
522
+ if ($type === 'authorization') {
523
+ return $factory->getHandlerPaymentAuthorize($paymentConfig);
524
+ }
525
+
526
+ return $factory->getHandlerPaymentPreauthorize($paymentConfig);
527
+ }
528
+ }
app/code/community/Shopgate/Framework/Model/Payment/Payone/BankAbstract.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+
25
+ /**
26
+ * Handler for all online bank transfer payment interfaces
27
+ *
28
+ * Note: any online bank transfer config needs to be enabled for
29
+ * Giro, Ideal, SUE to work, they don't actually need to be selected.
30
+ *
31
+ * @package Class Shopgate_Framework_Model_Payment_Payone_BankAbstract
32
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
33
+ */
34
+ class Shopgate_Framework_Model_Payment_Payone_BankAbstract extends Shopgate_Framework_Model_Payment_Payone_Abstract
35
+ {
36
+ const PAYONE_CORE_MODEL_CONFIG_IDENTIFIER = 'payone_online_bank_transfer';
37
+ const PAYMENT_MODEL = 'payone_core/payment_method_onlineBankTransfer';
38
+
39
+ /**
40
+ * @param Mage_Sales_Model_Order $order
41
+ * @return Mage_Sales_Model_Order
42
+ * @throws Exception
43
+ */
44
+ public function manipulateOrderWithPaymentData($order)
45
+ {
46
+ $this->getOrder()->getPayment()->setPayoneOnlinebanktransferType($this->_getConfigCode());
47
+
48
+ return parent::manipulateOrderWithPaymentData();
49
+ }
50
+
51
+ }
app/code/community/Shopgate/Framework/Model/Payment/Payone/Cc.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Class Shopgate_Framework_Model_Payment_Payone_Cc
26
+ *
27
+ * @author awesselburg <wesselburg@me.com>
28
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
29
+ */
30
+ class Shopgate_Framework_Model_Payment_Payone_Cc
31
+ extends Shopgate_Framework_Model_Payment_Payone_Abstract
32
+ implements Shopgate_Framework_Model_Payment_Interface
33
+ {
34
+ const PAYONE_CORE_MODEL_CONFIG_IDENTIFIER = 'payone_creditcard';
35
+ const PAYMENT_MODEL = 'payone_core/payment_method_creditcard';
36
+ const PAYMENT_IDENTIFIER = ShopgateOrder::PAYONE_CC;
37
+
38
+ /**
39
+ * @param Mage_Sales_Model_Order $order
40
+ *
41
+ * @return Mage_Sales_Model_Order
42
+ * @throws Exception
43
+ */
44
+ public function manipulateOrderWithPaymentData($order)
45
+ {
46
+ $paymentInfo = $this->getShopgateOrder()->getPaymentInfos();
47
+
48
+ $this->getOrder()->getPayment()->setCcType($this->_getConfigCode());
49
+ $this->getOrder()->getPayment()->setCcOwner($paymentInfo['credit_card']['holder']);
50
+ $this->getOrder()->getPayment()->setCcNumberEnc($paymentInfo['credit_card']['masked_number']);
51
+
52
+ return parent::manipulateOrderWithPaymentData();
53
+ }
54
+
55
+ /**
56
+ * @return bool|string
57
+ */
58
+ protected function _getConfigCode()
59
+ {
60
+ /**
61
+ * @var array
62
+ */
63
+ $paymentInfo = $this->getShopgateOrder()->getPaymentInfos();
64
+
65
+ /**
66
+ * @var string $key
67
+ * @var string $value
68
+ *
69
+ * @todo check mapping
70
+ */
71
+ foreach ($this->getSystemConfig()->toSelectArray() as $key => $value) {
72
+ if (strtolower($value) == $paymentInfo['credit_card']['type']) {
73
+ return $key;
74
+ }
75
+ }
76
+
77
+ return false;
78
+ }
79
+
80
+ }
app/code/community/Shopgate/Framework/Model/Payment/Payone/Dbt.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Class Shopgate_Framework_Model_Payment_Payone_Dbt
26
+ *
27
+ * @author awesselburg <wesselburg@me.com>
28
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
29
+ */
30
+ class Shopgate_Framework_Model_Payment_Payone_Dbt
31
+ extends Shopgate_Framework_Model_Payment_Payone_Abstract
32
+ implements Shopgate_Framework_Model_Payment_Interface
33
+ {
34
+ const PAYONE_CORE_MODEL_CONFIG_IDENTIFIER = 'payone_debit_payment';
35
+ const PAYMENT_MODEL = 'payone_core/payment_method_debitPayment';
36
+ const PAYMENT_IDENTIFIER = ShopgateOrder::PAYONE_DBT;
37
+
38
+ }
app/code/community/Shopgate/Framework/Model/Payment/Payone/Gp.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Class Shopgate_Framework_Model_Payment_Payone_Gp
26
+ *
27
+ * @author awesselburg <wesselburg@me.com>
28
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
29
+ */
30
+ class Shopgate_Framework_Model_Payment_Payone_Gp
31
+ extends Shopgate_Framework_Model_Payment_Payone_BankAbstract
32
+ implements Shopgate_Framework_Model_Payment_Interface
33
+ {
34
+ const PAYMENT_IDENTIFIER = ShopgateOrder::PAYONE_GP;
35
+
36
+ /**
37
+ * @return string
38
+ */
39
+ protected function _getConfigCode()
40
+ {
41
+ return Payone_Api_Enum_OnlinebanktransferType::GIROPAY;
42
+ }
43
+
44
+ }
app/code/community/Shopgate/Framework/Model/Payment/Payone/Idl.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Handler for Payone IDEAL bank transfer payment method
26
+ *
27
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
28
+ */
29
+ class Shopgate_Framework_Model_Payment_Payone_Idl
30
+ extends Shopgate_Framework_Model_Payment_Payone_BankAbstract
31
+ implements Shopgate_Framework_Model_Payment_Interface
32
+ {
33
+ const PAYMENT_IDENTIFIER = ShopgateOrder::PAYONE_IDL;
34
+
35
+ /**
36
+ * @return string
37
+ */
38
+ protected function _getConfigCode()
39
+ {
40
+ return Payone_Api_Enum_OnlinebanktransferType::IDEAL;
41
+ }
42
+ }
app/code/community/Shopgate/Framework/Model/Payment/Payone/Inv.php ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Class Shopgate_Framework_Model_Payment_Payone_Inv
26
+ *
27
+ * @author awesselburg <wesselburg@me.com>
28
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
29
+ */
30
+ class Shopgate_Framework_Model_Payment_Payone_Inv
31
+ extends Shopgate_Framework_Model_Payment_Payone_Abstract
32
+ implements Shopgate_Framework_Model_Payment_Interface
33
+ {
34
+ const PAYONE_CORE_MODEL_CONFIG_IDENTIFIER = 'payone_invoice';
35
+ const PAYMENT_MODEL = 'payone_core/payment_method_invoice';
36
+ const PAYMENT_IDENTIFIER = ShopgateOrder::PAYONE_INV;
37
+
38
+ /**
39
+ * @param Mage_Sales_Model_Order $order
40
+ * @return Mage_Sales_Model_Order
41
+ * @throws Exception
42
+ */
43
+ public function manipulateOrderWithPaymentData($order)
44
+ {
45
+ $info = $this->getShopgateOrder()->getPaymentInfos();
46
+
47
+ if (isset($info['clearing_bankaccountholder'])) {
48
+ $this->getOrder()->getPayment()->setPayoneClearingBankAccountholder($info['clearing_bankaccountholder']);
49
+ }
50
+ if (isset($info['clearing_bankcountry'])) {
51
+ $this->getOrder()->getPayment()->setPayoneClearingBankCountry($info['clearing_bankcountry']);
52
+ }
53
+ if (isset($info['clearing_bankaccount'])) {
54
+ $this->getOrder()->getPayment()->setPayoneClearingBankAccount($info['clearing_bankaccount']);
55
+ }
56
+ if (isset($info['clearing_bankcode'])) {
57
+ $this->getOrder()->getPayment()->setPayoneClearingBankCode($info['clearing_bankcode']);
58
+ }
59
+ if (isset($info['clearing_bankcity'])) {
60
+ $this->getOrder()->getPayment()->setPayoneClearingBankCity($info['clearing_bankcity']);
61
+ }
62
+ if (isset($info['clearing_bankname'])) {
63
+ $this->getOrder()->getPayment()->setPayoneClearingBankName($info['clearing_bankname']);
64
+ }
65
+ if (isset($info['clearing_bankiban'])) {
66
+ $this->getOrder()->getPayment()->setPayoneClearingBankIban(strtoupper($info['clearing_bankiban']));
67
+ }
68
+ if (isset($info['clearing_bankbic'])) {
69
+ $this->getOrder()->getPayment()->setPayoneClearingBankBic(strtoupper($info['clearing_bankbic']));
70
+ }
71
+
72
+ return parent::manipulateOrderWithPaymentData($this->getOrder());
73
+ }
74
+
75
+ /**
76
+ * Rewritten to add additional clearing parameters to response
77
+ *
78
+ * @param null|Payone_Api_Response_Authorization_Approved|Payone_Api_Response_Preauthorization_Approved $response
79
+ * @return Payone_Api_Response_Authorization_Approved|Payone_Api_Response_Preauthorization_Approved
80
+ */
81
+ protected function _createFakeResponse($response = null)
82
+ {
83
+ $info = $this->getShopgateOrder()->getPaymentInfos();
84
+
85
+ $response = $this->_getPayoneResponse();
86
+
87
+ /** @var Payone_Api_Response_Authorization_Approved | Payone_Api_Response_Preauthorization_Approved $response */
88
+ foreach ($info as $key => $val) {
89
+ switch ($key) {
90
+ case 'clearing_bankaccount':
91
+ $response->setClearingBankaccount($info[$key]);
92
+ break;
93
+ case 'clearing_bankcode':
94
+ $response->setClearingBankcode($info[$key]);
95
+ break;
96
+ case 'clearing_bankcountry':
97
+ $response->setClearingBankcountry($info[$key]);
98
+ break;
99
+ case 'clearing_bankname':
100
+ $response->setClearingBankname($info[$key]);
101
+ break;
102
+ case 'clearing_bankaccountholder':
103
+ $response->setClearingBankaccountholder($info[$key]);
104
+ break;
105
+ case 'clearing_bankcity':
106
+ $response->setClearingBankcity($info[$key]);
107
+ break;
108
+ case 'clearing_bankiban':
109
+ $response->setClearingBankiban($info[$key]);
110
+ break;
111
+ case 'clearing_bankbic':
112
+ $response->setClearingBankbic($info[$key]);
113
+ break;
114
+ }
115
+ }
116
+ return parent::_createFakeResponse($response);
117
+ }
118
+
119
+ }
app/code/community/Shopgate/Framework/Model/Payment/Payone/Klv.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Payone handler for Klarna payment method
26
+ *
27
+ * Class Shopgate_Framework_Model_Payment_Payone_Klv
28
+ *
29
+ * @author: Konstantin Kiritsenko <konstantin@kiritsenko.com>
30
+ */
31
+ class Shopgate_Framework_Model_Payment_Payone_Klv
32
+ extends Shopgate_Framework_Model_Payment_Payone_Abstract
33
+ implements Shopgate_Framework_Model_Payment_Interface
34
+ {
35
+ const PAYONE_CORE_MODEL_CONFIG_IDENTIFIER = 'payone_safe_invoice';
36
+ const PAYMENT_MODEL = 'payone_core/payment_method_safeInvoice';
37
+ const PAYMENT_IDENTIFIER = ShopgateOrder::PAYONE_KLV;
38
+
39
+ }
app/code/community/Shopgate/Framework/Model/Payment/Payone/Pp.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Class Shopgate_Framework_Model_Payment_Payone_Pp
26
+ *
27
+ * @author awesselburg <wesselburg@me.com>
28
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
29
+ */
30
+ class Shopgate_Framework_Model_Payment_Payone_Pp
31
+ extends Shopgate_Framework_Model_Payment_Payone_Abstract
32
+ implements Shopgate_Framework_Model_Payment_Interface
33
+ {
34
+ const PAYONE_CORE_MODEL_CONFIG_IDENTIFIER = 'payone_wallet';
35
+ const PAYMENT_MODEL = 'payone_core/payment_method_wallet';
36
+ const PAYMENT_IDENTIFIER = ShopgateOrder::PAYONE_PP;
37
+
38
+ /**
39
+ * @return string
40
+ */
41
+ protected function _getConfigCode()
42
+ {
43
+ return Payone_Api_Enum_WalletType::PAYPAL_EXPRESS;
44
+ }
45
+
46
+ }
app/code/community/Shopgate/Framework/Model/Payment/Payone/Prp.php ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Class Shopgate_Framework_Model_Payment_Payone_Prepay
26
+ *
27
+ * @author awesselburg <wesselburg@me.com>
28
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
29
+ */
30
+ class Shopgate_Framework_Model_Payment_Payone_Prp
31
+ extends Shopgate_Framework_Model_Payment_Payone_Abstract
32
+ implements Shopgate_Framework_Model_Payment_Interface
33
+ {
34
+ const PAYONE_CORE_MODEL_CONFIG_IDENTIFIER = 'payone_advance_payment';
35
+ const PAYMENT_MODEL = 'payone_core/payment_method_advancePayment';
36
+ const PAYMENT_IDENTIFIER = ShopgateOrder::PAYONE_PRP;
37
+
38
+ /**
39
+ * @param Mage_Sales_Model_Order $order
40
+ * @return Mage_Sales_Model_Order
41
+ * @throws Exception
42
+ */
43
+ public function manipulateOrderWithPaymentData($order)
44
+ {
45
+ $info = $this->getShopgateOrder()->getPaymentInfos();
46
+
47
+ if (isset($info['clearing_bankaccountholder'])) {
48
+ $this->getOrder()->getPayment()->setPayoneClearingBankAccountholder($info['clearing_bankaccountholder']);
49
+ }
50
+ if (isset($info['clearing_bankcountry'])) {
51
+ $this->getOrder()->getPayment()->setPayoneClearingBankCountry($info['clearing_bankcountry']);
52
+ }
53
+ if (isset($info['clearing_bankaccount'])) {
54
+ $this->getOrder()->getPayment()->setPayoneClearingBankAccount($info['clearing_bankaccount']);
55
+ }
56
+ if (isset($info['clearing_bankcode'])) {
57
+ $this->getOrder()->getPayment()->setPayoneClearingBankCode($info['clearing_bankcode']);
58
+ }
59
+ if (isset($info['clearing_bankcity'])) {
60
+ $this->getOrder()->getPayment()->setPayoneClearingBankCity($info['clearing_bankcity']);
61
+ }
62
+ if (isset($info['clearing_bankname'])) {
63
+ $this->getOrder()->getPayment()->setPayoneClearingBankName($info['clearing_bankname']);
64
+ }
65
+ if (isset($info['clearing_bankiban'])) {
66
+ $this->getOrder()->getPayment()->setPayoneClearingBankIban(strtoupper($info['clearing_bankiban']));
67
+ }
68
+ if (isset($info['clearing_bankbic'])) {
69
+ $this->getOrder()->getPayment()->setPayoneClearingBankBic(strtoupper($info['clearing_bankbic']));
70
+ }
71
+
72
+ return parent::manipulateOrderWithPaymentData();
73
+ }
74
+
75
+ /**
76
+ * Rewritten to add additional clearing parameters to response
77
+ *
78
+ * @param null|Payone_Api_Response_Authorization_Approved|Payone_Api_Response_Preauthorization_Approved $response
79
+ * @return Payone_Api_Response_Authorization_Approved|Payone_Api_Response_Preauthorization_Approved
80
+ */
81
+ protected function _createFakeResponse($response = null)
82
+ {
83
+ $info = $this->getShopgateOrder()->getPaymentInfos();
84
+
85
+ $response = $this->_getPayoneResponse();
86
+
87
+ /** @var Payone_Api_Response_Authorization_Approved | Payone_Api_Response_Preauthorization_Approved $response */
88
+ foreach ($info as $key => $val) {
89
+ switch ($key) {
90
+ case 'clearing_bankaccount':
91
+ $response->setClearingBankaccount($info[$key]);
92
+ break;
93
+ case 'clearing_bankcode':
94
+ $response->setClearingBankcode($info[$key]);
95
+ break;
96
+ case 'clearing_bankcountry':
97
+ $response->setClearingBankcountry($info[$key]);
98
+ break;
99
+ case 'clearing_bankname':
100
+ $response->setClearingBankname($info[$key]);
101
+ break;
102
+ case 'clearing_bankaccountholder':
103
+ $response->setClearingBankaccountholder($info[$key]);
104
+ break;
105
+ case 'clearing_bankcity':
106
+ $response->setClearingBankcity($info[$key]);
107
+ break;
108
+ case 'clearing_bankiban':
109
+ $response->setClearingBankiban($info[$key]);
110
+ break;
111
+ case 'clearing_bankbic':
112
+ $response->setClearingBankbic($info[$key]);
113
+ break;
114
+ }
115
+ }
116
+ return parent::_createFakeResponse($response);
117
+ }
118
+ }
app/code/community/Shopgate/Framework/Model/Payment/Payone/Sue.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Class Shopgate_Framework_Model_Payment_Payone_Sue
26
+ *
27
+ * @author awesselburg <wesselburg@me.com>
28
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
29
+ */
30
+ class Shopgate_Framework_Model_Payment_Payone_Sue
31
+ extends Shopgate_Framework_Model_Payment_Payone_BankAbstract
32
+ implements Shopgate_Framework_Model_Payment_Interface
33
+ {
34
+ const PAYMENT_IDENTIFIER = ShopgateOrder::PAYONE_SUE;
35
+
36
+ /**
37
+ * @return string
38
+ */
39
+ protected function _getConfigCode()
40
+ {
41
+ return Payone_Api_Enum_OnlinebanktransferType::INSTANT_MONEY_TRANSFER;
42
+ }
43
+
44
+ }
app/code/community/Shopgate/Framework/Model/Payment/Pp.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * This is not necessarily needed. Just
26
+ *
27
+ * Class Shopgate_Framework_Model_Payment_Pp
28
+ *
29
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
30
+ */
31
+ class Shopgate_Framework_Model_Payment_Pp extends Shopgate_Framework_Model_Payment_Simple
32
+ {
33
+ }
app/code/community/Shopgate/Framework/Model/Payment/Pp/Abstract.php ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Class Shopgate_Framework_Model_Payment_Pp_Abstract
26
+ *
27
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
28
+ */
29
+ class Shopgate_Framework_Model_Payment_Pp_Abstract
30
+ extends Shopgate_Framework_Model_Payment_Abstract
31
+ implements Shopgate_Framework_Model_Payment_Interface
32
+ {
33
+ const PAYMENT_IDENTIFIER = 'PP';
34
+ const MODULE_CONFIG = 'Mage_Paypal';
35
+
36
+ /**
37
+ * History message action map
38
+ *
39
+ * @var array
40
+ */
41
+ protected $_messageStatusAction = array(
42
+ Mage_Paypal_Model_Info::PAYMENTSTATUS_COMPLETED => 'Captur',
43
+ Mage_Paypal_Model_Info::PAYMENTSTATUS_PENDING => 'Authoriz'
44
+ );
45
+
46
+ /**
47
+ * Depends on Shopgate paymentInfos() to be passed
48
+ * into the TransactionAdditionalInfo of $order.
49
+ *
50
+ * @param $paymentStatus String
51
+ * @param $order Mage_Sales_Model_Order
52
+ * @return Mage_Sales_Model_Order
53
+ */
54
+ public function orderStatusManager(Mage_Sales_Model_Order $order, $paymentStatus = null)
55
+ {
56
+ if (!$paymentStatus) {
57
+ $rawData = $order->getPayment()->getTransactionAdditionalInfo(
58
+ Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS
59
+ );
60
+ $paymentStatus = strtolower($rawData['payment_status']);
61
+ }
62
+
63
+ $total = $order->getBaseCurrency()->formatTxt($order->getGrandTotal());
64
+ $state = Mage_Sales_Model_Order::STATE_PROCESSING;
65
+ $action = $this->getActionByStatus($paymentStatus);
66
+
67
+ if ($order->getPayment()->getIsTransactionPending()) {
68
+ $message = Mage::helper('paypal')->__(
69
+ '%sing amount of %s is pending approval on gateway.',
70
+ $action,
71
+ $total
72
+ );
73
+ $state = Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW;
74
+ } else {
75
+ $message = Mage::helper('paypal')->__(
76
+ '%sed amount of %s online.',
77
+ $action,
78
+ $total
79
+ );
80
+ }
81
+
82
+ //test for fraud
83
+ if ($order->getPayment()->getIsFraudDetected()) {
84
+ $status = Mage_Sales_Model_Order::STATUS_FRAUD;
85
+ $state = Mage::helper('shopgate')->getStateForStatus($status);
86
+ if (!$state) {
87
+ $state = Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW;
88
+ }
89
+ }
90
+
91
+ if (!isset($status)) {
92
+ $status = Mage::helper('shopgate')->getStatusFromState($state);
93
+ }
94
+ $order->setState($state, $status, $message);
95
+ $order->setShopgateStatusSet(true);
96
+ return $order;
97
+ }
98
+
99
+ /**
100
+ * Maps correct message action based on order status.
101
+ * E.g. authorize if pending, capture on complete
102
+ *
103
+ * @param $paymentStatus
104
+ * @return string
105
+ */
106
+ public function getActionByStatus($paymentStatus)
107
+ {
108
+ return isset($this->_messageStatusAction[$paymentStatus]) ?
109
+ $this->_messageStatusAction[$paymentStatus] : 'Authoriz';
110
+ }
111
+ }
app/code/community/Shopgate/Framework/Model/Payment/Pp/Paypal.php ADDED
@@ -0,0 +1,251 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+
25
+ /**
26
+ * Handles the PayPal Express payment
27
+ *
28
+ * @package Shopgate_Framework_Model_Payment_Paypal_Paypal
29
+ * @author Peter Liebig <p.liebig@me.com, peter.liebig@magcorp.de>
30
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
31
+ */
32
+ class Shopgate_Framework_Model_Payment_Pp_Paypal
33
+ extends Shopgate_Framework_Model_Payment_Pp_Abstract
34
+ implements Shopgate_Framework_Model_Payment_Interface
35
+ {
36
+ const PAYMENT_IDENTIFIER = ShopgateOrder::PAYPAL;
37
+ const XML_CONFIG_ENABLED = 'payment/paypal_express/active';
38
+
39
+ /**
40
+ * create new order for paypal express (type wspp)
41
+ *
42
+ * @param $quote Mage_Sales_Model_Quote
43
+ * @return Mage_Sales_Model_Order
44
+ * @throws Exception
45
+ */
46
+ public function createNewOrder($quote)
47
+ {
48
+ $convert = Mage::getModel('sales/convert_quote');
49
+ $transaction = Mage::getModel('core/resource_transaction');
50
+
51
+ if ($quote->getCustomerId()) {
52
+ $transaction->addObject($quote->getCustomer());
53
+ }
54
+ $quote->setTotalsCollectedFlag(true);
55
+ $transaction->addObject($quote);
56
+ if ($quote->isVirtual()) {
57
+ $order = $convert->addressToOrder($quote->getBillingAddress());
58
+ } else {
59
+ $order = $convert->addressToOrder($quote->getShippingAddress());
60
+ }
61
+ $order->setBillingAddress($convert->addressToOrderAddress($quote->getBillingAddress()));
62
+ if ($quote->getBillingAddress()->getCustomerAddress()) {
63
+ $order->getBillingAddress()->setCustomerAddress($quote->getBillingAddress()->getCustomerAddress());
64
+ }
65
+ if (!$quote->isVirtual()) {
66
+ $order->setShippingAddress($convert->addressToOrderAddress($quote->getShippingAddress()));
67
+ if ($quote->getShippingAddress()->getCustomerAddress()) {
68
+ $order->getShippingAddress()->setCustomerAddress($quote->getShippingAddress()->getCustomerAddress());
69
+ }
70
+ }
71
+
72
+ $order->setPayment($convert->paymentToOrderPayment($quote->getPayment()));
73
+ $order->getPayment()->setTransactionId($quote->getPayment()->getTransactionId());
74
+
75
+ foreach ($quote->getAllItems() as $item) {
76
+ /** @var Mage_Sales_Model_Order_Item $item */
77
+ $orderItem = $convert->itemToOrderItem($item);
78
+ if ($item->getParentItem()) {
79
+ $orderItem->setParentItem($order->getItemByQuoteItemId($item->getParentItem()->getId()));
80
+ }
81
+ $order->addItem($orderItem);
82
+ }
83
+ $order->setQuote($quote);
84
+ $order->setExtOrderId($quote->getPayment()->getTransactionId());
85
+ $order->setCanSendNewEmailFlag(false);
86
+ $transaction->addObject($order);
87
+ $transaction->addCommitCallback(array($order, 'save'));
88
+
89
+ try {
90
+ $transaction->save();
91
+ Mage::dispatchEvent(
92
+ 'sales_model_service_quote_submit_success',
93
+ array(
94
+ 'order' => $order,
95
+ 'quote' => $quote
96
+ )
97
+ );
98
+ } catch (Exception $e) {
99
+ //reset order ID's on exception, because order not saved
100
+ $order->setId(null);
101
+ /** @var $item Mage_Sales_Model_Order_Item */
102
+ foreach ($order->getItemsCollection() as $item) {
103
+ $item->setOrderId(null);
104
+ $item->setItemId(null);
105
+ }
106
+
107
+ Mage::dispatchEvent(
108
+ 'sales_model_service_quote_submit_failure',
109
+ array(
110
+ 'order' => $order,
111
+ 'quote' => $quote
112
+ )
113
+ );
114
+ throw $e;
115
+ }
116
+ Mage::dispatchEvent('checkout_submit_all_after', array('order' => $order, 'quote' => $quote));
117
+ Mage::dispatchEvent('sales_model_service_quote_submit_after', array('order' => $order, 'quote' => $quote));
118
+
119
+ return $order;
120
+ }
121
+
122
+ /**
123
+ * @param $order Mage_Sales_Model_Order
124
+ * @return Mage_Sales_Model_Order
125
+ */
126
+ public function manipulateOrderWithPaymentData($order)
127
+ {
128
+ $paymentInfos = $this->getShopgateOrder()->getPaymentInfos();
129
+ $paymentStatus = $this->_getPaymentHelper()->filterPaymentStatus($paymentInfos['payment_status']);
130
+ $trans = Mage::getModel('sales/order_payment_transaction');
131
+ $trans->setOrderPaymentObject($order->getPayment());
132
+ $trans->setTxnId($paymentInfos['transaction_id']);
133
+ $trans->setIsClosed(false);
134
+
135
+ try {
136
+ switch ($paymentStatus) {
137
+ // paid
138
+ case Mage_Paypal_Model_Info::PAYMENTSTATUS_COMPLETED:
139
+ $invoice = $this->_getPaymentHelper()->createOrderInvoice($order);
140
+ $trans->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE);
141
+
142
+ if ($order->getPayment()->getIsTransactionPending()) {
143
+ $invoice->setIsPaid(false);
144
+ } else { // normal online capture: invoice is marked as "paid"
145
+ $invoice->setIsPaid(true);
146
+ $invoice->pay();
147
+ }
148
+ $invoice->setTransactionId($paymentInfos['transaction_id']);
149
+ $invoice->save();
150
+ $order->addRelatedObject($invoice);
151
+ break;
152
+ case Mage_Paypal_Model_Info::PAYMENTSTATUS_PENDING:
153
+ if (isset($paymentInfos['reason_code'])) {
154
+ $order->getPayment()->setIsTransactionPending(true);
155
+ $order->getPayment()->setIsFraudDetected(true);
156
+ }
157
+ $trans->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
158
+ $order->getPayment()->setAmountAuthorized($order->getTotalDue());
159
+ break;
160
+ default:
161
+ throw new Exception("Cannot handle payment status '{$paymentStatus}'.");
162
+ }
163
+ $trans->save();
164
+ $this->_getPaymentHelper()->importPaymentInformation($order->getPayment(), $paymentInfos);
165
+ $order->getPayment()->setTransactionAdditionalInfo(
166
+ Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS,
167
+ $paymentInfos
168
+ );
169
+
170
+ $order->getPayment()->setLastTransId($paymentInfos['transaction_id']);
171
+
172
+
173
+ } catch (Exception $x) {
174
+ $comment = $this->_getPaymentHelper()->createIpnComment(
175
+ $order,
176
+ Mage::helper('paypal')->__('Note: %s', $x->getMessage()),
177
+ true
178
+ );
179
+ $comment->save();
180
+ Mage::logException($x);
181
+ }
182
+ return $order;
183
+ }
184
+
185
+ /**
186
+ * @param $quote Mage_Sales_Model_Quote
187
+ * @param $data array
188
+ * @return Mage_Sales_Model_Quote
189
+ */
190
+ public function prepareQuote($quote, $data)
191
+ {
192
+ $this->_getPaymentHelper()->importToPayment(
193
+ $data,
194
+ $quote->getPayment()->getMethodInstance()->getInfoInstance()
195
+ );
196
+ $quote->getPayment()->setTransactionId($data['transaction_id']);
197
+ $quote->getPayment()->setLastTransId($data['transaction_id']);
198
+ $quote->getPayment()->setPaypalPayerId($data['payer_id']);
199
+ $quote->getPayment()->setPaypalPayerStatus($data['payer_status']);
200
+ $quote->getPayment()->setAdditionalInformation('paypal_express_checkout_payer_id', $data['transaction_id']);
201
+ $quote->getPayment()->setAdditionalInformation('paypal_pending_reason', $data['pending_reason']);
202
+
203
+ return $quote;
204
+ }
205
+
206
+ /**
207
+ * Set order status, rewrite if matches conditions
208
+ *
209
+ * @param Mage_Sales_Model_Order $magentoOrder
210
+ * @return Mage_Sales_Model_Order
211
+ */
212
+ public function setOrderStatus($magentoOrder)
213
+ {
214
+ $state = Mage_Sales_Model_Order::STATE_PROCESSING;
215
+ $magentoOrder = $this->orderStatusManager($magentoOrder);
216
+
217
+ if ($this->getShopgateOrder()->getIsPaid() == 1
218
+ && $magentoOrder->getState() !== $state
219
+ ) {
220
+ $magentoOrder->setState(
221
+ $state,
222
+ $state,
223
+ $this->_getPaymentHelper()
224
+ ->__('[SHOPGATE] Import received as paid, forcing state: ' . $state)
225
+ );
226
+ }
227
+ $magentoOrder->setShopgateStatusSet(true);
228
+ return $magentoOrder;
229
+ }
230
+
231
+ /**
232
+ * @return Shopgate_Framework_Helper_Payment_Wspp
233
+ */
234
+ protected function _getPaymentHelper()
235
+ {
236
+ return Mage::helper('shopgate/payment_wspp');
237
+ }
238
+
239
+ /**
240
+ * Makes sure we are on the right PayPal
241
+ *
242
+ * @return bool
243
+ */
244
+ public function checkGenericValid()
245
+ {
246
+ $payment = Mage::helper('shopgate/import_order')
247
+ ->getMagentoPaymentMethod($this->getPaymentMethod());
248
+
249
+ return $payment ? $payment->getCode() === "paypal_express" : false;
250
+ }
251
+ }
app/code/community/Shopgate/Framework/Model/Payment/Pp/Wspp.php ADDED
@@ -0,0 +1,232 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * User: pliebig
4
+ * Date: 10.09.14
5
+ * Time: 10:05
6
+ * E-Mail: p.liebig@me.com, peter.liebig@magcorp.de
7
+ */
8
+
9
+ /**
10
+ * Class to manipulate the order payment data with amazon payment data
11
+ *
12
+ * @package Shopgate_Framework_Model_Payment_Wspp
13
+ * @author Peter Liebig <p.liebig@me.com, peter.liebig@magcorp.de>
14
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
15
+ */
16
+ class Shopgate_Framework_Model_Payment_Pp_Wspp
17
+ extends Shopgate_Framework_Model_Payment_Pp_Abstract
18
+ implements Shopgate_Framework_Model_Payment_Interface
19
+ {
20
+ const PAYMENT_IDENTIFIER = ShopgateOrder::PP_WSPP_CC;
21
+ const XML_CONFIG_ENABLED = 'payment/paypal_wps_express/active';
22
+ const MODULE_CONFIG = 'Mage_Paypal';
23
+
24
+ /**
25
+ * Create new order for amazon payment
26
+ *
27
+ * @param $quote Mage_Sales_Model_Quote
28
+ * @return Mage_Sales_Model_Order
29
+ * @throws Exception
30
+ */
31
+ public function createNewOrder($quote)
32
+ {
33
+ $convert = Mage::getModel('sales/convert_quote');
34
+ $transaction = Mage::getModel('core/resource_transaction');
35
+
36
+ if ($quote->getCustomerId()) {
37
+ $transaction->addObject($quote->getCustomer());
38
+ }
39
+
40
+ $transaction->addObject($quote);
41
+ if ($quote->isVirtual()) {
42
+ $order = $convert->addressToOrder($quote->getBillingAddress());
43
+ } else {
44
+ $order = $convert->addressToOrder($quote->getShippingAddress());
45
+ }
46
+ $order->setBillingAddress($convert->addressToOrderAddress($quote->getBillingAddress()));
47
+ if ($quote->getBillingAddress()->getCustomerAddress()) {
48
+ $order->getBillingAddress()->setCustomerAddress($quote->getBillingAddress()->getCustomerAddress());
49
+ }
50
+ if (!$quote->isVirtual()) {
51
+ $order->setShippingAddress($convert->addressToOrderAddress($quote->getShippingAddress()));
52
+ if ($quote->getShippingAddress()->getCustomerAddress()) {
53
+ $order->getShippingAddress()->setCustomerAddress($quote->getShippingAddress()->getCustomerAddress());
54
+ }
55
+ }
56
+
57
+ $order->setPayment($convert->paymentToOrderPayment($quote->getPayment()));
58
+ $order->getPayment()->setTransactionId($quote->getPayment()->getTransactionId());
59
+
60
+ foreach ($quote->getAllItems() as $item) {
61
+ /** @var Mage_Sales_Model_Order_Item $item */
62
+ $orderItem = $convert->itemToOrderItem($item);
63
+ if ($item->getParentItem()) {
64
+ $orderItem->setParentItem($order->getItemByQuoteItemId($item->getParentItem()->getId()));
65
+ }
66
+ $order->addItem($orderItem);
67
+ }
68
+ $order->setQuote($quote);
69
+ $order->setExtOrderId($quote->getPayment()->getTransactionId());
70
+ $order->setCanSendNewEmailFlag(false);
71
+ $transaction->addObject($order);
72
+ $transaction->addCommitCallback(array($order, 'save'));
73
+
74
+ try {
75
+ $transaction->save();
76
+ Mage::dispatchEvent(
77
+ 'sales_model_service_quote_submit_success',
78
+ array(
79
+ 'order' => $order,
80
+ 'quote' => $quote
81
+ )
82
+ );
83
+ } catch (Exception $e) {
84
+ //reset order ID's on exception, because order not saved
85
+ $order->setId(null);
86
+ /** @var $item Mage_Sales_Model_Order_Item */
87
+ foreach ($order->getItemsCollection() as $item) {
88
+ $item->setOrderId(null);
89
+ $item->setItemId(null);
90
+ }
91
+
92
+ Mage::dispatchEvent(
93
+ 'sales_model_service_quote_submit_failure',
94
+ array(
95
+ 'order' => $order,
96
+ 'quote' => $quote
97
+ )
98
+ );
99
+ throw $e;
100
+ }
101
+ Mage::dispatchEvent('checkout_submit_all_after', array('order' => $order, 'quote' => $quote));
102
+ Mage::dispatchEvent('sales_model_service_quote_submit_after', array('order' => $order, 'quote' => $quote));
103
+
104
+ return $order;
105
+ }
106
+
107
+ /**
108
+ * @param $order Mage_Sales_Model_Order
109
+ * // TODO Refund
110
+ * @return Mage_Sales_Model_Order
111
+ */
112
+ public function manipulateOrderWithPaymentData($order)
113
+ {
114
+ $paymentInfos = $this->getShopgateOrder()->getPaymentInfos();
115
+ $paypalIpnData = json_decode($paymentInfos['paypal_ipn_data'], true);
116
+ $paypalIpnData = array_merge($paymentInfos['credit_card'], $paypalIpnData);
117
+ $paymentStatus = $this->_getPaymentHelper()->filterPaymentStatus($paypalIpnData['payment_status']);
118
+
119
+ $trans = Mage::getModel('sales/order_payment_transaction');
120
+ $trans->setOrderPaymentObject($order->getPayment());
121
+ $trans->setTxnId($paypalIpnData['txn_id']);
122
+ $trans->setIsClosed(false);
123
+
124
+ try {
125
+ $invoice = $this->_getPaymentHelper()->createOrderInvoice($order);
126
+ switch ($paymentStatus) {
127
+ // paid
128
+ case Mage_Paypal_Model_Info::PAYMENTSTATUS_COMPLETED:
129
+ $trans->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE);
130
+ if ($order->getPayment()->getIsTransactionPending()) {
131
+ $invoice->setIsPaid(false);
132
+ } else { // normal online capture: invoice is marked as "paid"
133
+ $invoice->setIsPaid(true);
134
+ $invoice->pay();
135
+ }
136
+ break;
137
+ // refund by merchant on PayPal side
138
+ case Mage_Paypal_Model_Info::PAYMENTSTATUS_REFUNDED:
139
+ //$this->_getPaymentHelper()->registerPaymentRefund($additionalData, $order);
140
+ break;
141
+ // payment was obtained, but money were not captured yet
142
+ case Mage_Paypal_Model_Info::PAYMENTSTATUS_PENDING:
143
+ foreach ($paypalIpnData as $key => $value) {
144
+ if (strpos($key, 'fraud_management_pending_filters_') !== false) {
145
+ $order->getPayment()->setIsTransactionPending(true);
146
+ $order->getPayment()->setIsFraudDetected(true);
147
+ }
148
+ }
149
+
150
+ $trans->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
151
+ $invoice->setIsPaid(false);
152
+ $order->getPayment()->setAmountAuthorized($order->getTotalDue());
153
+ break;
154
+ default:
155
+ throw new Exception("Cannot handle payment status '{$paymentStatus}'.");
156
+ }
157
+ $trans->save();
158
+ $invoice->setTransactionId($paypalIpnData['txn_id']);
159
+ $invoice->save();
160
+ $order->addRelatedObject($invoice);
161
+ $this->_getPaymentHelper()->importPaymentInformation($order->getPayment(), $paypalIpnData);
162
+ $order->getPayment()->setTransactionAdditionalInfo(
163
+ Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS,
164
+ $paypalIpnData
165
+ );
166
+ $order->getPayment()->setCcOwner($paypalIpnData['holder']);
167
+ $order->getPayment()->setCcType($paypalIpnData['type']);
168
+ $order->getPayment()->setCcNumberEnc($paypalIpnData['masked_number']);
169
+ $order->getPayment()->setLastTransId($paypalIpnData['txn_id']);
170
+ } catch (Exception $x) {
171
+ $comment = $this->_getPaymentHelper()->createIpnComment(
172
+ $order,
173
+ Mage::helper('paypal')->__('Note: %s', $x->getMessage()),
174
+ true
175
+ );
176
+ $comment->save();
177
+ Mage::logException($x);
178
+ }
179
+ return $order;
180
+ }
181
+
182
+ /**
183
+ * @param $quote Mage_Sales_Model_Quote
184
+ * @param $data array
185
+ * @return Mage_Sales_Model_Quote
186
+ */
187
+ public function prepareQuote($quote, $data)
188
+ {
189
+ $ipnData = json_decode($data['paypal_ipn_data'], true);
190
+ $this->_getPaymentHelper()->importToPayment(
191
+ $ipnData,
192
+ $quote->getPayment()->getMethodInstance()->getInfoInstance()
193
+ );
194
+ $quote->getPayment()->setTransactionId($data['paypal_txn_id']);
195
+ $quote->getPayment()->setCcOwner($data['credit_card']['holder']);
196
+ $quote->getPayment()->setCcType($data['credit_card']['type']);
197
+ $quote->getPayment()->setCcNumberEnc($data['credit_card']['masked_number']);
198
+ $quote->setData('paypal_ipn_data', $data['paypal_ipn_data']);
199
+ $quote->getPayment()->setLastTransId($data['paypal_txn_id']);
200
+ return $quote;
201
+ }
202
+
203
+ /**
204
+ * Set order status
205
+ *
206
+ * @param Mage_Sales_Model_Order $magentoOrder
207
+ * @return Mage_Sales_Model_Order
208
+ */
209
+ public function setOrderStatus($magentoOrder)
210
+ {
211
+ return $this->orderStatusManager($magentoOrder);
212
+ }
213
+
214
+ /**
215
+ * WSPP online actions still work without method being enabled.
216
+ * It also breaks when runs with default abstract
217
+ *
218
+ * @return bool
219
+ */
220
+ public function isEnabled()
221
+ {
222
+ return true;
223
+ }
224
+
225
+ /**
226
+ * @return Shopgate_Framework_Helper_Payment_Wspp
227
+ */
228
+ protected function _getPaymentHelper()
229
+ {
230
+ return Mage::helper('shopgate/payment_wspp');
231
+ }
232
+ }
app/code/community/Shopgate/Framework/Model/Payment/Router.php ADDED
@@ -0,0 +1,183 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Handles all payment routing for Multi-Payment implementations like PayOne & PayPal.
26
+ * It helps figure out which class model to use based on payment_method provided.
27
+ *
28
+ * Class Shopgate_Framework_Model_Payment_Router
29
+ *
30
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
31
+ */
32
+ class Shopgate_Framework_Model_Payment_Router extends Shopgate_Framework_Model_Payment_Abstract
33
+ {
34
+ /**
35
+ * Default: returns 2nd part of payment_method
36
+ * e.g. in AUTHN_CC, return CC. Simple class
37
+ * handles the first part.
38
+ */
39
+ protected $_payment_method_part = 2;
40
+
41
+ /**
42
+ * Returns the correct Shopgate payment model
43
+ * based on method identifier. This is recursive (sorta)!
44
+ *
45
+ * @return false|Shopgate_Framework_Model_Payment_Abstract
46
+ * @throws Exception
47
+ */
48
+ public function getModelByPaymentMethod()
49
+ {
50
+ $class = $this->getClassFromMethod();
51
+ $model = Mage::getModel($class, $this->getShopgateOrder());
52
+
53
+ if ($model) {
54
+ if ($model instanceof Shopgate_Framework_Model_Payment_Interface) {
55
+ return $model;
56
+ } elseif ($model instanceof Shopgate_Framework_Model_Payment_Router) {
57
+ return $model->getModelByPaymentMethod();
58
+ }
59
+ }
60
+
61
+ return false;
62
+ }
63
+
64
+ /**
65
+ * @return bool|false|Mage_Core_Model_Abstract
66
+ */
67
+ public function getMethodModel()
68
+ {
69
+ $model = $this->getModelByPaymentMethod();
70
+
71
+ if (!$model) {
72
+ $model = $this->_checkAllPossibleModels();
73
+ }
74
+
75
+ if (!$model) {
76
+ $debug = $this->_getHelper()->__('No class found for payment method: %s', $this->getPaymentMethod());
77
+ ShopgateLogger::getInstance()->log($debug, ShopgateLogger::LOGTYPE_DEBUG);
78
+ }
79
+
80
+ return $model;
81
+ }
82
+
83
+ /**
84
+ * Using payment_method as example - AUTHN_CC.
85
+ * If 2nd part, replaces _Router with _Cc,
86
+ * else finishes with 1st part to build _Cc_Authn
87
+ *
88
+ * @return string
89
+ */
90
+ protected function getClassFromMethod()
91
+ {
92
+ $endPart = ucfirst(strtolower($this->_getMethodPart()));
93
+ $current = get_class($this);
94
+ if (strstr($current, 'Router') !== false) {
95
+ return str_replace('Router', $endPart, $current);
96
+ } else {
97
+ return $current . '_' . $endPart;
98
+ }
99
+ }
100
+
101
+ /**
102
+ * Returns the correct part of the payment id.
103
+ * E.g. payment_method_part = 2, will return
104
+ * the second part of AUTHN_CC, so CC.
105
+ *
106
+ * @return string
107
+ */
108
+ protected function _getMethodPart()
109
+ {
110
+ //user friendly, first part (1) == 0 for array
111
+ $index = $this->_payment_method_part;
112
+ $parts = explode('_', $this->getPaymentMethod());
113
+ return $parts[--$index] ? $parts[$index] : $parts[0];
114
+ }
115
+
116
+ /** ======= Fallback Functionality ======== */
117
+
118
+ /**
119
+ * Initializes models until it finds the one implementing
120
+ * interface.
121
+ *
122
+ * @return bool|false|Mage_Core_Model_Abstract
123
+ */
124
+ protected function _checkAllPossibleModels()
125
+ {
126
+ $combinations = $this->_getModelCombinations();
127
+ $class = str_replace('_Router', '', get_class());
128
+ foreach ($combinations as $combination) {
129
+ $className = $class . $combination;
130
+ $model = Mage::getModel($className, $this->getShopgateOrder());
131
+ if ($model instanceof Shopgate_Framework_Model_Payment_Interface) {
132
+ return $model;
133
+ } elseif ($model instanceof Shopgate_Framework_Model_Payment_Router) {
134
+ $model = $model->getModelByPaymentMethod();
135
+ if ($model) {
136
+ return $model;
137
+ }
138
+ }
139
+ }
140
+ return false;
141
+ }
142
+
143
+ /**
144
+ * Gets all possible model combinations
145
+ * PAONE_PRP -> _Prp, _Payone, _Payone_Prp, _Prp_Payone
146
+ *
147
+ * @return array
148
+ */
149
+ protected function _getModelCombinations()
150
+ {
151
+ $combinations = array();
152
+ $paymentMethod = explode('_', strtolower($this->getPaymentMethod()));
153
+ $this->depthPicker($paymentMethod, '', $combinations);
154
+
155
+ return $combinations;
156
+ }
157
+
158
+ /**
159
+ * Recursive array combination logic
160
+ *
161
+ * @param $arr
162
+ * @param $temp_string
163
+ * @param $collect
164
+ */
165
+ function depthPicker($arr, $temp_string, &$collect)
166
+ {
167
+ if ($temp_string != "") {
168
+ $collect [] = $temp_string;
169
+ }
170
+
171
+ for ($i = 0; $i < sizeof($arr); $i++) {
172
+ $arrcopy = $arr;
173
+ $elem = array_splice($arrcopy, $i, 1); // removes and returns the i'th element
174
+ $temp = $temp_string . "_" . ucfirst($elem[0]);
175
+ if (sizeof($arrcopy) > 0) {
176
+ $this->depthPicker($arrcopy, $temp, $collect);
177
+ } else {
178
+ $collect[] = $temp;
179
+ }
180
+ }
181
+ }
182
+
183
+ }
app/code/community/Shopgate/Framework/Model/Payment/Simple.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Handles simple (SINGLE NAME) payment_method routing, e.g. PAYPAL
26
+ *
27
+ * Class Shopgate_Framework_Model_Payment_Simple
28
+ *
29
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
30
+ */
31
+ class Shopgate_Framework_Model_Payment_Simple extends Shopgate_Framework_Model_Payment_Router
32
+ {
33
+ /**
34
+ * Simple method just appends first part of
35
+ * payment_method to form folder structure.
36
+ * E.g. PAYPAL -> Simple/Paypal.php
37
+ */
38
+ protected $_payment_method_part = 1;
39
+ }
app/code/community/Shopgate/Framework/Model/Payment/Simple/Billsafe.php ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Class to manipulate the order payment data with BillSAFE payment data
26
+ *
27
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
28
+ */
29
+ class Shopgate_Framework_Model_Payment_Simple_Billsafe
30
+ extends Shopgate_Framework_Model_Payment_Abstract
31
+ implements Shopgate_Framework_Model_Payment_Interface
32
+ {
33
+ const PAYMENT_IDENTIFIER = ShopgateOrder::BILLSAFE;
34
+ const XML_CONFIG_ENABLED = 'payment/billsafe/active';
35
+ const XML_CONFIG_STATUS_PAID = 'payment/billsafe/order_status';
36
+ const MODULE_CONFIG = 'Netresearch_Billsafe';
37
+
38
+ /**
39
+ * @param $order Mage_Sales_Model_Order
40
+ *
41
+ * @return Mage_Sales_Model_Order
42
+ */
43
+ public function manipulateOrderWithPaymentData($order)
44
+ {
45
+ $paymentBillsafe = Mage::getModel('billsafe/payment');
46
+ $order->getPayment()->setMethod($paymentBillsafe->getCode());
47
+ $paymentBillsafe->setInfoInstance($order->getPayment());
48
+ $order->getPayment()->setMethodInstance($paymentBillsafe);
49
+ $order->save();
50
+ $orderObject = new Varien_Object(array('increment_id' => $this->getShopgateOrder()->getOrderNumber()));
51
+ $data = Mage::getSingleton('billsafe/client')->getPaymentInstruction($orderObject);
52
+ if ($data) {
53
+ $order->getPayment()->setAdditionalInformation(
54
+ 'BillsafeStatus',
55
+ Netresearch_Billsafe_Model_Payment::BILLSAFE_STATUS_ACTIVE
56
+ );
57
+ $order->getPayment()->setAdditionalInformation('Recipient', $data->recipient);
58
+ $order->getPayment()->setAdditionalInformation('BankCode', $data->bankCode);
59
+ $order->getPayment()->setAdditionalInformation('AccountNumber', $data->accountNumber);
60
+ $order->getPayment()->setAdditionalInformation('BankName', $data->bankName);
61
+ $order->getPayment()->setAdditionalInformation('Bic', $data->bic);
62
+ $order->getPayment()->setAdditionalInformation('Iban', $data->iban);
63
+ $order->getPayment()->setAdditionalInformation('Reference', $data->reference);
64
+ $order->getPayment()->setAdditionalInformation('Amount', $data->amount);
65
+ $order->getPayment()->setAdditionalInformation('CurrencyCode', $data->currencyCode);
66
+ $order->getPayment()->setAdditionalInformation('Note', $data->note);
67
+ $order->getPayment()->setAdditionalInformation('legalNote', $data->legalNote);
68
+ } else {
69
+ $order->getPayment()->setAdditionalInformation(
70
+ 'BillsafeStatus',
71
+ Netresearch_Billsafe_Model_Payment::BILLSAFE_STATUS_CANCELLED
72
+ );
73
+ }
74
+ $paymentInfos = $this->getShopgateOrder()->getPaymentInfos();
75
+ $orderTrans = Mage::getModel('sales/order_payment_transaction');
76
+ $orderTrans->setOrderPaymentObject($order->getPayment());
77
+ $orderTrans->setIsClosed(false);
78
+ $orderTrans->setTxnId($paymentInfos['billsafe_transaction_id']);
79
+ $orderTrans->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
80
+ $orderTrans->save();
81
+ $order->getPayment()->importTransactionInfo($orderTrans);
82
+ $order->getPayment()->setDataChanges(true);
83
+
84
+ return $order;
85
+ }
86
+ }
app/code/community/Shopgate/Framework/Model/Payment/Simple/Mws.php ADDED
@@ -0,0 +1,234 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Payment handler for Creativestyle_AmazonPayments
26
+ *
27
+ * Class Shopgate_Framework_Model_Payment_Simple_Mws
28
+ *
29
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
30
+ */
31
+ class Shopgate_Framework_Model_Payment_Simple_Mws
32
+ extends Shopgate_Framework_Model_Payment_Abstract
33
+ implements Shopgate_Framework_Model_Payment_Interface
34
+ {
35
+ const PAYMENT_IDENTIFIER = ShopgateOrder::AMAZON_PAYMENT;
36
+ const XML_CONFIG_ENABLED = 'amazonpayments/general/active';
37
+ const MODULE_CONFIG = 'Creativestyle_AmazonPayments';
38
+
39
+ /**
40
+ * create new order for amazon payment
41
+ *
42
+ * @param $quote Mage_Sales_Model_Quote
43
+ * @return Mage_Sales_Model_Order
44
+ * @throws Exception
45
+ */
46
+ public function createNewOrder($quote)
47
+ {
48
+ $convert = Mage::getModel('sales/convert_quote');
49
+ $transaction = Mage::getModel('core/resource_transaction');
50
+
51
+ if ($quote->getCustomerId()) {
52
+ $transaction->addObject($quote->getCustomer());
53
+ }
54
+
55
+ $transaction->addObject($quote);
56
+ if ($quote->isVirtual()) {
57
+ $order = $convert->addressToOrder($quote->getBillingAddress());
58
+ } else {
59
+ $order = $convert->addressToOrder($quote->getShippingAddress());
60
+ }
61
+ $order->setBillingAddress($convert->addressToOrderAddress($quote->getBillingAddress()));
62
+ if ($quote->getBillingAddress()->getCustomerAddress()) {
63
+ $order->getBillingAddress()->setCustomerAddress($quote->getBillingAddress()->getCustomerAddress());
64
+ }
65
+ if (!$quote->isVirtual()) {
66
+ $order->setShippingAddress($convert->addressToOrderAddress($quote->getShippingAddress()));
67
+ if ($quote->getShippingAddress()->getCustomerAddress()) {
68
+ $order->getShippingAddress()->setCustomerAddress($quote->getShippingAddress()->getCustomerAddress());
69
+ }
70
+ }
71
+ $order->setPayment($convert->paymentToOrderPayment($quote->getPayment()));
72
+ $order->getPayment()->setTransactionId($quote->getPayment()->getTransactionId());
73
+ $order->getPayment()->setAdditionalInformation(
74
+ 'amazon_order_reference_id',
75
+ $quote->getPayment()
76
+ ->getTransactionId()
77
+ );
78
+
79
+ foreach ($quote->getAllItems() as $item) {
80
+ /** @var Mage_Sales_Model_Order_Item $item */
81
+ $orderItem = $convert->itemToOrderItem($item);
82
+ if ($item->getParentItem()) {
83
+ $orderItem->setParentItem($order->getItemByQuoteItemId($item->getParentItem()->getId()));
84
+ }
85
+ $order->addItem($orderItem);
86
+ }
87
+ $order->setQuote($quote);
88
+ $order->setExtOrderId($quote->getPayment()->getTransactionId());
89
+ $order->setCanSendNewEmailFlag(false);
90
+
91
+ $transaction->addObject($order);
92
+ $transaction->addCommitCallback(array($order, 'save'));
93
+
94
+ Mage::dispatchEvent('checkout_type_onepage_save_order', array('order' => $order, 'quote' => $quote));
95
+ Mage::dispatchEvent('sales_model_service_quote_submit_before', array('order' => $order, 'quote' => $quote));
96
+
97
+ try {
98
+ $transaction->save();
99
+ Mage::dispatchEvent(
100
+ 'sales_model_service_quote_submit_success',
101
+ array(
102
+ 'order' => $order,
103
+ 'quote' => $quote
104
+ )
105
+ );
106
+ } catch (Exception $e) {
107
+ //reset order ID's on exception, because order not saved
108
+ $order->setId(null);
109
+ /** @var $item Mage_Sales_Model_Order_Item */
110
+ foreach ($order->getItemsCollection() as $item) {
111
+ $item->setOrderId(null);
112
+ $item->setItemId(null);
113
+ }
114
+
115
+ Mage::dispatchEvent(
116
+ 'sales_model_service_quote_submit_failure',
117
+ array(
118
+ 'order' => $order,
119
+ 'quote' => $quote
120
+ )
121
+ );
122
+ throw $e;
123
+ }
124
+ Mage::dispatchEvent('checkout_submit_all_after', array('order' => $order, 'quote' => $quote));
125
+ Mage::dispatchEvent('sales_model_service_quote_submit_after', array('order' => $order, 'quote' => $quote));
126
+
127
+ return $order;
128
+ }
129
+
130
+ /**
131
+ * @param $order Mage_Sales_Model_Order
132
+ * todo: refund & support for mage v1.4.1.1
133
+ * @return Mage_Sales_Model_Order
134
+ */
135
+ public function manipulateOrderWithPaymentData($order)
136
+ {
137
+ $paymentInfos = $this->getShopgateOrder()->getPaymentInfos();
138
+ try {
139
+ $orderTrans = Mage::getModel('sales/order_payment_transaction');
140
+ $orderTrans->setOrderPaymentObject($order->getPayment());
141
+ $orderTrans->setIsClosed(false);
142
+ $orderTrans->setTxnId($paymentInfos['mws_order_id']);
143
+
144
+ if (Mage::helper('shopgate/config')->getIsMagentoVersionLower15()) {
145
+ $orderTrans->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_PAYMENT);
146
+ } else {
147
+ $orderTrans->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_ORDER);
148
+ }
149
+
150
+ $orderTrans->save();
151
+ $order->getPayment()->importTransactionInfo($orderTrans);
152
+ $order->getPayment()->setLastTransId($paymentInfos['mws_order_id']);
153
+
154
+ if (!empty($paymentInfos['mws_auth_id'])) {
155
+ $authTrans = Mage::getModel('sales/order_payment_transaction');
156
+ $authTrans->setOrderPaymentObject($order->getPayment());
157
+ $authTrans->setParentTxnId($orderTrans->getTxnId(), $paymentInfos['mws_auth_id']);
158
+ $authTrans->setIsClosed(false);
159
+ $authTrans->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
160
+ $authTrans->save();
161
+ $order->getPayment()->importTransactionInfo($authTrans);
162
+ $order->getPayment()->setAmountAuthorized($order->getTotalDue());
163
+ $order->getPayment()->setLastTransId($paymentInfos['mws_auth_id']);
164
+
165
+ if (!empty($paymentInfos['mws_capture_id'])) {
166
+ $transaction = Mage::getModel('sales/order_payment_transaction');
167
+ $transaction->setOrderPaymentObject($order->getPayment());
168
+ $transaction->setParentTxnId($authTrans->getTxnId(), $paymentInfos['mws_capture_id']);
169
+ $transaction->setIsClosed(false);
170
+ $transaction->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE);
171
+ $transaction->save();
172
+ $order->getPayment()->importTransactionInfo($transaction);
173
+ $order->getPayment()->capture(null);
174
+ /** @var Mage_Sales_Model_Resource_Order_Invoice_Collection $invoiceCollection */
175
+ $invoiceCollection = $order->getInvoiceCollection();
176
+ $invoiceCollection->getFirstItem()->setTransactionId($paymentInfos['mws_capture_id']);
177
+ $order->getPayment()->setAmountAuthorized($order->getTotalDue());
178
+ $order->getPayment()->setBaseAmountAuthorized($order->getBaseTotalDue());
179
+ $order->getPayment()->setLastTransId($paymentInfos['mws_capture_id']);
180
+ }
181
+ }
182
+ } catch (Exception $x) {
183
+ Mage::logException($x);
184
+ }
185
+
186
+ return $order;
187
+ }
188
+
189
+ /**
190
+ * @param $quote Mage_Sales_Model_Quote
191
+ * @param $info array
192
+ * @return Mage_Sales_Model_Quote
193
+ */
194
+ public function prepareQuote($quote, $info)
195
+ {
196
+ $payment = Mage::helper('shopgate/import_order')->getMagentoPaymentMethod($this::PAYMENT_IDENTIFIER);;
197
+ if ($quote->isVirtual()) {
198
+ $quote->getBillingAddress()->setPaymentMethod($payment->getCode() ? $payment->getCode() : null);
199
+ } else {
200
+ $quote->getShippingAddress()->setPaymentMethod($payment->getCode() ? $payment->getCode() : null);
201
+ }
202
+
203
+ $data = array(
204
+ 'method' => $payment->getCode(),
205
+ 'checks' => Creativestyle_AmazonPayments_Model_Payment_Abstract::CHECK_USE_FOR_COUNTRY
206
+ | Creativestyle_AmazonPayments_Model_Payment_Abstract::CHECK_USE_FOR_CURRENCY
207
+ | Creativestyle_AmazonPayments_Model_Payment_Abstract::CHECK_ORDER_TOTAL_MIN_MAX
208
+ );
209
+
210
+ $quote->getPayment()->importData($data);
211
+ $quote->getPayment()->setTransactionId($info['mws_order_id']);
212
+ return $quote;
213
+ }
214
+
215
+ /**
216
+ * Set order state if non is set,
217
+ * else ignore as Amazon plugin handles all that
218
+ *
219
+ * @param $magentoOrder
220
+ * @return Mage_Sales_Model_Order
221
+ */
222
+ public function setOrderStatus($magentoOrder)
223
+ {
224
+ //backup for potential plugin lower version malfunctions
225
+ if (!$magentoOrder->getState()) {
226
+ $magentoOrder->setState(
227
+ Mage_Sales_Model_Order::STATE_PROCESSING,
228
+ Mage_Sales_Model_Order::STATE_PROCESSING
229
+ );
230
+ }
231
+ $magentoOrder->setShopgateStatusSet(true);
232
+ return $magentoOrder;
233
+ }
234
+ }
app/code/community/Shopgate/Framework/Model/Payment/Simple/Paypal.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Forwarder to PayPal, let paypal folder handle these poor payment_method naming edge cases!
26
+ *
27
+ * Class Shopgate_Framework_Model_Payment_Simple_Paypal
28
+ *
29
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
30
+ */
31
+ class Shopgate_Framework_Model_Payment_Simple_Paypal extends Shopgate_Framework_Model_Payment_Pp_Paypal {}
app/code/community/Shopgate/Framework/Model/Payment/Simple/Sue.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Sofortuebreweisung version router
26
+ *
27
+ * Class Shopgate_Framework_Model_Payment_Simple_Sue
28
+ *
29
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
30
+ */
31
+ class Shopgate_Framework_Model_Payment_Simple_Sue extends Shopgate_Framework_Model_Payment_Simple
32
+ {
33
+ const MODULE_CONFIG = 'Paymentnetwork_Pnsofortueberweisung';
34
+
35
+ /**
36
+ * Route to appropriate file based on version
37
+ *
38
+ * @return false|Shopgate_Framework_Model_Payment_Abstract
39
+ */
40
+ public function getModelByPaymentMethod()
41
+ {
42
+ if (version_compare($this->_getVersion(), '3.0.0', '>=')) {
43
+ $this->setPaymentMethod('SUE300');
44
+ } else {
45
+ $this->setPaymentMethod('SUE118');
46
+ }
47
+
48
+ return parent::getModelByPaymentMethod();
49
+ }
50
+
51
+ }
app/code/community/Shopgate/Framework/Model/Payment/Simple/Sue/Abstract.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Fallback handler for all SUE payment method needs.
26
+ *
27
+ * Class Shopgate_Framework_Model_Payment_Simple_Sue_Abstract
28
+ *
29
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
30
+ */
31
+ class Shopgate_Framework_Model_Payment_Simple_Sue_Abstract extends Shopgate_Framework_Model_Payment_Abstract
32
+ {
33
+ const PAYMENT_IDENTIFIER = ShopgateOrder::SUE;
34
+ const MODULE_CONFIG = 'Paymentnetwork_Pnsofortueberweisung';
35
+
36
+ /**
37
+ * Add invoice to a paid order
38
+ * todo: v118 may need a transaction ID for refunding
39
+ *
40
+ * @param Mage_Sales_Model_Order $magentoOrder
41
+ * @return Mage_Sales_Model_Order
42
+ * @throws Exception
43
+ */
44
+ public function manipulateOrderWithPaymentData($magentoOrder)
45
+ {
46
+ $shopgateOrder = $this->getShopgateOrder();
47
+
48
+ if ($shopgateOrder->getIsPaid()) {
49
+ $invoice = $this->_getPaymentHelper()->createOrderInvoice($magentoOrder);
50
+ $invoice->setIsPaid(true);
51
+ $invoice->pay();
52
+ $invoice->save();
53
+ $magentoOrder->addRelatedObject($invoice);
54
+ }
55
+
56
+ $magentoOrder = parent::manipulateOrderWithPaymentData($magentoOrder);
57
+
58
+ return $magentoOrder;
59
+ }
60
+
61
+ /**
62
+ * Sets order status backup implementation
63
+ *
64
+ * @param Mage_Sales_Model_Order $magentoOrder
65
+ * @return Mage_Sales_Model_Order
66
+ */
67
+ public function setOrderStatus($magentoOrder)
68
+ {
69
+ $magentoOrder = parent::setOrderStatus($magentoOrder);
70
+
71
+ /**
72
+ * Old versions where status is not set by default
73
+ */
74
+ if (!$magentoOrder->getShopgateStatusSet()) {
75
+ $state = Mage_Sales_Model_Order::STATE_PENDING_PAYMENT;
76
+ $status = $this->_getHelper()->getStatusFromState($state);
77
+ $message = $this->_getHelper()->__('[SHOPGATE] Using default status as no native plugin status is set');
78
+ $magentoOrder->setState($state, $status, $message);
79
+ $magentoOrder->setShopgateStatusSet(true);
80
+ }
81
+
82
+ return $magentoOrder;
83
+ }
84
+
85
+ }
app/code/community/Shopgate/Framework/Model/Payment/Simple/Sue/Sue118.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Handler for SUE versions 1.1.8 - 2.9.9
26
+ *
27
+ * Class Shopgate_Framework_Model_Payment_Simple_Sue_Sue118
28
+ *
29
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
30
+ */
31
+ class Shopgate_Framework_Model_Payment_Simple_Sue_Sue118
32
+ extends Shopgate_Framework_Model_Payment_Simple_Sue_Abstract
33
+ implements Shopgate_Framework_Model_Payment_Interface
34
+ {
35
+ const XML_CONFIG_ENABLED = 'payment/pnsofortueberweisung/active';
36
+ const XML_CONFIG_STATUS_PAID = 'payment/pnsofortueberweisung/order_status';
37
+ }
app/code/community/Shopgate/Framework/Model/Payment/Simple/Sue/Sue300.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
+ */
23
+
24
+ /**
25
+ * Handler for SUE versions 3.0.0+
26
+ *
27
+ * Class Shopgate_Framework_Model_Payment_Simple_Sue_Sue300
28
+ *
29
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
30
+ */
31
+ class Shopgate_Framework_Model_Payment_Simple_Sue_Sue300
32
+ extends Shopgate_Framework_Model_Payment_Simple_Sue_Abstract
33
+ implements Shopgate_Framework_Model_Payment_Interface
34
+ {
35
+ const XML_CONFIG_ENABLED = 'payment/paymentnetwork_pnsofortueberweisung/active';
36
+ const XML_CONFIG_STATUS_PAID = 'payment/paymentnetwork_pnsofortueberweisung/order_status_received_credited';
37
+ const XML_CONFIG_STATUS_NOT_PAID = 'payment/paymentnetwork_pnsofortueberweisung/order_status_pending_not_credited_yet';
38
+ }
app/code/community/Shopgate/Framework/Model/Payment/Usaepay.php CHANGED
@@ -18,19 +18,21 @@
18
  * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
  * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
  *
21
- * @author Shopgate GmbH <interfaces@shopgate.com>
22
  */
23
 
24
  /**
25
- * native model for usa epay
26
- *
27
  * @package Shopgate_Framework_Model_Payment_Usaepay
28
  * @author Peter Liebig <p.liebig@me.com, peter.liebig@magcorp.de>
 
29
  */
30
- class Shopgate_Framework_Model_Payment_Usaepay extends Shopgate_Framework_Model_Payment_Abstract
31
  {
32
-
33
  /**
 
 
 
34
  * @param $order Mage_Sales_Model_Order
35
  * @param $shopgateOrder ShopgateOrder
36
  *
@@ -38,96 +40,7 @@ class Shopgate_Framework_Model_Payment_Usaepay extends Shopgate_Framework_Model_
38
  */
39
  public function manipulateOrderWithPaymentData($order, $shopgateOrder)
40
  {
41
- $paymentInfos = $shopgateOrder->getPaymentInfos();
42
- // changing order payment method here cause otherwise validation fails cause not CC number, no expiration date
43
- $paymentUsaepay = Mage::getModel('usaepay/CCPaymentAction');
44
- $order->getPayment()->setMethod($paymentUsaepay->getCode());
45
- $paymentUsaepay->setInfoInstance($order->getPayment());
46
- $order->getPayment()->setMethodInstance($paymentUsaepay);
47
- $order->save();
48
-
49
- $lastFour = substr($paymentInfos['credit_card']['masked_number'], -4);
50
- $order->getPayment()->setCcNumberEnc($paymentInfos['credit_card']['masked_number']);
51
- $order->getPayment()->setCCLast4($lastFour);
52
- $order->getPayment()->setCcTransId($paymentInfos['reference_number']);
53
- $order->getPayment()->setCcApproval($paymentInfos['authorization_number']);
54
- $order->getPayment()->setCcType($this->_getCcTypeName($paymentInfos['credit_card']['type']));
55
- $order->getPayment()->setCcOwner($paymentInfos['credit_card']['holder']);
56
- $order->getPayment()->setLastTransId($paymentInfos['reference_number']);
57
-
58
- // C or A type. no const in usa epay model for this
59
- $paymentStatus = $shopgateOrder->getIsPaid() ? 'C' : 'A';
60
- try {
61
- $status = true;
62
- $invoice = $this->_getPaymentHelper()->createOrderInvoice($order);
63
- switch ($paymentStatus) {
64
- case 'C':
65
- $amountToCapture = $order->getBaseCurrency()->formatTxt($invoice->getBaseGrandTotal());
66
- $order->getPayment()->setAmountAuthorized($invoice->getGrandTotal());
67
- $order->getPayment()->setBaseAmountAuthorized($invoice->getBaseGrandTotal());
68
- $order->getPayment()->setBaseAmountPaidOnline($invoice->getBaseGrandTotal());
69
- $message = Mage::helper('sales')->__('Captured amount of %s online.', $amountToCapture);
70
- $state = Mage_Sales_Model_Order::STATE_PROCESSING;
71
- $invoice->setIsPaid(true);
72
- $invoice->setTransactionId($paymentInfos['reference_number']);
73
- $invoice->pay();
74
- $invoice->save();
75
- $order->addRelatedObject($invoice);
76
- $order->setState($state, $status, $message);
77
- break;
78
- case 'A':
79
- $formattedPrice = $order->getBaseCurrency()->formatTxt($order->getTotalDue());
80
- $order->getPayment()->setAmountAuthorized($order->getGrandTotal());
81
- $order->getPayment()->setBaseAmountAuthorized($order->getBaseGrandTotal());
82
- $order->getPayment()->setIsTransactionPending(true);
83
- $message = Mage::helper('paypal')->__('Authorized amount of %s.', $formattedPrice);
84
- $state = Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW;
85
- $invoice->setIsPaid(false);
86
- $invoice->save();
87
- $order->addRelatedObject($invoice);
88
- $order->setState($state, $status, $message);
89
- break;
90
- default:
91
- throw new Exception("Cannot handle payment status '{$paymentStatus}'.");
92
- }
93
- } catch (Exception $x) {
94
- $order->addStatusHistoryComment(Mage::helper('sales')->__('Note: %s', $x->getMessage()));
95
- Mage::logException($x);
96
- }
97
- return $order;
98
  }
99
 
100
- /**
101
- * Retrieve credit card type by mapping
102
- *
103
- * @param $ccType string
104
- * @return string
105
- */
106
- protected function _getCcTypeName($ccType)
107
- {
108
- switch ($ccType) {
109
- case 'visa':
110
- $ccType = 'VI';
111
- break;
112
- case 'mastercard':
113
- $ccType = 'MC';
114
- break;
115
- case 'american_express':
116
- $ccType = 'AE';
117
- break;
118
- case 'discover':
119
- $ccType = 'DI';
120
- break;
121
- case 'jcb':
122
- $ccType = 'JCB';
123
- break;
124
- case 'maestro':
125
- $ccType = 'SM';
126
- break;
127
- default:
128
- $ccType = 'OT';
129
- break;
130
- }
131
- return $ccType;
132
- }
133
  }
18
  * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
  * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
  *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
  */
23
 
24
  /**
25
+ * @deprecated v.2.9.18 - use Shopgate_Framework_Model_Payment_Cc_Usaepay instead
 
26
  * @package Shopgate_Framework_Model_Payment_Usaepay
27
  * @author Peter Liebig <p.liebig@me.com, peter.liebig@magcorp.de>
28
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
29
  */
30
+ class Shopgate_Framework_Model_Payment_Usaepay
31
  {
 
32
  /**
33
+ * Use Shopgate_Framework_Model_Payment_Cc_Usaepay instead
34
+ *
35
+ * @deprecated v.2.9.18
36
  * @param $order Mage_Sales_Model_Order
37
  * @param $shopgateOrder ShopgateOrder
38
  *
40
  */
41
  public function manipulateOrderWithPaymentData($order, $shopgateOrder)
42
  {
43
+ return Mage::getModel('shopgate/payment_cc_usaepay', $shopgateOrder)->manipulateOrderWithPaymentData($order);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  }
45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  }
app/code/community/Shopgate/Framework/Model/Payment/Wspp.php CHANGED
@@ -1,103 +1,51 @@
1
  <?php
2
  /**
3
- * User: pliebig
4
- * Date: 10.09.14
5
- * Time: 10:05
6
- * E-Mail: p.liebig@me.com, peter.liebig@magcorp.de
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  */
8
 
9
  /**
10
- * class to manipulate the order payment data with amazon payment data
11
  *
 
12
  * @package Shopgate_Framework_Model_Payment_Wspp
13
  * @author Peter Liebig <p.liebig@me.com, peter.liebig@magcorp.de>
 
14
  */
15
  class Shopgate_Framework_Model_Payment_Wspp
16
  {
17
  /**
18
  * create new order for amazon payment
19
  *
 
20
  * @param $quote Mage_Sales_Model_Quote
21
  * @return Mage_Sales_Model_Order
22
  * @throws Exception
23
  */
24
  public function createNewOrder($quote)
25
  {
26
- $convert = Mage::getModel('sales/convert_quote');
27
- $transaction = Mage::getModel('core/resource_transaction');
28
-
29
- if ($quote->getCustomerId()) {
30
- $transaction->addObject($quote->getCustomer());
31
- }
32
-
33
- $transaction->addObject($quote);
34
- if ($quote->isVirtual()) {
35
- $order = $convert->addressToOrder($quote->getBillingAddress());
36
- } else {
37
- $order = $convert->addressToOrder($quote->getShippingAddress());
38
- }
39
- $order->setBillingAddress($convert->addressToOrderAddress($quote->getBillingAddress()));
40
- if ($quote->getBillingAddress()->getCustomerAddress()) {
41
- $order->getBillingAddress()->setCustomerAddress($quote->getBillingAddress()->getCustomerAddress());
42
- }
43
- if (!$quote->isVirtual()) {
44
- $order->setShippingAddress($convert->addressToOrderAddress($quote->getShippingAddress()));
45
- if ($quote->getShippingAddress()->getCustomerAddress()) {
46
- $order->getShippingAddress()->setCustomerAddress($quote->getShippingAddress()->getCustomerAddress());
47
- }
48
- }
49
-
50
- $order->setPayment($convert->paymentToOrderPayment($quote->getPayment()));
51
- $order->getPayment()->setTransactionId($quote->getPayment()->getTransactionId());
52
-
53
- foreach ($quote->getAllItems() as $item) {
54
- /** @var Mage_Sales_Model_Order_Item $item */
55
- $orderItem = $convert->itemToOrderItem($item);
56
- if ($item->getParentItem()) {
57
- $orderItem->setParentItem($order->getItemByQuoteItemId($item->getParentItem()->getId()));
58
- }
59
- $order->addItem($orderItem);
60
- }
61
- $order->setQuote($quote);
62
- $order->setExtOrderId($quote->getPayment()->getTransactionId());
63
- $order->setCanSendNewEmailFlag(false);
64
- $transaction->addObject($order);
65
- $transaction->addCommitCallback(array($order, 'save'));
66
-
67
- try {
68
- $transaction->save();
69
- Mage::dispatchEvent(
70
- 'sales_model_service_quote_submit_success',
71
- array(
72
- 'order' => $order,
73
- 'quote' => $quote
74
- )
75
- );
76
- } catch (Exception $e) {
77
- //reset order ID's on exception, because order not saved
78
- $order->setId(null);
79
- /** @var $item Mage_Sales_Model_Order_Item */
80
- foreach ($order->getItemsCollection() as $item) {
81
- $item->setOrderId(null);
82
- $item->setItemId(null);
83
- }
84
-
85
- Mage::dispatchEvent(
86
- 'sales_model_service_quote_submit_failure',
87
- array(
88
- 'order' => $order,
89
- 'quote' => $quote
90
- )
91
- );
92
- throw $e;
93
- }
94
- Mage::dispatchEvent('checkout_submit_all_after', array('order' => $order, 'quote' => $quote));
95
- Mage::dispatchEvent('sales_model_service_quote_submit_after', array('order' => $order, 'quote' => $quote));
96
-
97
- return $order;
98
  }
99
 
100
  /**
 
101
  * @param $order Mage_Sales_Model_Order
102
  * @param $shopgateOrder ShopgateOrder
103
  * // TODO Refund
@@ -105,94 +53,18 @@ class Shopgate_Framework_Model_Payment_Wspp
105
  */
106
  public function manipulateOrderWithPaymentData($order, $shopgateOrder)
107
  {
108
- $paymentInfos = $shopgateOrder->getPaymentInfos();
109
- $paypalIpnData = json_decode($paymentInfos['paypal_ipn_data'], true);
110
- $paypalIpnData = array_merge($paymentInfos['credit_card'], $paypalIpnData);
111
- $paymentStatus = $this->_getPaymentHelper()->filterPaymentStatus($paypalIpnData['payment_status']);
112
-
113
- $trans = Mage::getModel('sales/order_payment_transaction');
114
- $trans->setOrderPaymentObject($order->getPayment());
115
- $trans->setTxnId($paypalIpnData['txn_id']);
116
- $trans->setIsClosed(false);
117
-
118
- try {
119
- $invoice = $this->_getPaymentHelper()->createOrderInvoice($order);
120
- switch ($paymentStatus) {
121
- // paid
122
- case Mage_Paypal_Model_Info::PAYMENTSTATUS_COMPLETED:
123
- $trans->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE);
124
- if ($order->getPayment()->getIsTransactionPending()) {
125
- $invoice->setIsPaid(false);
126
- } else { // normal online capture: invoice is marked as "paid"
127
- $invoice->setIsPaid(true);
128
- $invoice->pay();
129
- }
130
- break;
131
- // refund by merchant on PayPal side
132
- case Mage_Paypal_Model_Info::PAYMENTSTATUS_REFUNDED:
133
- //$this->_getPaymentHelper()->registerPaymentRefund($additionalData, $order);
134
- break;
135
- // payment was obtained, but money were not captured yet
136
- case Mage_Paypal_Model_Info::PAYMENTSTATUS_PENDING:
137
- foreach($paypalIpnData as $key => $value){
138
- if(strpos($key,'fraud_management_pending_filters_') !== false) {
139
- $order->getPayment()->setIsTransactionPending(true);
140
- $order->getPayment()->setIsFraudDetected(true);
141
- }
142
- }
143
-
144
- $trans->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
145
- $invoice->setIsPaid(false);
146
- $order->getPayment()->setAmountAuthorized($order->getTotalDue());
147
- break;
148
- default:
149
- throw new Exception("Cannot handle payment status '{$paymentStatus}'.");
150
- }
151
- $trans->save();
152
- $invoice->setTransactionId($paypalIpnData['txn_id']);
153
- $invoice->save();
154
- $order->addRelatedObject($invoice);
155
- $this->_getPaymentHelper()->importPaymentInformation($order->getPayment(), $paypalIpnData);
156
- $order->getPayment()->setTransactionAdditionalInfo(
157
- Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS,
158
- $paypalIpnData
159
- );
160
- $order->getPayment()->setCcOwner($paypalIpnData['holder']);
161
- $order->getPayment()->setCcType($paypalIpnData['type']);
162
- $order->getPayment()->setCcNumberEnc($paypalIpnData['masked_number']);
163
- $order->getPayment()->setLastTransId($paypalIpnData['txn_id']);
164
- $this->_getPaymentHelper()->orderStatusManager($order, $paymentStatus);
165
- } catch (Exception $x) {
166
- $comment = $this->_getPaymentHelper()->createIpnComment(
167
- $order,
168
- Mage::helper('paypal')->__('Note: %s', $x->getMessage()),
169
- true
170
- );
171
- $comment->save();
172
- Mage::logException($x);
173
- }
174
- return $order;
175
  }
176
 
177
  /**
 
178
  * @param $quote Mage_Sales_Model_Quote
179
  * @param $data array
180
  * @return Mage_Sales_Model_Quote
181
  */
182
  public function prepareQuote($quote, $data)
183
  {
184
- $ipnData = json_decode($data['paypal_ipn_data'], true);
185
- $this->_getPaymentHelper()->importToPayment(
186
- $ipnData,
187
- $quote->getPayment()->getMethodInstance()->getInfoInstance()
188
- );
189
- $quote->getPayment()->setTransactionId($data['paypal_txn_id']);
190
- $quote->getPayment()->setCcOwner($data['credit_card']['holder']);
191
- $quote->getPayment()->setCcType($data['credit_card']['type']);
192
- $quote->getPayment()->setCcNumberEnc($data['credit_card']['masked_number']);
193
- $quote->setData('paypal_ipn_data', $data['paypal_ipn_data']);
194
- $quote->getPayment()->setLastTransId($data['paypal_txn_id']);
195
- return $quote;
196
  }
197
 
198
  /**
1
  <?php
2
  /**
3
+ * Shopgate GmbH
4
+ *
5
+ * URHEBERRECHTSHINWEIS
6
+ *
7
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
8
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
9
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
10
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
11
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
12
+ *
13
+ * COPYRIGHT NOTICE
14
+ *
15
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
16
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
17
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
18
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
19
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
20
+ *
21
+ * @author Shopgate GmbH <interfaces@shopgate.com>
22
  */
23
 
24
  /**
25
+ * Class to manipulate the order payment data with amazon payment data
26
  *
27
+ * @deprecated v.2.9.18 - use Shopgate_Framework_Model_Payment_Pp_Wspp instead
28
  * @package Shopgate_Framework_Model_Payment_Wspp
29
  * @author Peter Liebig <p.liebig@me.com, peter.liebig@magcorp.de>
30
+ * @author Konstantin Kiritsenko <konstantin@kiritsenko.com>
31
  */
32
  class Shopgate_Framework_Model_Payment_Wspp
33
  {
34
  /**
35
  * create new order for amazon payment
36
  *
37
+ * @deprecated v.2.9.18
38
  * @param $quote Mage_Sales_Model_Quote
39
  * @return Mage_Sales_Model_Order
40
  * @throws Exception
41
  */
42
  public function createNewOrder($quote)
43
  {
44
+ return Mage::getModel('shopgate/payment_pp_wspp', new ShopgateOrder())->createNewOrder($quote);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  }
46
 
47
  /**
48
+ * @deprecated v.2.9.18
49
  * @param $order Mage_Sales_Model_Order
50
  * @param $shopgateOrder ShopgateOrder
51
  * // TODO Refund
53
  */
54
  public function manipulateOrderWithPaymentData($order, $shopgateOrder)
55
  {
56
+ return Mage::getModel('shopgate/payment_pp_wspp', $shopgateOrder)->manipulateOrderWithPaymentData($order);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  }
58
 
59
  /**
60
+ * @deprecated v.2.9.18
61
  * @param $quote Mage_Sales_Model_Quote
62
  * @param $data array
63
  * @return Mage_Sales_Model_Quote
64
  */
65
  public function prepareQuote($quote, $data)
66
  {
67
+ return Mage::getModel('shopgate/payment_pp_wspp', new ShopgateOrder())->prepareQuote($quote, $data);
 
 
 
 
 
 
 
 
 
 
 
68
  }
69
 
70
  /**
app/code/community/Shopgate/Framework/Model/Shopgate/Plugin.php CHANGED
@@ -72,6 +72,11 @@ class Shopgate_Framework_Model_Shopgate_Plugin extends ShopgatePlugin
72
  */
73
  protected $_defaultCategoryRow = null;
74
 
 
 
 
 
 
75
  /**
76
  * Callback function for initialization by plugin implementations.
77
  * This method gets called on instantiation of a ShopgatePlugin child class and serves as __construct() replacement.
@@ -89,6 +94,31 @@ class Shopgate_Framework_Model_Shopgate_Plugin extends ShopgatePlugin
89
  return true;
90
  }
91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  /**
93
  *
94
  * @param string $action
@@ -355,31 +385,14 @@ class Shopgate_Framework_Model_Shopgate_Plugin extends ShopgatePlugin
355
  $title = $title ? $title : $order->getShippingInfos()->getDisplayName();
356
  $quote->getShippingAddress()->setShippingDescription($title);
357
  $quote->save();
358
-
359
- // due to compatibility with 3rd party modules which fetches the quote from the session (like phoenix_cod)
360
- Mage::getSingleton('checkout/session')->replaceQuote($quote);
361
- $this->log("# Create order from quote", ShopgateLogger::LOGTYPE_DEBUG);
362
 
363
- if ($order->getPaymentMethod() == ShopgateOrder::AMAZON_PAYMENT
364
- && Mage::getConfig()->getModuleConfig('Creativestyle_AmazonPayments')->is('active', 'true')) {
365
- $magentoOrder = Mage::getModel('shopgate/payment_amazon')->createNewOrder($quote);
366
- } elseif ($order->getPaymentMethod() == ShopgateOrder::PP_WSPP_CC
367
- && Mage::getConfig()->getModuleConfig('Mage_Paypal')->is('active', 'true')) {
368
- $magentoOrder = Mage::getModel('shopgate/payment_wspp')->createNewOrder($quote);
369
- } elseif ($order->getPaymentMethod() == ShopgateOrder::PAYPAL
370
- && Mage::getConfig()->getModuleConfig('Mage_Paypal')->is('active', 'true')
371
- && $quote->getPayment()->getMethodInstance()->getCode() == "paypal_express") {
372
- $magentoOrder = Mage::getModel('shopgate/payment_express')->createNewOrder($quote);
373
- } else {
374
- $service = Mage::getModel('sales/service_quote', $quote);
375
- if (!Mage::helper("shopgate/config")->getIsMagentoVersionLower15()) {
376
- $service->submitAll();
377
- $magentoOrder = $service->getOrder();
378
- } else {
379
- $magentoOrder = $service->submit();
380
- }
381
- }
382
 
 
 
 
383
  $this->log("# Modify order", ShopgateLogger::LOGTYPE_DEBUG);
384
  $magentoOrder->setCanEdit(false);
385
  $magentoOrder->setCanShipPartially(true);
@@ -387,23 +400,17 @@ class Shopgate_Framework_Model_Shopgate_Plugin extends ShopgatePlugin
387
  $magentoOrder = $this->executeLoaders($this->_getCreateOrderLoaders(), $magentoOrder, $order);
388
  $magentoOrder->setShippingDescription($title);
389
  $magentoOrder->setShippingMethod($method);
390
- if ($magentoOrder->getTotalDue() > 0
 
 
391
  && $order->getPaymentMethod() == ShopgateOrder::PP_WSPP_CC
392
  ) {
393
- $state = Mage_Sales_Model_Order::STATE_PROCESSING;
394
- $status = true;
395
- if ($magentoOrder->getPayment()->getIsTransactionPending()) {
396
- $state = Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW;
397
- if ($magentoOrder->getPayment()->getIsFraudDetected()) {
398
- $status = Mage_Sales_Model_Order::STATUS_FRAUD;
399
- }
400
- } else {
401
  $magentoOrder->setTotalPaid($magentoOrder->getGrandTotal());
402
  $magentoOrder->setBaseTotalPaid($magentoOrder->getBaseGrandTotal());
403
  $magentoOrder->setTotalDue(0);
404
  $magentoOrder->setBaseTotalDue(0);
405
  }
406
- $magentoOrder->setState($state,$status);
407
  }
408
  $magentoOrder->save();
409
 
@@ -510,6 +517,12 @@ class Shopgate_Framework_Model_Shopgate_Plugin extends ShopgatePlugin
510
  $product = Mage::getModel('catalog/product')->setStoreId($this->_getConfig()->getStoreViewId())
511
  ->load($pId);
512
 
 
 
 
 
 
 
513
  $itemNumber = $item->getItemNumber();
514
  $productWeight = NULL;
515
 
@@ -768,7 +781,12 @@ class Shopgate_Framework_Model_Shopgate_Plugin extends ShopgatePlugin
768
  */
769
  protected function _setQuotePayment($quote, $order)
770
  {
771
- $payment = $this->_getOrderHelper()->getMagentoPaymentMethod($order->getPaymentMethod());
 
 
 
 
 
772
  $paymentInfo = array();
773
  $info = $order->getPaymentInfos();
774
 
@@ -778,10 +796,10 @@ class Shopgate_Framework_Model_Shopgate_Plugin extends ShopgatePlugin
778
  $checkoutSession->replaceQuote($quote);
779
  }
780
  }
781
-
782
  if ($payment instanceof Shopgate_Framework_Model_Payment_MobilePayment) {
783
  $this->log("payment is shopgate", ShopgateLogger::LOGTYPE_DEBUG);
784
- $payment->setShopgateOrder($order);
785
  }
786
 
787
  if ($payment->getCode() == Mage::getModel("shopgate/payment_mobilePayment")->getCode()) {
@@ -799,31 +817,13 @@ class Shopgate_Framework_Model_Shopgate_Plugin extends ShopgatePlugin
799
  $paymentInfo['is_test'] = $order->getIsTest();
800
  $paymentInfo['is_paid'] = $order->getIsPaid();
801
 
802
- $quote->getPayment()->setMethod($payment->getCode());
803
-
804
  $quote->getPayment()->setAdditionalData(serialize($paymentInfo));
805
  $quote->getPayment()->setAdditionalInformation($paymentInfo);
806
  $quote->getPayment()->setLastTransId($order->getPaymentTransactionNumber());
807
 
808
- if ($order->getPaymentMethod() == ShopgateOrder::AMAZON_PAYMENT
809
- && Mage::getConfig()->getModuleConfig('Creativestyle_AmazonPayments')->is('active', 'true')) {
810
- $amazonPaymentModel = Mage::getModel('shopgate/payment_amazon');
811
- $quote = $amazonPaymentModel->prepareQuote($quote, $payment, $info);
812
- }
813
 
814
- if ($order->getPaymentMethod() == ShopgateOrder::PP_WSPP_CC
815
- && Mage::getConfig()->getModuleConfig('Mage_Paypal')->is('active', 'true')) {
816
- $paypalWsppModel = Mage::getModel('shopgate/payment_wspp');
817
- $quote = $paypalWsppModel->prepareQuote($quote, $info);
818
- }
819
-
820
- if ($order->getPaymentMethod() == ShopgateOrder::PAYPAL
821
- && Mage::getConfig()->getModuleConfig('Mage_Paypal')->is('active', 'true')
822
- && $payment->getCode() == "paypal_express") {
823
- $paypalExpressModel = Mage::getModel('shopgate/payment_express');
824
- $quote = $paypalExpressModel->prepareQuote($quote, $info);
825
- }
826
-
827
  return $quote;
828
  }
829
 
@@ -1367,75 +1367,61 @@ class Shopgate_Framework_Model_Shopgate_Plugin extends ShopgatePlugin
1367
  */
1368
  protected function _setOrderState($magentoOrder, $shopgateOrder)
1369
  {
1370
- if ($shopgateOrder->getPaymentMethod() == ShopgateOrder::PREPAY && !$shopgateOrder->getIsPaid()) {
 
 
 
1371
  $classExists = mageFindClassFile("Mage_Payment_Model_Method_Banktransfer");
1372
 
1373
- if ($classExists !== false
1374
- && Mage::getStoreConfigFlag("payment/banktransfer/active")
1375
- ) {
1376
  return $magentoOrder;
1377
- } else if ((Mage::getConfig()->getModuleConfig("Phoenix_BankPayment")->is('active', 'true')
1378
- || Mage::getConfig()->getModuleConfig('Mage_BankPayment')->is('active', 'true'))
1379
- && Mage::getStoreConfig('payment/bankpayment/order_status')
1380
- ) {
1381
- $status = Mage::getStoreConfig('payment/bankpayment/order_status');
1382
- $state = $this->_getHelper()->getStateForStatus($status);
1383
- $magentoOrder->setState($state, $status);
1384
- } else if (!Mage::getStoreConfig(Shopgate_Framework_Model_Config::XML_PATH_SHOPGATE_ORDER_MARK_UNBLOCKED_AS_PAID)) {
1385
- if ($magentoOrder->getState() != Mage_Sales_Model_Order::STATE_HOLDED) {
1386
- $magentoOrder->setHoldBeforeState($magentoOrder->getState());
1387
- $magentoOrder->setHoldBeforeStatus($magentoOrder->getStatus());
1388
- }
1389
- $magentoOrder->setState(Mage_Sales_Model_Order::STATE_HOLDED, Mage_Sales_Model_Order::STATE_HOLDED);
1390
  } else {
1391
- $oldStatus = $shopgateOrder->getIsPaid();
1392
- $shopgateOrder->setIsPaid(true);
1393
-
1394
- $magentoOrder->addStatusHistoryComment(
1395
- $this->_getHelper()->__(
1396
- "[SHOPGATE] Set order as paid because shipping is not blocked and config is set to 'mark unblocked orders as paid'!"
1397
- ),
1398
- false
1399
- )->setIsCustomerNotified(false);
1400
-
1401
- $magentoOrder = $this->_setOrderPayment($magentoOrder, $shopgateOrder);
1402
- $shopgateOrder->setIsPaid($oldStatus);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1403
  }
1404
  } else {
1405
- $stateObject = new Varien_Object();
1406
  $methodInstance = $magentoOrder->getPayment()->getMethodInstance();
1407
- if ($shopgateOrder->getPaymentMethod() != ShopgateOrder::AMAZON_PAYMENT) {
 
 
1408
  // avoid calling order on amazon payment again
1409
  $methodInstance->initialize($methodInstance->getConfigData('payment_action'), $stateObject);
1410
  }
1411
 
1412
- if ($shopgateOrder->getPaymentMethod() == ShopgateOrder::PP_WSPP_CC
1413
- || $shopgateOrder->getPaymentMethod() == ShopgateOrder::AMAZON_PAYMENT) {
1414
- $stateObject->setState($magentoOrder->getState());
1415
- $stateObject->setStatus($magentoOrder->getStatus());
1416
- }
1417
-
1418
- if ($shopgateOrder->getPaymentMethod() == ShopgateOrder::SUE) {
1419
- if ($shopgateOrder->getIsPaid()) {
1420
- $status = $methodInstance->getConfigData("order_status_received_credited");
1421
- $stateObject->setState($this->_getHelper()->getStateForStatus($status));
1422
- $stateObject->setStatus($status);
1423
- } else {
1424
- $status = $methodInstance->getConfigData("order_status_pending_not_credited_yet");
1425
- $stateObject->setState($this->_getHelper()->getStateForStatus($status));
1426
- $stateObject->setStatus($status);
1427
- }
1428
- if(!$status) {
1429
- //above statuses are not there below v.3.0.0
1430
- $status = $methodInstance->getConfigData("order_status");
1431
- if(!$status) {
1432
- $status = Mage_Sales_Model_Order::STATE_PENDING_PAYMENT; //mage 1.4.1.1 empty status fix
1433
- }
1434
- $stateObject->setState($this->_getHelper()->getStateForStatus($status));
1435
- $stateObject->setStatus($status);
1436
- }
1437
- }
1438
-
1439
  if (!$stateObject->getState()) {
1440
  $status = $methodInstance->getConfigData("order_status");
1441
 
@@ -1459,24 +1445,16 @@ class Shopgate_Framework_Model_Shopgate_Plugin extends ShopgatePlugin
1459
  $shopgateOrder->setIsPaid(true);
1460
 
1461
  $magentoOrder->addStatusHistoryComment(
1462
- $this->_getHelper()->__(
1463
- "[SHOPGATE] Set order as paid because shipping is not blocked and config is set to 'mark unblocked orders as paid'!"
1464
- ),
1465
- false
1466
  )->setIsCustomerNotified(false);
1467
 
1468
  $magentoOrder = $this->_setOrderPayment($magentoOrder, $shopgateOrder);
1469
 
1470
  $shopgateOrder->setIsPaid($oldStatus);
1471
  }
1472
-
1473
- if ($shopgateOrder->getIsPaid() && ($shopgateOrder->getPaymentMethod() === ShopgateOrder::PAYPAL
1474
- || $shopgateOrder->getPaymentMethod() == ShopgateOrder::AMAZON_PAYMENT)) {
1475
- $magentoOrder->setState(
1476
- Mage_Sales_Model_Order::STATE_PROCESSING,
1477
- Mage_Sales_Model_Order::STATE_PROCESSING
1478
- );
1479
- }
1480
  }
1481
 
1482
  $magentoOrder->save();
@@ -1493,43 +1471,13 @@ class Shopgate_Framework_Model_Shopgate_Plugin extends ShopgatePlugin
1493
  */
1494
  protected function _setOrderPayment($magentoOrder, $shopgateOrder)
1495
  {
1496
- if ($shopgateOrder->getPaymentMethod() == ShopgateOrder::AMAZON_PAYMENT
1497
- && Mage::getConfig()->getModuleConfig("Creativestyle_AmazonPayments")->is('active', 'true')) {
1498
- return Mage::getModel('shopgate/payment_amazon')->manipulateOrderWithPaymentData($magentoOrder,$shopgateOrder);
1499
- }
1500
-
1501
- if ($shopgateOrder->getPaymentMethod() == ShopgateOrder::USAEPAY_CC
1502
- && Mage::getConfig()->getModuleConfig("Mage_Usaepay")->is('active', 'true')) {
1503
- return Mage::getModel('shopgate/payment_usaepay')->manipulateOrderWithPaymentData($magentoOrder,$shopgateOrder);
1504
- }
1505
-
1506
- if ($shopgateOrder->getPaymentMethod() == ShopgateOrder::AUTHN_CC
1507
- && Mage::getConfig()->getModuleConfig("Mage_Paygate")->is('active', 'true')
1508
- && (bool)Mage::getModel('paygate/authorizenet')->getConfigData('active')) {
1509
- return Mage::getModel('shopgate/payment_authorize')->manipulateOrderWithPaymentData(
1510
- $magentoOrder,
1511
- $shopgateOrder
1512
- );
1513
- }
1514
-
1515
- if ($shopgateOrder->getPaymentMethod() == ShopgateOrder::PP_WSPP_CC
1516
- && Mage::getConfig()->getModuleConfig("Mage_Paypal")->is('active', 'true')) {
1517
- return Mage::getModel('shopgate/payment_wspp')->manipulateOrderWithPaymentData($magentoOrder,$shopgateOrder);
1518
  }
1519
 
1520
- if ($shopgateOrder->getPaymentMethod() == ShopgateOrder::PAYPAL
1521
- && Mage::getConfig()->getModuleConfig("Mage_Paypal")->is('active', 'true')
1522
- && $magentoOrder->getPayment()->getMethodInstance()->getCode() == "paypal_express") {
1523
- return Mage::getModel('shopgate/payment_express')->manipulateOrderWithPaymentData($magentoOrder,$shopgateOrder);
1524
- }
1525
-
1526
- if ($shopgateOrder->getPaymentMethod() == ShopgateOrder::BILLSAFE
1527
- && Mage::getConfig()->getModuleConfig("Netresearch_Billsafe")->is('active', 'true')) {
1528
- /** @var Shopgate_Framework_Model_Payment_Billsafe $billsafePaymentModel */
1529
- return Mage::getModel('shopgate/payment_billsafe')->manipulateOrderWithPaymentData($magentoOrder,$shopgateOrder);
1530
- }
1531
-
1532
-
1533
  if ($shopgateOrder->getIsPaid() && $magentoOrder->getBaseTotalDue()) {
1534
  $magentoOrder->getPayment()->setShouldCloseParentTransaction(true);
1535
  $magentoOrder->getPayment()->registerCaptureNotification($shopgateOrder->getAmountComplete());
@@ -1544,7 +1492,6 @@ class Shopgate_Framework_Model_Shopgate_Plugin extends ShopgatePlugin
1544
  $transaction->setIsClosed(false);
1545
  $transaction->setTxnId($shopgateOrder->getPaymentTransactionNumber());
1546
  $transaction->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE);
1547
-
1548
  $transaction->save();
1549
 
1550
  $magentoOrder->getPayment()->importTransactionInfo($transaction);
@@ -1553,18 +1500,7 @@ class Shopgate_Framework_Model_Shopgate_Plugin extends ShopgatePlugin
1553
  }
1554
  }
1555
  }
1556
-
1557
- if ($shopgateOrder->getPaymentMethod() == ShopgateOrder::SUE
1558
- && Mage::getConfig()->getModuleConfig('Paymentnetwork_Pnsofortueberweisung')->is('active', 'true')) {
1559
- if ($shopgateOrder->getIsPaid()) {
1560
- $invoice = $this->_getPaymentHelper()->createOrderInvoice($magentoOrder);
1561
- $invoice->setIsPaid(true);
1562
- $invoice->pay();
1563
- $invoice->save();
1564
- $magentoOrder->addRelatedObject($invoice);
1565
- }
1566
- }
1567
-
1568
  $magentoOrder->getPayment()->setLastTransId($shopgateOrder->getPaymentTransactionNumber());
1569
 
1570
  return $magentoOrder;
72
  */
73
  protected $_defaultCategoryRow = null;
74
 
75
+ /**
76
+ * @var null | Shopgate_Framework_Model_Payment_Factory
77
+ */
78
+ protected $_factory = null;
79
+
80
  /**
81
  * Callback function for initialization by plugin implementations.
82
  * This method gets called on instantiation of a ShopgatePlugin child class and serves as __construct() replacement.
94
  return true;
95
  }
96
 
97
+ /**
98
+ * Simple setter
99
+ *
100
+ * @param $factory Shopgate_Framework_Model_Payment_Factory
101
+ */
102
+ protected function _setFactory(Shopgate_Framework_Model_Payment_Factory $factory)
103
+ {
104
+ $this->_factory = $factory;
105
+ }
106
+
107
+ /**
108
+ * Factory getter
109
+ *
110
+ * @return null|Shopgate_Framework_Model_Payment_Factory
111
+ */
112
+ protected function _getFactory()
113
+ {
114
+ if(!$this->_factory){
115
+ $shopgateOrder = Mage::getModel('core/session')->getShopgateOrder();
116
+ $factory = Mage::getModel('shopgate/payment_factory', $shopgateOrder);
117
+ $this->_setFactory($factory);
118
+ }
119
+ return $this->_factory;
120
+ }
121
+
122
  /**
123
  *
124
  * @param string $action
385
  $title = $title ? $title : $order->getShippingInfos()->getDisplayName();
386
  $quote->getShippingAddress()->setShippingDescription($title);
387
  $quote->save();
 
 
 
 
388
 
389
+ // due to compatibility with 3rd party modules which fetches the quote from the session (like phoenix_cod, SUE)
390
+ // needed before $service->submitAll() is called
391
+ Mage::getSingleton('checkout/session')->replaceQuote($quote);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
392
 
393
+ $magentoOrder = $this->_getFactory()->createNewOrder($quote);
394
+
395
+ $this->log("# Create order from quote", ShopgateLogger::LOGTYPE_DEBUG);
396
  $this->log("# Modify order", ShopgateLogger::LOGTYPE_DEBUG);
397
  $magentoOrder->setCanEdit(false);
398
  $magentoOrder->setCanShipPartially(true);
400
  $magentoOrder = $this->executeLoaders($this->_getCreateOrderLoaders(), $magentoOrder, $order);
401
  $magentoOrder->setShippingDescription($title);
402
  $magentoOrder->setShippingMethod($method);
403
+
404
+ //todo: move this out, intentionally here after executeLoaders?
405
+ if ($magentoOrder->getTotalDue() > 0
406
  && $order->getPaymentMethod() == ShopgateOrder::PP_WSPP_CC
407
  ) {
408
+ if (!$magentoOrder->getPayment()->getIsTransactionPending()) {
 
 
 
 
 
 
 
409
  $magentoOrder->setTotalPaid($magentoOrder->getGrandTotal());
410
  $magentoOrder->setBaseTotalPaid($magentoOrder->getBaseGrandTotal());
411
  $magentoOrder->setTotalDue(0);
412
  $magentoOrder->setBaseTotalDue(0);
413
  }
 
414
  }
415
  $magentoOrder->save();
416
 
517
  $product = Mage::getModel('catalog/product')->setStoreId($this->_getConfig()->getStoreViewId())
518
  ->load($pId);
519
 
520
+ if (!$product->getId()) {
521
+ throw new ShopgateLibraryException(
522
+ ShopgateLibraryException::CART_ITEM_PRODUCT_NOT_FOUND, 'product ID: ' . $pId, true
523
+ );
524
+ }
525
+
526
  $itemNumber = $item->getItemNumber();
527
  $productWeight = NULL;
528
 
781
  */
782
  protected function _setQuotePayment($quote, $order)
783
  {
784
+ $payment = $this->_getFactory()->getPaymentModel();
785
+
786
+ if (!$payment) {
787
+ $payment = $this->_getOrderHelper()->getMagentoPaymentMethod($order->getPaymentMethod());
788
+ }
789
+
790
  $paymentInfo = array();
791
  $info = $order->getPaymentInfos();
792
 
796
  $checkoutSession->replaceQuote($quote);
797
  }
798
  }
799
+
800
  if ($payment instanceof Shopgate_Framework_Model_Payment_MobilePayment) {
801
  $this->log("payment is shopgate", ShopgateLogger::LOGTYPE_DEBUG);
802
+ $payment->setShopgateOrder($order); //allows printing of order details
803
  }
804
 
805
  if ($payment->getCode() == Mage::getModel("shopgate/payment_mobilePayment")->getCode()) {
817
  $paymentInfo['is_test'] = $order->getIsTest();
818
  $paymentInfo['is_paid'] = $order->getIsPaid();
819
 
820
+ $quote->getPayment()->setMethod($payment->getCode());
 
821
  $quote->getPayment()->setAdditionalData(serialize($paymentInfo));
822
  $quote->getPayment()->setAdditionalInformation($paymentInfo);
823
  $quote->getPayment()->setLastTransId($order->getPaymentTransactionNumber());
824
 
825
+ $quote = $this->_getFactory()->prepareQuote($quote, $info);
 
 
 
 
826
 
 
 
 
 
 
 
 
 
 
 
 
 
 
827
  return $quote;
828
  }
829
 
1367
  */
1368
  protected function _setOrderState($magentoOrder, $shopgateOrder)
1369
  {
1370
+ $magentoOrder = $this->_getFactory()->setOrderStatus($magentoOrder);
1371
+ if ($magentoOrder->getShopgateStatusSet()) {
1372
+ //do nothing, but we will need to pull this whole thing inside factory
1373
+ } elseif ($shopgateOrder->getPaymentMethod() == ShopgateOrder::PREPAY && !$shopgateOrder->getIsPaid()) {
1374
  $classExists = mageFindClassFile("Mage_Payment_Model_Method_Banktransfer");
1375
 
1376
+ if ($classExists !== false && Mage::getStoreConfigFlag("payment/banktransfer/active")) {
 
 
1377
  return $magentoOrder;
 
 
 
 
 
 
 
 
 
 
 
 
 
1378
  } else {
1379
+ if ((Mage::getConfig()->getModuleConfig("Phoenix_BankPayment")->is('active', 'true')
1380
+ || Mage::getConfig()->getModuleConfig('Mage_BankPayment')->is('active', 'true'))
1381
+ && Mage::getStoreConfig('payment/bankpayment/order_status')
1382
+ ) {
1383
+ $status = Mage::getStoreConfig('payment/bankpayment/order_status');
1384
+ $state = $this->_getHelper()->getStateForStatus($status);
1385
+ $magentoOrder->setState($state, $status);
1386
+ } else {
1387
+ if (!Mage::getStoreConfig(
1388
+ Shopgate_Framework_Model_Config::XML_PATH_SHOPGATE_ORDER_MARK_UNBLOCKED_AS_PAID
1389
+ )
1390
+ ) {
1391
+ if ($magentoOrder->getState() != Mage_Sales_Model_Order::STATE_HOLDED) {
1392
+ $magentoOrder->setHoldBeforeState($magentoOrder->getState());
1393
+ $magentoOrder->setHoldBeforeStatus($magentoOrder->getStatus());
1394
+ }
1395
+ $magentoOrder->setState(
1396
+ Mage_Sales_Model_Order::STATE_HOLDED,
1397
+ Mage_Sales_Model_Order::STATE_HOLDED
1398
+ );
1399
+ } else {
1400
+ $oldStatus = $shopgateOrder->getIsPaid();
1401
+ $shopgateOrder->setIsPaid(true);
1402
+
1403
+ $magentoOrder->addStatusHistoryComment(
1404
+ $this->_getHelper()->__(
1405
+ "[SHOPGATE] Set order as paid because shipping is not blocked and config is set to 'mark unblocked orders as paid'!"
1406
+ ),
1407
+ false
1408
+ )->setIsCustomerNotified(false);
1409
+
1410
+ $magentoOrder = $this->_setOrderPayment($magentoOrder, $shopgateOrder);
1411
+ $shopgateOrder->setIsPaid($oldStatus);
1412
+ }
1413
+ }
1414
  }
1415
  } else {
1416
+ $stateObject = new Varien_Object();
1417
  $methodInstance = $magentoOrder->getPayment()->getMethodInstance();
1418
+ if ($shopgateOrder->getPaymentMethod() != ShopgateOrder::AMAZON_PAYMENT
1419
+ && strpos($shopgateOrder->getPaymentMethod(), 'PAYONE') === false
1420
+ ) {
1421
  // avoid calling order on amazon payment again
1422
  $methodInstance->initialize($methodInstance->getConfigData('payment_action'), $stateObject);
1423
  }
1424
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1425
  if (!$stateObject->getState()) {
1426
  $status = $methodInstance->getConfigData("order_status");
1427
 
1445
  $shopgateOrder->setIsPaid(true);
1446
 
1447
  $magentoOrder->addStatusHistoryComment(
1448
+ $this->_getHelper()->__(
1449
+ "[SHOPGATE] Set order as paid because shipping is not blocked and config is set to 'mark unblocked orders as paid'!"
1450
+ ),
1451
+ false
1452
  )->setIsCustomerNotified(false);
1453
 
1454
  $magentoOrder = $this->_setOrderPayment($magentoOrder, $shopgateOrder);
1455
 
1456
  $shopgateOrder->setIsPaid($oldStatus);
1457
  }
 
 
 
 
 
 
 
 
1458
  }
1459
 
1460
  $magentoOrder->save();
1471
  */
1472
  protected function _setOrderPayment($magentoOrder, $shopgateOrder)
1473
  {
1474
+ /** @var Shopgate_Framework_Model_Payment_Factory $factory */
1475
+ $factory = $this->_getFactory();
1476
+ if ($factory->validatePaymentClass()) {
1477
+ return $factory->manipulateOrderWithPaymentData($magentoOrder);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1478
  }
1479
 
1480
+ // Abstract will handle anything that doesn't have a manipulateOrder function
 
 
 
 
 
 
 
 
 
 
 
 
1481
  if ($shopgateOrder->getIsPaid() && $magentoOrder->getBaseTotalDue()) {
1482
  $magentoOrder->getPayment()->setShouldCloseParentTransaction(true);
1483
  $magentoOrder->getPayment()->registerCaptureNotification($shopgateOrder->getAmountComplete());
1492
  $transaction->setIsClosed(false);
1493
  $transaction->setTxnId($shopgateOrder->getPaymentTransactionNumber());
1494
  $transaction->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE);
 
1495
  $transaction->save();
1496
 
1497
  $magentoOrder->getPayment()->importTransactionInfo($transaction);
1500
  }
1501
  }
1502
  }
1503
+
 
 
 
 
 
 
 
 
 
 
 
1504
  $magentoOrder->getPayment()->setLastTransId($shopgateOrder->getPaymentTransactionNumber());
1505
 
1506
  return $magentoOrder;
app/code/community/Shopgate/Framework/changelog.txt CHANGED
@@ -1,892 +1,18 @@
1
- '''Deutsch'''
2
-
3
- '''Version 2.9.17'''
4
- * Fehler bei kostenlosen Produkten behoben
5
- * get_settings um payment_methods erweitert
6
-
7
- '''Version 2.9.16'''
8
- * Fehler beim Export des Steuersatzes behoben
9
- * Eigene Zahlungsabrechnung für Zahlungskosten
10
- * OAuth Anbindung ompimiert
11
- * Update auf Library Version 2.9.19
12
-
13
- '''Version 2.9.15'''
14
- * Bezahlmethode Paymentnetwork_Pnsofortueberweisung wird nun ab Version 1.1.8 unterstützt
15
- * Bezahlmethode Mage_BankPayment wird nun unterstützt
16
- * Verhindert die automatische Rechnungserstellung für Authorize.net Bestellungen und auth_only Konfiguration
17
- * Behebt Probleme bei der Übermittlung von Stornierung, Erstattungen werden nichtmehr als Storno an Shopgate übermittelt
18
- * Behebt Probleme mit fehlenden/falschen Produktgewichten bei der Berechnung von Versandkosten
19
- * Behebt Probleme mit falschen Bestellstatus bei Vorkasse Bestellungen und der Bezahlmethode Magento Banktransfer
20
- * Behebt Probleme mit falschen Preisen bei Eltern-/Kindprodukten
21
-
22
- '''Version 2.9.14'''
23
- * Behebt Probleme in der Preisberechnung von Kindprodukten
24
- * Behebt Probleme mit den Bundeloptionen
25
- * Behebt Probleme mit dem Magento Compiler
26
- * Behebt Probleme mit dem Status von Billsafebestellungen
27
-
28
- '''Version 2.9.13'''
29
- * Behebt Probleme mit falschen Status bei SofortÜberweisungs Bestellungen
30
- * Behebt Problem mit falschen Steuerklassen während des Produkt Exports bei Kindprodukten
31
- * Verbessert den Export von Individualisierungsoptionen
32
- * Verbessert das Bestellstatus-Mapping während des addOrders, die Option "Nicht blockierte Bestellunge als bezahlt markieren" greift jetzt auch bei Vorkasse
33
- * Upsell Produkte von Elternprodukten werden nun an die Kinder vererbt
34
- * Behebt Probleme bei abweichenden Variantenpreisen
35
- * Neue Konfigurationsmöglichkeit zum Export von niedrig aufgelösten Produktbildern
36
- * Behebt Problem mit fehlenden Bestellstatus bei PayPal Bestellungen
37
-
38
- '''Version 2.9.12'''
39
- * Individualisierungsoptionen werden nun beim Export von Bundle Produkten berücksichtigt
40
- * Behebt Probleme beim Synchronisieren von Billsafe Bestellungen
41
- * Behebt Probleme bei fehlenden Versandmethoden
42
- * Behebt Probleme mit falsch gesetzten Status bei Nachname Bestellungen
43
- * Behebt Probleme mit falschen Preisen bei Bundle Produkten
44
- * Lagerbestände werden nun auch bei Nachbestellungen mit exportiert
45
- * Behebt Probleme beim Export von Produktrelationen
46
-
47
- '''Version 2.9.11'''
48
- * Behebt Problem beim Bestellungen die blockiert und nicht bezahlt sind
49
- * Behebt Fehler mit Versandkosten und Paypal Express
50
- * Behebt Probleme mit dem Anlegen dem Standard Rechnungs- und Lieferadressen
51
- * Behebt Probleme mit der Anzeige der Artikelverfügbarkeit
52
- * Behebt Probleme mit der Produktsortierung
53
- * Behebt Probleme mit den Zusatzkosten für Optionen
54
- * Optimiert Übergabe der Trennzeichen beim Gewicht
55
- * Behebt Probleme mit der Übergabe des Lagerbestandes
56
-
57
- '''Version 2.9.10'''
58
- * Behebt Problem beim importieren von Bestellungen
59
- * Behebt Fehler bei deaktivierten Magento Benachrichtigungsmodul
60
-
61
- '''Version 2.9.9'''
62
- * zusätzliches Feld für UPC Export in der Konfiguration eingefügt
63
- * Caching Problem für die Headerdateien behoben
64
- * Verbindungsaufbau abgesichert durch zusätzliche Checks
65
- * verbesserter Preisexport für Bundle Produktoptionen ohne Pflichtfelder
66
- * natives Paypal Mapping wenn Website Payments Pro aktiv ist auf Express
67
- * Bildexport für XML Kindprodukte angepasst unter Berücksichtigung der Konfigurationsoptionen
68
-
69
- '''Version 2.9.8'''
70
- * Java Script Dateien für Oauth angepasst
71
- * verbesserte Unterstützung für native Zahlungsmethoden bis 1.4.0.1
72
- * Msp_CashOnDelivery Unterstützung hinzugefügt
73
- * Firegento Unterstützung hinzugefügt (MageSetup and GermanSetup)
74
- * Amasty_Rules Unterstützung hinzugefügt
75
-
76
- '''Version 2.9.7'''
77
- * Verbesserte Bundle Optionen
78
- * Lieferzeit Attribut angepasst für ältere Versionen
79
- * UPC Bug behoben
80
- * verbesserte Unterstützung für native Zahlungsmethoden bis 1.4.0.1
81
- * Fehler in der Lagerverwaltung behoben
82
- * Phoenix_Banktransfer als native Zahlungsmethode
83
- * Doppelte Bestellung als Fehler trotz fehlender Bestellung minimiert
84
- * Kindproduktdaten Export verbessert
85
- * Performance bei mobiler Weiterleitung deutlich verbessert
86
- * Gruppenpreise von 1.4.x bis 1.6.x unterstützt
87
- * Benachrichtigungssystem von Magento genutzt um auf Plugin Updates hinzuweisen
88
-
89
- '''Version 2.9.6'''
90
- * Steuerberechnung für Coupons behoben
91
- * hinzufügen von Eltern-Kind Kombination zur Bestellung gefixed
92
- * Preisberechnung von Zusatzkosten auf Optionen angepasst
93
- * Billsafe als native Zahlungsmethode implementiert
94
- * Sofortüberweisung als native Zahlungsmehtode implementiert
95
- * Standard Überschrift für Bundleoptionen
96
- * Bestellstatus fix für Paypal Website Payments Pro
97
- * Bestellstatus Standard Mapping für > 1.6
98
- * Unterstützung für Virtuelle Produkte
99
-
100
- '''Version 2.9.5'''
101
- * Fehler bei rabattierten Artikelpreisen in der Bestellung behoben
102
- * Bestandsproblem bei Elternprodukten in check_cart behoben(CSV)
103
- * verbesserter Bündelartikel Export, Bestandsberechnung und Preisberechnung
104
- * verhindert den Export deaktivierter Gruppenproduktkinder
105
- * register_customer Fehlerausgabe behoben
106
- * verbesserte mobile Weiterleitung bei speziellen Produktsetup
107
- * Fehler beim Caching der Attribute im Produktexport behoben
108
- * verbesserter Export der Staffelpreise
109
- * Verbesserung der nativen ePay und Amazon Integration
110
- * Unterstützung für virtuelle Produkte hinzugefügt
111
- * verbesserte Statuszuordnung bei Bestellgenerierung
112
-
113
- '''Version 2.9.4'''
114
- * Bestandsproblem bei Elternprodukten in check_cart behoben(XML)
115
- * Update der Library auf Version 2.9.3
116
- * Fehler in Attributsetcaching bei Produktexport behoben
117
- * Basispreis von Erweiterung "DerModPro Base Price" in XML und CSV Export hinzugefügt
118
- * die Konfiguration exportiere Name des Elternproduktes wird nun auch im XML Export beachtet
119
- * native Authorize.net Implementierung
120
- * native epay Implementierung
121
- * Verbesserung der Paypal Website Payments Pro Integration
122
- * Kompatibilität für Magento Versionen < 1.5 verbessert
123
-
124
- '''Version 2.9.3'''
125
- * Caching beim Export an Magento Cache angebunden
126
- * Unterstützung von OrganicInternet SimpleConfigurableProducts
127
- * Installationsschwierigkeiten < 1.4.1.x behoben
128
- * verbesserte Lagerverwaltung
129
- * verbesserte Kompatibilität zu Katalogpreisregeln beim Bestellimport
130
- * Paypal Website Payments Pro als native Zahlungsmethode integriert
131
- * verbesserte Steuerhandhabe für Versandkosten bei steuerfreien Ländern
132
- * Mobile Weiterleitung überarbeitet und natives Magento Caching eingebaut
133
-
134
- '''Version 2.9.2'''
135
- * Problem mit fehlgeschlagenem add_order und Shopgate Coupons behoben
136
- * Erweiterte Bezahlinformation bei PayPal Bestellungen
137
- * Fehler beim Produktbilder Export in XML behoben
138
- * Überflüssigen Observer entfernt
139
- * Verbesserung der Kompatibilität zu Magento <= 1.4.1.0
140
- * Unterstützung von PayPal Website Payments Pro für Magento 1.4.x.x und 1.5.x.x
141
- * Fehler mit falschen Preisen bei add_order und Bestellungen mit Katalog Preisregelen behoben
142
-
143
- '''Version 2.9.1'''
144
- * XML export beachtet nun die Konfiguration für den priorisierten Thumbnail Bild export
145
- * verbesserter XML Export von Produktbeschreibungen
146
- * Kompatibilität mit USPS Fremdmodul hinzugefügt
147
- * exportiert Kategorien welche nicht sichtbar im Menü sind als inaktiv
148
- * Speicherproblem mit Varien_Image_Adapter_Gd2 behoben
149
- * Fehler für fehlende Versandmethoden bei Bundle Produkten behoben
150
- * Fehler bei check_cart für Artikel die nicht auf Lager aber Nachbestellbar sind
151
- * Staffelpreise für die Option alle Kundengruppen werden nun für jede Gruppe einzeln in XML exportiert
152
- * Neue Konfiguration für das erste Produktbild
153
- * Produkte mit Individualisierungsoptionen vom Typ File werden nun vom XML Export ausgeschlossen
154
- * Neue Konfiguration ob der Preis Indexer während des Exportes genutzt werden soll oder nicht
155
-
156
- '''Version 2.9.0'''
157
- * Fehler in der Ping Action bei Magento Versionen < 1.6 behoben
158
- * verbesserte Leistung beim Produktexport
159
- * verbesserte Echtzeit-Lagererkennung
160
- * Fehler für falsche Preise von Gruppenprodukten im XML Export behoben
161
- * Fehler für falsche Preise von Kindprodukten wenn zusätzlich ein Preisoffset im Elternprodukt definiert ist
162
- * Couponwert beachtet nun auch Optionspreise
163
- * verbesserter Warenbestandsexport für XML
164
- * Update der Library auf Version 2.9.1
165
- * Produktrezensionen als XML
166
-
167
- '''Version 2.8.4'''
168
- * Update der Library auf Version 2.8.10
169
-
170
- '''Version 2.8.3'''
171
- * Erweiterung der Sortieroptionen von Produkten in Kategorien
172
- * verbesserter export des Verfügbarkeitstextes für Bundle Produkte
173
- * Versandkosten bei Shopgate werden nun erst erstattet, wenn der volle Versandkostenbetrag in Magento erstattet wird
174
- * Einbinden einer neuen Konfigurations Option um den Export von Produktattributen als Eigenschaft selektiv zu erzwingen
175
- * XML Support für Bundleoptionen
176
-
177
- '''Version 2.8.2'''
178
- * Verbesserter Support für 1.4.x bis 1.5.x
179
-
180
- '''Version 2.8.1'''
181
- * Anpassung vom Codestil
182
- * Integration von Amazon Payments nativ
183
- * Update der Library auf Version 2.8.6
184
- * Code cleanup
185
- * Zusätzliche Option um eigene Felder als Kommentar in die Bestellhistorie zu schreiben
186
-
187
- '''Version 2.8.0'''
188
- * Update der Library auf Version 2.8.5
189
- * Angepasster Gruppenproduktexport
190
- * Synchronisation von Bestellungen (Umsetzung von get_orders)
191
- * Säuberung von legacy code
192
- * Bundle Produkt Export Verbesserung
193
- * verbessertes Logging von Fehlern
194
- * sicherstellen das Produkte storeview abhängig geladen werden
195
-
196
- '''Version 2.7.5'''
197
- * Falls vorhanden werden nun Coupon Labels anstelle der Coupon Titel übertragen
198
- * Update der Library auf Version 2.7.4
199
-
200
- '''Version 2.7.4'''
201
- * Bugfix zurücksetzen der Standard Versandmethode shopgate_fix falls keine Plugin API Versandmethoden benutzt werden
202
-
203
- '''Version 2.7.3'''
204
- * Neue Konfiguration für den exklusiven Export der Kategorien welche in der Hauptnavigation angezeigt werden
205
- * Bugfix für Gruppenprodukte ohne Kinder
206
- * Bugfix für Fedex API Versandkosten Fehler
207
-
208
- '''Version 2.7.2'''
209
- * Bugfix für Oauth
210
-
211
- '''Version 2.7.1'''
212
- * Bugfix für den Aufruf einer nicht mehr verwendeten Klassen Konstante
213
-
214
- '''Version 2.7.0'''
215
- * Implementieren eines Verbindungs-Managers
216
- * Umstellung der Authentifizierung über OAuth
217
- * Aktualiseren der Shopgate Library auf die Version 2.7.2
218
- * Optimierte Verarbeitung der Versandmethoden bei checkCart
219
- * Bugfix für den Export des Standard Verfügbarkeits Texts
220
- * Setzen der Anrede beim Verarbeiten von Bestellungen
221
- * Bugfix Anzeigename Versandmethode in Transaktions Mails
222
- * exportiert Kategorie Thumbnail vor Kategoriebild
223
- * verbesserter Export der Produkte für die Nachbestellungen aktiviert sind
224
- * verbesserter Produkt Export von Eltern<->Kind Beziehungen in Verbindung mit der Sichtbarkeit der Kindprodukte
225
-
226
- '''Version 2.6.16'''
227
- * Bugfix für fehlerhafte Besteuerung der Versandkosten
228
- * Verarbeitung der Rabatt Besteuerungs Konfiguration
229
- * Bugfix für das Extrahieren der StoreViewId nach ShopNumber
230
- * erlaube Gruppenprodukte in mehreren Kategorien
231
- * Bugfix Anzeigename der Versandmethode
232
- * Implementieren von Erweiterten Ausgaben für get_settings
233
-
234
- '''Version 2.6.15'''
235
- * Update der Library auf die Version 2.6.10
236
- * Möglichkeit für die Auswahl des zu exportierenden Produkttitels geschaffen
237
- * Bugfix für Preisrundungen bei Bundle Optionen
238
- * Export von nicht verfügbaren Bundle Optionen
239
- * Bugfix für fehlende Attribute bei Kindprodukten im XML Export
240
- * Bugfix für fehlerhafte Katalog Preisregeln bei konfigurierbaren Produkten
241
- * Bugfix ignoriere Kindprodukt Steuerklassen, falls auch die Preise der Kindprodukte ignoriert werden(Einstellung)
242
-
243
- '''Version 2.6.14'''
244
- * Erweiterung der redirect Unterdrückung für Modul Routen
245
- * Neue Option um Thumbnail Produktbilder an erster Stelle zu exportieren
246
- * Kunden/Gast Bestellzuordnung optimiert
247
- * Bugfix für teilweise doppelte Besteuerung von Versandkosten
248
-
249
- '''Version 2.6.13'''
250
- * Update der library auf Version 2.6.8
251
- * Erweitern von set_settings für die Behandlung von Array's als Konfigurations Elemente
252
- * Bufix für das entfernen von Shopgate-Coupon Produkten in Verbindung mit Flat Tables
253
- * Einbetten eines Selektor um die Steuerregeln für Netto Märkte zu aktivieren
254
- * Bugfix für die Behandlung von Variationsaufschlägen bei konfigurierbaren Produkten
255
-
256
- '''Version 2.6.12'''
257
- * Bugfix für die Verarbeitung der Lagerhaltung nach einem addOrder Request
258
-
259
- '''Version 2.6.11'''
260
- * Unterbindung von mobilen redirects kann jetzt konkret vom modul gesteuert werden
261
- * Aktualisieren der library auf Version 2.6.7
262
- * Bugfix für Übermittlung von Lieferungen über Plugin Funktion _cronSetShippingCompleted
263
- * Bugfix für die Berechnung der Produktpreise von Bundle Optionen
264
-
265
- '''Version 2.6.10'''
266
- * Auflösen von availableText Angaben durch Attribute die Optionsfelder haben
267
- * Bugfix für fehlende Produkte während des CSV Exportes
268
- * Bugfix für doppelte Stornoanzahl bei konfigurierbaren Produkten
269
- * Bugfix für den mobilen redirect durch Http Header
270
-
271
- '''Version 2.6.9'''
272
- * ermöglicht kundenbezogene Warenkorbpreisregeln
273
- * Kompatibilität alter PHP Versionen verbessert
274
-
275
- '''Version 2.6.8'''
276
- * Fehler bei Versandkosten und Lieferadressen ohne Steuer behoben
277
- * Versandmethoden aus der Plugin API werden nun mit korrektem Namen in der Bestellung angezeigt
278
-
279
- '''Version 2.6.7'''
280
- * Bugfix Kompatibilität zu Phoenix_CashOnDelivery (fehlende Auflistung der Gebühr)
281
- * Bugfix XML Produktexport (SalesPrice und UID Kindprodukt)
282
-
283
- '''Version 2.6.6'''
284
- * Nutzung von store basierten Attributetiteln
285
- * Bilder die "Nicht in der Gallerie" markiert sind und exportiert werden schließen Vorschaubilder aus
286
- * Redundanzbefreiung für CSV und XML Export
287
- * Bugfix für falschen Preis bei Produkten mit Katalogpreisregeln und Sonderpreisen
288
-
289
- '''Version 2.6.5'''
290
- * Genauere Versandmethoden in Detailansichten und Emails
291
-
292
- '''Version 2.6.4'''
293
- * Kategorie XML Export hinzugefügt
294
- * Kategorie CSV Export angepasst
295
-
296
- '''Version 2.6.3'''
297
- * Bugfix für das Auflösen von Shopgate Coupons bei aktiviertem MSRP
298
- * Gruppenproduktbilder vom Export entfernt wenn das Produkt deaktiviert wurde
299
- * Shopgate Library auf Version 2.6.6 aktualisiert
300
- * Bugfix Übermittlung von Stornierungen zu Shopgate
301
- * CMS Seite werden standardmäßig von der mobilen Weiterleitung ausgeschlossen
302
-
303
- '''Version 2.6.2'''
304
- * Produkt XML Export hinzugefügt
305
- * Produkt CSV Export angepasst
306
- * Shopgate Library auf Version 2.6.3 aktualisiert
307
-
308
- '''Version 2.6.1'''
309
- * Shopgate Library auf Version 2.6.2 aktualisiert
310
- * Kindprodukte welche nur in der Suche sichtbar sind werden nun mit exportiert
311
-
312
- '''Version 2.6.0'''
313
- * Fehler bei Bestellungen und Lieferadressen ohne Steuer behoben
314
- * Shopgate Library auf Version 2.6.1 aktualisiert
315
- * ermöglicht einen splitted Kategory Export
316
- * Verbessertes Label für die Verfügbarkeit von Nachbestellungen
317
- * Bugfix für das Auflösen von mobilen redirects für storeview Aufrufe ohne gültige Shopgate Konfiguration
318
-
319
- '''Version 2.5.14'''
320
- * Möglichkeit Bilder zu exportieren die "Nicht in der Gallerie" markiert sind
321
- * Alte Dateistruktueren wurden entfernt
322
- * Möglichkeit Produkte beim Export pro Kategorie nach neuestem Datum zu sortieren
323
- * Gutscheincode pro Adresse um Validierung zu sichern
324
-
325
- '''Version 2.5.13'''
326
- * Erweiterung von get_settings um CustomerGroups
327
- * Erweiterung von check_cart um CustomerGroups
328
- * Erweiterung von get_customer um CustomerGroups
329
- * Setzen des Vary Header für Seiten die weitergeleitet werden können
330
- * Entfernen eines nicht mehr notwendigen Klassen Rewrites
331
-
332
- '''Version 2.5.12'''
333
- * Support von Versandmethoden auf Plugin Basis und dadruch vereinfachte Integration
334
- * Korrekter Export des Herstellerpreises
335
-
336
- '''Version 2.5.11'''
337
- * Fix für die Anzeige der Zahlungsdetails in der Bestellübersicht
338
- * Optimierung und Redundanzoptimierung für Preiskalkulation
339
-
340
- '''Version 2.5.10'''
341
- * Bugfix für den Export der Reviews als Model um das VoteRating zu unterstützen
342
-
343
- '''Version 2.5.9'''
344
- * Bugfix für das fälschlicherweise Übertragen von Optionen auf Folgeprodukte beim Export
345
- * Bugfix für den Export von Eltern-Kind Beziehungen bei Produkten
346
- * Standardmäßige Aktivierung der mobilen Weiterleitung nur für begrenzte Controller
347
-
348
- '''Version 2.5.8'''
349
- * Performance Optimierung für Kategorie und Review Export
350
- * Bugfix für den Export von Steuerklassen und Eltern Kind Beziehungen im US Modul
351
-
352
- '''Version 2.5.7'''
353
- * Erweiterte Shop Informationen beim ping an das Modul
354
- * Update Shopgate Library auf Version 2.5.4
355
- * Bugfix für den StoreView bezogenen Export von Reviews
356
- * Bugfix für den Export von Ratings bei Reviews
357
-
358
- '''Version 2.5.6'''
359
- * Bugfix für das Anlegen von ShopgateCoupons beim Bestellungsimport
360
- * Bugfix für die Übermittlung von Stornierungen an Shopgate
361
- * Bugfix für die Übermittlung von Versandstatus an Shopgate
362
- * verbesserte Preisberechnung für Versandkosten in check_cart
363
-
364
- '''Version 2.5.5'''
365
- * Aufheben eines Performance leaks beim CSV Export
366
- * Bugfix für einen semantischen Fehler
367
-
368
- '''Version 2.5.4'''
369
- * Update Shopgate Library auf Version 2.5.1
370
- * Erweiterung der beschreibbaren Eigenschaften über set_settings (e.g. enable_check_stock)
371
- * Einfügen von license header Texten für php Dokumente
372
- * Beim Exportieren von Gruppenartikel wird geprüft ob die Elternkategorie sichtbar ist
373
-
374
- '''Version 2.5.3'''
375
- * Bugfix: Doppelte Steuer bei Gebühren für Bezahlmethoden
376
- * Attribute welche als filterbar aber nicht sichtbar im Shop konfiguriert sind, können nun exportiert werden(neue Einstellung) und stehen Mobil zum Filtern zur Verfügung
377
-
378
- '''Version 2.5.2'''
379
- * Verfügbarkeits-Text kann jetzt auf beliebige Produktattribute gemappt werden
380
-
381
- '''Version 2.5.1'''
382
- * Attribute der Elternprodukte werden nun bei den Kindprodukten mit ausgegeben
383
-
384
- '''Version 2.5.0'''
385
- * Update Shopgate Library auf Version 2.5.0
386
- * Warenbestandsabfrage in Echtzeit
387
- * Gewichtsbasierte Versandmethoden werden nun korrekt berechnet
388
- * Validierung der Textlänge bei Individualisierungsoptionen
389
-
390
- '''Version 2.4.33'''
391
- * Weitere Schritte für vereinfachte Installation
392
-
393
- '''Version 2.4.32'''
394
- * Bugfix für die ganzheitliche Lagerverwaltung bei checkCart und Integration von qtyIncrements
395
- * Bugfix für vertauschte Preise bei der checkCart Response
396
- * Bugfix Kompatibilität zu Phoenix_CashOnDelivery
397
- * Lokalisierung für de_CH und de_AT hinzugefügt
398
- * Bugfix für nicht korrekt implementierte ShopgateConfig Eigenschaften
399
-
400
- '''Version 2.4.31'''
401
- * Feature Implementierung für erleichterte Installation
402
-
403
- '''Version 2.4.30'''
404
- * Bugfix für die korrekte Umsetzung der Weiterleitungs-Konfigurations-Einstellung
405
- * Feature für das Abschalten des mobilen redirects für spezifische Controller, Kategorien oder Produkte
406
- * Bugfix Export EAN Code
407
- * Bugfix für das Verarbeiten des korrekten Stockitems bei CheckCart in Verbindung mit Configurables
408
- * Feature implementiert um eine automatische Anbindung an Shopgate bei Module Installation zu ermöglichen
409
-
410
- '''Version 2.4.29'''
411
- * Schreiben von payment informationen in das Payment-Model zur weiteren Verarbeitung von Magento
412
- * Bugfix mobile Validierung des Lagerbestands bei Configurable Produkten
413
-
414
- '''Version 2.4.28'''
415
- * Bugfix mobile Validierung des Lagerbestands bei Bundle Produkten
416
-
417
- '''Version 2.4.27'''
418
- * Bugfix Mapping für USPS Versand ab Version 1.8.0.0
419
- * Bugfix für den Export von AvailableText für ein Produkt
420
- * Coupon Fehlerhandling verbessert
421
- * Exportiert nun auch Anker Kategorie Ids vom Produkt
422
- * Update Shopgate Library auf Version 2.4.14
423
- * Bugfix für addOrder von Bundle Produkten die in falschen Preisen resultieren
424
- * Bugfix für das Ermitteln der maximalen wenn gar keine Optionen im Shop vorhanden sind
425
-
426
- '''Version 2.4.26'''
427
- * Titel für Versand- und Zahlmethoden von Shopgate sind jetzt konfigurierbar
428
-
429
- '''Version 2.4.25'''
430
- * Korrigierter Export von Lagerbeständen bei Bundles
431
- * Bugfix für das Exportieren der Verfügbarkeitsnachricht
432
- * Einbeziehen von Nachbestellungen beim Exportieren von Lagerbeständen für Bundles
433
- * Bugfix für das Prüfen der Verfügbarkeit
434
- * Wiederaufnehmen der Bundles als festen Produkttyp für den Export
435
- * Bugfix für das Ausschliessen von Optionen die nicht verfügbar sind beim Export
436
-
437
- '''Version 2.4.24'''
438
- * Verbessertes Fehlerhandling falls Produkte nicht verfügbar sind
439
-
440
- '''Version 2.4.23'''
441
- * Bugfix für den Export von Bundle-Produkten mit dynamischem Preis
442
- * Verbesserungen und Fehler Handling in der check_cart Methode
443
- * Automatisiertes Ermitteln der maximalen Optionanzahl für den Export
444
- * Systemkonfiguration für 'default_item_row_option_count' entfernt
445
-
446
- '''Version 2.4.22'''
447
- * Bugfix doppelte Nachname Gebühr im Zusammenspiel mit Phönix CashOnDelivery
448
- * Feature custom_fields für Bestellungen und Versand-/Rechnungsadressen werden nun übermittelt und gespeichert
449
- * Update Shopgate Library auf Version 2.4.13
450
-
451
- '''Version 2.4.21'''
452
- * Update Shopgate Library auf Version 2.4.12
453
-
454
- '''Version 2.4.20'''
455
- * Update Shopgate Library auf Version 2.4.10
456
-
457
- '''Version 2.4.19'''
458
- * Berücksichtigung der Steuereinstellungen beim Export von Individualisierungsoptionen
459
- * Export von Gruppen Produkten verbessert
460
- * Kompatibilität zu anderen Modulen durch Entfernung nicht notwendiger Model rewrites verbessert
461
- * Erstattete Produkte werden nun an Shopgate übertragen
462
-
463
- '''Version 2.4.18'''
464
- * Update Shopgate Library auf Version 2.4.9
465
- * Die Methode check_cart gibt nun neben den Coupons auch Warenkorbprodukte mit Lagerinformationen sowie Versand- und Zahlmethoden zurück, welche für gegebene Adresse verfügbar sind
466
-
467
- '''Version 2.4.17'''
468
- * Unterstützung von Backorders
469
- * Unterstützung von Phönix CashOnDelivery
470
- * Unterstützung von Individuellen Optionen bei konfigurierbaren Produkten
471
-
472
- '''Version 2.4.16'''
473
- * Bugfix ungültiger Klassenkonstantenaufruf für ältere PHP Versionen
474
-
475
- '''Version 2.4.15'''
476
- * Bugfix Steuerberechnung für Magento 1.4.x.x
477
-
478
- '''Version 2.4.14'''
479
- * verbessertes Fehlerhandhabung der getCustomer Methode und Library Update auf 2.4.8
480
-
481
- '''Version 2.4.13'''
482
- * Kunden welche sich Mobil registrieren werden nun zum Shop übertragen.
483
-
484
- '''Version 2.4.12'''
485
- * Bugfix Übersetzungen im Backend fehlerhaft
486
-
487
- '''Version 2.4.11'''
488
- * Produktsortierung innerhalb einer Kategorie für den Produktexport nun über das Magento Backend konfigurierbar
489
-
490
- '''Version 2.4.10'''
491
- * EVP/UVP Preise werden nun mit exportiert
492
-
493
- '''Version 2.4.9'''
494
- * Beim Produktexport werden nun die Upsell und Crossell Produkte berücksichtigt und mit exportiert
495
- * Unterstüzung von konfigurierbaren Produkten auf >=1.4.0.1 erweitert
496
-
497
- '''Version 2.4.8'''
498
- * Update Shopgate Library auf Version 2.4.3
499
-
500
- '''Version 2.4.7'''
501
- * Bugfix setQuoteItems im FrameworkController erweitert um konfigurierbare Produkte mit gewählter Option in Quote und Order korrekt abzubilden
502
-
503
- '''Version 2.4.6'''
504
- * Bugfix falsches Ansprechen einer Klassenkonstante im FrameworkController
505
- * Library update zur Speicherreduzierung und Performancesteigerung
506
- * Bugfix für erneutes Erfassen von Rechnungsanteilen und daraus resultierendem Betrugsverdacht
507
- * Bugfix für den Test ob ein Payment Update erfasst werden darf
508
-
509
- '''Version 2.4.5'''
510
- * Erweitern des Loggings für das Ermitteln der Versandmethode aus der ShopgateOrder
511
- * Bugfix für den mobilen Redirect von sichtbaren Kindprodukten von Konfigurierbaren auf das Elternprodukt
512
- * Bugfix für fehlerhaft aufgerufene Helper Methoden getParentIdsConfigurable and getParentIdsGrouped
513
- * Bugfix falsches Typhinting für USPS Mapper
514
-
515
- '''Version 2.4.4'''
516
- * Fehler beim Export des Aufpreises für Individualisierungsoptionen behoben
517
-
518
- '''Version 2.4.3'''
519
- * Anpassen der Modul Abhängigkeiten für die kürzlich implementierte Erweiterung des Shippings
520
- * Erweitern des Loggings für setSettings
521
- * Bugfix leeren des Konfigurations Cache nach dem Speichern durch setSettings
522
-
523
- '''Version 2.4.2'''
524
- * Rückgabewert von getAvailableMethods für Shopgate angepasst
525
- * Produkte mit Individualisierungsoptionen vom Typ File werden nun vom Export ausgeschlossen
526
-
527
- '''Version 2.4.1'''
528
- * Anpassen der Log-Statements für mehr Übersicht
529
- * Erweitern der load() und save() Methoden für die scope sensitive Speicherung in der Datenbank
530
- * Bugfix für das speichern von Leerwerten auf stores scope Ebene
531
- * Optimierung für das Cleanup der scope sensitiven Speicherung
532
- * Einbinden von versteckten settings variablen in die Verarbeitung von setSettings
533
- * Kalkulation von Coupons verbessert
534
-
535
- '''Version 2.4.0'''
536
- * Debug Funktionalität
537
- * Bugfix für Shopgate Coupons im US Plugin
538
- * Bugfix für die nativen USPS Versandmethoden (präziserer Abgleich der Methoden)
539
- * Bugfix für die nativen USPS Versandmethoden ('Default' Carrier Mapping hinzugefügt)
540
- * Export nicht aktive Kategorien
541
- * Implementierung der load() und save() Methoden für ShopgatePluginApi->setSettings()
542
- * Bugfix für nicht in der Klasse registrierte Klassenvariablen mit Getter und Setter
543
- * Implementierung von Log Einträgen zum Debuggen in die Verarbeitungskette angestossen von helper('shopgate/data')->setShippingMethod()
544
- * Entfernen der Möglichkeit das Modul über setSettings zu deaktivieren
545
-
546
- '''Version 2.3.17'''
547
- * Bugfix für die Verarbeitung von USPS Shipping methoden in denen ein Array Index falsch angesprochen wurde
548
-
549
- '''Version 2.3.16'''
550
- * Filter für Eigneschaften beim Export
551
- * Beim OrderImport von nicht USPS Shipping Methoden kam es zu Fehlern weil Array falsch definiert war
552
-
553
- '''Version 2.3.15'''
554
- * Benutzerdefinierte Beschreibung Attributcode
555
- * Die Überprüfung der Coupon Codes in Magento 1.4.x.x hat teilweise zu Problem geführt
556
- * Beim OrderImport werden für USPS jetzt die nativen Shipping Models verwendet anstatt einem generischen (shopgate_fix)
557
-
558
- '''Version 2.3.14'''
559
- * Konfiguration für Gewicht Einheit (kg,g,lb,oz) und automatische Vorkonfiguration
560
- * Neue Version der Library. Unterstützung von bis zu 100 Optionen beim Artikelexport
561
- * EAN Export, 'attribute code' für EAN kann auf Konfigurationseite definiert werden
562
-
563
- '''Version 2.3.13'''
564
- * Stornierung Bug Fix (Virtual Produkt)
565
-
566
- '''Version 2.3.12'''
567
- * Option (Ja/Nein) für Export sichtbare Unterproducts in Konfiguration
568
- * Zuordnung Original-Ids zu Shopgate Ids funktioniert auch für konfigurable Produkte
569
- * Varien_Autoloader Schwierigkeit mit Magento 1.4 (COD) überarbeitet
570
-
571
- '''Version 2.3.11'''
572
- * Die Zahlart wird nur noch als virtueller Artikel in die Bestellung eingetragen wenn die Kosten negativ sind
573
- * Bundles aus der Liste der exportierbaren Produkttypen entfernt. Export von Bundles bis auf weiteres "experimentell"
574
- * Im US Plugin wird als Ausgangsgröße zur Gewichtsberechnung die Einheit Pfund (lbs) genommen
575
- * Gewichtsangabe wird nicht mehr grundet
576
-
577
- '''Version 2.3.10'''
578
- * Schwierigkeit mit Version 2.3.9. Erweiterung kann nichtg über Magento Connect geladen werden
579
-
580
- '''Version 2.3.9'''
581
- * Stornierung von VirtualProdukten wird ignoriert.
582
- * Beim Aufruf von get_settings wird als Standard die Steuerklasse für die Kundengruppe "NOT_LOGGED_IN" übergeben
583
-
584
- '''Version 2.3.8'''
585
- * Fehler beim Export des Aufpreises für Eingabefelder behoben
586
- * Fehler beim Export des Gewichts für Produkte mit Verpackungseinheiten
587
- * Magento EE unter 1.9.1.0 wird jetzt aufgrund der gleichen Codebasis wie Magento CE unter 1.5.0.0 behandelt
588
-
589
- '''Version 2.3.7'''
590
- * Bugfix für die Auswahl der Bezahlarten bei Modulen von Drittanbietern
591
-
592
- '''Version 2.3.6'''
593
- * Bugfix für Magento 1.4. Schnittstellen können nicht angelegt werden und Bestellungen mit Zahlart COD können nicht importiert werden
594
-
595
- '''Version 2.3.5'''
596
- * Geschenkverpackung für Magento Enterprise ab Version 1.10
597
-
598
- '''Version 2.3.4'''
599
- * Verbesserter Umgang bei Aufpreisen für Artikeloptionen, die im Elternprodukt hinterlegt sind
600
-
601
- '''Version 2.3.3'''
602
- * Fehler beim Einlösen von Gutscheinen behoben
603
- * Die Zahlart wird jetzt als virtueller Artikel in die Bestellung eingetragen
604
-
605
- '''Version 2.3.2'''
606
- * Shopgate Gutscheine gelten nicht mehr als Produkte, die verschickt werden müssen. Sie haben dadurch keinen Einfluss mehr auf den "completed" Status einer Bestellung
607
- * Bugfix für Magento 1.4 (Schwierigkeit mit Autoloader, wenn ein Model nicht existiert)
608
- * Bugfix für US, wenn der Country Code in der Adresse fehlt
609
- * Liste der Region-Codes erweitert
610
-
611
- '''Version 2.3.1'''
612
- * Wenn für ein Produkt ein Sonderpreis und eine Katalogregel definiert ist, wird der jeweils niedrigere Preis exportiert
613
- * Verbesserung beim Export der Steuerklasse, wenn keine Regel definiert ist
614
- * Bugfix für Magento 1.4, Mobile Weiterleitung
615
-
616
- '''Version 2.3.0'''
617
- * Update der ShopgateLibrary auf Version 2.3.2
618
- * Art der Weiterleitung einstellbar. Entweder immer oder nur auf Produktdetailseite, Kategorielisting und Startseite
619
- * Anzeigen der bei Shopgate ausgewählten Versandart
620
- * Der Text für die verfügbarkeit eines Artikels kann jetzt optional aus einem Attribute ausgelesen weren
621
- * Der Gutscheinbetrag eines Shopgate Artikels wird im Feld "Originalpreis" eingetragen
622
-
623
- '''Version 2.2.7'''
624
- * Fehler im ShopgateConnect behoben
625
- * Der Lagerbestand kann jetzt auch negativ werden je nachdem wie das Produkt/System eingestellt ist
626
-
627
- '''Version 2.2.6'''
628
- * Englische Bezeichnung von "child products" zu "subproducts" geändert
629
- * Bestellstatus wird jetzt immer gesetzt
630
- * Der Produkt-Export exportiert jetzt nur noch die Produkte aus dem ausgewählten Store
631
- * Warenkorb Preisregeln werden beim Hinzufügen von Bestellungen nicht mehr berücksichtigt
632
- * Die Magento internen Zahlungsarten werden jetzt unterstützt
633
-
634
- '''Version 2.2.5'''
635
- * Update der ShopgateLibrary auf Version 2.2.1
636
- * USA- und EU-Plugin wurden zu einem Modul zusammengefügt
637
- * API zugangsdaten können in der config jetzt auch leer sein
638
- * Wenn keine API-Daten eingegeben wurden, werden keine API aufrufe an Shopgate versucht
639
- * Beim versuch den Lagerbestand zu aktualisieren wurde ein Fehler behoben, wenn der Artikel keinen Lagerbestandseintrag hat
640
- * Der Lagerbstand wird nicht aktualisiert, wenn der Bestand kleiner als 0 sein wird
641
- * Die Zahlungsart "CheckMo" wird jetzt bei Vorkasse benutzt
642
-
643
- '''Version 2.2.4'''
644
- * überarbeiteter Export von konfigurierbaren Produkten für bessere Performance
645
- * Fehler bei der Berechnung von Gutscheinen behoben
646
- * Fehler beim Export von Store Labels behoben
647
-
648
- '''Version 2.2.3'''
649
- * Fehler behoben, bei dem das Bearbeiten von Nicht-Shopgate-Bestellungen u.U. nicht mehr bearbeitet werden konnten
650
-
651
- '''Version 2.2.2'''
652
- * Bestellbestätigungsmail kann jetzt aus dem Magento Shop aktiviert werden
653
- * Der Bestellstatus von PayPal-Bestellungen wird jetzt auf "processing" gesetzt
654
- * Optional kann der Versand jetzt auch an Shopgate übermittelt werden, wenn der Status "completed" ist, auch wenn kein Versandauftrag vorhanden ist
655
- * Fehler im Gutscheinsystem wurden behoben
656
- * Ein Bug in der Berechnung der Nachnahmegebühren wurde behoben. Diese werden jetzt nicht mehr Doppelt aufgelistet
657
- * Beim Zugriff auf eine Shopnummer über mehrere Domains wurde ein Fehler behoben
658
- * Fehler beim Hinzufügen von Bestellungen mit Checkbox-Optionen wurde behoben
659
-
660
- '''Version 2.2.1'''
661
- * Template für die Zahlungsarten für den Kunden und die eMails hinzugefügt
662
- * Street2 wird jetzt bei Adressen eingetragen
663
-
664
- '''Version 2.2.0'''
665
- * Update der ShopgateLibrary auf Version 2.2.0
666
- * Die Funktionen check_cart und redeem_coupons werden unterstützt. Damit ist die Live-Abfrage von Gutscheinen im Shopsystem möglich
667
- * Die Zahlungsart 'shopgate_generic' ist jetzt 'mobile_payment'
668
- * Der Status in neuen Bestellungen für die Zahlungsarten 'shopgate' und 'mobile_payment' kann jetzt eingestellt werden
669
- * Fehler beim hinzufügen von Shopgate Gutscheinen in Magento 1.4 behoben
670
- * Fehler im erstellen der Liefer- und Rechnungsadresse beim hinzufügen einer Bestellung
671
-
672
- '''Version 2.1.51'''
673
- * Fehler beim updateOrder behoben
674
-
675
- '''Version 2.1.50'''
676
- * Export optionen zum auswählen der Beschreibung und der Bilder (Eltern, Variationen, Beide)
677
-
678
- '''Version 2.1.49'''
679
- * Update der ShopgateLibrary auf Version 2.1.26
680
- * Fehler beim updateOrder behoben - Freigabe von Bestellungen durch Shopgate
681
- * nicht mehr verwendete Funktionen entfernt
682
-
683
- '''Version 2.1.48'''
684
- * Anzeigen der Mobilen Version einer CMS-Seite
685
- * Support für das Modul "CashOnDelivery" hinzugefügt
686
- * Das eintragen des Zahlungsstatus wurde überarbeitet
687
- * BugFix für das Hinzufügen von Adressen wenn kein Staat übergeben wurde
688
- * Reduzierung des Lagerbestandes nach einer Bestellung
689
-
690
- '''Version 2.1.47'''
691
- * Update der ShopgateLibrary auf Version 2.1.25
692
- * Katalog Preis Regeln werden jetzt beim export mit berücksichtigt
693
- * Unterstützung des "DreamRobot_Checkout" Moduls um Bestellungen von Magento an DreamRoboto zu senden
694
- * neues SQL Installationsskript welches ab dieser plugin Version genutzt wird
695
- * Berechnungsfehler beim Hinzufügen von Bestellungen behoben, wenn die Proukte exklusive Steuern im Backend eingetragen werden
696
-
697
- '''Version 2.1.46'''
698
- * Kompatibilität mit Magento EE 1.13.0 hergestellt
699
- * Fehler im SQL upgrade skript behoben
700
-
701
- '''Version 2.1.45'''
702
- * Teilstornierungen werden jetzt auch an Shopgate gemeldet
703
- * Teilbesetllungen werden jetzt besser an Shopgate übertragen
704
- * Im Backend kann jetzt auch global nach Shopgate Bestellnummern gesucht werden
705
-
706
- '''Version 2.1.44'''
707
- * BugFixes
708
-
709
- '''Version 2.1.43'''
710
- * Update der ShopgateLibrary auf Version 2.1.24
711
- * Shopgate Gutscheine werden jetzt separat behandelt
712
- * Preisfehler beim hinzufügen von bestellungen behoben. Die Bestellung enthält jetzt die Preise, die bei Shopgate angegeben wurde.
713
- * Update der Bestellungen überarbeitet
714
-
715
- '''Version 2.1.42'''
716
- * Gestapelte Produkte werden nun in die jeweiligen Produktanzahlen aufgetrennt
717
-
718
- '''Version 2.1.41'''
719
- * Produkte, die Qty Inkremente nutzen, werden nun als gestapelte Produkte exportiert
720
-
721
- '''Version 2.1.40'''
722
- * Fehler auf den Produkt-Detailseiten behoben wenn die Kompilierung aktiviert ist
723
- * Magento Edition wird jetzt auch in der PluginInfo gelistet
724
- * Mobile Weiterleitung kann jetzt auch ausschließlich mittels JavaScript ausgeführt werden
725
-
726
- '''Version 2.1.39'''
727
- * Update der ShopgateLibrary auf Version 2.1.23
728
- * Fehler in der Mobilen Weiterleitung behoben
729
-
730
- '''Version 2.1.38'''
731
- * Update der ShopgateLibrary auf Version 2.1.22
732
- * Option zum Exportieren von mehreren Stores
733
- * Zahlungsarten gruppiert
734
- * Fehler beim hinzufügen von Coupons behoben
735
-
736
- '''Version 2.1.37'''
737
- * Update der ShopgateLibrary auf Version 2.1.19
738
- * Verwenden der neuen Weiterleitung
739
- * BugFixes for Magento 1.4
740
-
741
- '''Version 2.1.36'''
742
- * BugFixes
743
-
744
- '''Version 2.1.35'''
745
- * Beim import der Bestellungen wird jetzt sicher gestellt, das die Preise aus Shopgate genommen werden
746
- * Steuer der Versandkosten werden jetzt berechnet
747
- * kleinere Fehler behoben
748
- * vor und nach add_order und update_order wird ein eventdispatcher aufgerufen
749
-
750
- '''Version 2.1.34'''
751
- * Encoding problem mit dem euro-zeichen behoben
752
- * Berechnunug der Steuern für Händler außerhalb Deutschland gefixt
753
- * Version des Plugins wird jetzt in allen einstellungen sichtbar
754
- * Gewicht wird jetzt als ganzzahl exportiert
755
-
756
- '''Version 2.1.33'''
757
- * Update der Library auf 2.1.18
758
- * Die Einstellungen wurden auf die Webseite erweitert und stehen jetzt für alle Views zu verfügung
759
- * Unterstützung des Grundpreis-Moduls von 'DerModPro' (http://www.magentocommerce.com/magento-connect/grundpreis-modul-pangv.html)
760
- * Diverse Verbesserungen des Paymentsystems
761
-
762
- '''Version 2.1.32'''
763
- * Problem beim Verwenden json-Funktionen behoben
764
- * Einstellungen angepasst
765
- * Zeilenumbrüche am Anfang und Ende von Optionsnamen werden jetzt entfernt
766
- * Problem beim Erstellen von Gutschriften behoben
767
-
768
- '''Version 2.1.31'''
769
- * "Debug-Einstellungen" heißt jetzt "Verbindungseinstellungen"
770
- * unterstützt wieder Magento 1.4.x
771
-
772
- '''Version 2.1.30'''
773
- * Lagerbestände werden jetzt immer als ganze Zahlen exportiert, Nachkommastellen werden abgeschnitten
774
- * Beschreibungstexte in Modulkonfiguration und Bestellungskommentaren überarbeitet
775
-
776
- '''Version 2.1.29'''
777
- * Bestellungen wieder auf on-hold setzen, wenn diese nicht zum Versand freigegeben sind
778
-
779
- '''Version 2.1.28'''
780
- * Bei Shopgate reduzierte Preise werden im Bestellungsimport mit übernommen
781
- * Update Library auf 2.1.17
782
-
783
- '''Version 2.1.27'''
784
- * Fix url_deep für produkte, welche einzeln nicht sichtbar sind
785
-
786
- '''Version 2.1.26'''
787
- * Prüfe beim Export von Bildern, ob das Bild an sich auch gesetzt ist
788
- * Zietliche Verzögerung beim Speichern der Status Historie
789
- * Problem mit dem StoreCode in der URL beim Aufruf der Plugin-API umgangen
790
- * htaccess Informationen für Bilder im Export
791
-
792
- '''Version 2.1.25'''
793
- * Funktionalitäten in Observer ausgelagert
794
- * Option um freigegebene Bestellungen direkt als bezahlt zu markieren
795
- * Option "Ist Ihr Shop bei Shopgate frei geschaltet" hinzugefügt
796
-
797
- '''Version 2.1.24'''
798
- * Produkte exportieren, welche nur in der Suche verfügbar sind
799
-
800
- '''Version 2.1.23'''
801
- * BugFix beim Importieren der Optionen
802
- * Ignoriere den Warenbestand beim Bestellungsimport
803
-
804
- '''Version 2.1.22'''
805
- * Export / Import von eingabefeldern
806
- * Exportiere Bilder von Konfigurierbaren Produkten für die verknüpften Artikel
807
-
808
- '''Version 2.1.21'''
809
- * BugFix
810
-
811
- '''Version 2.1.20'''
812
- * BugFix
813
-
814
- '''Version 2.1.19'''
815
- * Ignoriere Platzhalter-Bilder bei Kind-Produkten
816
- * Bestellstatus korrigiert
817
- * Nutze Beschreibung der Gruppen-Produkte
818
- * Exportiere Bilder der Gruppen-Produkte
819
- * Stornierung von Bestellungen (Beta)
820
-
821
- '''Version 2.1.18'''
822
- * BugFixes
823
-
824
- '''Version 2.1.17'''
825
- * Export Reviews-CSV Fix
826
- * Problem mit Konfigurierbaren produkten behoben
827
-
828
- '''Version 2.1.16'''
829
- * Fix Export Optionen für Downloads
830
-
831
- '''Version 2.1.15'''
832
- * Aktualisiere Library auf 2.1.12
833
-
834
- '''Version 2.1.14'''
835
- * Aktualisiere Library auf 2.1.11
836
- * Export Download Produkte
837
- * Export-Filter
838
-
839
- '''Version 2.1.13'''
840
- * Probleme mit dem Magento-Compiler behoben
841
-
842
- '''Version 2.1.12'''
843
- * Exportfehler von "Kurzbeschreibung + Beschreibung" behoben
844
-
845
- '''Version 2.1.11'''
846
- * Aktualisierung der Library auf 2.1.9
847
-
848
- '''Version 2.1.10'''
849
- * Fehler im Checkout für Magento 1.4 behoben
850
-
851
- '''Version 2.1.9'''
852
- * bei den Produktbildern wird das Basis-Bild des Produkts jetzt als erstes Bild und auch dann exportiert, wenn es für die Produktbildergalerie deaktiviert wurde
853
-
854
- '''Version 2.1.8'''
855
- * Exportiere Grouped-Product ohne SKU korrekt mittels id
856
-
857
- '''Version 2.1.7'''
858
- * Allgemeinen Fehler behoben
859
- * Fehler beim erstellen der redirect-keywords behoben
860
-
861
- '''Version 2.1.6'''
862
- * Bugfix in den Einstellungen. Im Export wird die eingestellte Wäheung wieder übernommen
863
- * nutzt die Shopgate Library 2.1.8
864
-
865
- '''Version 2.1.5'''
866
- * Erweitertes Logging bei addOrder/updateOrder
867
- * Option um die Preise der Eltern-Produkte zu ignorieren
868
-
869
- '''Version 2.1.4'''
870
- * Aktualisierung der Library auf 2.1.6
871
- * active_status im export
872
- * min/max Bestellmenge bei Bestelllungen ignorieren
873
-
874
- '''Version 2.1.3'''
875
- * Option um Zeilenumbrüche in Kurzbeschreibung und Beschreibung zu konvertieren
876
-
877
- '''Version 2.1.2'''
878
- * Fehler beim Export der Bilder von Kind-Elementen behoben
879
- * Option zum Ignorieren der Beschreibungen von Varianten
880
-
881
- '''Version 2.1.1'''
882
- * Aktualisierung der Library auf 2.1.4 um einen Internen Fehler zu beheben
883
-
884
- '''Version 2.1.0'''
885
- * Neue Library 2.1.0
886
-
887
-
888
  '''English'''
889
 
 
 
 
 
 
 
 
 
 
 
 
 
 
890
  '''Version 2.9.17'''
891
  * solved issue with free products
892
  * get_settings was extended to export payment_methods
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  '''English'''
2
 
3
+ '''Version 2.9.18'''
4
+ * Overhaul of payment & status mapping in add_order calls
5
+ * Added debug logs to vital functions of order/status mapping
6
+ * Adjusted order status/state translation for magento v.1.4.1.1+
7
+ * Implemented ParadoxLabs_AuthorizeNetCim mapping /w fallback to AuthorizeNET
8
+ * Cleaned up Shopgate/mobilePayment variable printing
9
+ * Added support for Payone_Core for online capture & online refund
10
+ * Payone_Core implementation tested on v3.2.0 - 3.3.3 & mage 1.4.1.1+
11
+ * Added exception throw when add_cart/check_cart prod ID is not in the system
12
+ * Fixed problems with establishing connections via oAuth
13
+ * Fixed issue with Payone and listing of get_settings payment methods
14
+ * Update to shopgate library version 2.9.21
15
+
16
  '''Version 2.9.17'''
17
  * solved issue with free products
18
  * get_settings was extended to export payment_methods
app/code/community/Shopgate/Framework/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Shopgate_Framework>
5
- <version>2.9.17</version>
6
  </Shopgate_Framework>
7
  </modules>
8
  <global>
@@ -166,7 +166,7 @@
166
  </sales_order_cancled>
167
  </observers>
168
  </order_cancel_after>
169
-
170
  <shopgate_load_config_before>
171
  <observers>
172
  <capture_oauth_registration_configuration_manipulation>
@@ -176,7 +176,7 @@
176
  </capture_oauth_registration_configuration_manipulation>
177
  </observers>
178
  </shopgate_load_config_before>
179
-
180
  <shopgate_save_config_after>
181
  <observers>
182
  <set_default_store_on_oauth_registration>
@@ -186,7 +186,7 @@
186
  </set_default_store_on_oauth_registration>
187
  </observers>
188
  </shopgate_save_config_after>
189
-
190
  <sales_quote_collect_totals_before>
191
  <observers>
192
  <temporaray_save_virtual_products_from_shopgate_coupons>
@@ -196,7 +196,7 @@
196
  </temporaray_save_virtual_products_from_shopgate_coupons>
197
  </observers>
198
  </sales_quote_collect_totals_before>
199
-
200
  <sales_order_place_after>
201
  <observers>
202
  <remove_virtual_products_of_shopgate_coupons>
@@ -267,6 +267,16 @@
267
  </shopgate>
268
  </observers>
269
  </controller_action_predispatch>
 
 
 
 
 
 
 
 
 
 
270
  </events>
271
  </adminhtml>
272
  <frontend>
2
  <config>
3
  <modules>
4
  <Shopgate_Framework>
5
+ <version>2.9.18</version>
6
  </Shopgate_Framework>
7
  </modules>
8
  <global>
166
  </sales_order_cancled>
167
  </observers>
168
  </order_cancel_after>
169
+
170
  <shopgate_load_config_before>
171
  <observers>
172
  <capture_oauth_registration_configuration_manipulation>
176
  </capture_oauth_registration_configuration_manipulation>
177
  </observers>
178
  </shopgate_load_config_before>
179
+
180
  <shopgate_save_config_after>
181
  <observers>
182
  <set_default_store_on_oauth_registration>
186
  </set_default_store_on_oauth_registration>
187
  </observers>
188
  </shopgate_save_config_after>
189
+
190
  <sales_quote_collect_totals_before>
191
  <observers>
192
  <temporaray_save_virtual_products_from_shopgate_coupons>
196
  </temporaray_save_virtual_products_from_shopgate_coupons>
197
  </observers>
198
  </sales_quote_collect_totals_before>
199
+
200
  <sales_order_place_after>
201
  <observers>
202
  <remove_virtual_products_of_shopgate_coupons>
267
  </shopgate>
268
  </observers>
269
  </controller_action_predispatch>
270
+
271
+ <sales_order_invoice_pay>
272
+ <observers>
273
+ <adjust_sequence_number>
274
+ <type>singleton</type>
275
+ <class>Shopgate_Framework_Model_Observer</class>
276
+ <method>preparePayoneOrderForRefund</method>
277
+ </adjust_sequence_number>
278
+ </observers>
279
+ </sales_order_invoice_pay>
280
  </events>
281
  </adminhtml>
282
  <frontend>
app/design/adminhtml/default/default/template/shopgate/payment/mobile_payment.phtml CHANGED
@@ -17,37 +17,25 @@
17
  * @var $this Shopgate_Framework_Block_Payment_MobilePayment
18
  */
19
 
20
- if ($this->getShopgateOrder()->getShopgateOrderObject()->getIsTest()):?>
21
- <strong style="color: red; font-size: 1.2em;">
22
- <?php echo $this->__("## This order is a TEST by Shopgate - DO NOT SHIP!") ?>
23
- </strong><br />
24
- <?php endif; ?>
25
 
26
- <?php if ($this->hasDifferentPrices()): ?>
27
- <strong style="color: red; font-size: 1.2em;">
28
- <?php echo $this->__("!! The total amount in Magento differs from the total amount at Shopgate. Please check your tax settings.") ?>
29
- </strong><br /><br />
30
- <?php endif; ?>
31
 
32
- <?php if ($this->getShopgateOrder()->getIsShippingBlocked()): ?>
33
- <strong style="color: red; font-size: 1.2em;">
34
- <?php echo $this->__("## Note: Shipping of this order is blocked by Shopgate!") ?></strong><br />
35
- <?php endif; ?>
36
 
37
- <?php if($this->getShopgateOrder()->getIsCustomerInvoiceBlocked()):?>
38
- <strong style="color: red; font-size: 1.2em;"><?php echo $this->__("## Note: For this order you must not create an invoice!")?></strong><br />
39
- <?php endif; ?>
 
40
 
41
  <?php echo $this->__('Shopgate order number: %s', $this->getShopgateOrderNumber()); ?>
42
  <p style="margin-top: 1em;">
43
- <?php foreach($this->getPaymentInfos() as $key => $value ): ?>
44
- <div style="text-decoration: underline; font-weight: bold"><?php echo $this->__(uc_words($key, ' ') . ":"); ?></div>
45
- <?php if (is_array($value)) {
46
- foreach ($value as $_key => $_value) {
47
- echo $this->__(uc_words($_key, ' ') . ": ".uc_words($_value, ' ')."<br />");
48
- }
49
- } else {
50
- echo $this->__($this->htmlEscape($value)) . "<br />";
51
- } ?>
52
- <?php endforeach; ?>
53
  </p>
17
  * @var $this Shopgate_Framework_Block_Payment_MobilePayment
18
  */
19
 
20
+ if ($this->getShopgateOrder()->getShopgateOrderObject()->getIsTest()):?><strong style="color: red; font-size: 1.2em;">
21
+ <?php echo $this->__("## This order is a TEST by Shopgate - DO NOT SHIP!") ?>
22
+ </strong><br /><?php endif; ?>
 
 
23
 
24
+ <?php if ($this->hasDifferentPrices()): ?><strong style="color: red; font-size: 1.2em;">
25
+ <?php echo $this->__(
26
+ "!! The total amount in Magento differs from the total amount at Shopgate. Please check your tax settings."
27
+ ) ?>
28
+ </strong><br /><br /><?php endif; ?>
29
 
30
+ <?php if ($this->getShopgateOrder()->getIsShippingBlocked()): ?><strong style="color: red; font-size: 1.2em;">
31
+ <?php echo $this->__("## Note: Shipping of this order is blocked by Shopgate!") ?></strong><br /><?php endif; ?>
 
 
32
 
33
+ <?php if ($this->getShopgateOrder()->getIsCustomerInvoiceBlocked()): ?><strong
34
+ style="color: red; font-size: 1.2em;"><?php echo $this->__(
35
+ "## Note: For this order you must not create an invoice!"
36
+ ) ?></strong><br /><?php endif; ?>
37
 
38
  <?php echo $this->__('Shopgate order number: %s', $this->getShopgateOrderNumber()); ?>
39
  <p style="margin-top: 1em;">
40
+ <?php echo $this->printPaymentInfo(); ?>
 
 
 
 
 
 
 
 
 
41
  </p>
lib/Shopgate/changelog.txt CHANGED
@@ -1,5 +1,11 @@
1
  '''Deutsch'''
2
 
 
 
 
 
 
 
3
  '''Version 2.9.19'''
4
  * Produkt-XML-Export: manche XML-Knoten wurden fälschlicherweise mit "forceEmpty"-Attribute exportiert
5
 
@@ -417,6 +423,12 @@
417
 
418
  '''English'''
419
 
 
 
 
 
 
 
420
  '''Version 2.9.19'''
421
  * product XML export: some XML nodes were exported with a "forceEmpty" attribute by mistake
422
 
1
  '''Deutsch'''
2
 
3
+ '''Version 2.9.21'''
4
+ * Konstanten für weitere Zahlungsarten in Klasse ShopgateCartBase hinzugefügt
5
+
6
+ '''Version 2.9.20'''
7
+ * XML-Export: Es werden nun keine XML-Tags mehr leer hinzugefügt, wenn diese eigentlich entfernt werden sollten
8
+
9
  '''Version 2.9.19'''
10
  * Produkt-XML-Export: manche XML-Knoten wurden fälschlicherweise mit "forceEmpty"-Attribute exportiert
11
 
423
 
424
  '''English'''
425
 
426
+ '''Version 2.9.21'''
427
+ * added constants for more payment types in class ShopgateCartBase
428
+
429
+ '''Version 2.9.20'''
430
+ * xml export does not include empty xml elements when they should actually be removed instead
431
+
432
  '''Version 2.9.19'''
433
  * product XML export: some XML nodes were exported with a "forceEmpty" attribute by mistake
434
 
lib/Shopgate/classes/core.php CHANGED
@@ -24,7 +24,7 @@
24
  ###################################################################################
25
  # define constants
26
  ###################################################################################
27
- define('SHOPGATE_LIBRARY_VERSION', '2.9.19');
28
  define('SHOPGATE_LIBRARY_ENCODING' , 'UTF-8');
29
  define('SHOPGATE_BASE_DIR', realpath(dirname(__FILE__).'/../'));
30
 
24
  ###################################################################################
25
  # define constants
26
  ###################################################################################
27
+ define('SHOPGATE_LIBRARY_VERSION', '2.9.21');
28
  define('SHOPGATE_LIBRARY_ENCODING' , 'UTF-8');
29
  define('SHOPGATE_BASE_DIR', realpath(dirname(__FILE__).'/../'));
30
 
lib/Shopgate/classes/models/XmlEmptyObject.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Shopgate GmbH
5
+ *
6
+ * URHEBERRECHTSHINWEIS
7
+ *
8
+ * Dieses Plugin ist urheberrechtlich geschützt. Es darf ausschließlich von Kunden der Shopgate GmbH
9
+ * zum Zwecke der eigenen Kommunikation zwischen dem IT-System des Kunden mit dem IT-System der
10
+ * Shopgate GmbH über www.shopgate.com verwendet werden. Eine darüber hinausgehende Vervielfältigung, Verbreitung,
11
+ * öffentliche Zugänglichmachung, Bearbeitung oder Weitergabe an Dritte ist nur mit unserer vorherigen
12
+ * schriftlichen Zustimmung zulässig. Die Regelungen der §§ 69 d Abs. 2, 3 und 69 e UrhG bleiben hiervon unberührt.
13
+ *
14
+ * COPYRIGHT NOTICE
15
+ *
16
+ * This plugin is the subject of copyright protection. It is only for the use of Shopgate GmbH customers,
17
+ * for the purpose of facilitating communication between the IT system of the customer and the IT system
18
+ * of Shopgate GmbH via www.shopgate.com. Any reproduction, dissemination, public propagation, processing or
19
+ * transfer to third parties is only permitted where we previously consented thereto in writing. The provisions
20
+ * of paragraph 69 d, sub-paragraphs 2, 3 and paragraph 69, sub-paragraph e of the German Copyright Act shall remain unaffected.
21
+ *
22
+ * @author Shopgate GmbH <interfaces@shopgate.com>
23
+ */
24
+
25
+ /**
26
+ * @class Shopgate_Model_Catalog_XmlEmptyObject
27
+ */
28
+ class Shopgate_Model_Catalog_XmlEmptyObject extends Shopgate_Model_AbstractExport {
29
+
30
+ /**
31
+ * define allowed methods
32
+ *
33
+ * @var array
34
+ */
35
+ protected $allowedMethods = array();
36
+
37
+ /**
38
+ * @param Shopgate_Model_XmlResultObject $itemNode
39
+ *
40
+ * @return Shopgate_Model_XmlResultObject
41
+ */
42
+ public function asXml(Shopgate_Model_XmlResultObject $itemNode) {
43
+ return $itemNode;
44
+ }
45
+ }
lib/Shopgate/classes/models/catalog/Product.php CHANGED
@@ -760,27 +760,29 @@ class Shopgate_Model_Catalog_Product extends Shopgate_Model_AbstractExport {
760
  */
761
  protected function cleanChildData($parentItem, $childItem) {
762
  foreach ($childItem->getData() as $childKey => $childValue) {
763
- /**
764
- * array or object
765
- */
766
  if (is_array($childValue) || $childValue instanceof Shopgate_Model_Abstract) {
767
  /**
768
- * array
769
  */
770
  if(is_array($childValue) && count($childValue) > 0) {
 
 
 
771
  if($childValue == $parentItem->getData($childKey)) {
772
  $childItem->setData($childKey, array());
773
  }
774
  } elseif ($childValue instanceof Shopgate_Model_Abstract) {
 
 
 
775
  if($childValue == $parentItem->getData($childKey)) {
776
- $class = get_class($childValue);
777
- $childItem->setData($childKey, new $class);
778
  }
779
  }
 
780
  /**
781
  * string
782
  */
783
- } else {
784
  if($childValue == $parentItem->getData($childKey)) {
785
  $childItem->setData($childKey, null);
786
  }
760
  */
761
  protected function cleanChildData($parentItem, $childItem) {
762
  foreach ($childItem->getData() as $childKey => $childValue) {
 
 
 
763
  if (is_array($childValue) || $childValue instanceof Shopgate_Model_Abstract) {
764
  /**
765
+ * array or object
766
  */
767
  if(is_array($childValue) && count($childValue) > 0) {
768
+ /**
769
+ * array
770
+ */
771
  if($childValue == $parentItem->getData($childKey)) {
772
  $childItem->setData($childKey, array());
773
  }
774
  } elseif ($childValue instanceof Shopgate_Model_Abstract) {
775
+ /**
776
+ * object
777
+ */
778
  if($childValue == $parentItem->getData($childKey)) {
779
+ $childItem->setData($childKey, new Shopgate_Model_Catalog_XmlEmptyObject());
 
780
  }
781
  }
782
+ } else {
783
  /**
784
  * string
785
  */
 
786
  if($childValue == $parentItem->getData($childKey)) {
787
  $childItem->setData($childKey, null);
788
  }
lib/Shopgate/classes/orders.php CHANGED
@@ -44,6 +44,7 @@ abstract class ShopgateCartBase extends ShopgateContainer {
44
  const PAYONE_INV = "PAYONE_INV";
45
  const SG_INVOICE = "SG_INVOICE";
46
  const WCARD_INV = "WCARD_INV";
 
47
 
48
  const PAYPAL = "PAYPAL";
49
  const CMPTOP_PP = "CMPTOP_PP";
@@ -145,8 +146,11 @@ abstract class ShopgateCartBase extends ShopgateContainer {
145
  const MSTPAY_SUE = "MSTPAY_SUE";
146
  const SG_SUE = "SG_SUE";
147
  const WCARD_SUE = "WCARD_SUE";
 
 
148
 
149
  const SIX_IDEAL = "SIX_IDEAL";
 
150
 
151
  const AMAZON_PAYMENT = "MWS";
152
 
44
  const PAYONE_INV = "PAYONE_INV";
45
  const SG_INVOICE = "SG_INVOICE";
46
  const WCARD_INV = "WCARD_INV";
47
+ const PAYONE_KLV = 'PAYONE_KLV';
48
 
49
  const PAYPAL = "PAYPAL";
50
  const CMPTOP_PP = "CMPTOP_PP";
146
  const MSTPAY_SUE = "MSTPAY_SUE";
147
  const SG_SUE = "SG_SUE";
148
  const WCARD_SUE = "WCARD_SUE";
149
+ const PAYONE_GP = "PAYONE_GP";
150
+ const PAYONE_SUE = "PAYONE_SUE";
151
 
152
  const SIX_IDEAL = "SIX_IDEAL";
153
+ const PAYONE_IDL = "PAYONE_IDL";
154
 
155
  const AMAZON_PAYMENT = "MWS";
156
 
lib/Shopgate/shopgate.php CHANGED
@@ -41,6 +41,7 @@ require_once(dirname(__FILE__).DS.'classes'.DS.'redirect.php');
41
  */
42
  require_once(dirname(__FILE__).DS.'classes'.DS.'models/Abstract.php');
43
  require_once(dirname(__FILE__).DS.'classes'.DS.'models/AbstractExport.php');
 
44
  require_once(dirname(__FILE__).DS.'classes'.DS.'models/XmlResultObject.php');
45
  /**
46
  * catalog
41
  */
42
  require_once(dirname(__FILE__).DS.'classes'.DS.'models/Abstract.php');
43
  require_once(dirname(__FILE__).DS.'classes'.DS.'models/AbstractExport.php');
44
+ require_once(dirname(__FILE__).DS.'classes'.DS.'models/XmlEmptyObject.php');
45
  require_once(dirname(__FILE__).DS.'classes'.DS.'models/XmlResultObject.php');
46
  /**
47
  * catalog
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>shopgate_module</name>
4
- <version>2.9.17</version>
5
  <stability>stable</stability>
6
  <license uri="http://wiki.shopgate.com/Magento/de">Shopgate Plugin</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>Shopgate Plugin</description>
11
  <notes>Shopgate Modul</notes>
12
  <authors><author><name>Peter Liebig</name><user>Shopgate</user><email>p.liebig@me.com</email></author><author><name>Stephan Recknagel</name><user>Shopgate</user><email>mail@recknagel.io</email></author><author><name>Andr&#xE9; Kraus</name><user>Shopgate</user><email>andre.kraus83@googlemail.com</email></author></authors>
13
- <date>2015-07-22</date>
14
- <time>12:19:05</time>
15
- <contents><target name="mageetc"><dir name="modules"><file name="Shopgate_Framework.xml" hash="3fb114204bd038da711122083876f161"/></dir></target><target name="magecommunity"><dir name="Shopgate"><dir name="Framework"><dir name="Block"><dir name="Adminhtml"><dir name="OAuth"><dir name="Config"><file name="Connector.php" hash="890d04b08bf692c12b02f29abf813f83"/></dir><dir name="Connect"><dir name="Add"><file name="Form.php" hash="45685099b41a46919a9900d22c30b711"/></dir><file name="Info.php" hash="ee7bbc837bf3f298791b8496f2d6d565"/><file name="Overlay.php" hash="a6496896dccb5898b36e3e65585650f4"/></dir><file name="Connect.php" hash="cc7e43ba447b6338f6c50ccaa5fd073a"/><file name="Data.php" hash="1903e819d5d16abba4c37d7823909260"/><file name="Disconnect.php" hash="2545e56bca73577ba5f73fce0501624a"/><dir name="Manage"><file name="Grid.php" hash="78357b78fed0e8b3535a7e505c8f6425"/></dir><file name="Manage.php" hash="a99e12333f7c27771ca42a0764108639"/></dir></dir><file name="Info.php" hash="3dd73900370546289a6033942a0c0528"/><dir name="Payment"><file name="MobilePayment.php" hash="3d8abdc154405a733003702a00e797a4"/><file name="Shopgate.php" hash="67af406fa04da70461b3580b8adea89d"/></dir><dir name="Totals"><file name="AbstractPaymentFee.php" hash="5e36647f536d1c6daba33cd6e0a5e302"/><file name="CreditmemoPaymentFee.php" hash="4a287f54554d8d45772db386f54a45e7"/><file name="InvoicePaymentFee.php" hash="818164536fe249016af3046aef73f181"/><file name="OrderPaymentFee.php" hash="55c8f62c4da8014c99414ece9cd125c4"/></dir><file name="Version.php" hash="2f45712bb20635ac17d8bdee213819e5"/></dir><dir name="Helper"><dir name="Billsafe"><file name="Order.php" hash="474c2aa15f352224c11c8ab17e921c9d"/></dir><file name="Config.php" hash="bb3b32c2717439d218c04d90876a18f1"/><file name="Coupon.php" hash="7a19ac697702d6334705f1d92274243b"/><file name="Customer.php" hash="9317086e730aedc99c7c187ebf898a7b"/><file name="Data.php" hash="d705b15ef5678874f337a17009f4cd75"/><file name="Debug.php" hash="82c85038046fc9b2f994df18b7f202a6"/><file name="Export.php" hash="205dee2b07a96990efdc7ecca08cf075"/><dir name="Import"><file name="Order.php" hash="0ba172f97c206d14f6950a693164472a"/></dir><file name="Install.php" hash="57f42693c9a6ddb18b8a25a2a5da7cf8"/><dir name="Payment"><file name="Abstract.php" hash="484289d68e09f591f59d50b3905a895e"/><file name="Wspp.php" hash="53ed3f72fc8d5bcde6a6a7ab78d6323f"/></dir><file name="Sales.php" hash="abbbdf5bd1223e2ebb62255cdadadc80"/></dir><dir name="Model"><dir name="Carrier"><file name="Fix.php" hash="42dc660fd45db6dc3721957665c6cf43"/></dir><dir name="Cataloginventory"><file name="Stock.php" hash="42ffccc3d644f8b04358a3e76bda32dd"/></dir><dir name="Compiler"><file name="Process.php" hash="740452b7bc234417788db1f1ee892ef5"/></dir><file name="Config.php" hash="30c638d50ff53e16bff9cfeb8285d170"/><file name="Customer.php" hash="97ed53ca3f69c7a24fb40cce11f58721"/><dir name="DreamRobot"><file name="Observer.php" hash="7b4e8922a46f5974b8edf359c632a9d3"/></dir><dir name="Export"><file name="Abstract.php" hash="9e86667845e8cebd8e0ccb8879b70b6d"/><dir name="Category"><file name="Csv.php" hash="72f4f58345d95f8f621783bedf2a092e"/><file name="Xml.php" hash="12ab046b9a000636ed4ed5eefb770af2"/></dir><file name="Category.php" hash="5a41141ecec85669674ec818c4661cdc"/><dir name="Customer"><file name="Orders.php" hash="98f11380fdc5d83bd8d04fbc8a00041d"/></dir><file name="Customer.php" hash="2711476c9538a22242d1511649ec77f1"/><dir name="Product"><file name="Csv.php" hash="579821eee1466a94b6aa1daf8fdc83c7"/><file name="Xml.php" hash="1d6bca8bf936aff0aae65fd6ab1c4d5b"/></dir><file name="Product.php" hash="d9c807df57af3f1cced2d9bb433338ec"/><dir name="Review"><file name="Csv.php" hash="5c72f802a2de256ca1ec8dab1b75b291"/><file name="Xml.php" hash="bc16f60d9ed20705422921955a5071fe"/></dir><file name="Review.php" hash="ad6f548035a30da642d2459354acbb40"/><file name="Settings.php" hash="8d3628736fff9010c994a8a3baa7c85c"/></dir><file name="Feed.php" hash="fb99cd7b2b3d94908848b722df666b67"/><dir name="Mobile"><file name="Redirect.php" hash="637ba202475a901806d3ba822d9cdc1e"/></dir><dir name="Mysql4"><dir name="Core"><file name="Core.php" hash="fc129d4d929f83e8389367b9c5d6d5e1"/></dir><dir name="Customer"><file name="Collection.php" hash="89d31997abc3c2145f74e02dd5456a7c"/></dir><file name="Customer.php" hash="d5f460b2d5bfa87b8368a8a6c6b51115"/><file name="Product.php" hash="6a99b3d0de44dfbd132ce9caca19034e"/><dir name="Shopgate"><dir name="Order"><file name="Collection.php" hash="e180ba816be47239828bea65cd5f8445"/></dir><file name="Order.php" hash="c297847e39ad01307dba4a69c13445f2"/></dir></dir><file name="Observer.php" hash="80741b3017e2596e7cf5a250809dc46c"/><dir name="Payment"><file name="Abstract.php" hash="d12c6c7bbdf5e4b112f7ea5699d1ae65"/><file name="Amazon.php" hash="ac6ec7bf147016a03c5310ab982f25ef"/><file name="Authorize.php" hash="cd26445080ff467b7b332e19dac0de0e"/><file name="Billsafe.php" hash="49233f403c0ec2fe1aa275ef0301fe76"/><file name="Express.php" hash="20f331f5ab9a146caa771816826962d0"/><file name="Generic.php" hash="666f06186d1bb96b94af287d221e27c5"/><file name="MobilePayment.php" hash="367c50012fab08f981cf5e36bbb341e2"/><file name="Shopgate.php" hash="f0d59e2a4369f7a22e47cf9c3bb9c44a"/><file name="Usaepay.php" hash="7198aa92c6198b88e72e4a9f58f5c354"/><file name="Wspp.php" hash="479ff4eafd8aa7bc5aa6ab555e3ce80e"/></dir><dir name="Resource"><dir name="Core"><file name="Config.php" hash="0ee7969070ab0dddfdd3bb2cc404cd3c"/></dir><dir name="Customer"><file name="Collection.php" hash="2ddb7db1355100bc9e86f966f1d4612c"/></dir><file name="Customer.php" hash="69848842d4be07be4d66d700a7b6695b"/><file name="Product.php" hash="5c62ef4cfc3f0ebbbe5a9a46d1c25dfa"/><file name="Setup.php" hash="7b5cc0f99c857e9292638c1fbeb43969"/><dir name="Shopgate"><dir name="Connection"><file name="Collection.php" hash="f294d4239cee276b7e3c5e6e2109de66"/><dir name="Grid"><file name="Collection.php" hash="d499139d50dffbfe1b1e868b5aeeee0f"/></dir></dir><dir name="Order"><file name="Collection.php" hash="2c18a4ca248ca8719e7ead85f0c57619"/></dir><file name="Order.php" hash="1942eeb8268781c499f8cad384081b02"/></dir></dir><dir name="Sales"><dir name="Creditmemo"><dir name="Total"><file name="ShopgatePaymentFee.php" hash="614d1e96cd2c97e0fcd7db86ee3aad89"/></dir></dir><dir name="Invoice"><dir name="Total"><file name="ShopgatePaymentFee.php" hash="c4400832de32367067fd5396bcf7bfc8"/></dir></dir><dir name="Quote"><dir name="Address"><dir name="Total"><file name="ShopgatePaymentFee.php" hash="28b097ab68b92268248b19a4ff20121b"/></dir></dir></dir></dir><dir name="Search"><dir name="Shopgate"><file name="Order.php" hash="94dcf366528641687b89ab0c9f973ef5"/></dir></dir><dir name="Shopgate"><dir name="Cart"><dir name="Validation"><dir name="Stock"><file name="Bundle.php" hash="7cc03239fbefe3a8e71755a178299944"/><file name="Simple.php" hash="9da9891d52c89e0772af5bcea7581ae8"/></dir><file name="Stock.php" hash="03d8139aa9840d707c8e4cb991bca20f"/></dir></dir><file name="Connection.php" hash="ff0da764d444103f5892ef21e23ba353"/><file name="Order.php" hash="89e0e425fc48282c1b46d3078b294be1"/><file name="Plugin.php" hash="f732780bc919537d0418575f85de7f08"/><dir name="Shipping"><dir name="Mapper"><file name="Carrier.php" hash="ef57904070fdf7921e51e88c3991c029"/><dir name="Method"><file name="Abstract.php" hash="bb402c49f3da66f7bd4baf5b215f989e"/><file name="Interface.php" hash="1bab00e6e0356184c3f213acfce601da"/><file name="Shopgate.php" hash="af8e1ade067d1b9fb0e5b493ad814576"/><file name="Usps.php" hash="14969ce8762a7fa5e5e5d6bc64285f52"/></dir></dir><file name="Mapper.php" hash="b93ac160c4c176c77887a23593ab058c"/></dir></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Attribute.php" hash="8dfc3964b750aebac8db5f584559d5c3"/><dir name="Description"><file name="List.php" hash="c83f37019461ab7adc86a57400f63761"/></dir><file name="Description.php" hash="d0dcebc9d75fdb0bb80f3c3faba6397c"/><file name="Enabledisable.php" hash="7f189c26cd1c2c7f1cd6dc56379798b5"/><dir name="Item"><file name="Sort.php" hash="2dc75f9c1e8baaddbf895945acd2ff19"/></dir><dir name="Product"><file name="Image.php" hash="e9d0e7c5769446290094d2b67e5c468b"/><file name="Names.php" hash="98de8ee7ae9b3c504eb087f5e09d3afd"/><file name="Types.php" hash="007b54c2e095691380c21a5ab62846fc"/></dir><dir name="Redirect"><file name="Types.php" hash="c5d3c44ab1f5ba74224b41836b14afff"/></dir><file name="Server.php" hash="b569e24076ca68c4063729fb708b666a"/><file name="Store.php" hash="cb2998beb43ba8afeeaa5b64a5b5e946"/><dir name="Validation"><file name="Config.php" hash="77382cb829f4b3b50120d7e1359e0051"/></dir><dir name="Variation"><dir name="Export"><file name="Type.php" hash="bb19358c2c2fbee3cb9776f3540faa20"/></dir></dir><dir name="Weight"><file name="Units.php" hash="10af44d670bcfdb559f4196c7006e893"/></dir></dir></dir></dir></dir><file name="changelog.txt" hash="31db96f7525168b2b66ea5c3bd45938b"/><dir name="controllers"><dir name="Adminhtml"><file name="ShopgateController.php" hash="cd2305edb0348a15f956d20d39433778"/></dir><file name="FrameworkController.php" hash="f901e83f2033e6a1604b389e217d4127"/></dir><dir name="etc"><file name="adminhtml.xml" hash="d1f345ca5fc8b0619234f9c270fb84a7"/><file name="config.xml" hash="3b7e6e76af128bbdafd6cf60b8ae4c59"/><file name="system.xml" hash="eae99f8132b6316c0abdc0ec7440ddb6"/></dir><file name="licence.txt" hash="dec6ca25c420b36a2e400caf1541c923"/><dir name="sql"><dir name="shopgate_setup"><file name="mysql4-install-0.1.0.php" hash="069abba038757da43b2ca6c5a0c82aba"/><file name="mysql4-install-2.1.45.php" hash="eddddf157e55a87edc77361dde564463"/><file name="mysql4-install-2.2.0.php" hash="eddddf157e55a87edc77361dde564463"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="cc637fc1bc511e745f02a56d0b36e3be"/><file name="mysql4-upgrade-1.0.5-1.0.7.php" hash="1e800d9d235b817bf5be698288bc0129"/><file name="mysql4-upgrade-2.1.44-2.1.45.php" hash="134d0b665746c61d364f6fd93d83f46c"/><file name="mysql4-upgrade-2.1.49-2.1.50.php" hash="e0fd395bb9c25c0e544c455186cfe7c9"/><file name="mysql4-upgrade-2.4.28-2.4.29.php" hash="9c8c868ce90e42b56182b23b78d6fbe7"/><file name="mysql4-upgrade-2.4.29-2.4.30.php" hash="ca3ee1e2f337bcea26264a17f603548e"/><file name="mysql4-upgrade-2.7.5-2.8.0.php" hash="34393a58a0b4ec90b4e618d3ff4cc565"/><file name="mysql4-upgrade-2.9.15-2.9.16.php" hash="980e7cc83f912ef4f630ef8d1cb964d1"/><file name="mysql4-upgrade-2.9.4-2.9.5.php" hash="89a34b7b9ad2eec492055e52e7e75049"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="de_DE"><file name="Shopgate_Framework.csv" hash="bdf9f8ed6d5127744440bfd72bb09e06"/></dir><dir name="de_CH"><file name="Shopgate_Framework.csv" hash="bdf9f8ed6d5127744440bfd72bb09e06"/></dir><dir name="de_AT"><file name="Shopgate_Framework.csv" hash="bdf9f8ed6d5127744440bfd72bb09e06"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="shopgate"><file name="logo.png" hash="b7139047ecc90b15a5710ab0fe77fc81"/><file name="logo_big.png" hash="b98bfcf09766589506a1cca24ca47972"/><file name="logo_small.png" hash="7abf7f774c592eb582c2856e027af798"/><file name="oauth_connect.js" hash="8e5c77d9ad1354f826445f03c91008f4"/><file name="shopgate_admin.css" hash="0fbc07171267b9fb5dba7004a0858f66"/><file name="target.js" hash="80484a4dae515f708c97545d9959673a"/></dir></dir></dir></dir></target><target name="magelib"><dir name="Shopgate"><dir name="assets"><file name="index.php" hash="bfc5021f1ee9b67f78a0fc9fdab6c558"/><file name="js_header.html" hash="f9865eae13ed93fd41788aa27b0391ee"/><file name="link_tag.html" hash="4798d67e30ef4a76dd8435326421673d"/><file name="mobile_header.html" hash="17616650e160eaccd24e25729396c5a9"/></dir><file name="changelog.txt" hash="ddd93e3e8846e641e7c7438a70aa1e40"/><dir name="classes"><file name="apis.php" hash="309c70f84eaeebc7a873cc1b2ccaf144"/><file name="configuration.php" hash="a4bd69f9e18dd2d0ebd704468e8a8ffc"/><file name="core.php" hash="90b0b73fc198669b65d78624738267b7"/><file name="customers.php" hash="c6806e5296caa93709f300030f224188"/><file name="external_orders.php" hash="faa434d0a099f5d415d0aec2e3788f46"/><dir name="helper"><file name="DataStructure.php" hash="ece9e9f855756777f543d090f5ecc710"/><file name="Pricing.php" hash="fd4c74999abc3bfa05fd74994a2ce78f"/><file name="String.php" hash="10c9396b2975bf0bde86f171932c3074"/><file name="index.php" hash="bfc5021f1ee9b67f78a0fc9fdab6c558"/></dir><file name="index.php" hash="bfc5021f1ee9b67f78a0fc9fdab6c558"/><file name="items.php" hash="93d57ff12a362b52b53daa8ef67949e9"/><dir name="models"><file name="Abstract.php" hash="a32633283eb403a55a166bbad70b3e2f"/><file name="AbstractExport.php" hash="f265f9e906208e1799994d117582be20"/><file name="XmlResultObject.php" hash="e104dedb2b8fa4579b7a93da2cb58dc0"/><dir name="catalog"><file name="Attribute.php" hash="28d8f3bc6c416661d1eaa77726ba7009"/><file name="AttributeGroup.php" hash="0270086ec8006ee8231c6b0baa8d6034"/><file name="Category.php" hash="fcba83c074f7559f44bc62154f7063e0"/><file name="CategoryPath.php" hash="475869aef74c567c8569ee9953210faa"/><file name="Identifier.php" hash="d9a3b16d1fcdec641ca2b0fd77fbd625"/><file name="Input.php" hash="5ac87958a42f38122fba6e472c2d643e"/><file name="Manufacturer.php" hash="cbfd53577f0f8dfccfb70dc801fc9e15"/><file name="Option.php" hash="7cb3f72a8c1fb4505cde70d1b3d72013"/><file name="Price.php" hash="63587038abdac8fbe74428da7c433e28"/><file name="Product.php" hash="53d43785d81ffbc5c7379037f51ff9ea"/><file name="Property.php" hash="5967f0403a606a27ea4fec71a8402327"/><file name="Relation.php" hash="263cde539af500af911baec4e354079e"/><file name="Review.php" hash="72c94cb1f2a54bafffdb5672d87ecd4d"/><file name="Shipping.php" hash="e4cabbc096e8aed1ffa98a23abb47b2d"/><file name="Stock.php" hash="f157bc07057803b571018df2db0fefa6"/><file name="Tag.php" hash="39e7b845ab157d2f707707576e868d64"/><file name="TierPrice.php" hash="9dd757c9c3d193944a5727fbe5cf4704"/><file name="Validation.php" hash="0be71640c1df60ab809347194ec66457"/><file name="Visibility.php" hash="d60c6b8ec486da4afdc46a00d65ad172"/><file name="index.php" hash="bfc5021f1ee9b67f78a0fc9fdab6c558"/></dir><file name="index.php" hash="bfc5021f1ee9b67f78a0fc9fdab6c558"/><dir name="media"><file name="Attachment.php" hash="c074ef3426c2506350cbf5ff0133c89d"/><file name="Image.php" hash="3640490564b897d069c9c4180fb23649"/><file name="index.php" hash="bfc5021f1ee9b67f78a0fc9fdab6c558"/></dir></dir><file name="orders.php" hash="07cfeed4d8224c9fee0a09a03fbe4c28"/><file name="redirect.php" hash="568c682f66c4434188c604158029db57"/></dir><dir name="config"><file name="index.php" hash="bfc5021f1ee9b67f78a0fc9fdab6c558"/></dir><file name="index.php" hash="de19abc78063ea9a4112964c79946f1c"/><file name="shopgate.php" hash="480b0ed67c19c4822f81b8cbabe49a68"/><file name="shopgate_license.txt" hash="21fbb2f00b832416916b27c5e3f5d6d1"/><dir name="temp"><dir name="cache"><file name="index.php" hash="7573387748996e2dd9e02a237056f158"/></dir><file name="index.php" hash="7573387748996e2dd9e02a237056f158"/><dir name="logs"><file name="index.php" hash="7573387748996e2dd9e02a237056f158"/></dir></dir><dir name="vendors"><file name="2d_is.php" hash="087decaca87ee85d548d8caaa43f1212"/><file name="BSD_license.txt" hash="2df4dd93533ca2c19f6f2d601bc3e0d5"/><file name="JSON.php" hash="c8398aeb5c3c71aeb1813389d9a030af"/><file name="index.php" hash="bfc5021f1ee9b67f78a0fc9fdab6c558"/></dir><file name=".htaccess" hash="34479bc8d9df775c38a980ecaf6f3f4b"/></dir></target><target name="mage"><dir name="app"><dir name="design"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="shopgate.xml" hash="26e50f9810daeb36b45f850272a86c91"/></dir><dir name="template"><dir name="shopgate"><file name="mobile_website.phtml" hash="229cbefd12ea77676f8af9c7159528ea"/><dir name="payment"><file name="mobile_payment.phtml" hash="1e18979028fb13e99af7c595c75a5d27"/><file name="shopgate.phtml" hash="1e18979028fb13e99af7c595c75a5d27"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="shopgate.xml" hash="a38cee3696126b6bb43df33a0d3f5271"/></dir><dir name="template"><dir name="shopgate"><dir name="oauth"><dir name="config"><file name="connector.phtml" hash="478c309bdde7834bf20a48b65a4699fb"/></dir><dir name="connect"><file name="info.phtml" hash="4f75dc4311616081873a7d416b96c1c2"/><file name="overlay.phtml" hash="2a17d5b6ff8023568437b194f8a9d482"/></dir><file name="connect.phtml" hash="6956aa22eedf549c4565304b4e4a4ab9"/><file name="data.phtml" hash="09b4c5d83863f104db7a018510cdb315"/><file name="disconnect.phtml" hash="2858cebe9004c9fb5764f79faee46f87"/><file name="manage.phtml" hash="1f99255efbce4dbdc1ee781820d455b8"/></dir><dir name="payment"><file name="mobile_payment.phtml" hash="f1bcde7c750b581b1adced27f8200a27"/><file name="shopgate.phtml" hash="5457030290f8aa08c2711a8bd27c3dee"/></dir></dir></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>shopgate_module</name>
4
+ <version>2.9.18</version>
5
  <stability>stable</stability>
6
  <license uri="http://wiki.shopgate.com/Magento/de">Shopgate Plugin</license>
7
  <channel>community</channel>
10
  <description>Shopgate Plugin</description>
11
  <notes>Shopgate Modul</notes>
12
  <authors><author><name>Peter Liebig</name><user>Shopgate</user><email>p.liebig@me.com</email></author><author><name>Stephan Recknagel</name><user>Shopgate</user><email>mail@recknagel.io</email></author><author><name>Andr&#xE9; Kraus</name><user>Shopgate</user><email>andre.kraus83@googlemail.com</email></author></authors>
13
+ <date>2015-08-04</date>
14
+ <time>12:43:09</time>
15
+ <contents><target name="mageetc"><dir name="modules"><file name="Shopgate_Framework.xml" hash="3fb114204bd038da711122083876f161"/></dir></target><target name="magecommunity"><dir name="Shopgate"><dir name="Framework"><dir name="Block"><dir name="Adminhtml"><dir name="OAuth"><dir name="Config"><file name="Connector.php" hash="890d04b08bf692c12b02f29abf813f83"/></dir><dir name="Connect"><dir name="Add"><file name="Form.php" hash="45685099b41a46919a9900d22c30b711"/></dir><file name="Info.php" hash="ee7bbc837bf3f298791b8496f2d6d565"/><file name="Overlay.php" hash="a6496896dccb5898b36e3e65585650f4"/></dir><file name="Connect.php" hash="cc7e43ba447b6338f6c50ccaa5fd073a"/><file name="Data.php" hash="1903e819d5d16abba4c37d7823909260"/><file name="Disconnect.php" hash="2545e56bca73577ba5f73fce0501624a"/><dir name="Manage"><file name="Grid.php" hash="78357b78fed0e8b3535a7e505c8f6425"/></dir><file name="Manage.php" hash="a99e12333f7c27771ca42a0764108639"/></dir></dir><file name="Info.php" hash="3dd73900370546289a6033942a0c0528"/><dir name="Payment"><file name="MobilePayment.php" hash="4c5805f4d09cb7f38f6e873b4cae33c1"/><file name="Shopgate.php" hash="67af406fa04da70461b3580b8adea89d"/></dir><dir name="Totals"><file name="AbstractPaymentFee.php" hash="5e36647f536d1c6daba33cd6e0a5e302"/><file name="CreditmemoPaymentFee.php" hash="4a287f54554d8d45772db386f54a45e7"/><file name="InvoicePaymentFee.php" hash="818164536fe249016af3046aef73f181"/><file name="OrderPaymentFee.php" hash="55c8f62c4da8014c99414ece9cd125c4"/></dir><file name="Version.php" hash="2f45712bb20635ac17d8bdee213819e5"/></dir><dir name="Helper"><dir name="Billsafe"><file name="Order.php" hash="474c2aa15f352224c11c8ab17e921c9d"/></dir><file name="Config.php" hash="738109de2b00a28594a57fb0a2e91952"/><file name="Coupon.php" hash="7a19ac697702d6334705f1d92274243b"/><file name="Customer.php" hash="9317086e730aedc99c7c187ebf898a7b"/><file name="Data.php" hash="0f8adfe6c80eefc85537c79b19731235"/><file name="Debug.php" hash="82c85038046fc9b2f994df18b7f202a6"/><file name="Export.php" hash="205dee2b07a96990efdc7ecca08cf075"/><dir name="Import"><file name="Order.php" hash="0ba172f97c206d14f6950a693164472a"/></dir><file name="Install.php" hash="57f42693c9a6ddb18b8a25a2a5da7cf8"/><dir name="Payment"><file name="Abstract.php" hash="484289d68e09f591f59d50b3905a895e"/><file name="Payone.php" hash="ddced5955ff55105d8b3c91e0fcb0778"/><file name="Wspp.php" hash="53ed3f72fc8d5bcde6a6a7ab78d6323f"/></dir><file name="Sales.php" hash="abbbdf5bd1223e2ebb62255cdadadc80"/></dir><dir name="Model"><dir name="Carrier"><file name="Fix.php" hash="42dc660fd45db6dc3721957665c6cf43"/></dir><dir name="Cataloginventory"><file name="Stock.php" hash="42ffccc3d644f8b04358a3e76bda32dd"/></dir><dir name="Compiler"><file name="Process.php" hash="740452b7bc234417788db1f1ee892ef5"/></dir><file name="Config.php" hash="30c638d50ff53e16bff9cfeb8285d170"/><file name="Customer.php" hash="97ed53ca3f69c7a24fb40cce11f58721"/><dir name="DreamRobot"><file name="Observer.php" hash="7b4e8922a46f5974b8edf359c632a9d3"/></dir><dir name="Export"><file name="Abstract.php" hash="9e86667845e8cebd8e0ccb8879b70b6d"/><dir name="Category"><file name="Csv.php" hash="72f4f58345d95f8f621783bedf2a092e"/><file name="Xml.php" hash="12ab046b9a000636ed4ed5eefb770af2"/></dir><file name="Category.php" hash="5a41141ecec85669674ec818c4661cdc"/><dir name="Customer"><file name="Orders.php" hash="98f11380fdc5d83bd8d04fbc8a00041d"/></dir><file name="Customer.php" hash="2711476c9538a22242d1511649ec77f1"/><dir name="Product"><file name="Csv.php" hash="579821eee1466a94b6aa1daf8fdc83c7"/><file name="Xml.php" hash="1d6bca8bf936aff0aae65fd6ab1c4d5b"/></dir><file name="Product.php" hash="d9c807df57af3f1cced2d9bb433338ec"/><dir name="Review"><file name="Csv.php" hash="5c72f802a2de256ca1ec8dab1b75b291"/><file name="Xml.php" hash="bc16f60d9ed20705422921955a5071fe"/></dir><file name="Review.php" hash="ad6f548035a30da642d2459354acbb40"/><file name="Settings.php" hash="604a2642188876402ae2df485392625a"/></dir><file name="Feed.php" hash="fb99cd7b2b3d94908848b722df666b67"/><dir name="Mobile"><file name="Redirect.php" hash="637ba202475a901806d3ba822d9cdc1e"/></dir><dir name="Mysql4"><dir name="Core"><file name="Core.php" hash="fc129d4d929f83e8389367b9c5d6d5e1"/></dir><dir name="Customer"><file name="Collection.php" hash="89d31997abc3c2145f74e02dd5456a7c"/></dir><file name="Customer.php" hash="d5f460b2d5bfa87b8368a8a6c6b51115"/><file name="Product.php" hash="6a99b3d0de44dfbd132ce9caca19034e"/><dir name="Shopgate"><dir name="Order"><file name="Collection.php" hash="e180ba816be47239828bea65cd5f8445"/></dir><file name="Order.php" hash="c297847e39ad01307dba4a69c13445f2"/></dir></dir><file name="Observer.php" hash="12012d97720b4726fc0036e89ae72fbf"/><dir name="Payment"><file name="Abstract.php" hash="6ccbbe837dfab2e688168bfb6736dbdd"/><file name="Amazon.php" hash="c90003246111cf066270015b41cb7ff9"/><file name="Authorize.php" hash="6f747fb258e59137cc5dadc179664246"/><file name="Billsafe.php" hash="1c97ec04356ae4ed25c1492a317eaaff"/><dir name="Cc"><file name="Abstract.php" hash="9da8b136b64e684d434b5c7d1749a0d6"/><file name="Authn.php" hash="cb7c64d874af752b5e42b84f730d3b70"/><file name="AuthnAbstract.php" hash="14f800ab7f1eef9cb156ede972f03cc3"/><dir name="Authncim"><file name="Gateway.php" hash="1f8df3fe0e50f4729bebfc1d4763b015"/><file name="Method.php" hash="aa6916548a71848ad7c83e4f053bc27e"/></dir><file name="Authncim.php" hash="1790d5366857344bb78ec76e1e1ccf53"/><file name="Usaepay.php" hash="e26b2317146174b6da8e6f189df84bfe"/></dir><file name="Cc.php" hash="7fe7850acbe549859442ec9facb9b550"/><file name="Express.php" hash="e90c6eb120a0aec969f63496b4fb1063"/><file name="Factory.php" hash="18e6a9df111781de310fc72b339f0292"/><file name="Generic.php" hash="666f06186d1bb96b94af287d221e27c5"/><file name="Interface.php" hash="151002297bcce208b85bd260c7a25b47"/><file name="MobilePayment.php" hash="59554c65e778831f6add450e0f846f42"/><dir name="Payone"><file name="Abstract.php" hash="3465493a3cfce507ab194522b71cf59e"/><file name="BankAbstract.php" hash="fa4ef2c918868001c5f1df97cb4bc400"/><file name="Cc.php" hash="11e68f50ea43bf73b31c53efea0cbc4d"/><file name="Dbt.php" hash="7f098887ba6f12669a18f62d7885de6d"/><file name="Gp.php" hash="7686149aedae93b0d5eef0b06fc08d7e"/><file name="Idl.php" hash="57d144744565ff644db917cab7ef689e"/><file name="Inv.php" hash="91d893ee5eacdc00ff8fbb3f1b750894"/><file name="Klv.php" hash="f82fb0cc874ea8f1121f282372e4e404"/><file name="Pp.php" hash="93004cedd66ab4bf31e5bb8747b4a606"/><file name="Prp.php" hash="76079d7e154c3a982b1d117793942c3a"/><file name="Sue.php" hash="31280f2c8abf21f0a582b656fb0d38ad"/></dir><dir name="Pp"><file name="Abstract.php" hash="dfbfd8dbca2a7adc22aa52fcff02ffd8"/><file name="Paypal.php" hash="567bd33b3fa420496e1395e68f1a68fc"/><file name="Wspp.php" hash="93638df868d42015f3d87ac93e176efd"/></dir><file name="Pp.php" hash="c521bbb32aed313c0170dd6e8361f934"/><file name="Router.php" hash="1df693718ebb4b71d2ae790678927194"/><file name="Shopgate.php" hash="f0d59e2a4369f7a22e47cf9c3bb9c44a"/><dir name="Simple"><file name="Billsafe.php" hash="939f38d1f3938be6f43c338a3204310f"/><file name="Mws.php" hash="ded03363e82fc438521687ed9881c6e7"/><file name="Paypal.php" hash="4d4311d0f61d33b189c431abae236a4f"/><dir name="Sue"><file name="Abstract.php" hash="d07d6b3a5702b458ed4e5f4574e3ced9"/><file name="Sue118.php" hash="4333d782de9814b6ab63fd9d4a140aa8"/><file name="Sue300.php" hash="0669135e0ea3b6d3280c37b6e17ac9a5"/></dir><file name="Sue.php" hash="6802dc052e2088957329689b003a16f8"/></dir><file name="Simple.php" hash="e4f0b3cd8282c2661cb19eabdb77d075"/><file name="Usaepay.php" hash="50e049e1cae29abbd7027cf842878540"/><file name="Wspp.php" hash="23b0420ff59dc0bfa7940bf0f07562fc"/></dir><dir name="Resource"><dir name="Core"><file name="Config.php" hash="0ee7969070ab0dddfdd3bb2cc404cd3c"/></dir><dir name="Customer"><file name="Collection.php" hash="2ddb7db1355100bc9e86f966f1d4612c"/></dir><file name="Customer.php" hash="69848842d4be07be4d66d700a7b6695b"/><file name="Product.php" hash="5c62ef4cfc3f0ebbbe5a9a46d1c25dfa"/><file name="Setup.php" hash="7b5cc0f99c857e9292638c1fbeb43969"/><dir name="Shopgate"><dir name="Connection"><file name="Collection.php" hash="f294d4239cee276b7e3c5e6e2109de66"/><dir name="Grid"><file name="Collection.php" hash="d499139d50dffbfe1b1e868b5aeeee0f"/></dir></dir><dir name="Order"><file name="Collection.php" hash="2c18a4ca248ca8719e7ead85f0c57619"/></dir><file name="Order.php" hash="1942eeb8268781c499f8cad384081b02"/></dir></dir><dir name="Sales"><dir name="Creditmemo"><dir name="Total"><file name="ShopgatePaymentFee.php" hash="614d1e96cd2c97e0fcd7db86ee3aad89"/></dir></dir><dir name="Invoice"><dir name="Total"><file name="ShopgatePaymentFee.php" hash="c4400832de32367067fd5396bcf7bfc8"/></dir></dir><dir name="Quote"><dir name="Address"><dir name="Total"><file name="ShopgatePaymentFee.php" hash="28b097ab68b92268248b19a4ff20121b"/></dir></dir></dir></dir><dir name="Search"><dir name="Shopgate"><file name="Order.php" hash="94dcf366528641687b89ab0c9f973ef5"/></dir></dir><dir name="Shopgate"><dir name="Cart"><dir name="Validation"><dir name="Stock"><file name="Bundle.php" hash="7cc03239fbefe3a8e71755a178299944"/><file name="Simple.php" hash="9da9891d52c89e0772af5bcea7581ae8"/></dir><file name="Stock.php" hash="03d8139aa9840d707c8e4cb991bca20f"/></dir></dir><file name="Connection.php" hash="ff0da764d444103f5892ef21e23ba353"/><file name="Order.php" hash="89e0e425fc48282c1b46d3078b294be1"/><file name="Plugin.php" hash="183e8c21f66aac59a8d1ae523e8161bf"/><dir name="Shipping"><dir name="Mapper"><file name="Carrier.php" hash="ef57904070fdf7921e51e88c3991c029"/><dir name="Method"><file name="Abstract.php" hash="bb402c49f3da66f7bd4baf5b215f989e"/><file name="Interface.php" hash="1bab00e6e0356184c3f213acfce601da"/><file name="Shopgate.php" hash="af8e1ade067d1b9fb0e5b493ad814576"/><file name="Usps.php" hash="14969ce8762a7fa5e5e5d6bc64285f52"/></dir></dir><file name="Mapper.php" hash="b93ac160c4c176c77887a23593ab058c"/></dir></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Attribute.php" hash="8dfc3964b750aebac8db5f584559d5c3"/><dir name="Description"><file name="List.php" hash="c83f37019461ab7adc86a57400f63761"/></dir><file name="Description.php" hash="d0dcebc9d75fdb0bb80f3c3faba6397c"/><file name="Enabledisable.php" hash="7f189c26cd1c2c7f1cd6dc56379798b5"/><dir name="Item"><file name="Sort.php" hash="2dc75f9c1e8baaddbf895945acd2ff19"/></dir><dir name="Product"><file name="Image.php" hash="e9d0e7c5769446290094d2b67e5c468b"/><file name="Names.php" hash="98de8ee7ae9b3c504eb087f5e09d3afd"/><file name="Types.php" hash="007b54c2e095691380c21a5ab62846fc"/></dir><dir name="Redirect"><file name="Types.php" hash="c5d3c44ab1f5ba74224b41836b14afff"/></dir><file name="Server.php" hash="b569e24076ca68c4063729fb708b666a"/><file name="Store.php" hash="cb2998beb43ba8afeeaa5b64a5b5e946"/><dir name="Validation"><file name="Config.php" hash="77382cb829f4b3b50120d7e1359e0051"/></dir><dir name="Variation"><dir name="Export"><file name="Type.php" hash="bb19358c2c2fbee3cb9776f3540faa20"/></dir></dir><dir name="Weight"><file name="Units.php" hash="10af44d670bcfdb559f4196c7006e893"/></dir></dir></dir></dir></dir><file name="changelog.txt" hash="766a8c100b0a7ec9a93654da5d0bcaeb"/><dir name="controllers"><dir name="Adminhtml"><file name="ShopgateController.php" hash="cd2305edb0348a15f956d20d39433778"/></dir><file name="FrameworkController.php" hash="f901e83f2033e6a1604b389e217d4127"/></dir><dir name="etc"><file name="adminhtml.xml" hash="d1f345ca5fc8b0619234f9c270fb84a7"/><file name="config.xml" hash="d2d87cb530732959f3c6f063a4105f4d"/><file name="system.xml" hash="eae99f8132b6316c0abdc0ec7440ddb6"/></dir><file name="licence.txt" hash="dec6ca25c420b36a2e400caf1541c923"/><dir name="sql"><dir name="shopgate_setup"><file name="mysql4-install-0.1.0.php" hash="069abba038757da43b2ca6c5a0c82aba"/><file name="mysql4-install-2.1.45.php" hash="eddddf157e55a87edc77361dde564463"/><file name="mysql4-install-2.2.0.php" hash="eddddf157e55a87edc77361dde564463"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="cc637fc1bc511e745f02a56d0b36e3be"/><file name="mysql4-upgrade-1.0.5-1.0.7.php" hash="1e800d9d235b817bf5be698288bc0129"/><file name="mysql4-upgrade-2.1.44-2.1.45.php" hash="134d0b665746c61d364f6fd93d83f46c"/><file name="mysql4-upgrade-2.1.49-2.1.50.php" hash="e0fd395bb9c25c0e544c455186cfe7c9"/><file name="mysql4-upgrade-2.4.28-2.4.29.php" hash="9c8c868ce90e42b56182b23b78d6fbe7"/><file name="mysql4-upgrade-2.4.29-2.4.30.php" hash="ca3ee1e2f337bcea26264a17f603548e"/><file name="mysql4-upgrade-2.7.5-2.8.0.php" hash="34393a58a0b4ec90b4e618d3ff4cc565"/><file name="mysql4-upgrade-2.9.15-2.9.16.php" hash="980e7cc83f912ef4f630ef8d1cb964d1"/><file name="mysql4-upgrade-2.9.4-2.9.5.php" hash="89a34b7b9ad2eec492055e52e7e75049"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="de_DE"><file name="Shopgate_Framework.csv" hash="bdf9f8ed6d5127744440bfd72bb09e06"/></dir><dir name="de_CH"><file name="Shopgate_Framework.csv" hash="bdf9f8ed6d5127744440bfd72bb09e06"/></dir><dir name="de_AT"><file name="Shopgate_Framework.csv" hash="bdf9f8ed6d5127744440bfd72bb09e06"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="shopgate"><file name="logo.png" hash="b7139047ecc90b15a5710ab0fe77fc81"/><file name="logo_big.png" hash="b98bfcf09766589506a1cca24ca47972"/><file name="logo_small.png" hash="7abf7f774c592eb582c2856e027af798"/><file name="oauth_connect.js" hash="8e5c77d9ad1354f826445f03c91008f4"/><file name="shopgate_admin.css" hash="0fbc07171267b9fb5dba7004a0858f66"/><file name="target.js" hash="80484a4dae515f708c97545d9959673a"/></dir></dir></dir></dir></target><target name="magelib"><dir name="Shopgate"><dir name="assets"><file name="index.php" hash="bfc5021f1ee9b67f78a0fc9fdab6c558"/><file name="js_header.html" hash="f9865eae13ed93fd41788aa27b0391ee"/><file name="link_tag.html" hash="4798d67e30ef4a76dd8435326421673d"/><file name="mobile_header.html" hash="17616650e160eaccd24e25729396c5a9"/></dir><file name="changelog.txt" hash="bbbfde8d30b9ec1bca95ecfd929a8ee8"/><dir name="classes"><file name="apis.php" hash="309c70f84eaeebc7a873cc1b2ccaf144"/><file name="configuration.php" hash="a4bd69f9e18dd2d0ebd704468e8a8ffc"/><file name="core.php" hash="864b6373749c596b5fde9b29233baa5e"/><file name="customers.php" hash="c6806e5296caa93709f300030f224188"/><file name="external_orders.php" hash="faa434d0a099f5d415d0aec2e3788f46"/><dir name="helper"><file name="DataStructure.php" hash="ece9e9f855756777f543d090f5ecc710"/><file name="Pricing.php" hash="fd4c74999abc3bfa05fd74994a2ce78f"/><file name="String.php" hash="10c9396b2975bf0bde86f171932c3074"/><file name="index.php" hash="bfc5021f1ee9b67f78a0fc9fdab6c558"/></dir><file name="index.php" hash="bfc5021f1ee9b67f78a0fc9fdab6c558"/><file name="items.php" hash="93d57ff12a362b52b53daa8ef67949e9"/><dir name="models"><file name="Abstract.php" hash="a32633283eb403a55a166bbad70b3e2f"/><file name="AbstractExport.php" hash="f265f9e906208e1799994d117582be20"/><file name="XmlEmptyObject.php" hash="d6cfdae3bdd858d4f10fcebdb542f533"/><file name="XmlResultObject.php" hash="e104dedb2b8fa4579b7a93da2cb58dc0"/><dir name="catalog"><file name="Attribute.php" hash="28d8f3bc6c416661d1eaa77726ba7009"/><file name="AttributeGroup.php" hash="0270086ec8006ee8231c6b0baa8d6034"/><file name="Category.php" hash="fcba83c074f7559f44bc62154f7063e0"/><file name="CategoryPath.php" hash="475869aef74c567c8569ee9953210faa"/><file name="Identifier.php" hash="d9a3b16d1fcdec641ca2b0fd77fbd625"/><file name="Input.php" hash="5ac87958a42f38122fba6e472c2d643e"/><file name="Manufacturer.php" hash="cbfd53577f0f8dfccfb70dc801fc9e15"/><file name="Option.php" hash="7cb3f72a8c1fb4505cde70d1b3d72013"/><file name="Price.php" hash="63587038abdac8fbe74428da7c433e28"/><file name="Product.php" hash="13ab692ab92566f3ed1dcebe8ef612a5"/><file name="Property.php" hash="5967f0403a606a27ea4fec71a8402327"/><file name="Relation.php" hash="263cde539af500af911baec4e354079e"/><file name="Review.php" hash="72c94cb1f2a54bafffdb5672d87ecd4d"/><file name="Shipping.php" hash="e4cabbc096e8aed1ffa98a23abb47b2d"/><file name="Stock.php" hash="f157bc07057803b571018df2db0fefa6"/><file name="Tag.php" hash="39e7b845ab157d2f707707576e868d64"/><file name="TierPrice.php" hash="9dd757c9c3d193944a5727fbe5cf4704"/><file name="Validation.php" hash="0be71640c1df60ab809347194ec66457"/><file name="Visibility.php" hash="d60c6b8ec486da4afdc46a00d65ad172"/><file name="index.php" hash="bfc5021f1ee9b67f78a0fc9fdab6c558"/></dir><file name="index.php" hash="bfc5021f1ee9b67f78a0fc9fdab6c558"/><dir name="media"><file name="Attachment.php" hash="c074ef3426c2506350cbf5ff0133c89d"/><file name="Image.php" hash="3640490564b897d069c9c4180fb23649"/><file name="index.php" hash="bfc5021f1ee9b67f78a0fc9fdab6c558"/></dir></dir><file name="orders.php" hash="2b4cccde29c5a4ee2395625540a16f88"/><file name="redirect.php" hash="568c682f66c4434188c604158029db57"/></dir><dir name="config"><file name="index.php" hash="bfc5021f1ee9b67f78a0fc9fdab6c558"/></dir><file name="index.php" hash="de19abc78063ea9a4112964c79946f1c"/><file name="shopgate.php" hash="f0482cc4027105bb5d423ddde01e7ac7"/><file name="shopgate_license.txt" hash="21fbb2f00b832416916b27c5e3f5d6d1"/><dir name="temp"><dir name="cache"><file name="index.php" hash="7573387748996e2dd9e02a237056f158"/></dir><file name="index.php" hash="7573387748996e2dd9e02a237056f158"/><dir name="logs"><file name="index.php" hash="7573387748996e2dd9e02a237056f158"/></dir></dir><dir name="vendors"><file name="2d_is.php" hash="087decaca87ee85d548d8caaa43f1212"/><file name="BSD_license.txt" hash="2df4dd93533ca2c19f6f2d601bc3e0d5"/><file name="JSON.php" hash="c8398aeb5c3c71aeb1813389d9a030af"/><file name="index.php" hash="bfc5021f1ee9b67f78a0fc9fdab6c558"/></dir><file name=".htaccess" hash="34479bc8d9df775c38a980ecaf6f3f4b"/></dir></target><target name="mage"><dir name="app"><dir name="design"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="shopgate.xml" hash="26e50f9810daeb36b45f850272a86c91"/></dir><dir name="template"><dir name="shopgate"><file name="mobile_website.phtml" hash="229cbefd12ea77676f8af9c7159528ea"/><dir name="payment"><file name="mobile_payment.phtml" hash="1e18979028fb13e99af7c595c75a5d27"/><file name="shopgate.phtml" hash="1e18979028fb13e99af7c595c75a5d27"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="shopgate.xml" hash="a38cee3696126b6bb43df33a0d3f5271"/></dir><dir name="template"><dir name="shopgate"><dir name="oauth"><dir name="config"><file name="connector.phtml" hash="478c309bdde7834bf20a48b65a4699fb"/></dir><dir name="connect"><file name="info.phtml" hash="4f75dc4311616081873a7d416b96c1c2"/><file name="overlay.phtml" hash="2a17d5b6ff8023568437b194f8a9d482"/></dir><file name="connect.phtml" hash="6956aa22eedf549c4565304b4e4a4ab9"/><file name="data.phtml" hash="09b4c5d83863f104db7a018510cdb315"/><file name="disconnect.phtml" hash="2858cebe9004c9fb5764f79faee46f87"/><file name="manage.phtml" hash="1f99255efbce4dbdc1ee781820d455b8"/></dir><dir name="payment"><file name="mobile_payment.phtml" hash="88e83035e22b1d69f631a8c935fcd2de"/><file name="shopgate.phtml" hash="5457030290f8aa08c2711a8bd27c3dee"/></dir></dir></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>