ZerebroInternet_Barzahlen - Version 1.3.0

Version Notes

In this version the following things were already tested successfully on Magento CE 1.4.2.0, 1.5.0.1, 1.5.1.0, 1.6.0.0, 1.6.1.0, 1.6.2.0, 1.7.0.0, 1.7.0.1, 1.7.0.2, 1.8.0.0, 1.8.1.0, 1.9.0.0, 1.9.0.1

Download this release

Release Info

Developer Alexander Diebler
Extension ZerebroInternet_Barzahlen
Version 1.3.0
Comparing to
See all releases


Code changes from version 1.2.1 to 1.3.0

Files changed (84) hide show
  1. app/code/community/ZerebroInternet/Barzahlen/Block/.DS_Store +0 -0
  2. app/code/community/ZerebroInternet/Barzahlen/Block/Adminhtml/Sales/Order/Creditmemo/View.php +0 -44
  3. app/code/community/ZerebroInternet/Barzahlen/Block/Adminhtml/Sales/Order/View.php +0 -44
  4. app/code/community/ZerebroInternet/Barzahlen/Block/Form.php +7 -19
  5. app/code/community/ZerebroInternet/Barzahlen/Block/Info.php +4 -14
  6. app/code/community/ZerebroInternet/Barzahlen/Helper/Data.php +4 -19
  7. app/code/community/ZerebroInternet/Barzahlen/Model/.DS_Store +0 -0
  8. app/code/community/ZerebroInternet/Barzahlen/Model/Adminexceptions/Allspecificcountries.php +3 -13
  9. app/code/community/ZerebroInternet/Barzahlen/Model/Adminexceptions/Maxordertotal.php +3 -13
  10. app/code/community/ZerebroInternet/Barzahlen/Model/Adminexceptions/Notificationkey.php +3 -13
  11. app/code/community/ZerebroInternet/Barzahlen/Model/Adminexceptions/Paymentkey.php +3 -13
  12. app/code/community/ZerebroInternet/Barzahlen/Model/Adminexceptions/Shopid.php +3 -13
  13. app/code/community/ZerebroInternet/Barzahlen/Model/Adminexceptions/Specificcountry.php +3 -13
  14. app/code/community/ZerebroInternet/Barzahlen/Model/Adminexceptions/Title.php +3 -13
  15. app/code/community/ZerebroInternet/Barzahlen/Model/Api.php +16 -13
  16. app/code/community/ZerebroInternet/Barzahlen/Model/Api/Abstract.php +3 -12
  17. app/code/community/ZerebroInternet/Barzahlen/Model/Api/Notification.php +3 -12
  18. app/code/community/ZerebroInternet/Barzahlen/Model/Api/Request/Abstract.php +3 -12
  19. app/code/community/ZerebroInternet/Barzahlen/Model/Api/Request/Cancel.php +3 -12
  20. app/code/community/ZerebroInternet/Barzahlen/Model/Api/Request/Payment.php +3 -12
  21. app/code/community/ZerebroInternet/Barzahlen/Model/Api/Request/Refund.php +3 -12
  22. app/code/community/ZerebroInternet/Barzahlen/Model/Api/Request/Resend.php +3 -12
  23. app/code/community/ZerebroInternet/Barzahlen/Model/Api/Request/Update.php +3 -12
  24. app/code/community/ZerebroInternet/Barzahlen/Model/Api/Version.php +135 -0
  25. app/code/community/ZerebroInternet/Barzahlen/Model/Barzahlen.php +128 -55
  26. app/code/community/ZerebroInternet/Barzahlen/Model/Cancel.php +0 -54
  27. app/code/community/ZerebroInternet/Barzahlen/Model/Check.php +0 -128
  28. app/code/community/ZerebroInternet/Barzahlen/Model/Ipn.php +32 -155
  29. app/code/community/ZerebroInternet/Barzahlen/Model/Observer.php +87 -0
  30. app/code/community/ZerebroInternet/Barzahlen/Model/Payment.php +0 -190
  31. app/code/community/ZerebroInternet/Barzahlen/Model/Refund.php +0 -70
  32. app/code/community/ZerebroInternet/Barzahlen/Model/Resend.php +0 -43
  33. app/code/community/ZerebroInternet/Barzahlen/Test/Block/Form.php +31 -0
  34. app/code/community/ZerebroInternet/Barzahlen/Test/Block/Info.php +31 -0
  35. app/code/community/ZerebroInternet/Barzahlen/Test/Controller/IpnController.php +470 -0
  36. app/code/community/ZerebroInternet/Barzahlen/Test/Controller/IpnController/fixtures/new_order.yaml +91 -0
  37. app/code/community/ZerebroInternet/Barzahlen/Test/Controller/IpnController/fixtures/paid_order.yaml +103 -0
  38. app/code/community/ZerebroInternet/Barzahlen/Test/Controller/IpnController/fixtures/refunded_order.yaml +190 -0
  39. app/code/community/ZerebroInternet/Barzahlen/Test/Controller/IpnController/fixtures/successful_refunded_order.yaml +190 -0
  40. app/code/community/ZerebroInternet/Barzahlen/Test/Controller/ResendController.php +173 -0
  41. app/code/community/ZerebroInternet/Barzahlen/Test/Controller/ResendController/fixtures/new_order.yaml +83 -0
  42. app/code/community/ZerebroInternet/Barzahlen/Test/Controller/ResendController/fixtures/paid_order.yaml +95 -0
  43. app/code/community/ZerebroInternet/Barzahlen/Test/Controller/ResendController/fixtures/refunded_order.yaml +173 -0
  44. app/code/community/ZerebroInternet/Barzahlen/Test/Controller/ResendController/fixtures/successful_refunded_order.yaml +173 -0
  45. app/code/community/ZerebroInternet/Barzahlen/Test/Helper/Data.php +31 -0
  46. app/code/community/ZerebroInternet/Barzahlen/Test/Model/Adminexceptions/Maxordertotal.php +66 -0
  47. app/code/community/ZerebroInternet/Barzahlen/Test/Model/Adminexceptions/Maxordertotal/fixtures/Maxordertotal.yaml +15 -0
  48. app/code/community/ZerebroInternet/Barzahlen/Test/Model/Adminexceptions/Notificationkey.php +54 -0
  49. app/code/community/ZerebroInternet/Barzahlen/Test/Model/Adminexceptions/Notificationkey/fixtures/Notificationkey.yaml +15 -0
  50. app/code/community/ZerebroInternet/Barzahlen/Test/Model/Adminexceptions/Paymentkey.php +54 -0
  51. app/code/community/ZerebroInternet/Barzahlen/Test/Model/Adminexceptions/Paymentkey/fixtures/Paymentkey.yaml +15 -0
  52. app/code/community/ZerebroInternet/Barzahlen/Test/Model/Adminexceptions/Shopid.php +54 -0
  53. app/code/community/ZerebroInternet/Barzahlen/Test/Model/Adminexceptions/Shopid/fixtures/Shopid.yaml +15 -0
  54. app/code/community/ZerebroInternet/Barzahlen/Test/Model/Adminexceptions/Specificcountry.php +67 -0
  55. app/code/community/ZerebroInternet/Barzahlen/Test/Model/Adminexceptions/Specificcountry/fixtures/Specificcountry.yaml +15 -0
  56. app/code/community/ZerebroInternet/Barzahlen/Test/Model/Adminexceptions/Title.php +54 -0
  57. app/code/community/ZerebroInternet/Barzahlen/Test/Model/Adminexceptions/Title/fixtures/Title.yaml +15 -0
  58. app/code/community/ZerebroInternet/Barzahlen/Test/Model/Api/Notification.php +45 -0
  59. app/code/community/ZerebroInternet/Barzahlen/Test/Model/Api/Request/Cancel.php +31 -0
  60. app/code/community/ZerebroInternet/Barzahlen/Test/Model/Api/Request/Payment.php +35 -0
  61. app/code/community/ZerebroInternet/Barzahlen/Test/Model/Api/Request/Refund.php +32 -0
  62. app/code/community/ZerebroInternet/Barzahlen/Test/Model/Api/Request/Resend.php +31 -0
  63. app/code/community/ZerebroInternet/Barzahlen/Test/Model/Barzahlen.php +51 -0
  64. app/code/community/ZerebroInternet/Barzahlen/controllers/CheckoutController.php +0 -40
  65. app/code/community/ZerebroInternet/Barzahlen/controllers/IpnController.php +20 -22
  66. app/code/community/ZerebroInternet/Barzahlen/controllers/ResendController.php +6 -16
  67. app/code/community/ZerebroInternet/Barzahlen/etc/config.xml +138 -161
  68. app/code/community/ZerebroInternet/Barzahlen/etc/system.xml +3 -37
  69. app/design/adminhtml/base/default/template/barzahlen/form.phtml +7 -19
  70. app/design/adminhtml/base/default/template/barzahlen/info.phtml +4 -14
  71. app/design/adminhtml/base/default/template/barzahlen/mark.phtml +0 -24
  72. app/design/adminhtml/default/default/template/barzahlen/info.phtml +4 -14
  73. app/design/frontend/base/default/layout/barzahlen.xml +0 -33
  74. app/design/frontend/base/default/template/barzahlen/form.phtml +10 -22
  75. app/design/frontend/base/default/template/barzahlen/info.phtml +4 -14
  76. app/design/frontend/base/default/template/barzahlen/mark.phtml +4 -14
  77. app/design/frontend/base/default/template/barzahlen/processing.phtml +0 -46
  78. app/design/frontend/base/default/template/barzahlen/success.phtml +17 -0
  79. app/etc/modules/ZerebroInternet_Barzahlen.xml +0 -22
  80. app/locale/de_DE/{ZerebroInternet_Barzahlen_Admin.csv → ZerebroInternet_Barzahlen.csv} +10 -3
  81. app/locale/de_DE/ZerebroInternet_Barzahlen_Frontend.csv +0 -16
  82. app/locale/en_US/{ZerebroInternet_Barzahlen_Admin.csv → ZerebroInternet_Barzahlen.csv} +10 -3
  83. app/locale/en_US/ZerebroInternet_Barzahlen_Frontend.csv +0 -16
  84. package.xml +10 -10
app/code/community/ZerebroInternet/Barzahlen/Block/.DS_Store ADDED
Binary file
app/code/community/ZerebroInternet/Barzahlen/Block/Adminhtml/Sales/Order/Creditmemo/View.php DELETED
@@ -1,44 +0,0 @@
1
- <?php
2
- /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
- *
15
- * @category ZerebroInternet
16
- * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
- * @author Alexander Diebler
20
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
- */
22
-
23
- class ZerebroInternet_Barzahlen_Block_Adminhtml_Sales_Order_Creditmemo_View extends Mage_Adminhtml_Block_Sales_Order_Creditmemo_View
24
- {
25
- public function __construct()
26
- {
27
- parent::__construct();
28
- $creditMemo = $this->getCreditmemo();
29
- $paymentMethod = $creditMemo->getOrder()->getPayment()->getMethodInstance()->getCode();
30
-
31
- if ($creditMemo->getId() && $creditMemo->getState() == $creditMemo::STATE_OPEN && $paymentMethod == 'barzahlen') {
32
- $message = Mage::helper('sales')->__('bz_adm_resend_refund_slip_question');
33
- $this->_addButton('refund_slip_resend', array(
34
- 'label' => Mage::helper('barzahlen')->__('bz_adm_resend_refund_slip'),
35
- 'onclick' => "confirmSetLocation('{$message}', '{$this->getResendPaymentUrl($creditMemo->getId())}')"
36
- ), 0, 100, 'header');
37
- }
38
- }
39
-
40
- public function getResendPaymentUrl($creditMemoId)
41
- {
42
- return $this->getUrl('barzahlen/resend/refund', array('creditmemo_id' => $creditMemoId));
43
- }
44
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/ZerebroInternet/Barzahlen/Block/Adminhtml/Sales/Order/View.php DELETED
@@ -1,44 +0,0 @@
1
- <?php
2
- /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
- *
15
- * @category ZerebroInternet
16
- * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
- * @author Alexander Diebler
20
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
- */
22
-
23
- class ZerebroInternet_Barzahlen_Block_Adminhtml_Sales_Order_View extends Mage_Adminhtml_Block_Sales_Order_View
24
- {
25
- public function __construct()
26
- {
27
- parent::__construct();
28
- $order = $this->getOrder();
29
- $paymentMethod = $order->getPayment()->getMethodInstance()->getCode();
30
-
31
- if ($order->getId() && $order->canInvoice() && $paymentMethod == 'barzahlen') {
32
- $message = Mage::helper('sales')->__('bz_adm_resend_payment_slip_question');
33
- $this->_addButton('payment_slip_resend', array(
34
- 'label' => Mage::helper('barzahlen')->__('bz_adm_resend_payment_slip'),
35
- 'onclick' => "confirmSetLocation('{$message}', '{$this->getResendPaymentUrl($order->getId())}')"
36
- ), 0, 100, 'header');
37
- }
38
- }
39
-
40
- public function getResendPaymentUrl($orderId)
41
- {
42
- return $this->getUrl('barzahlen/resend/payment', array('order_id' => $orderId));
43
- }
44
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/ZerebroInternet/Barzahlen/Block/Form.php CHANGED
@@ -1,31 +1,19 @@
1
  <?php
2
  /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
  *
15
  * @category ZerebroInternet
16
  * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
  * @author Alexander Diebler
 
20
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
  */
22
 
23
  class ZerebroInternet_Barzahlen_Block_Form extends Mage_Payment_Block_Form
24
  {
25
  /**
26
- * Create the Form Block (Checkout Onepage) and assign the template to it.
27
- *
28
- * @return null
29
  */
30
  protected function _construct()
31
  {
@@ -33,9 +21,9 @@ class ZerebroInternet_Barzahlen_Block_Form extends Mage_Payment_Block_Form
33
  $mark = new $mark;
34
  $mark->setTemplate('barzahlen/mark.phtml');
35
  $this->setTemplate('barzahlen/form.phtml')
36
- ->setMethodTitle('')
37
- ->setMethodLabelAfterHtml($mark->toHtml());
38
 
39
  return parent::_construct();
40
  }
41
- }
1
  <?php
2
  /**
3
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * @category ZerebroInternet
6
  * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
 
8
  * @author Alexander Diebler
9
+ * @author Martin Seener
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
  */
12
 
13
  class ZerebroInternet_Barzahlen_Block_Form extends Mage_Payment_Block_Form
14
  {
15
  /**
16
+ * Create the form block (Checkout Onepage) and assign the template to it.
 
 
17
  */
18
  protected function _construct()
19
  {
21
  $mark = new $mark;
22
  $mark->setTemplate('barzahlen/mark.phtml');
23
  $this->setTemplate('barzahlen/form.phtml')
24
+ ->setMethodTitle('')
25
+ ->setMethodLabelAfterHtml($mark->toHtml());
26
 
27
  return parent::_construct();
28
  }
29
+ }
app/code/community/ZerebroInternet/Barzahlen/Block/Info.php CHANGED
@@ -1,22 +1,12 @@
1
  <?php
2
  /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
  *
15
  * @category ZerebroInternet
16
  * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
  * @author Alexander Diebler
 
20
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
  */
22
 
@@ -30,4 +20,4 @@ class ZerebroInternet_Barzahlen_Block_Info extends Mage_Payment_Block_Info
30
  parent::_construct();
31
  $this->setTemplate('barzahlen/info.phtml');
32
  }
33
- }
1
  <?php
2
  /**
3
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * @category ZerebroInternet
6
  * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
 
8
  * @author Alexander Diebler
9
+ * @author Martin Seener
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
  */
12
 
20
  parent::_construct();
21
  $this->setTemplate('barzahlen/info.phtml');
22
  }
23
+ }
app/code/community/ZerebroInternet/Barzahlen/Helper/Data.php CHANGED
@@ -1,32 +1,17 @@
1
  <?php
2
  /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
  *
15
  * @category ZerebroInternet
16
  * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
  * @author Alexander Diebler
 
20
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
  */
22
 
23
  class ZerebroInternet_Barzahlen_Helper_Data extends Mage_Core_Helper_Abstract
24
  {
25
- /**
26
- * @const file for all log and debug data
27
- */
28
- const DEFAULT_LOG_FILE = 'barzahlen.log';
29
-
30
  /**
31
  * Logs errors to the given log file.
32
  *
@@ -35,6 +20,6 @@ class ZerebroInternet_Barzahlen_Helper_Data extends Mage_Core_Helper_Abstract
35
  */
36
  public function bzLog($error_msg, array $error_data = array())
37
  {
38
- Mage::log($error_msg . " - " . serialize($error_data) . "\r\r", null, self::DEFAULT_LOG_FILE);
39
  }
40
  }
1
  <?php
2
  /**
3
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * @category ZerebroInternet
6
  * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
 
8
  * @author Alexander Diebler
9
+ * @author Martin Seener
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
  */
12
 
13
  class ZerebroInternet_Barzahlen_Helper_Data extends Mage_Core_Helper_Abstract
14
  {
 
 
 
 
 
15
  /**
16
  * Logs errors to the given log file.
17
  *
20
  */
21
  public function bzLog($error_msg, array $error_data = array())
22
  {
23
+ Mage::log($error_msg . " - " . serialize($error_data) . "\r\r", null, "barzahlen.log");
24
  }
25
  }
app/code/community/ZerebroInternet/Barzahlen/Model/.DS_Store ADDED
Binary file
app/code/community/ZerebroInternet/Barzahlen/Model/Adminexceptions/Allspecificcountries.php CHANGED
@@ -1,22 +1,12 @@
1
  <?php
2
  /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
  *
15
  * @category ZerebroInternet
16
  * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
  * @author Alexander Diebler
 
20
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
  */
22
 
1
  <?php
2
  /**
3
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * @category ZerebroInternet
6
  * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
 
8
  * @author Alexander Diebler
9
+ * @author Martin Seener
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
  */
12
 
app/code/community/ZerebroInternet/Barzahlen/Model/Adminexceptions/Maxordertotal.php CHANGED
@@ -1,22 +1,12 @@
1
  <?php
2
  /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
  *
15
  * @category ZerebroInternet
16
  * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
  * @author Alexander Diebler
 
20
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
  */
22
 
1
  <?php
2
  /**
3
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * @category ZerebroInternet
6
  * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
 
8
  * @author Alexander Diebler
9
+ * @author Martin Seener
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
  */
12
 
app/code/community/ZerebroInternet/Barzahlen/Model/Adminexceptions/Notificationkey.php CHANGED
@@ -1,22 +1,12 @@
1
  <?php
2
  /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
  *
15
  * @category ZerebroInternet
16
  * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
  * @author Alexander Diebler
 
20
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
  */
22
 
1
  <?php
2
  /**
3
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * @category ZerebroInternet
6
  * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
 
8
  * @author Alexander Diebler
9
+ * @author Martin Seener
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
  */
12
 
app/code/community/ZerebroInternet/Barzahlen/Model/Adminexceptions/Paymentkey.php CHANGED
@@ -1,22 +1,12 @@
1
  <?php
2
  /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
  *
15
  * @category ZerebroInternet
16
  * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
  * @author Alexander Diebler
 
20
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
  */
22
 
1
  <?php
2
  /**
3
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * @category ZerebroInternet
6
  * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
 
8
  * @author Alexander Diebler
9
+ * @author Martin Seener
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
  */
12
 
app/code/community/ZerebroInternet/Barzahlen/Model/Adminexceptions/Shopid.php CHANGED
@@ -1,22 +1,12 @@
1
  <?php
2
  /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
  *
15
  * @category ZerebroInternet
16
  * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
  * @author Alexander Diebler
 
20
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
  */
22
 
1
  <?php
2
  /**
3
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * @category ZerebroInternet
6
  * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
 
8
  * @author Alexander Diebler
9
+ * @author Martin Seener
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
  */
12
 
app/code/community/ZerebroInternet/Barzahlen/Model/Adminexceptions/Specificcountry.php CHANGED
@@ -1,22 +1,12 @@
1
  <?php
2
  /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
  *
15
  * @category ZerebroInternet
16
  * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
  * @author Alexander Diebler
 
20
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
  */
22
 
1
  <?php
2
  /**
3
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * @category ZerebroInternet
6
  * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
 
8
  * @author Alexander Diebler
9
+ * @author Martin Seener
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
  */
12
 
app/code/community/ZerebroInternet/Barzahlen/Model/Adminexceptions/Title.php CHANGED
@@ -1,22 +1,12 @@
1
  <?php
2
  /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
  *
15
  * @category ZerebroInternet
16
  * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
  * @author Alexander Diebler
 
20
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
  */
22
 
1
  <?php
2
  /**
3
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * @category ZerebroInternet
6
  * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
 
8
  * @author Alexander Diebler
9
+ * @author Martin Seener
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
  */
12
 
app/code/community/ZerebroInternet/Barzahlen/Model/Api.php CHANGED
@@ -1,21 +1,12 @@
1
  <?php
2
  /**
3
- * Barzahlen Payment Module SDK for Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
  *
15
  * @category ZerebroInternet
16
  * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
  * @author Alexander Diebler
 
19
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
20
  */
21
 
@@ -27,6 +18,7 @@ class ZerebroInternet_Barzahlen_Model_Api extends ZerebroInternet_Barzahlen_Mode
27
  protected $_allowLanguages = array('de', 'en'); //!< allowed languages for requests
28
  protected $_sandbox = false; //!< sandbox settings
29
  protected $_madeAttempts = 0; //!< performed attempts
 
30
 
31
  /**
32
  * Constructor. Sets basic settings. Adjusted for Magento
@@ -54,6 +46,16 @@ class ZerebroInternet_Barzahlen_Model_Api extends ZerebroInternet_Barzahlen_Mode
54
  }
55
  }
56
 
 
 
 
 
 
 
 
 
 
 
57
  /**
58
  * Handles request of all kinds.
59
  *
@@ -107,10 +109,11 @@ class ZerebroInternet_Barzahlen_Model_Api extends ZerebroInternet_Barzahlen_Mode
107
  curl_setopt($curl, CURLOPT_POST, count($requestArray));
108
  curl_setopt($curl, CURLOPT_POSTFIELDS, $requestArray);
109
  curl_setopt($curl, CURLOPT_HEADER, 0);
 
110
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
111
  curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
112
  curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
113
- curl_setopt($curl, CURLOPT_CAINFO, Mage::getRoot() . '/code/community/ZerebroInternet/Barzahlen/Model/Api/certs/ca-bundle.crt');
114
  curl_setopt($curl, CURLOPT_TIMEOUT, 30);
115
  curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 15);
116
  curl_setopt($curl, CURLOPT_HTTP_VERSION, 1.1);
1
  <?php
2
  /**
3
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * @category ZerebroInternet
6
  * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
8
  * @author Alexander Diebler
9
+ * @author Martin Seener
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
  */
12
 
18
  protected $_allowLanguages = array('de', 'en'); //!< allowed languages for requests
19
  protected $_sandbox = false; //!< sandbox settings
20
  protected $_madeAttempts = 0; //!< performed attempts
21
+ protected $_userAgent = 'PHP SDK v1.1.7';
22
 
23
  /**
24
  * Constructor. Sets basic settings. Adjusted for Magento
46
  }
47
  }
48
 
49
+ /**
50
+ * Sets user agent
51
+ *
52
+ * @param string $userAgent used user agent
53
+ */
54
+ public function setUserAgent($userAgent)
55
+ {
56
+ $this->_userAgent = $userAgent;
57
+ }
58
+
59
  /**
60
  * Handles request of all kinds.
61
  *
109
  curl_setopt($curl, CURLOPT_POST, count($requestArray));
110
  curl_setopt($curl, CURLOPT_POSTFIELDS, $requestArray);
111
  curl_setopt($curl, CURLOPT_HEADER, 0);
112
+ curl_setopt($curl, CURLOPT_USERAGENT, $this->_userAgent);
113
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
114
  curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
115
  curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
116
+ curl_setopt($curl, CURLOPT_CAINFO, dirname(__FILE__) . '/Api/certs/ca-bundle.crt');
117
  curl_setopt($curl, CURLOPT_TIMEOUT, 30);
118
  curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 15);
119
  curl_setopt($curl, CURLOPT_HTTP_VERSION, 1.1);
app/code/community/ZerebroInternet/Barzahlen/Model/Api/Abstract.php CHANGED
@@ -1,21 +1,12 @@
1
  <?php
2
  /**
3
- * Barzahlen Payment Module SDK for Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
  *
15
  * @category ZerebroInternet
16
  * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
  * @author Alexander Diebler
 
19
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
20
  */
21
 
1
  <?php
2
  /**
3
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * @category ZerebroInternet
6
  * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
8
  * @author Alexander Diebler
9
+ * @author Martin Seener
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
  */
12
 
app/code/community/ZerebroInternet/Barzahlen/Model/Api/Notification.php CHANGED
@@ -1,21 +1,12 @@
1
  <?php
2
  /**
3
- * Barzahlen Payment Module SDK for Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
  *
15
  * @category ZerebroInternet
16
  * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
  * @author Alexander Diebler
 
19
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
20
  */
21
 
1
  <?php
2
  /**
3
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * @category ZerebroInternet
6
  * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
8
  * @author Alexander Diebler
9
+ * @author Martin Seener
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
  */
12
 
app/code/community/ZerebroInternet/Barzahlen/Model/Api/Request/Abstract.php CHANGED
@@ -1,21 +1,12 @@
1
  <?php
2
  /**
3
- * Barzahlen Payment Module SDK for Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
  *
15
  * @category ZerebroInternet
16
  * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
  * @author Alexander Diebler
 
19
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
20
  */
21
 
1
  <?php
2
  /**
3
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * @category ZerebroInternet
6
  * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
8
  * @author Alexander Diebler
9
+ * @author Martin Seener
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
  */
12
 
app/code/community/ZerebroInternet/Barzahlen/Model/Api/Request/Cancel.php CHANGED
@@ -1,21 +1,12 @@
1
  <?php
2
  /**
3
- * Barzahlen Payment Module SDK for Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
  *
15
  * @category ZerebroInternet
16
  * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
  * @author Alexander Diebler
 
19
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
20
  */
21
 
1
  <?php
2
  /**
3
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * @category ZerebroInternet
6
  * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
8
  * @author Alexander Diebler
9
+ * @author Martin Seener
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
  */
12
 
app/code/community/ZerebroInternet/Barzahlen/Model/Api/Request/Payment.php CHANGED
@@ -1,21 +1,12 @@
1
  <?php
2
  /**
3
- * Barzahlen Payment Module SDK for Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
  *
15
  * @category ZerebroInternet
16
  * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
  * @author Alexander Diebler
 
19
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
20
  */
21
 
1
  <?php
2
  /**
3
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * @category ZerebroInternet
6
  * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
8
  * @author Alexander Diebler
9
+ * @author Martin Seener
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
  */
12
 
app/code/community/ZerebroInternet/Barzahlen/Model/Api/Request/Refund.php CHANGED
@@ -1,21 +1,12 @@
1
  <?php
2
  /**
3
- * Barzahlen Payment Module SDK for Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
  *
15
  * @category ZerebroInternet
16
  * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
  * @author Alexander Diebler
 
19
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
20
  */
21
 
1
  <?php
2
  /**
3
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * @category ZerebroInternet
6
  * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
8
  * @author Alexander Diebler
9
+ * @author Martin Seener
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
  */
12
 
app/code/community/ZerebroInternet/Barzahlen/Model/Api/Request/Resend.php CHANGED
@@ -1,21 +1,12 @@
1
  <?php
2
  /**
3
- * Barzahlen Payment Module SDK for Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
  *
15
  * @category ZerebroInternet
16
  * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
  * @author Alexander Diebler
 
19
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
20
  */
21
 
1
  <?php
2
  /**
3
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * @category ZerebroInternet
6
  * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
8
  * @author Alexander Diebler
9
+ * @author Martin Seener
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
  */
12
 
app/code/community/ZerebroInternet/Barzahlen/Model/Api/Request/Update.php CHANGED
@@ -1,21 +1,12 @@
1
  <?php
2
  /**
3
- * Barzahlen Payment Module SDK for Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
  *
15
  * @category ZerebroInternet
16
  * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
  * @author Alexander Diebler
 
19
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
20
  */
21
 
1
  <?php
2
  /**
3
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * @category ZerebroInternet
6
  * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
8
  * @author Alexander Diebler
9
+ * @author Martin Seener
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
  */
12
 
