Version Notes
Keine Hinweise
Download this release
Release Info
Developer | Christian Lakits |
Extension | Barpay_Payment_Standard |
Version | 0.1.5 |
Comparing to | |
See all releases |
Code changes from version 0.1.2 to 0.1.5
- app/code/community/Inite/Barpay/Block/Checkout/Error.php +16 -16
- app/code/community/Inite/Barpay/Block/Checkout/Success.php +22 -22
- app/code/community/Inite/Barpay/Block/Form.php +48 -0
- app/code/community/Inite/Barpay/Block/Info.php +44 -44
- app/code/community/Inite/Barpay/Block/Order/View.php +1 -1
- app/code/community/Inite/Barpay/Helper/Data.php +86 -86
- app/code/community/Inite/Barpay/Model/Email/Template.php +1 -1
- app/code/community/Inite/Barpay/Model/Email/Template/Mailer.php +1 -1
- app/code/community/Inite/Barpay/Model/Sales/Order.php +97 -97
- app/code/community/Inite/Barpay/Model/Standard.php +288 -288
- app/code/community/Inite/Barpay/controllers/AdminController.php +35 -35
- app/code/community/Inite/Barpay/controllers/StandardController.php +126 -126
- app/code/community/Inite/Barpay/etc/config.xml +149 -149
- app/code/community/Inite/Barpay/etc/system.xml +182 -182
- app/code/community/Inite/Barpay/sql/barpay_setup/mysql4-install-0.0.9.php +30 -30
- app/design/adminhtml/default/default/template/barpay/info.phtml +22 -22
- app/design/frontend/default/default/layout/barpay.xml +16 -16
- app/design/frontend/default/default/template/barpay/form.phtml +2 -2
- app/design/frontend/default/default/template/barpay/info.phtml +22 -22
- app/design/frontend/default/default/template/barpay/infobox.phtml +31 -31
- app/design/frontend/default/default/template/barpay/pay.phtml +17 -0
- app/design/frontend/default/default/template/barpay/payment/mark.phtml +13 -13
- app/design/frontend/default/default/template/barpay/success.phtml +18 -18
- app/etc/modules/Inite_Barpay.xml +10 -10
- package.xml +23 -6
app/code/community/Inite/Barpay/Block/Checkout/Error.php
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* This file is subject to the terms and conditions defined in
|
6 |
-
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
-
*
|
8 |
-
* @VERSION Barpay 0.1.
|
9 |
-
*
|
10 |
-
**/
|
11 |
-
|
12 |
-
?>
|
13 |
-
<?php
|
14 |
-
class Inite_Barpay_Block_Checkout_Error extends Mage_Core_Block_Template
|
15 |
-
{
|
16 |
-
|
17 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
*
|
5 |
+
* This file is subject to the terms and conditions defined in
|
6 |
+
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
+
*
|
8 |
+
* @VERSION Barpay 0.1.5
|
9 |
+
*
|
10 |
+
**/
|
11 |
+
|
12 |
+
?>
|
13 |
+
<?php
|
14 |
+
class Inite_Barpay_Block_Checkout_Error extends Mage_Core_Block_Template
|
15 |
+
{
|
16 |
+
|
17 |
}
|
app/code/community/Inite/Barpay/Block/Checkout/Success.php
CHANGED
@@ -1,27 +1,27 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* This file is subject to the terms and conditions defined in
|
6 |
-
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
-
*
|
8 |
-
* @VERSION Barpay 0.1.
|
9 |
-
*
|
10 |
-
**/
|
11 |
-
|
12 |
-
?>
|
13 |
-
<?php
|
14 |
-
class Inite_Barpay_Block_Checkout_Success extends Mage_Core_Block_Template
|
15 |
-
{
|
16 |
|
17 |
public function getPdfUrl(){
|
18 |
$orderId = Mage::getSingleton('customer/session')->getData('barpay_order_id');
|
19 |
return Mage::helper('barpay')->getPdfUrl($orderId);
|
20 |
-
}
|
21 |
-
|
22 |
-
public function canDownloadPdf()
|
23 |
-
{
|
24 |
-
$orderId = Mage::getSingleton('customer/session')->getData('barpay_order_id');
|
25 |
-
return Mage::helper('barpay')->canDownloadPdf($orderId);
|
26 |
-
}
|
27 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
*
|
5 |
+
* This file is subject to the terms and conditions defined in
|
6 |
+
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
+
*
|
8 |
+
* @VERSION Barpay 0.1.5
|
9 |
+
*
|
10 |
+
**/
|
11 |
+
|
12 |
+
?>
|
13 |
+
<?php
|
14 |
+
class Inite_Barpay_Block_Checkout_Success extends Mage_Core_Block_Template
|
15 |
+
{
|
16 |
|
17 |
public function getPdfUrl(){
|
18 |
$orderId = Mage::getSingleton('customer/session')->getData('barpay_order_id');
|
19 |
return Mage::helper('barpay')->getPdfUrl($orderId);
|
20 |
+
}
|
21 |
+
|
22 |
+
public function canDownloadPdf()
|
23 |
+
{
|
24 |
+
$orderId = Mage::getSingleton('customer/session')->getData('barpay_order_id');
|
25 |
+
return Mage::helper('barpay')->canDownloadPdf($orderId);
|
26 |
+
}
|
27 |
}
|
app/code/community/Inite/Barpay/Block/Form.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
*
|
5 |
+
* This file is subject to the terms and conditions defined in
|
6 |
+
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
+
*
|
8 |
+
* @VERSION Barpay 0.1.5
|
9 |
+
*
|
10 |
+
**/
|
11 |
+
|
12 |
+
?>
|
13 |
+
<?php
|
14 |
+
|
15 |
+
class Inite_Barpay_Block_Form extends Mage_Payment_Block_Form
|
16 |
+
{
|
17 |
+
protected function _construct()
|
18 |
+
{
|
19 |
+
parent::_construct();
|
20 |
+
$this->setTemplate('barpay/form.phtml');
|
21 |
+
}
|
22 |
+
|
23 |
+
public function getMethodLabelAfterHtml() {
|
24 |
+
$config = Mage::getModel('barpay/standard')->getConfigVars();
|
25 |
+
|
26 |
+
if($config->show_logo){
|
27 |
+
$mark = Mage::getConfig()->getBlockClassName('core/template');
|
28 |
+
$mark = new $mark;
|
29 |
+
$mark->setTemplate('barpay/payment/mark.phtml');
|
30 |
+
|
31 |
+
return $mark->toHtml();
|
32 |
+
}
|
33 |
+
return '';
|
34 |
+
}
|
35 |
+
|
36 |
+
public function getMethodTitle() {
|
37 |
+
$config = Mage::getModel('barpay/standard')->getConfigVars();
|
38 |
+
|
39 |
+
if($config->show_logo){
|
40 |
+
return '';
|
41 |
+
}
|
42 |
+
return Mage::getModel('barpay/standard')->getTitle();
|
43 |
+
}
|
44 |
+
|
45 |
+
public function hasMethodTitle() {
|
46 |
+
return true;
|
47 |
+
}
|
48 |
+
}
|
app/code/community/Inite/Barpay/Block/Info.php
CHANGED
@@ -1,45 +1,45 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* This file is subject to the terms and conditions defined in
|
6 |
-
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
-
*
|
8 |
-
* @VERSION Barpay 0.1.
|
9 |
-
*
|
10 |
-
**/
|
11 |
-
|
12 |
-
?>
|
13 |
-
<?php
|
14 |
-
class Inite_Barpay_Block_Info extends Mage_Payment_Block_Info
|
15 |
-
{
|
16 |
-
protected function _construct()
|
17 |
-
{
|
18 |
-
parent::_construct();
|
19 |
-
$this->setTemplate('barpay/info.phtml');
|
20 |
-
}
|
21 |
-
|
22 |
-
public function getPdfUrl()
|
23 |
-
{
|
24 |
-
return Mage::helper('barpay')->getPdfUrl($this->getInfo()->getId());
|
25 |
-
}
|
26 |
-
|
27 |
-
public function canDownloadPdf()
|
28 |
-
{
|
29 |
-
return Mage::helper('barpay')->canDownloadPdf($this->getInfo()->getId());
|
30 |
-
}
|
31 |
-
|
32 |
-
public function canRepay()
|
33 |
-
{
|
34 |
-
$session = Mage::getSingleton('admin/session');
|
35 |
-
if($session->getUser() && $this->getInfo()->getOrder()->getState() == 'pending_payment')
|
36 |
-
return true;
|
37 |
-
|
38 |
-
return false;
|
39 |
-
}
|
40 |
-
|
41 |
-
public function getRepayUrl()
|
42 |
-
{
|
43 |
-
return Mage::helper('adminhtml')->getUrl('barpayadmin/admin/repay', array('order_id'=>$this->getInfo()->getId()));
|
44 |
-
}
|
45 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
*
|
5 |
+
* This file is subject to the terms and conditions defined in
|
6 |
+
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
+
*
|
8 |
+
* @VERSION Barpay 0.1.5
|
9 |
+
*
|
10 |
+
**/
|
11 |
+
|
12 |
+
?>
|
13 |
+
<?php
|
14 |
+
class Inite_Barpay_Block_Info extends Mage_Payment_Block_Info
|
15 |
+
{
|
16 |
+
protected function _construct()
|
17 |
+
{
|
18 |
+
parent::_construct();
|
19 |
+
$this->setTemplate('barpay/info.phtml');
|
20 |
+
}
|
21 |
+
|
22 |
+
public function getPdfUrl()
|
23 |
+
{
|
24 |
+
return Mage::helper('barpay')->getPdfUrl($this->getInfo()->getId());
|
25 |
+
}
|
26 |
+
|
27 |
+
public function canDownloadPdf()
|
28 |
+
{
|
29 |
+
return Mage::helper('barpay')->canDownloadPdf($this->getInfo()->getId());
|
30 |
+
}
|
31 |
+
|
32 |
+
public function canRepay()
|
33 |
+
{
|
34 |
+
$session = Mage::getSingleton('admin/session');
|
35 |
+
if($session->getUser() && $this->getInfo()->getOrder()->getState() == 'pending_payment')
|
36 |
+
return true;
|
37 |
+
|
38 |
+
return false;
|
39 |
+
}
|
40 |
+
|
41 |
+
public function getRepayUrl()
|
42 |
+
{
|
43 |
+
return Mage::helper('adminhtml')->getUrl('barpayadmin/admin/repay', array('order_id'=>$this->getInfo()->getId()));
|
44 |
+
}
|
45 |
}
|
app/code/community/Inite/Barpay/Block/Order/View.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* This file is subject to the terms and conditions defined in
|
6 |
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
*
|
8 |
-
* @VERSION Barpay 0.1.
|
9 |
*
|
10 |
**/
|
11 |
|
5 |
* This file is subject to the terms and conditions defined in
|
6 |
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
*
|
8 |
+
* @VERSION Barpay 0.1.5
|
9 |
*
|
10 |
**/
|
11 |
|
app/code/community/Inite/Barpay/Helper/Data.php
CHANGED
@@ -1,87 +1,87 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* This file is subject to the terms and conditions defined in
|
6 |
-
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
-
*
|
8 |
-
* @VERSION Barpay 0.1.
|
9 |
-
*
|
10 |
-
**/
|
11 |
-
|
12 |
-
?>
|
13 |
-
<?php
|
14 |
-
|
15 |
-
class Inite_Barpay_Helper_Data extends Mage_Core_Helper_Abstract
|
16 |
-
{
|
17 |
-
public function getPdfUrl($orderId){
|
18 |
-
|
19 |
-
if($this->getVoucherUrl($orderId)){
|
20 |
-
return $this->getVoucherUrl($orderId);
|
21 |
-
}
|
22 |
-
|
23 |
-
elseif(file_exists($this->getFilePath($orderId))){
|
24 |
-
|
25 |
-
$params = array( '_secure'=>true,'order'=>$orderId);
|
26 |
-
|
27 |
-
$fileKey = $this->getFileKey($orderId);
|
28 |
-
if($fileKey) $params['key'] = $fileKey;
|
29 |
-
|
30 |
-
return Mage::getUrl('barpay/standard/file', $params );
|
31 |
-
}
|
32 |
-
|
33 |
-
else {
|
34 |
-
return '';
|
35 |
-
}
|
36 |
-
}
|
37 |
-
|
38 |
-
public function canDownloadPdf($orderId)
|
39 |
-
{
|
40 |
-
if(file_exists($this->getFilePath($orderId))){
|
41 |
-
return true;
|
42 |
-
}
|
43 |
-
|
44 |
-
elseif($this->getVoucherUrl($orderId)) {
|
45 |
-
return true;
|
46 |
-
}
|
47 |
-
|
48 |
-
else
|
49 |
-
return false;
|
50 |
-
|
51 |
-
}
|
52 |
-
|
53 |
-
public function getFilePath($orderId){
|
54 |
-
$config = Mage::getModel('barpay/standard')->getConfigVars();
|
55 |
-
|
56 |
-
$filename = 'barpay_voucher_'.$orderId.'.pdf';
|
57 |
-
$file = $config->file_save_path.$filename;
|
58 |
-
|
59 |
-
return $file;
|
60 |
-
}
|
61 |
-
|
62 |
-
public function getFileKey($orderId){
|
63 |
-
$order = Mage::getModel('sales/order')->load($orderId);
|
64 |
-
|
65 |
-
if(!$order || !$order->getPayment()) return false;
|
66 |
-
|
67 |
-
$transaction = $order->getPayment()->getAuthorizationTransaction();
|
68 |
-
|
69 |
-
if($transaction){
|
70 |
-
return $transaction->getAdditionalInformation('voucher_filekey');
|
71 |
-
}
|
72 |
-
else return false;
|
73 |
-
}
|
74 |
-
|
75 |
-
public function getVoucherUrl($orderId){
|
76 |
-
$order = Mage::getModel('sales/order')->load($orderId);
|
77 |
-
|
78 |
-
if(!$order || !$order->getPayment()) return false;
|
79 |
-
|
80 |
-
$transaction = $order->getPayment()->getAuthorizationTransaction();
|
81 |
-
|
82 |
-
if($transaction){
|
83 |
-
return $transaction->getAdditionalInformation('voucher_url');
|
84 |
-
}
|
85 |
-
else return false;
|
86 |
-
}
|
87 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
*
|
5 |
+
* This file is subject to the terms and conditions defined in
|
6 |
+
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
+
*
|
8 |
+
* @VERSION Barpay 0.1.5
|
9 |
+
*
|
10 |
+
**/
|
11 |
+
|
12 |
+
?>
|
13 |
+
<?php
|
14 |
+
|
15 |
+
class Inite_Barpay_Helper_Data extends Mage_Core_Helper_Abstract
|
16 |
+
{
|
17 |
+
public function getPdfUrl($orderId){
|
18 |
+
|
19 |
+
if($this->getVoucherUrl($orderId)){
|
20 |
+
return $this->getVoucherUrl($orderId);
|
21 |
+
}
|
22 |
+
|
23 |
+
elseif(file_exists($this->getFilePath($orderId))){
|
24 |
+
|
25 |
+
$params = array( '_secure'=>true,'order'=>$orderId);
|
26 |
+
|
27 |
+
$fileKey = $this->getFileKey($orderId);
|
28 |
+
if($fileKey) $params['key'] = $fileKey;
|
29 |
+
|
30 |
+
return Mage::getUrl('barpay/standard/file', $params );
|
31 |
+
}
|
32 |
+
|
33 |
+
else {
|
34 |
+
return '';
|
35 |
+
}
|
36 |
+
}
|
37 |
+
|
38 |
+
public function canDownloadPdf($orderId)
|
39 |
+
{
|
40 |
+
if(file_exists($this->getFilePath($orderId))){
|
41 |
+
return true;
|
42 |
+
}
|
43 |
+
|
44 |
+
elseif($this->getVoucherUrl($orderId)) {
|
45 |
+
return true;
|
46 |
+
}
|
47 |
+
|
48 |
+
else
|
49 |
+
return false;
|
50 |
+
|
51 |
+
}
|
52 |
+
|
53 |
+
public function getFilePath($orderId){
|
54 |
+
$config = Mage::getModel('barpay/standard')->getConfigVars();
|
55 |
+
|
56 |
+
$filename = 'barpay_voucher_'.$orderId.'.pdf';
|
57 |
+
$file = $config->file_save_path.$filename;
|
58 |
+
|
59 |
+
return $file;
|
60 |
+
}
|
61 |
+
|
62 |
+
public function getFileKey($orderId){
|
63 |
+
$order = Mage::getModel('sales/order')->load($orderId);
|
64 |
+
|
65 |
+
if(!$order || !$order->getPayment()) return false;
|
66 |
+
|
67 |
+
$transaction = $order->getPayment()->getAuthorizationTransaction();
|
68 |
+
|
69 |
+
if($transaction){
|
70 |
+
return $transaction->getAdditionalInformation('voucher_filekey');
|
71 |
+
}
|
72 |
+
else return false;
|
73 |
+
}
|
74 |
+
|
75 |
+
public function getVoucherUrl($orderId){
|
76 |
+
$order = Mage::getModel('sales/order')->load($orderId);
|
77 |
+
|
78 |
+
if(!$order || !$order->getPayment()) return false;
|
79 |
+
|
80 |
+
$transaction = $order->getPayment()->getAuthorizationTransaction();
|
81 |
+
|
82 |
+
if($transaction){
|
83 |
+
return $transaction->getAdditionalInformation('voucher_url');
|
84 |
+
}
|
85 |
+
else return false;
|
86 |
+
}
|
87 |
}
|
app/code/community/Inite/Barpay/Model/Email/Template.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* This file is subject to the terms and conditions defined in
|
6 |
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
*
|
8 |
-
* @VERSION Barpay 0.1.
|
9 |
*
|
10 |
**/
|
11 |
|
5 |
* This file is subject to the terms and conditions defined in
|
6 |
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
*
|
8 |
+
* @VERSION Barpay 0.1.5
|
9 |
*
|
10 |
**/
|
11 |
|
app/code/community/Inite/Barpay/Model/Email/Template/Mailer.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* This file is subject to the terms and conditions defined in
|
6 |
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
*
|
8 |
-
* @VERSION Barpay 0.1.
|
9 |
*
|
10 |
**/
|
11 |
|
5 |
* This file is subject to the terms and conditions defined in
|
6 |
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
*
|
8 |
+
* @VERSION Barpay 0.1.5
|
9 |
*
|
10 |
**/
|
11 |
|
app/code/community/Inite/Barpay/Model/Sales/Order.php
CHANGED
@@ -1,98 +1,98 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* This file is subject to the terms and conditions defined in
|
6 |
-
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
-
*
|
8 |
-
* @VERSION Barpay 0.1.
|
9 |
-
*
|
10 |
-
**/
|
11 |
-
|
12 |
-
?>
|
13 |
-
<?php
|
14 |
-
class Inite_Barpay_Model_Sales_Order extends Mage_Sales_Model_Order
|
15 |
-
{
|
16 |
-
|
17 |
-
public function sendNewOrderEmailWithAttachment()
|
18 |
-
{
|
19 |
-
$storeId = $this->getStore()->getId();
|
20 |
-
|
21 |
-
if (!Mage::helper('sales')->canSendNewOrderEmail($storeId)) {
|
22 |
-
return $this;
|
23 |
-
}
|
24 |
-
$copyTo = $this->_getEmails(self::XML_PATH_EMAIL_COPY_TO);
|
25 |
-
$copyMethod = Mage::getStoreConfig(self::XML_PATH_EMAIL_COPY_METHOD, $storeId);
|
26 |
-
|
27 |
-
$appEmulation = Mage::getSingleton('core/app_emulation');
|
28 |
-
$initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($storeId);
|
29 |
-
|
30 |
-
try {
|
31 |
-
$paymentBlock = Mage::helper('payment')->getInfoBlock($this->getPayment())
|
32 |
-
->setIsSecureMode(true);
|
33 |
-
$paymentBlock->getMethod()->setStore($storeId);
|
34 |
-
$paymentBlockHtml = $paymentBlock->toHtml();
|
35 |
-
} catch (Exception $exception) {
|
36 |
-
$appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);
|
37 |
-
throw $exception;
|
38 |
-
}
|
39 |
-
|
40 |
-
$appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);
|
41 |
-
|
42 |
-
if ($this->getCustomerIsGuest()) {
|
43 |
-
$templateId = Mage::getStoreConfig(self::XML_PATH_EMAIL_GUEST_TEMPLATE, $storeId);
|
44 |
-
$customerName = $this->getBillingAddress()->getName();
|
45 |
-
} else {
|
46 |
-
$templateId = Mage::getStoreConfig(self::XML_PATH_EMAIL_TEMPLATE, $storeId);
|
47 |
-
$customerName = $this->getCustomerName();
|
48 |
-
}
|
49 |
-
|
50 |
-
$mailer = Mage::getModel('core/email_template_mailer');
|
51 |
-
$emailInfo = Mage::getModel('core/email_info');
|
52 |
-
$emailInfo->addTo($this->getCustomerEmail(), $customerName);
|
53 |
-
if ($copyTo && $copyMethod == 'bcc') {
|
54 |
-
foreach ($copyTo as $email) {
|
55 |
-
$emailInfo->addBcc($email);
|
56 |
-
}
|
57 |
-
}
|
58 |
-
$mailer->addEmailInfo($emailInfo);
|
59 |
-
|
60 |
-
if ($copyTo && $copyMethod == 'copy') {
|
61 |
-
foreach ($copyTo as $email) {
|
62 |
-
$emailInfo = Mage::getModel('core/email_info');
|
63 |
-
$emailInfo->addTo($email);
|
64 |
-
$mailer->addEmailInfo($emailInfo);
|
65 |
-
}
|
66 |
-
}
|
67 |
-
|
68 |
-
$mailer->setSender(Mage::getStoreConfig(self::XML_PATH_EMAIL_IDENTITY, $storeId));
|
69 |
-
$mailer->setStoreId($storeId);
|
70 |
-
$mailer->setTemplateId($templateId);
|
71 |
-
$mailer->setTemplateParams(array(
|
72 |
-
'order' => $this,
|
73 |
-
'billing' => $this->getBillingAddress(),
|
74 |
-
'payment_html' => $paymentBlockHtml
|
75 |
-
)
|
76 |
-
);
|
77 |
-
|
78 |
-
$filename = 'barpay_voucher_'.$this->getId().'.pdf';
|
79 |
-
$frontFilename = 'barpay_voucher_'.$this->getIncrementId().'.pdf';
|
80 |
-
|
81 |
-
$file = Mage::getStoreConfig('payment/barpay/save_path').$filename;
|
82 |
-
if(file_exists($file))
|
83 |
-
{
|
84 |
-
$fileContents = file_get_contents($file);
|
85 |
-
$fileMime = 'application/pdf';
|
86 |
-
$mailer->addAttachment($fileContents, $frontFilename, $fileMime);
|
87 |
-
}
|
88 |
-
|
89 |
-
$mailer->send();
|
90 |
-
|
91 |
-
$this->setEmailSent(true);
|
92 |
-
$this->_getResource()->saveAttribute($this, 'email_sent');
|
93 |
-
|
94 |
-
return $this;
|
95 |
-
}
|
96 |
-
|
97 |
-
|
98 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
*
|
5 |
+
* This file is subject to the terms and conditions defined in
|
6 |
+
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
+
*
|
8 |
+
* @VERSION Barpay 0.1.5
|
9 |
+
*
|
10 |
+
**/
|
11 |
+
|
12 |
+
?>
|
13 |
+
<?php
|
14 |
+
class Inite_Barpay_Model_Sales_Order extends Mage_Sales_Model_Order
|
15 |
+
{
|
16 |
+
|
17 |
+
public function sendNewOrderEmailWithAttachment()
|
18 |
+
{
|
19 |
+
$storeId = $this->getStore()->getId();
|
20 |
+
|
21 |
+
if (!Mage::helper('sales')->canSendNewOrderEmail($storeId)) {
|
22 |
+
return $this;
|
23 |
+
}
|
24 |
+
$copyTo = $this->_getEmails(self::XML_PATH_EMAIL_COPY_TO);
|
25 |
+
$copyMethod = Mage::getStoreConfig(self::XML_PATH_EMAIL_COPY_METHOD, $storeId);
|
26 |
+
|
27 |
+
$appEmulation = Mage::getSingleton('core/app_emulation');
|
28 |
+
$initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($storeId);
|
29 |
+
|
30 |
+
try {
|
31 |
+
$paymentBlock = Mage::helper('payment')->getInfoBlock($this->getPayment())
|
32 |
+
->setIsSecureMode(true);
|
33 |
+
$paymentBlock->getMethod()->setStore($storeId);
|
34 |
+
$paymentBlockHtml = $paymentBlock->toHtml();
|
35 |
+
} catch (Exception $exception) {
|
36 |
+
$appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);
|
37 |
+
throw $exception;
|
38 |
+
}
|
39 |
+
|
40 |
+
$appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);
|
41 |
+
|
42 |
+
if ($this->getCustomerIsGuest()) {
|
43 |
+
$templateId = Mage::getStoreConfig(self::XML_PATH_EMAIL_GUEST_TEMPLATE, $storeId);
|
44 |
+
$customerName = $this->getBillingAddress()->getName();
|
45 |
+
} else {
|
46 |
+
$templateId = Mage::getStoreConfig(self::XML_PATH_EMAIL_TEMPLATE, $storeId);
|
47 |
+
$customerName = $this->getCustomerName();
|
48 |
+
}
|
49 |
+
|
50 |
+
$mailer = Mage::getModel('core/email_template_mailer');
|
51 |
+
$emailInfo = Mage::getModel('core/email_info');
|
52 |
+
$emailInfo->addTo($this->getCustomerEmail(), $customerName);
|
53 |
+
if ($copyTo && $copyMethod == 'bcc') {
|
54 |
+
foreach ($copyTo as $email) {
|
55 |
+
$emailInfo->addBcc($email);
|
56 |
+
}
|
57 |
+
}
|
58 |
+
$mailer->addEmailInfo($emailInfo);
|
59 |
+
|
60 |
+
if ($copyTo && $copyMethod == 'copy') {
|
61 |
+
foreach ($copyTo as $email) {
|
62 |
+
$emailInfo = Mage::getModel('core/email_info');
|
63 |
+
$emailInfo->addTo($email);
|
64 |
+
$mailer->addEmailInfo($emailInfo);
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
$mailer->setSender(Mage::getStoreConfig(self::XML_PATH_EMAIL_IDENTITY, $storeId));
|
69 |
+
$mailer->setStoreId($storeId);
|
70 |
+
$mailer->setTemplateId($templateId);
|
71 |
+
$mailer->setTemplateParams(array(
|
72 |
+
'order' => $this,
|
73 |
+
'billing' => $this->getBillingAddress(),
|
74 |
+
'payment_html' => $paymentBlockHtml
|
75 |
+
)
|
76 |
+
);
|
77 |
+
|
78 |
+
$filename = 'barpay_voucher_'.$this->getId().'.pdf';
|
79 |
+
$frontFilename = 'barpay_voucher_'.$this->getIncrementId().'.pdf';
|
80 |
+
|
81 |
+
$file = Mage::getStoreConfig('payment/barpay/save_path').$filename;
|
82 |
+
if(file_exists($file))
|
83 |
+
{
|
84 |
+
$fileContents = file_get_contents($file);
|
85 |
+
$fileMime = 'application/pdf';
|
86 |
+
$mailer->addAttachment($fileContents, $frontFilename, $fileMime);
|
87 |
+
}
|
88 |
+
|
89 |
+
$mailer->send();
|
90 |
+
|
91 |
+
$this->setEmailSent(true);
|
92 |
+
$this->_getResource()->saveAttribute($this, 'email_sent');
|
93 |
+
|
94 |
+
return $this;
|
95 |
+
}
|
96 |
+
|
97 |
+
|
98 |
}
|
app/code/community/Inite/Barpay/Model/Standard.php
CHANGED
@@ -1,289 +1,289 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* This file is subject to the terms and conditions defined in
|
6 |
-
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
-
*
|
8 |
-
* @VERSION Barpay 0.1.
|
9 |
-
*
|
10 |
-
**/
|
11 |
-
|
12 |
-
?>
|
13 |
-
<?php
|
14 |
-
|
15 |
-
class Inite_Barpay_Model_Standard extends Mage_Payment_Model_Method_Abstract
|
16 |
-
{
|
17 |
-
|
18 |
-
protected $_code = 'barpay';
|
19 |
-
protected $_infoBlockType = 'barpay/info';
|
20 |
-
protected $_formBlockType = 'barpay/form';
|
21 |
-
protected $_isInitializeNeeded = true;
|
22 |
-
protected $_canUseInternal = true;
|
23 |
-
protected $_canUseForMultishipping = false;
|
24 |
-
|
25 |
-
public function getOrderPlaceRedirectUrl()
|
26 |
-
{
|
27 |
-
return Mage::getUrl('barpay/standard/pay', array('_secure' => true));
|
28 |
-
}
|
29 |
-
|
30 |
-
public function getConfigVars()
|
31 |
-
{
|
32 |
-
$obj = new StdClass();
|
33 |
-
$storeId = Mage::app()->getRequest()->getParam('store', Mage::app()->getStore()->getStoreId());
|
34 |
-
|
35 |
-
if(Mage::getStoreConfig('payment/barpay/sandbox',$storeId)){
|
36 |
-
$obj->is_sandbox_mode = true;
|
37 |
-
$obj->product_id = '4260284350017';
|
38 |
-
$obj->submit_url = 'https://test.barpay-system.de/BarPayGateWay/BarPayIssue.php?wsdl';
|
39 |
-
$obj->callback_allowed_ips = array('46.51.205.62','176.34.143.159');
|
40 |
-
}
|
41 |
-
else {
|
42 |
-
$obj->is_sandbox_mode = false;
|
43 |
-
$obj->product_id = Mage::getStoreConfig('payment/barpay/product_id',$storeId);
|
44 |
-
$obj->submit_url = Mage::getStoreConfig('payment/barpay/submit_url',$storeId);
|
45 |
-
$obj->callback_allowed_ips = array('49.51.207.28', '46.51.207.29');
|
46 |
-
}
|
47 |
-
|
48 |
-
$obj->preshared_key = Mage::getStoreConfig('payment/barpay/preshared_key',$storeId);
|
49 |
-
$obj->bi_id = Mage::getStoreConfig('payment/barpay/merchant_id',$storeId);
|
50 |
-
$obj->bi_pwd = Mage::getStoreConfig('payment/barpay/merchant_pwd',$storeId);
|
51 |
-
$obj->valdat = is_numeric(Mage::getStoreConfig('payment/barpay/valid_days',$storeId)) && intval(Mage::getStoreConfig('payment/barpay/valid_days',$storeId)) > 0 ? intval(Mage::getStoreConfig('payment/barpay/valid_days',$storeId)) : 30;
|
52 |
-
|
53 |
-
$obj->show_logo = Mage::getStoreConfig('payment/barpay/show_logo',$storeId);
|
54 |
-
|
55 |
-
$obj->file_save_path = rtrim(Mage::getStoreConfig('payment/barpay/save_path',$storeId),"\\/").'/';
|
56 |
-
$obj->file_save_enabled = Mage::getStoreConfig('payment/barpay/save_enabled',$storeId);
|
57 |
-
|
58 |
-
return $obj;
|
59 |
-
}
|
60 |
-
|
61 |
-
public function callback($params){
|
62 |
-
|
63 |
-
$clientIp = !empty($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : $_SERVER['HTTP_CLIENT_IP'];
|
64 |
-
$config = $this->getConfigVars();
|
65 |
-
|
66 |
-
if(!in_array($clientIp, $config->callback_allowed_ips)) return false;
|
67 |
-
|
68 |
-
if(isset($params['CODE'],$params['PAYC'], $params['PAYMOD'],$params['DESCRIPTION'],$params['PAYCODE_HISTORY_1'],$params['SHASIG'])){
|
69 |
-
$transactionId = $params['PAYC'];
|
70 |
-
$respCode = $params['CODE'];
|
71 |
-
|
72 |
-
$signature = $params['SHASIG'];
|
73 |
-
|
74 |
-
$i=1;
|
75 |
-
while(isset($params['PAYCODE_HISTORY_'.$i])){
|
76 |
-
$meta = $params['PAYCODE_HISTORY_'.$i];
|
77 |
-
$i++;
|
78 |
-
}
|
79 |
-
|
80 |
-
$params['REF'] = preg_replace('/.*REF=([0-9]*)||.*\z/', '$1', $meta);
|
81 |
-
$params['PAYVAL'] = preg_replace('/.*PAYVAL=([0-9\.]*)||.*\z/', '$1', $meta);
|
82 |
-
$params['TIMEAG'] = preg_replace('/.*TIMEAG=(.*)\s*\z/', '$1', $meta);
|
83 |
-
|
84 |
-
$transactionCollection = Mage::getModel('sales/order_payment_transaction')->getCollection();
|
85 |
-
$transactionCollection->getSelect()->where('txn_id = ?',$transactionId);
|
86 |
-
$transaction = $transactionCollection->getFirstItem();
|
87 |
-
|
88 |
-
$payMode = $params['PAYMOD'];
|
89 |
-
|
90 |
-
if($transaction->getOrderId() && $respCode == '000'){
|
91 |
-
|
92 |
-
$order = Mage::getModel('sales/order')->load($transaction->getOrderId());
|
93 |
-
|
94 |
-
if($signature == $this->getSignature($transaction->getOrderId(), $payMode, $params) ){
|
95 |
-
|
96 |
-
$transaction->setOrderPaymentObject($order->getPayment())->close();
|
97 |
-
|
98 |
-
$state = 'processing';
|
99 |
-
$status = 'processing';
|
100 |
-
$comment = $params['DESCRIPTION'];
|
101 |
-
$isCustomerNotified = false;
|
102 |
-
$order->setState($state, $status, $comment, $isCustomerNotified);
|
103 |
-
$order->save();
|
104 |
-
|
105 |
-
return true;
|
106 |
-
}
|
107 |
-
}
|
108 |
-
|
109 |
-
}
|
110 |
-
|
111 |
-
return false;
|
112 |
-
}
|
113 |
-
|
114 |
-
|
115 |
-
private function hasTransaction($orderId){
|
116 |
-
$transactionCollection = Mage::getModel('sales/order_payment_transaction')->getCollection();
|
117 |
-
$transactionCollection->getSelect()->where('order_id = ?',$orderId);
|
118 |
-
return $transactionCollection->count();
|
119 |
-
}
|
120 |
-
|
121 |
-
public function payOrder($orderId){
|
122 |
-
$order = Mage::getModel('sales/order')->load($orderId);
|
123 |
-
$payment = $order->getPayment();
|
124 |
-
$config = $this->getConfigVars();
|
125 |
-
|
126 |
-
if(!$this->hasTransaction($orderId)){
|
127 |
-
$rCode = $this->apiCall($orderId);
|
128 |
-
|
129 |
-
if( $rCode == 0){
|
130 |
-
$state = 'pending_barpay';
|
131 |
-
$status = 'pending_barpay';
|
132 |
-
$comment = 'Set state to pending BarPay payment';
|
133 |
-
$isCustomerNotified = false;
|
134 |
-
$order->setState($state, $status, $comment, $isCustomerNotified);
|
135 |
-
$order->save();
|
136 |
-
|
137 |
-
if($config->file_save_enabled){
|
138 |
-
$order->sendNewOrderEmailWithAttachment();
|
139 |
-
}
|
140 |
-
else{
|
141 |
-
$order->sendNewOrderEmail();
|
142 |
-
}
|
143 |
-
return true;
|
144 |
-
}
|
145 |
-
elseif($rCode >= 500) {
|
146 |
-
$state = 'canceled';
|
147 |
-
$status = 'canceled';
|
148 |
-
$comment = 'Set state to canceled (error: '.$rCode.')';
|
149 |
-
$isCustomerNotified = false;
|
150 |
-
$order->setState($state, $status, $comment, $isCustomerNotified);
|
151 |
-
$order->save();
|
152 |
-
}
|
153 |
-
elseif($rCode == 300) {
|
154 |
-
$state = 'pending_payment';
|
155 |
-
$status = 'pending_payment';
|
156 |
-
$comment = 'Gateway error: Retry to init payment process';
|
157 |
-
$isCustomerNotified = false;
|
158 |
-
$order->setState($state, $status, $comment, $isCustomerNotified);
|
159 |
-
$order->save();
|
160 |
-
}
|
161 |
-
|
162 |
-
return $rCode;
|
163 |
-
}
|
164 |
-
|
165 |
-
return false;
|
166 |
-
}
|
167 |
-
|
168 |
-
private function getSignature($orderId, $payMode, $params = array())
|
169 |
-
{
|
170 |
-
|
171 |
-
$order = Mage::getModel('sales/order')->load($orderId);
|
172 |
-
$config = $this->getConfigVars();
|
173 |
-
|
174 |
-
$preSharedKey = $config->preshared_key;
|
175 |
-
$biid = $config->bi_id;
|
176 |
-
$bipwd = $config->bi_pwd;
|
177 |
-
$prodid = $config->product_id;
|
178 |
-
$payval = sprintf("%01.2f", $order->getBaseGrandTotal());
|
179 |
-
$invbi = $order->getIncrementId();
|
180 |
-
$tracebi = $order->getId();
|
181 |
-
|
182 |
-
if($payMode == '10000'){
|
183 |
-
$sigValues = $preSharedKey.$biid.$bipwd.$tracebi.$payMode.$prodid.$payval.$invbi;
|
184 |
-
|
185 |
-
}
|
186 |
-
|
187 |
-
elseif($payMode == '10500'){
|
188 |
-
$sigValues = $preSharedKey.$biid.$bipwd.$tracebi.$payMode.$params['CODE'].$params['REF'].$params['PAYVAL'].$params['TIMEAG'];
|
189 |
-
|
190 |
-
}
|
191 |
-
|
192 |
-
|
193 |
-
return hash('sha256', $sigValues);
|
194 |
-
}
|
195 |
-
|
196 |
-
|
197 |
-
private function apiCall($orderId)
|
198 |
-
{
|
199 |
-
$order = Mage::getModel('sales/order')->load($orderId);
|
200 |
-
$config = $this->getConfigVars();
|
201 |
-
|
202 |
-
$customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
|
203 |
-
|
204 |
-
$billing_address_id= $order->getData('billing_address_id');
|
205 |
-
$address = Mage::getModel('sales/order_address')->load($billing_address_id);
|
206 |
-
|
207 |
-
$payMode = "10000";
|
208 |
-
$biid = $config->bi_id;
|
209 |
-
$bipwd = $config->bi_pwd;
|
210 |
-
$prodid = $config->product_id;
|
211 |
-
$payc = "";
|
212 |
-
$payval = sprintf("%01.2f", $order->getBaseGrandTotal());
|
213 |
-
$invbi = $order->getIncrementId();
|
214 |
-
$tracebi = $order->getId();
|
215 |
-
$billdat = Mage::getModel('core/date')->date('d-m-Y', strtotime(now()));
|
216 |
-
$bicphone = $address->getData('telephone');
|
217 |
-
$bicemail = $
|
218 |
-
if(!$config->file_save_enabled){
|
219 |
-
$bicemail = 'URL#'.$bicemail;
|
220 |
-
}
|
221 |
-
$bicecity = $address->getCity();
|
222 |
-
$bicplz = $address->getPostcode();
|
223 |
-
|
224 |
-
$bicstrt = $address->getStreetFull();
|
225 |
-
$bicstrtnr = '';
|
226 |
-
|
227 |
-
$bicnum = $customer->getId();
|
228 |
-
$binoturl = 'POST#'.Mage::getUrl('barpay/standard/callback', array('_secure'=>true, 'store'=>Mage::app()->getStore()->getStoreId()));
|
229 |
-
|
230 |
-
$valdat = date("d-m-Y",Mage::app()->getLocale()->storeTimeStamp() + $config->valdat * 24 * 60 * 60);
|
231 |
-
|
232 |
-
$hash = $this->getSignature($orderId, $payMode);
|
233 |
-
|
234 |
-
try{
|
235 |
-
|
236 |
-
$client = new SoapClient($config->submit_url);
|
237 |
-
$response = $client->Issue($payMode, $biid, $bipwd, $prodid, $payval, $invbi, $tracebi, $valdat, $billdat, $bicphone, $bicemail, $bicecity, $bicplz, $bicstrt, $bicstrtnr, $binoturl,"$hash");
|
238 |
-
|
239 |
-
} catch (Exception $e) {
|
240 |
-
return 300;
|
241 |
-
}
|
242 |
-
|
243 |
-
if($response->RECF){
|
244 |
-
|
245 |
-
if(!$config->file_save_enabled){
|
246 |
-
$voucherUrl = $response->RECF;
|
247 |
-
}
|
248 |
-
else {
|
249 |
-
|
250 |
-
$file = Mage::helper('barpay')->getFilePath($orderId);
|
251 |
-
|
252 |
-
$voucherFileKey = md5($file.time());
|
253 |
-
|
254 |
-
$base64Data = preg_replace('/^\s*<!\[CDATA\[([\s\S]*)\]\]>\s*\z/', '$1', $response->RECF);
|
255 |
-
file_put_contents($file, base64_decode($base64Data));
|
256 |
-
}
|
257 |
-
}
|
258 |
-
|
259 |
-
if($response->PAYCODE){
|
260 |
-
$payment = $order->getPayment();
|
261 |
-
$grandTotal = $order->getBaseGrandTotal();
|
262 |
-
$payment->setTransactionId($response->PAYCODE)
|
263 |
-
->setPreparedMessage("Waiting for payment")
|
264 |
-
->setIsTransactionClosed(0)
|
265 |
-
->registerAuthorizationNotification($grandTotal);
|
266 |
-
$order->save();
|
267 |
-
|
268 |
-
|
269 |
-
$transaction = Mage::getModel('sales/order_payment_transaction')
|
270 |
-
->setOrder($order)
|
271 |
-
->setOrderPaymentObject($order->getPayment())
|
272 |
-
->loadByTxnId($response->PAYCODE);
|
273 |
-
|
274 |
-
if(isset($voucherUrl)){
|
275 |
-
$transaction->setAdditionalInformation('voucher_url',$voucherUrl)->save();
|
276 |
-
}
|
277 |
-
elseif(isset($voucherFileKey)){
|
278 |
-
$transaction->setAdditionalInformation('voucher_filekey',$voucherFileKey)->save();
|
279 |
-
}
|
280 |
-
}
|
281 |
-
|
282 |
-
return $response->RETC;
|
283 |
-
}
|
284 |
-
|
285 |
-
public function getTitle()
|
286 |
-
{
|
287 |
-
return $this->getConfigData('title');
|
288 |
-
}
|
289 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
*
|
5 |
+
* This file is subject to the terms and conditions defined in
|
6 |
+
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
+
*
|
8 |
+
* @VERSION Barpay 0.1.5
|
9 |
+
*
|
10 |
+
**/
|
11 |
+
|
12 |
+
?>
|
13 |
+
<?php
|
14 |
+
|
15 |
+
class Inite_Barpay_Model_Standard extends Mage_Payment_Model_Method_Abstract
|
16 |
+
{
|
17 |
+
|
18 |
+
protected $_code = 'barpay';
|
19 |
+
protected $_infoBlockType = 'barpay/info';
|
20 |
+
protected $_formBlockType = 'barpay/form';
|
21 |
+
protected $_isInitializeNeeded = true;
|
22 |
+
protected $_canUseInternal = true;
|
23 |
+
protected $_canUseForMultishipping = false;
|
24 |
+
|
25 |
+
public function getOrderPlaceRedirectUrl()
|
26 |
+
{
|
27 |
+
return Mage::getUrl('barpay/standard/pay', array('_secure' => true));
|
28 |
+
}
|
29 |
+
|
30 |
+
public function getConfigVars()
|
31 |
+
{
|
32 |
+
$obj = new StdClass();
|
33 |
+
$storeId = Mage::app()->getRequest()->getParam('store', Mage::app()->getStore()->getStoreId());
|
34 |
+
|
35 |
+
if(Mage::getStoreConfig('payment/barpay/sandbox',$storeId)){
|
36 |
+
$obj->is_sandbox_mode = true;
|
37 |
+
$obj->product_id = '4260284350017';
|
38 |
+
$obj->submit_url = 'https://test.barpay-system.de/BarPayGateWay/BarPayIssue.php?wsdl';
|
39 |
+
$obj->callback_allowed_ips = array('46.51.205.62','176.34.143.159');
|
40 |
+
}
|
41 |
+
else {
|
42 |
+
$obj->is_sandbox_mode = false;
|
43 |
+
$obj->product_id = Mage::getStoreConfig('payment/barpay/product_id',$storeId);
|
44 |
+
$obj->submit_url = Mage::getStoreConfig('payment/barpay/submit_url',$storeId);
|
45 |
+
$obj->callback_allowed_ips = array('49.51.207.28', '46.51.207.29');
|
46 |
+
}
|
47 |
+
|
48 |
+
$obj->preshared_key = Mage::getStoreConfig('payment/barpay/preshared_key',$storeId);
|
49 |
+
$obj->bi_id = Mage::getStoreConfig('payment/barpay/merchant_id',$storeId);
|
50 |
+
$obj->bi_pwd = Mage::getStoreConfig('payment/barpay/merchant_pwd',$storeId);
|
51 |
+
$obj->valdat = is_numeric(Mage::getStoreConfig('payment/barpay/valid_days',$storeId)) && intval(Mage::getStoreConfig('payment/barpay/valid_days',$storeId)) > 0 ? intval(Mage::getStoreConfig('payment/barpay/valid_days',$storeId)) : 30;
|
52 |
+
|
53 |
+
$obj->show_logo = Mage::getStoreConfig('payment/barpay/show_logo',$storeId);
|
54 |
+
|
55 |
+
$obj->file_save_path = rtrim(Mage::getStoreConfig('payment/barpay/save_path',$storeId),"\\/").'/';
|
56 |
+
$obj->file_save_enabled = Mage::getStoreConfig('payment/barpay/save_enabled',$storeId);
|
57 |
+
|
58 |
+
return $obj;
|
59 |
+
}
|
60 |
+
|
61 |
+
public function callback($params){
|
62 |
+
|
63 |
+
$clientIp = !empty($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : $_SERVER['HTTP_CLIENT_IP'];
|
64 |
+
$config = $this->getConfigVars();
|
65 |
+
|
66 |
+
if(!in_array($clientIp, $config->callback_allowed_ips)) return false;
|
67 |
+
|
68 |
+
if(isset($params['CODE'],$params['PAYC'], $params['PAYMOD'],$params['DESCRIPTION'],$params['PAYCODE_HISTORY_1'],$params['SHASIG'])){
|
69 |
+
$transactionId = $params['PAYC'];
|
70 |
+
$respCode = $params['CODE'];
|
71 |
+
|
72 |
+
$signature = $params['SHASIG'];
|
73 |
+
|
74 |
+
$i=1;
|
75 |
+
while(isset($params['PAYCODE_HISTORY_'.$i])){
|
76 |
+
$meta = $params['PAYCODE_HISTORY_'.$i];
|
77 |
+
$i++;
|
78 |
+
}
|
79 |
+
|
80 |
+
$params['REF'] = preg_replace('/.*REF=([0-9]*)||.*\z/', '$1', $meta);
|
81 |
+
$params['PAYVAL'] = preg_replace('/.*PAYVAL=([0-9\.]*)||.*\z/', '$1', $meta);
|
82 |
+
$params['TIMEAG'] = preg_replace('/.*TIMEAG=(.*)\s*\z/', '$1', $meta);
|
83 |
+
|
84 |
+
$transactionCollection = Mage::getModel('sales/order_payment_transaction')->getCollection();
|
85 |
+
$transactionCollection->getSelect()->where('txn_id = ?',$transactionId);
|
86 |
+
$transaction = $transactionCollection->getFirstItem();
|
87 |
+
|
88 |
+
$payMode = $params['PAYMOD'];
|
89 |
+
|
90 |
+
if($transaction->getOrderId() && $respCode == '000'){
|
91 |
+
|
92 |
+
$order = Mage::getModel('sales/order')->load($transaction->getOrderId());
|
93 |
+
|
94 |
+
if($signature == $this->getSignature($transaction->getOrderId(), $payMode, $params) ){
|
95 |
+
|
96 |
+
$transaction->setOrderPaymentObject($order->getPayment())->close();
|
97 |
+
|
98 |
+
$state = 'processing';
|
99 |
+
$status = 'processing';
|
100 |
+
$comment = $params['DESCRIPTION'];
|
101 |
+
$isCustomerNotified = false;
|
102 |
+
$order->setState($state, $status, $comment, $isCustomerNotified);
|
103 |
+
$order->save();
|
104 |
+
|
105 |
+
return true;
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
}
|
110 |
+
|
111 |
+
return false;
|
112 |
+
}
|
113 |
+
|
114 |
+
|
115 |
+
private function hasTransaction($orderId){
|
116 |
+
$transactionCollection = Mage::getModel('sales/order_payment_transaction')->getCollection();
|
117 |
+
$transactionCollection->getSelect()->where('order_id = ?',$orderId);
|
118 |
+
return $transactionCollection->count();
|
119 |
+
}
|
120 |
+
|
121 |
+
public function payOrder($orderId){
|
122 |
+
$order = Mage::getModel('sales/order')->load($orderId);
|
123 |
+
$payment = $order->getPayment();
|
124 |
+
$config = $this->getConfigVars();
|
125 |
+
|
126 |
+
if(!$this->hasTransaction($orderId)){
|
127 |
+
$rCode = $this->apiCall($orderId);
|
128 |
+
|
129 |
+
if( $rCode == 0){
|
130 |
+
$state = 'pending_barpay';
|
131 |
+
$status = 'pending_barpay';
|
132 |
+
$comment = 'Set state to pending BarPay payment';
|
133 |
+
$isCustomerNotified = false;
|
134 |
+
$order->setState($state, $status, $comment, $isCustomerNotified);
|
135 |
+
$order->save();
|
136 |
+
|
137 |
+
if($config->file_save_enabled){
|
138 |
+
$order->sendNewOrderEmailWithAttachment();
|
139 |
+
}
|
140 |
+
else{
|
141 |
+
$order->sendNewOrderEmail();
|
142 |
+
}
|
143 |
+
return true;
|
144 |
+
}
|
145 |
+
elseif($rCode >= 500) {
|
146 |
+
$state = 'canceled';
|
147 |
+
$status = 'canceled';
|
148 |
+
$comment = 'Set state to canceled (error: '.$rCode.')';
|
149 |
+
$isCustomerNotified = false;
|
150 |
+
$order->setState($state, $status, $comment, $isCustomerNotified);
|
151 |
+
$order->save();
|
152 |
+
}
|
153 |
+
elseif($rCode == 300) {
|
154 |
+
$state = 'pending_payment';
|
155 |
+
$status = 'pending_payment';
|
156 |
+
$comment = 'Gateway error: Retry to init payment process';
|
157 |
+
$isCustomerNotified = false;
|
158 |
+
$order->setState($state, $status, $comment, $isCustomerNotified);
|
159 |
+
$order->save();
|
160 |
+
}
|
161 |
+
|
162 |
+
return $rCode;
|
163 |
+
}
|
164 |
+
|
165 |
+
return false;
|
166 |
+
}
|
167 |
+
|
168 |
+
private function getSignature($orderId, $payMode, $params = array())
|
169 |
+
{
|
170 |
+
|
171 |
+
$order = Mage::getModel('sales/order')->load($orderId);
|
172 |
+
$config = $this->getConfigVars();
|
173 |
+
|
174 |
+
$preSharedKey = $config->preshared_key;
|
175 |
+
$biid = $config->bi_id;
|
176 |
+
$bipwd = $config->bi_pwd;
|
177 |
+
$prodid = $config->product_id;
|
178 |
+
$payval = sprintf("%01.2f", $order->getBaseGrandTotal());
|
179 |
+
$invbi = $order->getIncrementId();
|
180 |
+
$tracebi = $order->getId();
|
181 |
+
|
182 |
+
if($payMode == '10000'){
|
183 |
+
$sigValues = $preSharedKey.$biid.$bipwd.$tracebi.$payMode.$prodid.$payval.$invbi;
|
184 |
+
|
185 |
+
}
|
186 |
+
|
187 |
+
elseif($payMode == '10500'){
|
188 |
+
$sigValues = $preSharedKey.$biid.$bipwd.$tracebi.$payMode.$params['CODE'].$params['REF'].$params['PAYVAL'].$params['TIMEAG'];
|
189 |
+
|
190 |
+
}
|
191 |
+
|
192 |
+
|
193 |
+
return hash('sha256', $sigValues);
|
194 |
+
}
|
195 |
+
|
196 |
+
|
197 |
+
private function apiCall($orderId)
|
198 |
+
{
|
199 |
+
$order = Mage::getModel('sales/order')->load($orderId);
|
200 |
+
$config = $this->getConfigVars();
|
201 |
+
|
202 |
+
$customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
|
203 |
+
|
204 |
+
$billing_address_id= $order->getData('billing_address_id');
|
205 |
+
$address = Mage::getModel('sales/order_address')->load($billing_address_id);
|
206 |
+
|
207 |
+
$payMode = "10000";
|
208 |
+
$biid = $config->bi_id;
|
209 |
+
$bipwd = $config->bi_pwd;
|
210 |
+
$prodid = $config->product_id;
|
211 |
+
$payc = "";
|
212 |
+
$payval = sprintf("%01.2f", $order->getBaseGrandTotal());
|
213 |
+
$invbi = $order->getIncrementId();
|
214 |
+
$tracebi = $order->getId();
|
215 |
+
$billdat = Mage::getModel('core/date')->date('d-m-Y', strtotime(now()));
|
216 |
+
$bicphone = $address->getData('telephone');
|
217 |
+
$bicemail = $config->is_sandbox_mode ? 'installation@ezv-gmbh.de' : $customer->getData('email');
|
218 |
+
if(!$config->file_save_enabled){
|
219 |
+
$bicemail = 'URL#'.$bicemail;
|
220 |
+
}
|
221 |
+
$bicecity = $address->getCity();
|
222 |
+
$bicplz = $address->getPostcode();
|
223 |
+
|
224 |
+
$bicstrt = $address->getStreetFull();
|
225 |
+
$bicstrtnr = '';
|
226 |
+
|
227 |
+
$bicnum = $customer->getId();
|
228 |
+
$binoturl = 'POST#'.Mage::getUrl('barpay/standard/callback', array('_secure'=>true, 'store'=>Mage::app()->getStore()->getStoreId()));
|
229 |
+
|
230 |
+
$valdat = date("d-m-Y",Mage::app()->getLocale()->storeTimeStamp() + $config->valdat * 24 * 60 * 60);
|
231 |
+
|
232 |
+
$hash = $this->getSignature($orderId, $payMode);
|
233 |
+
|
234 |
+
try{
|
235 |
+
|
236 |
+
$client = new SoapClient($config->submit_url);
|
237 |
+
$response = $client->Issue($payMode, $biid, $bipwd, $prodid, $payval, $invbi, $tracebi, $valdat, $billdat, $bicphone, $bicemail, $bicecity, $bicplz, $bicstrt, $bicstrtnr, $binoturl,"$hash");
|
238 |
+
|
239 |
+
} catch (Exception $e) {
|
240 |
+
return 300;
|
241 |
+
}
|
242 |
+
|
243 |
+
if($response->RECF){
|
244 |
+
|
245 |
+
if(!$config->file_save_enabled){
|
246 |
+
$voucherUrl = $response->RECF;
|
247 |
+
}
|
248 |
+
else {
|
249 |
+
|
250 |
+
$file = Mage::helper('barpay')->getFilePath($orderId);
|
251 |
+
|
252 |
+
$voucherFileKey = md5($file.time());
|
253 |
+
|
254 |
+
$base64Data = preg_replace('/^\s*<!\[CDATA\[([\s\S]*)\]\]>\s*\z/', '$1', $response->RECF);
|
255 |
+
file_put_contents($file, base64_decode($base64Data));
|
256 |
+
}
|
257 |
+
}
|
258 |
+
|
259 |
+
if($response->PAYCODE){
|
260 |
+
$payment = $order->getPayment();
|
261 |
+
$grandTotal = $order->getBaseGrandTotal();
|
262 |
+
$payment->setTransactionId($response->PAYCODE)
|
263 |
+
->setPreparedMessage("Waiting for payment")
|
264 |
+
->setIsTransactionClosed(0)
|
265 |
+
->registerAuthorizationNotification($grandTotal);
|
266 |
+
$order->save();
|
267 |
+
|
268 |
+
|
269 |
+
$transaction = Mage::getModel('sales/order_payment_transaction')
|
270 |
+
->setOrder($order)
|
271 |
+
->setOrderPaymentObject($order->getPayment())
|
272 |
+
->loadByTxnId($response->PAYCODE);
|
273 |
+
|
274 |
+
if(isset($voucherUrl)){
|
275 |
+
$transaction->setAdditionalInformation('voucher_url',$voucherUrl)->save();
|
276 |
+
}
|
277 |
+
elseif(isset($voucherFileKey)){
|
278 |
+
$transaction->setAdditionalInformation('voucher_filekey',$voucherFileKey)->save();
|
279 |
+
}
|
280 |
+
}
|
281 |
+
|
282 |
+
return $response->RETC;
|
283 |
+
}
|
284 |
+
|
285 |
+
public function getTitle()
|
286 |
+
{
|
287 |
+
return $this->getConfigData('title');
|
288 |
+
}
|
289 |
}
|
app/code/community/Inite/Barpay/controllers/AdminController.php
CHANGED
@@ -1,36 +1,36 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* This file is subject to the terms and conditions defined in
|
6 |
-
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
-
*
|
8 |
-
* @VERSION Barpay 0.1.
|
9 |
-
*
|
10 |
-
**/
|
11 |
-
|
12 |
-
?>
|
13 |
-
<?php
|
14 |
-
class Inite_Barpay_AdminController extends Mage_Adminhtml_Controller_Action
|
15 |
-
{
|
16 |
-
public function repayAction()
|
17 |
-
{
|
18 |
-
$orderId = $this->getRequest()->getParam('order_id',false);
|
19 |
-
|
20 |
-
if($orderId){
|
21 |
-
|
22 |
-
$rCode = Mage::getModel('barpay/standard')->payOrder($orderId);
|
23 |
-
|
24 |
-
if( $rCode === true){
|
25 |
-
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('barpay')->__('Payment has been initialized.'));
|
26 |
-
}
|
27 |
-
elseif($rCode >= 500) {
|
28 |
-
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('barpay')->__('Order has been canceled due to a permanent error.'));
|
29 |
-
}
|
30 |
-
elseif($rCode == 300) {
|
31 |
-
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('barpay')->__('Payment gateway could not be reached.'));
|
32 |
-
}
|
33 |
-
}
|
34 |
-
$this->_redirect('adminhtml/sales_order/view',array('_current'=>true));
|
35 |
-
}
|
36 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
*
|
5 |
+
* This file is subject to the terms and conditions defined in
|
6 |
+
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
+
*
|
8 |
+
* @VERSION Barpay 0.1.5
|
9 |
+
*
|
10 |
+
**/
|
11 |
+
|
12 |
+
?>
|
13 |
+
<?php
|
14 |
+
class Inite_Barpay_AdminController extends Mage_Adminhtml_Controller_Action
|
15 |
+
{
|
16 |
+
public function repayAction()
|
17 |
+
{
|
18 |
+
$orderId = $this->getRequest()->getParam('order_id',false);
|
19 |
+
|
20 |
+
if($orderId){
|
21 |
+
|
22 |
+
$rCode = Mage::getModel('barpay/standard')->payOrder($orderId);
|
23 |
+
|
24 |
+
if( $rCode === true){
|
25 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('barpay')->__('Payment has been initialized.'));
|
26 |
+
}
|
27 |
+
elseif($rCode >= 500) {
|
28 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('barpay')->__('Order has been canceled due to a permanent error.'));
|
29 |
+
}
|
30 |
+
elseif($rCode == 300) {
|
31 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('barpay')->__('Payment gateway could not be reached.'));
|
32 |
+
}
|
33 |
+
}
|
34 |
+
$this->_redirect('adminhtml/sales_order/view',array('_current'=>true));
|
35 |
+
}
|
36 |
}
|
app/code/community/Inite/Barpay/controllers/StandardController.php
CHANGED
@@ -1,126 +1,126 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* This file is subject to the terms and conditions defined in
|
6 |
-
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
-
*
|
8 |
-
* @VERSION Barpay 0.1.
|
9 |
-
*
|
10 |
-
**/
|
11 |
-
|
12 |
-
?>
|
13 |
-
<?php
|
14 |
-
class Inite_Barpay_StandardController extends Mage_Core_Controller_Front_Action
|
15 |
-
{
|
16 |
-
public function indexAction()
|
17 |
-
{
|
18 |
-
$this->loadLayout();
|
19 |
-
$this->renderLayout();
|
20 |
-
}
|
21 |
-
|
22 |
-
|
23 |
-
public function payAction()
|
24 |
-
{
|
25 |
-
$orderId = $this->_getCheckout()->getLastOrderId();
|
26 |
-
$rCode = Mage::getModel('barpay/standard')->payOrder($orderId);
|
27 |
-
|
28 |
-
if( $rCode == true){
|
29 |
-
Mage::getSingleton('customer/session')->setData('barpay_order_id', $orderId);
|
30 |
-
|
31 |
-
}
|
32 |
-
elseif($rCode >= 500) {
|
33 |
-
Mage::getSingleton('customer/session')->addError(Mage::helper('barpay')->__('Order has been canceled due to a permanent error.'));
|
34 |
-
$this->_redirect('/');
|
35 |
-
}
|
36 |
-
elseif($rCode == 300) {
|
37 |
-
Mage::getSingleton('customer/session')->addError(Mage::helper('barpay')->__('Payment gateway could not be reached.'));
|
38 |
-
$this->_redirect('/');
|
39 |
-
}
|
40 |
-
|
41 |
-
$this->_forward('index');
|
42 |
-
}
|
43 |
-
|
44 |
-
public function fileAction()
|
45 |
-
{
|
46 |
-
$orderId = $this->getRequest()->getParam('order');
|
47 |
-
$fileKey = $this->getRequest()->getParam('key');
|
48 |
-
|
49 |
-
$order = Mage::getModel('sales/order')->load($orderId);
|
50 |
-
$orderIncId = $order->getIncrementId();
|
51 |
-
|
52 |
-
$file = Mage::helper('barpay')->getFilePath($orderId);
|
53 |
-
|
54 |
-
Mage::getSingleton('core/session', array('name'=>'frontend'));
|
55 |
-
$c_session = Mage::getSingleton('customer/session', array('name'=>'frontend'));
|
56 |
-
|
57 |
-
Mage::getSingleton('core/session', array('name'=>'adminhtml'));
|
58 |
-
$a_session = Mage::getSingleton('admin/session', array('name'=>'adminhtml'));
|
59 |
-
|
60 |
-
$isProtected = ($fileKey == Mage::helper('barpay')->getFileKey($orderId)) ? false : true;
|
61 |
-
$isAdmin = ($a_session && $a_session->isLoggedIn()) ? true : false;
|
62 |
-
$isCustomer = ($c_session && $c_session->isLoggedIn()) ? true : false;
|
63 |
-
|
64 |
-
if( !$isAdmin && !$isCustomer && $isProtected && !file_exists($file) ){
|
65 |
-
$current_url = Mage::getUrl('barpay/standard/file', array('_current'=>true));
|
66 |
-
$c_session->setBeforeAuthUrl($current_url);
|
67 |
-
|
68 |
-
$this->getResponse()->setRedirect(Mage::helper('customer')->getLoginUrl());
|
69 |
-
$this->getResponse()->sendHeaders();
|
70 |
-
exit;
|
71 |
-
}
|
72 |
-
|
73 |
-
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
74 |
-
$customerId = $customer->getId();
|
75 |
-
|
76 |
-
$frontFilename = 'barpay_voucher_'.$orderIncId.'.pdf';
|
77 |
-
|
78 |
-
if( file_exists($file) && ($customerId == $order->getCustomerId() || $isAdmin || !$isProtected) ){
|
79 |
-
|
80 |
-
if(function_exists("mime_content_type")){
|
81 |
-
$mime_type = mime_content_type($file);
|
82 |
-
}
|
83 |
-
else {
|
84 |
-
$mime_type = finfo_file(finfo_open(FILEINFO_MIME_TYPE), $file);
|
85 |
-
}
|
86 |
-
|
87 |
-
if (file_exists($file))
|
88 |
-
{
|
89 |
-
$this->getResponse()
|
90 |
-
->setHeader('Content-Disposition', 'attachment; filename='.$frontFilename)
|
91 |
-
->setHeader('Content-Transfer-Encoding', 'binary')
|
92 |
-
->setHeader('Content-Length', filesize($file))
|
93 |
-
->setHeader('Content-type', $mime_type);
|
94 |
-
|
95 |
-
$this->getResponse()->sendHeaders();
|
96 |
-
|
97 |
-
readfile($file);
|
98 |
-
exit;
|
99 |
-
}
|
100 |
-
}
|
101 |
-
}
|
102 |
-
|
103 |
-
|
104 |
-
public function callbackAction()
|
105 |
-
{
|
106 |
-
$params = $this->getRequest()->getParams();
|
107 |
-
$success = Mage::getModel('barpay/standard')->callback($params);
|
108 |
-
if($success){
|
109 |
-
$this->getResponse()->setHeader('RETC', '0');
|
110 |
-
$this->getResponse()->sendHeaders();
|
111 |
-
echo 'RETC=0';
|
112 |
-
}
|
113 |
-
else {
|
114 |
-
$this->getResponse()->setHeader('RETC', '500');
|
115 |
-
$this->getResponse()->sendHeaders();
|
116 |
-
echo 'RETC=500';
|
117 |
-
}
|
118 |
-
exit;
|
119 |
-
}
|
120 |
-
|
121 |
-
protected function _getCheckout()
|
122 |
-
{
|
123 |
-
return Mage::getSingleton('checkout/session');
|
124 |
-
}
|
125 |
-
|
126 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
*
|
5 |
+
* This file is subject to the terms and conditions defined in
|
6 |
+
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
+
*
|
8 |
+
* @VERSION Barpay 0.1.5
|
9 |
+
*
|
10 |
+
**/
|
11 |
+
|
12 |
+
?>
|
13 |
+
<?php
|
14 |
+
class Inite_Barpay_StandardController extends Mage_Core_Controller_Front_Action
|
15 |
+
{
|
16 |
+
public function indexAction()
|
17 |
+
{
|
18 |
+
$this->loadLayout();
|
19 |
+
$this->renderLayout();
|
20 |
+
}
|
21 |
+
|
22 |
+
|
23 |
+
public function payAction()
|
24 |
+
{
|
25 |
+
$orderId = $this->_getCheckout()->getLastOrderId();
|
26 |
+
$rCode = Mage::getModel('barpay/standard')->payOrder($orderId);
|
27 |
+
|
28 |
+
if( $rCode == true){
|
29 |
+
Mage::getSingleton('customer/session')->setData('barpay_order_id', $orderId);
|
30 |
+
|
31 |
+
}
|
32 |
+
elseif($rCode >= 500) {
|
33 |
+
Mage::getSingleton('customer/session')->addError(Mage::helper('barpay')->__('Order has been canceled due to a permanent error.'));
|
34 |
+
$this->_redirect('/');
|
35 |
+
}
|
36 |
+
elseif($rCode == 300) {
|
37 |
+
Mage::getSingleton('customer/session')->addError(Mage::helper('barpay')->__('Payment gateway could not be reached.'));
|
38 |
+
$this->_redirect('/');
|
39 |
+
}
|
40 |
+
|
41 |
+
$this->_forward('index');
|
42 |
+
}
|
43 |
+
|
44 |
+
public function fileAction()
|
45 |
+
{
|
46 |
+
$orderId = $this->getRequest()->getParam('order');
|
47 |
+
$fileKey = $this->getRequest()->getParam('key');
|
48 |
+
|
49 |
+
$order = Mage::getModel('sales/order')->load($orderId);
|
50 |
+
$orderIncId = $order->getIncrementId();
|
51 |
+
|
52 |
+
$file = Mage::helper('barpay')->getFilePath($orderId);
|
53 |
+
|
54 |
+
Mage::getSingleton('core/session', array('name'=>'frontend'));
|
55 |
+
$c_session = Mage::getSingleton('customer/session', array('name'=>'frontend'));
|
56 |
+
|
57 |
+
Mage::getSingleton('core/session', array('name'=>'adminhtml'));
|
58 |
+
$a_session = Mage::getSingleton('admin/session', array('name'=>'adminhtml'));
|
59 |
+
|
60 |
+
$isProtected = ($fileKey == Mage::helper('barpay')->getFileKey($orderId)) ? false : true;
|
61 |
+
$isAdmin = ($a_session && $a_session->isLoggedIn()) ? true : false;
|
62 |
+
$isCustomer = ($c_session && $c_session->isLoggedIn()) ? true : false;
|
63 |
+
|
64 |
+
if( !$isAdmin && !$isCustomer && $isProtected && !file_exists($file) ){
|
65 |
+
$current_url = Mage::getUrl('barpay/standard/file', array('_current'=>true));
|
66 |
+
$c_session->setBeforeAuthUrl($current_url);
|
67 |
+
|
68 |
+
$this->getResponse()->setRedirect(Mage::helper('customer')->getLoginUrl());
|
69 |
+
$this->getResponse()->sendHeaders();
|
70 |
+
exit;
|
71 |
+
}
|
72 |
+
|
73 |
+
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
74 |
+
$customerId = $customer->getId();
|
75 |
+
|
76 |
+
$frontFilename = 'barpay_voucher_'.$orderIncId.'.pdf';
|
77 |
+
|
78 |
+
if( file_exists($file) && ($customerId == $order->getCustomerId() || $isAdmin || !$isProtected) ){
|
79 |
+
|
80 |
+
if(function_exists("mime_content_type")){
|
81 |
+
$mime_type = mime_content_type($file);
|
82 |
+
}
|
83 |
+
else {
|
84 |
+
$mime_type = finfo_file(finfo_open(FILEINFO_MIME_TYPE), $file);
|
85 |
+
}
|
86 |
+
|
87 |
+
if (file_exists($file))
|
88 |
+
{
|
89 |
+
$this->getResponse()
|
90 |
+
->setHeader('Content-Disposition', 'attachment; filename='.$frontFilename)
|
91 |
+
->setHeader('Content-Transfer-Encoding', 'binary')
|
92 |
+
->setHeader('Content-Length', filesize($file))
|
93 |
+
->setHeader('Content-type', $mime_type);
|
94 |
+
|
95 |
+
$this->getResponse()->sendHeaders();
|
96 |
+
|
97 |
+
readfile($file);
|
98 |
+
exit;
|
99 |
+
}
|
100 |
+
}
|
101 |
+
}
|
102 |
+
|
103 |
+
|
104 |
+
public function callbackAction()
|
105 |
+
{
|
106 |
+
$params = $this->getRequest()->getParams();
|
107 |
+
$success = Mage::getModel('barpay/standard')->callback($params);
|
108 |
+
if($success){
|
109 |
+
$this->getResponse()->setHeader('RETC', '0');
|
110 |
+
$this->getResponse()->sendHeaders();
|
111 |
+
echo 'RETC=0';
|
112 |
+
}
|
113 |
+
else {
|
114 |
+
$this->getResponse()->setHeader('RETC', '500');
|
115 |
+
$this->getResponse()->sendHeaders();
|
116 |
+
echo 'RETC=500';
|
117 |
+
}
|
118 |
+
exit;
|
119 |
+
}
|
120 |
+
|
121 |
+
protected function _getCheckout()
|
122 |
+
{
|
123 |
+
return Mage::getSingleton('checkout/session');
|
124 |
+
}
|
125 |
+
|
126 |
+
}
|
app/code/community/Inite/Barpay/etc/config.xml
CHANGED
@@ -1,149 +1,149 @@
|
|
1 |
-
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
-
<config>
|
3 |
-
<modules>
|
4 |
-
<Inite_Barpay>
|
5 |
-
<version>0.1.
|
6 |
-
</Inite_Barpay>
|
7 |
-
</modules>
|
8 |
-
|
9 |
-
<default>
|
10 |
-
<payment>
|
11 |
-
<barpay>
|
12 |
-
<sandbox>0</sandbox>
|
13 |
-
<merchant_id>003000100010001000066</merchant_id>
|
14 |
-
<merchant_pwd>b4p4yt3st1n4g</merchant_pwd>
|
15 |
-
<preshared_key>49735a24765967ccd770d3a0593053534a22674d1d277644f353fcd8e4</preshared_key>
|
16 |
-
<product_id>4260284350017</product_id>
|
17 |
-
<submit_url>https://livebi.barpay-system.de/BarPayGateWay/BarPayIssue.php?wsdl</submit_url>
|
18 |
-
<save_enabled>0</save_enabled>
|
19 |
-
<show_logo>0</show_logo>
|
20 |
-
<valid_days>30</valid_days>
|
21 |
-
</barpay>
|
22 |
-
</payment>
|
23 |
-
</default>
|
24 |
-
|
25 |
-
<frontend>
|
26 |
-
<routers>
|
27 |
-
<barpay>
|
28 |
-
<use>standard</use>
|
29 |
-
<args>
|
30 |
-
<module>Inite_Barpay</module>
|
31 |
-
<frontName>barpay</frontName>
|
32 |
-
</args>
|
33 |
-
</barpay>
|
34 |
-
</routers>
|
35 |
-
|
36 |
-
<layout>
|
37 |
-
<updates>
|
38 |
-
<barpay>
|
39 |
-
<file>barpay.xml</file>
|
40 |
-
</barpay>
|
41 |
-
</updates>
|
42 |
-
</layout>
|
43 |
-
</frontend>
|
44 |
-
|
45 |
-
<global>
|
46 |
-
|
47 |
-
<sales>
|
48 |
-
<order>
|
49 |
-
<statuses>
|
50 |
-
<pending_barpay translate="label"><label>Pending Barpay</label></pending_barpay>
|
51 |
-
</statuses>
|
52 |
-
<states>
|
53 |
-
<pending_barpay>
|
54 |
-
<statuses>
|
55 |
-
<pending_barpay />
|
56 |
-
</statuses>
|
57 |
-
<visible_on_front/>
|
58 |
-
</pending_barpay>
|
59 |
-
</states>
|
60 |
-
</order>
|
61 |
-
</sales>
|
62 |
-
|
63 |
-
<models>
|
64 |
-
<barpay>
|
65 |
-
<class>Inite_Barpay_Model</class>
|
66 |
-
</barpay>
|
67 |
-
<sales>
|
68 |
-
<rewrite>
|
69 |
-
<order>Inite_Barpay_Model_Sales_Order</order>
|
70 |
-
</rewrite>
|
71 |
-
</sales>
|
72 |
-
<core>
|
73 |
-
<rewrite>
|
74 |
-
<email_template_mailer>Inite_Barpay_Model_Email_Template_Mailer</email_template_mailer>
|
75 |
-
<email_template>Inite_Barpay_Model_Email_Template</email_template>
|
76 |
-
</rewrite>
|
77 |
-
</core>
|
78 |
-
</models>
|
79 |
-
|
80 |
-
<helpers>
|
81 |
-
<barpay>
|
82 |
-
<class>Inite_Barpay_Helper</class>
|
83 |
-
</barpay>
|
84 |
-
</helpers>
|
85 |
-
|
86 |
-
<blocks>
|
87 |
-
<barpay>
|
88 |
-
<class>Inite_Barpay_Block</class>
|
89 |
-
</barpay>
|
90 |
-
|
91 |
-
</blocks>
|
92 |
-
|
93 |
-
<resources>
|
94 |
-
<barpay_setup>
|
95 |
-
<setup>
|
96 |
-
<module>Inite_Barpay</module>
|
97 |
-
</setup>
|
98 |
-
<connection>
|
99 |
-
<use>core_setup</use>
|
100 |
-
</connection>
|
101 |
-
</barpay_setup>
|
102 |
-
|
103 |
-
<barpay_write>
|
104 |
-
<connection>
|
105 |
-
<use>core_write</use>
|
106 |
-
</connection>
|
107 |
-
</barpay_write>
|
108 |
-
<barpay_read>
|
109 |
-
<connection>
|
110 |
-
<use>core_read</use>
|
111 |
-
</connection>
|
112 |
-
</barpay_read>
|
113 |
-
</resources>
|
114 |
-
|
115 |
-
</global>
|
116 |
-
|
117 |
-
<admin>
|
118 |
-
<routers>
|
119 |
-
<barpayadmin>
|
120 |
-
<use>admin</use>
|
121 |
-
<args>
|
122 |
-
<module>Inite_Barpay</module>
|
123 |
-
<frontName>barpayadmin</frontName>
|
124 |
-
</args>
|
125 |
-
</barpayadmin>
|
126 |
-
</routers>
|
127 |
-
</admin>
|
128 |
-
|
129 |
-
<default>
|
130 |
-
<payment>
|
131 |
-
<barpay>
|
132 |
-
<model>barpay/standard</model>
|
133 |
-
<active>0</active>
|
134 |
-
<order_status>pending</order_status>
|
135 |
-
<title>Barpay (0.1.
|
136 |
-
<comment>
|
137 |
-
<![CDATA[This text appears just beneath the field with a small arrow.
|
138 |
-
<span class="notice">It can contain HTML formatting too!</span>]]>
|
139 |
-
</comment>
|
140 |
-
<submit_url>https://livebi.barpay-system.de/BarPayGateWay/BarPayIssue.php?wsdl</submit_url>
|
141 |
-
<allowspecific>0</allowspecific>
|
142 |
-
<sort_order>100</sort_order>
|
143 |
-
</barpay>
|
144 |
-
</payment>
|
145 |
-
</default>
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
</config>
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Inite_Barpay>
|
5 |
+
<version>0.1.5</version>
|
6 |
+
</Inite_Barpay>
|
7 |
+
</modules>
|
8 |
+
|
9 |
+
<default>
|
10 |
+
<payment>
|
11 |
+
<barpay>
|
12 |
+
<sandbox>0</sandbox>
|
13 |
+
<merchant_id>003000100010001000066</merchant_id>
|
14 |
+
<merchant_pwd>b4p4yt3st1n4g</merchant_pwd>
|
15 |
+
<preshared_key>49735a24765967ccd770d3a0593053534a22674d1d277644f353fcd8e4</preshared_key>
|
16 |
+
<product_id>4260284350017</product_id>
|
17 |
+
<submit_url>https://livebi.barpay-system.de/BarPayGateWay/BarPayIssue.php?wsdl</submit_url>
|
18 |
+
<save_enabled>0</save_enabled>
|
19 |
+
<show_logo>0</show_logo>
|
20 |
+
<valid_days>30</valid_days>
|
21 |
+
</barpay>
|
22 |
+
</payment>
|
23 |
+
</default>
|
24 |
+
|
25 |
+
<frontend>
|
26 |
+
<routers>
|
27 |
+
<barpay>
|
28 |
+
<use>standard</use>
|
29 |
+
<args>
|
30 |
+
<module>Inite_Barpay</module>
|
31 |
+
<frontName>barpay</frontName>
|
32 |
+
</args>
|
33 |
+
</barpay>
|
34 |
+
</routers>
|
35 |
+
|
36 |
+
<layout>
|
37 |
+
<updates>
|
38 |
+
<barpay>
|
39 |
+
<file>barpay.xml</file>
|
40 |
+
</barpay>
|
41 |
+
</updates>
|
42 |
+
</layout>
|
43 |
+
</frontend>
|
44 |
+
|
45 |
+
<global>
|
46 |
+
|
47 |
+
<sales>
|
48 |
+
<order>
|
49 |
+
<statuses>
|
50 |
+
<pending_barpay translate="label"><label>Pending Barpay</label></pending_barpay>
|
51 |
+
</statuses>
|
52 |
+
<states>
|
53 |
+
<pending_barpay>
|
54 |
+
<statuses>
|
55 |
+
<pending_barpay />
|
56 |
+
</statuses>
|
57 |
+
<visible_on_front/>
|
58 |
+
</pending_barpay>
|
59 |
+
</states>
|
60 |
+
</order>
|
61 |
+
</sales>
|
62 |
+
|
63 |
+
<models>
|
64 |
+
<barpay>
|
65 |
+
<class>Inite_Barpay_Model</class>
|
66 |
+
</barpay>
|
67 |
+
<sales>
|
68 |
+
<rewrite>
|
69 |
+
<order>Inite_Barpay_Model_Sales_Order</order>
|
70 |
+
</rewrite>
|
71 |
+
</sales>
|
72 |
+
<core>
|
73 |
+
<rewrite>
|
74 |
+
<email_template_mailer>Inite_Barpay_Model_Email_Template_Mailer</email_template_mailer>
|
75 |
+
<email_template>Inite_Barpay_Model_Email_Template</email_template>
|
76 |
+
</rewrite>
|
77 |
+
</core>
|
78 |
+
</models>
|
79 |
+
|
80 |
+
<helpers>
|
81 |
+
<barpay>
|
82 |
+
<class>Inite_Barpay_Helper</class>
|
83 |
+
</barpay>
|
84 |
+
</helpers>
|
85 |
+
|
86 |
+
<blocks>
|
87 |
+
<barpay>
|
88 |
+
<class>Inite_Barpay_Block</class>
|
89 |
+
</barpay>
|
90 |
+
|
91 |
+
</blocks>
|
92 |
+
|
93 |
+
<resources>
|
94 |
+
<barpay_setup>
|
95 |
+
<setup>
|
96 |
+
<module>Inite_Barpay</module>
|
97 |
+
</setup>
|
98 |
+
<connection>
|
99 |
+
<use>core_setup</use>
|
100 |
+
</connection>
|
101 |
+
</barpay_setup>
|
102 |
+
|
103 |
+
<barpay_write>
|
104 |
+
<connection>
|
105 |
+
<use>core_write</use>
|
106 |
+
</connection>
|
107 |
+
</barpay_write>
|
108 |
+
<barpay_read>
|
109 |
+
<connection>
|
110 |
+
<use>core_read</use>
|
111 |
+
</connection>
|
112 |
+
</barpay_read>
|
113 |
+
</resources>
|
114 |
+
|
115 |
+
</global>
|
116 |
+
|
117 |
+
<admin>
|
118 |
+
<routers>
|
119 |
+
<barpayadmin>
|
120 |
+
<use>admin</use>
|
121 |
+
<args>
|
122 |
+
<module>Inite_Barpay</module>
|
123 |
+
<frontName>barpayadmin</frontName>
|
124 |
+
</args>
|
125 |
+
</barpayadmin>
|
126 |
+
</routers>
|
127 |
+
</admin>
|
128 |
+
|
129 |
+
<default>
|
130 |
+
<payment>
|
131 |
+
<barpay>
|
132 |
+
<model>barpay/standard</model>
|
133 |
+
<active>0</active>
|
134 |
+
<order_status>pending</order_status>
|
135 |
+
<title>Barpay (0.1.5)</title>
|
136 |
+
<comment>
|
137 |
+
<![CDATA[This text appears just beneath the field with a small arrow.
|
138 |
+
<span class="notice">It can contain HTML formatting too!</span>]]>
|
139 |
+
</comment>
|
140 |
+
<submit_url>https://livebi.barpay-system.de/BarPayGateWay/BarPayIssue.php?wsdl</submit_url>
|
141 |
+
<allowspecific>0</allowspecific>
|
142 |
+
<sort_order>100</sort_order>
|
143 |
+
</barpay>
|
144 |
+
</payment>
|
145 |
+
</default>
|
146 |
+
|
147 |
+
|
148 |
+
|
149 |
+
</config>
|
app/code/community/Inite/Barpay/etc/system.xml
CHANGED
@@ -1,183 +1,183 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<sections>
|
4 |
-
<payment>
|
5 |
-
<groups>
|
6 |
-
<barpay translate="label comment" module="barpay">
|
7 |
-
<label>Barpay</label>
|
8 |
-
<comment>
|
9 |
-
<![CDATA[<b>Hinweise zur Nutzung des BarPay Plugins.</b>
|
10 |
-
Das Modul ist per Default im Sandbox Modus konfiguriert, alle Zugangsdaten für das BarPay Testsystem sind bereits hinterlegt. Bitte registrieren Sie sich mit einer festen IP unter <a href="mailto:installation@ezv-gmbh.de">installation@ezv-gmbh.de</a>, danach schalten wir den Testzugang frei.
|
11 |
-
|
12 |
-
Um BarPay produktiv nutzen zu können, ist der Abschluss eines Dienstleistungsvertrages mit der EZV Gesellschaft für Zahlungssysteme mbH notwendig. Die Vertragsunterlagen und Konditionen stellt Ihnen unser Vertriebsteam gern zur Verfügung. Sie erreichen Ihren Ansprechpartner unter der Rufnummer +49 30 609844-120 oder per E-Mail unter <a href="mailto:sales@ezv-gmbh.de">sales@ezv-gmbh.de</a>
|
13 |
-
|
14 |
-
Ausführliche Informationen zum Bezahlverfahren BarPay finden Sie auf unseren Websites <a href="http://www.barpay.de" target=_blank>www.barpay.de</a> und <a href="http://www.ezv-gmbh.de" target=_blank>www.ezv-gmbh.de</a>.]]>
|
15 |
-
</comment>
|
16 |
-
|
17 |
-
<frontend_type>text</frontend_type>
|
18 |
-
<sort_order>100</sort_order>
|
19 |
-
<show_in_default>1</show_in_default>
|
20 |
-
<show_in_website>1</show_in_website>
|
21 |
-
<show_in_store>1</show_in_store>
|
22 |
-
<fields>
|
23 |
-
<active translate="label">
|
24 |
-
<label>Enabled</label>
|
25 |
-
<frontend_type>select</frontend_type>
|
26 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
27 |
-
<sort_order>10</sort_order>
|
28 |
-
<show_in_default>1</show_in_default>
|
29 |
-
<show_in_website>1</show_in_website>
|
30 |
-
<show_in_store>0</show_in_store>
|
31 |
-
</active>
|
32 |
-
|
33 |
-
<sandbox translate="label">
|
34 |
-
<label>Sandbox Mode</label>
|
35 |
-
<frontend_type>select</frontend_type>
|
36 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
37 |
-
<sort_order>15</sort_order>
|
38 |
-
<show_in_default>1</show_in_default>
|
39 |
-
<show_in_website>1</show_in_website>
|
40 |
-
<show_in_store>0</show_in_store>
|
41 |
-
</sandbox>
|
42 |
-
|
43 |
-
<title translate="label">
|
44 |
-
<label>Title</label>
|
45 |
-
<frontend_type>text</frontend_type>
|
46 |
-
<sort_order>20</sort_order>
|
47 |
-
<show_in_default>1</show_in_default>
|
48 |
-
<show_in_website>1</show_in_website>
|
49 |
-
<show_in_store>1</show_in_store>
|
50 |
-
</title>
|
51 |
-
|
52 |
-
<show_logo translate="label">
|
53 |
-
<label>Show logo in checkout</label>
|
54 |
-
<frontend_type>select</frontend_type>
|
55 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
56 |
-
<sort_order>30</sort_order>
|
57 |
-
<show_in_default>1</show_in_default>
|
58 |
-
<show_in_website>1</show_in_website>
|
59 |
-
<show_in_store>1</show_in_store>
|
60 |
-
</show_logo>
|
61 |
-
|
62 |
-
<order_status translate="label">
|
63 |
-
<label>New Order Status</label>
|
64 |
-
<frontend_type>select</frontend_type>
|
65 |
-
<source_model>adminhtml/system_config_source_order_status</source_model>
|
66 |
-
<sort_order>50</sort_order>
|
67 |
-
<show_in_default>1</show_in_default>
|
68 |
-
<show_in_website>1</show_in_website>
|
69 |
-
<show_in_store>0</show_in_store>
|
70 |
-
</order_status>
|
71 |
-
|
72 |
-
<submit_url>
|
73 |
-
<label>Gateway URL</label>
|
74 |
-
<frontend_type>text</frontend_type>
|
75 |
-
<sort_order>56</sort_order>
|
76 |
-
<show_in_default>1</show_in_default>
|
77 |
-
<show_in_website>1</show_in_website>
|
78 |
-
<show_in_store>0</show_in_store>
|
79 |
-
</submit_url>
|
80 |
-
|
81 |
-
<preshared_key>
|
82 |
-
<label>Preshared key</label>
|
83 |
-
<frontend_type>text</frontend_type>
|
84 |
-
<sort_order>57</sort_order>
|
85 |
-
<show_in_default>1</show_in_default>
|
86 |
-
<show_in_website>1</show_in_website>
|
87 |
-
<show_in_store>0</show_in_store>
|
88 |
-
</preshared_key>
|
89 |
-
|
90 |
-
<product_id>
|
91 |
-
<label>PRODID</label>
|
92 |
-
<frontend_type>text</frontend_type>
|
93 |
-
<sort_order>58</sort_order>
|
94 |
-
<show_in_default>1</show_in_default>
|
95 |
-
<show_in_website>1</show_in_website>
|
96 |
-
<show_in_store>0</show_in_store>
|
97 |
-
</product_id>
|
98 |
-
|
99 |
-
<merchant_id>
|
100 |
-
<label>BIID</label>
|
101 |
-
<frontend_type>text</frontend_type>
|
102 |
-
<sort_order>59</sort_order>
|
103 |
-
<show_in_default>1</show_in_default>
|
104 |
-
<show_in_website>1</show_in_website>
|
105 |
-
<show_in_store>0</show_in_store>
|
106 |
-
</merchant_id>
|
107 |
-
|
108 |
-
<merchant_pwd>
|
109 |
-
<label>BIPW</label>
|
110 |
-
<frontend_type>text</frontend_type>
|
111 |
-
<sort_order>60</sort_order>
|
112 |
-
<show_in_default>1</show_in_default>
|
113 |
-
<show_in_website>1</show_in_website>
|
114 |
-
<show_in_store>0</show_in_store>
|
115 |
-
</merchant_pwd>
|
116 |
-
|
117 |
-
<valid_days translate="label">
|
118 |
-
<label>Valdat (Tage)</label>
|
119 |
-
<frontend_type>text</frontend_type>
|
120 |
-
<sort_order>65</sort_order>
|
121 |
-
<show_in_default>1</show_in_default>
|
122 |
-
<show_in_website>1</show_in_website>
|
123 |
-
<show_in_store>0</show_in_store>
|
124 |
-
</valid_days>
|
125 |
-
|
126 |
-
<allowspecific translate="label">
|
127 |
-
<label>Payment Applicable From</label>
|
128 |
-
<frontend_type>select</frontend_type>
|
129 |
-
<sort_order>70</sort_order>
|
130 |
-
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
131 |
-
<show_in_default>1</show_in_default>
|
132 |
-
<show_in_website>1</show_in_website>
|
133 |
-
<show_in_store>0</show_in_store>
|
134 |
-
</allowspecific>
|
135 |
-
|
136 |
-
<specificcountry translate="label">
|
137 |
-
<label>Countries Payment Applicable From</label>
|
138 |
-
<frontend_type>multiselect</frontend_type>
|
139 |
-
<sort_order>80</sort_order>
|
140 |
-
<source_model>adminhtml/system_config_source_country</source_model>
|
141 |
-
<show_in_default>1</show_in_default>
|
142 |
-
<show_in_website>1</show_in_website>
|
143 |
-
<show_in_store>0</show_in_store>
|
144 |
-
<depends><allowspecific>1</allowspecific></depends>
|
145 |
-
</specificcountry>
|
146 |
-
|
147 |
-
<sort_order translate="label">
|
148 |
-
<label>Sort Order</label>
|
149 |
-
<frontend_type>text</frontend_type>
|
150 |
-
<sort_order>100</sort_order>
|
151 |
-
<show_in_default>1</show_in_default>
|
152 |
-
<show_in_website>1</show_in_website>
|
153 |
-
<show_in_store>0</show_in_store>
|
154 |
-
</sort_order>
|
155 |
-
|
156 |
-
<save_enabled translate="label">
|
157 |
-
<label>Save vouchers loacaly</label>
|
158 |
-
<comment><![CDATA[Save vouchers in local file system. <font color=red>ONLY AVAILABLE AT VERSION 1.2 PLEASE CHOOSE JA</font>]]></comment>
|
159 |
-
<frontend_type>select</frontend_type>
|
160 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
161 |
-
<sort_order>105</sort_order>
|
162 |
-
<show_in_default>1</show_in_default>
|
163 |
-
<show_in_website>1</show_in_website>
|
164 |
-
<show_in_store>0</show_in_store>
|
165 |
-
</save_enabled>
|
166 |
-
|
167 |
-
<save_path translate="label">
|
168 |
-
<label>Server document save path</label>
|
169 |
-
<comment>Make sure path is not reachable via http protocol and ending with a slash.</comment>
|
170 |
-
<frontend_type>text</frontend_type>
|
171 |
-
<sort_order>110</sort_order>
|
172 |
-
<show_in_default>1</show_in_default>
|
173 |
-
<show_in_website>1</show_in_website>
|
174 |
-
<show_in_store>0</show_in_store>
|
175 |
-
</save_path>
|
176 |
-
|
177 |
-
</fields>
|
178 |
-
</barpay>
|
179 |
-
</groups>
|
180 |
-
</payment>
|
181 |
-
|
182 |
-
</sections>
|
183 |
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<sections>
|
4 |
+
<payment>
|
5 |
+
<groups>
|
6 |
+
<barpay translate="label comment" module="barpay">
|
7 |
+
<label>Barpay</label>
|
8 |
+
<comment>
|
9 |
+
<![CDATA[<b>Hinweise zur Nutzung des BarPay Plugins.</b>
|
10 |
+
Das Modul ist per Default im Sandbox Modus konfiguriert, alle Zugangsdaten für das BarPay Testsystem sind bereits hinterlegt. Bitte registrieren Sie sich mit einer festen IP unter <a href="mailto:installation@ezv-gmbh.de">installation@ezv-gmbh.de</a>, danach schalten wir den Testzugang frei.
|
11 |
+
|
12 |
+
Um BarPay produktiv nutzen zu können, ist der Abschluss eines Dienstleistungsvertrages mit der EZV Gesellschaft für Zahlungssysteme mbH notwendig. Die Vertragsunterlagen und Konditionen stellt Ihnen unser Vertriebsteam gern zur Verfügung. Sie erreichen Ihren Ansprechpartner unter der Rufnummer +49 30 609844-120 oder per E-Mail unter <a href="mailto:sales@ezv-gmbh.de">sales@ezv-gmbh.de</a>
|
13 |
+
|
14 |
+
Ausführliche Informationen zum Bezahlverfahren BarPay finden Sie auf unseren Websites <a href="http://www.barpay.de" target=_blank>www.barpay.de</a> und <a href="http://www.ezv-gmbh.de" target=_blank>www.ezv-gmbh.de</a>.]]>
|
15 |
+
</comment>
|
16 |
+
|
17 |
+
<frontend_type>text</frontend_type>
|
18 |
+
<sort_order>100</sort_order>
|
19 |
+
<show_in_default>1</show_in_default>
|
20 |
+
<show_in_website>1</show_in_website>
|
21 |
+
<show_in_store>1</show_in_store>
|
22 |
+
<fields>
|
23 |
+
<active translate="label">
|
24 |
+
<label>Enabled</label>
|
25 |
+
<frontend_type>select</frontend_type>
|
26 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
27 |
+
<sort_order>10</sort_order>
|
28 |
+
<show_in_default>1</show_in_default>
|
29 |
+
<show_in_website>1</show_in_website>
|
30 |
+
<show_in_store>0</show_in_store>
|
31 |
+
</active>
|
32 |
+
|
33 |
+
<sandbox translate="label">
|
34 |
+
<label>Sandbox Mode</label>
|
35 |
+
<frontend_type>select</frontend_type>
|
36 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
37 |
+
<sort_order>15</sort_order>
|
38 |
+
<show_in_default>1</show_in_default>
|
39 |
+
<show_in_website>1</show_in_website>
|
40 |
+
<show_in_store>0</show_in_store>
|
41 |
+
</sandbox>
|
42 |
+
|
43 |
+
<title translate="label">
|
44 |
+
<label>Title</label>
|
45 |
+
<frontend_type>text</frontend_type>
|
46 |
+
<sort_order>20</sort_order>
|
47 |
+
<show_in_default>1</show_in_default>
|
48 |
+
<show_in_website>1</show_in_website>
|
49 |
+
<show_in_store>1</show_in_store>
|
50 |
+
</title>
|
51 |
+
|
52 |
+
<show_logo translate="label">
|
53 |
+
<label>Show logo in checkout</label>
|
54 |
+
<frontend_type>select</frontend_type>
|
55 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
56 |
+
<sort_order>30</sort_order>
|
57 |
+
<show_in_default>1</show_in_default>
|
58 |
+
<show_in_website>1</show_in_website>
|
59 |
+
<show_in_store>1</show_in_store>
|
60 |
+
</show_logo>
|
61 |
+
|
62 |
+
<order_status translate="label">
|
63 |
+
<label>New Order Status</label>
|
64 |
+
<frontend_type>select</frontend_type>
|
65 |
+
<source_model>adminhtml/system_config_source_order_status</source_model>
|
66 |
+
<sort_order>50</sort_order>
|
67 |
+
<show_in_default>1</show_in_default>
|
68 |
+
<show_in_website>1</show_in_website>
|
69 |
+
<show_in_store>0</show_in_store>
|
70 |
+
</order_status>
|
71 |
+
|
72 |
+
<submit_url>
|
73 |
+
<label>Gateway URL</label>
|
74 |
+
<frontend_type>text</frontend_type>
|
75 |
+
<sort_order>56</sort_order>
|
76 |
+
<show_in_default>1</show_in_default>
|
77 |
+
<show_in_website>1</show_in_website>
|
78 |
+
<show_in_store>0</show_in_store>
|
79 |
+
</submit_url>
|
80 |
+
|
81 |
+
<preshared_key>
|
82 |
+
<label>Preshared key</label>
|
83 |
+
<frontend_type>text</frontend_type>
|
84 |
+
<sort_order>57</sort_order>
|
85 |
+
<show_in_default>1</show_in_default>
|
86 |
+
<show_in_website>1</show_in_website>
|
87 |
+
<show_in_store>0</show_in_store>
|
88 |
+
</preshared_key>
|
89 |
+
|
90 |
+
<product_id>
|
91 |
+
<label>PRODID</label>
|
92 |
+
<frontend_type>text</frontend_type>
|
93 |
+
<sort_order>58</sort_order>
|
94 |
+
<show_in_default>1</show_in_default>
|
95 |
+
<show_in_website>1</show_in_website>
|
96 |
+
<show_in_store>0</show_in_store>
|
97 |
+
</product_id>
|
98 |
+
|
99 |
+
<merchant_id>
|
100 |
+
<label>BIID</label>
|
101 |
+
<frontend_type>text</frontend_type>
|
102 |
+
<sort_order>59</sort_order>
|
103 |
+
<show_in_default>1</show_in_default>
|
104 |
+
<show_in_website>1</show_in_website>
|
105 |
+
<show_in_store>0</show_in_store>
|
106 |
+
</merchant_id>
|
107 |
+
|
108 |
+
<merchant_pwd>
|
109 |
+
<label>BIPW</label>
|
110 |
+
<frontend_type>text</frontend_type>
|
111 |
+
<sort_order>60</sort_order>
|
112 |
+
<show_in_default>1</show_in_default>
|
113 |
+
<show_in_website>1</show_in_website>
|
114 |
+
<show_in_store>0</show_in_store>
|
115 |
+
</merchant_pwd>
|
116 |
+
|
117 |
+
<valid_days translate="label">
|
118 |
+
<label>Valdat (Tage)</label>
|
119 |
+
<frontend_type>text</frontend_type>
|
120 |
+
<sort_order>65</sort_order>
|
121 |
+
<show_in_default>1</show_in_default>
|
122 |
+
<show_in_website>1</show_in_website>
|
123 |
+
<show_in_store>0</show_in_store>
|
124 |
+
</valid_days>
|
125 |
+
|
126 |
+
<allowspecific translate="label">
|
127 |
+
<label>Payment Applicable From</label>
|
128 |
+
<frontend_type>select</frontend_type>
|
129 |
+
<sort_order>70</sort_order>
|
130 |
+
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
131 |
+
<show_in_default>1</show_in_default>
|
132 |
+
<show_in_website>1</show_in_website>
|
133 |
+
<show_in_store>0</show_in_store>
|
134 |
+
</allowspecific>
|
135 |
+
|
136 |
+
<specificcountry translate="label">
|
137 |
+
<label>Countries Payment Applicable From</label>
|
138 |
+
<frontend_type>multiselect</frontend_type>
|
139 |
+
<sort_order>80</sort_order>
|
140 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
141 |
+
<show_in_default>1</show_in_default>
|
142 |
+
<show_in_website>1</show_in_website>
|
143 |
+
<show_in_store>0</show_in_store>
|
144 |
+
<depends><allowspecific>1</allowspecific></depends>
|
145 |
+
</specificcountry>
|
146 |
+
|
147 |
+
<sort_order translate="label">
|
148 |
+
<label>Sort Order</label>
|
149 |
+
<frontend_type>text</frontend_type>
|
150 |
+
<sort_order>100</sort_order>
|
151 |
+
<show_in_default>1</show_in_default>
|
152 |
+
<show_in_website>1</show_in_website>
|
153 |
+
<show_in_store>0</show_in_store>
|
154 |
+
</sort_order>
|
155 |
+
|
156 |
+
<save_enabled translate="label">
|
157 |
+
<label>Save vouchers loacaly</label>
|
158 |
+
<comment><![CDATA[Save vouchers in local file system. <font color=red>ONLY AVAILABLE AT VERSION 1.2 PLEASE CHOOSE JA</font>]]></comment>
|
159 |
+
<frontend_type>select</frontend_type>
|
160 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
161 |
+
<sort_order>105</sort_order>
|
162 |
+
<show_in_default>1</show_in_default>
|
163 |
+
<show_in_website>1</show_in_website>
|
164 |
+
<show_in_store>0</show_in_store>
|
165 |
+
</save_enabled>
|
166 |
+
|
167 |
+
<save_path translate="label">
|
168 |
+
<label>Server document save path</label>
|
169 |
+
<comment>Make sure path is not reachable via http protocol and ending with a slash.</comment>
|
170 |
+
<frontend_type>text</frontend_type>
|
171 |
+
<sort_order>110</sort_order>
|
172 |
+
<show_in_default>1</show_in_default>
|
173 |
+
<show_in_website>1</show_in_website>
|
174 |
+
<show_in_store>0</show_in_store>
|
175 |
+
</save_path>
|
176 |
+
|
177 |
+
</fields>
|
178 |
+
</barpay>
|
179 |
+
</groups>
|
180 |
+
</payment>
|
181 |
+
|
182 |
+
</sections>
|
183 |
</config>
|
app/code/community/Inite/Barpay/sql/barpay_setup/mysql4-install-0.0.9.php
CHANGED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* This file is subject to the terms and conditions defined in
|
6 |
-
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
-
*
|
8 |
-
* @VERSION Barpay 0.1.
|
9 |
-
*
|
10 |
-
**/
|
11 |
-
|
12 |
-
?>
|
13 |
-
<?php
|
14 |
-
|
15 |
-
$installer = $this;
|
16 |
-
|
17 |
-
$statusTable = $installer->getTable('sales/order_status');
|
18 |
-
$statusStateTable = $installer->getTable('sales/order_status_state');
|
19 |
-
$statusLabelTable = $installer->getTable('sales/order_status_label');
|
20 |
-
|
21 |
-
$data = array(
|
22 |
-
array('status' => 'pending_barpay', 'label' => 'Pending Barpay')
|
23 |
-
);
|
24 |
-
$installer->getConnection()->insertArray($statusTable, array('status', 'label'), $data);
|
25 |
-
|
26 |
-
$data = array(
|
27 |
-
array('status' => 'pending_barpay', 'state' => 'pending_barpay', 'is_default' => 1)
|
28 |
-
);
|
29 |
-
$installer->getConnection()->insertArray($statusStateTable, array('status', 'state', 'is_default'), $data);
|
30 |
-
|
31 |
?>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
*
|
5 |
+
* This file is subject to the terms and conditions defined in
|
6 |
+
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
+
*
|
8 |
+
* @VERSION Barpay 0.1.5
|
9 |
+
*
|
10 |
+
**/
|
11 |
+
|
12 |
+
?>
|
13 |
+
<?php
|
14 |
+
|
15 |
+
$installer = $this;
|
16 |
+
|
17 |
+
$statusTable = $installer->getTable('sales/order_status');
|
18 |
+
$statusStateTable = $installer->getTable('sales/order_status_state');
|
19 |
+
$statusLabelTable = $installer->getTable('sales/order_status_label');
|
20 |
+
|
21 |
+
$data = array(
|
22 |
+
array('status' => 'pending_barpay', 'label' => 'Pending Barpay')
|
23 |
+
);
|
24 |
+
$installer->getConnection()->insertArray($statusTable, array('status', 'label'), $data);
|
25 |
+
|
26 |
+
$data = array(
|
27 |
+
array('status' => 'pending_barpay', 'state' => 'pending_barpay', 'is_default' => 1)
|
28 |
+
);
|
29 |
+
$installer->getConnection()->insertArray($statusStateTable, array('status', 'state', 'is_default'), $data);
|
30 |
+
|
31 |
?>
|
app/design/adminhtml/default/default/template/barpay/info.phtml
CHANGED
@@ -1,23 +1,23 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* This file is subject to the terms and conditions defined in
|
6 |
-
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
-
*
|
8 |
-
* @VERSION Barpay 0.1.
|
9 |
-
*
|
10 |
-
**/
|
11 |
-
|
12 |
-
?>
|
13 |
-
<p>
|
14 |
-
Barpay
|
15 |
-
<?php if($this->canDownloadPdf()): ?>
|
16 |
-
<br/>
|
17 |
-
<a href="<?php echo $this->getPdfUrl(); ?>"><?php echo $this->__('Download Barpay voucher'); ?></a>
|
18 |
-
<?php endif; ?>
|
19 |
-
<?php if($this->canRepay()): ?>
|
20 |
-
<br/>
|
21 |
-
<a href="<?php echo $this->getRepayUrl(); ?>"><?php echo $this->__('Initialize payment process'); ?></a>
|
22 |
-
<?php endif; ?>
|
23 |
</p>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
*
|
5 |
+
* This file is subject to the terms and conditions defined in
|
6 |
+
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
+
*
|
8 |
+
* @VERSION Barpay 0.1.5
|
9 |
+
*
|
10 |
+
**/
|
11 |
+
|
12 |
+
?>
|
13 |
+
<p>
|
14 |
+
Barpay
|
15 |
+
<?php if($this->canDownloadPdf()): ?>
|
16 |
+
<br/>
|
17 |
+
<a href="<?php echo $this->getPdfUrl(); ?>"><?php echo $this->__('Download Barpay voucher'); ?></a>
|
18 |
+
<?php endif; ?>
|
19 |
+
<?php if($this->canRepay()): ?>
|
20 |
+
<br/>
|
21 |
+
<a href="<?php echo $this->getRepayUrl(); ?>"><?php echo $this->__('Initialize payment process'); ?></a>
|
22 |
+
<?php endif; ?>
|
23 |
</p>
|
app/design/frontend/default/default/layout/barpay.xml
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<layout version="0.1.0">
|
3 |
-
<default>
|
4 |
-
<reference name="right">
|
5 |
-
<block type="core/template" name="barpay.right.logo" template="barpay/infobox.phtml"/>
|
6 |
-
</reference>
|
7 |
-
</default>
|
8 |
-
<barpay_standard_index>
|
9 |
-
<reference name="root">
|
10 |
-
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
11 |
-
</reference>
|
12 |
-
<reference name="content">
|
13 |
-
<block type="checkout/onepage_success" name="checkout.success" template="checkout/success.phtml"/>
|
14 |
-
<block type="barpay/checkout_success" name="barpay_checkout_success" template="barpay/success.phtml" />
|
15 |
-
</reference>
|
16 |
-
</barpay_standard_index>
|
17 |
</layout>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<default>
|
4 |
+
<reference name="right">
|
5 |
+
<block type="core/template" name="barpay.right.logo" template="barpay/infobox.phtml"/>
|
6 |
+
</reference>
|
7 |
+
</default>
|
8 |
+
<barpay_standard_index>
|
9 |
+
<reference name="root">
|
10 |
+
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
11 |
+
</reference>
|
12 |
+
<reference name="content">
|
13 |
+
<block type="checkout/onepage_success" name="checkout.success" template="checkout/success.phtml"/>
|
14 |
+
<block type="barpay/checkout_success" name="barpay_checkout_success" template="barpay/success.phtml" />
|
15 |
+
</reference>
|
16 |
+
</barpay_standard_index>
|
17 |
</layout>
|
app/design/frontend/default/default/template/barpay/form.phtml
CHANGED
@@ -5,14 +5,14 @@
|
|
5 |
* This file is subject to the terms and conditions defined in
|
6 |
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
*
|
8 |
-
* @VERSION Barpay 0.1.
|
9 |
*
|
10 |
**/
|
11 |
|
12 |
?>
|
13 |
<fieldset class="form-list">
|
14 |
<ul id="payment_form_<?php echo $this->getMethodCode(); ?>" style="display:none">
|
15 |
-
<li>Sicher, schnell und ohne Gebühren mit BarPay online bar bezahlen.<a onclick="javascript:window.open('<?php echo $this->__('http://www.barpay.de/info/') ?>','kundeninformationen','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=580, height=550');return false;" href="#" title="Hier klicken -
|
16 |
|
17 |
</li>
|
18 |
</ul>
|
5 |
* This file is subject to the terms and conditions defined in
|
6 |
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
*
|
8 |
+
* @VERSION Barpay 0.1.5
|
9 |
*
|
10 |
**/
|
11 |
|
12 |
?>
|
13 |
<fieldset class="form-list">
|
14 |
<ul id="payment_form_<?php echo $this->getMethodCode(); ?>" style="display:none">
|
15 |
+
<li>Sicher, schnell und ohne Gebühren mit BarPay online bar bezahlen.<a onclick="javascript:window.open('<?php echo $this->__('http://www.barpay.de/info/') ?>','kundeninformationen','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=580, height=550');return false;" href="#" title="Hier klicken - Barpay Kundeninformationen"><img src="<?php echo $this->__('https://www.badmoebeldirekt.de/barpay.gif') ?>" alt="Hier klicken - Barpay Kundeninformationen" border="0" /></a>
|
16 |
|
17 |
</li>
|
18 |
</ul>
|
app/design/frontend/default/default/template/barpay/info.phtml
CHANGED
@@ -1,23 +1,23 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* This file is subject to the terms and conditions defined in
|
6 |
-
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
-
*
|
8 |
-
* @VERSION Barpay 0.1.
|
9 |
-
*
|
10 |
-
**/
|
11 |
-
|
12 |
-
?>
|
13 |
-
<p>
|
14 |
-
Barpay
|
15 |
-
<?php if($this->canDownloadPdf()): ?>
|
16 |
-
<br/>
|
17 |
-
<a href="<?php echo $this->getPdfUrl(); ?>"><?php echo $this->__('Download Barpay voucher'); ?></a>
|
18 |
-
<?php endif; ?>
|
19 |
-
<?php if($this->canRepay()): ?>
|
20 |
-
<br/>
|
21 |
-
<a href="<?php echo $this->getRepayUrl(); ?>"><?php echo $this->__('Initialize payment process'); ?></a>
|
22 |
-
<?php endif; ?>
|
23 |
</p>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
*
|
5 |
+
* This file is subject to the terms and conditions defined in
|
6 |
+
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
+
*
|
8 |
+
* @VERSION Barpay 0.1.5
|
9 |
+
*
|
10 |
+
**/
|
11 |
+
|
12 |
+
?>
|
13 |
+
<p>
|
14 |
+
Barpay
|
15 |
+
<?php if($this->canDownloadPdf()): ?>
|
16 |
+
<br/>
|
17 |
+
<a href="<?php echo $this->getPdfUrl(); ?>"><?php echo $this->__('Download Barpay voucher'); ?></a>
|
18 |
+
<?php endif; ?>
|
19 |
+
<?php if($this->canRepay()): ?>
|
20 |
+
<br/>
|
21 |
+
<a href="<?php echo $this->getRepayUrl(); ?>"><?php echo $this->__('Initialize payment process'); ?></a>
|
22 |
+
<?php endif; ?>
|
23 |
</p>
|
app/design/frontend/default/default/template/barpay/infobox.phtml
CHANGED
@@ -1,32 +1,32 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* This file is subject to the terms and conditions defined in
|
6 |
-
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
-
*
|
8 |
-
* @VERSION Barpay 0.1.
|
9 |
-
*
|
10 |
-
**/
|
11 |
-
|
12 |
-
?>
|
13 |
-
<?php if(Mage::getStoreConfig('payment/barpay/active')):?>
|
14 |
-
|
15 |
-
<div class="block">
|
16 |
-
<div class="block-title">
|
17 |
-
<strong>
|
18 |
-
<span>
|
19 |
-
Neue Zahlungsart
|
20 |
-
</span>
|
21 |
-
</strong>
|
22 |
-
</div>
|
23 |
-
<div class="block-content" style="margin : 1em;background-color:#FFFFFF;">
|
24 |
-
|
25 |
-
<br>
|
26 |
-
<a onclick="javascript:window.open('<?php echo $this->__('http://www.barpay.de/info/') ?>','kundeninformationen','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=580, height=550');return false;" href="#" title="Hier klicken - Informationen zu Barpay"><img src="<?php echo $this->getSkinUrl('images/barpay/barpay_callout.gif') ?>" alt="Hier klicken - Barpay Kundeninformationen" border="0" /></a>
|
27 |
-
|
28 |
-
</div>
|
29 |
-
</div>
|
30 |
-
|
31 |
-
|
32 |
<?php endif; ?>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
*
|
5 |
+
* This file is subject to the terms and conditions defined in
|
6 |
+
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
+
*
|
8 |
+
* @VERSION Barpay 0.1.5
|
9 |
+
*
|
10 |
+
**/
|
11 |
+
|
12 |
+
?>
|
13 |
+
<?php if(Mage::getStoreConfig('payment/barpay/active')):?>
|
14 |
+
|
15 |
+
<div class="block">
|
16 |
+
<div class="block-title">
|
17 |
+
<strong>
|
18 |
+
<span>
|
19 |
+
Neue Zahlungsart
|
20 |
+
</span>
|
21 |
+
</strong>
|
22 |
+
</div>
|
23 |
+
<div class="block-content" style="margin : 1em;background-color:#FFFFFF;">
|
24 |
+
|
25 |
+
<br>
|
26 |
+
<a onclick="javascript:window.open('<?php echo $this->__('http://www.barpay.de/info/') ?>','kundeninformationen','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=580, height=550');return false;" href="#" title="Hier klicken - Informationen zu Barpay"><img src="<?php echo $this->getSkinUrl('images/barpay/barpay_callout.gif') ?>" alt="Hier klicken - Barpay Kundeninformationen" border="0" /></a>
|
27 |
+
|
28 |
+
</div>
|
29 |
+
</div>
|
30 |
+
|
31 |
+
|
32 |
<?php endif; ?>
|
app/design/frontend/default/default/template/barpay/pay.phtml
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
*
|
5 |
+
* This file is subject to the terms and conditions defined in
|
6 |
+
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
+
*
|
8 |
+
* @VERSION Barpay 0.1.5
|
9 |
+
*
|
10 |
+
**/
|
11 |
+
|
12 |
+
?>
|
13 |
+
<h2>Instructions</h2>
|
14 |
+
|
15 |
+
<br/>
|
16 |
+
|
17 |
+
<a href="<?php $this->getPdfUrl(); ?>"><?php $this->__('Download Barpay voucher'); ?></a>
|
app/design/frontend/default/default/template/barpay/payment/mark.phtml
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* This file is subject to the terms and conditions defined in
|
6 |
-
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
-
*
|
8 |
-
* @VERSION Barpay 0.1.
|
9 |
-
*
|
10 |
-
**/
|
11 |
-
|
12 |
-
?>
|
13 |
-
<a onclick="javascript:window.open('<?php echo $this->__('http://www.barpay.de/info/') ?>','kundeninformationen','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=580, height=550');return false;" href="#" title="Hier klicken - Informationen zu Barpay"><img src="<?php echo $this->getSkinUrl('images/barpay/barpay_checkout.gif') ?>" alt="Hier klicken - Barpay Kundeninformationen" border="0" /></a>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
*
|
5 |
+
* This file is subject to the terms and conditions defined in
|
6 |
+
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
+
*
|
8 |
+
* @VERSION Barpay 0.1.5
|
9 |
+
*
|
10 |
+
**/
|
11 |
+
|
12 |
+
?>
|
13 |
+
<a onclick="javascript:window.open('<?php echo $this->__('http://www.barpay.de/info/') ?>','kundeninformationen','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=580, height=550');return false;" href="#" title="Hier klicken - Informationen zu Barpay"><img src="<?php echo $this->getSkinUrl('images/barpay/barpay_checkout.gif') ?>" alt="Hier klicken - Barpay Kundeninformationen" border="0" /></a>
|
app/design/frontend/default/default/template/barpay/success.phtml
CHANGED
@@ -1,19 +1,19 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* This file is subject to the terms and conditions defined in
|
6 |
-
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
-
*
|
8 |
-
* @VERSION Barpay 0.1.
|
9 |
-
*
|
10 |
-
**/
|
11 |
-
|
12 |
-
?>
|
13 |
-
<?php if($this->canDownloadPdf()): ?>
|
14 |
-
<h2>Instructions</h2>
|
15 |
-
|
16 |
-
<br/>
|
17 |
-
|
18 |
-
<a href="<?php echo $this->getPdfUrl(); ?>"><?php echo $this->__('Download Barpay voucher'); ?></a>
|
19 |
<?php endif; ?>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
*
|
5 |
+
* This file is subject to the terms and conditions defined in
|
6 |
+
* file 'LICENSE.txt', which is part of this source code package.
|
7 |
+
*
|
8 |
+
* @VERSION Barpay 0.1.5
|
9 |
+
*
|
10 |
+
**/
|
11 |
+
|
12 |
+
?>
|
13 |
+
<?php if($this->canDownloadPdf()): ?>
|
14 |
+
<h2>Instructions</h2>
|
15 |
+
|
16 |
+
<br/>
|
17 |
+
|
18 |
+
<a href="<?php echo $this->getPdfUrl(); ?>"><?php echo $this->__('Download Barpay voucher'); ?></a>
|
19 |
<?php endif; ?>
|
app/etc/modules/Inite_Barpay.xml
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
-
<config>
|
2 |
-
<modules>
|
3 |
-
<Inite_Barpay>
|
4 |
-
<active>true</active>
|
5 |
-
<codePool>community</codePool>
|
6 |
-
<depends>
|
7 |
-
<Mage_Payment/>
|
8 |
-
</depends>
|
9 |
-
</Inite_Barpay>
|
10 |
-
</modules>
|
11 |
</config>
|
1 |
+
<config>
|
2 |
+
<modules>
|
3 |
+
<Inite_Barpay>
|
4 |
+
<active>true</active>
|
5 |
+
<codePool>community</codePool>
|
6 |
+
<depends>
|
7 |
+
<Mage_Payment/>
|
8 |
+
</depends>
|
9 |
+
</Inite_Barpay>
|
10 |
+
</modules>
|
11 |
</config>
|
package.xml
CHANGED
@@ -1,18 +1,35 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Barpay_Payment_Standard</name>
|
4 |
-
<version>0.1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/gpl-license.php">GPL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>
|
10 |
-
<description>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
<notes>Keine Hinweise</notes>
|
12 |
<authors><author><name>Christian Lakits</name><user>lakits</user><email>barpay@munichx-media.de</email></author><author><name>Gerry Schlegel</name><user>bertdireins</user><email>barpay@munichx-media.de</email></author></authors>
|
13 |
-
<date>2012-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Inite"><dir name="Barpay"><dir name="Block"><dir name="Checkout"><file name="Error.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Barpay_Payment_Standard</name>
|
4 |
+
<version>0.1.5</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/gpl-license.php">GPL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>Secure, quick and without any fees: Pay online in cash with BarPay.</summary>
|
10 |
+
<description>Online retailers lose many customers at the checkout. They cancel their
|
11 |
+
purchase, in most cases due to the payment methods. The solution for this is
|
12 |
+
called BarPay, which is an alternative to all existing online payment methods.
|
13 |
+
Consumers do not need a bank account or credit card but pay in cash as they
|
14 |
+
are used to: simple, convenient and safe.
|
15 |
+

|
16 |
+
The BarPay principle is simple. Directly after the conclusion of the order
|
17 |
+
process, the buyer is sent an individual barcode via e-mail, invoice
|
18 |
+
attachment or directly in the browser. This can be printed out or presented
|
19 |
+
via smartphone to more than 18,000 local BarPay acceptance points like
|
20 |
+
petrol stations, shops and kiosks in Germany. If the consumer pays the
|
21 |
+
invoice at one of these sales outlets, the code is scanned, the payment
|
22 |
+
booked and the incoming payment reported to the retailer via the BarPay
|
23 |
+
system. The goods can then be dispatched.
|
24 |
+

|
25 |
+
--------------------------------------------------
|
26 |
+

|
27 |
+
Nach Auswahl von BarPay wird dem Käufer ein individueller Barcode per E-Mail, Rechnungsanhang oder zum Download übermittelt. Dieser kann ausgedruckt und beim BarPay Akezptanznetzwerk bezahlt werden. Dazu zählen rund 18.000 Handelsketten, Tankstellen und Kiosk-Systeme in ganz Deutschland. Der Zahlungseingang wird dem Online-Händler in Echtzeit übermittelt, und die bestellte Ware kann umgehend in den Versand gehen.</description>
|
28 |
<notes>Keine Hinweise</notes>
|
29 |
<authors><author><name>Christian Lakits</name><user>lakits</user><email>barpay@munichx-media.de</email></author><author><name>Gerry Schlegel</name><user>bertdireins</user><email>barpay@munichx-media.de</email></author></authors>
|
30 |
+
<date>2012-09-20</date>
|
31 |
+
<time>13:31:59</time>
|
32 |
+
<contents><target name="magecommunity"><dir name="Inite"><dir name="Barpay"><dir name="Block"><dir name="Checkout"><file name="Error.php" hash="dacb79ceca05b5ff50d63af49bebd254"/><file name="Success.php" hash="4fdf541d5dff39219e0b87732eaeca4c"/></dir><file name="Form.php" hash="e993c0ada3a0799242a8d479acc4a6e2"/><file name="Info.php" hash="52fe634b1fcb782c21a568583c3f51b1"/><dir name="Order"><file name="View.php" hash="29c1a2b0c261a8697d552a6e61d4a491"/></dir></dir><dir name="Helper"><file name="Data.php" hash="5c635785c203f501e8b812ab7d3ae5c7"/></dir><file name="LICENSE.txt" hash="d32239bcb673463ab874e80d47fae504"/><dir name="Model"><dir name="Email"><dir name="Template"><file name="Mailer.php" hash="ff641d075f29cd36063bb08722c23636"/></dir><file name="Template.php" hash="2896c0ee6c25c076ede3611afe4d1cec"/></dir><dir name="Sales"><file name="Order.php" hash="e72f0b7eb0d193fde0fe77081190ff55"/></dir><file name="Standard.php" hash="f9726cffc273dc461a47c47b06255dd6"/></dir><dir name="controllers"><file name="AdminController.php" hash="a303fbabed06cc96253d38ebf603771e"/><file name="StandardController.php" hash="afb4c860eed0f2209c771306b7ceaf72"/></dir><dir name="etc"><file name="config.xml" hash="05f860baf6dd89451b40857f8a8a885b"/><file name="system.xml" hash="f5ed718accbabf3309592835ca159d5e"/></dir><dir name="sql"><dir name="barpay_setup"><file name="mysql4-install-0.0.9.php" hash="0e77bf3ab173e36edebc38644ecb7051"/></dir></dir></dir></dir></target><target name="mageskin"><dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="images"><dir name="barpay"><file name="barpay_callout.gif" hash="60114fdd50afa0cefbfa38e0a17f17e0"/><file name="barpay_checkout.gif" hash="041df1836a58b31aa6ae7c09b4a6cfef"/></dir></dir></dir></dir></dir></dir></target><target name="magedesign"><dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="barpay"><file name="form.phtml" hash="7952ea1d3770923ea32106fbe19e076c"/><file name="info.phtml" hash="aa01243cc33bdd606360e464d0cfb7ad"/><file name="infobox.phtml" hash="eb5642d9454a19ca40d1fae0a846d10d"/><file name="pay.phtml" hash="34c2dc92c6536d0070a50cf8404e3101"/><dir name="payment"><file name="mark.phtml" hash="d264e027f75b8d1cc79ccc24c28a68ca"/></dir><file name="success.phtml" hash="232bf0f5f38d665eb6109a0053ef65c2"/></dir></dir><dir name="layout"><file name="barpay.xml" hash="58a8f6484b33f3d8952e3b6a01758fda"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="barpay"><file name="info.phtml" hash="aa01243cc33bdd606360e464d0cfb7ad"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Inite_Barpay.xml" hash="b6587e6f382c8083dba6c0f681f1b2a3"/></dir></dir></target></contents>
|
33 |
<compatible/>
|
34 |
<dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
|
35 |
</package>
|