app/code/community/ZerebroInternet/Barzahlen/Model/Api/Version.php ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Barzahlen Payment Module for Magento
4
+ *
5
+ * @category ZerebroInternet
6
+ * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
8
+ * @author Alexander Diebler
9
+ * @author Martin Seener
10
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
+ */
12
+
13
+ class ZerebroInternet_Barzahlen_Model_Api_Version
14
+ {
15
+ /**
16
+ * @var string
17
+ */
18
+ private $pluginVersion = null;
19
+
20
+ /**
21
+ * @var string
22
+ */
23
+ private $pluginUrl = null;
24
+
25
+ /**
26
+ * Kicks off the plugin check.
27
+ *
28
+ * @param string $shopsystem used shop system
29
+ * @param string $shopsystemVersion used shop system version
30
+ * @param string $pluginVersion current plugin version
31
+ * @return boolean | string
32
+ */
33
+ public function isNewVersionAvailable($shopId, $shopsystem, $shopsystemVersion, $pluginVersion)
34
+ {
35
+ $transArray = array(
36
+ 'shop_id' => $shopId,
37
+ 'shopsystem' => $shopsystem,
38
+ 'shopsystem_version' => $shopsystemVersion,
39
+ 'plugin_version' => $pluginVersion
40
+ );
41
+ $this->requestVersion($transArray);
42
+
43
+ if ($this->result == 0 && $this->pluginVersion != null && $pluginVersion != $this->pluginVersion) {
44
+ return true;
45
+ }
46
+
47
+ return false;
48
+ }
49
+
50
+ /**
51
+ * Requests the current version and parses the xml.
52
+ *
53
+ * @param array $transArray
54
+ * @return boolean | string
55
+ */
56
+ protected function requestVersion(array $transArray)
57
+ {
58
+ $curl = $this->prepareRequest($transArray);
59
+ $xmlResponse = $this->sendRequest($curl);
60
+
61
+ $domDocument = new DOMDocument();
62
+ $domDocument->loadXML($xmlResponse);
63
+
64
+ $this->result = $domDocument->getElementsByTagName("result")->item(0)->nodeValue;
65
+ if ($this->result != 0) {
66
+ $errorMessage = $domDocument->getElementsByTagName("error-message")->item(0)->nodeValue;
67
+ Mage::log('barzahlen/versioncheck: Error during cURL - ' . $errorMessage . "\r\r", null, "barzahlen.log");
68
+ }
69
+
70
+ $this->pluginVersion = $domDocument->getElementsByTagName("plugin-version")->item(0)->nodeValue;
71
+ $this->pluginUrl = $domDocument->getElementsByTagName("plugin-url")->item(0)->nodeValue;
72
+ }
73
+
74
+ /**
75
+ * Prepares the curl request.
76
+ *
77
+ * @param array $requestArray array with the information which shall be send via POST
78
+ * @return cURL handle object
79
+ */
80
+ protected function prepareRequest(array $requestArray)
81
+ {
82
+ $curl = curl_init();
83
+ curl_setopt($curl, CURLOPT_URL, 'https://plugincheck.barzahlen.de/check');
84
+ curl_setopt($curl, CURLOPT_POST, count($requestArray));
85
+ curl_setopt($curl, CURLOPT_POSTFIELDS, $requestArray);
86
+ curl_setopt($curl, CURLOPT_HEADER, 0);
87
+ curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
88
+ curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
89
+ curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
90
+ curl_setopt($curl, CURLOPT_CAINFO, dirname(__FILE__) . '/certs/ca-bundle.crt');
91
+ curl_setopt($curl, CURLOPT_TIMEOUT, 30);
92
+ curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 15);
93
+ curl_setopt($curl, CURLOPT_HTTP_VERSION, 1.1);
94
+ return $curl;
95
+ }
96
+
97
+ /**
98
+ * Sends the information via HTTP POST to the given domain expecting a response.
99
+ *
100
+ * @return cURL handle object
101
+ * @return xml response from Barzahlen
102
+ */
103
+ protected function sendRequest($curl)
104
+ {
105
+ $return = curl_exec($curl);
106
+ $error = curl_error($curl);
107
+ curl_close($curl);
108
+
109
+ if ($error != '') {
110
+ Mage::log('barzahlen/versioncheck: Error during cURL - ' . $error . "\r\r", null, "barzahlen.log");
111
+ }
112
+
113
+ return $return;
114
+ }
115
+
116
+ /**
117
+ * Returns the current plugin version.
118
+ *
119
+ * @return string
120
+ */
121
+ public function getNewPluginVersion()
122
+ {
123
+ return $this->pluginVersion;
124
+ }
125
+
126
+ /**
127
+ * Returns the current plugin url.
128
+ *
129
+ * @return string
130
+ */
131
+ public function getNewPluginUrl()
132
+ {
133
+ return $this->pluginUrl;
134
+ }
135
+ }
app/code/community/ZerebroInternet/Barzahlen/Model/Barzahlen.php CHANGED
@@ -1,37 +1,17 @@
1
  <?php
2
  /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
  *
15
  * @category ZerebroInternet
16
  * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
  * @author Alexander Diebler
 
20
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
  */
22
 
23
  class ZerebroInternet_Barzahlen_Model_Barzahlen extends Mage_Payment_Model_Method_Abstract
24
  {
25
- /**
26
- * @const payment code
27
- */
28
- const PAYMENT_CODE = 'barzahlen';
29
-
30
- /**
31
- * @const file for all error log and debug data
32
- */
33
- const DEFAULT_LOG_FILE = 'barzahlen.log';
34
-
35
  /**
36
  * module code
37
  *
@@ -60,36 +40,17 @@ class ZerebroInternet_Barzahlen_Model_Barzahlen extends Mage_Payment_Model_Metho
60
  */
61
  protected $_infoBlockType = 'barzahlen/info';
62
 
63
- /**
64
- * processing url
65
- *
66
- * @var string
67
- */
68
- protected $_redirectProcessingUrl = 'barzahlen/checkout/processing';
69
-
70
  /**
71
  * Availability options
72
  *
73
  * @var boolean
74
  */
75
- protected $_canRefund = true; //!< Barzahlen transactions can be refunded
76
- protected $_canRefundInvoicePartial = true; //!< refunds can be done partial
77
- protected $_canUseInternal = true; //!< can be used in admin panel checkout
78
- protected $_canUseCheckout = true; //!< can be used as method on onepage checkout
79
- protected $_canUseForMultishipping = true; //!< can be used as method on multipage checkout
80
-
81
- /**
82
- * Barzahlen payment state possible values
83
- *
84
- * @var string
85
- */
86
- const PAYMENTSTATE_PENDING = 'pending'; //!< pending state (new order)
87
- const PAYMENTSTATE_PAID = 'paid'; //!< paid state (processing order)
88
- const PAYMENTSTATE_EXPIRED = 'expired'; //!< expired state (canceled order)
89
- const PAYMENTSTATE_REFUND_PENDING = 'refund_pending'; //!< refund pending state (credit memo OPEN)
90
- const PAYMENTSTATE_REFUND_COMPLETED = 'refund_completed'; //!< refund completed state (credit memo REFUNDED)
91
- const PAYMENTSTATE_REFUND_EXPIRED = 'refund_expired'; //!< refund expired state (credit memo CANCELED)
92
- const PAYMENTSTATE_TEXT_BLOCKS = 'bz_frnt_ipn_'; //!< text block prefix
93
 
94
  /**
95
  * Constructs Barzahlen API object.
@@ -101,23 +62,135 @@ class ZerebroInternet_Barzahlen_Model_Barzahlen extends Mage_Payment_Model_Metho
101
  $shopId = $this->getConfigData('shop_id');
102
  $paymentKey = $this->getConfigData('payment_key');
103
  $sandbox = $this->getConfigData('sandbox');
 
104
  $barzahlenApi = Mage::getModel('barzahlen/api', array('shopId' => $shopId, 'paymentKey' => $paymentKey, 'sandbox' => $sandbox));
105
  $barzahlenApi->setLanguage(substr((Mage::getSingleton('core/locale')->getLocaleCode()), 0, 2));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
 
107
- if ($this->getConfigData('debug')) {
108
- $barzahlenApi->setDebug(true, self::DEFAULT_LOG_FILE);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  }
110
 
111
- return $barzahlenApi;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  }
113
 
114
  /**
115
- * Redirect URL for checkouts using Barzahlen Payment Method - instead of onepage checkout success page.
116
  *
117
- * @return string with URL
 
 
 
118
  */
119
- public function getOrderPlaceRedirectUrl()
120
  {
121
- return Mage::getUrl($this->_redirectProcessingUrl);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
  }
123
  }
1
  <?php
2
  /**
3
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * @category ZerebroInternet
6
  * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
 
8
  * @author Alexander Diebler
9
+ * @author Martin Seener
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
  */
12
 
13
  class ZerebroInternet_Barzahlen_Model_Barzahlen extends Mage_Payment_Model_Method_Abstract
14
  {
 
 
 
 
 
 
 
 
 
 
15
  /**
16
  * module code
17
  *
40
  */
41
  protected $_infoBlockType = 'barzahlen/info';
42
 
 
 
 
 
 
 
 
43
  /**
44
  * Availability options
45
  *
46
  * @var boolean
47
  */
48
+ protected $_canOrder = true;
49
+ protected $_canRefund = true;
50
+ protected $_canRefundInvoicePartial = true;
51
+ protected $_canUseInternal = true;
52
+ protected $_canUseCheckout = true;
53
+ protected $_canUseForMultishipping = true;
 
 
 
 
 
 
 
 
 
 
 
 
54
 
55
  /**
56
  * Constructs Barzahlen API object.
62
  $shopId = $this->getConfigData('shop_id');
63
  $paymentKey = $this->getConfigData('payment_key');
64
  $sandbox = $this->getConfigData('sandbox');
65
+
66
  $barzahlenApi = Mage::getModel('barzahlen/api', array('shopId' => $shopId, 'paymentKey' => $paymentKey, 'sandbox' => $sandbox));
67
  $barzahlenApi->setLanguage(substr((Mage::getSingleton('core/locale')->getLocaleCode()), 0, 2));
68
+ $barzahlenApi->setDebug($this->getConfigData('debug'), 'barzahlen.log');
69
+ $barzahlenApi->setUserAgent('Magento ' . Mage::getVersion() . ' / Plugin v1.3.0');
70
+
71
+ return $barzahlenApi;
72
+ }
73
+
74
+ /**
75
+ * Send payment request after order (backend / frontend).
76
+ *
77
+ * @param Varien_Object $payment
78
+ * @param float $amount
79
+ * @return $this|Mage_Payment_Model_Abstract
80
+ * @throws Mage_Core_Exception
81
+ */
82
+ public function order(Varien_Object $payment, $amount)
83
+ {
84
+ $order = $payment->getOrder();
85
+ $orderAddress = $order->getBillingAddress();
86
 
87
+ $bzPayment = Mage::getModel(
88
+ 'barzahlen/api_request_payment',
89
+ array(
90
+ 'customerEmail' => $order->getCustomerEmail(),
91
+ 'customerStreetNr' => $orderAddress->getData("street"),
92
+ 'customerZipcode' => $orderAddress->getData("postcode"),
93
+ 'customerCity' => $orderAddress->getData("city"),
94
+ 'customerCountry' => $orderAddress->getData("country_id"),
95
+ 'orderId' => $order->getRealOrderId(),
96
+ 'amount' => $amount,
97
+ 'currency' => $order->getOrderCurrencyCode()
98
+ )
99
+ );
100
+
101
+ try {
102
+ $this->getBarzahlenApi()->handleRequest($bzPayment);
103
+ $payment->setAdditionalInformation('transaction_id', $bzPayment->getTransactionId())
104
+ ->setTransactionId($bzPayment->getTransactionId())
105
+ ->setIsTransactionClosed(0);
106
+ $session = Mage::getSingleton('checkout/session');
107
+ $session->setData('barzahlen_infotext', $bzPayment->getInfotext1());
108
+ } catch (Exception $e) {
109
+ Mage::helper('barzahlen')->bzLog($e);
110
+ Mage::throwException(Mage::helper('barzahlen')->__('bz_frnt_error'));
111
  }
112
 
113
+ return $this;
114
+ }
115
+
116
+ /**
117
+ * Sends resend request to Barzahlen and returns if request was successful.
118
+ *
119
+ * @param integer $transactionId Barzahlen Transaction ID
120
+ * @return boolean
121
+ */
122
+ public function resendSlip($transactionId)
123
+ {
124
+ $bzResend = Mage::getModel(
125
+ 'barzahlen/api_request_resend',
126
+ array(
127
+ 'transactionId' => $transactionId
128
+ )
129
+ );
130
+
131
+ try {
132
+ $this->getBarzahlenApi()->handleRequest($bzResend);
133
+ } catch (Exception $e) {
134
+ Mage::helper('barzahlen')->bzLog($e);
135
+ }
136
+
137
+ return $bzResend->isValid();
138
  }
139
 
140
  /**
141
+ * Trigger online refund action from admin panel.
142
  *
143
+ * @param Varien_Object $payment
144
+ * @param float $amount
145
+ * @return $this|Mage_Payment_Model_Abstract
146
+ * @throws Mage_Core_Exception
147
  */
148
+ public function refund(Varien_Object $payment, $amount)
149
  {
150
+ $bzRefund = Mage::getModel(
151
+ 'barzahlen/api_request_refund',
152
+ array(
153
+ 'transactionId' => $payment->getAdditionalInformation('transaction_id'),
154
+ 'amount' => $amount,
155
+ 'currency' => $payment->getOrder()->getOrderCurrencyCode()
156
+ )
157
+ );
158
+
159
+ try {
160
+ $this->getBarzahlenApi()->handleRequest($bzRefund);
161
+ $payment->setTransactionId($bzRefund->getRefundTransactionId());
162
+ } catch (Exception $e) {
163
+ Mage::helper('barzahlen')->bzLog($e);
164
+ Mage::throwException(Mage::helper('barzahlen')->__('bz_adm_refund_error'));
165
+ }
166
+
167
+ return $this;
168
+ }
169
+
170
+ /**
171
+ * Cancel payment slip after order cancellation.
172
+ *
173
+ * @param $data
174
+ */
175
+ public function cancelPaymentSlip($data)
176
+ {
177
+ $payment = $data->getOrder()->getPayment();
178
+
179
+ if ($payment->getMethod() != $this->_code) {
180
+ return;
181
+ }
182
+
183
+ $bzCancel = Mage::getModel(
184
+ 'barzahlen/api_request_cancel',
185
+ array(
186
+ 'transactionId' => $payment->getAdditionalInformation('transaction_id')
187
+ )
188
+ );
189
+
190
+ try {
191
+ $this->getBarzahlenApi()->handleRequest($bzCancel);
192
+ } catch (Exception $e) {
193
+ Mage::helper('barzahlen')->bzLog($e);
194
+ }
195
  }
196
  }
app/code/community/ZerebroInternet/Barzahlen/Model/Cancel.php DELETED
@@ -1,54 +0,0 @@
1
- <?php
2
- /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
- *
15
- * @category ZerebroInternet
16
- * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
- * @author Alexander Diebler
20
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
- */
22
-
23
- class ZerebroInternet_Barzahlen_Model_Cancel extends Mage_Core_Model_Abstract
24
- {
25
- /**
26
- * Cancels pending payment slips together with orders.
27
- *
28
- * @return boolean
29
- */
30
- public function cancelObserver($order)
31
- {
32
- $order = $order->getOrder();
33
-
34
- if (!$order->getId()) {
35
- Mage::throwException('No valid order choosen.');
36
- }
37
-
38
- if ($order->getPayment()->getMethod() != ZerebroInternet_Barzahlen_Model_Barzahlen::PAYMENT_CODE) {
39
- return;
40
- }
41
-
42
- $transactionId = $order->getPayment()->getAdditionalInformation('transaction_id');
43
-
44
- $cancel = Mage::getModel('barzahlen/api_request_cancel', array('transactionId' => $transactionId));
45
-
46
- try {
47
- Mage::getSingleton('barzahlen/barzahlen')->getBarzahlenApi()->handleRequest($cancel);
48
- } catch (Exception $e) {
49
- Mage::helper('barzahlen')->bzLog($e);
50
- }
51
-
52
- return $cancel->isValid();
53
- }
54
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/ZerebroInternet/Barzahlen/Model/Check.php DELETED
@@ -1,128 +0,0 @@
1
- <?php
2
- /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
- *
15
- * @category ZerebroInternet
16
- * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
- * @author Alexander Diebler
20
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
- */
22
-
23
- class ZerebroInternet_Barzahlen_Model_Check extends ZerebroInternet_Barzahlen_Model_Api_Abstract
24
- {
25
- /**
26
- * Checks if a update request is necessary and performs it if so.
27
- *
28
- * @param Varien_Event_Observer $observer
29
- */
30
- public function checkObserver($observer)
31
- {
32
- $user = $observer->getUser();
33
- $extra = unserialize($user->getExtra());
34
-
35
- $lastCheck = Mage::getStoreConfig('payment/barzahlen/last_check');
36
-
37
- if (isset($extra['configState']['payment_barzahlen']) && $extra['configState']['payment_barzahlen'] == 1) {
38
- if ($lastCheck == null || $lastCheck < strtotime("-1 week")) {
39
- $config = new Mage_Core_Model_Config();
40
- $config->saveConfig('payment/barzahlen/last_check', time(), 'default', 0);
41
- Mage::getConfig()->cleanCache();
42
- $barzahlen = Mage::getSingleton('barzahlen/barzahlen');
43
- $transArray['shop_id'] = $barzahlen->getConfigData('shop_id') != null ? $barzahlen->getConfigData('shop_id') : $barzahlen->getConfigData('shop_id', 1);
44
- $transArray['shopsystem'] = 'Magento';
45
- $transArray['shopsystem_version'] = Mage::getVersion();
46
- $transArray['plugin_version'] = (string) Mage::getConfig()->getNode()->modules->ZerebroInternet_Barzahlen->version;
47
- $paymentKey = $barzahlen->getConfigData('payment_key') != null ? $barzahlen->getConfigData('payment_key') : $barzahlen->getConfigData('payment_key', 1);
48
- $transArray['hash'] = $this->_createHash($transArray, $paymentKey);
49
-
50
- $currentVersion = $this->_requestVersion($transArray);
51
- if ($currentVersion != false) {
52
- if ($currentVersion != $transArray['plugin_version']) {
53
- Mage::getSingleton('core/session')->addNotice('Barzahlen-Update:' . Mage::helper('barzahlen')->__('bz_adm_now_available') . $currentVersion . Mage::helper('barzahlen')->__('bz_adm_over') . '<a href="' . Mage::helper("adminhtml")->getUrl('adminhtml/extension_local/index') . '">Magento Connect Manager</a>' . Mage::helper('barzahlen')->__('bz_adm_or') . '<a href="http://www.barzahlen.de/partner/integration/shopsysteme/2/magento">Barzahlen Homepage</a>.');
54
- }
55
- }
56
- }
57
- }
58
- }
59
-
60
- /**
61
- * Requests the current version and parses the xml.
62
- *
63
- * @param array $transArray
64
- * @return boolean | string
65
- */
66
- protected function _requestVersion(array $transArray)
67
- {
68
- $xmlResponse = $this->_curlRequest($transArray);
69
- if ($xmlResponse === false) {
70
- return false;
71
- }
72
-
73
- if (!is_string($xmlResponse) || $xmlResponse == '') {
74
- Mage::helper('barzahlen')->bzLog('PluginCheck: No valid xml response received.');
75
- return false;
76
- }
77
-
78
- try {
79
- $xmlObj = new SimpleXMLElement($xmlResponse);
80
- } catch (Exception $e) {
81
- Mage::helper('barzahlen')->bzLog('PluginCheck: ' . $e);
82
- return false;
83
- }
84
-
85
- if ($xmlObj->{'result'} != 0) {
86
- Mage::helper('barzahlen')->bzLog('PluginCheck: XML response contains an error: ' . $xmlObj->{'error-message'});
87
- return false;
88
- }
89
-
90
- return $xmlObj->{'plugin-version'};
91
- }
92
-
93
- /**
94
- * Sends the cURL request.
95
- *
96
- * @param array $transArray
97
- * @return boolean | string
98
- */
99
- protected function _curlRequest(array $transArray)
100
- {
101
- try {
102
- $curl = curl_init();
103
- curl_setopt($curl, CURLOPT_URL, 'https://plugincheck.barzahlen.de/check');
104
- curl_setopt($curl, CURLOPT_POST, count($transArray));
105
- curl_setopt($curl, CURLOPT_POSTFIELDS, $transArray);
106
- curl_setopt($curl, CURLOPT_HEADER, 0);
107
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
108
- curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
109
- curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
110
- curl_setopt($curl, CURLOPT_CAINFO, Mage::getRoot() . '/code/community/ZerebroInternet/Barzahlen/Model/Api/certs/ca-bundle.crt');
111
- curl_setopt($curl, CURLOPT_TIMEOUT, 30);
112
- curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 15);
113
- curl_setopt($curl, CURLOPT_HTTP_VERSION, 1.1);
114
- $return = curl_exec($curl);
115
- $error = curl_error($curl);
116
- curl_close($curl);
117
-
118
- if ($error != '') {
119
- Mage::helper('barzahlen')->bzLog('PluginCheck: ' . $error);
120
- }
121
-
122
- return $return;
123
- } catch (Exception $e) {
124
- Mage::helper('barzahlen')->bzLog('PluginCheck: ' . $e);
125
- return false;
126
- }
127
- }
128
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/ZerebroInternet/Barzahlen/Model/Ipn.php CHANGED
@@ -1,22 +1,12 @@
1
  <?php
2
  /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
  *
15
  * @category ZerebroInternet
16
  * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
  * @author Alexander Diebler
 
20
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
  */
22
 
@@ -37,11 +27,16 @@ class ZerebroInternet_Barzahlen_Model_Ipn
37
  protected $_order;
38
 
39
  /**
40
- * Corresponding Credit Memo
41
  *
42
- * @var Mage_Sales_Model_Order_Creditmemo
43
  */
44
- protected $_creditmemo;
 
 
 
 
 
45
 
46
  /**
47
  * Checks received data and validates hash.
@@ -50,8 +45,7 @@ class ZerebroInternet_Barzahlen_Model_Ipn
50
  * @return TRUE if received get array is valid and hash could be confirmed
51
  * @return FALSE if an error occurred
52
  */
53
-
54
- public function sendResponseHeader($ipnData)
55
  {
56
  $barzahlen = Mage::getModel('barzahlen/barzahlen');
57
  $shopId = $barzahlen->getConfigData('shop_id');
@@ -80,10 +74,11 @@ class ZerebroInternet_Barzahlen_Model_Ipn
80
  $orderId = isset($this->_receivedData['origin_order_id']) ? $this->_receivedData['origin_order_id'] : $this->_receivedData['order_id'];
81
  $this->_order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
82
 
83
- if ($this->_checkOrderInformation()) {
84
- if ($this->_handleStateChange()) {
85
- $this->_order->save();
86
- }
 
87
  }
88
  }
89
 
@@ -115,17 +110,14 @@ class ZerebroInternet_Barzahlen_Model_Ipn
115
  protected function _handleStateChange()
116
  {
117
  switch ($this->_receivedData['state']) {
118
- case ZerebroInternet_Barzahlen_Model_Barzahlen::PAYMENTSTATE_PAID:
119
  $this->_processTransactionPaid();
120
  return true;
121
- case ZerebroInternet_Barzahlen_Model_Barzahlen::PAYMENTSTATE_EXPIRED:
122
  $this->_processTransactionExpired();
123
  return true;
124
- case ZerebroInternet_Barzahlen_Model_Barzahlen::PAYMENTSTATE_REFUND_COMPLETED:
125
- $this->_processRefundCompleted();
126
- return true;
127
- case ZerebroInternet_Barzahlen_Model_Barzahlen::PAYMENTSTATE_REFUND_EXPIRED:
128
- $this->_processRefundExpired();
129
  return true;
130
  default:
131
  Mage::helper('barzahlen')->bzLog('controller/ipn: Cannot handle payment state', $this->_receivedData);
@@ -138,71 +130,29 @@ class ZerebroInternet_Barzahlen_Model_Ipn
138
  */
139
  protected function _processTransactionPaid()
140
  {
141
- if (!$this->_order->canInvoice()) {
142
  return;
143
  }
144
 
145
- Mage::getModel('sales/order_invoice_api')->create($this->_order->getIncrementId(), array(), $this->_createIpnComment(), true, true);
 
 
 
 
 
146
  }
147
 
148
  /**
149
- * Cancels an order after the period of ten days elasped.
150
  */
151
  protected function _processTransactionExpired()
152
  {
 
 
153
  $this->_order->registerCancellation($this->_createIpnComment(), false)->save();
154
  $this->_order->sendOrderUpdateEmail(true, $this->_createIpnComment());
155
  }
156
 
157
- /**
158
- * Update order state after refund was completed successful.
159
- */
160
- protected function _processRefundCompleted()
161
- {
162
- if ($this->_getCreditmemo()) {
163
- $this->_creditmemo->setState(Mage_Sales_Model_Order_Creditmemo::STATE_REFUNDED);
164
- $this->_creditmemo->addComment($this->_createIpnComment(), false, true);
165
- $this->_creditmemo->save();
166
- }
167
- }
168
-
169
- /**
170
- * Sets an order be to completed after the period of thrity days for the refund elasped.
171
- */
172
- protected function _processRefundExpired()
173
- {
174
- if ($this->_getCreditmemo()) {
175
- $this->_creditmemo->setState(Mage_Sales_Model_Order_Creditmemo::STATE_CANCELED);
176
- $this->_creditmemo->addComment($this->_createIpnComment(), false, true);
177
- $this->_rollbackCreditmemo();
178
- $this->_creditmemo->save();
179
- }
180
- }
181
-
182
- /**
183
- * Get requested credit memo from the database.
184
- *
185
- * @return TURE if credit memo was found with refund_transaction_id
186
- * @return FALSE if no credit memo was found
187
- */
188
- protected function _getCreditmemo()
189
- {
190
- $creditmemos = $this->_order->getCreditmemosCollection();
191
-
192
- foreach ($creditmemos as $creditmemo)
193
- if ($creditmemo->getTransactionId() == $this->_receivedData['refund_transaction_id']) {
194
- if ($creditmemo->getState() != Mage_Sales_Model_Order_Creditmemo::STATE_OPEN) {
195
- Mage::helper('barzahlen')->bzLog('controller/ipn: credit memo already refunded / closed', $this->_receivedData);
196
- return false;
197
- }
198
- $this->_creditmemo = $creditmemo;
199
- return true;
200
- }
201
-
202
- Mage::helper('barzahlen')->bzLog('controller/ipn: Unable to find requested creditmemo by refund_transaction_id', $this->_receivedData);
203
- return false;
204
- }
205
-
206
  /**
207
  * Creates the comment for the ipn according to store language.
208
  *
@@ -210,80 +160,7 @@ class ZerebroInternet_Barzahlen_Model_Ipn
210
  */
211
  protected function _createIpnComment()
212
  {
213
- $paymentState = $this->_receivedData['state'];
214
- $message = Mage::helper('barzahlen')->__('bz_frnt_ipn_' . $paymentState);
215
  return $message;
216
  }
217
-
218
- /**
219
- * Performs rollback process when a refund is expired.
220
- */
221
- protected function _rollbackCreditmemo()
222
- {
223
- $this->_rollbackOrderItems();
224
- $this->_rollbackOrderStats();
225
- $this->_setNullforZero();
226
-
227
- $this->_order->getPayment()->cancelCreditmemo($this->_creditmemo);
228
- }
229
-
230
- /**
231
- * Sets back the quantity of the order items after a refund expired. Imitates
232
- * Mage_Sales_Model_Order_Item->cancel() since that function doesn't work the expected way.
233
- * (Magento v.1.6.1.0)
234
- */
235
- protected function _rollbackOrderItems()
236
- {
237
- foreach ($this->_creditmemo->getAllItems() as $item) {
238
- $item->getOrderItem()->setQtyRefunded($item->getOrderItem()->getQtyRefunded() - $item->getQty())->save();
239
- }
240
- $this->_creditmemo->save();
241
- }
242
-
243
- /**
244
- * Sets back order information to the state before the credit memo. Imitates
245
- * Mage_Sales_Model_Order_Creditmemo->cancel() since that function doesn't work the expected way.
246
- * (Magento v.1.6.1.0)
247
- */
248
- protected function _rollbackOrderStats()
249
- {
250
- $this->_order->setTotalOfflineRefunded($this->_order->getTotalOfflineRefunded() - $this->_creditmemo->getGrandTotal());
251
- $this->_order->setBaseTotalOfflineRefunded($this->_order->getBaseTotalOfflineRefunded() - $this->_creditmemo->getBaseGrandTotal());
252
- $this->_order->setTotalRefunded($this->_order->getTotalOfflineRefunded() + $this->_order->getTotalOnlineRefunded());
253
- $this->_order->setBaseTotalRefunded($this->_order->getBaseTotalOfflineRefunded() + $this->_order->getBaseTotalOnlineRefunded());
254
- $this->_order->setBaseSubtotalRefunded($this->_order->getBaseSubtotalRefunded() - $this->_creditmemo->getBaseSubtotal());
255
- $this->_order->setSubtotalRefunded($this->_order->getSubtotalRefunded() - $this->_creditmemo->getSubtotal());
256
- $this->_order->setBaseTaxRefunded($this->_order->getBaseTaxRefunded() - $this->_creditmemo->getBaseTaxAmount());
257
- $this->_order->setTaxRefunded($this->_order->getTaxRefunded() - $this->_creditmemo->getTaxAmount());
258
- $this->_order->setBaseShippingRefunded($this->_order->getBaseShippingRefunded() - $this->_creditmemo->getBaseShippingAmount());
259
- $this->_order->setShippingRefunded($this->_order->getShippingRefunded() - $this->_creditmemo->getShippingAmount());
260
- }
261
-
262
- /**
263
- * Replaces 0 by null to avoid automatic state setting by Mage_Sales_Model_Order after complete
264
- * refund rollback.
265
- */
266
- protected function _setNullforZero()
267
- {
268
- if ($this->_order->getTotalOfflineRefunded() <= 0)
269
- $this->_order->setTotalOfflineRefunded(null);
270
- if ($this->_order->getBaseTotalOfflineRefunded() <= 0)
271
- $this->_order->setBaseTotalOfflineRefunded(null);
272
- if ($this->_order->getTotalOfflineRefunded() <= 0)
273
- $this->_order->setTotalRefunded(null);
274
- if ($this->_order->getBaseTotalOfflineRefunded() <= 0)
275
- $this->_order->setBaseTotalRefunded(null);
276
- if ($this->_order->getBaseSubtotalRefunded() <= 0)
277
- $this->_order->setBaseSubtotalRefunded(null);
278
- if ($this->_order->getSubtotalRefunded() <= 0)
279
- $this->_order->setSubtotalRefunded(null);
280
- if ($this->_order->getBaseTaxRefunded() <= 0)
281
- $this->_order->setBaseTaxRefunded(null);
282
- if ($this->_order->getTaxRefunded() <= 0)
283
- $this->_order->setTaxRefunded(null);
284
- if ($this->_order->getBaseShippingRefunded() <= 0)
285
- $this->_order->setBaseShippingRefunded(null);
286
- if ($this->_order->getShippingRefunded() <= 0)
287
- $this->_order->setShippingRefunded(null);
288
- }
289
  }
1
  <?php
2
  /**
3
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * @category ZerebroInternet
6
  * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
 
8
  * @author Alexander Diebler
9
+ * @author Martin Seener
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
  */
12
 
27
  protected $_order;
28
 
29
  /**
30
+ * Barzahlen payment state possible values
31
  *
32
+ * @var string
33
  */
34
+ const PAYMENTSTATE_PENDING = 'pending';
35
+ const PAYMENTSTATE_PAID = 'paid';
36
+ const PAYMENTSTATE_EXPIRED = 'expired';
37
+ const PAYMENTSTATE_REFUND_PENDING = 'refund_pending';
38
+ const PAYMENTSTATE_REFUND_COMPLETED = 'refund_completed';
39
+ const PAYMENTSTATE_REFUND_EXPIRED = 'refund_expired';
40
 
41
  /**
42
  * Checks received data and validates hash.
45
  * @return TRUE if received get array is valid and hash could be confirmed
46
  * @return FALSE if an error occurred
47
  */
48
+ public function isDataValid($ipnData)
 
49
  {
50
  $barzahlen = Mage::getModel('barzahlen/barzahlen');
51
  $shopId = $barzahlen->getConfigData('shop_id');
74
  $orderId = isset($this->_receivedData['origin_order_id']) ? $this->_receivedData['origin_order_id'] : $this->_receivedData['order_id'];
75
  $this->_order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
76
 
77
+ if ($this->_checkOrderInformation() && $this->_handleStateChange()) {
78
+ $this->_order->save();
79
+ return true;
80
+ } else {
81
+ return false;
82
  }
83
  }
84
 
110
  protected function _handleStateChange()
111
  {
112
  switch ($this->_receivedData['state']) {
113
+ case self::PAYMENTSTATE_PAID:
114
  $this->_processTransactionPaid();
115
  return true;
116
+ case self::PAYMENTSTATE_EXPIRED:
117
  $this->_processTransactionExpired();
118
  return true;
119
+ case self::PAYMENTSTATE_REFUND_COMPLETED:
120
+ case self::PAYMENTSTATE_REFUND_EXPIRED:
 
 
 
121
  return true;
122
  default:
123
  Mage::helper('barzahlen')->bzLog('controller/ipn: Cannot handle payment state', $this->_receivedData);
130
  */
131
  protected function _processTransactionPaid()
132
  {
133
+ if(!$this->_order->canInvoice()) {
134
  return;
135
  }
136
 
137
+ $payment = $this->_order->getPayment();
138
+ $payment->setTransactionId($this->_receivedData['transaction_id'])
139
+ ->setCurrencyCode($this->_receivedData['currency'])
140
+ ->setPreparedMessage($this->_createIpnComment())
141
+ ->setIsTransactionClosed(1)
142
+ ->registerCaptureNotification($this->_receivedData['amount']);
143
  }
144
 
145
  /**
146
+ * Cancels an order after the period for payment elapsed.
147
  */
148
  protected function _processTransactionExpired()
149
  {
150
+ $payment = $this->_order->getPayment();
151
+ $payment->getTransaction($this->_receivedData['transaction_id'])->close();
152
  $this->_order->registerCancellation($this->_createIpnComment(), false)->save();
153
  $this->_order->sendOrderUpdateEmail(true, $this->_createIpnComment());
154
  }
155
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
156
  /**
157
  * Creates the comment for the ipn according to store language.
158
  *
160
  */
161
  protected function _createIpnComment()
162
  {
163
+ $message = Mage::helper('barzahlen')->__('bz_frnt_ipn_' . $this->_receivedData['state']);
 
164
  return $message;
165
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
166
  }
app/code/community/ZerebroInternet/Barzahlen/Model/Observer.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Barzahlen Payment Module for Magento
4
+ *
5
+ * @category ZerebroInternet
6
+ * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
8
+ * @author Alexander Diebler
9
+ * @author Martin Seener
10
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
+ */
12
+
13
+ class ZerebroInternet_Barzahlen_Model_Observer
14
+ {
15
+ public function addGridButtons($observer)
16
+ {
17
+ $block = $observer->getBlock();
18
+ $type = $block->getType();
19
+
20
+ if($type == 'adminhtml/sales_order_view') {
21
+ $order = $block->getOrder();
22
+ $paymentMethod = $order->getPayment()->getMethod();
23
+
24
+ if ($order->getId() && $order->canInvoice() && $paymentMethod == 'barzahlen') {
25
+ $message = Mage::helper('sales')->__('bz_adm_resend_payment_slip_question');
26
+ $block->addButton('payment_slip_resend', array(
27
+ 'label' => Mage::helper('barzahlen')->__('bz_adm_resend_payment_slip'),
28
+ 'onclick' => "confirmSetLocation('{$message}', '{$block->getUrl('barzahlen/resend/payment', array('order_id' => $order->getId()))}')"
29
+ ), 0, 100, 'header');
30
+ }
31
+ } elseif ($type == 'adminhtml/sales_order_creditmemo_view'){
32
+ $creditMemo = $block->getCreditmemo();
33
+ $paymentMethod = $creditMemo->getOrder()->getPayment()->getMethod();
34
+
35
+ if ($creditMemo->getId() && $paymentMethod == 'barzahlen') {
36
+ $message = Mage::helper('sales')->__('bz_adm_resend_refund_slip_question');
37
+ $block->addButton('refund_slip_resend', array(
38
+ 'label' => Mage::helper('barzahlen')->__('bz_adm_resend_refund_slip'),
39
+ 'onclick' => "confirmSetLocation('{$message}', '{$block->getUrl('barzahlen/resend/refund', array('creditmemo_id' => $creditMemo->getId()))}')"
40
+ ), 0, 100, 'header');
41
+ }
42
+ }
43
+ }
44
+
45
+ public function insertInfotext($observer)
46
+ {
47
+ $block = $observer->getBlock();
48
+ $type = $block->getType();
49
+ $session = Mage::getSingleton('checkout/session');
50
+
51
+ if (($type == 'checkout/success' || $type == 'checkout/onepage_success') && $session->getData('barzahlen_infotext')) {
52
+ $child = clone $block;
53
+ $child->setType('barzahlen/success');
54
+ $block->setChild('child', $child);
55
+ $block->setTemplate('barzahlen/success.phtml');
56
+ $block->setData('barzahlen_infotext', $session->getData('barzahlen_infotext', true));
57
+ }
58
+ }
59
+
60
+ /**
61
+ * Checks if a update request is necessary and performs it if so.
62
+ *
63
+ * @param Varien_Event_Observer $observer
64
+ */
65
+ public function checkVersion($observer)
66
+ {
67
+ $user = $observer->getUser();
68
+ $extra = unserialize($user->getExtra());
69
+
70
+ $lastCheck = Mage::getStoreConfig('payment/barzahlen/last_check');
71
+
72
+ if (isset($extra['configState']['payment_barzahlen']) && $extra['configState']['payment_barzahlen'] == 1) {
73
+ if ($lastCheck == null || $lastCheck < strtotime("-1 week")) {
74
+ $config = new Mage_Core_Model_Config();
75
+ $config->saveConfig('payment/barzahlen/last_check', time(), 'default', 0);
76
+ Mage::getConfig()->cleanCache();
77
+
78
+ $barzahlen = Mage::getSingleton('barzahlen/barzahlen');
79
+ $check = Mage::getSingleton('barzahlen/api_version');
80
+ $shopId = $barzahlen->getConfigData('shop_id') != null ? $barzahlen->getConfigData('shop_id') : $barzahlen->getConfigData('shop_id', 1);
81
+ if ($check->isNewVersionAvailable($shopId, 'Magento', Mage::getVersion(), (string) Mage::getConfig()->getNode()->modules->ZerebroInternet_Barzahlen->version)) {
82
+ Mage::getSingleton('core/session')->addNotice(sprintf(Mage::helper('barzahlen')->__('bz_adm_now_available'), $check->getNewPluginVersion(), $check->getNewPluginUrl()));
83
+ }
84
+ }
85
+ }
86
+ }
87
+ }
app/code/community/ZerebroInternet/Barzahlen/Model/Payment.php DELETED
@@ -1,190 +0,0 @@
1
- <?php
2
- /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
- *
15
- * @category ZerebroInternet
16
- * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
- * @author Alexander Diebler
20
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
- */
22
-
23
- class ZerebroInternet_Barzahlen_Model_Payment extends ZerebroInternet_Barzahlen_Model_Barzahlen
24
- {
25
- /**
26
- * Observer action if Barzahlen was choosen as payment method for backend
27
- * order creation.
28
- *
29
- * @param Mage_Sales_Model_Order $order
30
- * @param Mage_Sales_Model_Quote $quote
31
- * @return null
32
- */
33
- public function adminObserver($order, $quote)
34
- {
35
- $order = $order->getOrder();
36
-
37
- if ($order->getPayment()->getMethod() != ZerebroInternet_Barzahlen_Model_Barzahlen::PAYMENT_CODE) {
38
- return;
39
- }
40
-
41
- $payment = $this->_createPayment($order);
42
-
43
- try {
44
- Mage::getSingleton('barzahlen/barzahlen')->getBarzahlenApi()->handleRequest($payment);
45
- } catch (Exception $e) {
46
- Mage::helper('barzahlen')->bzLog($e);
47
- $this->_registerFailure($order);
48
- Mage::throwException(Mage::helper('barzahlen')->__('bz_adm_resend_error'));
49
- }
50
-
51
- if ($payment->isValid()) {
52
- $this->_registerSuccess($order, $payment->getXmlArray(), true);
53
- } else {
54
- $this->_registerFailure($order);
55
- Mage::throwException(Mage::helper('barzahlen')->__('bz_adm_resend_error'));
56
- }
57
- }
58
-
59
- /**
60
- * Performs payment handling and order update.
61
- */
62
- public function getTransactionId()
63
- {
64
- $orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
65
- $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
66
-
67
- if (!$this->_validateOrder($order)) {
68
- return;
69
- }
70
-
71
- $payment = $this->_createPayment($order);
72
-
73
- try {
74
- Mage::getSingleton('barzahlen/barzahlen')->getBarzahlenApi()->handleRequest($payment);
75
- } catch (Exception $e) {
76
- Mage::helper('barzahlen')->bzLog($e);
77
- $this->_registerFailure($order);
78
- throw $e;
79
- }
80
-
81
- if ($payment->isValid()) {
82
- $this->_registerSuccess($order, $payment->getXmlArray());
83
- } else {
84
- $this->_registerFailure($order);
85
- }
86
- }
87
-
88
- /**
89
- * Generates Barzahlen_Payment_Request from order details.
90
- *
91
- * @param Mage_Sales_Model_Order $order
92
- * @return Barzahlen_Request_Payment
93
- */
94
- protected function _createPayment(Mage_Sales_Model_Order $order)
95
- {
96
- $orderAddress = $order->getBillingAddress();
97
- $customerEmail = $order->getCustomerEmail();
98
- $customerStreetNr = $orderAddress->getData("street");
99
- $customerZipcode = $orderAddress->getData("postcode");
100
- $customerCity = $orderAddress->getData("city");
101
- $customerCountry = $orderAddress->getData("country_id");
102
- $amount = Mage::getSingleton('core/store')->roundPrice($order->getGrandTotal(), 2);
103
- $currency = $order->getOrderCurrencyCode();
104
- $payment = Mage::getModel('barzahlen/api_request_payment', array('customerEmail' => $customerEmail, 'customerStreetNr' => $customerStreetNr,
105
- 'customerZipcode' => $customerZipcode, 'customerCity' => $customerCity,
106
- 'customerCountry' => $customerCountry, 'orderId' => $order->getRealOrderId(), 'amount' => $amount, 'currency' => $currency));
107
-
108
- // filter the 3 custom vars and escape them for HTML compliance
109
- $tcHelper = Mage::getModel('core/email_template_filter');
110
- $customVar0 = $tcHelper->filter($this->getConfigData('custom_var_0'));
111
- $customVar1 = $tcHelper->filter($this->getConfigData('custom_var_1'));
112
- $customVar2 = $tcHelper->filter($this->getConfigData('custom_var_2'));
113
- $payment->setCustomVar($customVar0, $customVar1, $customVar2);
114
-
115
- return $payment;
116
- }
117
-
118
- /**
119
- * Validates, that the order exists, Barzahlen was choosen and the order wasn't paid yet.
120
- *
121
- * @param Mage_Sales_Model_Order $order
122
- * @return boolean
123
- */
124
- protected function _validateOrder($order)
125
- {
126
- // check if order exisits
127
- if (!$order->getId()) {
128
- Mage::helper('barzahlen')->bzLog('controllers/checkout: order not existing, aborting/redirecting');
129
- return false;
130
- }
131
-
132
- // get order payment and its information
133
- $payment = $order->getPayment();
134
- $code = $payment->getMethod();
135
- $transactionId = $payment->getAdditionalInformation('transaction_id');
136
-
137
- // check that Barzahlen was choosen
138
- if ($code != self::PAYMENT_CODE) {
139
- $errorData = array($order->getId(), $code);
140
- Mage::helper('barzahlen')->bzLog('controllers/checkout: Barzahlen was not choosen as payment method', $errorData);
141
- return false;
142
- }
143
-
144
- // check that order isn't paid yet and is still payable
145
- if ($transactionId != '' || $order->getState() == Mage_Sales_Model_Order::STATE_CANCELED) {
146
- $errorData = array($order->getId(), $transactionId);
147
- Mage::helper('barzahlen')->bzLog('controllers/checkout: order already got an transaction id', $errorData);
148
- return false;
149
- }
150
-
151
- return true;
152
- }
153
-
154
- /**
155
- * Sets all information for the failure page.
156
- *
157
- * @param Mage_Sales_Model_Order $order
158
- */
159
- protected function _registerFailure($order)
160
- {
161
- $session = Mage::getSingleton('checkout/session');
162
- $session->setResponse('400');
163
- $session->getQuote()->setIsActive(false)->save();
164
-
165
- $errorMsg = Mage::helper('barzahlen')->__('bz_frnt_ipn_denied');
166
- $order->setState(Mage_Sales_Model_Order::STATE_CANCELED, true, $errorMsg);
167
- $order->save();
168
- }
169
-
170
- /**
171
- * Sets all information for the success page.
172
- *
173
- * @param Mage_Sales_Model_Order $order
174
- * @param array $xmlArray array with xml response information
175
- */
176
- protected function _registerSuccess($order, array $xmlArray, $admin = false)
177
- {
178
- $session = Mage::getSingleton('checkout/session');
179
- $session->setResponse('200');
180
- $session->setBzInfotext1($xmlArray['infotext-1']);
181
- $session->getQuote()->setIsActive(false)->save();
182
-
183
- $order->getPayment()->setAdditionalInformation('transaction_id', $xmlArray['transaction-id']);
184
- if (!$admin) {
185
- $order->sendNewOrderEmail();
186
- }
187
- $order->addStatusHistoryComment(Mage::helper('barzahlen')->__('bz_frnt_ipn_pending'), Mage::getModel('barzahlen/barzahlen')->getConfigData('order_status'));
188
- $order->save();
189
- }
190
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/ZerebroInternet/Barzahlen/Model/Refund.php DELETED
@@ -1,70 +0,0 @@
1
- <?php
2
- /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
- *
15
- * @category ZerebroInternet
16
- * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
- * @author Alexander Diebler
20
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
- */
22
-
23
- class ZerebroInternet_Barzahlen_Model_Refund extends Mage_Core_Model_Abstract
24
- {
25
- /**
26
- * Catches the credit memo process and requests a refund by connecting to Barzahlen.
27
- *
28
- * @param Varien_Event_Observer $observer
29
- * @return Varien_Event_Observer with updated data
30
- */
31
- public function refundObserver($observer)
32
- {
33
- $creditmemo = $observer->getEvent()->getcreditmemo();
34
- $order = $creditmemo->getOrder();
35
-
36
- if (!$order->getId()) {
37
- Mage::helper('barzahlen')->bzLog('model/refund: no valid order choosen');
38
- Mage::throwException(Mage::helper('barzahlen')->__('bz_adm_refund_error'));
39
- }
40
-
41
- if ($order->getPayment()->getMethod() != ZerebroInternet_Barzahlen_Model_Barzahlen::PAYMENT_CODE) {
42
- return $observer;
43
- }
44
-
45
- $transactionId = $order->getPayment()->getAdditionalInformation('transaction_id');
46
- $amount = round($creditmemo->getGrandTotal(), 2);
47
- $currency = $order->getOrderCurrencyCode();
48
- $refund = Mage::getModel('barzahlen/api_request_refund', array('transactionId' => $transactionId, 'amount' => $amount, 'currency' => $currency));
49
-
50
- try {
51
- Mage::getSingleton('barzahlen/barzahlen')->getBarzahlenApi()->handleRequest($refund);
52
- } catch (Exception $e) {
53
- Mage::helper('barzahlen')->bzLog($e);
54
- }
55
-
56
- if ($refund->isValid() && $refund->getOriginTransactionId() == $transactionId) {
57
- $creditmemo->setState(Mage_Sales_Model_Order_Creditmemo::STATE_OPEN);
58
- $creditmemo->setTransactionId($refund->getRefundTransactionId());
59
- $creditmemo->addComment(Mage::helper('barzahlen')->__('bz_adm_refund_success'), false, true);
60
- $creditmemo->save();
61
- } elseif ($refund->getOriginTransactionId() != $transactionId) {
62
- Mage::helper('barzahlen')->bzLog('model/refund: refund transaction id doesn\'t match origin transaction id');
63
- Mage::throwException(Mage::helper('barzahlen')->__('bz_adm_refund_error'));
64
- } else {
65
- Mage::throwException(Mage::helper('barzahlen')->__('bz_adm_refund_error'));
66
- }
67
-
68
- return $observer;
69
- }
70
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/ZerebroInternet/Barzahlen/Model/Resend.php DELETED
@@ -1,43 +0,0 @@
1
- <?php
2
- /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
- *
15
- * @category ZerebroInternet
16
- * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
- * @author Alexander Diebler
20
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
- */
22
-
23
- class ZerebroInternet_Barzahlen_Model_Resend extends ZerebroInternet_Barzahlen_Model_Barzahlen
24
- {
25
- /**
26
- * Sends resend request to Barzahlen and returns if request was successful.
27
- *
28
- * @param integer $transactionId Barzahlen Transaction ID
29
- * @return boolean
30
- */
31
- public function resend($transactionId)
32
- {
33
- $resend = Mage::getModel('barzahlen/api_request_resend', array('transactionId' => $transactionId));
34
-
35
- try {
36
- Mage::getSingleton('barzahlen/barzahlen')->getBarzahlenApi()->handleRequest($resend);
37
- } catch (Exception $e) {
38
- Mage::helper('barzahlen')->bzLog($e);
39
- }
40
-
41
- return $resend->isValid();
42
- }
43
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/ZerebroInternet/Barzahlen/Test/Block/Form.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class ZerebroInternet_Barzahlen_Test_Block_Form extends EcomDev_PHPUnit_Test_Case_Controller {
4
+
5
+ /**
6
+ * Sets everything for a new test. parent::setUp() is necessary to enable fixtures.
7
+ */
8
+ public function setUp() {
9
+ parent::setUp();
10
+ }
11
+
12
+ /**
13
+ * Tests that form block is created correctly.
14
+ *
15
+ * @test
16
+ */
17
+ public function testFormBlock() {
18
+ require_once("app/code/community/ZerebroInternet/Barzahlen/Block/Form.php");
19
+ $this->object = new ZerebroInternet_Barzahlen_Block_Form;
20
+ //$this->assertLayoutBlockCreated('payment_form');
21
+ }
22
+
23
+ /**
24
+ * Unset everything before the next test.
25
+ */
26
+ public function tearDown() {
27
+
28
+ unset($this->object);
29
+ parent::tearDown();
30
+ }
31
+ }
app/code/community/ZerebroInternet/Barzahlen/Test/Block/Info.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class ZerebroInternet_Barzahlen_Test_Block_Info extends EcomDev_PHPUnit_Test_Case_Controller {
4
+
5
+ /**
6
+ * Sets everything for a new test. parent::setUp() is necessary to enable fixtures.
7
+ */
8
+ public function setUp() {
9
+ parent::setUp();
10
+ }
11
+
12
+ /**
13
+ * Tests that info block is created correctly.
14
+ *
15
+ * @test
16
+ */
17
+ public function testInfoBlock() {
18
+ require_once("app/code/community/ZerebroInternet/Barzahlen/Block/Info.php");
19
+ $this->object = new ZerebroInternet_Barzahlen_Block_Info;
20
+ //$this->assertLayoutBlockCreated('payment_info');
21
+ }
22
+
23
+ /**
24
+ * Unset everything before the next test.
25
+ */
26
+ public function tearDown() {
27
+
28
+ unset($this->object);
29
+ parent::tearDown();
30
+ }
31
+ }
app/code/community/ZerebroInternet/Barzahlen/Test/Controller/IpnController.php ADDED
@@ -0,0 +1,470 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once("app/code/community/ZerebroInternet/Barzahlen/controllers/IpnController.php");
4
+
5
+ class ZerebroInternet_Barzahlen_IpnController_Mock extends ZerebroInternet_Barzahlen_IpnController {
6
+
7
+ protected $_request;
8
+
9
+ public function __construct() {
10
+ $this->_request = $_GET;
11
+ }
12
+
13
+ public function getRequest() {
14
+ return $this;
15
+ }
16
+
17
+ public function getQuery() {
18
+ return $this->_request;
19
+ }
20
+
21
+ public function returnHeader($code) {
22
+ return null;
23
+ }
24
+ }
25
+
26
+ class ZerebroInternet_Barzahlen_Test_Controller_IpnController extends EcomDev_PHPUnit_Test_Case_Controller {
27
+
28
+ /**
29
+ * Sets everything for a new test. parent::setUp() is necessary to enable fixtures.
30
+ */
31
+ public function setUp() {
32
+ parent::setUp();
33
+ }
34
+
35
+ /**
36
+ * Checks that there are no data changes when a notifiction for a non-existing order is received.
37
+ *
38
+ * @test
39
+ * @loadFixture new_order
40
+ */
41
+ public function testValidPaidAgainstNonExistingOrder() {
42
+
43
+ $_GET = array('state' => 'paid',
44
+ 'transaction_id' => '3',
45
+ 'shop_id' => '1',
46
+ 'customer_email' => 'foo@bar.com',
47
+ 'amount' => '499.95',
48
+ 'currency' => 'EUR',
49
+ 'order_id' => '100000006',
50
+ 'custom_var_0' => 'MainStore',
51
+ 'custom_var_1' => 'Magento',
52
+ 'custom_var_2' => 'Bar zahlen',
53
+ 'hash' => '0d24005c408d8ed76252b8c520cd231b10061031efed6d876975d22495ed67fc5acfe2ffc04171044a87f2151966f03571a8ec07259d82ec1b29acc0f43627ac'
54
+ );
55
+
56
+ $this->object = new ZerebroInternet_Barzahlen_IpnController_Mock;
57
+ $this->object->indexAction();
58
+
59
+ $order = Mage::getModel('sales/order')->loadByIncrementId('100000003');
60
+ $this->assertEquals('new', $order->getState());
61
+ $this->assertEquals('pending', $order->getStatus());
62
+ }
63
+
64
+ /**
65
+ * Checks that there are no state changes when the order isn't connected to the received transaction id.
66
+ *
67
+ * @test
68
+ * @loadFixture new_order
69
+ */
70
+ public function testValidPaidAgainstNonExistingTransaction() {
71
+
72
+ $_GET = array('state' => 'paid',
73
+ 'transaction_id' => '6',
74
+ 'shop_id' => '1',
75
+ 'customer_email' => 'foo@bar.com',
76
+ 'amount' => '499.95',
77
+ 'currency' => 'EUR',
78
+ 'order_id' => '100000003',
79
+ 'custom_var_0' => 'MainStore',
80
+ 'custom_var_1' => 'Magento',
81
+ 'custom_var_2' => 'Bar zahlen',
82
+ 'hash' => 'c58c589dab3b33781aa472cb7c35fabc5c7e9d09550960b6f481402860e0b6b04232c5b6e76e0609d3cf77e76d29ccc03730052781f2378d84dd2fe9133022c2'
83
+ );
84
+
85
+ $this->object = new ZerebroInternet_Barzahlen_IpnController_Mock;
86
+ $this->object->indexAction();
87
+
88
+ $order = Mage::getModel('sales/order')->loadByIncrementId('100000003');
89
+ $this->assertEquals('new', $order->getState());
90
+ $this->assertEquals('pending', $order->getStatus());
91
+ }
92
+
93
+ /**
94
+ * Tests that a paid notification is fullfilled successful.
95
+ *
96
+ * @test
97
+ * @loadFixture new_order
98
+ */
99
+ public function testValidPaidAgainstNewOrder() {
100
+
101
+ $_GET = array('state' => 'paid',
102
+ 'transaction_id' => '3',
103
+ 'shop_id' => '1',
104
+ 'customer_email' => 'foo@bar.com',
105
+ 'amount' => '499.95',
106
+ 'currency' => 'EUR',
107
+ 'order_id' => '100000003',
108
+ 'custom_var_0' => 'MainStore',
109
+ 'custom_var_1' => 'Magento',
110
+ 'custom_var_2' => 'Bar zahlen',
111
+ 'hash' => '6a227d559521476b024468c181923e9af7d146d14f435ecd9d02bb87c95f8b21f81dcd6128f717f894c927c820a6d6e8841f52005397924ea8bd23d76eda7274'
112
+ );
113
+
114
+ $this->object = new ZerebroInternet_Barzahlen_IpnController_Mock;
115
+ $this->object->indexAction();
116
+
117
+ $order = Mage::getModel('sales/order')->loadByIncrementId('100000003');
118
+ $this->assertEquals('processing', $order->getState());
119
+ $this->assertEquals('processing', $order->getStatus());
120
+ }
121
+
122
+ /**
123
+ * Checks that a paid order can't be paid again.
124
+ *
125
+ * @test
126
+ * @loadFixture paid_order
127
+ */
128
+ public function testValidPaidAgainstPaidOrder() {
129
+
130
+ $_GET = array('state' => 'paid',
131
+ 'transaction_id' => '4',
132
+ 'shop_id' => '1',
133
+ 'customer_email' => 'foo@bar.com',
134
+ 'amount' => '499.95',
135
+ 'currency' => 'EUR',
136
+ 'order_id' => '100000004',
137
+ 'custom_var_0' => 'MainStore',
138
+ 'custom_var_1' => 'Magento',
139
+ 'custom_var_2' => 'Bar zahlen',
140
+ 'hash' => '326a2a0d56bb67d2c87a7daa32104c468d71725fad360051b028774989f78dac5a801a5e0458f32095fa6831967b637b40d2184f4ff10a18dccd3080f6fb0917'
141
+ );
142
+
143
+ $this->object = new ZerebroInternet_Barzahlen_IpnController_Mock;
144
+ $this->object->indexAction();
145
+
146
+ $order = Mage::getModel('sales/order')->loadByIncrementId('100000004');
147
+ $this->assertEquals('processing', $order->getState());
148
+ $this->assertEquals('processing', $order->getStatus());
149
+ }
150
+
151
+ /**
152
+ * Tests that a notification isn't accepted when transaction id is no numeric value.
153
+ *
154
+ * @test
155
+ * @loadFixture new_order
156
+ */
157
+ public function testInvalidPaidAgainstNewOrderGetFail() {
158
+
159
+ $_GET = array('state' => 'expired',
160
+ 'transaction-id' => '<hack>3</hack>',
161
+ 'shop_id' => '1',
162
+ 'customer_email' => 'foo@bar.com',
163
+ 'amount' => '499.95',
164
+ 'currency' => 'EUR',
165
+ 'order_id' => '100000003',
166
+ 'custom_var_0' => 'MainStore',
167
+ 'custom_var_1' => 'Magento',
168
+ 'custom_var_2' => 'Bar zahlen',
169
+ 'hash' => '59030ebeb4d860ce52b4a7eb4ec39adebceffe3ccbab81ff7caccfbdbf47ea13f6bd5c66417f3cac50fff9f9ef7dac8d2515e87cea9d07df3145c6792c02017b'
170
+ );
171
+
172
+ $this->object = new ZerebroInternet_Barzahlen_IpnController_Mock;
173
+ $this->object->indexAction();
174
+
175
+ $order = Mage::getModel('sales/order')->loadByIncrementId('100000003');
176
+ $this->assertEquals('new', $order->getState());
177
+ $this->assertEquals('pending', $order->getStatus());
178
+ }
179
+
180
+ /**
181
+ * Checks that a notification with an invalid hash is declined.
182
+ *
183
+ * @test
184
+ * @loadFixture new_order
185
+ */
186
+ public function testInvalidPaidAgainstNewOrderHashFail() {
187
+
188
+ $_GET = array('state' => 'expired',
189
+ 'transaction_id' => '3',
190
+ 'shop_id' => '1',
191
+ 'customer_email' => 'foo@bar.com',
192
+ 'amount' => '499.95',
193
+ 'currency' => 'EUR',
194
+ 'order_id' => '100000003',
195
+ 'custom_var_0' => 'MainStore',
196
+ 'custom_var_1' => 'Magento',
197
+ 'custom_var_2' => 'Bar zahlen',
198
+ 'hash' => '59030ebeb4d860ce52b4a7eb4ec39adebceffe3ccbab81ff7caccfbdbf47ea13f6bd5c66417f3cac50fff9f9ef7dac8d2515e87cea9d07df3145c6792c02017b'
199
+ );
200
+
201
+ $this->object = new ZerebroInternet_Barzahlen_IpnController_Mock;
202
+ $this->object->indexAction();
203
+
204
+ $order = Mage::getModel('sales/order')->loadByIncrementId('100000003');
205
+ $this->assertEquals('new', $order->getState());
206
+ $this->assertEquals('pending', $order->getStatus());
207
+ }
208
+
209
+ /**
210
+ * Tests that undefined notification states are rejected.
211
+ *
212
+ * @test
213
+ * @loadFixture new_order
214
+ */
215
+ public function testInvalidStateAgainstNewOrder() {
216
+
217
+ $_GET = array('state' => 'paid_expired',
218
+ 'transaction_id' => '3',
219
+ 'shop_id' => '1',
220
+ 'customer_email' => 'foo@bar.com',
221
+ 'amount' => '499.95',
222
+ 'currency' => 'EUR',
223
+ 'order_id' => '100000003',
224
+ 'custom_var_0' => 'MainStore',
225
+ 'custom_var_1' => 'Magento',
226
+ 'custom_var_2' => 'Bar zahlen',
227
+ 'hash' => '4f4ca47bbc55cefe33aaf4a476cc87bad9288f923cd48c2c4b7083f2246d50fd4d99c823780db1c09763e8f088b6c5982522159a8a07ddce2f3fcb7d30861401'
228
+ );
229
+
230
+ $this->object = new ZerebroInternet_Barzahlen_IpnController_Mock;
231
+ $this->object->indexAction();
232
+
233
+ $order = Mage::getModel('sales/order')->loadByIncrementId('100000003');
234
+ $this->assertEquals('new', $order->getState());
235
+ $this->assertEquals('pending', $order->getStatus());
236
+ }
237
+
238
+ /**
239
+ * Checks that a valid expired notification is procceded correctly.
240
+ *
241
+ * @test
242
+ * @loadFixture new_order
243
+ */
244
+ public function testValidExpiredAgainstNewOrder() {
245
+
246
+ $_GET = array('state' => 'expired',
247
+ 'transaction_id' => '3',
248
+ 'shop_id' => '1',
249
+ 'customer_email' => 'foo@bar.com',
250
+ 'amount' => '499.95',
251
+ 'currency' => 'EUR',
252
+ 'order_id' => '100000003',
253
+ 'custom_var_0' => 'MainStore',
254
+ 'custom_var_1' => 'Magento',
255
+ 'custom_var_2' => 'Bar zahlen',
256
+ 'hash' => '5f903f1732e84e42169b92014066b2caf09669ae1cc445efcd79552d43640302756ebc84cf70745513217569ff45baacb952acf9be0e4418e99d55085d5b6090'
257
+ );
258
+
259
+ $create = $this->getModelMock('sales/order', array('registerCancellation'));
260
+ $create->expects($this->once())
261
+ ->method('registerCancellation')
262
+ ->will($this->returnCallback(array($this, 'cancelHelper')));
263
+ $this->replaceByMock('model','sales/order',$create);
264
+
265
+ $this->object = new ZerebroInternet_Barzahlen_IpnController_Mock;
266
+ $this->object->indexAction();
267
+
268
+ $order = Mage::getModel('sales/order')->loadByIncrementId('100000003');
269
+ $this->assertEquals('canceled', $order->getState());
270
+ $this->assertEquals('canceled', $order->getStatus());
271
+ }
272
+
273
+ /**
274
+ * Tests that a valid refund_completed notification is performed correctly.
275
+ *
276
+ * @test
277
+ * @loadFixture refunded_order
278
+ */
279
+ public function testValidRefundCompletedAgainstPaidOrder() {
280
+
281
+ $_GET = array('state' => 'refund_completed',
282
+ 'refund_transaction_id' => '5',
283
+ 'origin_transaction_id' => '5',
284
+ 'shop_id' => '1',
285
+ 'customer_email' => 'foo@bar.com',
286
+ 'amount' => '499.95',
287
+ 'currency' => 'EUR',
288
+ 'origin_order_id' => '100000005',
289
+ 'custom_var_0' => 'MainStore',
290
+ 'custom_var_1' => 'Magento',
291
+ 'custom_var_2' => 'Bar zahlen',
292
+ 'hash' => '8b9c0b9038a727fff303ce4c394e313a2d890da4cd1f2970456760887b6c1f11ba43ce43d1242d9adc3c1cf92633f1377b7a81832eb16e825977b5f1d2550d1b'
293
+ );
294
+
295
+ $this->object = new ZerebroInternet_Barzahlen_IpnController_Mock;
296
+ $this->object->indexAction();
297
+
298
+ $order = Mage::getModel('sales/order')->loadByIncrementId('100000005');
299
+ $this->assertEquals('closed', $order->getState());
300
+ $this->assertEquals('closed', $order->getStatus());
301
+
302
+ $collection = Mage::getResourceModel('sales/order_creditmemo_collection')
303
+ ->addAttributeToFilter('order_id', array('eq' => $order->getEntityId()))
304
+ ->addAttributeToSelect('*');
305
+ foreach ($collection as $cm) {
306
+ $creditmemo = $cm;
307
+ }
308
+ $this->assertEquals('2', $creditmemo->getState());
309
+ }
310
+
311
+ /**
312
+ * Tests that a valid refund_expired notification is performed correctly.
313
+ *
314
+ * @test
315
+ * @loadFixture refunded_order
316
+ */
317
+ public function testValidRefundExpiredAgainstPaidOrder() {
318
+
319
+ $_GET = array('state' => 'refund_expired',
320
+ 'refund_transaction_id' => '5',
321
+ 'origin_transaction_id' => '5',
322
+ 'shop_id' => '1',
323
+ 'customer_email' => 'foo@bar.com',
324
+ 'amount' => '499.95',
325
+ 'currency' => 'EUR',
326
+ 'origin_order_id' => '100000005',
327
+ 'custom_var_0' => 'MainStore',
328
+ 'custom_var_1' => 'Magento',
329
+ 'custom_var_2' => 'Bar zahlen',
330
+ 'hash' => '7230f941a9eda8e44067015b8719382285e5ac1e6523d759d317642b4b655c735f9de0089d45db57a5ab330d6160624711307ed2d005db54f012e88c875f4873'
331
+ );
332
+
333
+ $this->object = new ZerebroInternet_Barzahlen_IpnController_Mock;
334
+ $this->object->indexAction();
335
+
336
+ $order = Mage::getModel('sales/order')->loadByIncrementId('100000005');
337
+ $this->assertEquals('closed', $order->getState());
338
+ $this->assertEquals('closed', $order->getstate());
339
+
340
+ $collection = Mage::getResourceModel('sales/order_creditmemo_collection')
341
+ ->addAttributeToFilter('order_id', array('eq' => $order->getEntityId()))
342
+ ->addAttributeToSelect('*');
343
+ foreach ($collection as $cm) {
344
+ $creditmemo = $cm;
345
+ }
346
+ $this->assertEquals('2', $creditmemo->getState());
347
+ }
348
+
349
+ /**
350
+ * Tests that a valid refund_expired notification fails at already completed refund.
351
+ *
352
+ * @test
353
+ * @loadFixture successful_refunded_order
354
+ */
355
+ public function testValidRefundExpiredAgainstCompletedRefund() {
356
+
357
+ $_GET = array('state' => 'refund_expired',
358
+ 'refund_transaction_id' => '5',
359
+ 'origin_transaction_id' => '5',
360
+ 'shop_id' => '1',
361
+ 'customer_email' => 'foo@bar.com',
362
+ 'amount' => '499.95',
363
+ 'currency' => 'EUR',
364
+ 'origin_order_id' => '100000005',
365
+ 'custom_var_0' => 'MainStore',
366
+ 'custom_var_1' => 'Magento',
367
+ 'custom_var_2' => 'Bar zahlen',
368
+ 'hash' => '7230f941a9eda8e44067015b8719382285e5ac1e6523d759d317642b4b655c735f9de0089d45db57a5ab330d6160624711307ed2d005db54f012e88c875f4873'
369
+ );
370
+
371
+ $this->object = new ZerebroInternet_Barzahlen_IpnController_Mock;
372
+ $this->object->indexAction();
373
+
374
+ $order = Mage::getModel('sales/order')->loadByIncrementId('100000005');
375
+ $this->assertEquals('closed', $order->getState());
376
+ $this->assertEquals('closed', $order->getstate());
377
+
378
+ $collection = Mage::getResourceModel('sales/order_creditmemo_collection')
379
+ ->addAttributeToFilter('order_id', array('eq' => $order->getEntityId()))
380
+ ->addAttributeToSelect('*');
381
+ foreach ($collection as $cm) {
382
+ $creditmemo = $cm;
383
+ }
384
+ $this->assertEquals('2', $creditmemo->getState());
385
+ }
386
+
387
+ /**
388
+ * Checks that a refund notification with an invalid refund_transaction_id is rejected.
389
+ *
390
+ * @test
391
+ * @loadFixture refunded_order
392
+ */
393
+ public function testValidRefundCompletedAgainstNonExistingRefundId() {
394
+
395
+ $_GET = array('state' => 'refund_completed',
396
+ 'refund_transaction_id' => '6',
397
+ 'origin_transaction_id' => '5',
398
+ 'shop_id' => '1',
399
+ 'customer_email' => 'foo@bar.com',
400
+ 'amount' => '499.95',
401
+ 'currency' => 'EUR',
402
+ 'origin_order_id' => '100000005',
403
+ 'custom_var_0' => 'MainStore',
404
+ 'custom_var_1' => 'Magento',
405
+ 'custom_var_2' => 'Bar zahlen',
406
+ 'hash' => '640a007a308b40abea98808a09e6e0aa66b9e20b93356719a2f777e9472122ace37846ba9c1c244587b7548dfb135da42e056c91784aec1f1ecae39d63d71b46'
407
+ );
408
+
409
+ $this->object = new ZerebroInternet_Barzahlen_IpnController_Mock;
410
+ $this->object->indexAction();
411
+
412
+ $order = Mage::getModel('sales/order')->loadByIncrementId('100000005');
413
+ $this->assertEquals('closed', $order->getState());
414
+ $this->assertEquals('closed', $order->getStatus());
415
+
416
+ $collection = Mage::getResourceModel('sales/order_creditmemo_collection')
417
+ ->addAttributeToFilter('order_id', array('eq' => $order->getEntityId()))
418
+ ->addAttributeToSelect('*');
419
+ foreach ($collection as $cm) {
420
+ $creditmemo = $cm;
421
+ }
422
+ $this->assertEquals('2', $creditmemo->getState());
423
+ }
424
+
425
+ /**
426
+ * Checks that exceptions doesn't lead to an abort.
427
+ *
428
+ * @test
429
+ * @loadFixture new_order
430
+ */
431
+ public function testIpnExceptionHandling() {
432
+
433
+ $create = $this->getModelMock('barzahlen/ipn', array('isDataValid'));
434
+ $create->expects($this->once())
435
+ ->method('isDataValid')
436
+ ->will($this->throwException(new Mage_Core_Exception('An error occurred.')));
437
+ $this->replaceByMock('model','barzahlen/ipn',$create);
438
+
439
+ $this->object = new ZerebroInternet_Barzahlen_IpnController_Mock;
440
+ $this->object->indexAction();
441
+ }
442
+
443
+ /**
444
+ * Imitates invoice creation.
445
+ */
446
+ function invoiceHelper() {
447
+ $order = Mage::getModel('sales/order')->loadByIncrementId('100000003');
448
+ $order->setState('processing', true)->save();
449
+ return $order;
450
+ }
451
+
452
+ /**
453
+ * Imitates order cancellation.
454
+ */
455
+ function cancelHelper() {
456
+ $order = Mage::getModel('sales/order')->loadByIncrementId('100000003');
457
+ $order->setState('canceled', 'canceled')->save();
458
+ return $order;
459
+ }
460
+
461
+ /**
462
+ * Unset everything before the next test.
463
+ */
464
+ public function tearDown() {
465
+
466
+ unset($this->object);
467
+ parent::tearDown();
468
+ }
469
+ }
470
+ ?>
app/code/community/ZerebroInternet/Barzahlen/Test/Controller/IpnController/fixtures/new_order.yaml ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ config:
2
+ default/payment/barzahlen/title: Barzahlen (Pay Cash Online)
3
+ default/payment/barzahlen/sandbox: 0
4
+ default/payment/barzahlen/sort_order: 1
5
+ default/payment/barzahlen/active: 1
6
+ default/payment/barzahlen/debug: 1
7
+ default/payment/barzahlen/allowspecific: 1
8
+ default/payment/barzahlen/specificcountry: DE
9
+ default/payment/barzahlen/max_order_total: 1000
10
+ default/payment/barzahlen/shop_id: 1
11
+ default/payment/barzahlen/payment_key: da49244dda9da8158f94134ba26a3ed258bde622
12
+ default/payment/barzahlen/notification_key: 3a25aea969b8768b034e81a64c4812136deab059
13
+ default/payment/barzahlen/custom_var_0: "{{store url=""}}&foo=2"
14
+ default/payment/barzahlen/custom_var_1: Magento 1.6.1.0
15
+ default/payment/barzahlen/custom_var_2: Connect Package 2.0 v.0.9.3-1
16
+ tables:
17
+ sales/order:
18
+ - entity_id: 3
19
+ state: new
20
+ status: pending
21
+ coupon_code: NULL
22
+ protect_code: 2c8edc
23
+ shipping-description: Flat Rate - Fixed
24
+ is_virtual: 0
25
+ store_id: 1
26
+ base_grand_total: 499.95
27
+ base_shipping_amount: 30.00
28
+ base_subtotal: 469.95
29
+ base_to_global_rate: 1
30
+ base_to_order_rate: 1
31
+ discount_amount: 0
32
+ grand_total: 499.95
33
+ shipping_amount: 30.00
34
+ store_to_base_rate: 1
35
+ store_to_order_rate: 1
36
+ subtotal: 469.95
37
+ total_paid: 0
38
+ total_qty_ordered: 6
39
+ customer_is_guest: 0
40
+ customer_note_notify: 1
41
+ billing_address_id: 1
42
+ customer_group_id: 1
43
+ email_sent: 1
44
+ quote_id: 1
45
+ shipping_address_id: 1
46
+ base_subtotal_incl_tax: 469.95
47
+ base_total_due: 499.95
48
+ subtotal_incl_tax: 469.95
49
+ total_due: 499.95
50
+ weight: 18
51
+ increment_id: 100000003
52
+ base_currency_code: EUR
53
+ customer_email: foo@bar.com
54
+ customer_firstname: Max
55
+ customer_lastname: Mustermann
56
+ global_currency_code: EUR
57
+ order_currency_code: EUR
58
+ remote_ip: 192.168.1.1
59
+ shipping_method: flatrate_flatrate
60
+ store_currency_code: EUR
61
+ store_name: Main Website Main Store English
62
+ created_at: 2012-04-01 14:00:00
63
+ updated_at: 2012-04-01 14:00:10
64
+ total_item_count: 6
65
+ shipping_incl_tax: 30
66
+ base_shipping_incl_tax: 30
67
+ sales/order_payment:
68
+ - entity_id: 3
69
+ parent_id: 3
70
+ base_shipping_amount: 30
71
+ shipping_amount: 30
72
+ base_amount_ordered: 499.95
73
+ amount_ordered: 499.95
74
+ method: barzahlen
75
+ additional_information: "a:1:{s:14:"transaction_id";s:1:"3";}"
76
+ sales/order_item:
77
+ - item_id: 3
78
+ order_id: 3
79
+ qty_canceled: 0
80
+ qty_invoiced: 0
81
+ qty_ordered: 6
82
+ qty_refunded: 0
83
+ qty_shipped: 0
84
+ sales/payment_transaction:
85
+ - transaction_id: 3
86
+ order_id: 3
87
+ payment_id: 3
88
+ txn_id: 3
89
+ txn_type: order
90
+ is_closed: 0
91
+ created_at: 2012-04-01 14:00:00
app/code/community/ZerebroInternet/Barzahlen/Test/Controller/IpnController/fixtures/paid_order.yaml ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ config:
2
+ default/payment/barzahlen/title: Barzahlen (Pay Cash Online)
3
+ default/payment/barzahlen/sandbox: 0
4
+ default/payment/barzahlen/sort_order: 1
5
+ default/payment/barzahlen/active: 1
6
+ default/payment/barzahlen/debug: 1
7
+ default/payment/barzahlen/allowspecific: 1
8
+ default/payment/barzahlen/specificcountry: DE
9
+ default/payment/barzahlen/max_order_total: 1000
10
+ default/payment/barzahlen/shop_id: 1
11
+ default/payment/barzahlen/payment_key: da49244dda9da8158f94134ba26a3ed258bde622
12
+ default/payment/barzahlen/notification_key: 3a25aea969b8768b034e81a64c4812136deab059
13
+ default/payment/barzahlen/custom_var_0: "{{store url=""}}&foo=2"
14
+ default/payment/barzahlen/custom_var_1: Magento 1.6.1.0
15
+ default/payment/barzahlen/custom_var_2: Connect Package 2.0 v.0.9.3-1
16
+ tables:
17
+ sales/order:
18
+ - entity_id: 4
19
+ state: processing
20
+ status: processing
21
+ coupon_code: NULL
22
+ protect_code: 2c8edc
23
+ shipping-description: Flat Rate - Fixed
24
+ is_virtual: 0
25
+ store_id: 1
26
+ base_grand_total: 499.95
27
+ base_shipping_amount: 30.00
28
+ base_shipping_invoiced: 30.00
29
+ base_subtotal: 469.95
30
+ base_subtotal_invoiced: 469.95
31
+ base_to_global_rate: 1
32
+ base_to_order_rate: 1
33
+ base_total_invoiced: 499.95
34
+ base_total_invoiced_cost: 99.95
35
+ base_total_paid: 499.95
36
+ discount_amount: 0
37
+ grand_total: 499.95
38
+ shipping_amount: 30.00
39
+ shipping_invoiced: 30.00
40
+ store_to_base_rate: 1
41
+ store_to_order_rate: 1
42
+ subtotal: 469.95
43
+ subtotal_invoiced: 469.95
44
+ total_invoiced: 499.95
45
+ total_paid: 499.95
46
+ total_qty_ordered: 6
47
+ customer_is_guest: 0
48
+ customer_note_notify: 1
49
+ billing_address_id: 1
50
+ customer_group_id: 1
51
+ email_sent: 1
52
+ quote_id: 1
53
+ shipping_address_id: 1
54
+ base_subtotal_incl_tax: 469.95
55
+ base_total_due: 0
56
+ subtotal_incl_tax: 469.95
57
+ total_due: 0
58
+ weight: 18
59
+ increment_id: 100000004
60
+ base_currency_code: EUR
61
+ customer_email: foo@bar.com
62
+ customer_firstname: Max
63
+ customer_lastname: Mustermann
64
+ global_currency_code: EUR
65
+ order_currency_code: EUR
66
+ remote_ip: 192.168.1.1
67
+ shipping_method: flatrate_flatrate
68
+ store_currency_code: EUR
69
+ store_name: Main Website Main Store English
70
+ created_at: 2012-04-01 14:00:00
71
+ updated_at: 2012-04-02 14:00:00
72
+ total_item_count: 6
73
+ shipping_incl_tax: 30
74
+ base_shipping_incl_tax: 30
75
+ sales/order_payment:
76
+ - entity_id: 4
77
+ parent_id: 4
78
+ base_shipping_captured: 30
79
+ shipping_captured: 30
80
+ base_amount_paid: 499.95
81
+ base_shipping_amount: 30
82
+ shipping_amount: 30
83
+ amount_paid: 499.95
84
+ base_amount_ordered: 499.95
85
+ amount_ordered: 499.95
86
+ method: barzahlen
87
+ additional_information: "a:1:{s:14:"transaction_id";s:1:"4";}"
88
+ sales/order_item:
89
+ - item_id: 4
90
+ order_id: 4
91
+ qty_canceled: 0
92
+ qty_invoiced: 6
93
+ qty_ordered: 6
94
+ qty_refunded: 0
95
+ qty_shipped: 0
96
+ sales/payment_transaction:
97
+ - transaction_id: 4
98
+ order_id: 4
99
+ payment_id: 4
100
+ txn_id: 4
101
+ txn_type: order
102
+ is_closed: 1
103
+ created_at: 2012-04-01 14:00:00
app/code/community/ZerebroInternet/Barzahlen/Test/Controller/IpnController/fixtures/refunded_order.yaml ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ config:
2
+ default/payment/barzahlen/title: Barzahlen (Pay Cash Online)
3
+ default/payment/barzahlen/sandbox: 0
4
+ default/payment/barzahlen/sort_order: 1
5
+ default/payment/barzahlen/active: 1
6
+ default/payment/barzahlen/debug: 1
7
+ default/payment/barzahlen/allowspecific: 1
8
+ default/payment/barzahlen/specificcountry: DE
9
+ default/payment/barzahlen/max_order_total: 1000
10
+ default/payment/barzahlen/shop_id: 1
11
+ default/payment/barzahlen/payment_key: da49244dda9da8158f94134ba26a3ed258bde622
12
+ default/payment/barzahlen/notification_key: 3a25aea969b8768b034e81a64c4812136deab059
13
+ default/payment/barzahlen/custom_var_0: "{{store url=""}}&foo=2"
14
+ default/payment/barzahlen/custom_var_1: Magento 1.6.1.0
15
+ default/payment/barzahlen/custom_var_2: Connect Package 2.0 v.0.9.3-1
16
+ tables:
17
+ sales/order:
18
+ - entity_id: 5
19
+ state: closed
20
+ status: closed
21
+ coupon_code: NULL
22
+ protect_code: 2c8edc
23
+ shipping-description: Flat Rate - Fixed
24
+ is_virtual: 0
25
+ store_id: 1
26
+ base_grand_total: 499.95
27
+ base_shipping_amount: 30.00
28
+ base_shipping_invoiced: 30.00
29
+ base_shipping_refunded: 30.00
30
+ base_subtotal: 469.95
31
+ base_subtotal_invoiced: 469.95
32
+ base_subtotal_refunded: 469.95
33
+ base_to_global_rate: 1
34
+ base_to_order_rate: 1
35
+ base_total_invoiced: 499.95
36
+ base_total_invoiced_cost: 99.95
37
+ base_total_offline_refunded: 499.95
38
+ base_total_paid: 499.95
39
+ base_total_refunded: 499.95
40
+ discount_amount: 0
41
+ grand_total: 499.95
42
+ shipping_amount: 30.00
43
+ shipping_invoiced: 30.00
44
+ shipping_refunded: 30.00
45
+ store_to_base_rate: 1
46
+ store_to_order_rate: 1
47
+ subtotal: 469.95
48
+ subtotal_invoiced: 469.95
49
+ subtotal_refunded: 469.95
50
+ total_invoiced: 499.95
51
+ total_offline_refunded: 499.95
52
+ total_paid: 499.95
53
+ total_qty_ordered: 6
54
+ total_refunded: 499.95
55
+ customer_is_guest: 0
56
+ customer_note_notify: 1
57
+ billing_address_id: 1
58
+ customer_group_id: 1
59
+ email_sent: 1
60
+ quote_id: 1
61
+ shipping_address_id: 1
62
+ base_subtotal_incl_tax: 469.95
63
+ base_total_due: 0
64
+ subtotal_incl_tax: 469.95
65
+ total_due: 0
66
+ weight: 18
67
+ increment_id: 100000005
68
+ base_currency_code: EUR
69
+ customer_email: foo@bar.com
70
+ customer_firstname: Max
71
+ customer_lastname: Mustermann
72
+ global_currency_code: EUR
73
+ order_currency_code: EUR
74
+ remote_ip: 192.168.1.1
75
+ shipping_method: flatrate_flatrate
76
+ store_currency_code: EUR
77
+ store_name: Main Website Main Store English
78
+ created_at: 2012-04-01 14:00:00
79
+ updated_at: 2012-04-03 14:00:00
80
+ total_item_count: 6
81
+ shipping_incl_tax: 30
82
+ base_shipping_incl_tax: 30
83
+ sales/order_payment:
84
+ - entity_id: 5
85
+ parent_id: 5
86
+ base_shipping_captured: 30
87
+ shipping_captured: 30
88
+ amount_refunded: 499.95
89
+ base_amount_paid: 499.95
90
+ base_shipping_amount: 30
91
+ shipping_amount: 30
92
+ amount_paid: 499.95
93
+ base_amount_ordered: 499.95
94
+ base_shipping_refunded: 30
95
+ shipping_refunded: 30
96
+ base_amount_refunded: 499.95
97
+ amount_ordered: 499.95
98
+ method: barzahlen
99
+ additional_information: "a:1:{s:14:"transaction_id";s:1:"5";}"
100
+ sales/order_item:
101
+ - item_id: 5
102
+ order_id: 5
103
+ qty_canceled: 0
104
+ qty_invoiced: 6
105
+ qty_ordered: 6
106
+ qty_refunded: 6
107
+ qty_shipped: 6
108
+ sales/creditmemo:
109
+ - entity_id: 5
110
+ store_id: 1
111
+ store_to_order_rate: 1
112
+ base_to_order_rate: 1
113
+ grand_total: 499.95
114
+ base_subtotal_incl_tax: 469.95
115
+ shipping_amount: 30
116
+ subtotal_incl_tax: 469.95
117
+ base_shipping_amount: 30
118
+ store_to_base_rate: 1
119
+ base_to_global_rate: 1
120
+ base_subtotal: 469.95
121
+ subtotal: 469.95
122
+ base_grand_total: 499.95
123
+ order_id: 5
124
+ state: 2
125
+ shipping_address_id: 1
126
+ billing_address_id: 1
127
+ store_currency_code: EUR
128
+ order_currency_code: EUR
129
+ base_currency_code: EUR
130
+ global_currency_code: EUR
131
+ transaction_id: 5
132
+ increment_id: 100000005
133
+ created_at: 2012-04-03 14:00:00
134
+ updated_at: 2012-04-03 14:00:10
135
+ shipping_incl_tax: 30
136
+ base_shipping_incl_tax: 30
137
+ sales/creditmemo_grid:
138
+ - entity_id: 5
139
+ store_id: 1
140
+ store_to_order_rate: 1
141
+ base_to_order_rate: 1
142
+ grand_total: 499.95
143
+ store_to_base_rate: 1
144
+ base_to_global_rate: 1
145
+ base_grand_total: 499.95
146
+ order_id: 5
147
+ state: 1
148
+ store_currency_code: EUR
149
+ order_currency_code: EUR
150
+ base_currency_code: EUR
151
+ global_currency_code: EUR
152
+ increment_id: 100000005
153
+ order_increment_id: 100000005
154
+ created_at: 2012-04-03 14:00:00
155
+ updated_at: 2012-04-03 14:00:10
156
+ billing_name: Max Mustermann
157
+ sales/creditmemo_item:
158
+ - entity_id: 5
159
+ parent_id: 5
160
+ base_price: 80
161
+ base_row_total: 469.95
162
+ row_total: 469.95
163
+ price_incl_tax: 80
164
+ base_price_incl_tax: 80
165
+ qty: 6
166
+ base_cost: 29.99
167
+ price: 80
168
+ base_row_total_incl_tax: 469.95
169
+ row_total_incl_tax: 469.95
170
+ product_id: 1
171
+ order_item_id: 5
172
+ weee_tax_applied: "a:0:{}"
173
+ sku: asc_10
174
+ sales/payment_transaction:
175
+ - transaction_id: 5
176
+ order_id: 5
177
+ payment_id: 5
178
+ txn_id: 5
179
+ txn_type: order
180
+ is_closed: 1
181
+ created_at: 2012-04-01 14:00:00
182
+ - transaction_id: 6
183
+ parent_id: 5
184
+ order_id: 5
185
+ payment_id: 5
186
+ txn_id: 6
187
+ parent_txn_id: 5
188
+ txn_type: refund
189
+ is_closed: 0
190
+ created_at: 2012-04-02 14:00:00
app/code/community/ZerebroInternet/Barzahlen/Test/Controller/IpnController/fixtures/successful_refunded_order.yaml ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ config:
2
+ default/payment/barzahlen/title: Barzahlen (Pay Cash Online)
3
+ default/payment/barzahlen/sandbox: 0
4
+ default/payment/barzahlen/sort_order: 1
5
+ default/payment/barzahlen/active: 1
6
+ default/payment/barzahlen/debug: 1
7
+ default/payment/barzahlen/allowspecific: 1
8
+ default/payment/barzahlen/specificcountry: DE
9
+ default/payment/barzahlen/max_order_total: 1000
10
+ default/payment/barzahlen/shop_id: 1
11
+ default/payment/barzahlen/payment_key: da49244dda9da8158f94134ba26a3ed258bde622
12
+ default/payment/barzahlen/notification_key: 3a25aea969b8768b034e81a64c4812136deab059
13
+ default/payment/barzahlen/custom_var_0: "{{store url=""}}&foo=2"
14
+ default/payment/barzahlen/custom_var_1: Magento 1.6.1.0
15
+ default/payment/barzahlen/custom_var_2: Connect Package 2.0 v.0.9.3-1
16
+ tables:
17
+ sales/order:
18
+ - entity_id: 5
19
+ state: closed
20
+ status: closed
21
+ coupon_code: NULL
22
+ protect_code: 2c8edc
23
+ shipping-description: Flat Rate - Fixed
24
+ is_virtual: 0
25
+ store_id: 1
26
+ base_grand_total: 499.95
27
+ base_shipping_amount: 30.00
28
+ base_shipping_invoiced: 30.00
29
+ base_shipping_refunded: 30.00
30
+ base_subtotal: 469.95
31
+ base_subtotal_invoiced: 469.95
32
+ base_subtotal_refunded: 469.95
33
+ base_to_global_rate: 1
34
+ base_to_order_rate: 1
35
+ base_total_invoiced: 499.95
36
+ base_total_invoiced_cost: 99.95
37
+ base_total_offline_refunded: 499.95
38
+ base_total_paid: 499.95
39
+ base_total_refunded: 499.95
40
+ discount_amount: 0
41
+ grand_total: 499.95
42
+ shipping_amount: 30.00
43
+ shipping_invoiced: 30.00
44
+ shipping_refunded: 30.00
45
+ store_to_base_rate: 1
46
+ store_to_order_rate: 1
47
+ subtotal: 469.95
48
+ subtotal_invoiced: 469.95
49
+ subtotal_refunded: 469.95
50
+ total_invoiced: 499.95
51
+ total_offline_refunded: 499.95
52
+ total_paid: 499.95
53
+ total_qty_ordered: 6
54
+ total_refunded: 499.95
55
+ customer_is_guest: 0
56
+ customer_note_notify: 1
57
+ billing_address_id: 1
58
+ customer_group_id: 1
59
+ email_sent: 1
60
+ quote_id: 1
61
+ shipping_address_id: 1
62
+ base_subtotal_incl_tax: 469.95
63
+ base_total_due: 0
64
+ subtotal_incl_tax: 469.95
65
+ total_due: 0
66
+ weight: 18
67
+ increment_id: 100000005
68
+ base_currency_code: EUR
69
+ customer_email: foo@bar.com
70
+ customer_firstname: Max
71
+ customer_lastname: Mustermann
72
+ global_currency_code: EUR
73
+ order_currency_code: EUR
74
+ remote_ip: 192.168.1.1
75
+ shipping_method: flatrate_flatrate
76
+ store_currency_code: EUR
77
+ store_name: Main Website Main Store English
78
+ created_at: 2012-04-01 14:00:00
79
+ updated_at: 2012-04-03 14:00:00
80
+ total_item_count: 6
81
+ shipping_incl_tax: 30
82
+ base_shipping_incl_tax: 30
83
+ sales/order_payment:
84
+ - entity_id: 5
85
+ parent_id: 5
86
+ base_shipping_captured: 30
87
+ shipping_captured: 30
88
+ amount_refunded: 499.95
89
+ base_amount_paid: 499.95
90
+ base_shipping_amount: 30
91
+ shipping_amount: 30
92
+ amount_paid: 499.95
93
+ base_amount_ordered: 499.95
94
+ base_shipping_refunded: 30
95
+ shipping_refunded: 30
96
+ base_amount_refunded: 499.95
97
+ amount_ordered: 499.95
98
+ method: barzahlen
99
+ additional_information: "a:1:{s:14:"transaction_id";s:1:"5";}"
100
+ sales/order_item:
101
+ - item_id: 5
102
+ order_id: 5
103
+ qty_canceled: 0
104
+ qty_invoiced: 6
105
+ qty_ordered: 6
106
+ qty_refunded: 6
107
+ qty_shipped: 6
108
+ sales/creditmemo:
109
+ - entity_id: 5
110
+ store_id: 1
111
+ store_to_order_rate: 1
112
+ base_to_order_rate: 1
113
+ grand_total: 499.95
114
+ base_subtotal_incl_tax: 469.95
115
+ shipping_amount: 30
116
+ subtotal_incl_tax: 469.95
117
+ base_shipping_amount: 30
118
+ store_to_base_rate: 1
119
+ base_to_global_rate: 1
120
+ base_subtotal: 469.95
121
+ subtotal: 469.95
122
+ base_grand_total: 499.95
123
+ order_id: 5
124
+ state: 2
125
+ shipping_address_id: 1
126
+ billing_address_id: 1
127
+ store_currency_code: EUR
128
+ order_currency_code: EUR
129
+ base_currency_code: EUR
130
+ global_currency_code: EUR
131
+ transaction_id: 5
132
+ increment_id: 100000005
133
+ created_at: 2012-04-03 14:00:00
134
+ updated_at: 2012-04-03 14:00:10
135
+ shipping_incl_tax: 30
136
+ base_shipping_incl_tax: 30
137
+ sales/creditmemo_grid:
138
+ - entity_id: 5
139
+ store_id: 1
140
+ store_to_order_rate: 1
141
+ base_to_order_rate: 1
142
+ grand_total: 499.95
143
+ store_to_base_rate: 1
144
+ base_to_global_rate: 1
145
+ base_grand_total: 499.95
146
+ order_id: 5
147
+ state: 2
148
+ store_currency_code: EUR
149
+ order_currency_code: EUR
150
+ base_currency_code: EUR
151
+ global_currency_code: EUR
152
+ increment_id: 100000005
153
+ order_increment_id: 100000005
154
+ created_at: 2012-04-03 14:00:00
155
+ updated_at: 2012-04-03 14:00:10
156
+ billing_name: Max Mustermann
157
+ sales/creditmemo_item:
158
+ - entity_id: 5
159
+ parent_id: 5
160
+ base_price: 80
161
+ base_row_total: 469.95
162
+ row_total: 469.95
163
+ price_incl_tax: 80
164
+ base_price_incl_tax: 80
165
+ qty: 6
166
+ base_cost: 29.99
167
+ price: 80
168
+ base_row_total_incl_tax: 469.95
169
+ row_total_incl_tax: 469.95
170
+ product_id: 1
171
+ order_item_id: 5
172
+ weee_tax_applied: "a:0:{}"
173
+ sku: asc_10
174
+ sales/payment_transaction:
175
+ - transaction_id: 5
176
+ order_id: 5
177
+ payment_id: 5
178
+ txn_id: 5
179
+ txn_type: order
180
+ is_closed: 1
181
+ created_at: 2012-04-01 14:00:00
182
+ - transaction_id: 6
183
+ parent_id: 5
184
+ order_id: 5
185
+ payment_id: 5
186
+ txn_id: 6
187
+ parent_txn_id: 5
188
+ txn_type: refund
189
+ is_closed: 1
190
+ created_at: 2012-04-02 14:00:00
app/code/community/ZerebroInternet/Barzahlen/Test/Controller/ResendController.php ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once("app/code/community/ZerebroInternet/Barzahlen/controllers/ResendController.php");
4
+
5
+ class ZerebroInternet_Barzahlen_ResendController_Mock extends ZerebroInternet_Barzahlen_ResendController {
6
+
7
+ protected $_request;
8
+ public $redirectUrl;
9
+ public $redirectArray;
10
+
11
+ public function __construct() {
12
+ $this->_request = $_GET;
13
+ }
14
+
15
+ public function getRequest() {
16
+ return $this;
17
+ }
18
+
19
+ public function getParam($param) {
20
+ return $this->_request[$param];
21
+ }
22
+
23
+ protected function _redirect($url, $array) {
24
+ $this->redirectUrl = $url;
25
+ $this->redirectArray = $array;
26
+ }
27
+ }
28
+
29
+ class ZerebroInternet_Barzahlen_Test_Controller_ResendController extends EcomDev_PHPUnit_Test_Case_Controller {
30
+
31
+ /**
32
+ * Sets everything for a new test. parent::setUp() is necessary to enable fixtures.
33
+ */
34
+ public function setUp() {
35
+ parent::setUp();
36
+ }
37
+
38
+ /**
39
+ * Checks resend payment slip with valid resend.
40
+ *
41
+ * @test
42
+ * @loadFixture new_order
43
+ */
44
+ public function testResendPaymentSlipWithValidResend() {
45
+
46
+ $_GET = array('order_id' => '100000003');
47
+ $this->object = new ZerebroInternet_Barzahlen_ResendController_Mock;
48
+
49
+ // mock order
50
+ $order = $this->getModelMock('sales/order', array('getPayment', 'getAdditionalInformation'));
51
+ $order->expects($this->any())
52
+ ->method('getPayment')
53
+ ->will($this->returnValue($order));
54
+ $order->expects($this->any())
55
+ ->method('getAdditionalInformation')
56
+ ->will($this->returnValue('100000003'));
57
+ $this->replaceByMock('model','sales/order',$order);
58
+
59
+ // mock resend
60
+ $resend = $this->getModelMock('barzahlen/barzahlen', array('resendSlip'));
61
+ $resend->expects($this->once())
62
+ ->method('resendSlip')
63
+ ->will($this->returnValue(true));
64
+ $this->replaceByMock('singleton','barzahlen/barzahlen',$resend);
65
+
66
+ $this->object->paymentAction();
67
+ $this->assertEquals('adminhtml/sales_order/view', $this->object->redirectUrl);
68
+ $this->assertEquals(array('order_id' => '100000003'), $this->object->redirectArray);
69
+ }
70
+
71
+ /**
72
+ * Checks resend payment slip with invalid resend.
73
+ *
74
+ * @test
75
+ * @loadFixture paid_order
76
+ */
77
+ public function testResendPaymentSlipWithInvalidResend() {
78
+
79
+ $_GET = array('order_id' => '100000004');
80
+ $this->object = new ZerebroInternet_Barzahlen_ResendController_Mock;
81
+
82
+ // mock order
83
+ $order = $this->getModelMock('sales/order', array('getPayment', 'getAdditionalInformation'));
84
+ $order->expects($this->any())
85
+ ->method('getPayment')
86
+ ->will($this->returnValue($order));
87
+ $order->expects($this->any())
88
+ ->method('getAdditionalInformation')
89
+ ->will($this->returnValue('100000004'));
90
+ $this->replaceByMock('model','sales/order',$order);
91
+
92
+ // mock resend
93
+ $resend = $this->getModelMock('barzahlen/barzahlen', array('resendSlip'));
94
+ $resend->expects($this->once())
95
+ ->method('resendSlip')
96
+ ->will($this->returnValue(false));
97
+ $this->replaceByMock('singleton','barzahlen/barzahlen',$resend);
98
+
99
+ $this->object->paymentAction();
100
+ $this->assertEquals('adminhtml/sales_order/view', $this->object->redirectUrl);
101
+ $this->assertEquals(array('order_id' => '100000004'), $this->object->redirectArray);
102
+ }
103
+
104
+ /**
105
+ * Checks resend refund slip with valid resend.
106
+ *
107
+ * @test
108
+ * @loadFixture refunded_order
109
+ */
110
+ public function testResendRefundSlipWithValidResend() {
111
+
112
+ $_GET = array('creditmemo_id' => '100000005');
113
+ $this->object = new ZerebroInternet_Barzahlen_ResendController_Mock;
114
+
115
+ // mock creditmemo
116
+ $cmemo = $this->getModelMock('sales/order_creditmemo', array('getTransactionId'));
117
+ $cmemo->expects($this->any())
118
+ ->method('getTransactionId')
119
+ ->will($this->returnValue('100000005'));
120
+ $this->replaceByMock('model','sales/order_creditmemo',$cmemo);
121
+
122
+ // mock resend
123
+ $resend = $this->getModelMock('barzahlen/barzahlen', array('resendSlip'));
124
+ $resend->expects($this->once())
125
+ ->method('resendSlip')
126
+ ->will($this->returnValue(true));
127
+ $this->replaceByMock('singleton','barzahlen/barzahlen',$resend);
128
+
129
+ $this->object->refundAction();
130
+ $this->assertEquals('adminhtml/sales_order_creditmemo/view', $this->object->redirectUrl);
131
+ $this->assertEquals(array('creditmemo_id' => '100000005'), $this->object->redirectArray);
132
+ }
133
+
134
+ /**
135
+ * Checks resend refund slip with invalid resend.
136
+ *
137
+ * @test
138
+ * @loadFixture successful_refunded_order
139
+ */
140
+ public function testResendRefundSlipWithInvalidResend() {
141
+
142
+ $_GET = array('creditmemo_id' => '100000005');
143
+ $this->object = new ZerebroInternet_Barzahlen_ResendController_Mock;
144
+
145
+ // mock creditmemo
146
+ $cmemo = $this->getModelMock('sales/order_creditmemo', array('getTransactionId'));
147
+ $cmemo->expects($this->any())
148
+ ->method('getTransactionId')
149
+ ->will($this->returnValue('100000005'));
150
+ $this->replaceByMock('model','sales/order_creditmemo',$cmemo);
151
+
152
+ // mock resend
153
+ $resend = $this->getModelMock('barzahlen/barzahlen', array('resendSlip'));
154
+ $resend->expects($this->once())
155
+ ->method('resendSlip')
156
+ ->will($this->returnValue(false));
157
+ $this->replaceByMock('singleton','barzahlen/barzahlen',$resend);
158
+
159
+ $this->object->refundAction();
160
+ $this->assertEquals('adminhtml/sales_order_creditmemo/view', $this->object->redirectUrl);
161
+ $this->assertEquals(array('creditmemo_id' => '100000005'), $this->object->redirectArray);
162
+ }
163
+
164
+ /**
165
+ * Unset everything before the next test.
166
+ */
167
+ public function tearDown() {
168
+
169
+ unset($this->object);
170
+ parent::tearDown();
171
+ }
172
+ }
173
+ ?>
app/code/community/ZerebroInternet/Barzahlen/Test/Controller/ResendController/fixtures/new_order.yaml ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ config:
2
+ default/payment/barzahlen/title: Barzahlen (Pay Cash Online)
3
+ default/payment/barzahlen/sandbox: 0
4
+ default/payment/barzahlen/sort_order: 1
5
+ default/payment/barzahlen/active: 1
6
+ default/payment/barzahlen/debug: 1
7
+ default/payment/barzahlen/allowspecific: 1
8
+ default/payment/barzahlen/specificcountry: DE
9
+ default/payment/barzahlen/max_order_total: 1000
10
+ default/payment/barzahlen/shop_id: 1
11
+ default/payment/barzahlen/payment_key: da49244dda9da8158f94134ba26a3ed258bde622
12
+ default/payment/barzahlen/notification_key: 3a25aea969b8768b034e81a64c4812136deab059
13
+ default/payment/barzahlen/custom_var_0: "{{store url=""}}&foo=2"
14
+ default/payment/barzahlen/custom_var_1: Magento 1.6.1.0
15
+ default/payment/barzahlen/custom_var_2: Connect Package 2.0 v.0.9.3-1
16
+ tables:
17
+ sales/order:
18
+ - entity_id: 3
19
+ state: new
20
+ status: pending
21
+ coupon_code: NULL
22
+ protect_code: 2c8edc
23
+ shipping-description: Flat Rate - Fixed
24
+ is_virtual: 0
25
+ store_id: 1
26
+ base_grand_total: 499.95
27
+ base_shipping_amount: 30.00
28
+ base_subtotal: 469.95
29
+ base_to_global_rate: 1
30
+ base_to_order_rate: 1
31
+ discount_amount: 0
32
+ grand_total: 499.95
33
+ shipping_amount: 30.00
34
+ store_to_base_rate: 1
35
+ store_to_order_rate: 1
36
+ subtotal: 469.95
37
+ total_paid: 0
38
+ total_qty_ordered: 6
39
+ customer_is_guest: 0
40
+ customer_note_notify: 1
41
+ billing_address_id: 1
42
+ customer_group_id: 1
43
+ email_sent: 1
44
+ quote_id: 1
45
+ shipping_address_id: 1
46
+ base_subtotal_incl_tax: 469.95
47
+ base_total_due: 499.95
48
+ subtotal_incl_tax: 469.95
49
+ total_due: 499.95
50
+ weight: 18
51
+ increment_id: 100000003
52
+ base_currency_code: EUR
53
+ customer_email: foo@bar.com
54
+ customer_firstname: Max
55
+ customer_lastname: Mustermann
56
+ global_currency_code: EUR
57
+ order_currency_code: EUR
58
+ remote_ip: 192.168.1.1
59
+ shipping_method: flatrate_flatrate
60
+ store_currency_code: EUR
61
+ store_name: Main Website Main Store English
62
+ created_at: 2012-04-01 14:00:00
63
+ updated_at: 2012-04-01 14:00:10
64
+ total_item_count: 6
65
+ shipping_incl_tax: 30
66
+ base_shipping_incl_tax: 30
67
+ sales/order_payment:
68
+ - entity_id: 3
69
+ parent_id: 3
70
+ base_shipping_amount: 30
71
+ shipping_amount: 30
72
+ base_amount_ordered: 499.95
73
+ amount_ordered: 499.95
74
+ method: barzahlen
75
+ additional_information: "a:1:{s:14:"transaction_id";s:1:"3";}"
76
+ sales/order_item:
77
+ - item_id: 3
78
+ order_id: 3
79
+ qty_canceled: 0
80
+ qty_invoiced: 0
81
+ qty_ordered: 6
82
+ qty_refunded: 0
83
+ qty_shipped: 0
app/code/community/ZerebroInternet/Barzahlen/Test/Controller/ResendController/fixtures/paid_order.yaml ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ config:
2
+ default/payment/barzahlen/title: Barzahlen (Pay Cash Online)
3
+ default/payment/barzahlen/sandbox: 0
4
+ default/payment/barzahlen/sort_order: 1
5
+ default/payment/barzahlen/active: 1
6
+ default/payment/barzahlen/debug: 1
7
+ default/payment/barzahlen/allowspecific: 1
8
+ default/payment/barzahlen/specificcountry: DE
9
+ default/payment/barzahlen/max_order_total: 1000
10
+ default/payment/barzahlen/shop_id: 1
11
+ default/payment/barzahlen/payment_key: da49244dda9da8158f94134ba26a3ed258bde622
12
+ default/payment/barzahlen/notification_key: 3a25aea969b8768b034e81a64c4812136deab059
13
+ default/payment/barzahlen/custom_var_0: "{{store url=""}}&foo=2"
14
+ default/payment/barzahlen/custom_var_1: Magento 1.6.1.0
15
+ default/payment/barzahlen/custom_var_2: Connect Package 2.0 v.0.9.3-1
16
+ tables:
17
+ sales/order:
18
+ - entity_id: 4
19
+ state: processing
20
+ status: processing
21
+ coupon_code: NULL
22
+ protect_code: 2c8edc
23
+ shipping-description: Flat Rate - Fixed
24
+ is_virtual: 0
25
+ store_id: 1
26
+ base_grand_total: 499.95
27
+ base_shipping_amount: 30.00
28
+ base_shipping_invoiced: 30.00
29
+ base_subtotal: 469.95
30
+ base_subtotal_invoiced: 469.95
31
+ base_to_global_rate: 1
32
+ base_to_order_rate: 1
33
+ base_total_invoiced: 499.95
34
+ base_total_invoiced_cost: 99.95
35
+ base_total_paid: 499.95
36
+ discount_amount: 0
37
+ grand_total: 499.95
38
+ shipping_amount: 30.00
39
+ shipping_invoiced: 30.00
40
+ store_to_base_rate: 1
41
+ store_to_order_rate: 1
42
+ subtotal: 469.95
43
+ subtotal_invoiced: 469.95
44
+ total_invoiced: 499.95
45
+ total_paid: 499.95
46
+ total_qty_ordered: 6
47
+ customer_is_guest: 0
48
+ customer_note_notify: 1
49
+ billing_address_id: 1
50
+ customer_group_id: 1
51
+ email_sent: 1
52
+ quote_id: 1
53
+ shipping_address_id: 1
54
+ base_subtotal_incl_tax: 469.95
55
+ base_total_due: 0
56
+ subtotal_incl_tax: 469.95
57
+ total_due: 0
58
+ weight: 18
59
+ increment_id: 100000004
60
+ base_currency_code: EUR
61
+ customer_email: foo@bar.com
62
+ customer_firstname: Max
63
+ customer_lastname: Mustermann
64
+ global_currency_code: EUR
65
+ order_currency_code: EUR
66
+ remote_ip: 192.168.1.1
67
+ shipping_method: flatrate_flatrate
68
+ store_currency_code: EUR
69
+ store_name: Main Website Main Store English
70
+ created_at: 2012-04-01 14:00:00
71
+ updated_at: 2012-04-02 14:00:00
72
+ total_item_count: 6
73
+ shipping_incl_tax: 30
74
+ base_shipping_incl_tax: 30
75
+ sales/order_payment:
76
+ - entity_id: 4
77
+ parent_id: 4
78
+ base_shipping_captured: 30
79
+ shipping_captured: 30
80
+ base_amount_paid: 499.95
81
+ base_shipping_amount: 30
82
+ shipping_amount: 30
83
+ amount_paid: 499.95
84
+ base_amount_ordered: 499.95
85
+ amount_ordered: 499.95
86
+ method: barzahlen
87
+ additional_information: "a:1:{s:14:"transaction_id";s:1:"4";}"
88
+ sales/order_item:
89
+ - item_id: 4
90
+ order_id: 4
91
+ qty_canceled: 0
92
+ qty_invoiced: 6
93
+ qty_ordered: 6
94
+ qty_refunded: 0
95
+ qty_shipped: 0
app/code/community/ZerebroInternet/Barzahlen/Test/Controller/ResendController/fixtures/refunded_order.yaml ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ config:
2
+ default/payment/barzahlen/title: Barzahlen (Pay Cash Online)
3
+ default/payment/barzahlen/sandbox: 0
4
+ default/payment/barzahlen/sort_order: 1
5
+ default/payment/barzahlen/active: 1
6
+ default/payment/barzahlen/debug: 1
7
+ default/payment/barzahlen/allowspecific: 1
8
+ default/payment/barzahlen/specificcountry: DE
9
+ default/payment/barzahlen/max_order_total: 1000
10
+ default/payment/barzahlen/shop_id: 1
11
+ default/payment/barzahlen/payment_key: da49244dda9da8158f94134ba26a3ed258bde622
12
+ default/payment/barzahlen/notification_key: 3a25aea969b8768b034e81a64c4812136deab059
13
+ default/payment/barzahlen/custom_var_0: "{{store url=""}}&foo=2"
14
+ default/payment/barzahlen/custom_var_1: Magento 1.6.1.0
15
+ default/payment/barzahlen/custom_var_2: Connect Package 2.0 v.0.9.3-1
16
+ tables:
17
+ sales/order:
18
+ - entity_id: 5
19
+ state: closed
20
+ status: closed
21
+ coupon_code: NULL
22
+ protect_code: 2c8edc
23
+ shipping-description: Flat Rate - Fixed
24
+ is_virtual: 0
25
+ store_id: 1
26
+ base_grand_total: 499.95
27
+ base_shipping_amount: 30.00
28
+ base_shipping_invoiced: 30.00
29
+ base_shipping_refunded: 30.00
30
+ base_subtotal: 469.95
31
+ base_subtotal_invoiced: 469.95
32
+ base_subtotal_refunded: 469.95
33
+ base_to_global_rate: 1
34
+ base_to_order_rate: 1
35
+ base_total_invoiced: 499.95
36
+ base_total_invoiced_cost: 99.95
37
+ base_total_offline_refunded: 499.95
38
+ base_total_paid: 499.95
39
+ base_total_refunded: 499.95
40
+ discount_amount: 0
41
+ grand_total: 499.95
42
+ shipping_amount: 30.00
43
+ shipping_invoiced: 30.00
44
+ shipping_refunded: 30.00
45
+ store_to_base_rate: 1
46
+ store_to_order_rate: 1
47
+ subtotal: 469.95
48
+ subtotal_invoiced: 469.95
49
+ subtotal_refunded: 469.95
50
+ total_invoiced: 499.95
51
+ total_offline_refunded: 499.95
52
+ total_paid: 499.95
53
+ total_qty_ordered: 6
54
+ total_refunded: 499.95
55
+ customer_is_guest: 0
56
+ customer_note_notify: 1
57
+ billing_address_id: 1
58
+ customer_group_id: 1
59
+ email_sent: 1
60
+ quote_id: 1
61
+ shipping_address_id: 1
62
+ base_subtotal_incl_tax: 469.95
63
+ base_total_due: 0
64
+ subtotal_incl_tax: 469.95
65
+ total_due: 0
66
+ weight: 18
67
+ increment_id: 100000005
68
+ base_currency_code: EUR
69
+ customer_email: foo@bar.com
70
+ customer_firstname: Max
71
+ customer_lastname: Mustermann
72
+ global_currency_code: EUR
73
+ order_currency_code: EUR
74
+ remote_ip: 192.168.1.1
75
+ shipping_method: flatrate_flatrate
76
+ store_currency_code: EUR
77
+ store_name: Main Website Main Store English
78
+ created_at: 2012-04-01 14:00:00
79
+ updated_at: 2012-04-03 14:00:00
80
+ total_item_count: 6
81
+ shipping_incl_tax: 30
82
+ base_shipping_incl_tax: 30
83
+ sales/order_payment:
84
+ - entity_id: 5
85
+ parent_id: 5
86
+ base_shipping_captured: 30
87
+ shipping_captured: 30
88
+ amount_refunded: 499.95
89
+ base_amount_paid: 499.95
90
+ base_shipping_amount: 30
91
+ shipping_amount: 30
92
+ amount_paid: 499.95
93
+ base_amount_ordered: 499.95
94
+ base_shipping_refunded: 30
95
+ shipping_refunded: 30
96
+ base_amount_refunded: 499.95
97
+ amount_ordered: 499.95
98
+ method: barzahlen
99
+ additional_information: "a:1:{s:14:"transaction_id";s:1:"5";}"
100
+ sales/order_item:
101
+ - item_id: 5
102
+ order_id: 5
103
+ qty_canceled: 0
104
+ qty_invoiced: 6
105
+ qty_ordered: 6
106
+ qty_refunded: 6
107
+ qty_shipped: 6
108
+ sales/creditmemo:
109
+ - entity_id: 5
110
+ store_id: 1
111
+ store_to_order_rate: 1
112
+ base_to_order_rate: 1
113
+ grand_total: 499.95
114
+ base_subtotal_incl_tax: 469.95
115
+ shipping_amount: 30
116
+ subtotal_incl_tax: 469.95
117
+ base_shipping_amount: 30
118
+ store_to_base_rate: 1
119
+ base_to_global_rate: 1
120
+ base_subtotal: 469.95
121
+ subtotal: 469.95
122
+ base_grand_total: 499.95
123
+ order_id: 5
124
+ state: 1
125
+ shipping_address_id: 1
126
+ billing_address_id: 1
127
+ store_currency_code: EUR
128
+ order_currency_code: EUR
129
+ base_currency_code: EUR
130
+ global_currency_code: EUR
131
+ transaction_id: 5
132
+ increment_id: 100000005
133
+ created_at: 2012-04-03 14:00:00
134
+ updated_at: 2012-04-03 14:00:10
135
+ shipping_incl_tax: 30
136
+ base_shipping_incl_tax: 30
137
+ sales/creditmemo_grid:
138
+ - entity_id: 5
139
+ store_id: 1
140
+ store_to_order_rate: 1
141
+ base_to_order_rate: 1
142
+ grand_total: 499.95
143
+ store_to_base_rate: 1
144
+ base_to_global_rate: 1
145
+ base_grand_total: 499.95
146
+ order_id: 5
147
+ state: 1
148
+ store_currency_code: EUR
149
+ order_currency_code: EUR
150
+ base_currency_code: EUR
151
+ global_currency_code: EUR
152
+ increment_id: 100000005
153
+ order_increment_id: 100000005
154
+ created_at: 2012-04-03 14:00:00
155
+ updated_at: 2012-04-03 14:00:10
156
+ billing_name: Max Mustermann
157
+ sales/creditmemo_item:
158
+ - entity_id: 5
159
+ parent_id: 5
160
+ base_price: 80
161
+ base_row_total: 469.95
162
+ row_total: 469.95
163
+ price_incl_tax: 80
164
+ base_price_incl_tax: 80
165
+ qty: 6
166
+ base_cost: 29.99
167
+ price: 80
168
+ base_row_total_incl_tax: 469.95
169
+ row_total_incl_tax: 469.95
170
+ product_id: 1
171
+ order_item_id: 5
172
+ weee_tax_applied: "a:0:{}"
173
+ sku: asc_10
app/code/community/ZerebroInternet/Barzahlen/Test/Controller/ResendController/fixtures/successful_refunded_order.yaml ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ config:
2
+ default/payment/barzahlen/title: Barzahlen (Pay Cash Online)
3
+ default/payment/barzahlen/sandbox: 0
4
+ default/payment/barzahlen/sort_order: 1
5
+ default/payment/barzahlen/active: 1
6
+ default/payment/barzahlen/debug: 1
7
+ default/payment/barzahlen/allowspecific: 1
8
+ default/payment/barzahlen/specificcountry: DE
9
+ default/payment/barzahlen/max_order_total: 1000
10
+ default/payment/barzahlen/shop_id: 1
11
+ default/payment/barzahlen/payment_key: da49244dda9da8158f94134ba26a3ed258bde622
12
+ default/payment/barzahlen/notification_key: 3a25aea969b8768b034e81a64c4812136deab059
13
+ default/payment/barzahlen/custom_var_0: "{{store url=""}}&foo=2"
14
+ default/payment/barzahlen/custom_var_1: Magento 1.6.1.0
15
+ default/payment/barzahlen/custom_var_2: Connect Package 2.0 v.0.9.3-1
16
+ tables:
17
+ sales/order:
18
+ - entity_id: 5
19
+ state: closed
20
+ status: closed
21
+ coupon_code: NULL
22
+ protect_code: 2c8edc
23
+ shipping-description: Flat Rate - Fixed
24
+ is_virtual: 0
25
+ store_id: 1
26
+ base_grand_total: 499.95
27
+ base_shipping_amount: 30.00
28
+ base_shipping_invoiced: 30.00
29
+ base_shipping_refunded: 30.00
30
+ base_subtotal: 469.95
31
+ base_subtotal_invoiced: 469.95
32
+ base_subtotal_refunded: 469.95
33
+ base_to_global_rate: 1
34
+ base_to_order_rate: 1
35
+ base_total_invoiced: 499.95
36
+ base_total_invoiced_cost: 99.95
37
+ base_total_offline_refunded: 499.95
38
+ base_total_paid: 499.95
39
+ base_total_refunded: 499.95
40
+ discount_amount: 0
41
+ grand_total: 499.95
42
+ shipping_amount: 30.00
43
+ shipping_invoiced: 30.00
44
+ shipping_refunded: 30.00
45
+ store_to_base_rate: 1
46
+ store_to_order_rate: 1
47
+ subtotal: 469.95
48
+ subtotal_invoiced: 469.95
49
+ subtotal_refunded: 469.95
50
+ total_invoiced: 499.95
51
+ total_offline_refunded: 499.95
52
+ total_paid: 499.95
53
+ total_qty_ordered: 6
54
+ total_refunded: 499.95
55
+ customer_is_guest: 0
56
+ customer_note_notify: 1
57
+ billing_address_id: 1
58
+ customer_group_id: 1
59
+ email_sent: 1
60
+ quote_id: 1
61
+ shipping_address_id: 1
62
+ base_subtotal_incl_tax: 469.95
63
+ base_total_due: 0
64
+ subtotal_incl_tax: 469.95
65
+ total_due: 0
66
+ weight: 18
67
+ increment_id: 100000005
68
+ base_currency_code: EUR
69
+ customer_email: foo@bar.com
70
+ customer_firstname: Max
71
+ customer_lastname: Mustermann
72
+ global_currency_code: EUR
73
+ order_currency_code: EUR
74
+ remote_ip: 192.168.1.1
75
+ shipping_method: flatrate_flatrate
76
+ store_currency_code: EUR
77
+ store_name: Main Website Main Store English
78
+ created_at: 2012-04-01 14:00:00
79
+ updated_at: 2012-04-03 14:00:00
80
+ total_item_count: 6
81
+ shipping_incl_tax: 30
82
+ base_shipping_incl_tax: 30
83
+ sales/order_payment:
84
+ - entity_id: 5
85
+ parent_id: 5
86
+ base_shipping_captured: 30
87
+ shipping_captured: 30
88
+ amount_refunded: 499.95
89
+ base_amount_paid: 499.95
90
+ base_shipping_amount: 30
91
+ shipping_amount: 30
92
+ amount_paid: 499.95
93
+ base_amount_ordered: 499.95
94
+ base_shipping_refunded: 30
95
+ shipping_refunded: 30
96
+ base_amount_refunded: 499.95
97
+ amount_ordered: 499.95
98
+ method: barzahlen
99
+ additional_information: "a:1:{s:14:"transaction_id";s:1:"5";}"
100
+ sales/order_item:
101
+ - item_id: 5
102
+ order_id: 5
103
+ qty_canceled: 0
104
+ qty_invoiced: 6
105
+ qty_ordered: 6
106
+ qty_refunded: 6
107
+ qty_shipped: 6
108
+ sales/creditmemo:
109
+ - entity_id: 5
110
+ store_id: 1
111
+ store_to_order_rate: 1
112
+ base_to_order_rate: 1
113
+ grand_total: 499.95
114
+ base_subtotal_incl_tax: 469.95
115
+ shipping_amount: 30
116
+ subtotal_incl_tax: 469.95
117
+ base_shipping_amount: 30
118
+ store_to_base_rate: 1
119
+ base_to_global_rate: 1
120
+ base_subtotal: 469.95
121
+ subtotal: 469.95
122
+ base_grand_total: 499.95
123
+ order_id: 5
124
+ state: 2
125
+ shipping_address_id: 1
126
+ billing_address_id: 1
127
+ store_currency_code: EUR
128
+ order_currency_code: EUR
129
+ base_currency_code: EUR
130
+ global_currency_code: EUR
131
+ transaction_id: 5
132
+ increment_id: 100000005
133
+ created_at: 2012-04-03 14:00:00
134
+ updated_at: 2012-04-03 14:00:10
135
+ shipping_incl_tax: 30
136
+ base_shipping_incl_tax: 30
137
+ sales/creditmemo_grid:
138
+ - entity_id: 5
139
+ store_id: 1
140
+ store_to_order_rate: 1
141
+ base_to_order_rate: 1
142
+ grand_total: 499.95
143
+ store_to_base_rate: 1
144
+ base_to_global_rate: 1
145
+ base_grand_total: 499.95
146
+ order_id: 5
147
+ state: 2
148
+ store_currency_code: EUR
149
+ order_currency_code: EUR
150
+ base_currency_code: EUR
151
+ global_currency_code: EUR
152
+ increment_id: 100000005
153
+ order_increment_id: 100000005
154
+ created_at: 2012-04-03 14:00:00
155
+ updated_at: 2012-04-03 14:00:10
156
+ billing_name: Max Mustermann
157
+ sales/creditmemo_item:
158
+ - entity_id: 5
159
+ parent_id: 5
160
+ base_price: 80
161
+ base_row_total: 469.95
162
+ row_total: 469.95
163
+ price_incl_tax: 80
164
+ base_price_incl_tax: 80
165
+ qty: 6
166
+ base_cost: 29.99
167
+ price: 80
168
+ base_row_total_incl_tax: 469.95
169
+ row_total_incl_tax: 469.95
170
+ product_id: 1
171
+ order_item_id: 5
172
+ weee_tax_applied: "a:0:{}"
173
+ sku: asc_10
app/code/community/ZerebroInternet/Barzahlen/Test/Helper/Data.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class ZerebroInternet_Barzahlen_Test_Helper_Data extends EcomDev_PHPUnit_Test_Case {
4
+
5
+ /**
6
+ * Sets everything for a new test. parent::setUp() is necessary to enable fixtures.
7
+ */
8
+ public function setUp() {
9
+ parent::setUp();
10
+ $this->object = Mage::helper('barzahlen');
11
+ }
12
+
13
+ /**
14
+ * Checks that logging works.
15
+ *
16
+ * @test
17
+ */
18
+ public function testLogging() {
19
+ $this->object->bzLog('An error occurred.');
20
+ }
21
+
22
+ /**
23
+ * Unset everything before the next test.
24
+ */
25
+ protected function tearDown() {
26
+
27
+ unset($this->object);
28
+ parent::tearDown();
29
+ }
30
+ }
31
+ ?>
app/code/community/ZerebroInternet/Barzahlen/Test/Model/Adminexceptions/Maxordertotal.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class ZerebroInternet_Barzahlen_Test_Model_Adminexceptions_Maxordertotal extends EcomDev_PHPUnit_Test_Case {
4
+
5
+ /**
6
+ * Sets everything for a new test. parent::setUp() is necessary to enable fixtures.
7
+ */
8
+ protected function setUp() {
9
+ parent::setUp();
10
+
11
+ $this->object = new ZerebroInternet_Barzahlen_Model_Adminexceptions_Maxordertotal;
12
+
13
+ $this->object->setScope('default');
14
+ $this->object->setScopeId(0);
15
+ $this->object->setPath('payment/barzahlen/max_order_total');
16
+ }
17
+
18
+ /**
19
+ * Tests that default value is written to datebase, when too high integer value is put in.
20
+ *
21
+ * @test
22
+ * @loadFixture Maxordertotal
23
+ */
24
+ public function testBeforeSaveForMaxordertotal() {
25
+
26
+ $this->object->setValue('2500');
27
+ $this->object->save();
28
+ $this->assertEquals('999.99', $this->object->getValue());
29
+ }
30
+
31
+ /**
32
+ * Checks that valid integer value is written to database.
33
+ *
34
+ * @test
35
+ * @loadFixture Maxordertotal
36
+ */
37
+ public function testBeforeSaveForMaxordertotal2() {
38
+
39
+ $this->object->setValue('500');
40
+ $this->object->save();
41
+ $this->assertEquals('500', $this->object->getValue());
42
+ }
43
+
44
+ /**
45
+ * Tests that default value is written to datebase, when too low integer value is put in.
46
+ *
47
+ * @test
48
+ * @loadFixture Maxordertotal
49
+ */
50
+ public function testBeforeSaveForMaxordertotal3() {
51
+
52
+ $this->object->setValue('-200');
53
+ $this->object->save();
54
+ $this->assertEquals('999.99', $this->object->getValue());
55
+ }
56
+
57
+ /**
58
+ * Unset everything before the next test.
59
+ */
60
+ protected function tearDown() {
61
+
62
+ $this->object->delete();
63
+ unset($this->object);
64
+ parent::tearDown();
65
+ }
66
+ }
app/code/community/ZerebroInternet/Barzahlen/Test/Model/Adminexceptions/Maxordertotal/fixtures/Maxordertotal.yaml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ config:
2
+ default/payment/barzahlen/title: Barzahlen (Pay Cash Online)
3
+ default/payment/barzahlen/sandbox: 0
4
+ default/payment/barzahlen/sort_order: 1
5
+ default/payment/barzahlen/active: 1
6
+ default/payment/barzahlen/debug: 1
7
+ default/payment/barzahlen/allowspecific: 1
8
+ default/payment/barzahlen/specificcountry: DE
9
+ default/payment/barzahlen/max_order_total: 1000
10
+ default/payment/barzahlen/shop_id: 1
11
+ default/payment/barzahlen/payment_key: da49244dda9da8158f94134ba26a3ed258bde622
12
+ default/payment/barzahlen/notification_key: 3a25aea969b8768b034e81a64c4812136deab059
13
+ default/payment/barzahlen/custom_var_0: "{{store url=""}}&foo=2"
14
+ default/payment/barzahlen/custom_var_1: Magento 1.6.1.0
15
+ default/payment/barzahlen/custom_var_2: Connect Package 2.0 v.0.9.3-1
app/code/community/ZerebroInternet/Barzahlen/Test/Model/Adminexceptions/Notificationkey.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class ZerebroInternet_Barzahlen_Test_Model_Adminexceptions_Notificationkey extends EcomDev_PHPUnit_Test_Case {
4
+
5
+ /**
6
+ * Sets everything for a new test. parent::setUp() is necessary to enable fixtures.
7
+ */
8
+ protected function setUp() {
9
+ parent::setUp();
10
+
11
+ $this->object = new ZerebroInternet_Barzahlen_Model_Adminexceptions_Notificationkey;
12
+
13
+ $this->object->setScope('default');
14
+ $this->object->setScopeId(0);
15
+ $this->object->setPath('payment/barzahlen/notification_key');
16
+ }
17
+
18
+ /**
19
+ * Tests that former value keeps in datebase, when empty string is put in.
20
+ *
21
+ * @test
22
+ * @loadFixture Notificationkey
23
+ */
24
+ public function testNotificationkeyBeforeSaveWithEmptyString() {
25
+
26
+ $this->object->setValue('');
27
+ $this->object->save();
28
+ $this->assertEquals('3a25aea969b8768b034e81a64c4812136deab059', $this->object->getValue());
29
+ }
30
+
31
+ /**
32
+ * Checks that valid string is written to database.
33
+ *
34
+ * @test
35
+ * @loadFixture Notificationkey
36
+ */
37
+ public function testNotificationkeyBeforeSaveWithRandomString() {
38
+
39
+ $this->object->setValue('Bar zahlen');
40
+ $this->object->save();
41
+ $this->assertEquals('Bar zahlen', $this->object->getValue());
42
+ }
43
+
44
+ /**
45
+ * Unset everything before the next test.
46
+ */
47
+ protected function tearDown() {
48
+
49
+ $this->object->delete();
50
+ unset($this->object);
51
+ parent::tearDown();
52
+ }
53
+ }
54
+ ?>
app/code/community/ZerebroInternet/Barzahlen/Test/Model/Adminexceptions/Notificationkey/fixtures/Notificationkey.yaml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ config:
2
+ default/payment/barzahlen/title: Barzahlen (Pay Cash Online)
3
+ default/payment/barzahlen/sandbox: 0
4
+ default/payment/barzahlen/sort_order: 1
5
+ default/payment/barzahlen/active: 1
6
+ default/payment/barzahlen/debug: 1
7
+ default/payment/barzahlen/allowspecific: 1
8
+ default/payment/barzahlen/specificcountry: DE
9
+ default/payment/barzahlen/max_order_total: 1000
10
+ default/payment/barzahlen/shop_id: 1
11
+ default/payment/barzahlen/payment_key: da49244dda9da8158f94134ba26a3ed258bde622
12
+ default/payment/barzahlen/notification_key: 3a25aea969b8768b034e81a64c4812136deab059
13
+ default/payment/barzahlen/custom_var_0: "{{store url=""}}&foo=2"
14
+ default/payment/barzahlen/custom_var_1: Magento 1.6.1.0
15
+ default/payment/barzahlen/custom_var_2: Connect Package 2.0 v.0.9.3-1
app/code/community/ZerebroInternet/Barzahlen/Test/Model/Adminexceptions/Paymentkey.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class ZerebroInternet_Barzahlen_Test_Model_Adminexceptions_Paymentkey extends EcomDev_PHPUnit_Test_Case {
4
+
5
+ /**
6
+ * Sets everything for a new test. parent::setUp() is necessary to enable fixtures.
7
+ */
8
+ protected function setUp() {
9
+ parent::setUp();
10
+
11
+ $this->object = new ZerebroInternet_Barzahlen_Model_Adminexceptions_Paymentkey;
12
+
13
+ $this->object->setScope('default');
14
+ $this->object->setScopeId(0);
15
+ $this->object->setPath('payment/barzahlen/payment_key');
16
+ }
17
+
18
+ /**
19
+ * Tests that former value keeps in datebase, when empty string is put in.
20
+ *
21
+ * @test
22
+ * @loadFixture Paymentkey
23
+ */
24
+ public function testPaymentkeyBeforeSaveWithEmptyString() {
25
+
26
+ $this->object->setValue('');
27
+ $this->object->save();
28
+ $this->assertEquals('da49244dda9da8158f94134ba26a3ed258bde622', $this->object->getValue());
29
+ }
30
+
31
+ /**
32
+ * Checks that valid string is written to database.
33
+ *
34
+ * @test
35
+ * @loadFixture Paymentkey
36
+ */
37
+ public function testPaymentkeyBeforeSaveWithRandomString() {
38
+
39
+ $this->object->setValue('Bar zahlen');
40
+ $this->object->save();
41
+ $this->assertEquals('Bar zahlen', $this->object->getValue());
42
+ }
43
+
44
+ /**
45
+ * Unset everything before the next test.
46
+ */
47
+ protected function tearDown() {
48
+
49
+ $this->object->delete();
50
+ unset($this->object);
51
+ parent::tearDown();
52
+ }
53
+ }
54
+ ?>
app/code/community/ZerebroInternet/Barzahlen/Test/Model/Adminexceptions/Paymentkey/fixtures/Paymentkey.yaml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ config:
2
+ default/payment/barzahlen/title: Barzahlen (Pay Cash Online)
3
+ default/payment/barzahlen/sandbox: 0
4
+ default/payment/barzahlen/sort_order: 1
5
+ default/payment/barzahlen/active: 1
6
+ default/payment/barzahlen/debug: 1
7
+ default/payment/barzahlen/allowspecific: 1
8
+ default/payment/barzahlen/specificcountry: DE
9
+ default/payment/barzahlen/max_order_total: 1000
10
+ default/payment/barzahlen/shop_id: 1
11
+ default/payment/barzahlen/payment_key: da49244dda9da8158f94134ba26a3ed258bde622
12
+ default/payment/barzahlen/notification_key: 3a25aea969b8768b034e81a64c4812136deab059
13
+ default/payment/barzahlen/custom_var_0: "{{store url=""}}&foo=2"
14
+ default/payment/barzahlen/custom_var_1: Magento 1.6.1.0
15
+ default/payment/barzahlen/custom_var_2: Connect Package 2.0 v.0.9.3-1
app/code/community/ZerebroInternet/Barzahlen/Test/Model/Adminexceptions/Shopid.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class ZerebroInternet_Barzahlen_Test_Model_Adminexceptions_Shopid extends EcomDev_PHPUnit_Test_Case {
4
+
5
+ /**
6
+ * Sets everything for a new test. parent::setUp() is necessary to enable fixtures.
7
+ */
8
+ protected function setUp() {
9
+ parent::setUp();
10
+
11
+ $this->object = new ZerebroInternet_Barzahlen_Model_Adminexceptions_Shopid;
12
+
13
+ $this->object->setScope('default');
14
+ $this->object->setScopeId(0);
15
+ $this->object->setPath('payment/barzahlen/shop_id');
16
+ }
17
+
18
+ /**
19
+ * Tests that former value keeps in datebase, when empty string is put in.
20
+ *
21
+ * @test
22
+ * @loadFixture Shopid
23
+ */
24
+ public function testShopidBeforeSaveWithEmptyString() {
25
+
26
+ $this->object->setValue('');
27
+ $this->object->save();
28
+ $this->assertEquals('1', $this->object->getValue());
29
+ }
30
+
31
+ /**
32
+ * Checks that valid string is written to database.
33
+ *
34
+ * @test
35
+ * @loadFixture Shopid
36
+ */
37
+ public function testShopidBeforeSaveWithRandomString() {
38
+
39
+ $this->object->setValue('Bar zahlen');
40
+ $this->object->save();
41
+ $this->assertEquals('Bar zahlen', $this->object->getValue());
42
+ }
43
+
44
+ /**
45
+ * Unset everything before the next test.
46
+ */
47
+ protected function tearDown() {
48
+
49
+ $this->object->delete();
50
+ unset($this->object);
51
+ parent::tearDown();
52
+ }
53
+ }
54
+ ?>
app/code/community/ZerebroInternet/Barzahlen/Test/Model/Adminexceptions/Shopid/fixtures/Shopid.yaml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ config:
2
+ default/payment/barzahlen/title: Barzahlen (Pay Cash Online)
3
+ default/payment/barzahlen/sandbox: 0
4
+ default/payment/barzahlen/sort_order: 1
5
+ default/payment/barzahlen/active: 1
6
+ default/payment/barzahlen/debug: 1
7
+ default/payment/barzahlen/allowspecific: 1
8
+ default/payment/barzahlen/specificcountry: DE
9
+ default/payment/barzahlen/max_order_total: 1000
10
+ default/payment/barzahlen/shop_id: 1
11
+ default/payment/barzahlen/payment_key: da49244dda9da8158f94134ba26a3ed258bde622
12
+ default/payment/barzahlen/notification_key: 3a25aea969b8768b034e81a64c4812136deab059
13
+ default/payment/barzahlen/custom_var_0: "{{store url=""}}&foo=2"
14
+ default/payment/barzahlen/custom_var_1: Magento 1.6.1.0
15
+ default/payment/barzahlen/custom_var_2: Connect Package 2.0 v.0.9.3-1
app/code/community/ZerebroInternet/Barzahlen/Test/Model/Adminexceptions/Specificcountry.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class ZerebroInternet_Barzahlen_Test_Model_Adminexceptions_Specificcountry extends EcomDev_PHPUnit_Test_Case {
4
+
5
+ /**
6
+ * Sets everything for a new test. parent::setUp() is necessary to enable fixtures.
7
+ */
8
+ protected function setUp() {
9
+ parent::setUp();
10
+
11
+ $this->object = new ZerebroInternet_Barzahlen_Model_Adminexceptions_Specificcountry;
12
+
13
+ $this->object->setScope('default');
14
+ $this->object->setScopeId(0);
15
+ $this->object->setPath('payment/barzahlen/specificcountry');
16
+ }
17
+
18
+ /**
19
+ * Tests that former value keeps in datebase, when empty array is put in.
20
+ *
21
+ * @test
22
+ * @loadFixture Specificcountry
23
+ */
24
+ public function testSpecificcountryBeforeSaveWithEmptyString() {
25
+
26
+ $this->object->setValue(array());
27
+ $this->object->save();
28
+ $this->assertEquals('DE', $this->object->getValue());
29
+ }
30
+
31
+ /**
32
+ * Tests that former value keeps in datebase, when invalid array is put in.
33
+ *
34
+ * @test
35
+ * @loadFixture Specificcountry
36
+ */
37
+ public function testSpecificcountryBeforeSaveWithNotAllowedCountries() {
38
+
39
+ $this->object->setValue(array('DE','US'));
40
+ $this->object->save();
41
+ $this->assertEquals('DE', $this->object->getValue());
42
+ }
43
+
44
+ /**
45
+ * Checks that valid input is written to database.
46
+ *
47
+ * @test
48
+ * @loadFixture Specificcountry
49
+ */
50
+ public function testSpecificcountryBeforeSaveWithValidCountry() {
51
+
52
+ $this->object->setValue(array('DE'));
53
+ $this->object->save();
54
+ $this->assertEquals('DE', $this->object->getValue());
55
+ }
56
+
57
+ /**
58
+ * Unset everything before the next test.
59
+ */
60
+ protected function tearDown() {
61
+
62
+ $this->object->delete();
63
+ unset($this->object);
64
+ parent::tearDown();
65
+ }
66
+ }
67
+ ?>
app/code/community/ZerebroInternet/Barzahlen/Test/Model/Adminexceptions/Specificcountry/fixtures/Specificcountry.yaml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ config:
2
+ default/payment/barzahlen/title: Barzahlen (Pay Cash Online)
3
+ default/payment/barzahlen/sandbox: 0
4
+ default/payment/barzahlen/sort_order: 1
5
+ default/payment/barzahlen/active: 1
6
+ default/payment/barzahlen/debug: 1
7
+ default/payment/barzahlen/allowspecific: 1
8
+ default/payment/barzahlen/specificcountry: DE
9
+ default/payment/barzahlen/max_order_total: 1000
10
+ default/payment/barzahlen/shop_id: 1
11
+ default/payment/barzahlen/payment_key: da49244dda9da8158f94134ba26a3ed258bde622
12
+ default/payment/barzahlen/notification_key: 3a25aea969b8768b034e81a64c4812136deab059
13
+ default/payment/barzahlen/custom_var_0: "{{store url=""}}&foo=2"
14
+ default/payment/barzahlen/custom_var_1: Magento 1.6.1.0
15
+ default/payment/barzahlen/custom_var_2: Connect Package 2.0 v.0.9.3-1
app/code/community/ZerebroInternet/Barzahlen/Test/Model/Adminexceptions/Title.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class ZerebroInternet_Barzahlen_Test_Model_Adminexceptions_Title extends EcomDev_PHPUnit_Test_Case {
4
+
5
+ /**
6
+ * Sets everything for a new test. parent::setUp() is necessary to enable fixtures.
7
+ */
8
+ protected function setUp() {
9
+ parent::setUp();
10
+
11
+ $this->object = new ZerebroInternet_Barzahlen_Model_Adminexceptions_Title;
12
+
13
+ $this->object->setScope('default');
14
+ $this->object->setScopeId(0);
15
+ $this->object->setPath('payment/barzahlen/title');
16
+ }
17
+
18
+ /**
19
+ * Tests that former value keeps in datebase, when empty string is put in.
20
+ *
21
+ * @test
22
+ * @loadFixture Title
23
+ */
24
+ public function testTitleBeforeSaveWithEmptyString() {
25
+
26
+ $this->object->setValue('');
27
+ $this->object->save();
28
+ $this->assertEquals('Barzahlen', $this->object->getValue());
29
+ }
30
+
31
+ /**
32
+ * Checks that given string is written to the database.
33
+ *
34
+ * @test
35
+ * @loadFixture Title
36
+ */
37
+ public function testTitleBeforeSaveWithValidString() {
38
+
39
+ $this->object->setValue('Barzahlen (Pay Cash Online)');
40
+ $this->object->save();
41
+ $this->assertEquals('Barzahlen (Pay Cash Online)', $this->object->getValue());
42
+ }
43
+
44
+ /**
45
+ * Unset everything before the next test.
46
+ */
47
+ protected function tearDown() {
48
+
49
+ $this->object->delete();
50
+ unset($this->object);
51
+ parent::tearDown();
52
+ }
53
+ }
54
+ ?>
app/code/community/ZerebroInternet/Barzahlen/Test/Model/Adminexceptions/Title/fixtures/Title.yaml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ config:
2
+ default/payment/barzahlen/title: Barzahlen (Pay Cash Online)
3
+ default/payment/barzahlen/sandbox: 0
4
+ default/payment/barzahlen/sort_order: 1
5
+ default/payment/barzahlen/active: 1
6
+ default/payment/barzahlen/debug: 1
7
+ default/payment/barzahlen/allowspecific: 1
8
+ default/payment/barzahlen/specificcountry: DE
9
+ default/payment/barzahlen/max_order_total: 1000
10
+ default/payment/barzahlen/shop_id: 1
11
+ default/payment/barzahlen/payment_key: da49244dda9da8158f94134ba26a3ed258bde622
12
+ default/payment/barzahlen/notification_key: 3a25aea969b8768b034e81a64c4812136deab059
13
+ default/payment/barzahlen/custom_var_0: "{{store url=""}}&foo=2"
14
+ default/payment/barzahlen/custom_var_1: Magento 1.6.1.0
15
+ default/payment/barzahlen/custom_var_2: Connect Package 2.0 v.0.9.3-1
app/code/community/ZerebroInternet/Barzahlen/Test/Model/Api/Notification.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class ZerebroInternet_Barzahlen_Test_Model_Api_Notification extends EcomDev_PHPUnit_Test_Case {
4
+
5
+ /**
6
+ * Sets everything for a new test. parent::setUp() is necessary to enable fixtures.
7
+ */
8
+ public function setUp() {
9
+ parent::setUp();
10
+ $this->object = Mage::getModel('barzahlen/api_notification');
11
+ }
12
+
13
+ /**
14
+ * Checks getter functions.
15
+ *
16
+ * @test
17
+ */
18
+ public function testGetVariables() {
19
+ $this->assertEquals(null, $this->object->getNotificationType());
20
+ $this->assertEquals(null, $this->object->getState());
21
+ $this->assertEquals(null, $this->object->getRefundTransactionId());
22
+ $this->assertEquals(null, $this->object->getTransactionId());
23
+ $this->assertEquals(null, $this->object->getOriginTransactionId());
24
+ $this->assertEquals(null, $this->object->getShopId());
25
+ $this->assertEquals(null, $this->object->getCustomerEmail());
26
+ $this->assertEquals(null, $this->object->getAmount());
27
+ $this->assertEquals(null, $this->object->getCurrency());
28
+ $this->assertEquals(null, $this->object->getOrderId());
29
+ $this->assertEquals(null, $this->object->getOriginOrderId());
30
+ $this->assertEquals(null, $this->object->getCustomVar0());
31
+ $this->assertEquals(null, $this->object->getCustomVar1());
32
+ $this->assertEquals(null, $this->object->getCustomVar2());
33
+ $this->assertEquals(array(null, null, null), $this->object->getCustomVar());
34
+ }
35
+
36
+ /**
37
+ * Unset everything before the next test.
38
+ */
39
+ protected function tearDown() {
40
+
41
+ unset($this->object);
42
+ parent::tearDown();
43
+ }
44
+ }
45
+ ?>
app/code/community/ZerebroInternet/Barzahlen/Test/Model/Api/Request/Cancel.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class ZerebroInternet_Barzahlen_Test_Model_Api_Request_Cancel extends EcomDev_PHPUnit_Test_Case {
4
+
5
+ /**
6
+ * Sets everything for a new test. parent::setUp() is necessary to enable fixtures.
7
+ */
8
+ public function setUp() {
9
+ parent::setUp();
10
+ $this->object = Mage::getModel('barzahlen/api_request_cancel');
11
+ }
12
+
13
+ /**
14
+ * Checks getter functions.
15
+ *
16
+ * @test
17
+ */
18
+ public function testGetVariables() {
19
+ $this->assertEquals(null, $this->object->getTransactionId());
20
+ }
21
+
22
+ /**
23
+ * Unset everything before the next test.
24
+ */
25
+ protected function tearDown() {
26
+
27
+ unset($this->object);
28
+ parent::tearDown();
29
+ }
30
+ }
31
+ ?>
app/code/community/ZerebroInternet/Barzahlen/Test/Model/Api/Request/Payment.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class ZerebroInternet_Barzahlen_Test_Model_Api_Request_Payment extends EcomDev_PHPUnit_Test_Case {
4
+
5
+ /**
6
+ * Sets everything for a new test. parent::setUp() is necessary to enable fixtures.
7
+ */
8
+ public function setUp() {
9
+ parent::setUp();
10
+ $this->object = Mage::getModel('barzahlen/api_request_payment');
11
+ }
12
+
13
+ /**
14
+ * Checks getter functions.
15
+ *
16
+ * @test
17
+ */
18
+ public function testGetVariables() {
19
+ $this->assertEquals(null, $this->object->getTransactionId());
20
+ $this->assertEquals(null, $this->object->getPaymentSlipLink());
21
+ $this->assertEquals(null, $this->object->getExpirationNotice());
22
+ $this->assertEquals(null, $this->object->getInfotext1());
23
+ $this->assertEquals(null, $this->object->getInfotext2());
24
+ }
25
+
26
+ /**
27
+ * Unset everything before the next test.
28
+ */
29
+ protected function tearDown() {
30
+
31
+ unset($this->object);
32
+ parent::tearDown();
33
+ }
34
+ }
35
+ ?>
app/code/community/ZerebroInternet/Barzahlen/Test/Model/Api/Request/Refund.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class ZerebroInternet_Barzahlen_Test_Model_Api_Request_Refund extends EcomDev_PHPUnit_Test_Case {
4
+
5
+ /**
6
+ * Sets everything for a new test. parent::setUp() is necessary to enable fixtures.
7
+ */
8
+ public function setUp() {
9
+ parent::setUp();
10
+ $this->object = Mage::getModel('barzahlen/api_request_refund');
11
+ }
12
+
13
+ /**
14
+ * Checks getter functions.
15
+ *
16
+ * @test
17
+ */
18
+ public function testGetVariables() {
19
+ $this->assertEquals(null, $this->object->getOriginTransactionId());
20
+ $this->assertEquals(null, $this->object->getRefundTransactionId());
21
+ }
22
+
23
+ /**
24
+ * Unset everything before the next test.
25
+ */
26
+ protected function tearDown() {
27
+
28
+ unset($this->object);
29
+ parent::tearDown();
30
+ }
31
+ }
32
+ ?>
app/code/community/ZerebroInternet/Barzahlen/Test/Model/Api/Request/Resend.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class ZerebroInternet_Barzahlen_Test_Model_Api_Request_Resend extends EcomDev_PHPUnit_Test_Case {
4
+
5
+ /**
6
+ * Sets everything for a new test. parent::setUp() is necessary to enable fixtures.
7
+ */
8
+ public function setUp() {
9
+ parent::setUp();
10
+ $this->object = Mage::getModel('barzahlen/api_request_resend');
11
+ }
12
+
13
+ /**
14
+ * Checks getter functions.
15
+ *
16
+ * @test
17
+ */
18
+ public function testGetVariables() {
19
+ $this->assertEquals(null, $this->object->getTransactionId());
20
+ }
21
+
22
+ /**
23
+ * Unset everything before the next test.
24
+ */
25
+ protected function tearDown() {
26
+
27
+ unset($this->object);
28
+ parent::tearDown();
29
+ }
30
+ }
31
+ ?>
app/code/community/ZerebroInternet/Barzahlen/Test/Model/Barzahlen.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class ZerebroInternet_Barzahlen_Test_Model_Barzahlen extends EcomDev_PHPUnit_Test_Case {
4
+
5
+ /**
6
+ * Sets everything for a new test. parent::setUp() is necessary to enable fixtures.
7
+ */
8
+ public function setUp() {
9
+ parent::setUp();
10
+ $this->object = Mage::getModel('barzahlen/barzahlen');
11
+ }
12
+
13
+ /**
14
+ * Checks that all attributes are set.
15
+ *
16
+ * @test
17
+ */
18
+ public function testCorrectModuleSettingConstants() {
19
+
20
+ //This test every Module Setting Constant as defined in the Barzahlen Model
21
+ $this->assertAttributeEquals('barzahlen', '_code', $this->object);
22
+ $this->assertAttributeEquals('barzahlen', '_paymentMethod', $this->object);
23
+ $this->assertAttributeEquals('barzahlen/form', '_formBlockType', $this->object);
24
+ $this->assertAttributeEquals('barzahlen/info', '_infoBlockType', $this->object);
25
+ $this->assertAttributeEquals(true, '_canRefund', $this->object);
26
+ $this->assertAttributeEquals(true, '_canRefundInvoicePartial', $this->object);
27
+ $this->assertAttributeEquals(true, '_canUseInternal', $this->object);
28
+ $this->assertAttributeEquals(true, '_canUseCheckout', $this->object);
29
+ $this->assertAttributeEquals(true, '_canUseForMultishipping', $this->object);
30
+ }
31
+
32
+ /**
33
+ * Tests that redirect urls are given back correctly.
34
+ *
35
+ * @test
36
+ */
37
+ public function testGettingUrls() {
38
+ $this->object->getOrderPlaceRedirectUrl();
39
+ $this->object->getBarzahlenRedirectUrl();
40
+ }
41
+
42
+ /**
43
+ * Unset everything before the next test.
44
+ */
45
+ protected function tearDown() {
46
+
47
+ unset($this->object);
48
+ parent::tearDown();
49
+ }
50
+ }
51
+ ?>
app/code/community/ZerebroInternet/Barzahlen/controllers/CheckoutController.php DELETED
@@ -1,40 +0,0 @@
1
- <?php
2
- /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
- *
15
- * @category ZerebroInternet
16
- * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
- * @author Alexander Diebler
20
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
- */
22
-
23
- class ZerebroInternet_Barzahlen_CheckoutController extends Mage_Core_Controller_Front_Action
24
- {
25
- /**
26
- * Checkout function for the Magento shop system.
27
- */
28
- public function processingAction()
29
- {
30
- try {
31
- Mage::getSingleton('barzahlen/payment')->getTransactionId();
32
- } catch (Exception $e) {
33
- Mage::logException($e);
34
- }
35
-
36
- // load success / failure page (final checkout page)
37
- $this->loadLayout();
38
- $this->renderLayout();
39
- }
40
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/ZerebroInternet/Barzahlen/controllers/IpnController.php CHANGED
@@ -1,30 +1,20 @@
1
  <?php
2
  /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
  *
15
  * @category ZerebroInternet
16
  * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
  * @author Alexander Diebler
 
20
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
  */
22
 
23
  class ZerebroInternet_Barzahlen_IpnController extends Mage_Core_Controller_Front_Action
24
  {
25
  /**
26
- * Instantiate IPN model and pass IPN request to it. After successful hash validation HTTP header
27
- * 200 is send first before the database is updated.
28
  */
29
  public function indexAction()
30
  {
@@ -32,17 +22,25 @@ class ZerebroInternet_Barzahlen_IpnController extends Mage_Core_Controller_Front
32
  $data = $this->getRequest()->getQuery();
33
  $ipnModel = Mage::getModel('barzahlen/ipn');
34
 
35
- if ($ipnModel->sendResponseHeader($data)) {
36
- header("HTTP/1.1 200 OK");
37
- header("Status: 200 OK");
38
- $ipnModel->updateDatabase();
39
  } else {
40
- header("HTTP/1.1 400 Bad Request");
41
- header("Status: 400 Bad Request");
42
- die();
43
  }
44
  } catch (Exception $e) {
45
  Mage::logException($e);
46
  }
47
  }
 
 
 
 
 
 
 
 
 
 
 
 
48
  }
1
  <?php
2
  /**
3
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * @category ZerebroInternet
6
  * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
 
8
  * @author Alexander Diebler
9
+ * @author Martin Seener
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
  */
12
 
13
  class ZerebroInternet_Barzahlen_IpnController extends Mage_Core_Controller_Front_Action
14
  {
15
  /**
16
+ * Instantiate IPN model and pass IPN request to it. After successful hash validation and database update
17
+ * HTTP header 200 is send to confirm callback.
18
  */
19
  public function indexAction()
20
  {
22
  $data = $this->getRequest()->getQuery();
23
  $ipnModel = Mage::getModel('barzahlen/ipn');
24
 
25
+ if ($ipnModel->isDataValid($data) && $ipnModel->updateDatabase()) {
26
+ $this->returnHeader(200);
 
 
27
  } else {
28
+ $this->returnHeader(400);
 
 
29
  }
30
  } catch (Exception $e) {
31
  Mage::logException($e);
32
  }
33
  }
34
+
35
+ protected function returnHeader($code)
36
+ {
37
+ if ($code == 200) {
38
+ header("HTTP/1.1 200 OK");
39
+ header("Status: 200 OK");
40
+ } else {
41
+ header("HTTP/1.1 400 Bad Request");
42
+ header("Status: 400 Bad Request");
43
+ die();
44
+ }
45
+ }
46
  }
app/code/community/ZerebroInternet/Barzahlen/controllers/ResendController.php CHANGED
@@ -1,22 +1,12 @@
1
  <?php
2
  /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
  *
15
  * @category ZerebroInternet
16
  * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
  * @author Alexander Diebler
 
20
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
  */
22
 
@@ -32,7 +22,7 @@ class ZerebroInternet_Barzahlen_ResendController extends Mage_Adminhtml_Controll
32
 
33
  $transactionId = $order->getPayment()->getAdditionalInformation('transaction_id');
34
 
35
- if (Mage::getSingleton('barzahlen/resend')->resend($transactionId)) {
36
  $this->_getSession()->addSuccess($this->__('bz_adm_resend_payment_success'));
37
  } else {
38
  $this->_getSession()->addError($this->__('bz_adm_resend_error'));
@@ -51,12 +41,12 @@ class ZerebroInternet_Barzahlen_ResendController extends Mage_Adminhtml_Controll
51
 
52
  $transactionId = $creditmemo->getTransactionId();
53
 
54
- if (Mage::getSingleton('barzahlen/resend')->resend($transactionId)) {
55
  $this->_getSession()->addSuccess($this->__('bz_adm_resend_refund_success'));
56
  } else {
57
  $this->_getSession()->addError($this->__('bz_adm_resend_error'));
58
  }
59
 
60
- $this->_redirect('adminhtml/sales_creditmemo/view', array('creditmemo_id' => $id));
61
  }
62
  }
1
  <?php
2
  /**
3
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * @category ZerebroInternet
6
  * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
 
8
  * @author Alexander Diebler
9
+ * @author Martin Seener
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
  */
12
 
22
 
23
  $transactionId = $order->getPayment()->getAdditionalInformation('transaction_id');
24
 
25
+ if (Mage::getSingleton('barzahlen/barzahlen')->resendSlip($transactionId)) {
26
  $this->_getSession()->addSuccess($this->__('bz_adm_resend_payment_success'));
27
  } else {
28
  $this->_getSession()->addError($this->__('bz_adm_resend_error'));
41
 
42
  $transactionId = $creditmemo->getTransactionId();
43
 
44
+ if (Mage::getSingleton('barzahlen/barzahlen')->resendSlip($transactionId)) {
45
  $this->_getSession()->addSuccess($this->__('bz_adm_resend_refund_success'));
46
  } else {
47
  $this->_getSession()->addError($this->__('bz_adm_resend_error'));
48
  }
49
 
50
+ $this->_redirect('adminhtml/sales_order_creditmemo/view', array('creditmemo_id' => $id));
51
  }
52
  }
app/code/community/ZerebroInternet/Barzahlen/etc/config.xml CHANGED
@@ -1,180 +1,157 @@
1
  <?xml version="1.0"?>
2
  <!--
3
  /**
4
- * Barzahlen Payment Module
5
- *
6
- * NOTICE OF LICENSE
7
- *
8
- * This source file is subject to the Open Software License (OSL 3.0)
9
- * that is bundled with this package in the file LICENSE.txt.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://opensource.org/licenses/osl-3.0.php
12
- * If you did not receive a copy of the license and are unable to
13
- * obtain it through the world-wide-web, please send an email
14
- * to info@barzahlen.de so we can send you a copy immediately.
15
  *
16
  * @category ZerebroInternet
17
  * @package ZerebroInternet_Barzahlen
18
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
19
- * @author Martin Seener
20
  * @author Alexander Diebler
 
21
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
22
  */
23
  -->
24
  <config>
25
 
26
- <modules>
27
- <ZerebroInternet_Barzahlen>
28
- <version>1.2.1</version>
29
- </ZerebroInternet_Barzahlen>
30
- </modules>
31
 
32
- <global>
33
- <models>
34
- <barzahlen>
35
- <class>ZerebroInternet_Barzahlen_Model</class>
36
- </barzahlen>
37
- </models>
38
- <blocks>
39
- <barzahlen>
40
- <class>ZerebroInternet_Barzahlen_Block</class>
41
- </barzahlen>
42
- <adminhtml>
43
- <rewrite>
44
- <sales_order_view>ZerebroInternet_Barzahlen_Block_Adminhtml_Sales_Order_View</sales_order_view>
45
- <sales_order_creditmemo_view>ZerebroInternet_Barzahlen_Block_Adminhtml_Sales_Order_Creditmemo_View</sales_order_creditmemo_view>
46
- </rewrite>
47
- </adminhtml>
48
- </blocks>
49
- <helpers>
50
- <barzahlen>
51
- <class>ZerebroInternet_Barzahlen_Helper</class>
52
- </barzahlen>
53
- </helpers>
54
- <resources>
55
- <barzahlen_setup>
56
- <setup>
57
- <module>ZerebroInternet_Barzahlen</module>
58
- </setup>
59
- <connection>
60
- <use>core_setup</use>
61
- </connection>
62
- </barzahlen_setup>
63
- <barzahlen_write>
64
- <connection>
65
- <use>core_write</use>
66
- </connection>
67
- </barzahlen_write>
68
- <barzahlen_read>
69
- <connection>
70
- <use>core_read</use>
71
- </connection>
72
- </barzahlen_read>
73
- </resources>
74
- </global>
75
 
76
- <frontend>
77
- <secure_url>
78
- <barzahlen_checkout_processing>/barzahlen/checkout/processing</barzahlen_checkout_processing>
79
- </secure_url>
80
- <translate>
81
- <modules>
82
- <ZerebroInternet_Barzahlen>
83
- <files>
84
- <default>ZerebroInternet_Barzahlen_Frontend.csv</default>
85
- </files>
86
- </ZerebroInternet_Barzahlen>
87
- </modules>
88
- </translate>
89
- <layout>
90
- <updates>
91
- <barzahlen>
92
- <file>barzahlen.xml</file>
93
- </barzahlen>
94
- </updates>
95
- </layout>
96
- <routers>
97
- <barzahlen>
98
- <use>standard</use>
99
- <args>
100
- <module>ZerebroInternet_Barzahlen</module>
101
- <frontName>barzahlen</frontName>
102
- </args>
103
- </barzahlen>
104
- </routers>
105
- </frontend>
 
106
 
107
- <adminhtml>
108
- <translate>
109
- <modules>
110
- <ZerebroInternet_Barzahlen>
111
- <files>
112
- <default>ZerebroInternet_Barzahlen_Admin.csv</default>
113
- </files>
114
- </ZerebroInternet_Barzahlen>
115
- </modules>
116
- </translate>
117
- <events>
118
- <checkout_submit_all_after>
119
- <observers>
120
- <barzahlen_observer>
121
- <type>singleton</type>
122
- <class>barzahlen/payment</class>
123
- <method>adminObserver</method>
124
- </barzahlen_observer>
125
- </observers>
126
- </checkout_submit_all_after>
127
- <order_cancel_after>
128
- <observers>
129
- <barzahlen_observer>
130
- <type>singleton</type>
131
- <class>barzahlen/cancel</class>
132
- <method>cancelObserver</method>
133
- </barzahlen_observer>
134
- </observers>
135
- </order_cancel_after>admin_session_user_login_success
136
- <sales_order_creditmemo_refund>
137
- <observers>
138
- <barzahlen_observer>
139
- <type>singleton</type>
140
- <class>barzahlen/refund</class>
141
- <method>refundObserver</method>
142
- </barzahlen_observer>
143
- </observers>
144
- </sales_order_creditmemo_refund>
145
- <admin_session_user_login_success>
146
- <observers>
147
- <barzahlen_observer>
148
- <type>singleton</type>
149
- <class>barzahlen/check</class>
150
- <method>checkObserver</method>
151
- </barzahlen_observer>
152
- </observers>
153
- </admin_session_user_login_success>
154
- </events>
155
- </adminhtml>
156
 
157
- <default>
158
- <payment>
159
- <barzahlen>
160
- <model>barzahlen/barzahlen</model>
161
- <title>Barzahlen</title>
162
- <active>0</active>
163
- <order_status>pending</order_status>
164
- <allowspecific>1</allowspecific>
165
- <specificcountry>DE</specificcountry>
166
- <max_order_total>999.99</max_order_total>
167
- <sort_order>-1</sort_order>
168
- </barzahlen>
169
- </payment>
170
- </default>
 
171
 
172
- <phpunit>
173
- <suite>
174
- <modules>
175
- <ZerebroInternet_Barzahlen />
176
- </modules>
177
- </suite>
178
- </phpunit>
179
 
180
  </config>
1
  <?xml version="1.0"?>
2
  <!--
3
  /**
4
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
5
  *
6
  * @category ZerebroInternet
7
  * @package ZerebroInternet_Barzahlen
8
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
 
9
  * @author Alexander Diebler
10
+ * @author Martin Seener
11
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
12
  */
13
  -->
14
  <config>
15
 
16
+ <modules>
17
+ <ZerebroInternet_Barzahlen>
18
+ <version>1.3.0</version>
19
+ </ZerebroInternet_Barzahlen>
20
+ </modules>
21
 
22
+ <global>
23
+ <blocks>
24
+ <barzahlen>
25
+ <class>ZerebroInternet_Barzahlen_Block</class>
26
+ </barzahlen>
27
+ </blocks>
28
+ <helpers>
29
+ <barzahlen>
30
+ <class>ZerebroInternet_Barzahlen_Helper</class>
31
+ </barzahlen>
32
+ </helpers>
33
+ <models>
34
+ <barzahlen>
35
+ <class>ZerebroInternet_Barzahlen_Model</class>
36
+ </barzahlen>
37
+ </models>
38
+ <resources>
39
+ <barzahlen_setup>
40
+ <setup>
41
+ <module>ZerebroInternet_Barzahlen</module>
42
+ </setup>
43
+ <connection>
44
+ <use>core_setup</use>
45
+ </connection>
46
+ </barzahlen_setup>
47
+ <barzahlen_write>
48
+ <connection>
49
+ <use>core_write</use>
50
+ </connection>
51
+ </barzahlen_write>
52
+ <barzahlen_read>
53
+ <connection>
54
+ <use>core_read</use>
55
+ </connection>
56
+ </barzahlen_read>
57
+ </resources>
58
+ </global>
 
 
 
 
 
 
59
 
60
+ <frontend>
61
+ <routers>
62
+ <barzahlen>
63
+ <use>standard</use>
64
+ <args>
65
+ <module>ZerebroInternet_Barzahlen</module>
66
+ <frontName>barzahlen</frontName>
67
+ </args>
68
+ </barzahlen>
69
+ </routers>
70
+ <events>
71
+ <core_block_abstract_to_html_before>
72
+ <observers>
73
+ <barzahlen_core_block_abstract_to_html_before>
74
+ <type>singleton</type>
75
+ <class>barzahlen/observer</class>
76
+ <method>insertInfotext</method>
77
+ </barzahlen_core_block_abstract_to_html_before>
78
+ </observers>
79
+ </core_block_abstract_to_html_before>
80
+ </events>
81
+ <translate>
82
+ <modules>
83
+ <ZerebroInternet_Barzahlen>
84
+ <files>
85
+ <default>ZerebroInternet_Barzahlen.csv</default>
86
+ </files>
87
+ </ZerebroInternet_Barzahlen>
88
+ </modules>
89
+ </translate>
90
+ </frontend>
91
 
92
+ <adminhtml>
93
+ <events>
94
+ <order_cancel_after>
95
+ <observers>
96
+ <barzahlen_observer>
97
+ <type>singleton</type>
98
+ <class>barzahlen/barzahlen</class>
99
+ <method>cancelPaymentSlip</method>
100
+ </barzahlen_observer>
101
+ </observers>
102
+ </order_cancel_after>
103
+ <admin_session_user_login_success>
104
+ <observers>
105
+ <barzahlen_observer>
106
+ <type>singleton</type>
107
+ <class>barzahlen/observer</class>
108
+ <method>checkVersion</method>
109
+ </barzahlen_observer>
110
+ </observers>
111
+ </admin_session_user_login_success>
112
+ <core_block_abstract_prepare_layout_before>
113
+ <observers>
114
+ <barzahlen_core_block_abstract_prepare_layout_before>
115
+ <type>singleton</type>
116
+ <class>barzahlen/observer</class>
117
+ <method>addGridButtons</method>
118
+ </barzahlen_core_block_abstract_prepare_layout_before>
119
+ </observers>
120
+ </core_block_abstract_prepare_layout_before>
121
+ </events>
122
+ <translate>
123
+ <modules>
124
+ <ZerebroInternet_Barzahlen>
125
+ <files>
126
+ <default>ZerebroInternet_Barzahlen.csv</default>
127
+ </files>
128
+ </ZerebroInternet_Barzahlen>
129
+ </modules>
130
+ </translate>
131
+ </adminhtml>
 
 
 
 
 
 
 
 
 
132
 
133
+ <default>
134
+ <payment>
135
+ <barzahlen>
136
+ <model>barzahlen/barzahlen</model>
137
+ <title>Barzahlen</title>
138
+ <active>0</active>
139
+ <order_status>pending</order_status>
140
+ <allowspecific>1</allowspecific>
141
+ <specificcountry>DE</specificcountry>
142
+ <max_order_total>999.99</max_order_total>
143
+ <sort_order>-1</sort_order>
144
+ <payment_action>order</payment_action>
145
+ </barzahlen>
146
+ </payment>
147
+ </default>
148
 
149
+ <phpunit>
150
+ <suite>
151
+ <modules>
152
+ <ZerebroInternet_Barzahlen />
153
+ </modules>
154
+ </suite>
155
+ </phpunit>
156
 
157
  </config>
app/code/community/ZerebroInternet/Barzahlen/etc/system.xml CHANGED
@@ -1,23 +1,13 @@
1
  <?xml version="1.0"?>
2
  <!--
3
  /**
4
- * Barzahlen Payment Module
5
- *
6
- * NOTICE OF LICENSE
7
- *
8
- * This source file is subject to the Open Software License (OSL 3.0)
9
- * that is bundled with this package in the file LICENSE.txt.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://opensource.org/licenses/osl-3.0.php
12
- * If you did not receive a copy of the license and are unable to
13
- * obtain it through the world-wide-web, please send an email
14
- * to info@barzahlen.de so we can send you a copy immediately.
15
  *
16
  * @category ZerebroInternet
17
  * @package ZerebroInternet_Barzahlen
18
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
19
- * @author Martin Seener
20
  * @author Alexander Diebler
 
21
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
22
  */
23
  -->
@@ -102,30 +92,6 @@
102
  <show_in_website>1</show_in_website>
103
  <show_in_store>1</show_in_store>
104
  </notification_key>
105
- <custom_var_0 translate="label">
106
- <label>bz_adm_customvar0_title</label>
107
- <frontend_type>text</frontend_type>
108
- <sort_order>8</sort_order>
109
- <show_in_default>1</show_in_default>
110
- <show_in_website>1</show_in_website>
111
- <show_in_store>1</show_in_store>
112
- </custom_var_0>
113
- <custom_var_1 translate="label">
114
- <label>bz_adm_customvar1_title</label>
115
- <frontend_type>text</frontend_type>
116
- <sort_order>9</sort_order>
117
- <show_in_default>1</show_in_default>
118
- <show_in_website>1</show_in_website>
119
- <show_in_store>1</show_in_store>
120
- </custom_var_1>
121
- <custom_var_2 translate="label">
122
- <label>bz_adm_customvar2_title</label>
123
- <frontend_type>text</frontend_type>
124
- <sort_order>10</sort_order>
125
- <show_in_default>1</show_in_default>
126
- <show_in_website>1</show_in_website>
127
- <show_in_store>1</show_in_store>
128
- </custom_var_2>
129
  <allowspecific translate="label">
130
  <backend_model>barzahlen/adminexceptions_allspecificcountries</backend_model>
131
  <label>bz_adm_allowspecific_title</label>
1
  <?xml version="1.0"?>
2
  <!--
3
  /**
4
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
5
  *
6
  * @category ZerebroInternet
7
  * @package ZerebroInternet_Barzahlen
8
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
 
9
  * @author Alexander Diebler
10
+ * @author Martin Seener
11
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
12
  */
13
  -->
92
  <show_in_website>1</show_in_website>
93
  <show_in_store>1</show_in_store>
94
  </notification_key>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  <allowspecific translate="label">
96
  <backend_model>barzahlen/adminexceptions_allspecificcountries</backend_model>
97
  <label>bz_adm_allowspecific_title</label>
app/design/adminhtml/base/default/template/barzahlen/form.phtml CHANGED
@@ -1,39 +1,27 @@
1
  <?php
2
  /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
  *
15
  * @category ZerebroInternet
16
  * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2012 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
  * @author Alexander Diebler
 
20
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
  */
22
-
23
  ?>
 
24
  <?php $_code = $this->getMethodCode(); ?>
25
  <ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none">
26
  <li>
27
- <img src="https://cdn.barzahlen.de/images/barzahlen_logo.png" height="45" alt="Barzahlen" class="v-middle" />
28
  <?php
29
- echo Mage::getModel('barzahlen/barzahlen')->getConfigData('sandbox') ? "<br/><br/>".$this->__('bz_adm_sandbox') : null;
30
- echo "<br/><br/>".$this->__('bz_adm_partner')."&nbsp;";
31
  for($i = 1; $i <= 10; $i++) {
32
  $count = str_pad($i,2,"0",STR_PAD_LEFT);
33
- echo '<img src="https://cdn.barzahlen.de/images/barzahlen_partner_'.$count.'.png" alt="" style="vertical-align: middle; height: 25px;" />';
34
  }
35
  ?>
36
- <br /><br />
37
  </li>
38
  </ul>
39
 
1
  <?php
2
  /**
3
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * @category ZerebroInternet
6
  * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
 
8
  * @author Alexander Diebler
9
+ * @author Martin Seener
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
  */
 
12
  ?>
13
+
14
  <?php $_code = $this->getMethodCode(); ?>
15
  <ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none">
16
  <li>
 
17
  <?php
18
+ echo $this->__('bz_adm_partner') . "&nbsp;";
 
19
  for($i = 1; $i <= 10; $i++) {
20
  $count = str_pad($i,2,"0",STR_PAD_LEFT);
21
+ echo '<img src="https://cdn.barzahlen.de/images/barzahlen_partner_'.$count.'.png" alt="" style="vertical-align: middle; height: 25px;" >';
22
  }
23
  ?>
24
+ <br ><br >
25
  </li>
26
  </ul>
27
 
app/design/adminhtml/base/default/template/barzahlen/info.phtml CHANGED
@@ -1,24 +1,14 @@
1
  <?php
2
  /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
  *
15
  * @category ZerebroInternet
16
  * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2012 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
  * @author Alexander Diebler
 
20
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
  */
22
  ?>
23
 
24
- <img id="payment_form_<?php echo $this->getMethodCode() ?>" src="https://cdn.barzahlen.de/images/barzahlen_logo.png" height="57" width="168" alt="Barzahlen Logo" />
1
  <?php
2
  /**
3
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * @category ZerebroInternet
6
  * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
 
8
  * @author Alexander Diebler
9
+ * @author Martin Seener
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
  */
12
  ?>
13
 
14
+ <img src="https://cdn.barzahlen.de/images/checkout_barzahlen_logo.png" alt="Barzahlen" style="max-width: 100%;">
app/design/adminhtml/base/default/template/barzahlen/mark.phtml DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
- /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
- *
15
- * @category ZerebroInternet
16
- * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2012 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
- * @author Alexander Diebler
20
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
- */
22
- ?>
23
-
24
- <img src="https://cdn.barzahlen.de/images/barzahlen_logo.png" height="45" alt="Barzahlen" class="v-middle" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/barzahlen/info.phtml CHANGED
@@ -1,24 +1,14 @@
1
  <?php
2
  /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
  *
15
  * @category ZerebroInternet
16
  * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2012 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
  * @author Alexander Diebler
 
20
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
  */
22
  ?>
23
 
24
- <a href="https://partner.barzahlen.de"><img id="payment_form_<?php echo $this->getMethodCode() ?>" src="https://cdn.barzahlen.de/images/barzahlen_logo.png" height="45" width="133" alt="Barzahlen" /></a>
1
  <?php
2
  /**
3
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * @category ZerebroInternet
6
  * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
 
8
  * @author Alexander Diebler
9
+ * @author Martin Seener
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
  */
12
  ?>
13
 
14
+ <img src="https://cdn.barzahlen.de/images/checkout_barzahlen_logo.png" alt="Barzahlen" style="max-width: 100%;">
app/design/frontend/base/default/layout/barzahlen.xml DELETED
@@ -1,33 +0,0 @@
1
- <?xml version="1.0"?>
2
- <!--
3
- /**
4
- * Barzahlen Payment Module
5
- *
6
- * NOTICE OF LICENSE
7
- *
8
- * This source file is subject to the Open Software License (OSL 3.0)
9
- * that is bundled with this package in the file LICENSE.txt.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://opensource.org/licenses/osl-3.0.php
12
- * If you did not receive a copy of the license and are unable to
13
- * obtain it through the world-wide-web, please send an email
14
- * to info@barzahlen.de so we can send you a copy immediately.
15
- *
16
- * @category ZerebroInternet
17
- * @package ZerebroInternet_Barzahlen
18
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
19
- * @author Martin Seener
20
- * @author Alexander Diebler
21
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
22
- */
23
- -->
24
- <layout version="1.2.1">
25
- <barzahlen_checkout_processing>
26
- <reference name="root">
27
- <action method="setTemplate"><template>page/1column.phtml</template></action>
28
- </reference>
29
- <reference name="content">
30
- <block type="core/template" name="barzahlen_processing" template="barzahlen/processing.phtml" />
31
- </reference>
32
- </barzahlen_checkout_processing>
33
- </layout>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/barzahlen/form.phtml CHANGED
@@ -1,42 +1,30 @@
1
  <?php
2
  /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
  *
15
  * @category ZerebroInternet
16
  * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2012 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
  * @author Alexander Diebler
 
20
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
  */
22
-
23
  ?>
 
24
  <?php $_code = $this->getMethodCode(); ?>
25
  <ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none">
26
  <li>
27
  <?php
28
- echo '<div>';
29
- echo '<img src="https://cdn.barzahlen.de/images/barzahlen_special.png" style="float: right; margin-left: 10px; max-width: 180px; max-height: 180px;">';
30
- echo $this->__('bz_frnt_info');
31
- echo Mage::getModel('barzahlen/barzahlen')->getConfigData('sandbox') ? "<br/><br/>".$this->__('bz_frnt_sandbox') : null;
32
- echo "<br/><br/>".$this->__('bz_frnt_partner')."&nbsp;";
33
  for($i = 1; $i <= 10; $i++) {
34
  $count = str_pad($i,2,"0",STR_PAD_LEFT);
35
- echo '<img src="https://cdn.barzahlen.de/images/barzahlen_partner_'.$count.'.png" alt="" style="vertical-align: middle; height: 25px;" />';
36
  }
37
  echo '</div>';
38
  ?>
39
- <br /><br />
40
  </li>
41
  </ul>
42
-
1
  <?php
2
  /**
3
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * @category ZerebroInternet
6
  * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
 
8
  * @author Alexander Diebler
9
+ * @author Martin Seener
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
  */
 
12
  ?>
13
+
14
  <?php $_code = $this->getMethodCode(); ?>
15
  <ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none">
16
  <li>
17
  <?php
18
+ echo '<div id="barzahlen_description">';
19
+ echo '<img id="barzahlen_special" src="https://cdn.barzahlen.de/images/barzahlen_special.png" style="float: right; margin-left: 10px; max-width: 180px; max-height: 180px;">';
20
+ echo $this->__('bz_frnt_info') . "<br><br>";
21
+ echo $this->__('bz_frnt_partner') . "&nbsp;";
 
22
  for($i = 1; $i <= 10; $i++) {
23
  $count = str_pad($i,2,"0",STR_PAD_LEFT);
24
+ echo '<img src="https://cdn.barzahlen.de/images/barzahlen_partner_'.$count.'.png" alt="" style="vertical-align: middle; height: 25px; display: inline-block;">';
25
  }
26
  echo '</div>';
27
  ?>
 
28
  </li>
29
  </ul>
30
+ <script src="https://cdn.barzahlen.de/js/selection.js"></script>
app/design/frontend/base/default/template/barzahlen/info.phtml CHANGED
@@ -1,24 +1,14 @@
1
  <?php
2
  /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
  *
15
  * @category ZerebroInternet
16
  * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2012 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
  * @author Alexander Diebler
 
20
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
  */
22
  ?>
23
 
24
- <img id="payment_form_<?php echo $this->getMethodCode() ?>" src="https://cdn.barzahlen.de/images/barzahlen_logo.png" height="57" width="168" alt="Barzahlen Logo" />
1
  <?php
2
  /**
3
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * @category ZerebroInternet
6
  * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
 
8
  * @author Alexander Diebler
9
+ * @author Martin Seener
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
  */
12
  ?>
13
 
14
+ <img src="https://cdn.barzahlen.de/images/checkout_barzahlen_logo.png" alt="Barzahlen" style="max-width: 100%;">
app/design/frontend/base/default/template/barzahlen/mark.phtml CHANGED
@@ -1,24 +1,14 @@
1
  <?php
2
  /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
  *
15
  * @category ZerebroInternet
16
  * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2012 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
  * @author Alexander Diebler
 
20
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
  */
22
  ?>
23
 
24
- <img src="https://cdn.barzahlen.de/images/barzahlen_logo.png" height="45" alt="Barzahlen" class="v-middle" />
1
  <?php
2
  /**
3
+ * Barzahlen Payment Module for Magento
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * @category ZerebroInternet
6
  * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
 
8
  * @author Alexander Diebler
9
+ * @author Martin Seener
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
  */
12
  ?>
13
 
14
+ <img id="barzahlen_logo" src="https://cdn.barzahlen.de/images/barzahlen_logo.png" alt="Barzahlen" style="vertical-align: middle; height: 45px;">
app/design/frontend/base/default/template/barzahlen/processing.phtml DELETED
@@ -1,46 +0,0 @@
1
- <?php
2
- /**
3
- * Barzahlen Payment Module
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@barzahlen.de so we can send you a copy immediately.
14
- *
15
- * @category ZerebroInternet
16
- * @package ZerebroInternet_Barzahlen
17
- * @copyright Copyright (c) 2012 Zerebro Internet GmbH (http://www.barzahlen.de)
18
- * @author Martin Seener
19
- * @author Alexander Diebler
20
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
21
- */
22
-
23
- // Get Checkout Information
24
- $session = Mage::getSingleton('checkout/session');
25
- ?>
26
-
27
- <div class="page-title" style="padding:0; margin:0; margin-bottom: 10px;">
28
- <h1 style="padding:0; margin:0; margin-bottom: 10px;">
29
- <?php echo $session->getResponse() == 200 ? $this->__('bz_frnt_processing_orderreceived') : $this->__('bz_frnt_processing_transactionerror'); ?>
30
- </h1>
31
- </div>
32
-
33
- <?php
34
- if($session->getResponse() != 200) {
35
- echo "<h2 class=\"sub-title\">". $this->__('bz_frnt_processing_erroroccured') ."</h2>";
36
- }
37
- else {
38
- echo $session->getBzInfotext1();
39
- }
40
- ?>
41
-
42
- <div class="buttons-set">
43
- <button type="button" class="button" title="<?php echo $this->__('bz_frnt_processing_cntshp'); ?>" onclick="window.location='<?php echo $this->getUrl(); ?>'">
44
- <span><span><?php echo $this->__('bz_frnt_processing_cntshp'); ?></span></span>
45
- </button>
46
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/barzahlen/success.phtml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Barzahlen Payment Module for Magento
4
+ *
5
+ * @category ZerebroInternet
6
+ * @package ZerebroInternet_Barzahlen
7
+ * @copyright Copyright (c) 2014 Cash Payment Solutions GmbH (https://www.barzahlen.de)
8
+ * @author Alexander Diebler
9
+ * @author Martin Seener
10
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
11
+ */
12
+ ?>
13
+
14
+ <?php
15
+ echo $this->getBarzahlenInfotext();
16
+ echo $this->getChildHtml('child');
17
+ ?>
app/etc/modules/ZerebroInternet_Barzahlen.xml CHANGED
@@ -1,26 +1,4 @@
1
  <?xml version="1.0"?>
2
- <!--
3
- /**
4
- * Barzahlen Payment Module
5
- *
6
- * NOTICE OF LICENSE
7
- *
8
- * This source file is subject to the Open Software License (OSL 3.0)
9
- * that is bundled with this package in the file LICENSE.txt.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://opensource.org/licenses/osl-3.0.php
12
- * If you did not receive a copy of the license and are unable to
13
- * obtain it through the world-wide-web, please send an email
14
- * to info@barzahlen.de so we can send you a copy immediately.
15
- *
16
- * @category ZerebroInternet
17
- * @package ZerebroInternet_Barzahlen
18
- * @copyright Copyright (c) 2013 Zerebro Internet GmbH (http://www.barzahlen.de)
19
- * @author Martin Seener
20
- * @author Alexander Diebler
21
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL-3.0)
22
- */
23
- -->
24
  <config>
25
  <modules>
26
  <ZerebroInternet_Barzahlen>
1
  <?xml version="1.0"?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  <config>
3
  <modules>
4
  <ZerebroInternet_Barzahlen>
app/locale/de_DE/{ZerebroInternet_Barzahlen_Admin.csv → ZerebroInternet_Barzahlen.csv} RENAMED
@@ -1,3 +1,12 @@
 
 
 
 
 
 
 
 
 
1
  "bz_adm_title","Barzahlen"
2
  "bz_adm_enabled_title","Aktiviert"
3
  "bz_adm_order_status_title","Status neuer Bestellungen"
@@ -46,6 +55,4 @@
46
  "bz_adm_partner","<b>Bezahlen möglich bei:</b>"
47
  "bz_adm_sandbox","Der <strong>Sandbox Modus</strong> ist aktiv. Allen getätigten Zahlungen wird ein Test-Zahlschein zugewiesen. Dieser kann nicht von unseren Einzelhandelspartnern verarbeitet werden."
48
  "bz_frnt_ipn_pending","Barzahlen: Zahlschein erfolgreich angefordert und versendet."
49
- "bz_adm_now_available"," Jetzt verfügbar "
50
- "bz_adm_over"," über "
51
- "bz_adm_or"," oder "
1
+ "bz_frnt_info","Mit Abschluss der Bestellung bekommen Sie einen Zahlschein angezeigt, den Sie sich ausdrucken oder auf Ihr Handy schicken lassen können. Bezahlen Sie den Online-Einkauf mit Hilfe des Zahlscheins an der Kasse einer Barzahlen.de-Partnerfiliale."
2
+ "bz_frnt_partner","<b>Bezahlen Sie bei:</b>"
3
+ "bz_frnt_error","Es gab einen Fehler bei der Datenübertragung. Bitte versuchen Sie es erneut oder wählen Sie eine andere Zahlungsmethode."
4
+ "bz_frnt_ipn_pending","Barzahlen: Zahlschein erfolgreich angefordert und versendet."
5
+ "bz_frnt_ipn_paid","Barzahlen: Der Zahlschein wurde beim Offline-Partner bezahlt."
6
+ "bz_frnt_ipn_expired","Barzahlen: Der Zahlungszeitraum des Zahlscheins ist abgelaufen."
7
+ "bz_frnt_ipn_refund_pending","Barzahlen: Die Rückzahlung wurde erfolgreich angestoßen."
8
+ "bz_frnt_ipn_refund_completed","Barzahlen: Die Rückzahlung wurde erfolgreich ausgeführt."
9
+ "bz_frnt_ipn_refund_expired","Barzahlen: Der Rückzahlungszeitraum ist abgelaufen."
10
  "bz_adm_title","Barzahlen"
11
  "bz_adm_enabled_title","Aktiviert"
12
  "bz_adm_order_status_title","Status neuer Bestellungen"
55
  "bz_adm_partner","<b>Bezahlen möglich bei:</b>"
56
  "bz_adm_sandbox","Der <strong>Sandbox Modus</strong> ist aktiv. Allen getätigten Zahlungen wird ein Test-Zahlschein zugewiesen. Dieser kann nicht von unseren Einzelhandelspartnern verarbeitet werden."
57
  "bz_frnt_ipn_pending","Barzahlen: Zahlschein erfolgreich angefordert und versendet."
58
+ "bz_adm_now_available","Version %1$s f&uuml;r Barzahlen.de-Plugin verf&uuml;gbar unter: <a href=""%2$s"" style=""font-size: 1em; color: #333;"" target=""_blank"">%2$s</a>"
 
 
app/locale/de_DE/ZerebroInternet_Barzahlen_Frontend.csv DELETED
@@ -1,16 +0,0 @@
1
- "Barzahlen (Pay Cash Online)","Barzahlen"
2
- "bz_frnt_info","Mit Abschluss der Bestellung bekommen Sie einen Zahlschein angezeigt, den Sie sich ausdrucken oder auf Ihr Handy schicken lassen können. Bezahlen Sie den Online-Einkauf mit Hilfe des Zahlscheins an der Kasse einer Barzahlen-Partnerfiliale."
3
- "bz_frnt_partner","<b>Bezahlen Sie bei:</b>"
4
- "bz_frnt_sandbox","Der <strong>Sandbox Modus</strong> ist aktiv. Allen getätigten Zahlungen wird ein Test-Zahlschein zugewiesen. Dieser kann nicht von unseren Einzelhandelspartnern verarbeitet werden."
5
- "bz_frnt_processing_orderreceived","Ihre Bestellung ist eingegangen"
6
- "bz_frnt_processing_orderno","Ihre Bestellnummer: %s"
7
- "bz_frnt_processing_cntshp","Einkauf fortsetzen"
8
- "bz_frnt_processing_transactionerror","Es trat während der Übertragung der Transaktion ein Fehler auf. Die Bestellung wurde abgebrochen und der Administrator wurde benachrichtigt. Bitte versuchen Sie es später erneut."
9
- "bz_frnt_processing_erroroccured","Beim Bezahlvorgang ist leider ein Fehler aufgetreten!"
10
- "bz_frnt_ipn_pending","Barzahlen: Zahlschein erfolgreich angefordert und versendet."
11
- "bz_frnt_ipn_paid","Barzahlen: Der Zahlschein wurde beim Offline-Partner bezahlt."
12
- "bz_frnt_ipn_expired","Barzahlen: Der Zahlungszeitraum des Zahlscheins ist abgelaufen."
13
- "bz_frnt_ipn_refund_pending","Barzahlen: Die Rückzahlung wurde erfolgreich angestoßen."
14
- "bz_frnt_ipn_refund_completed","Barzahlen: Die Rückzahlung wurde erfolgreich ausgeführt."
15
- "bz_frnt_ipn_refund_expired","Barzahlen: Der Rückzahlungszeitraum ist abgelaufen."
16
- "bz_frnt_ipn_denied","Barzahlen: Der Zahlschein konnte nicht angefordert werden."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/locale/en_US/{ZerebroInternet_Barzahlen_Admin.csv → ZerebroInternet_Barzahlen.csv} RENAMED
@@ -1,3 +1,12 @@
 
 
 
 
 
 
 
 
 
1
  "bz_adm_title","Barzahlen (Pay Cash Online)"
2
  "bz_adm_enabled_title","Enabled"
3
  "bz_adm_order_status_title","New Order Status"
@@ -46,6 +55,4 @@
46
  "bz_adm_partner","<b>Payment possible at:</b>"
47
  "bz_adm_sandbox","The <strong>Sandbox Mode</strong> is active. All placed orders receive a test payment slip. Test payment slips cannot be handled by our retail partners."
48
  "bz_frnt_ipn_pending","Barzahlen: Payment slip requested and sent successfully."
49
- "bz_adm_now_available"," Now available "
50
- "bz_adm_over"," over "
51
- "bz_adm_or"," or "
1
+ "bz_frnt_info","After completing your order you will receive a payment slip from Barzahlen.de that you can easily print out or have it sent via text message to your mobile phone. With the help of that payment slip you can pay your online purchase at one of our retail partners."
2
+ "bz_frnt_partner","<b>Pay at:</b>"
3
+ "bz_frnt_error","Payment via Barzahlen.de was unfortunately not possible. Please try again or select another payment method."
4
+ "bz_frnt_ipn_pending","Barzahlen: Payment slip requested and sent successfully."
5
+ "bz_frnt_ipn_paid","Barzahlen: The payment slip was paid successfully."
6
+ "bz_frnt_ipn_expired","Barzahlen: The time frame for the payment slip expired."
7
+ "bz_frnt_ipn_refund_pending","Barzahlen: The refund was requested successful."
8
+ "bz_frnt_ipn_refund_completed","Barzahlen: The refund was completed successful."
9
+ "bz_frnt_ipn_refund_expired","Barzahlen: The time frame for the refund expired."
10
  "bz_adm_title","Barzahlen (Pay Cash Online)"
11
  "bz_adm_enabled_title","Enabled"
12
  "bz_adm_order_status_title","New Order Status"
55
  "bz_adm_partner","<b>Payment possible at:</b>"
56
  "bz_adm_sandbox","The <strong>Sandbox Mode</strong> is active. All placed orders receive a test payment slip. Test payment slips cannot be handled by our retail partners."
57
  "bz_frnt_ipn_pending","Barzahlen: Payment slip requested and sent successfully."
58
+ "bz_adm_now_available","Version %1$s for Barzahlen.de plugin available on: <a href=""%2$s"" style=""font-size: 1em; color: #333;"" target=""_blank"">%2$s</a>"
 
 
app/locale/en_US/ZerebroInternet_Barzahlen_Frontend.csv DELETED
@@ -1,16 +0,0 @@
1
- "Barzahlen (Pay Cash Online)","Barzahlen"
2
- "bz_frnt_info","After completing your order you get a payment slip from Barzahlen that you can easily print out or have it sent via SMS to your mobile phone. With the help of that payment slip you can pay your online purchase at one of our retail partners (e.g. supermarket)."
3
- "bz_frnt_partner","<b>Pay at:</b>"
4
- "bz_frnt_sandbox","The <strong>Sandbox Mode</strong> is active. All placed orders receive a test payment slip. Test payment slips cannot be handled by our retail partners."
5
- "bz_frnt_processing_orderreceived","Your order has been received"
6
- "bz_frnt_processing_orderno","Your order#: %s"
7
- "bz_frnt_processing_cntshp","Continue Shopping"
8
- "bz_frnt_processing_transactionerror","An error occurred while transmitting your transaction. The order has been cancelled and the administrator has been notified about this. Please try again later."
9
- "bz_frnt_processing_erroroccured","An Error occurred within the payment process!"
10
- "bz_frnt_ipn_pending","Barzahlen: Payment slip requested and sent successfully."
11
- "bz_frnt_ipn_paid","Barzahlen: The payment slip was paid successfully."
12
- "bz_frnt_ipn_expired","Barzahlen: The time frame for the payment slip expired."
13
- "bz_frnt_ipn_refund_pending","Barzahlen: The refund was requested successful."
14
- "bz_frnt_ipn_refund_completed","Barzahlen: The refund was completed successful."
15
- "bz_frnt_ipn_refund_expired","Barzahlen: The time frame for the refund expired."
16
- "bz_frnt_ipn_denied","Barzahlen: Unable to request payment slip."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
package.xml CHANGED
@@ -1,22 +1,22 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>ZerebroInternet_Barzahlen</name>
4
- <version>1.2.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Source License (OSL) 3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>Barzahlen Payment Method Plugin</summary>
10
- <description>Barzahlen bietet Ihren Kunden die M&#xF6;glichkeit, online bar zu bezahlen. Sie werden in Echtzeit &#xFC;ber die Zahlung benachrichtigt und profitieren von voller Zahlungsgarantie und neuen Kundengruppen. Sehen Sie wie Barzahlen funktioniert: http://www.barzahlen.de/partner/funktionsweise&#xD;
11
  &#xD;
12
  ---&#xD;
13
  &#xD;
14
- Barzahlen let's your customers pay cash online. You get a payment confirmation in real-time and you benefit from our payment guarantee and new customer groups. See how Barzahlen works: http://www.barzahlen.de/partner/funktionsweise</description>
15
- <notes>In this version the following things were already tested successfully on 1.4.2.0,1.5.0.1,1.5.1.0,1.6.0.0,1.6.1.0,1.6.2.0,1.7.0.0,1.7.0.1,1.7.0.2</notes>
16
- <authors><author><name>Martin Seener</name><user>auto-converted</user><email>support@barzahlen.de</email></author><author><name>Alexander Diebler</name><user>auto-converted</user><email>support@barzahlen.de</email></author></authors>
17
- <date>2013-06-27</date>
18
- <time>08:03:59</time>
19
- <contents><target name="magecommunity"><dir name="ZerebroInternet"><dir name="Barzahlen"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><dir name="Creditmemo"><file name="View.php" hash="ed34c5974f780caae8597af54dab5f10"/></dir><file name="View.php" hash="69e2ec7e15a7020363035f5bd44cc72f"/></dir></dir></dir><file name="Form.php" hash="bb19aebff7b6df230a736969d56c3824"/><file name="Info.php" hash="c8957f90e34f2148f9f18ddfd30b9549"/></dir><dir name="Helper"><file name="Data.php" hash="76418bc156cbe5ea9b80b8d0b6930003"/></dir><dir name="Model"><dir name="Adminexceptions"><file name="Allspecificcountries.php" hash="f8250081f964940755620a78d0a34759"/><file name="Maxordertotal.php" hash="847c5dfa19c386e07bab438007fb4ed0"/><file name="Notificationkey.php" hash="444e60cd86e21c63cebec46433036af1"/><file name="Paymentkey.php" hash="5c8dbb4a24a006843528921ae8408c6f"/><file name="Shopid.php" hash="4bf52f9fab2b85e8dd97159ae8cae868"/><file name="Specificcountry.php" hash="5b64217fdd81d1c25b97a1aea935e961"/><file name="Title.php" hash="b4ed0a701c1e7afff4d5349946aee93a"/></dir><dir name="Api"><dir name="Request"><file name="Abstract.php" hash="b0673b637619bf66d412a73cc7fc1f96"/><file name="Cancel.php" hash="30b16b5c838206262332808519379819"/><file name="Payment.php" hash="b6408794692541a0476f50f369f29647"/><file name="Refund.php" hash="68485f173d147e5f7412c673f87a0f1c"/><file name="Resend.php" hash="bcdb1cc3bc630bd7a910b894999a4feb"/><file name="Update.php" hash="c823a9157e5afbd41ed98f9687b62745"/></dir><dir name="certs"><file name="ca-bundle.crt" hash="7e78dcc7f5a3aefffbb327141dd7ddcf"/></dir><file name="Abstract.php" hash="a7bd0bce3d4ee08eaebcf153396d0d9a"/><file name="Notification.php" hash="4ebab86f0dfd41ad9f625d9573225669"/></dir><file name="Api.php" hash="06fbc9bec0f8a6dbb22a87d48bd98f0f"/><file name="Barzahlen.php" hash="e1e76fc47ac6aa1067a97fba8b73ca7d"/><file name="Cancel.php" hash="dd5dafa4f7c1eabca9205fb204784c36"/><file name="Check.php" hash="327aff9f4692d3367a473337bf1a2aec"/><file name="Ipn.php" hash="0fc9e193c2d23be08a2790f2729489ac"/><file name="Payment.php" hash="405e04ddab9d31893b2938dc72d3f93f"/><file name="Refund.php" hash="6f8aa14279682f8a9c6cbed5a7402c46"/><file name="Resend.php" hash="08d258616935fd00690440e4f9db2424"/></dir><dir name="controllers"><file name="CheckoutController.php" hash="dea3cbe0437554bd7b9f98ad6fb96e52"/><file name="IpnController.php" hash="d8ffa31e1c0b50d8cbe1b022e6b3ec93"/><file name="ResendController.php" hash="ab6108dd5fa8e0ccfc8edcf8c99f639d"/></dir><dir name="etc"><file name="config.xml" hash="a98e5f3260d1e0192c6e11b99245fefa"/><file name="system.xml" hash="a9a17c3c88d65f51ea30e8589c34a07c"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="ZerebroInternet_Barzahlen.xml" hash="e06f159c8c6b298ea2bd8d360fd50904"/></dir></target><target name="magelocale"><dir name="de_DE"><file name="ZerebroInternet_Barzahlen_Admin.csv" hash="d0471ec8a3ba4d84eae8b3b6937b40cc"/><file name="ZerebroInternet_Barzahlen_Frontend.csv" hash="eca00f201a8a75063a90b69e12586596"/></dir><dir name="en_US"><file name="ZerebroInternet_Barzahlen_Admin.csv" hash="ba87e1f265f920303da24988a73b7efb"/><file name="ZerebroInternet_Barzahlen_Frontend.csv" hash="ba4c7050219ab94072c1acc567db96dd"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="barzahlen"><file name="info.phtml" hash="28b7003181c7334ae06cea890164fcf2"/></dir></dir></dir></dir><dir name="base"><dir name="default"><dir name="template"><dir name="barzahlen"><file name="form.phtml" hash="424b059387d5c4314ce710a498141498"/><file name="info.phtml" hash="74d5570ff6cc50fbd94ebed0e709435a"/><file name="mark.phtml" hash="e5180d493829dcd1c58837eec9d6e989"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="barzahlen.xml" hash="d07b3c0837faa75858c31724947f187f"/></dir><dir name="template"><dir name="barzahlen"><file name="form.phtml" hash="64322cfc9225bdd006b37ceda42110ab"/><file name="info.phtml" hash="74d5570ff6cc50fbd94ebed0e709435a"/><file name="mark.phtml" hash="e5180d493829dcd1c58837eec9d6e989"/><file name="processing.phtml" hash="7cbfff204dfec836d69d7a8ab7790488"/></dir></dir></dir></dir></dir></target></contents>
20
  <compatible/>
21
- <dependencies/>
22
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>ZerebroInternet_Barzahlen</name>
4
+ <version>1.3.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Source License (OSL) 3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>Barzahlen.de Payment Method Plugin</summary>
10
+ <description>Barzahlen bietet Ihren Kunden die M&#xF6;glichkeit, online bar zu bezahlen. Sie werden in Echtzeit &#xFC;ber die Zahlung benachrichtigt und profitieren von voller Zahlungsgarantie und neuen Kundengruppen. Sehen Sie wie Barzahlen funktioniert: https://www.barzahlen.de/de/partner/funktionsweise&#xD;
11
  &#xD;
12
  ---&#xD;
13
  &#xD;
14
+ Barzahlen let's your customers pay cash online. You get a payment confirmation in real-time and you benefit from our payment guarantee and new customer groups. See how Barzahlen works: https://www.barzahlen.de/en/partner/the-way-it-works</description>
15
+ <notes>In this version the following things were already tested successfully on Magento CE 1.4.2.0, 1.5.0.1, 1.5.1.0, 1.6.0.0, 1.6.1.0, 1.6.2.0, 1.7.0.0, 1.7.0.1, 1.7.0.2, 1.8.0.0, 1.8.1.0, 1.9.0.0, 1.9.0.1</notes>
16
+ <authors><author><name>Alexander Diebler</name><user>alexanderdiebler</user><email>support@barzahlen.de</email></author><author><name>Martin Seener</name><user>martinseener</user><email>support@barzahlen.de</email></author></authors>
17
+ <date>2014-11-19</date>
18
+ <time>20:15:41</time>
19
+ <contents><target name="magecommunity"><dir name="ZerebroInternet"><dir name="Barzahlen"><dir name="Block"><file name="Form.php" hash="1d7c24126682d9472e4f85f4fd0a2992"/><file name="Info.php" hash="e37a213d365267151de31fd5698692d9"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="Helper"><file name="Data.php" hash="76291350ced0b3db20c576bd19671ebf"/></dir><dir name="Model"><dir name="Adminexceptions"><file name="Allspecificcountries.php" hash="0def5c9f9800982cf2c52f64774e0292"/><file name="Maxordertotal.php" hash="43a4e90d59bac25561ad6747ed816cb9"/><file name="Notificationkey.php" hash="7099fec98ecb6bbf6b9d6a4eca328363"/><file name="Paymentkey.php" hash="c6b212a4080fe1578ce2374947b1ec70"/><file name="Shopid.php" hash="0c101801ed8b0e1be5877a561d51278a"/><file name="Specificcountry.php" hash="e243efeaa058fdb902693f7c9db778fa"/><file name="Title.php" hash="fa702fb53f9aad29a4ee0af939570c50"/></dir><dir name="Api"><file name="Abstract.php" hash="62600c1f0033145cb12a99de60897f3e"/><file name="Notification.php" hash="0abb5e28cf31c5ae9dd5d3a9a4989d94"/><dir name="Request"><file name="Abstract.php" hash="f75b00f1b903dd8b2a38e123974fab89"/><file name="Cancel.php" hash="ded1cade9e6294f61ee3e562c9e23767"/><file name="Payment.php" hash="1cba69b563035966bc563d2aa07f5f00"/><file name="Refund.php" hash="5d33ceeff9244fc312a04d7c67de95c5"/><file name="Resend.php" hash="cfeac2591b55c65247dc35f8a2e788e2"/><file name="Update.php" hash="dce93f89ce7cb1f7f01897dc7b04b251"/></dir><file name="Version.php" hash="095ec5facb8691cd298a102a651a9546"/><dir name="certs"><file name="ca-bundle.crt" hash="7e78dcc7f5a3aefffbb327141dd7ddcf"/></dir></dir><file name="Api.php" hash="ff5bb405065ae299d4bd45374dc8f9db"/><file name="Barzahlen.php" hash="50120ff5790c88b1df4ee6135bb94b4b"/><file name="Ipn.php" hash="1e19cacea612d8328f1118abaec7f0ba"/><file name="Observer.php" hash="77dc49e5ee19592be4c0a13f9465ed41"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="Test"><dir name="Block"><file name="Form.php" hash="b3cd3786480b630046d3a17c6ce1f611"/><file name="Info.php" hash="9fd7298fdffa7517ac3fc9de253a488a"/></dir><dir name="Controller"><dir name="IpnController"><dir name="fixtures"><file name="new_order.yaml" hash="591abc9eeafe9d09af91124c984deaa0"/><file name="paid_order.yaml" hash="72e262deb0ebded29da1943f0d9da2d6"/><file name="refunded_order.yaml" hash="e491eb816f6c6453271df94ad0d64d3d"/><file name="successful_refunded_order.yaml" hash="c0bc964307fb64bbe4d18f2ea8253071"/></dir></dir><file name="IpnController.php" hash="1f3e4eef7ab7bb439bbfd70cf6ad6a60"/><dir name="ResendController"><dir name="fixtures"><file name="new_order.yaml" hash="85228a355439c5bbf7da1657a9ca9329"/><file name="paid_order.yaml" hash="426a30ad0231d31c06ab1fb9ab54eeef"/><file name="refunded_order.yaml" hash="cf7435a46780d6f909fe9f2217254fb1"/><file name="successful_refunded_order.yaml" hash="d06bce0043bde8a3c4219f4882ecb64f"/></dir></dir><file name="ResendController.php" hash="812f5db46b3dfaed3c4ee9eab25bc1d1"/></dir><dir name="Helper"><file name="Data.php" hash="133088ca93f7cc6ef6f370b9bfe4f6de"/></dir><dir name="Model"><dir name="Adminexceptions"><dir name="Maxordertotal"><dir name="fixtures"><file name="Maxordertotal.yaml" hash="b189856fe031df252eb73c154b9d452d"/></dir></dir><file name="Maxordertotal.php" hash="711e41947049e5a411ba7c4baa09e47b"/><dir name="Notificationkey"><dir name="fixtures"><file name="Notificationkey.yaml" hash="b189856fe031df252eb73c154b9d452d"/></dir></dir><file name="Notificationkey.php" hash="b36c9ff3dee065d5b06b4a2140dfe540"/><dir name="Paymentkey"><dir name="fixtures"><file name="Paymentkey.yaml" hash="b189856fe031df252eb73c154b9d452d"/></dir></dir><file name="Paymentkey.php" hash="ddf4d622b463ac91baf2b6516547819e"/><dir name="Shopid"><dir name="fixtures"><file name="Shopid.yaml" hash="b189856fe031df252eb73c154b9d452d"/></dir></dir><file name="Shopid.php" hash="dcbe8310a9e6a03a740356da20cb5e6c"/><dir name="Specificcountry"><dir name="fixtures"><file name="Specificcountry.yaml" hash="b189856fe031df252eb73c154b9d452d"/></dir></dir><file name="Specificcountry.php" hash="1019ac4f2935906384bbb5b2d21a68b0"/><dir name="Title"><dir name="fixtures"><file name="Title.yaml" hash="b189856fe031df252eb73c154b9d452d"/></dir></dir><file name="Title.php" hash="260239d3cd2cd524bd554381c5b2469e"/></dir><dir name="Api"><file name="Notification.php" hash="7448cff7361f1cd6cf5d993aae42ca40"/><dir name="Request"><file name="Cancel.php" hash="d20317dd60dd451d624eca591a6193e2"/><file name="Payment.php" hash="a0a49c6044c5aef3f3bd7b5875229e4f"/><file name="Refund.php" hash="ddecb120d693546724b64a9f5824258d"/><file name="Resend.php" hash="60425da28b101df350331da3a7baf498"/></dir></dir><file name="Barzahlen.php" hash="99bca20b1375def3ffc9a51b6df6a5ee"/></dir></dir><dir name="controllers"><file name="IpnController.php" hash="97dd12571170d7d132559398c3a6e809"/><file name="ResendController.php" hash="5945384ce4a8a4fc2afabc06f7448f28"/></dir><dir name="etc"><file name="config.xml" hash="dac41fa3cf42572a6c49acc8dc47bc92"/><file name="system.xml" hash="4d279e51298f0f8935af4298f632fdc1"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="template"><dir name="barzahlen"><file name="form.phtml" hash="4f0f749dc67fdb948320f0a4806e8ecc"/><file name="info.phtml" hash="6d4ff8e0095b67dbbcfd1c5790987a88"/></dir></dir></dir></dir><dir name="default"><dir name="default"><dir name="template"><dir name="barzahlen"><file name="info.phtml" hash="6d4ff8e0095b67dbbcfd1c5790987a88"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="barzahlen"><file name="form.phtml" hash="56eccd77732efa4b9018284d0427fd3d"/><file name="info.phtml" hash="6d4ff8e0095b67dbbcfd1c5790987a88"/><file name="mark.phtml" hash="6e6e2110f30dafd96eddca289dd09b70"/><file name="success.phtml" hash="ebb1fe950a262c0d2416d02cc3b5eb91"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="de_DE"><file name="ZerebroInternet_Barzahlen.csv" hash="42a61107214456adb225990cf295bd49"/></dir><dir name="en_US"><file name="ZerebroInternet_Barzahlen.csv" hash="358bc2cc95fbdf64a49fd60a61c07528"/></dir></target><target name="mageetc"><dir name="modules"><file name="ZerebroInternet_Barzahlen.xml" hash="1ae4207fb1d691ed2565b706cb394ebb"/></dir></target></contents>
20
  <compatible/>
21
+ <dependencies><required><php><min>5.1.2</min><max>6.0.0</max></php></required></dependencies>
22
  </package>