EASYNOLOBANCASELLAPRO - Version 1.4.6.0

Version Notes

New features


  • ReD fraud prevention

  • Riskified fraud prevention

  • One click payment with tokenization

  • Account section for credit cards management

Please note: with this release the support for IWD one page checkout is unstable.

Download this release

Release Info

Developer Easy Nolo SpA
Extension EASYNOLOBANCASELLAPRO
Version 1.4.6.0
Comparing to
See all releases


Code changes from version 1.4.0.0 to 1.4.6.0

Files changed (78) hide show
  1. app/code/community/EasyNolo/.DS_Store +0 -0
  2. app/code/community/EasyNolo/BancaSellaPro/.DS_Store +0 -0
  3. app/code/community/EasyNolo/BancaSellaPro/.project +11 -0
  4. app/code/community/EasyNolo/BancaSellaPro/Block/Adminhtml/System/Config/Gestpayinfo.php +30 -0
  5. app/code/community/EasyNolo/BancaSellaPro/Block/Adminhtml/System/Config/Redinfo.php +39 -0
  6. app/code/community/EasyNolo/BancaSellaPro/Block/Adminhtml/System/Config/Riskifiedinfo.php +38 -0
  7. app/code/community/EasyNolo/BancaSellaPro/Block/Form.php +32 -2
  8. app/code/community/EasyNolo/BancaSellaPro/Block/Tokenization/List.php +24 -0
  9. app/code/community/EasyNolo/BancaSellaPro/Block/Tokenization/Newtoken.php +2 -5
  10. app/code/community/EasyNolo/BancaSellaPro/Helper/AlternativePayments/Ideal.php +17 -0
  11. app/code/community/EasyNolo/BancaSellaPro/Helper/AlternativePayments/Mybank.php +17 -0
  12. app/code/community/EasyNolo/BancaSellaPro/Helper/AlternativePayments/Paypal.php +45 -0
  13. app/code/community/EasyNolo/BancaSellaPro/Helper/AlternativePayments/Sofort.php +25 -0
  14. app/code/community/EasyNolo/BancaSellaPro/Helper/Baseclient.php +2 -2
  15. app/code/community/EasyNolo/BancaSellaPro/Helper/Crypt.php +110 -56
  16. app/code/community/EasyNolo/BancaSellaPro/Helper/Data.php +1 -1
  17. app/code/community/EasyNolo/BancaSellaPro/Helper/Recurringprofile.php +63 -18
  18. app/code/community/EasyNolo/BancaSellaPro/Helper/Red.php +148 -0
  19. app/code/community/EasyNolo/BancaSellaPro/Helper/Riskified.php +78 -0
  20. app/code/community/EasyNolo/BancaSellaPro/Helper/S2s.php +15 -0
  21. app/code/community/EasyNolo/BancaSellaPro/Model/Gestpay.php +85 -5
  22. app/code/community/EasyNolo/BancaSellaPro/Model/Observer.php +13 -0
  23. app/code/community/EasyNolo/BancaSellaPro/Model/Resource/Sales/Order/FingerPrint.php +16 -0
  24. app/code/community/EasyNolo/BancaSellaPro/Model/Resource/Sales/Order/FingerPrint/Collection.php +16 -0
  25. app/code/community/EasyNolo/BancaSellaPro/Model/Sales/Order/FingerPrint.php +16 -0
  26. app/code/community/EasyNolo/BancaSellaPro/Model/System/Config/Source/FraudOrderStatus.php +10 -0
  27. app/code/community/EasyNolo/BancaSellaPro/Model/System/Config/Source/OrderStatus.php +10 -0
  28. app/code/community/EasyNolo/BancaSellaPro/Model/System/Config/Source/TokenizationContext.php +24 -0
  29. app/code/community/EasyNolo/BancaSellaPro/Model/Token.php +7 -9
  30. app/code/community/EasyNolo/BancaSellaPro/Model/Webservice/Wscryptdecrypt.php +81 -47
  31. app/code/community/EasyNolo/BancaSellaPro/Model/Webservice/Wss2s.php +71 -10
  32. app/code/community/EasyNolo/BancaSellaPro/_additional_structure/.DS_Store +0 -0
  33. app/code/community/EasyNolo/BancaSellaPro/_additional_structure/app/design/frontend/base/default/layout/easynolo_bancasellapro.xml +163 -0
  34. app/{design → code/community/EasyNolo/BancaSellaPro/_additional_structure/app/design}/frontend/base/default/template/easynolo/bancasellapro/gestpay/confirm3d.phtml +0 -0
  35. app/code/community/EasyNolo/BancaSellaPro/_additional_structure/app/design/frontend/base/default/template/easynolo/bancasellapro/gestpay/form.phtml +186 -0
  36. app/{design → code/community/EasyNolo/BancaSellaPro/_additional_structure/app/design}/frontend/base/default/template/easynolo/bancasellapro/gestpay/form_onepagecheckout.phtml +5 -5
  37. app/code/community/EasyNolo/BancaSellaPro/_additional_structure/app/design/frontend/base/default/template/easynolo/bancasellapro/gestpay/iframe.phtml +58 -0
  38. app/{design → code/community/EasyNolo/BancaSellaPro/_additional_structure/app/design}/frontend/base/default/template/easynolo/bancasellapro/gestpay/newtoken.phtml +5 -5
  39. app/{design → code/community/EasyNolo/BancaSellaPro/_additional_structure/app/design}/frontend/base/default/template/easynolo/bancasellapro/gestpay/redirect.phtml +0 -0
  40. app/code/community/EasyNolo/BancaSellaPro/_additional_structure/app/design/frontend/base/default/template/easynolo/bancasellapro/gestpay/riskified.phtml +17 -0
  41. app/code/community/EasyNolo/BancaSellaPro/_additional_structure/app/design/frontend/base/default/template/easynolo/bancasellapro/gestpay/token/list.phtml +64 -0
  42. app/{design → code/community/EasyNolo/BancaSellaPro/_additional_structure/app/design}/frontend/base/default/template/easynolo/bancasellapro/page/redirect.phtml +0 -0
  43. app/{design → code/community/EasyNolo/BancaSellaPro/_additional_structure/app/design}/frontend/enterprise/default/layout/easynolo_bancasellapro.xml +4 -12
  44. app/{etc → code/community/EasyNolo/BancaSellaPro/_additional_structure/app/etc}/modules/EasyNolo_BancaSellaPro.xml +0 -0
  45. app/{etc → code/community/EasyNolo/BancaSellaPro/_additional_structure/app/etc}/modules/EasyNolo_BancaSellaPro.xml.Onepage.txt +0 -0
  46. app/code/community/EasyNolo/BancaSellaPro/_additional_structure/app/locale/en_US/EasyNolo_BancaSellaPro.csv +32 -0
  47. app/code/community/EasyNolo/BancaSellaPro/_additional_structure/app/locale/it_IT/EasyNolo_BancaSellaPro.csv +31 -0
  48. {js → app/code/community/EasyNolo/BancaSellaPro/_additional_structure/js}/bancasellapro/gestpayform.js +128 -116
  49. {js → app/code/community/EasyNolo/BancaSellaPro/_additional_structure/js}/bancasellapro/gestpayform_onepagecheckout.js +5 -5
  50. {js → app/code/community/EasyNolo/BancaSellaPro/_additional_structure/js}/bancasellapro/newtoken.js +2 -2
  51. app/code/community/EasyNolo/BancaSellaPro/_additional_structure/js/bancasellapro/red_blackbox.js +28 -0
  52. app/code/community/EasyNolo/BancaSellaPro/_additional_structure/js/bancasellapro/riskified.js +16 -0
  53. app/code/community/EasyNolo/BancaSellaPro/_additional_structure/skin/.DS_Store +0 -0
  54. app/code/community/EasyNolo/BancaSellaPro/_additional_structure/skin/adminhtml/.DS_Store +0 -0
  55. app/code/community/EasyNolo/BancaSellaPro/_additional_structure/skin/adminhtml/default/.DS_Store +0 -0
  56. app/code/community/EasyNolo/BancaSellaPro/_additional_structure/skin/adminhtml/default/default/.DS_Store +0 -0
  57. app/code/community/EasyNolo/BancaSellaPro/_additional_structure/skin/adminhtml/default/default/images/.DS_Store +0 -0
  58. app/code/community/EasyNolo/BancaSellaPro/_additional_structure/skin/adminhtml/default/default/images/bancasellapro/gestpay.png +0 -0
  59. app/code/community/EasyNolo/BancaSellaPro/_additional_structure/skin/adminhtml/default/default/images/bancasellapro/red.png +0 -0
  60. app/code/community/EasyNolo/BancaSellaPro/_additional_structure/skin/adminhtml/default/default/images/bancasellapro/riskified.png +0 -0
  61. {skin → app/code/community/EasyNolo/BancaSellaPro/_additional_structure/skin}/frontend/base/default/images/easynolo_bancasella/wait.gif +0 -0
  62. app/code/community/EasyNolo/BancaSellaPro/_additional_structure/skin/frontend/base/default/js/easynolo_bancasella/gestpayform_onepagecheckout.js +591 -0
  63. app/code/community/EasyNolo/BancaSellaPro/controllers/GestpayController.php +72 -46
  64. app/code/community/EasyNolo/BancaSellaPro/controllers/TokenizationController.php +94 -0
  65. app/code/community/EasyNolo/BancaSellaPro/etc/config.xml +50 -2
  66. app/code/community/EasyNolo/BancaSellaPro/etc/system.xml +390 -15
  67. app/code/community/EasyNolo/BancaSellaPro/sql/easynolo_bancasellapro_setup/upgrade-1.4.2-1.4.3.php +44 -0
  68. app/code/community/EasyNolo/BancaSellaPro/sql/easynolo_bancasellapro_setup/upgrade-1.4.3-1.4.4.php +47 -0
  69. app/code/community/EasyNolo/BancaSellaPro/sql/easynolo_bancasellapro_setup/upgrade-1.4.4-1.4.5.php +17 -0
  70. app/code/community/EasyNolo/BancaSellaPro/sql/easynolo_bancasellapro_setup/upgrade-1.4.5-1.4.6.php +47 -0
  71. app/design/frontend/base/default/layout/easynolo_bancasellapro.xml +0 -115
  72. app/design/frontend/base/default/template/easynolo/bancasellapro/checkout/onepage.phtml +0 -43
  73. app/design/frontend/base/default/template/easynolo/bancasellapro/checkout/onepage1-6.phtml +0 -43
  74. app/design/frontend/base/default/template/easynolo/bancasellapro/gestpay/form.phtml +0 -129
  75. app/design/frontend/enterprise/default/template/easynolo/bancasellapro/checkout/onepage.phtml +0 -42
  76. app/locale/en_US/EasyNolo_BancaSellaPro.csv +0 -7
  77. app/locale/it_IT/EasyNolo_BancaSellaPro.csv +0 -7
  78. package.xml +62 -11
app/code/community/EasyNolo/.DS_Store ADDED
Binary file
app/code/community/EasyNolo/BancaSellaPro/.DS_Store ADDED
Binary file
app/code/community/EasyNolo/BancaSellaPro/.project ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <projectDescription>
3
+ <name>EasyNolo_BancaSellaPro</name>
4
+ <comment></comment>
5
+ <projects>
6
+ </projects>
7
+ <buildSpec>
8
+ </buildSpec>
9
+ <natures>
10
+ </natures>
11
+ </projectDescription>
app/code/community/EasyNolo/BancaSellaPro/Block/Adminhtml/System/Config/Gestpayinfo.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: Massimo Maino
5
+ * Date: 28/10/16
6
+ * Time: 19:31
7
+ */
8
+
9
+ class EasyNolo_BancaSellaPro_Block_Adminhtml_System_Config_Gestpayinfo
10
+ extends Mage_Adminhtml_Block_Abstract
11
+ implements Varien_Data_Form_Element_Renderer_Interface
12
+ {
13
+
14
+ /**
15
+ * Render Information element
16
+ *
17
+ * @param Varien_Data_Form_Element_Abstract $element
18
+ * @return string
19
+ */
20
+ public function render(Varien_Data_Form_Element_Abstract $element)
21
+ {
22
+ $html = '
23
+ <img src="'.$this->getSkinUrl('images/bancasellapro/gestpay.png').'" style="width: 200px;" />
24
+ <br/>
25
+ <br><br>
26
+ ';
27
+ return $html;
28
+ }
29
+
30
+ }
app/code/community/EasyNolo/BancaSellaPro/Block/Adminhtml/System/Config/Redinfo.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: Massimo Maino
5
+ * Date: 28/10/16
6
+ * Time: 19:31
7
+ */
8
+
9
+ class EasyNolo_BancaSellaPro_Block_Adminhtml_System_Config_Redinfo
10
+ extends Mage_Adminhtml_Block_Abstract
11
+ implements Varien_Data_Form_Element_Renderer_Interface
12
+ {
13
+
14
+ /**
15
+ * Render Information element
16
+ *
17
+ * @param Varien_Data_Form_Element_Abstract $element
18
+ * @return string
19
+ */
20
+ public function render(Varien_Data_Form_Element_Abstract $element)
21
+ {
22
+ $html = '
23
+ <img src="'.$this->getSkinUrl('images/bancasellapro/red.png').'" style="width: 200px;" />
24
+ <br/>
25
+ This option gives you a tool of fraud prevention linked to each
26
+ transaction, provided by RED.
27
+ <br>
28
+ You must define your own configuration on RED activation. Based on this
29
+ configuration some parameters has to be passed or not. Once configured you environment,
30
+ you must enable or disable the following options as well.
31
+ <br>
32
+ Based on the collection and processing of this information, Red returns a risk
33
+ score (Accept, Deny, Challenge), which is used to change the order state/status.
34
+ <br><br>
35
+ ';
36
+ return $html;
37
+ }
38
+
39
+ }
app/code/community/EasyNolo/BancaSellaPro/Block/Adminhtml/System/Config/Riskifiedinfo.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: Massimo Maino
5
+ * Date: 28/10/16
6
+ * Time: 19:31
7
+ */
8
+
9
+ class EasyNolo_BancaSellaPro_Block_Adminhtml_System_Config_Riskifiedinfo
10
+ extends Mage_Adminhtml_Block_Abstract
11
+ implements Varien_Data_Form_Element_Renderer_Interface
12
+ {
13
+
14
+ /**
15
+ * Render Information element
16
+ *
17
+ * @param Varien_Data_Form_Element_Abstract $element
18
+ * @return string
19
+ */
20
+ public function render(Varien_Data_Form_Element_Abstract $element)
21
+ {
22
+ $html = '
23
+ <img src="'.$this->getSkinUrl('images/bancasellapro/riskified.png').'" style="width: 200px;" />
24
+ <br/>
25
+ This option gives you a tool of fraud prevention linked to each
26
+ transaction, provided by Riskified.
27
+ <br>
28
+ This extension works only if your active plan with Banca Sella is "Shop Protection" because we don\'t have sufficent information to decide wich transactions must be reviewed,
29
+ so with "Shop Protection" plan all transactions are submitted for review by default.
30
+ <br>
31
+ Based on the collection and processing of order information, Riskified returns a risk
32
+ score (ACCEPTED, DECLINED, UnderReview), which is used to change the order state/status.
33
+ <br><br>
34
+ ';
35
+ return $html;
36
+ }
37
+
38
+ }
app/code/community/EasyNolo/BancaSellaPro/Block/Form.php CHANGED
@@ -85,8 +85,32 @@ class EasyNolo_BancaSellaPro_Block_Form extends Mage_Payment_Block_Form
85
  * Check if iframe is enable on backend
86
  * @return boolean
87
  */
88
- public function isIframeEnable(){
89
- return $this->getMethod()->isIframeEnable();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  }
91
 
92
  public function isRecurringProfile()
@@ -101,4 +125,10 @@ class EasyNolo_BancaSellaPro_Block_Form extends Mage_Payment_Block_Form
101
  return $this->_isRecurringProfile;
102
  }
103
 
 
 
 
 
 
 
104
  }
85
  * Check if iframe is enable on backend
86
  * @return boolean
87
  */
88
+ public function isIframeEnabled(){
89
+ return $this->getMethod()->isIframeEnabled();
90
+ }
91
+
92
+ public function isRedEnabled(){
93
+ return $this->getMethod()->isRedEnabled();
94
+ }
95
+
96
+ public function isRiskifiedEnabled(){
97
+ return $this->getMethod()->isRiskifiedEnabled();
98
+ }
99
+
100
+ public function isTokenizationEnabled(){
101
+ return $this->getMethod()->isTokenizationEnabled();
102
+ }
103
+
104
+ public function getAllTokens()
105
+ {
106
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
107
+ $tokens = array();
108
+ if($customer->getId()) {
109
+ $tokens = Mage::getModel('easynolo_bancasellapro/token')
110
+ ->getCollection()
111
+ ->addFieldToFilter('customer_id', $customer->getId());
112
+ }
113
+ return $tokens;
114
  }
115
 
116
  public function isRecurringProfile()
125
  return $this->_isRecurringProfile;
126
  }
127
 
128
+ public function showToken(){
129
+ return $this->isTokenizationEnabled() &&
130
+ ($this->isRecurringProfile() || $this->getMethod()->getConfigData('tokenization_context') == 'always') &&
131
+ count($this->getAllTokens()) > 0;
132
+ }
133
+
134
  }
app/code/community/EasyNolo/BancaSellaPro/Block/Tokenization/List.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: maintux
5
+ * Date: 18/12/16
6
+ * Time: 11:00
7
+ */
8
+
9
+ class EasyNolo_BancaSellaPro_Block_Tokenization_List extends Mage_Core_Block_Template
10
+ {
11
+ public function getAllTokens(){
12
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
13
+ $tokens = Mage::getModel('easynolo_bancasellapro/token')
14
+ ->getCollection()
15
+ ->addFieldToFilter('customer_id', $customer->getId());
16
+ return $tokens;
17
+ }
18
+
19
+ protected function _beforeToHtml()
20
+ {
21
+ $this->setBackUrl($this->getUrl('customer/account/'));
22
+ return parent::_beforeToHtml();
23
+ }
24
+ }
app/code/community/EasyNolo/BancaSellaPro/Block/Tokenization/Newtoken.php CHANGED
@@ -48,9 +48,6 @@ class EasyNolo_BancaSellaPro_Block_Tokenization_Newtoken extends Mage_Core_Block
48
 
49
  $profile = Mage::registry('current_recurring_profile');
50
 
51
- /** @var EasyNolo_BancaSellaPro_Helper_Recurringprofile $recurringHelper */
52
- $recurringHelper = Mage::helper('easynolo_bancasellapro/recurringprofile');
53
-
54
  /** @var EasyNolo_BancaSellaPro_Model_Gestpay $method */
55
  $method = Mage::helper('payment')->getMethodInstance($profile->getMethodCode());
56
 
@@ -81,8 +78,8 @@ class EasyNolo_BancaSellaPro_Block_Tokenization_Newtoken extends Mage_Core_Block
81
 
82
  public function getEncryptString(){
83
  /** @var EasyNolo_BancaSellaPro_Helper_Crypt $helper */
84
- $helper =Mage::helper('easynolo_bancasellapro/crypt');
85
- return $helper->getEncryptStringByOrderWitTokenRequest($this->_order);
86
  }
87
 
88
  public function getSuccessRedirect(){
48
 
49
  $profile = Mage::registry('current_recurring_profile');
50
 
 
 
 
51
  /** @var EasyNolo_BancaSellaPro_Model_Gestpay $method */
52
  $method = Mage::helper('payment')->getMethodInstance($profile->getMethodCode());
53
 
78
 
79
  public function getEncryptString(){
80
  /** @var EasyNolo_BancaSellaPro_Helper_Crypt $helper */
81
+ $helper = Mage::helper('easynolo_bancasellapro/crypt');
82
+ return $helper->getEncryptStringByOrder($this->_order);
83
  }
84
 
85
  public function getSuccessRedirect(){
app/code/community/EasyNolo/BancaSellaPro/Helper/AlternativePayments/Ideal.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: maintux
5
+ * Date: 18/01/17
6
+ * Time: 17:48
7
+ */
8
+ class EasyNolo_BancaSellaPro_Helper_AlternativePayments_Ideal extends Mage_Core_Helper_Abstract {
9
+
10
+ function addCustomParams(&$params, $order_id=null){
11
+ $storeId = Mage::app()->getStore()->getStoreId();
12
+ $params['paymentTypeDetail'] = array(
13
+ 'IdealBankCode' => Mage::getStoreConfigFlag('payment/gestpaypro_alternative_payments/ideal_bankcode', $storeId)
14
+ );
15
+ }
16
+
17
+ }
app/code/community/EasyNolo/BancaSellaPro/Helper/AlternativePayments/Mybank.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: maintux
5
+ * Date: 18/01/17
6
+ * Time: 17:48
7
+ */
8
+ class EasyNolo_BancaSellaPro_Helper_AlternativePayments_Mybank extends Mage_Core_Helper_Abstract {
9
+
10
+ function addCustomParams(&$params, $order_id=null){
11
+ $storeId = Mage::app()->getStore()->getStoreId();
12
+ $params['paymentTypeDetail'] = array(
13
+ 'MyBankBankCode' => Mage::getStoreConfigFlag('payment/gestpaypro_alternative_payments/mybank_bankcode', $storeId)
14
+ );
15
+ }
16
+
17
+ }
app/code/community/EasyNolo/BancaSellaPro/Helper/AlternativePayments/Paypal.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: maintux
5
+ * Date: 18/01/17
6
+ * Time: 17:48
7
+ */
8
+ class EasyNolo_BancaSellaPro_Helper_AlternativePayments_Paypal extends Mage_Core_Helper_Abstract {
9
+
10
+ function addCustomParams(&$params, $order_id=null){
11
+ if(!$order_id) return;
12
+ $order = Mage::getModel('sales/order')->load($order_id);
13
+ $storeId = Mage::app()->getStore()->getStoreId();
14
+ $showProductInfo = Mage::getStoreConfigFlag('payment/gestpaypro_alternative_payments/paypal_show_product_info', $storeId);
15
+ $sellerProtection = Mage::getStoreConfigFlag('payment/gestpaypro_alternative_payments/paypal_seller_protection', $storeId);
16
+ if($showProductInfo){
17
+ if(!isset($params['OrderDetails'])) $params['OrderDetails'] = array();
18
+ $params['OrderDetails']['ArrayOfProductDetail'] = array('ProductDetail' => array());
19
+ foreach($order->getAllItems() as $order_item) {
20
+ $params['OrderDetails']['ArrayOfProductDetail']['ProductDetail'][] = array(
21
+ 'ProductCode' => $order_item->getId(),
22
+ 'Name' => $order_item->getName(),
23
+ 'SKU' => $order_item->getSku(),
24
+ 'Description' => $order_item->getDescription(),
25
+ 'Quantity' => (int)$order_item->getQtyOrdered(),
26
+ 'UnitPrice' => round($order_item->getPrice(), 2),
27
+ 'Price' => round($order_item->getRowTotal(), 2),
28
+ 'Type' => 1,
29
+ 'Vat' => $order_item->getTaxPercent().'%'
30
+ );
31
+ }
32
+ }
33
+ if($sellerProtection){
34
+ $params['ppSellerProtection'] = 1;
35
+ $shipping_address = $order->getShippingAddress();
36
+ $params['shippingDetails'] = array();
37
+ $params['shippingDetails']['shipToName'] = $shipping_address->getFirstname().' '.$shipping_address->getLastname();
38
+ $params['shippingDetails']['shipToStreet'] = $shipping_address->getStreet(-1);
39
+ $params['shippingDetails']['shipToCity'] = $shipping_address->getCity();
40
+ $params['shippingDetails']['shipToCountryCode'] = $shipping_address->getCountryModel()->getIso2Code();
41
+ $params['shippingDetails']['shipToZip'] = $shipping_address->getPostcode();
42
+ }
43
+ }
44
+
45
+ }
app/code/community/EasyNolo/BancaSellaPro/Helper/AlternativePayments/Sofort.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: maintux
5
+ * Date: 18/01/17
6
+ * Time: 17:48
7
+ */
8
+ class EasyNolo_BancaSellaPro_Helper_AlternativePayments_Sofort extends Mage_Core_Helper_Abstract {
9
+
10
+ function addCustomParams(&$params, $order_id=null){
11
+ if(!$order_id) return;
12
+ $order = Mage::getModel('sales/order')->load($order_id);
13
+ if(!isset($params['OrderDetails'])) $params['OrderDetails'] = array();
14
+ $params['OrderDetails']['CustomerDetail'] = array(
15
+ 'FirstName' => $order->getCustomerFirstname(),
16
+ 'Lastname' => $order->getCustomerLastname(),
17
+ 'PrimaryEmail' => $order->getCustomerEmail()
18
+ );
19
+ $billing_address = $order->getBillingAddress();
20
+ $params['OrderDetails']['BillingAddress'] = array(
21
+ 'CountryCode' => $billing_address->getCountryModel()->getIso2Code()
22
+ );
23
+ }
24
+
25
+ }
app/code/community/EasyNolo/BancaSellaPro/Helper/Baseclient.php CHANGED
@@ -41,8 +41,8 @@ class EasyNolo_BancaSellaPro_Helper_Baseclient extends Mage_Core_Helper_Abstract
41
  }
42
 
43
  $webService = Mage::getModel($this->_webserviceClassName);
44
- $gestPay=Mage::getModel('easynolo_bancasellapro/gestpay');
45
- $webService->setBaseUrl($gestPay->getBaseWSDLUrlSella());
46
 
47
  return $webService;
48
  }
41
  }
42
 
43
  $webService = Mage::getModel($this->_webserviceClassName);
44
+ $gestpay = Mage::getModel('easynolo_bancasellapro/gestpay');
45
+ $webService->setBaseUrl($gestpay->getBaseWSDLUrlSella());
46
 
47
  return $webService;
48
  }
app/code/community/EasyNolo/BancaSellaPro/Helper/Crypt.php CHANGED
@@ -52,18 +52,6 @@ class EasyNolo_BancaSellaPro_Helper_Crypt extends EasyNolo_BancaSellaPro_Helper_
52
 
53
  }
54
 
55
- public function getEncryptStringByOrderWitTokenRequest ($order){
56
- $method = $order->getPayment()->getMethodInstance();
57
- /** @var $webService EasyNolo_BancaSellaPro_Model_Webservice_Wscryptdecrypt */
58
- $webService = Mage::getModel('easynolo_bancasellapro/webservice_wscryptdecrypt');
59
- $webService->setOrder($order);
60
- $webService->setRecurringProfile(true);
61
- $webService->setBaseUrl($method->getBaseWSDLUrlSella());
62
-
63
- return $this->getEncryptString($webService);
64
-
65
- }
66
-
67
  /**
68
  * @param $method EasyNolo_BancaSellaPro_Model_Gestpay
69
  *
@@ -87,7 +75,7 @@ class EasyNolo_BancaSellaPro_Helper_Crypt extends EasyNolo_BancaSellaPro_Helper_
87
  *
88
  * @return mixed
89
  */
90
- public function decriptPaymentRequest($webService){
91
 
92
  $client = $this->_initClient($webService);
93
  if(!$client){
@@ -111,7 +99,7 @@ class EasyNolo_BancaSellaPro_Helper_Crypt extends EasyNolo_BancaSellaPro_Helper_
111
 
112
  $webService->setDecryptParam($a , $b);
113
 
114
- $result = $this->decriptPaymentRequest ($webService);
115
 
116
  if(!$result){
117
  return false;
@@ -155,7 +143,7 @@ class EasyNolo_BancaSellaPro_Helper_Crypt extends EasyNolo_BancaSellaPro_Helper_
155
  if($order->getId()){
156
  $method= $order->getPayment()->getMethodInstance();
157
  $order->cancel();
158
- $order->setState($method->getOrderStatusKoUser(), true, $message);
159
  $order->save();
160
  }
161
 
@@ -182,6 +170,7 @@ class EasyNolo_BancaSellaPro_Helper_Crypt extends EasyNolo_BancaSellaPro_Helper_
182
  $method = $payment->getMethodInstance();
183
  $_helper= Mage::helper('easynolo_bancasellapro');
184
  $_helper->log('Controllo l\'ordine in base alle risposte della S2S');
 
185
  if($method->getConfigData('order_status_fraud_gestpay')){
186
  $_helper->log('Controllo frode');
187
 
@@ -213,59 +202,71 @@ class EasyNolo_BancaSellaPro_Helper_Crypt extends EasyNolo_BancaSellaPro_Helper_
213
  }
214
 
215
  switch ($webservice->getTransactionResult()){
 
216
  case EasyNolo_BancaSellaPro_Model_Webservice_Wscryptdecrypt::TRANSACTION_RESULT_PENDING :
217
  $message = $this->__("Authorizing amount of %s is pending approval on gateway.", $order->getBaseCurrency()->formatTxt($order->getBaseGrandTotal()));
218
  $order->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT, true, $message);
219
  $_helper->log('Pagamento effettuato con bonifico bancario, verificare a mano la transazione');
220
  $order->addStatusHistoryComment($this->__('Payment was using bank transfer. Please verify the order status on GestPay.'));
221
  break;
222
- case EasyNolo_BancaSellaPro_Model_Webservice_Wscryptdecrypt::TRANSACTION_RESULT_OK :
223
- $_helper->log('Pagamento effettuato correttamente. Cambio stato all\'ordine e salvo l\'id della transazione');
224
- $message = $this->__("Authorization approved on gateway. GestPay Transaction ID: %s", $webservice->getBankTransactionID());
225
- if($paymentMethod = $webservice->getPaymentMethod()){
226
- $message .= " (".$paymentMethod.")";
227
- }
228
-
229
- $order->addStatusHistoryComment($message);
230
-
231
- // create the authorization transaction
232
- $payment->setAdditionalData(serialize($webservice->getData()));
233
- $payment->setTransactionAdditionalInfo(array(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS => $webservice->getData()), "");
234
- $payment->setTransactionId($webservice->getShopTransactionId());
235
- $payment->setCurrencyCode($order->getBaseCurrencyCode());
236
- $payment->setIsTransactionClosed(0);
237
- $payment->registerAuthorizationNotification($webservice->getAmount());
238
- $order = $payment->getOrder();
239
- $order->save();
240
 
241
- // reload the order and the related payment entities
242
- $order = Mage::getModel('sales/order')->load($order->getId());
243
- $payment = $order->getPayment();
244
 
245
- // perform the capture
246
- $setOrderAsPaid = true;
247
- if($method->getConfigPaymentAction() == Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE_CAPTURE) {
248
- if($method->getConfigData('use_s2s_api')){
249
- try{
250
- $payment->capture();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
251
  $order->save();
252
- }catch(Exception $e){
253
- $setOrderAsPaid = false;
254
- $message = $this->__("Failed capture online: %", $e->getMessage());
255
- $order->setState(Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW, Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW, $message);
256
- }
257
  }
258
-
259
- if($setOrderAsPaid == true){
260
- $payment->registerCaptureNotification($order->getBaseGrandTotal());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
261
  }
262
- }
263
-
264
- if($setOrderAsPaid == true){
265
- $order->setState($method->getOrderStatusOkGestPay(), true);
266
- }
267
-
268
  break;
 
269
  case EasyNolo_BancaSellaPro_Model_Webservice_Wscryptdecrypt::TRANSACTION_RESULT_KO :
270
  $_helper->log('Pagamento non andato a buon fine. Cambio stato all\'ordine e salvo l\'id della transazione');
271
  $message = $this->__("Authorizing amount of %s is pending approval on gateway.", $order->getBaseCurrency()->formatTxt($order->getBaseGrandTotal()));
@@ -283,4 +284,57 @@ class EasyNolo_BancaSellaPro_Helper_Crypt extends EasyNolo_BancaSellaPro_Helper_
283
  $order->save();
284
  $_helper->log('Dopo l\'elaborazione della s2s l\'ordine con id: '.$order->getId().' ha state: '.$order->getState().' e status: '.$order->getStatus());
285
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
286
  }
52
 
53
  }
54
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  /**
56
  * @param $method EasyNolo_BancaSellaPro_Model_Gestpay
57
  *
75
  *
76
  * @return mixed
77
  */
78
+ public function decryptPaymentRequest($webService){
79
 
80
  $client = $this->_initClient($webService);
81
  if(!$client){
99
 
100
  $webService->setDecryptParam($a , $b);
101
 
102
+ $result = $this->decryptPaymentRequest ($webService);
103
 
104
  if(!$result){
105
  return false;
143
  if($order->getId()){
144
  $method= $order->getPayment()->getMethodInstance();
145
  $order->cancel();
146
+ $order->setState($method->getOrderStatusKoGestPay(), true, $message);
147
  $order->save();
148
  }
149
 
170
  $method = $payment->getMethodInstance();
171
  $_helper= Mage::helper('easynolo_bancasellapro');
172
  $_helper->log('Controllo l\'ordine in base alle risposte della S2S');
173
+
174
  if($method->getConfigData('order_status_fraud_gestpay')){
175
  $_helper->log('Controllo frode');
176
 
202
  }
203
 
204
  switch ($webservice->getTransactionResult()){
205
+
206
  case EasyNolo_BancaSellaPro_Model_Webservice_Wscryptdecrypt::TRANSACTION_RESULT_PENDING :
207
  $message = $this->__("Authorizing amount of %s is pending approval on gateway.", $order->getBaseCurrency()->formatTxt($order->getBaseGrandTotal()));
208
  $order->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT, true, $message);
209
  $_helper->log('Pagamento effettuato con bonifico bancario, verificare a mano la transazione');
210
  $order->addStatusHistoryComment($this->__('Payment was using bank transfer. Please verify the order status on GestPay.'));
211
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
212
 
213
+ case EasyNolo_BancaSellaPro_Model_Webservice_Wscryptdecrypt::TRANSACTION_RESULT_OK :
 
 
214
 
215
+ if($method->isRedEnabled()):
216
+ switch ($webservice->getRedResponseCode()) {
217
+ case 'ACCEPT':
218
+ $this->_setOrderPaid($order, $webservice);
219
+ break;
220
+ default:
221
+ $_helper->log('Pagamento effettuato correttamente ma il check RED è risultato \''.$webservice->getRedResponseCode().'\'. Cambio stato all\'ordine e salvo l\'id della transazione');
222
+ $message = $this->__("Authorization approved on gateway but RED return with '%s' status. GestPay Transaction ID: %s", $webservice->getRedResponseCode(), $webservice->getBankTransactionID());
223
+ if($paymentMethod = $webservice->getPaymentMethod()){
224
+ $message .= " (".$paymentMethod.")";
225
+ }
226
+ $payment->setAdditionalData(serialize($webservice->getData()))
227
+ ->setTransactionAdditionalInfo(array(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS => $webservice->getData()), "");
228
+ $payment->setTransactionId($webservice->getShopTransactionId())
229
+ ->setCurrencyCode($order->getBaseCurrencyCode())
230
+ ->setIsTransactionClosed(0)
231
+ ->registerPaymentReviewAction(Mage_Sales_Model_Order_Payment::REVIEW_ACTION_UPDATE, false);
232
+ $status = Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW;
233
+ if($webservice->getRedResponseCode() == 'DENY')
234
+ $status = $method->getRedConfigData('deny_order_status');
235
+ elseif($webservice->getRedResponseCode() == 'CHALLENGE')
236
+ $status = $method->getRedConfigData('challenge_order_status');
237
+ $order->setState(Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW, $status, $message);
238
  $order->save();
 
 
 
 
 
239
  }
240
+ elseif($method->isRiskifiedEnabled()):
241
+ switch ($webservice->getRiskResponseCode()) {
242
+ case 'approved':
243
+ $this->_setOrderPaid($order, $webservice);
244
+ break;
245
+ default:
246
+ $_helper->log('Pagamento effettuato correttamente ma il check Riskified è risultato \''.$webservice->getRiskResponseCode().'\'. Cambio stato all\'ordine e salvo l\'id della transazione');
247
+ $message = $this->__("Authorization approved on gateway but Riskified return with '%s' status. Response description: %s. GestPay Transaction ID: %s", $webservice->getRiskResponseCode(), $webservice->getRiskResponseDescription(), $webservice->getBankTransactionID());
248
+ if($paymentMethod = $webservice->getPaymentMethod()){
249
+ $message .= " (".$paymentMethod.")";
250
+ }
251
+ $payment->setAdditionalData(serialize($webservice->getData()))
252
+ ->setTransactionAdditionalInfo(array(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS => $webservice->getData()), "");
253
+ $payment->setTransactionId($webservice->getShopTransactionId())
254
+ ->setCurrencyCode($order->getBaseCurrencyCode())
255
+ ->setIsTransactionClosed(0)
256
+ ->registerPaymentReviewAction(Mage_Sales_Model_Order_Payment::REVIEW_ACTION_UPDATE, false);
257
+ $status = Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW;
258
+ if($webservice->getRiskResponseCode() == 'declined')
259
+ $status = $method->getRiskifiedConfigData('declined_order_status');
260
+ elseif($webservice->getRiskResponseCode() == 'submitted')
261
+ $status = $method->getRiskifiedConfigData('submitted_order_status');
262
+ $order->setState(Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW, $status, $message);
263
+ $order->save();
264
  }
265
+ else:
266
+ $this->_setOrderPaid($order, $webservice);
267
+ endif;
 
 
 
268
  break;
269
+
270
  case EasyNolo_BancaSellaPro_Model_Webservice_Wscryptdecrypt::TRANSACTION_RESULT_KO :
271
  $_helper->log('Pagamento non andato a buon fine. Cambio stato all\'ordine e salvo l\'id della transazione');
272
  $message = $this->__("Authorizing amount of %s is pending approval on gateway.", $order->getBaseCurrency()->formatTxt($order->getBaseGrandTotal()));
284
  $order->save();
285
  $_helper->log('Dopo l\'elaborazione della s2s l\'ordine con id: '.$order->getId().' ha state: '.$order->getState().' e status: '.$order->getStatus());
286
  }
287
+
288
+ private function _setOrderPaid($order, $webservice){
289
+ $_helper= Mage::helper('easynolo_bancasellapro');
290
+ $payment = $order->getPayment();
291
+ $method = $payment->getMethodInstance();
292
+ $_helper->log('Pagamento effettuato correttamente. Cambio stato all\'ordine e salvo l\'id della transazione');
293
+ $message = $this->__("Authorization approved on gateway. GestPay Transaction ID: %s", $webservice->getBankTransactionID());
294
+ if($paymentMethod = $webservice->getPaymentMethod()){
295
+ $message .= " (".$paymentMethod.")";
296
+ }
297
+
298
+ $order->addStatusHistoryComment($message);
299
+
300
+ // create the authorization transaction
301
+ $payment->setAdditionalData(serialize($webservice->getData()));
302
+ $payment->setTransactionAdditionalInfo(array(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS => $webservice->getData()), "");
303
+ $payment->setTransactionId($webservice->getShopTransactionId());
304
+ $payment->setCurrencyCode($order->getBaseCurrencyCode());
305
+ $payment->setIsTransactionClosed(0);
306
+ $payment->registerAuthorizationNotification($webservice->getAmount());
307
+ $order = $payment->getOrder();
308
+ $order->save();
309
+
310
+ // reload the order and the related payment entities
311
+ $order = Mage::getModel('sales/order')->load($order->getId());
312
+ $payment = $order->getPayment();
313
+
314
+ // perform the capture
315
+ $setOrderAsPaid = true;
316
+ if($method->getConfigPaymentAction() == Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE_CAPTURE) {
317
+ // capture online if enabled
318
+ if($method->getUseS2sApiForSalesActions()){
319
+ try{
320
+ $payment->capture();
321
+ $order->save();
322
+ }catch(Exception $e){
323
+ $setOrderAsPaid = false;
324
+ $message = $this->__("Failed capture online: %", $e->getMessage());
325
+ $order->setState(Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW, Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW, $message);
326
+ }
327
+ }
328
+
329
+ // capture notification, used for capture offline too
330
+ if($setOrderAsPaid == true){
331
+ $payment->registerCaptureNotification($order->getBaseGrandTotal());
332
+ }
333
+ }
334
+
335
+ if($setOrderAsPaid == true){
336
+ $order->setState($method->getOrderStatusOkGestPay(), true);
337
+ }
338
+
339
+ }
340
  }
app/code/community/EasyNolo/BancaSellaPro/Helper/Data.php CHANGED
@@ -57,7 +57,7 @@ class EasyNolo_BancaSellaPro_Helper_Data extends Mage_Core_Helper_Abstract {
57
  function getGestPayJs(){
58
  $method = Mage::getModel('easynolo_bancasellapro/gestpay');
59
  $url = null;
60
- if($method->isIframeEnable()){
61
  $url = $method->getIframeUrl();
62
  }
63
  return $url;
57
  function getGestPayJs(){
58
  $method = Mage::getModel('easynolo_bancasellapro/gestpay');
59
  $url = null;
60
+ if($method->isIframeEnabled()){
61
  $url = $method->getIframeUrl();
62
  }
63
  return $url;
app/code/community/EasyNolo/BancaSellaPro/Helper/Recurringprofile.php CHANGED
@@ -11,6 +11,27 @@ class EasyNolo_BancaSellaPro_Helper_Recurringprofile extends EasyNolo_BancaSella
11
 
12
  const STATUS_REFUND_TOTAL = 'refund_bancasella';
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
  /**
16
  * Method to check if an order is for a recurring payment and if yes, save the token
@@ -19,15 +40,26 @@ class EasyNolo_BancaSellaPro_Helper_Recurringprofile extends EasyNolo_BancaSella
19
  */
20
  public function checkAndSaveToken( Mage_Sales_Model_Order $order, $webservice){
21
 
22
- $profileId = $this->getProfileIdByOrder($order);
 
23
 
 
 
 
 
 
 
 
 
 
 
24
  if(false !== $profileId){
25
  //find a recurring profile
26
  /** @var Mage_Sales_Model_Recurring_Profile $profile */
27
  $profile = Mage::getModel('sales/recurring_profile')->load($profileId);
28
 
29
  //controllo se il profile è in attesa
30
- if($profile->getState()==Mage_Sales_Model_Recurring_Profile::STATE_PENDING){
31
 
32
  switch ($webservice->getTransactionResult()){
33
  case EasyNolo_BancaSellaPro_Model_Webservice_Wscryptdecrypt::TRANSACTION_RESULT_OK :
@@ -38,15 +70,10 @@ class EasyNolo_BancaSellaPro_Helper_Recurringprofile extends EasyNolo_BancaSella
38
  $profile->setReferenceId($profile->getId());
39
  $profile->setState(Mage_Sales_Model_Recurring_Profile::STATE_ACTIVE);
40
 
41
- /** @var EasyNolo_Bancasellapro_Model_Token $tokenInfo */
42
- $tokenInfo = Mage::getModel('easynolo_bancasellapro/token');
43
- $tokenInfo->setProfile($profile)
44
- ->setTokenInfo(
45
- $webservice->getToken(),
46
- $webservice->getTokenExpiryMonth(),
47
- $webservice->getTokenExpiryYear());
48
  $tokenInfo->save();
49
  break;
 
50
  case EasyNolo_BancaSellaPro_Model_Webservice_Wscryptdecrypt::TRANSACTION_RESULT_KO :
51
  $profile->setState(Mage_Sales_Model_Recurring_Profile::STATE_CANCELED);
52
  break;
@@ -110,12 +137,12 @@ class EasyNolo_BancaSellaPro_Helper_Recurringprofile extends EasyNolo_BancaSella
110
 
111
  /**
112
  * Method to extract the recurring profile array by quote
113
- * @param Mage_Sales_Model_Quote $quote
114
  * @return array
115
  */
116
- public function getRecurringProfileByQuote($quote){
117
  //recupero tutti gli item visibili è controllo se l'ordine è di un recurring payment
118
- foreach ($quote->getAllVisibleItems() as $item) {
119
  if ($item->getProduct()->getIsRecurring()){
120
  $option = $item->getOptionByCode(Mage_Payment_Model_Recurring_Profile::PRODUCT_OPTIONS_KEY);
121
  if( $option == null ){
@@ -164,8 +191,8 @@ class EasyNolo_BancaSellaPro_Helper_Recurringprofile extends EasyNolo_BancaSella
164
  }else{
165
  $_helper->log('Analizzo il pagamento tramite token');
166
  //analizza il risultato
167
- $helperDecript = Mage::helper('easynolo_bancasellapro/crypt');
168
- $helperDecript->setStatusOrderByS2SRequest($order,$webservice);
169
  $method= $order->getPayment()->getMethodInstance();
170
  if( $order->getStatus()==$method->getOrderStatusOkGestPay()){
171
  $_helper->log('Invio email di conferma creazione ordine all\'utente');
@@ -189,8 +216,7 @@ class EasyNolo_BancaSellaPro_Helper_Recurringprofile extends EasyNolo_BancaSella
189
  return false;
190
  }
191
 
192
-
193
- protected function executePaymentS2S($webService){
194
  $client = $this->_initClient($webService);
195
  if(!$client){
196
  return false;
@@ -204,7 +230,6 @@ class EasyNolo_BancaSellaPro_Helper_Recurringprofile extends EasyNolo_BancaSella
204
  return $webService;
205
  }
206
 
207
-
208
  /**
209
  * Method to calculate next recurring date
210
  * @param $unit
@@ -262,5 +287,25 @@ class EasyNolo_BancaSellaPro_Helper_Recurringprofile extends EasyNolo_BancaSella
262
  return null;
263
  }
264
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
265
 
266
- }
11
 
12
  const STATUS_REFUND_TOTAL = 'refund_bancasella';
13
 
14
+ public function recalculateAmount($recurringProfile){
15
+ //il primo pagamento deve essere fatto calcolando l'init amount piu il costo della trial/billing_amount
16
+ if(isset($recurringProfile['trial_billing_amount']) && $recurringProfile['trial_billing_amount'] > 0){
17
+ $amount = $recurringProfile['trial_billing_amount'];
18
+ }else{
19
+ $amount = $recurringProfile['billing_amount'];
20
+ }
21
+
22
+ if (isset($recurringProfile['init_amount'])){
23
+ $amount += $recurringProfile['init_amount'];
24
+ }
25
+
26
+ if(isset($recurringProfile['shipping_amount'])){
27
+ $amount += $recurringProfile['shipping_amount'];
28
+ }
29
+ if(isset($recurringProfile['tax_amount'])){
30
+ $amount += $recurringProfile['tax_amount'];
31
+ }
32
+
33
+ return $amount;
34
+ }
35
 
36
  /**
37
  * Method to check if an order is for a recurring payment and if yes, save the token
40
  */
41
  public function checkAndSaveToken( Mage_Sales_Model_Order $order, $webservice){
42
 
43
+ if(!$webservice->getToken())
44
+ return;
45
 
46
+ /** @var EasyNolo_Bancasellapro_Model_Token $tokenInfo */
47
+ $tokenInfo = Mage::getModel('easynolo_bancasellapro/token');
48
+ $tokenInfo->setTokenInfo(
49
+ $webservice->getToken(),
50
+ $webservice->getTokenExpiryMonth(),
51
+ $webservice->getTokenExpiryYear());
52
+ $tokenInfo->setCustomerId($order->getCustomerId());
53
+ $tokenInfo->save();
54
+
55
+ $profileId = $this->getProfileIdByOrder($order);
56
  if(false !== $profileId){
57
  //find a recurring profile
58
  /** @var Mage_Sales_Model_Recurring_Profile $profile */
59
  $profile = Mage::getModel('sales/recurring_profile')->load($profileId);
60
 
61
  //controllo se il profile è in attesa
62
+ if($profile->getState() == Mage_Sales_Model_Recurring_Profile::STATE_PENDING){
63
 
64
  switch ($webservice->getTransactionResult()){
65
  case EasyNolo_BancaSellaPro_Model_Webservice_Wscryptdecrypt::TRANSACTION_RESULT_OK :
70
  $profile->setReferenceId($profile->getId());
71
  $profile->setState(Mage_Sales_Model_Recurring_Profile::STATE_ACTIVE);
72
 
73
+ $tokenInfo->setProfile($profile);
 
 
 
 
 
 
74
  $tokenInfo->save();
75
  break;
76
+
77
  case EasyNolo_BancaSellaPro_Model_Webservice_Wscryptdecrypt::TRANSACTION_RESULT_KO :
78
  $profile->setState(Mage_Sales_Model_Recurring_Profile::STATE_CANCELED);
79
  break;
137
 
138
  /**
139
  * Method to extract the recurring profile array by quote
140
+ * @param Mage_Sales_Model_Order|Mage_Sales_Model_Quote $orderOrQuote
141
  * @return array
142
  */
143
+ public function getRecurringProfile($orderOrQuote){
144
  //recupero tutti gli item visibili è controllo se l'ordine è di un recurring payment
145
+ foreach ($orderOrQuote->getAllVisibleItems() as $item) {
146
  if ($item->getProduct()->getIsRecurring()){
147
  $option = $item->getOptionByCode(Mage_Payment_Model_Recurring_Profile::PRODUCT_OPTIONS_KEY);
148
  if( $option == null ){
191
  }else{
192
  $_helper->log('Analizzo il pagamento tramite token');
193
  //analizza il risultato
194
+ $helperDecrypt = Mage::helper('easynolo_bancasellapro/crypt');
195
+ $helperDecrypt->setStatusOrderByS2SRequest($order,$webservice);
196
  $method= $order->getPayment()->getMethodInstance();
197
  if( $order->getStatus()==$method->getOrderStatusOkGestPay()){
198
  $_helper->log('Invio email di conferma creazione ordine all\'utente');
216
  return false;
217
  }
218
 
219
+ public function executePaymentS2S($webService){
 
220
  $client = $this->_initClient($webService);
221
  if(!$client){
222
  return false;
230
  return $webService;
231
  }
232
 
 
233
  /**
234
  * Method to calculate next recurring date
235
  * @param $unit
287
  return null;
288
  }
289
 
290
+ public function getFormattedToken($token){
291
+ return preg_replace("/([0-9]{2}).{10}([0-9]{4})/", "\${1}**********\${2}", $token);
292
+ }
293
+
294
+ public function getCardVendor($token){
295
+ if(preg_match("/^4[0-9]/", $token))
296
+ return array('label'=>'Visa', 'id'=>'visa');
297
+ elseif(preg_match("/^5[1-5]/", $token))
298
+ return array('label'=>'MasterCard', 'id'=>'mastercard');
299
+ elseif(preg_match("/^3[47]/", $token))
300
+ return array('label'=>'Amex', 'id'=>'america-express');
301
+ elseif(preg_match("/^3[068]/", $token))
302
+ return array('label'=>'Diners Club', 'id'=>'diners');
303
+ elseif(preg_match("/^6[05]/", $token))
304
+ return array('label'=>'Discover', 'id'=>'discover');
305
+ elseif(preg_match("/^21/", $token) || preg_match("/^18/", $token) || preg_match("/^35/", $token))
306
+ return array('label'=>'JCB', 'id'=>'jcb');
307
+ else
308
+ return array('label'=>'unknown', 'id'=>'credit-card');
309
+ }
310
 
311
+ }
app/code/community/EasyNolo/BancaSellaPro/Helper/Red.php ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class EasyNolo_BancaSellaPro_Helper_Red extends Mage_Core_Helper_Abstract
4
+ {
5
+ private function _sanitize($str, $type, $length=null){
6
+ if(!$length) $length = strlen($str);
7
+ switch ($type){
8
+ case 'Alphanumeric':
9
+ return substr(preg_replace("/[^A-Za-z0-9 ]/", '', $str), 0, $length);
10
+ case 'Numeric';
11
+ return (int)substr($str, 0, $length);
12
+ case 'String':
13
+ return substr($str, 0, $length);
14
+ case 'Email';
15
+ if($f = filter_var(substr($str, 0, $length), FILTER_VALIDATE_EMAIL))
16
+ return $f;
17
+ return '';
18
+ case 'DoB':
19
+ if(preg_match("/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/", $str))
20
+ return $str;
21
+ return '';
22
+ case 'IP';
23
+ if(preg_match("/^[0-9]{3}\.[0-9]{3}\.[0-9]{3}\.[0-9]{3}$/", $str))
24
+ return $str;
25
+ return '';
26
+ default:
27
+ return $str;
28
+ }
29
+ return '';
30
+ }
31
+
32
+ const TIME_TO_DEPARTURE_MAPPING = array(
33
+ 'Low Cost' => 'C',
34
+ 'Designated by customer' => 'D',
35
+ 'International' => 'I',
36
+ 'Military' => 'M',
37
+ 'Next Day/Overnight' => 'N',
38
+ 'Other' => 'O',
39
+ 'Store Pickup' => 'P',
40
+ '2 day Service' => 'T',
41
+ '3 day Service' => 'W'
42
+ );
43
+
44
+ public function addRedParams(&$params, $order_id=null){
45
+ if(!$order_id) return;
46
+ $order = Mage::getModel('sales/order')->load($order_id);
47
+ if(!$order->getId()) return;
48
+
49
+ $gestpay = $order->getPayment()->getMethodInstance();
50
+
51
+ $params['redFraudPrevention'] = 1;
52
+ // Red_CustomerInfo
53
+ if($gestpay->getRedConfigData('customer_info')) {
54
+ $params['Red_CustomerInfo'] = array(
55
+ 'Customer_Name' => $this->_sanitize($order->getCustomerFirstname(), 'String', 30),
56
+ 'Customer_Surname' => $this->_sanitize($order->getCustomerLastname(), 'String', 30),
57
+ 'Customer_Email' => $this->_sanitize($order->getCustomerEmail(), 'Email', 45),
58
+ //'Customer_Address' => $this->_sanitize('', 'String', 30),
59
+ //'Customer_Address2' => $this->_sanitize('', 'String', 30),
60
+ //'Customer_City' => $this->_sanitize('', 'String', 20),
61
+ //'Customer_StateCode' => $this->_sanitize('', 'String', 2),
62
+ //'Customer_Country' => $this->_sanitize('', 'String', 3),
63
+ //'Customer_PostalCode' => $this->_sanitize('', 'Alphanumeric', 9),
64
+ //'Customer_Phone' => $this->_sanitize('', 'Numeric', 19)
65
+ );
66
+ if($order->getCustomerPrefix())
67
+ $params['Red_CustomerInfo']['Customer_Title'] = $this->_sanitize($order->getCustomerPrefix(), 'String', 5);
68
+ }
69
+ // Red_ShippingInfo
70
+ if($gestpay->getRedConfigData('shipping_info')) {
71
+ $shipping_address = $order->getShippingAddress();
72
+ $params['Red_ShippingInfo'] = array(
73
+ 'Shipping_Name' => $this->_sanitize($shipping_address->getFirstname(), 'String', 30),
74
+ 'Shipping_Surname' => $this->_sanitize($shipping_address->getLastname(), 'String', 30),
75
+ 'Shipping_Email' => $this->_sanitize($shipping_address->getEmail(), 'Email', 45),
76
+ 'Shipping_Address' => $this->_sanitize($shipping_address->getStreet(-1), 'String', 30),
77
+ //'Shipping_Address2' => $this->_sanitize('', 'String', 30),
78
+ 'Shipping_City' => $this->_sanitize($shipping_address->getCity(), 'String', 20),
79
+ 'Shipping_Country' => $this->_sanitize($shipping_address->getCountryModel()->getIso3Code(), 'String', 3),
80
+ 'Shipping_PostalCode' => $this->_sanitize($shipping_address->getPostcode(), 'Alphanumeric', 9),
81
+ 'Shipping_HomePhone' => $this->_sanitize($shipping_address->getTelephone(), 'Numeric', 19),
82
+ //'Shipping_MobilePhone' => $this->_sanitize('', 'Numeric', 12),
83
+ //'Shipping_FaxPhone' => $this->_sanitize('', 'Numeric', 19),
84
+ //'Shipping_TimeToDeparture' => $this->_sanitize('', 'String', 1)
85
+ );
86
+ if($shipping_address->getRegionId())
87
+ $params['Red_ShippingInfo']['Shipping_StateCode'] = $this->_sanitize($shipping_address->getRegionModel()->getCode(), 'String', 2);
88
+ }
89
+ // Red_BillingInfo
90
+ if($gestpay->getRedConfigData('billing_info')) {
91
+ $billing_address = $order->getBillingAddress();
92
+ $params['Red_BillingInfo'] = array(
93
+ 'Billing_Id' => $this->_sanitize($billing_address->getEntityId(), 'Alphanumeric', 16),
94
+ 'Billing_Name' => $this->_sanitize($billing_address->getFirstname(), 'String', 30),
95
+ 'Billing_Surname' => $this->_sanitize($billing_address->getLastname(), 'String', 30),
96
+ 'Billing_DateOfBirth' => $this->_sanitize(date('Y-m-d', $order->getCustomerDob()), 'DoB'),
97
+ //'Billing_Email' => $this->_sanitize($billing_address->getEmail(), 'Email', 45),
98
+ 'Billing_Email' => 'challenge@email.com',
99
+ 'Billing_Address' => $this->_sanitize($billing_address->getStreet(-1), 'String', 30),
100
+ //'Billing_Address2' => $this->_sanitize('', 'String', 30),
101
+ 'Billing_City' => $this->_sanitize($billing_address->getCity(), 'String', 20),
102
+ 'Billing_Country' => $this->_sanitize($billing_address->getCountryModel()->getIso3Code(), 'String', 3),
103
+ 'Billing_PostalCode' => $this->_sanitize($billing_address->getPostcode(), 'Alphanumeric', 9),
104
+ 'Billing_HomePhone' => $this->_sanitize($billing_address->getTelephone(), 'Numeric', 19),
105
+ //'Billing_MobilePhone' => $this->_sanitize('', 'Numeric', 12),
106
+ //'Billing_WorkPhone' => $this->_sanitize('', 'Numeric', 19)
107
+ );
108
+ if($billing_address->getRegionId())
109
+ $params['Red_BillingInfo']['Billing_StateCode'] = $this->_sanitize($billing_address->getRegionModel()->getCode(), 'String', 2);
110
+ }
111
+ // Red_CustomerData
112
+ if($gestpay->getRedConfigData('customer_data')){
113
+ $params['Red_CustomerData'] = array(
114
+ 'MerchantWebSite' => $this->_sanitize(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB, $order->getStoreId()), 'String', 60),
115
+ //'PreviousCustomer' => 'N'
116
+ );
117
+ if($order->getRemoteIp())
118
+ $params['Red_CustomerData']['Customer_IpAddress'] = $this->_sanitize($order->getRemoteIp(), 'IP');
119
+ if($gestpay->getRedConfigData('red_merchant_id'))
120
+ $params['Red_CustomerData']['Red_Merchant_ID'] = $gestpay->getRedConfigData('red_merchant_id');
121
+ if($gestpay->getRedConfigData('red_service_type'))
122
+ $params['Red_CustomerData']['Red_ServiceType'] = $gestpay->getRedConfigData('red_service_type');
123
+ $finger_print = Mage::getModel('easynolo_bancasellapro/sales_order_fingerPrint')->getCollection()->addFieldToFilter('order_id', $order_id)->getFirstItem();
124
+ if($finger_print->getId()){
125
+ $params['Red_CustomerData']['PC_FingerPrint'] = $finger_print->getFingerPrint();
126
+ }
127
+ else{
128
+ $params['Red_CustomerData']['Red_ServiceType'] = 'N';
129
+ }
130
+ }
131
+ // Red_Items
132
+ if($gestpay->getRedConfigData('order_items')) {
133
+ $params['Red_Items'] = array(
134
+ 'NumberOfItems' => count($order->getAllItems()),
135
+ 'Red_Item' => array()
136
+ );
137
+ foreach($order->getAllItems() as $order_item) {
138
+ $params['Red_Items']['Red_Item'][] = array(
139
+ 'Item_ProductCode' => $this->_sanitize($order_item->getSku(), 'String', 12),
140
+ 'Item_Description' => $this->_sanitize($order_item->getName(), 'String', 26),
141
+ 'Item_Quantity' => (int)$order_item->getQtyOrdered(),
142
+ 'Item_InitCost' => (int)($order_item->getPrice() * 10000),
143
+ 'Item_TotalCost' => (int)($order_item->getRowTotal() * 10000)
144
+ );
145
+ }
146
+ }
147
+ }
148
+ }
app/code/community/EasyNolo/BancaSellaPro/Helper/Riskified.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class EasyNolo_BancaSellaPro_Helper_Riskified extends Mage_Core_Helper_Abstract
4
+ {
5
+
6
+ public function addOrderDetailsParams(&$params, $order_id=null){
7
+ $beaconSessionID = Mage::getSingleton("core/session")->getEncryptedSessionId();
8
+ if(!$order_id) return;
9
+ if(!$beaconSessionID) return;
10
+ $order = Mage::getModel('sales/order')->load($order_id);
11
+ if(!$order->getId()) return;
12
+
13
+ $gestpay = $order->getPayment()->getMethodInstance();
14
+
15
+ $params['OrderDetails'] = array();
16
+ $params['OrderDetails']['FraudPrevention'] = array();
17
+ $params['OrderDetails']['FraudPrevention']['SubmitForReview'] = 1;
18
+ $createdAt = $order->getCreatedAt();
19
+ $orderDate = date('Y-m-d', strtotime($createdAt));
20
+ $params['OrderDetails']['FraudPrevention']['OrderDateTime'] = $orderDate;
21
+ $params['OrderDetails']['FraudPrevention']['Source'] = 'website';
22
+ $params['OrderDetails']['FraudPrevention']['SubmissionReason'] = 'rule_decision';
23
+ $params['OrderDetails']['FraudPrevention']['BeaconSessionID'] = $beaconSessionID;
24
+
25
+ if($gestpay->getRiskifiedConfigData('customer_data')) {
26
+ $params['OrderDetails']['CustomerDetail'] = array();
27
+ $params['OrderDetails']['CustomerDetail']['FirstName'] = $order->getCustomerFirstname();
28
+ $params['OrderDetails']['CustomerDetail']['Lastname'] = $order->getCustomerLastname();
29
+ $params['OrderDetails']['CustomerDetail']['PrimaryEmail'] = $order->getCustomerEmail();
30
+ if ($order->getCustomerDob())
31
+ $params['OrderDetails']['CustomerDetail']['DateOfBirth'] = $order->getCustomerDob();
32
+ }
33
+
34
+ if($gestpay->getRiskifiedConfigData('shipping_info')) {
35
+ $shipping_address = $order->getShippingAddress();
36
+ $params['OrderDetails']['ShippingAddress'] = array();
37
+ $params['OrderDetails']['ShippingAddress']['FirstName'] = $shipping_address->getFirstname();
38
+ $params['OrderDetails']['ShippingAddress']['Lastname'] = $shipping_address->getLastname();
39
+ $params['OrderDetails']['ShippingAddress']['Email'] = $shipping_address->getEmail();
40
+ $params['OrderDetails']['ShippingAddress']['StreetName'] = $shipping_address->getStreet(-1);
41
+ $params['OrderDetails']['ShippingAddress']['City'] = $shipping_address->getCity();
42
+ $params['OrderDetails']['ShippingAddress']['CountryCode'] = $shipping_address->getCountryModel()->getIso2Code();
43
+ $params['OrderDetails']['ShippingAddress']['ZipCode'] = $shipping_address->getPostcode();
44
+ $params['OrderDetails']['ShippingAddress']['PrimaryPhone'] = $shipping_address->getTelephone();
45
+ }
46
+
47
+ if($gestpay->getRiskifiedConfigData('billing_info')) {
48
+ $billing_address = $order->getBillingAddress();
49
+ $params['OrderDetails']['BillingAddress'] = array();
50
+ $params['OrderDetails']['BillingAddress']['FirstName'] = $billing_address->getFirstname();
51
+ $params['OrderDetails']['BillingAddress']['Lastname'] = $billing_address->getLastname();
52
+ $params['OrderDetails']['BillingAddress']['Email'] = $billing_address->getEmail();
53
+ $params['OrderDetails']['BillingAddress']['StreetName'] = $billing_address->getStreet(-1);
54
+ $params['OrderDetails']['BillingAddress']['City'] = $billing_address->getCity();
55
+ $params['OrderDetails']['BillingAddress']['CountryCode'] = $billing_address->getCountryModel()->getIso2Code();
56
+ $params['OrderDetails']['BillingAddress']['ZipCode'] = $billing_address->getPostcode();
57
+ $params['OrderDetails']['BillingAddress']['PrimaryPhone'] = $billing_address->getTelephone();
58
+ }
59
+
60
+ if($gestpay->getRiskifiedConfigData('product_details')) {
61
+ $params['OrderDetails']['ArrayOfProductDetail'] = array('ProductDetail' => array());
62
+ foreach($order->getAllItems() as $order_item) {
63
+ $params['OrderDetails']['ArrayOfProductDetail']['ProductDetail'][] = array(
64
+ 'ProductCode' => $order_item->getId(),
65
+ 'Name' => $order_item->getName(),
66
+ 'SKU' => $order_item->getSku(),
67
+ 'Description' => $order_item->getDescription(),
68
+ 'Quantity' => (int)$order_item->getQtyOrdered(),
69
+ 'UnitPrice' => round($order_item->getPrice(), 2),
70
+ 'Price' => round($order_item->getRowTotal(), 2),
71
+ 'Type' => 1,
72
+ 'Vat' => $order_item->getTaxPercent().'%',
73
+ 'RequiresShipping' => true
74
+ );
75
+ }
76
+ }
77
+ }
78
+ }
app/code/community/EasyNolo/BancaSellaPro/Helper/S2s.php CHANGED
@@ -122,6 +122,21 @@ class EasyNolo_BancaSellaPro_Helper_S2s extends EasyNolo_BancaSellaPro_Helper_Ba
122
  return true;
123
  }
124
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
 
126
 
127
 
122
  return true;
123
  }
124
 
125
+ public function execute3DPaymentS2S($webService, $order, $transactionKey, $paRes)
126
+ {
127
+ $client = $this->_initClient($webService);
128
+ if(!$client){
129
+ return false;
130
+ }
131
+
132
+ $param = $webService->getParamToCall3DPaymentS2S($order, $transactionKey, $paRes);
133
+
134
+ $result = $client->callPagamS2S($param);
135
+
136
+ $webService->setResponseCallPagamS2S($result);
137
+ return $webService;
138
+ }
139
+
140
 
141
 
142
 
app/code/community/EasyNolo/BancaSellaPro/Model/Gestpay.php CHANGED
@@ -53,6 +53,36 @@ class EasyNolo_BancaSellaPro_Model_Gestpay extends Mage_Payment_Model_Method_Abs
53
  return parent::canManageRecurringProfiles() && $this->getConfigData('tokenization');
54
  }
55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  public function getCheckout()
57
  {
58
  if (empty($this->_checkout)) {
@@ -161,6 +191,15 @@ class EasyNolo_BancaSellaPro_Model_Gestpay extends Mage_Payment_Model_Method_Abs
161
  {
162
  return $this->getConfigData('language');
163
  }
 
 
 
 
 
 
 
 
 
164
 
165
  /**
166
  * Metodo che restitiusce url per il pagaemento su gestpay
@@ -225,17 +264,42 @@ class EasyNolo_BancaSellaPro_Model_Gestpay extends Mage_Payment_Model_Method_Abs
225
  return $this->getBaseUrlSella() . self::RELATIVE_IFRAME_URL;
226
  }
227
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
228
  /**
229
  * Metodo che indica se la soluzione con iframe è abilitata
230
  * @return bool true se abilitato, false altrimenti
231
  */
232
- public function isIframeEnable()
233
  {
234
  $enableIframe = $this->getConfigData('iframe');
235
  if ($enableIframe) {
236
  return true;
237
  }
238
  return false;
 
 
 
 
 
 
 
 
 
239
 
240
  }
241
 
@@ -246,7 +310,7 @@ class EasyNolo_BancaSellaPro_Model_Gestpay extends Mage_Payment_Model_Method_Abs
246
  */
247
  public function assignData($data)
248
  {
249
- if ($this->isIframeEnable()) {
250
  $children = Mage::getConfig()->getNode('modules')->children();
251
  $modulesArray = (array)$children;
252
  //controllo se ci sono dipendenze nel modulo bancasella
@@ -651,7 +715,12 @@ class EasyNolo_BancaSellaPro_Model_Gestpay extends Mage_Payment_Model_Method_Abs
651
 
652
  public function capture(Varien_Object $payment, $amount)
653
  {
654
- $helper = Mage::helper('easynolo_bancasellapro/s2s');
 
 
 
 
 
655
  $helper->capturePayment($payment, $amount);
656
  return $this;
657
  }
@@ -659,17 +728,27 @@ class EasyNolo_BancaSellaPro_Model_Gestpay extends Mage_Payment_Model_Method_Abs
659
  public function refund(Varien_Object $payment, $amount)
660
  {
661
  $helper = Mage::helper('easynolo_bancasellapro/s2s');
 
 
 
 
 
662
  $helper->refundPayment($payment, $amount);
663
  return $this;
664
  }
665
 
666
  public function void(Varien_Object $payment)
667
  {
668
- $helper = Mage::helper('easynolo_bancasellapro/s2s');
 
 
 
 
 
669
  $helper->voidPayment($payment);
670
  return $this;
671
  }
672
-
673
  /**
674
  * @param Mage_Sales_Model_Quote|null $quote
675
  * @return bool|void
@@ -690,4 +769,5 @@ class EasyNolo_BancaSellaPro_Model_Gestpay extends Mage_Payment_Model_Method_Abs
690
 
691
  return $result;
692
  }
 
693
  }
53
  return parent::canManageRecurringProfiles() && $this->getConfigData('tokenization');
54
  }
55
 
56
+ public function getRedConfigData($field, $storeId = null)
57
+ {
58
+ if (null === $storeId) {
59
+ $storeId = $this->getStore();
60
+ }
61
+ $path = 'payment/gestpaypro_red/'.$field;
62
+ return Mage::getStoreConfig($path, $storeId);
63
+ }
64
+
65
+ public function getRiskifiedConfigData($field, $storeId = null)
66
+ {
67
+ if (null === $storeId) {
68
+ $storeId = $this->getStore();
69
+ }
70
+ $path = 'payment/gestpaypro_riskified/'.$field;
71
+ return Mage::getStoreConfig($path, $storeId);
72
+ }
73
+
74
+ public function getAlternativePayments($storeId = null){
75
+ if (null === $storeId) {
76
+ $storeId = $this->getStore();
77
+ }
78
+ $ap = array();
79
+ if(Mage::getStoreConfigFlag('payment/gestpaypro_alternative_payments/enable_paypal', $storeId)) $ap[] = 'PAYPAL';
80
+ if(Mage::getStoreConfigFlag('payment/gestpaypro_alternative_payments/enable_mybank', $storeId)) $ap[] = 'MYBANK';
81
+ if(Mage::getStoreConfigFlag('payment/gestpaypro_alternative_payments/enable_ideal', $storeId)) $ap[] = 'IDEAL';
82
+ if(Mage::getStoreConfigFlag('payment/gestpaypro_alternative_payments/enable_sofort', $storeId)) $ap[] = 'SOFORT';
83
+ return $ap;
84
+ }
85
+
86
  public function getCheckout()
87
  {
88
  if (empty($this->_checkout)) {
191
  {
192
  return $this->getConfigData('language');
193
  }
194
+
195
+ /**
196
+ * Metodo che restituisce la lingua impostata nello store
197
+ * @return mixed
198
+ */
199
+ public function getUseS2sApiForSalesActions()
200
+ {
201
+ return $this->getConfigData('use_s2s_api');
202
+ }
203
 
204
  /**
205
  * Metodo che restitiusce url per il pagaemento su gestpay
264
  return $this->getBaseUrlSella() . self::RELATIVE_IFRAME_URL;
265
  }
266
 
267
+ public function isRedEnabled()
268
+ {
269
+ $enableRed = $this->getRedConfigData('enable');
270
+ if($enableRed)
271
+ return true;
272
+ return false;
273
+ }
274
+
275
+ public function isRiskifiedEnabled()
276
+ {
277
+ $enableRiskified = $this->getRiskifiedConfigData('enable');
278
+ if($enableRiskified)
279
+ return true;
280
+ return false;
281
+ }
282
+
283
  /**
284
  * Metodo che indica se la soluzione con iframe è abilitata
285
  * @return bool true se abilitato, false altrimenti
286
  */
287
+ public function isIframeEnabled()
288
  {
289
  $enableIframe = $this->getConfigData('iframe');
290
  if ($enableIframe) {
291
  return true;
292
  }
293
  return false;
294
+ }
295
+
296
+ public function isTokenizationEnabled()
297
+ {
298
+ $enableTokenization = $this->getConfigData('tokenization');
299
+ if ($enableTokenization) {
300
+ return true;
301
+ }
302
+ return false;
303
 
304
  }
305
 
310
  */
311
  public function assignData($data)
312
  {
313
+ if ($this->isIframeEnabled()) {
314
  $children = Mage::getConfig()->getNode('modules')->children();
315
  $modulesArray = (array)$children;
316
  //controllo se ci sono dipendenze nel modulo bancasella
715
 
716
  public function capture(Varien_Object $payment, $amount)
717
  {
718
+ $helper = Mage::helper('easynolo_bancasellapro/s2s');
719
+ if(!$this->getUseS2sApiForSalesActions()){
720
+ $message = $helper->__('Capture online not allowed. Check payment module configuration "Use S2S Sales API for Capture, Void, Refund actions".');
721
+ Mage::throwException($message);
722
+ }
723
+
724
  $helper->capturePayment($payment, $amount);
725
  return $this;
726
  }
728
  public function refund(Varien_Object $payment, $amount)
729
  {
730
  $helper = Mage::helper('easynolo_bancasellapro/s2s');
731
+ if(!$this->getUseS2sApiForSalesActions()){
732
+ $message = $helper->__('Refund online not allowed. Check payment module configuration "Use S2S Sales API for Capture, Void, Refund actions".');
733
+ Mage::throwException($message);
734
+ }
735
+
736
  $helper->refundPayment($payment, $amount);
737
  return $this;
738
  }
739
 
740
  public function void(Varien_Object $payment)
741
  {
742
+ $helper = Mage::helper('easynolo_bancasellapro/s2s');
743
+ if(!$this->getUseS2sApiForSalesActions()){
744
+ $message = $helper->__('Void online not allowed. Check payment module configuration "Use S2S Sales API for Capture, Void, Refund actions".');
745
+ Mage::throwException($message);
746
+ }
747
+
748
  $helper->voidPayment($payment);
749
  return $this;
750
  }
751
+
752
  /**
753
  * @param Mage_Sales_Model_Quote|null $quote
754
  * @return bool|void
769
 
770
  return $result;
771
  }
772
+
773
  }
app/code/community/EasyNolo/BancaSellaPro/Model/Observer.php CHANGED
@@ -54,4 +54,17 @@ class EasyNolo_BancaSellaPro_Model_Observer extends Mage_Core_Model_Abstract{
54
  }
55
  }
56
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  }
54
  }
55
  }
56
 
57
+ public function saveFingerPrint($event){
58
+ $order = $event->getOrder();
59
+ if($payment = Mage::app()->getRequest()->getParam('payment')) {
60
+ if($fingerPrint = $payment['blackBox']) {
61
+ $fp = Mage::getModel('easynolo_bancasellapro/sales_order_fingerPrint');
62
+ $fp->setData('order_id', $order->getId());
63
+ $fp->setData('finger_print', $fingerPrint);
64
+ $fp->save();
65
+ }
66
+ }
67
+ return $this;
68
+ }
69
+
70
  }
app/code/community/EasyNolo/BancaSellaPro/Model/Resource/Sales/Order/FingerPrint.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: maintux
5
+ * Date: 28/10/16
6
+ * Time: 16:41
7
+ */
8
+ class EasyNolo_BancaSellaPro_Model_Resource_Sales_Order_FingerPrint extends Mage_Core_Model_Resource_Db_Abstract
9
+ {
10
+
11
+ protected function _construct()
12
+ {
13
+ $this->_init('easynolo_bancasellapro/pc_finger_print', 'entity_id');
14
+ }
15
+
16
+ }
app/code/community/EasyNolo/BancaSellaPro/Model/Resource/Sales/Order/FingerPrint/Collection.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: maintux
5
+ * Date: 28/10/16
6
+ * Time: 16:47
7
+ */
8
+ class EasyNolo_BancaSellaPro_Model_Resource_Sales_Order_FingerPrint_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
9
+ {
10
+
11
+ protected function _construct()
12
+ {
13
+ $this->_init('easynolo_bancasellapro/sales_order_fingerPrint');
14
+ }
15
+
16
+ }
app/code/community/EasyNolo/BancaSellaPro/Model/Sales/Order/FingerPrint.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: Massimo Maino
5
+ * Date: 28/10/16
6
+ * Time: 16:39
7
+ */
8
+ class EasyNolo_BancaSellaPro_Model_Sales_Order_FingerPrint extends Mage_Core_Model_Abstract
9
+ {
10
+
11
+ protected function _construct()
12
+ {
13
+ $this->_init('easynolo_bancasellapro/sales_order_fingerPrint');
14
+ }
15
+
16
+ }
app/code/community/EasyNolo/BancaSellaPro/Model/System/Config/Source/FraudOrderStatus.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category EasyNolo
4
+ * @package EasyNolo_BancaSellaPro
5
+ * @author Easy Nolo <ecommerce@sella.it>
6
+ */
7
+ class EasyNolo_BancaSellaPro_Model_System_Config_Source_FraudOrderStatus extends Mage_Adminhtml_Model_System_Config_Source_Order_Status {
8
+ // set null to return all order statuses
9
+ protected $_stateStatuses = array(Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW);
10
+ }
app/code/community/EasyNolo/BancaSellaPro/Model/System/Config/Source/OrderStatus.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category EasyNolo
4
+ * @package EasyNolo_BancaSellaPro
5
+ * @author Easy Nolo <ecommerce@sella.it>
6
+ */
7
+ class EasyNolo_BancaSellaPro_Model_System_Config_Source_OrderStatus extends Mage_Adminhtml_Model_System_Config_Source_Order_Status {
8
+ // set null to return all order statuses
9
+ protected $_stateStatuses = null;
10
+ }
app/code/community/EasyNolo/BancaSellaPro/Model/System/Config/Source/TokenizationContext.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: maintux
5
+ * Date: 27/12/16
6
+ * Time: 16:15
7
+ */
8
+
9
+ class EasyNolo_BancaSellaPro_Model_System_Config_Source_TokenizationContext
10
+ {
11
+ public function toOptionArray()
12
+ {
13
+ return array(
14
+ array(
15
+ 'value' => 'always',
16
+ 'label' => Mage::helper('easynolo_bancasellapro')->__('Enable tokenization for all payments')
17
+ ),
18
+ array(
19
+ 'value' => 'recurring_profile',
20
+ 'label' => Mage::helper('easynolo_bancasellapro')->__('Enable tokenization for recurring profile')
21
+ )
22
+ );
23
+ }
24
+ }
app/code/community/EasyNolo/BancaSellaPro/Model/Token.php CHANGED
@@ -3,15 +3,13 @@
3
  * Class Token.php
4
  *
5
  * @method string getToken()
6
- * @method EasyNolo_BancaSellaPro_Model_Token setToken(string)
7
  * @method string getExpiryDate()
8
- * @method EasyNolo_BancaSellaPro_Model_Token setExpiryDate(string)
9
- * @method int getOrderId()
10
- * @method EasyNolo_BancaSellaPro_Model_Token setOrderId(int)
11
  * @method int getProfileId()
12
- * @method EasyNolo_BancaSellaPro_Model_Token setProfileId(int)
13
  * @method int getCustomerId()
14
- * @method EasyNolo_BancaSellaPro_Model_Token setCustomerId(int)
15
  *
16
  * @category EasyNolo_Bancasellapro
17
  * @package EasyNolo
@@ -26,7 +24,7 @@ class EasyNolo_BancaSellaPro_Model_Token extends Mage_Core_Model_Abstract{
26
  }
27
 
28
  /**
29
- * Set the plofile inside the model
30
  * @param Mage_Payment_Model_Recurring_Profile $profile
31
  * @return $this
32
  */
@@ -69,7 +67,7 @@ class EasyNolo_BancaSellaPro_Model_Token extends Mage_Core_Model_Abstract{
69
  }
70
 
71
  /**
72
- * Method that return a valid token for the sended profile
73
  * @param Mage_Payment_Model_Recurring_Profile $profile
74
  * @return $this
75
  */
@@ -82,7 +80,7 @@ class EasyNolo_BancaSellaPro_Model_Token extends Mage_Core_Model_Abstract{
82
  }
83
 
84
  /**
85
- * Return the first token for the sended profile
86
  * @param Mage_Payment_Model_Recurring_Profile $profile
87
  * @return $this
88
  */
3
  * Class Token.php
4
  *
5
  * @method string getToken()
6
+ * @method EasyNolo_BancaSellaPro_Model_Token setToken(string $token)
7
  * @method string getExpiryDate()
8
+ * @method EasyNolo_BancaSellaPro_Model_Token setExpiryDate(string $date)
 
 
9
  * @method int getProfileId()
10
+ * @method EasyNolo_BancaSellaPro_Model_Token setProfileId(int $profile_id)
11
  * @method int getCustomerId()
12
+ * @method EasyNolo_BancaSellaPro_Model_Token setCustomerId(int $customer_id)
13
  *
14
  * @category EasyNolo_Bancasellapro
15
  * @package EasyNolo
24
  }
25
 
26
  /**
27
+ * Set the profile inside the model
28
  * @param Mage_Payment_Model_Recurring_Profile $profile
29
  * @return $this
30
  */
67
  }
68
 
69
  /**
70
+ * Method that return a valid token for the sent profile
71
  * @param Mage_Payment_Model_Recurring_Profile $profile
72
  * @return $this
73
  */
80
  }
81
 
82
  /**
83
+ * Return the first token for the sent profile
84
  * @param Mage_Payment_Model_Recurring_Profile $profile
85
  * @return $this
86
  */
app/code/community/EasyNolo/BancaSellaPro/Model/Webservice/Wscryptdecrypt.php CHANGED
@@ -28,11 +28,40 @@ class EasyNolo_BancaSellaPro_Model_Webservice_Wscryptdecrypt extends EasyNolo_Ba
28
 
29
  if($gestpay instanceof EasyNolo_BancaSellaPro_Model_Gestpay){
30
 
31
- $this->setData('shopLogin', $gestpay->getMerchantId() );
32
- $this->setData('shopTransactionId', $order->getIncrementId() );
33
- $this->setData('uicCode', $gestpay->getCurrency() );
34
- $this->setData('languageId', $gestpay->getLanguage() );
35
- $this->setData('amount', round($total, 2) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  }
37
 
38
  }
@@ -43,51 +72,32 @@ class EasyNolo_BancaSellaPro_Model_Webservice_Wscryptdecrypt extends EasyNolo_Ba
43
  $total = $method->getTotalByOrder($quote);
44
  $orderId = $method->getFutureOrderId();
45
 
46
- $this->setData('shopLogin', $method->getMerchantId() );
47
- //se è un pagamento ricorrente e il metodo puo gestire i profili ricorrenti
48
- if(
49
- $method->canManageRecurringProfiles() &&
50
- Mage::helper('easynolo_bancasellapro/recurringprofile')->isRecurringProfile($quote)
51
- ){
52
- $recurringProfile = Mage::helper('easynolo_bancasellapro/recurringprofile')->getRecurringProfileByQuote($quote);
53
- //il primo pagamento deve essere fatto calcolando l'init amount piu il costo della trial/billing_amount
54
-
55
- if(isset($recurringProfile['trial_billing_amount']) && $recurringProfile['trial_billing_amount'] > 0){
56
- $amount = $recurringProfile['trial_billing_amount'];
57
- }else{
58
- $amount = $recurringProfile['billing_amount'];
59
- }
60
-
61
- if (isset($recurringProfile['init_amount'])){
62
- $amount += $recurringProfile['init_amount'];
63
- }
64
-
65
- if(isset($recurringProfile['shipping_amount'])){
66
- $amount+= $recurringProfile['shipping_amount'];
67
  }
68
- if(isset($recurringProfile['tax_amount'])){
69
- $amount+=$recurringProfile['tax_amount'];
70
- }
71
-
72
- $this->setData('amount', $amount);
73
-
74
- $this->setRecurringProfile(true);
75
- }else{
76
-
77
- $this->setData('amount', round($total, 2) );
78
  }
79
- $this->setData('shopTransactionId',$orderId );
80
- $this->setData('uicCode', $method->getCurrency() );
81
- $this->setData('languageId', $method->getLanguage() );
82
 
83
  }
84
 
85
-
86
  /**
87
  * metodo che restituisce i parametri per creare la stringa criptata per effettuare una richiesta di pagamento a bancasella
88
  * @return array
89
  */
90
  public function getParamToEncrypt(){
 
91
  $_helper= Mage::helper('easynolo_bancasellapro');
92
  $_helper->log('Imposto i parametri da inviare all\'encrypt');
93
 
@@ -96,16 +106,33 @@ class EasyNolo_BancaSellaPro_Model_Webservice_Wscryptdecrypt extends EasyNolo_Ba
96
  $param['shopTransactionId'] = $this->getData('shopTransactionId');
97
  $param['uicCode'] = $this->getData('uicCode');
98
 
99
- //se il pagamento è ricorrente, deve essere richiesto anche il token
100
- if($this->hasRecurringProfile() && $this->getRecurringProfile()==true){
101
- $param['requestToken'] = 'MASKEDPAN';
102
- }
103
-
104
  if($this->getData('languageId')!=0){
105
  $param['languageId'] = $this->getData('languageId');
106
  }
107
  $param['amount'] = $this->getData('amount');
108
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  $_helper->log($param);
110
 
111
  return $param;
@@ -166,7 +193,6 @@ class EasyNolo_BancaSellaPro_Model_Webservice_Wscryptdecrypt extends EasyNolo_Ba
166
  $this->setErrorCode((string)$realResult->ErrorCode);
167
  $this->setErrorDescription((string)$realResult->ErrorDescription);
168
 
169
-
170
  $this->setShopTransactionID((string)$realResult->ShopTransactionID);
171
  $this->setBankTransactionID((string)$realResult->BankTransactionID);
172
  $this->setAuthorizationCode((string)$realResult->AuthorizationCode);
@@ -191,6 +217,15 @@ class EasyNolo_BancaSellaPro_Model_Webservice_Wscryptdecrypt extends EasyNolo_Ba
191
  $this->setTokenExpiryMonth((string)$realResult->TokenExpiryMonth);
192
  $this->setTokenExpiryYear((string)$realResult->TokenExpiryYear);
193
 
 
 
 
 
 
 
 
 
 
194
  $_helper->log($this->getData());
195
 
196
  }
@@ -200,7 +235,6 @@ class EasyNolo_BancaSellaPro_Model_Webservice_Wscryptdecrypt extends EasyNolo_Ba
200
  $this->setParamB($b);
201
  }
202
 
203
-
204
  /**
205
  * Metodo per sapere in modo veloce se il pagamento è stato effettuato
206
  * @return bool true se lo stato è pagato oppure in attesa di bonifico, false altrimenti
28
 
29
  if($gestpay instanceof EasyNolo_BancaSellaPro_Model_Gestpay){
30
 
31
+ $this->setData('shopLogin', $gestpay->getMerchantId());
32
+ $this->setData('shopTransactionId', $order->getIncrementId());
33
+ $this->setData('uicCode', $gestpay->getCurrency());
34
+ $this->setData('languageId', $gestpay->getLanguage());
35
+ $this->setData('amount', round($total, 2));
36
+
37
+ if($gestpay->isRedEnabled()){
38
+ $this->setData('redEnabled', true);
39
+ $this->setData('orderId', $order->getId());
40
+ }
41
+
42
+ if($gestpay->isRiskifiedEnabled()){
43
+ $this->setData('riskifiedEnabled', true);
44
+ $this->setData('orderId', $order->getId());
45
+ }
46
+
47
+ if($gestpay->isIframeEnabled()){
48
+ $this->setData('iframeEnabled', true);
49
+ }
50
+
51
+ $this->setData('alternativePayments', $gestpay->getAlternativePayments());
52
+
53
+ if($gestpay->isTokenizationEnabled()){
54
+ $_recurringProfileHelper = Mage::helper('easynolo_bancasellapro/recurringprofile');
55
+ $this->setData('requestToken', true);
56
+ $this->setData('tokenizationContext', $gestpay->getConfigData('tokenization_context'));
57
+ if($gestpay->canManageRecurringProfiles() && $_recurringProfileHelper->isRecurringProfile($order)){
58
+ $this->setRecurringProfile(true);
59
+ $recurringProfile = $_recurringProfileHelper->getRecurringProfile($order);
60
+ $_newAmount = $_recurringProfileHelper->recalculateAmount($recurringProfile);
61
+ $this->setData('amount', round($_newAmount, 2));
62
+ }
63
+ }
64
+
65
  }
66
 
67
  }
72
  $total = $method->getTotalByOrder($quote);
73
  $orderId = $method->getFutureOrderId();
74
 
75
+ $this->setData('shopLogin', $method->getMerchantId());
76
+ $this->setData('shopTransactionId', $orderId);
77
+ $this->setData('uicCode', $method->getCurrency());
78
+ $this->setData('languageId', $method->getLanguage());
79
+ $this->setData('amount', round($total, 2));
80
+
81
+ if($method->isTokenizationEnabled()){
82
+ $_recurringProfileHelper = Mage::helper('easynolo_bancasellapro/recurringprofile');
83
+ $this->setData('requestToken', true);
84
+ $this->setData('tokenizationContext', $method->getConfigData('tokenization_context'));
85
+ if($method->canManageRecurringProfiles() && $_recurringProfileHelper->isRecurringProfile($quote)){
86
+ $this->setRecurringProfile(true);
87
+ $recurringProfile = $_recurringProfileHelper->getRecurringProfile($quote);
88
+ $_newAmount = $_recurringProfileHelper->recalculateAmount($recurringProfile);
89
+ $this->setData('amount', round($_newAmount, 2));
 
 
 
 
 
 
90
  }
 
 
 
 
 
 
 
 
 
 
91
  }
 
 
 
92
 
93
  }
94
 
 
95
  /**
96
  * metodo che restituisce i parametri per creare la stringa criptata per effettuare una richiesta di pagamento a bancasella
97
  * @return array
98
  */
99
  public function getParamToEncrypt(){
100
+
101
  $_helper= Mage::helper('easynolo_bancasellapro');
102
  $_helper->log('Imposto i parametri da inviare all\'encrypt');
103
 
106
  $param['shopTransactionId'] = $this->getData('shopTransactionId');
107
  $param['uicCode'] = $this->getData('uicCode');
108
 
 
 
 
 
 
109
  if($this->getData('languageId')!=0){
110
  $param['languageId'] = $this->getData('languageId');
111
  }
112
  $param['amount'] = $this->getData('amount');
113
 
114
+ $ap = $this->getData('alternativePayments');
115
+ if(count($ap) > 0 && !$this->getData('iframeEnabled')){
116
+ $param['paymentTypes'] = array('paymentType' => array());
117
+ $param['paymentTypes']['paymentType'][] = 'CREDITCARD';
118
+ foreach ($ap as $alternative_payment){
119
+ $param['paymentTypes']['paymentType'][] = $alternative_payment;
120
+ Mage::helper('easynolo_bancasellapro/alternativePayments_'.strtolower($alternative_payment));
121
+ }
122
+ }
123
+
124
+ if($this->getData('requestToken')) {
125
+ $param['requestToken'] = 'MASKEDPAN';
126
+ }
127
+
128
+ if($this->getData('redEnabled')){
129
+ Mage::helper('easynolo_bancasellapro/red')->addRedParams($param, $this->getData('orderId'));
130
+ }
131
+
132
+ if($this->getData('riskifiedEnabled')){
133
+ Mage::helper('easynolo_bancasellapro/riskified')->addOrderDetailsParams($param, $this->getData('orderId'));
134
+ }
135
+
136
  $_helper->log($param);
137
 
138
  return $param;
193
  $this->setErrorCode((string)$realResult->ErrorCode);
194
  $this->setErrorDescription((string)$realResult->ErrorDescription);
195
 
 
196
  $this->setShopTransactionID((string)$realResult->ShopTransactionID);
197
  $this->setBankTransactionID((string)$realResult->BankTransactionID);
198
  $this->setAuthorizationCode((string)$realResult->AuthorizationCode);
217
  $this->setTokenExpiryMonth((string)$realResult->TokenExpiryMonth);
218
  $this->setTokenExpiryYear((string)$realResult->TokenExpiryYear);
219
 
220
+ //RED
221
+ // ACCEPT, DENY, CHALLENGE, NOSCORE, ERROR, ENETFP, ETMOUT, EIVINF
222
+ $this->setRedResponseCode((string)$realResult->RedResponseCode);
223
+ $this->setRedResponseDescription((string)$realResult->RedResponseDescription);
224
+
225
+ //Riskified
226
+ $this->setRiskResponseCode((string)$realResult->RiskResponseCode);
227
+ $this->setRiskResponseDescription((string)$realResult->RiskResponseDescription);
228
+
229
  $_helper->log($this->getData());
230
 
231
  }
235
  $this->setParamB($b);
236
  }
237
 
 
238
  /**
239
  * Metodo per sapere in modo veloce se il pagamento è stato effettuato
240
  * @return bool true se lo stato è pagato oppure in attesa di bonifico, false altrimenti
app/code/community/EasyNolo/BancaSellaPro/Model/Webservice/Wss2s.php CHANGED
@@ -27,7 +27,7 @@ class EasyNolo_BancaSellaPro_Model_Webservice_Wss2s extends EasyNolo_BancaSellaP
27
  $bankId = false;
28
  $add = unserialize($payment->getAdditionalData());
29
  if($add){
30
- $bankId= $add['bank_transaction_id'];
31
  }
32
 
33
  if($gestpay instanceof EasyNolo_BancaSellaPro_Model_Gestpay){
@@ -37,7 +37,23 @@ class EasyNolo_BancaSellaPro_Model_Webservice_Wss2s extends EasyNolo_BancaSellaP
37
  $this->setData('bankTransactionId',$bankId);
38
  $this->setData('uicCode', $gestpay->getCurrency() );
39
  $this->setData('languageId', $gestpay->getLanguage() );
40
- $this->setData('amount', round($total, 2) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
 
42
  }
43
 
@@ -47,11 +63,13 @@ class EasyNolo_BancaSellaPro_Model_Webservice_Wss2s extends EasyNolo_BancaSellaP
47
  $this->setData('tokenValue',$token->getToken());
48
  }
49
 
 
50
  /**
51
  * metodo che restituisce i parametri per creare la stringa criptata per effettuare una richiesta di pagamento a bancasella
52
  * @return array
53
  */
54
  public function getParamToCallPagamS2S($amount){
 
55
  $_helper= Mage::helper('easynolo_bancasellapro');
56
  $_helper->log('Imposto i parametri da inviare all\'encrypt per effettuare il pagamento con token');
57
 
@@ -68,10 +86,47 @@ class EasyNolo_BancaSellaPro_Model_Webservice_Wss2s extends EasyNolo_BancaSellaP
68
  $param['amount'] = $amount;
69
  $param['tokenValue'] = $this->getData('tokenValue');
70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  $_helper->log($param);
72
 
73
  return $param;
74
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  public function getParamToCallCaptureS2S($amount){
76
  $_helper= Mage::helper('easynolo_bancasellapro');
77
  $_helper->log('Imposto i parametri da inviare all\'encrypt per effettuare il pagamento con token');
@@ -137,16 +192,12 @@ class EasyNolo_BancaSellaPro_Model_Webservice_Wss2s extends EasyNolo_BancaSellaP
137
  * @param $result
138
  */
139
  public function setResponseCallDeleteS2S($result){
140
-
141
  $_helper= Mage::helper('easynolo_bancasellapro');
142
  $_helper->log('Salvo i parametri decriptati');
143
 
144
  $this->_getRealResult($result,'callDeleteS2SResult');
145
-
146
-
147
-
148
-
149
  }
 
150
  protected function _getRealResult($result,$method){
151
  $_helper= Mage::helper('easynolo_bancasellapro');
152
  $_helper->log('Salvo i parametri decriptati - '.$method);
@@ -171,9 +222,9 @@ class EasyNolo_BancaSellaPro_Model_Webservice_Wss2s extends EasyNolo_BancaSellaP
171
  $this->setAlertCode((string)$realResult->AlertCode);
172
 
173
  $this->setAlertDescription((string)$realResult->AlertDescription);
174
- $this->setVbVRisp((string)$realResult->VbVRisp);
175
- $this->setVbVBuyer((string)$realResult->VbVBuyer);
176
- $this->setVbVFlag((string)$realResult->VbVFlag);
177
  $this->setTransactionKey((string)$realResult->TransactionKey);
178
  $this->setPaymentMethod((string)$realResult->PaymentMethod);
179
 
@@ -181,6 +232,16 @@ class EasyNolo_BancaSellaPro_Model_Webservice_Wss2s extends EasyNolo_BancaSellaP
181
  $this->setData('token',(string)$realResult->TOKEN);
182
  $this->setTokenExpiryMonth((string)$realResult->TokenExpiryMonth);
183
  $this->setTokenExpiryYear((string)$realResult->TokenExpiryYear);
 
 
 
 
 
 
 
 
 
 
184
  $_helper->log($this->getData());
185
  return $this;
186
  }
27
  $bankId = false;
28
  $add = unserialize($payment->getAdditionalData());
29
  if($add){
30
+ $bankId = $add['bank_transaction_id'];
31
  }
32
 
33
  if($gestpay instanceof EasyNolo_BancaSellaPro_Model_Gestpay){
37
  $this->setData('bankTransactionId',$bankId);
38
  $this->setData('uicCode', $gestpay->getCurrency() );
39
  $this->setData('languageId', $gestpay->getLanguage() );
40
+ $this->setData('amount', round($total, 2));
41
+
42
+ if($gestpay->isRedEnabled()){
43
+ $this->setData('redEnabled', true);
44
+ $this->setData('orderId', $order->getId());
45
+ }
46
+
47
+ if($gestpay->isRiskifiedEnabled()){
48
+ $this->setData('riskifiedEnabled', true);
49
+ $this->setData('orderId', $order->getId());
50
+ }
51
+
52
+ if($gestpay->isIframeEnabled()){
53
+ $this->setData('iframeEnabled', true);
54
+ }
55
+
56
+ $this->setData('alternativePayments', $gestpay->getAlternativePayments());
57
 
58
  }
59
 
63
  $this->setData('tokenValue',$token->getToken());
64
  }
65
 
66
+
67
  /**
68
  * metodo che restituisce i parametri per creare la stringa criptata per effettuare una richiesta di pagamento a bancasella
69
  * @return array
70
  */
71
  public function getParamToCallPagamS2S($amount){
72
+ if(!$amount) $amount = $this->getData('amount');
73
  $_helper= Mage::helper('easynolo_bancasellapro');
74
  $_helper->log('Imposto i parametri da inviare all\'encrypt per effettuare il pagamento con token');
75
 
86
  $param['amount'] = $amount;
87
  $param['tokenValue'] = $this->getData('tokenValue');
88
 
89
+ $ap = $this->getData('alternativePayments');
90
+ if(count($ap) > 0 && !$this->getData('iframeEnabled')){
91
+ $param['paymentTypes'] = array('paymentType' => array());
92
+ $param['paymentTypes']['paymentType'][] = 'CREDITCARD';
93
+ foreach ($ap as $alternative_payment){
94
+ $param['paymentTypes']['paymentType'][] = $alternative_payment;
95
+ Mage::helper('easynolo_bancasellapro/alternativePayments_'.strtolower($alternative_payment));
96
+ }
97
+ }
98
+
99
+ if($this->getData('redEnabled')){
100
+ Mage::helper('easynolo_bancasellapro/red')->addRedParams($param, $this->getData('orderId'));
101
+ }
102
+
103
+ if($this->getData('riskifiedEnabled')){
104
+ Mage::helper('easynolo_bancasellapro/riskified')->addOrderDetailsParams($param, $this->getData('orderId'));
105
+ }
106
+
107
+
108
  $_helper->log($param);
109
 
110
  return $param;
111
  }
112
+
113
+ public function getParamToCall3DPaymentS2S($order, $transactionKey, $paRes){
114
+ $_helper= Mage::helper('easynolo_bancasellapro');
115
+ $_helper->log('Imposto i parametri da inviare all\'encrypt per effettuare la conferma 3D');
116
+ $gestpay = $order->getPayment()->getMethodInstance();
117
+ $params = array(
118
+ "shopLogin" => $gestpay->getMerchantId(),
119
+ "uicCode" => $gestpay->getCurrency(),
120
+ "amount" => round($gestpay->getTotalByOrder($order), 2),
121
+ "shopTransactionId" => $order->getIncrementId(),
122
+ "transKey" => $transactionKey,
123
+ "PARes" => $paRes
124
+ );
125
+ $_helper->log($params);
126
+ return $params;
127
+ }
128
+
129
+
130
  public function getParamToCallCaptureS2S($amount){
131
  $_helper= Mage::helper('easynolo_bancasellapro');
132
  $_helper->log('Imposto i parametri da inviare all\'encrypt per effettuare il pagamento con token');
192
  * @param $result
193
  */
194
  public function setResponseCallDeleteS2S($result){
 
195
  $_helper= Mage::helper('easynolo_bancasellapro');
196
  $_helper->log('Salvo i parametri decriptati');
197
 
198
  $this->_getRealResult($result,'callDeleteS2SResult');
 
 
 
 
199
  }
200
+
201
  protected function _getRealResult($result,$method){
202
  $_helper= Mage::helper('easynolo_bancasellapro');
203
  $_helper->log('Salvo i parametri decriptati - '.$method);
222
  $this->setAlertCode((string)$realResult->AlertCode);
223
 
224
  $this->setAlertDescription((string)$realResult->AlertDescription);
225
+ $this->setVbVRisp((string)$realResult->VbV->VbVRisp);
226
+ $this->setVbVBuyer((string)$realResult->VbV->VbVBuyer);
227
+ $this->setVbVFlag((string)$realResult->VbV->VbVFlag);
228
  $this->setTransactionKey((string)$realResult->TransactionKey);
229
  $this->setPaymentMethod((string)$realResult->PaymentMethod);
230
 
232
  $this->setData('token',(string)$realResult->TOKEN);
233
  $this->setTokenExpiryMonth((string)$realResult->TokenExpiryMonth);
234
  $this->setTokenExpiryYear((string)$realResult->TokenExpiryYear);
235
+
236
+ //RED
237
+ // ACCEPT, DENY, CHALLENGE, NOSCORE, ERROR, ENETFP, ETMOUT, EIVINF
238
+ $this->setRedResponseCode((string)$realResult->RedResponseCode);
239
+ $this->setRedResponseDescription((string)$realResult->RedResponseDescription);
240
+
241
+ //Riskified
242
+ $this->setRiskResponseCode((string)$realResult->RiskResponseCode);
243
+ $this->setRiskResponseDescription((string)$realResult->RiskResponseDescription);
244
+
245
  $_helper->log($this->getData());
246
  return $this;
247
  }
app/code/community/EasyNolo/BancaSellaPro/_additional_structure/.DS_Store ADDED
Binary file
app/code/community/EasyNolo/BancaSellaPro/_additional_structure/app/design/frontend/base/default/layout/easynolo_bancasellapro.xml ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout>
3
+ <default>
4
+ <reference name="before_body_end">
5
+ <block type="core/template" name="gestpaypro.riskified.script.block" template="easynolo/bancasellapro/gestpay/riskified.phtml" ifconfig="payment/gestpaypro_riskified/enable" />
6
+ </reference>
7
+ </default>
8
+
9
+ <easynolo_bancasellapro_gestpay_redirect>
10
+ <label>Redirect...</label>
11
+
12
+ <block type="easynolo_bancasellapro/newroot" name="root" output="toHtml" template="easynolo/bancasellapro/page/redirect.phtml">
13
+
14
+ <block type="core/text_list" name="content" as="content" translate="label">
15
+ <label>Main Content Area</label>
16
+ <block type="easynolo_bancasellapro/redirect" name="bancasella_gestpay_redirect" template="easynolo/bancasellapro/gestpay/redirect.phtml"></block>
17
+ </block>
18
+
19
+ </block>
20
+
21
+ </easynolo_bancasellapro_gestpay_redirect>
22
+
23
+ <easynolo_bancasellapro_gestpay_success translate="label">
24
+ <label>Checkout Success</label>
25
+ <reference name="root">
26
+ <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
27
+ </reference>
28
+ <reference name="content">
29
+ <block type="checkout/onepage_success" name="checkout.success" template="checkout/success.phtml"/>
30
+ </reference>
31
+ </easynolo_bancasellapro_gestpay_success>
32
+
33
+ <easynolo_bancasellapro_gestpay_confirm3d>
34
+ <block type="easynolo_bancasellapro/newroot" name="root" output="toHtml" template="easynolo/bancasellapro/page/redirect.phtml">
35
+ <block type="core/text_list" name="content" as="content" translate="label">
36
+ <block type="easynolo_bancasellapro/confirm3d" name="bancasellagestpay_confirm"
37
+ template="easynolo/bancasellapro/gestpay/confirm3d.phtml" />
38
+ </block>
39
+ </block>
40
+
41
+ </easynolo_bancasellapro_gestpay_confirm3d>
42
+
43
+ <checkout_onepage_index>
44
+ <reference name="head">
45
+ <block type="easynolo_bancasellapro/utility_text" name="gestpay.iframe.external"/>
46
+ <action method="addJs"><script>prototype/window.js</script></action>
47
+ <action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>
48
+ <action method="addCss"><name>lib/prototype/windows/themes/magento.css</name></action>
49
+ <action method="addJs" ifconfig="payment/gestpaypro_red/enable"><script>bancasellapro/red_blackbox.js</script></action>
50
+ <action method="addJs"><script>bancasellapro/gestpayform.js</script></action>
51
+ <block type="core/text" name="paymentfont">
52
+ <action method="setText">
53
+ <text>
54
+ <![CDATA[<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/paymentfont/1.1.2/css/paymentfont.min.css">]]>
55
+ </text>
56
+ </action>
57
+ </block>
58
+ </reference>
59
+ <reference name="before_body_end">
60
+ <block type="core/text" name="gestpaypro.red.script.block">
61
+ <action method="setText" ifconfig="payment/gestpaypro_red/enable"><text><![CDATA[<script src="https://mpsnare.iesnare.com/snare.js"></script>]]></text></action>
62
+ </block>
63
+ <block type="core/template" name="gestpaypro.iframe.script.block" template="easynolo/bancasellapro/gestpay/iframe.phtml" ifconfig="payment/gestpaypro/iframe"/>
64
+ </reference>
65
+ </checkout_onepage_index>
66
+
67
+ <!--WARNING: if you use a magento version 1.6 you must to use this comment handle instead of precedent handle-->
68
+ <!--<checkout_onepage_index>-->
69
+ <!--<reference name="head">-->
70
+
71
+ <!--<block type="easynolo_bancasellapro/utility_text" name="gestpay.iframe.external"/>-->
72
+ <!--<action method="addJs"><script>prototype/window.js</script></action>-->
73
+ <!--<action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>-->
74
+ <!--<action method="addItem"><type>js_css</type><name>prototype/windows/themes/magento.css</name></action>-->
75
+ <!--<action method="addJs" ifconfig="payment/gestpaypro_red/enable"><script>bancasellapro/red_blackbox.js</script></action>-->
76
+ <!--<action method="addJs"><script>bancasellapro/gestpayform.js</script></action>-->
77
+
78
+ <!--</reference>-->
79
+ <!--</checkout_onepage_index>-->
80
+
81
+ <opc_index_index>
82
+ <reference name="head">
83
+ <block type="easynolo_bancasellapro/utility_text" name="gestpay.iframe.external"/>
84
+ <action method="addJs"><script>prototype/window.js</script></action>
85
+ <action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>
86
+ <action method="addCss"><name>lib/prototype/windows/themes/magento.css</name></action>
87
+ <action method="addItem"><type>skin_js</type><name>js/easynolo_bancasella/gestpayform_onepagecheckout.js</name></action>
88
+ <block type="core/text" name="paymentfont">
89
+ <action method="setText">
90
+ <text>
91
+ <![CDATA[<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/paymentfont/1.1.2/css/paymentfont.min.css">]]>
92
+ </text>
93
+ </action>
94
+ </block>
95
+ <reference name="before_body_end">
96
+ <block type="core/text" name="gestpaypro.red.script.block">
97
+ <action method="setText" ifconfig="payment/gestpaypro_red/enable"><text><![CDATA[<script src="https://mpsnare.iesnare.com/snare.js"></script>]]></text></action>
98
+ </block>
99
+ <block type="core/template" name="gestpaypro.iframe.script.block" template="easynolo/bancasellapro/gestpay/iframe.phtml" ifconfig="payment/gestpaypro/iframe"/>
100
+ </reference>
101
+ </reference>
102
+ </opc_index_index>
103
+
104
+ <!--WARNING: if you use a magento version 1.6 you must to use this comment handle instead of precedent handle-->
105
+ <!--<opc_index_index>-->
106
+ <!--<reference name="head">-->
107
+ <!--<block type="easynolo_bancasellapro/utility_text" name="gestpay.iframe.external"/>-->
108
+ <!--<action method="addJs"><script>prototype/window.js</script></action>-->
109
+ <!--<action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>-->
110
+ <!--<action method="addItem"><type>js_css</type><name>prototype/windows/themes/magento.css</name></action>-->
111
+ <!--<action method="addItem"><type>skin_js</type><name>js/easynolo_bancasella/gestpayform_onepagecheckout.js</name></action>-->
112
+ <!--</reference>-->
113
+ <!--</opc_index_index>-->
114
+
115
+
116
+
117
+
118
+ <easynolo_bancasellapro_tokenization_newtoken translate="label">
119
+ <label>Generate a new token</label>
120
+ <reference name="root">
121
+ <action method="setTemplate"><template>page/1column.phtml</template></action>
122
+ </reference>
123
+ <reference name="head">
124
+ <block type="easynolo_bancasellapro/utility_text" name="gestpay.iframe.external"/>
125
+ <action method="addJs"><script>bancasellapro/newtoken.js</script></action>
126
+ <action method="addJs"><script>prototype/window.js</script></action>
127
+ <action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>
128
+ <action method="addCss"><name>lib/prototype/windows/themes/magento.css</name></action>
129
+ </reference>
130
+
131
+ <reference name="content">
132
+ <block type="easynolo_bancasellapro/tokenization_newtoken" name="checkout.success" template="easynolo/bancasellapro/gestpay/newtoken.phtml"/>
133
+ </reference>
134
+
135
+ </easynolo_bancasellapro_tokenization_newtoken>
136
+
137
+ <customer_account>
138
+ <reference name="customer_account_navigation">
139
+ <action method="addLink">
140
+ <name>gestpay_token</name>
141
+ <path>easynolo_bancasellapro/tokenization</path>
142
+ <label>My saved cards</label>
143
+ </action>
144
+ </reference>
145
+ </customer_account>
146
+
147
+ <easynolo_bancasellapro_tokenization_index>
148
+ <update handle="customer_account"/>
149
+ <reference name="my.account.wrapper">
150
+ <block type="easynolo_bancasellapro/tokenization_list" name="gestpay_token" template="easynolo/bancasellapro/gestpay/token/list.phtml"/>
151
+ <block type="customer/account_dashboard" name="customer.account.link.back" template="customer/account/link/back.phtml" />
152
+ </reference>
153
+ <reference name="head">
154
+ <block type="core/text" name="paymentfont">
155
+ <action method="setText">
156
+ <text>
157
+ <![CDATA[<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/paymentfont/1.1.2/css/paymentfont.min.css">]]>
158
+ </text>
159
+ </action>
160
+ </block>
161
+ </reference>
162
+ </easynolo_bancasellapro_tokenization_index>
163
+ </layout>
app/{design → code/community/EasyNolo/BancaSellaPro/_additional_structure/app/design}/frontend/base/default/template/easynolo/bancasellapro/gestpay/confirm3d.phtml RENAMED
File without changes
app/code/community/EasyNolo/BancaSellaPro/_additional_structure/app/design/frontend/base/default/template/easynolo/bancasellapro/gestpay/form.phtml ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category EasyNolo
4
+ * @package EasyNolo_BancaSellaPro
5
+ * @author Easy Nolo <ecommerce@sella.it>
6
+ */
7
+ ?>
8
+
9
+ <?php
10
+ /* @var $this EasyNolo_BancaSellaPro_Block_Form */
11
+ /* @var $method EasyNolo_BancaSellaPro_Model_Gestpay */
12
+ $method = $this->getMethod();
13
+ $_code = $this->getMethodCode();
14
+ $merchantId = $method->getMerchantId();
15
+ ?>
16
+
17
+ <?php
18
+ try{
19
+ /** @var EasyNolo_BancaSellaPro_Helper_Crypt $helper */
20
+ $encryptString = false;
21
+
22
+ // If RED is enabled we must retrieve encrypted string after order confirmation.
23
+ if( $this->isAjaxRequest() && $this->isIframeEnabled() && !$this->isRedEnabled() && !$this->isRiskifiedEnabled()){
24
+ $helper = Mage::helper('easynolo_bancasellapro/crypt');
25
+ $encryptString = $helper->getEncryptStringBeforeOrder($method);
26
+ }
27
+ ?>
28
+
29
+ <fieldset class="form-list">
30
+ <?php if($this->isIframeEnabled()): ?>
31
+ <ul class="form-list" id="payment_iframe_<?php echo $_code ?>" style="display:none;">
32
+ <?php $hasToken = $this->showToken(); ?>
33
+ <?php if($hasToken): ?>
34
+ <?php $token_helper = Mage::helper('easynolo_bancasellapro/recurringprofile'); ?>
35
+ <li class="gestpay-tokens">
36
+ <h4><?php echo $this->__('Your saved cards'); ?></h4>
37
+ <table style="width: 50%">
38
+ <thead>
39
+ <tr>
40
+ <th>&nbsp;</th>
41
+ <th><?php echo $this->__('Card') ?></th>
42
+ <th><?php echo $this->__('Expiration') ?></th>
43
+ <th>&nbsp;</th>
44
+ </tr>
45
+ </thead>
46
+ <tbody>
47
+ <?php $i = 0; foreach ($this->getAllTokens() as $token): ?>
48
+ <tr>
49
+ <td style="text-align: center; vertical-align: middle;">
50
+ <input <?php if($i==0){ echo 'checked'; } ?> type="radio" id="hid_<?php echo $_code ?>_token" name="bancasella_iframe[token]" style="margin-right: 4px;" value="<?php echo $token->getEntityId(); ?>" autocomplete="off" />
51
+ </td>
52
+ <td style="vertical-align: middle;"><?php echo $token_helper->getFormattedToken($token->getToken()); ?></td>
53
+ <td style="vertical-align: middle;"><span class="nobr"><?php echo Mage::helper('core')->formatDate($token->getExpiryDate(), 'medium', false); ?></span></td>
54
+ <td style="text-align: center; vertical-align: middle;" class="last">
55
+ <?php $_vendor = $token_helper->getCardVendor($token->getToken()); ?>
56
+ <span title="<?php echo $_vendor['label']; ?>">
57
+ <i style="font-family: PaymentFont;font-style: normal;font-size: 25px;" class="pf-<?php echo $_vendor['id'] ?>"></i>
58
+ </span>
59
+ </td>
60
+ </tr>
61
+ <?php $i++; endforeach; ?>
62
+ <tr>
63
+ <td colspan="4">
64
+ <a href="#" data-action="switchTokenToCard"><?php echo $this->__('Use new card'); ?></a>
65
+ </td>
66
+ </tr>
67
+ </tbody>
68
+ </table>
69
+ </li>
70
+ <?php endif; ?>
71
+ <li style="<?php if($hasToken){ echo 'display: none'; } ?>" class="gestpay-form-field">
72
+ <label for="<?php echo $_code ?>_cc_number" class="<?php if(!$hasToken){ echo 'required'; } ?>"><?php echo $this->__('Credit Card Number') ?></label>
73
+ <div class="input-box">
74
+ <input <?php if($hasToken){ echo 'disabled'; } ?> type="text" id="hid_<?php echo $_code ?>_cc_number" name="bancasella_iframe[cc_number]" title="<?php echo $this->__('Credit Card Number') ?>" class="input-text <?php if(!$hasToken){ echo 'required-entry'; } ?> validate-number validate-cc-number" value="" autocomplete="off" />
75
+ </div>
76
+ </li>
77
+ <li style="<?php if($hasToken){ echo 'display: none'; } ?>" class="gestpay-form-field">
78
+ <label for="hid_<?php echo $_code ?>_cc_exp_mm" class="<?php if(!$hasToken){ echo 'required'; } ?>"><?php echo $this->__('Expiration Date') ?></label>
79
+ <div class="input-box">
80
+ <div class="v-fix">
81
+ <select <?php if($hasToken){ echo 'disabled'; } ?> id="hid_<?php echo $_code ?>_cc_exp_mm" name="bancasella_iframe[cc_exp_mm]" class="month <?php if(!$hasToken){ echo 'required-entry'; } ?>">
82
+ <?php foreach ($this->getCcMonths() as $k=>$v): ?>
83
+ <option value="<?php echo $k?$k:'' ?>"><?php echo $v ?></option>
84
+ <?php endforeach ?>
85
+ </select>
86
+ </div>
87
+ <div class="v-fix">
88
+ <select <?php if($hasToken){ echo 'disabled'; } ?> id="hid_<?php echo $_code ?>_cc_exp_yy" name="bancasella_iframe[cc_exp_yy]" class="year <?php if(!$hasToken){ echo 'required-entry'; } ?>">
89
+ <?php foreach ($this->getCcYears() as $k=>$v): ?>
90
+ <option value="<?php echo $k?$k:'' ?>"><?php echo $v ?></option>
91
+ <?php endforeach ?>
92
+ </select>
93
+ </div>
94
+ </div>
95
+ </li>
96
+ <li style="<?php if($hasToken){ echo 'display: none'; } ?>" class="gestpay-form-field">
97
+ <label for="<?php echo $_code ?>_cc_cvv" class="<?php if(!$hasToken){ echo 'required'; } ?>"><?php echo $this->__('CVV2 / 4DBC') ?></label>
98
+ <div class="input-box">
99
+ <input type="text" id="hid_<?php echo $_code ?>_cc_cvv" name="bancasella_iframe[cc_cvv]" title="<?php echo $this->__('CVV2 / 4DBC') ?>" class="input-text <?php if(!$hasToken){ echo 'required-entry'; } ?> validate-number" value="" autocomplete="off" />
100
+ </div>
101
+ </li>
102
+ <li style="<?php if($hasToken){ echo 'display: none'; } ?>" class="gestpay-form-field">
103
+ <label for="<?php echo $_code ?>_cc_name" class="<?php if(!$hasToken){ echo 'required'; } ?>"><?php echo $this->__('Name on Card') ?></label>
104
+ <div class="input-box">
105
+ <input <?php if($hasToken){ echo 'disabled'; } ?> type="text" id="hid_<?php echo $_code ?>_cc_name" name="bancasella_iframe[cc_name]" title="<?php echo $this->__('Name on Card') ?>" class="input-text <?php if(!$hasToken){ echo 'required-entry'; } ?>" value="" autocomplete="off" />
106
+ </div>
107
+ </li>
108
+ <li style="<?php if($hasToken){ echo 'display: none'; } ?>" class="gestpay-form-field">
109
+ <label for="<?php echo $_code ?>_cc_email" class="<?php if(!$hasToken){ echo 'required'; } ?>"><?php echo $this->__('Email') ?></label>
110
+ <div class="input-box">
111
+ <input <?php if($hasToken){ echo 'disabled'; } ?> type="text" id="hid_<?php echo $_code ?>_cc_email" name="bancasella_iframe[cc_email]" title="<?php echo $this->__('Email') ?>" class="input-text <?php if(!$hasToken){ echo 'required-entry'; } ?> validate-email" value="" autocomplete="off" />
112
+ </div>
113
+ </li>
114
+ </ul>
115
+ <?php else: ?>
116
+ <ul id="payment_form_<?php echo $_code ?>" style="display: none;">
117
+ <li>
118
+ <?php echo $this->__($method->getConfigData ( 'description' )) ?>
119
+ </li>
120
+ </ul>
121
+ <?php endif; ?>
122
+
123
+ <?php if($this->isIframeEnabled()): ?>
124
+ <script type="text/javascript">
125
+ //<![CDATA[
126
+ if ( typeof BancaSellaForm !== 'undefined'){
127
+
128
+ var GestPayConfig = {};
129
+ GestPayConfig.merchantId = '<?php echo $merchantId ?>';
130
+ <?php if($encryptString): ?>
131
+ GestPayConfig.stringEncrypt = '<?php echo $encryptString ?>';
132
+ <?php endif; ?>
133
+ GestPayConfig.formId = 'payment_iframe_<?php echo $_code ?>';
134
+ GestPayConfig.radioBancaSella = 'p_method_<?php echo $_code ?>';
135
+ GestPayConfig.cssSelectorInfo = '#payment_form_<?php echo $_code ?> li';
136
+ GestPayConfig.GestPayExternalClass = GestPay;
137
+ GestPayConfig.idStart = 'hid_<?php echo $_code ?>';
138
+ GestPayConfig.cssSelectorRadioPayment = '#checkout-payment-method-load input[type="radio"]';
139
+ GestPayConfig.confirmPage = '<?php echo $this->getPage3d(); ?>';
140
+ GestPayConfig.authPage = '<?php echo $this->getAuthPage(); ?>';
141
+ GestPayConfig.showHidePaymentDivId = 'opc-payment';
142
+ GestPayConfig.waitImage = '<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>';
143
+ GestPayConfig.successRedirect = '<?php echo $this->getSuccessRedirect()?>';
144
+ GestPayConfig.isRecurringProfile = '<?php echo $this->isRecurringProfile()?>';
145
+ GestPayConfig.code = '<?php echo $_code ?>';
146
+ GestPayConfig.enableRed = <?php echo $this->isRedEnabled() ? 'true' : 'false'; ?>;
147
+ GestPayConfig.enableRiskified = <?php echo $this->isRiskifiedEnabled() ? 'true' : 'false'; ?>;
148
+
149
+ GestPayConfig.enableFormToIframe = typeof BrowserEnabled !== 'undefined'? BrowserEnabled : false;
150
+
151
+ BancaSellaForm.init(GestPayConfig);
152
+
153
+ if(jQuery('a[data-action="switchTokenToCard"]').length > 0){
154
+ jQuery('a[data-action="switchTokenToCard"]').on('click', function(event){
155
+ event.preventDefault();
156
+ jQuery(this).closest('li').hide();
157
+ jQuery('.gestpay-form-field').show();
158
+ jQuery('.gestpay-form-field label').addClass('required');
159
+ jQuery('.gestpay-tokens input').prop('disabled', true);
160
+ jQuery('.gestpay-form-field input, .gestpay-form-field select').addClass('required-entry').prop('disabled', false);
161
+ })
162
+ }
163
+ }
164
+ //]]>
165
+ </script>
166
+ <?php endif; ?>
167
+ </fieldset>
168
+ <?php
169
+ }catch(Exception $e){
170
+ $_helper= Mage::helper('easynolo_bancasellapro');
171
+ $_helper->log($e->getMessage());
172
+
173
+ if($this->isRecurringProfile()){
174
+ ?>
175
+ <script type="text/javascript">
176
+ //<![CDATA[
177
+ if ( typeof BancaSellaForm !== 'undefined' ){
178
+ BancaSellaForm.code= '<?php echo $_code ?>';
179
+ BancaSellaForm.removePaymentMethod();
180
+ }
181
+ //]]>
182
+ </script>
183
+ <?php
184
+ }
185
+ }
186
+ ?>
app/{design → code/community/EasyNolo/BancaSellaPro/_additional_structure/app/design}/frontend/base/default/template/easynolo/bancasellapro/gestpay/form_onepagecheckout.phtml RENAMED
@@ -15,11 +15,11 @@
15
  <?php
16
  try{
17
  /** @var EasyNolo_BancaSellaPro_Helper_Crypt $helper */
18
- $encriptString = false;
19
 
20
- if( $this->isIframeEnable() ){
21
  $helper =Mage::helper('easynolo_bancasellapro/crypt');
22
- $encriptString = $helper->getEncryptStringBeforeOrder($method);
23
  }
24
  ?>
25
 
@@ -77,14 +77,14 @@ try{
77
  <?php echo $this->__($method->getConfigData ( 'description' )) ?>
78
  </li>
79
  </ul>
80
- <?php if($encriptString): ?>
81
  <script type="text/javascript">
82
  //<![CDATA[
83
  if ( typeof BancaSellaForm !== 'undefined'){
84
 
85
  var GestPayConfig = {};
86
  GestPayConfig.merchantId = '<?php echo $merchantId ?>';
87
- GestPayConfig.stringEnctipt = '<?php echo $encriptString ?>';
88
  GestPayConfig.formId = 'payment_iframe_<?php echo $_code ?>';
89
  GestPayConfig.radioBancaSella= 'p_method_<?php echo $_code ?>';
90
  GestPayConfig.cssSelectorInfo = '#payment_form_<?php echo $_code ?> li';
15
  <?php
16
  try{
17
  /** @var EasyNolo_BancaSellaPro_Helper_Crypt $helper */
18
+ $encryptString = false;
19
 
20
+ if( $this->isIframeEnabled() ){
21
  $helper =Mage::helper('easynolo_bancasellapro/crypt');
22
+ $encryptString = $helper->getEncryptStringBeforeOrder($method);
23
  }
24
  ?>
25
 
77
  <?php echo $this->__($method->getConfigData ( 'description' )) ?>
78
  </li>
79
  </ul>
80
+ <?php if($encryptString): ?>
81
  <script type="text/javascript">
82
  //<![CDATA[
83
  if ( typeof BancaSellaForm !== 'undefined'){
84
 
85
  var GestPayConfig = {};
86
  GestPayConfig.merchantId = '<?php echo $merchantId ?>';
87
+ GestPayConfig.stringEncrypt = '<?php echo $encryptString ?>';
88
  GestPayConfig.formId = 'payment_iframe_<?php echo $_code ?>';
89
  GestPayConfig.radioBancaSella= 'p_method_<?php echo $_code ?>';
90
  GestPayConfig.cssSelectorInfo = '#payment_form_<?php echo $_code ?> li';
app/code/community/EasyNolo/BancaSellaPro/_additional_structure/app/design/frontend/base/default/template/easynolo/bancasellapro/gestpay/iframe.phtml ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: maintux
5
+ * Date: 18/12/16
6
+ * Time: 19:13
7
+ */
8
+ ?>
9
+ <script type="text/javascript">
10
+ if (typeof Review != 'undefined') {
11
+ Review.addMethods({
12
+ nextStep: function(transport){
13
+ if (transport && transport.responseText) {
14
+ response = eval('(' + transport.responseText + ')');
15
+ if (!response.success) {
16
+ var msg = response.error_messages;
17
+ if (typeof(msg)=='object') {
18
+ msg = msg.join("\n");
19
+ }
20
+ if (msg) {
21
+ alert(msg);
22
+ }
23
+ if (response.update_section) {
24
+ $('checkout-'+response.update_section.name+'-load').update(response.update_section.html);
25
+ }
26
+ if (response.goto_section) {
27
+ checkout.gotoSection(response.goto_section);
28
+ }
29
+ }else{
30
+ this.isSuccess = true;
31
+ BancaSellaForm.redirectSuccessUrl = this.successUrl;
32
+ if(!BancaSellaForm.lock && ($(BancaSellaForm.radioBancaSella).checked)){
33
+
34
+ if (response.success) {
35
+ BancaSellaForm.redirectAfterIframe = this.successUrl;
36
+ }
37
+ if (response.redirect) {
38
+ BancaSellaForm.redirectAfterIframe = response.redirect;
39
+ }
40
+
41
+ BancaSellaForm.saveDataCC($(BancaSellaForm.formId));
42
+ //inviamo i dati della carta
43
+ BancaSellaForm.sendPaymentIframe();
44
+ }else{
45
+ if (response.redirect) {
46
+ location.href = response.redirect;
47
+ return;
48
+ }
49
+ if (response.success) {
50
+ window.location=this.successUrl;
51
+ }
52
+ }
53
+ }
54
+ }
55
+ }
56
+ });
57
+ }
58
+ </script>
app/{design → code/community/EasyNolo/BancaSellaPro/_additional_structure/app/design}/frontend/base/default/template/easynolo/bancasellapro/gestpay/newtoken.phtml RENAMED
@@ -8,10 +8,10 @@
8
  <?php
9
 
10
  /** @var EasyNolo_BancaSellaPro_Helper_Crypt $helper */
11
- $encriptString = false;
12
  //solo se il form è richimato in ajax recupero la stringa
13
- if( $method->isIframeEnable() ){
14
- $encriptString = $this->getEncryptString();
15
  }
16
  ?>
17
  <div class="fieldset" id="tokenization-form">
@@ -68,14 +68,14 @@ if( $method->isIframeEnable() ){
68
  <p class="required"><?php echo $this->__('* Required Fields'); ?></p>
69
  <button title="<?php echo $this->__('Send'); ?>" class="button" onclick="EasyNoloTokenization.sendPaymentIframe()"><span><span><?php echo $this->__('Send'); ?></span></span></button>
70
  </div>
71
- <?php if($encriptString): ?>
72
  <script type="text/javascript">
73
  //<![CDATA[
74
  if ( typeof EasyNoloTokenization !== 'undefined'){
75
 
76
  var GestPayConfig = {};
77
  GestPayConfig.merchantId = '<?php echo $merchantId ?>';
78
- GestPayConfig.stringEnctipt = '<?php echo $encriptString ?>';
79
  GestPayConfig.formId = 'tokenization-form';
80
  GestPayConfig.GestPayExternalClass = GestPay;
81
  GestPayConfig.waitImage= '<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>';
8
  <?php
9
 
10
  /** @var EasyNolo_BancaSellaPro_Helper_Crypt $helper */
11
+ $encryptString = false;
12
  //solo se il form è richimato in ajax recupero la stringa
13
+ if( $method->isIframeEnabled() ){
14
+ $encryptString = $this->getEncryptString();
15
  }
16
  ?>
17
  <div class="fieldset" id="tokenization-form">
68
  <p class="required"><?php echo $this->__('* Required Fields'); ?></p>
69
  <button title="<?php echo $this->__('Send'); ?>" class="button" onclick="EasyNoloTokenization.sendPaymentIframe()"><span><span><?php echo $this->__('Send'); ?></span></span></button>
70
  </div>
71
+ <?php if($encryptString): ?>
72
  <script type="text/javascript">
73
  //<![CDATA[
74
  if ( typeof EasyNoloTokenization !== 'undefined'){
75
 
76
  var GestPayConfig = {};
77
  GestPayConfig.merchantId = '<?php echo $merchantId ?>';
78
+ GestPayConfig.stringEncrypt = '<?php echo $encryptString ?>';
79
  GestPayConfig.formId = 'tokenization-form';
80
  GestPayConfig.GestPayExternalClass = GestPay;
81
  GestPayConfig.waitImage= '<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>';
app/{design → code/community/EasyNolo/BancaSellaPro/_additional_structure/app/design}/frontend/base/default/template/easynolo/bancasellapro/gestpay/redirect.phtml RENAMED
File without changes
app/code/community/EasyNolo/BancaSellaPro/_additional_structure/app/design/frontend/base/default/template/easynolo/bancasellapro/gestpay/riskified.phtml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: maintux
5
+ * Date: 30/12/16
6
+ * Time: 16:11
7
+ */
8
+ ?>
9
+
10
+ <script type="text/javascript">
11
+ //<![CDATA[
12
+ var riskified_store_domain = '<?php echo $_SERVER['HTTP_HOST']; ?>';
13
+ var riskified_session_id = '<?php echo Mage::getSingleton("core/session")->getEncryptedSessionId() ?>';
14
+ //]]>
15
+ </script>
16
+
17
+ <script type="text/javascript" src="<?php echo $this->getJSUrl('bancasellapro/riskified.js') ?>"></script>
app/code/community/EasyNolo/BancaSellaPro/_additional_structure/app/design/frontend/base/default/template/easynolo/bancasellapro/gestpay/token/list.phtml ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: maintux
5
+ * Date: 18/12/16
6
+ * Time: 10:58
7
+ */
8
+ ?>
9
+ <?php $helper = Mage::helper('easynolo_bancasellapro/recurringprofile'); ?>
10
+
11
+ <div class="page-title">
12
+ <h1><?php echo $this->__('My saved cards') ?></h1>
13
+ </div>
14
+
15
+ <?php echo $this->getMessagesBlock()->toHtml() ?>
16
+
17
+ <table class="data-table linearize-table-large" id="my-saved-cards-table">
18
+ <colgroup>
19
+ <col width="1">
20
+ <col width="1">
21
+ <col>
22
+ <col width="1">
23
+ <col width="1">
24
+ <col width="1">
25
+ </colgroup><thead>
26
+ <tr class="first last">
27
+ <th><?php echo $this->__('Card #') ?></th>
28
+ <th><?php echo $this->__('Vendor') ?></th>
29
+ <th><?php echo $this->__('Number') ?></th>
30
+ <th><?php echo $this->__('Expiration Date') ?></th>
31
+ <th><?php echo $this->__('Recurring Profile') ?></th>
32
+ <th><?php echo $this->__('Actions') ?></th>
33
+ </tr>
34
+ </thead>
35
+ <tbody>
36
+ <?php foreach($this->getAllTokens() as $token): ?>
37
+ <tr>
38
+ <td style="text-align: center; vertical-align: middle;"><?php echo $token->getEntityId(); ?></td>
39
+ <td style="text-align: center; vertical-align: middle;">
40
+ <?php $_vendor = $helper->getCardVendor($token->getToken()); ?>
41
+ <span title="<?php echo $_vendor['label']; ?>">
42
+ <i style="font-family: PaymentFont;font-style: normal;font-size: 25px;" class="pf-<?php echo $_vendor['id'] ?>"></i>
43
+ </span>
44
+ </td>
45
+ <td style="vertical-align: middle;"><?php echo $helper->getFormattedToken($token->getToken()); ?></td>
46
+ <td style="text-align: center; vertical-align: middle;"><span class="nobr"><?php echo $token->getExpiryDate(); ?></span></td>
47
+ <td style="text-align: center; vertical-align: middle;">
48
+ <?php if($profileId = $token->getProfileId()): ?>
49
+ <a href="<?php echo $this->getUrl('sales/recurring_profile/view/', array('profile' => $profileId)) ?>">
50
+ <?php echo $profileId; ?>
51
+ </a>
52
+ <?php else: ?>
53
+ -
54
+ <?php endif; ?>
55
+ </td>
56
+ <td style="text-align: center; vertical-align: middle;" class="last">
57
+ <?php if(!$token->getProfileId()): ?>
58
+ <a href="<?php echo $this->getUrl('bancasellapro/tokenization/delete/', array('token' => $token->getEntityId())) ?>"><?php echo $this->__('Delete'); ?></a>
59
+ <?php endif; ?>
60
+ </td>
61
+ </tr>
62
+ <?php endforeach; ?>
63
+ </tbody>
64
+ </table>
app/{design → code/community/EasyNolo/BancaSellaPro/_additional_structure/app/design}/frontend/base/default/template/easynolo/bancasellapro/page/redirect.phtml RENAMED
File without changes
app/{design → code/community/EasyNolo/BancaSellaPro/_additional_structure/app/design}/frontend/enterprise/default/layout/easynolo_bancasellapro.xml RENAMED
@@ -38,16 +38,12 @@
38
 
39
  <checkout_onepage_index>
40
  <reference name="head">
41
-
42
  <block type="easynolo_bancasellapro/utility_text" name="gestpay.iframe.external"/>
43
  <action method="addJs"><script>prototype/window.js</script></action>
44
  <action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>
45
  <action method="addCss"><name>lib/prototype/windows/themes/magento.css</name></action>
46
- </reference>
47
- <reference name="checkout.onepage">
48
- <action method="setTemplate">
49
- <template>easynolo/bancasellapro/checkout/onepage.phtml</template>
50
- </action>
51
  </reference>
52
  </checkout_onepage_index>
53
 
@@ -55,16 +51,12 @@
55
  <!--WARNING: this is a fix to magento 11.1. Comment before handle and enable this-->
56
  <!-- <checkout_onepage_index>
57
  <reference name="head">
58
-
59
  <block type="easynolo_bancasellapro/utility_text" name="gestpay.iframe.external"/>
60
  <action method="addJs"><script>prototype/window.js</script></action>
61
  <action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>
62
  <action method="addItem"><type>js_css</type><name>prototype/windows/themes/magento.css</name></action>
63
- </reference>
64
- <reference name="checkout.onepage">
65
- <action method="setTemplate">
66
- <template>easynolo/bancasellapro/checkout/onepage.phtml</template>
67
- </action>
68
  </reference>
69
  </checkout_onepage_index> -->
70
 
38
 
39
  <checkout_onepage_index>
40
  <reference name="head">
 
41
  <block type="easynolo_bancasellapro/utility_text" name="gestpay.iframe.external"/>
42
  <action method="addJs"><script>prototype/window.js</script></action>
43
  <action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>
44
  <action method="addCss"><name>lib/prototype/windows/themes/magento.css</name></action>
45
+ <action method="addJs" ifconfig="payment/gestpaypro_red/enable"><script>bancasellapro/red_blackbox.js</script></action>
46
+ <action method="addJs"><script>bancasellapro/gestpayform.js</script></action>
 
 
 
47
  </reference>
48
  </checkout_onepage_index>
49
 
51
  <!--WARNING: this is a fix to magento 11.1. Comment before handle and enable this-->
52
  <!-- <checkout_onepage_index>
53
  <reference name="head">
 
54
  <block type="easynolo_bancasellapro/utility_text" name="gestpay.iframe.external"/>
55
  <action method="addJs"><script>prototype/window.js</script></action>
56
  <action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>
57
  <action method="addItem"><type>js_css</type><name>prototype/windows/themes/magento.css</name></action>
58
+ <action method="addJs" ifconfig="payment/gestpaypro_red/enable"><script>bancasellapro/red_blackbox.js</script></action>
59
+ <action method="addJs"><script>bancasellapro/gestpayform.js</script></action>
 
 
 
60
  </reference>
61
  </checkout_onepage_index> -->
62
 
app/{etc → code/community/EasyNolo/BancaSellaPro/_additional_structure/app/etc}/modules/EasyNolo_BancaSellaPro.xml RENAMED
File without changes
app/{etc → code/community/EasyNolo/BancaSellaPro/_additional_structure/app/etc}/modules/EasyNolo_BancaSellaPro.xml.Onepage.txt RENAMED
File without changes
app/code/community/EasyNolo/BancaSellaPro/_additional_structure/app/locale/en_US/EasyNolo_BancaSellaPro.csv ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Checkout","Checkout"
2
+ "Edit","Edit"
3
+ "You will be redirected to the payment system website in a few seconds.","You will be redirected to the payment system website in a few seconds."
4
+ "You will be redirected to Banca Sella in a few seconds.","You will be redirected to Banca Sella in a few seconds."
5
+ "You are redirecting to issuing bank for 3d authentification","You are redirecting to issuing bank for 3d authentification"
6
+ "Credit Card Data","Credit Card Data"
7
+ "Credit Card Number","Credit Card Number"
8
+ "Expiration Date","Expiration Date"
9
+ "Year","Year"
10
+ "Month","Month"
11
+ "CVV2 / 4DBC","CVV2 / 4DBC"
12
+ "Name on Card","Name on Card"
13
+ "Email","Email"
14
+ "* Required Fields","* Required Fields"
15
+ "Send","Send"
16
+ "You are redirecting to Banca Sella for completion of payment","You are redirecting to Banca Sella for completion of payment"
17
+ "Click <a href=""%s"">here</a> if you are not redirected within 10 seconds...","Click <a href=""%s"">here</a> if you are not redirected within 10 seconds..."
18
+ "Payment has been declined. Please try again.","Payment has been declined. Please try again."
19
+ "Unable to set Payment Method.","Unable to set Payment Method."
20
+ "Failed to update the profile.","Failed to update the profile."
21
+ "Specified profile does not exist.","Specified profile does not exist."
22
+ "Successfully retrieved a new payment token","Successfully retrieved a new payment token"
23
+ "Unable to retrieve a new payment token","Unable to retrieve a new payment token"
24
+ "There was an error processing your order. Please contact us or try again later.","There was an error processing your order. Please contact us or try again later."
25
+ "Payment transaction not authorized: %s.","Payment transaction not authorized: %s."
26
+ "You are waiting the completion of payment",""
27
+ "Please wait...","Please wait..."
28
+ "Payment authorization error","Payment authorization error"
29
+ "Complete payment on Banca Sella website","Complete payment on Banca Sella website"
30
+ "Send Credit Card Data","Send Credit Card Data"
31
+ "Please correct the highlighted fields","Please correct the highlighted fields"
32
+ "3D secure","3D secure"
app/code/community/EasyNolo/BancaSellaPro/_additional_structure/app/locale/it_IT/EasyNolo_BancaSellaPro.csv ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Checkout","Checkout"
2
+ "Edit","Modifica"
3
+ "You will be redirected to the payment system website in a few seconds.","Sarai reindirizzato sul sito web di Banca Sella in pochi secondi."
4
+ "You will be redirected to Banca Sella in a few seconds.","Sarai reindirizzato sul sito web di Banca Sella in pochi secondi."
5
+ "You are redirecting to issuing bank for 3d authentification","Ti stiamo reindirizzando al sito della banca per la verifica del 3D Secure"
6
+ "Credit Card Data","Dati della Carta di Credito"
7
+ "Credit Card Number","Numero della carta"
8
+ "Expiration Date","Data di scadenza"
9
+ "Year","Anno"
10
+ "Month","Mese"
11
+ "CVV2 / 4DBC","CVV2 / 4DBC"
12
+ "Name on Card","Nome sulla carta"
13
+ "Email","Email"
14
+ "* Required Fields","* Campi obbligatori"
15
+ "Send","Invia"
16
+ "You are redirecting to Banca Sella for completion of payment","Sarai reindirizzato sul sito web di Banca Sella per completare il pagamento"
17
+ "Click <a href=""%s"">here</a> if you are not redirected within 10 seconds...","Clicca <a href=""%s"">qui</a> se non vieni reindirizzato entro 10 secondi..."
18
+ "Payment has been declined. Please try again.","Il pagamento è stato rifiutato. Riprova."
19
+ "Unable to set Payment Method.","Impossibile impostare il metodo di pagamento."
20
+ "Failed to update the profile.","Si è verificato un errore durante l'aggiornamento del profilo."
21
+ "Specified profile does not exist.","Il profilo selezionato non esiste."
22
+ "Successfully retrieved a new payment token","Richiesta di aggiornamento del token effettuata con successo"
23
+ "Unable to retrieve a new payment token","Richiesta di aggiornamento del token non effettuata"
24
+ "There was an error processing your order. Please contact us or try again later.","Si è verificato un errore nel processo di pagamento. Riprova più tardi."
25
+ "Payment transaction not authorized: %s.","Transazione di pagamento negata: %s."
26
+ "Please wait...","Attendere prego..."
27
+ "Payment authorization error","Si è verificato un problema nell'autorizzazione del pagamento"
28
+ "Complete payment on Banca Sella website","Continua il pagamento sul sito di Banca Sella"
29
+ "Send Credit Card Data","Invia i dati della carta di credito"
30
+ "Please correct the highlighted fields","Per favore correggi i campi evidenziati"
31
+ "3D secure","3D secure"
{js → app/code/community/EasyNolo/BancaSellaPro/_additional_structure/js}/bancasellapro/gestpayform.js RENAMED
@@ -1,31 +1,33 @@
1
  if (typeof BancaSellaForm == 'undefined') {
2
 
3
  var BancaSellaForm = {
4
- formId : false,
5
- merchantId : false,
6
- stringEnctipt : false,
7
- radioBancaSella : false,
8
- cssSelectorInfo : false,
9
- GestPayExternalClass : false,
10
- enable : false,
11
- idStart : false,
12
- cssSelectorRadioPayment : false,
13
- redirectSuccessUrl : false,
14
- redirectAfterIframe : false,
15
- confirmPage : false,
16
- authPage : false,
17
- dialogCC : false,
18
  lock: false,
19
- modal3d : false,
20
- successRedirect : false,
21
- code:null,
22
- enableFormToIframe:false,
23
- isRecurringProfile:false,
 
 
24
 
25
  init : function (config){
26
  this.formId = config.formId;
27
  this.merchantId = config.merchantId;
28
- this.stringEnctipt = config.stringEnctipt;
29
  this.radioBancaSella = config.radioBancaSella;
30
  this.cssSelectorInfo = config.cssSelectorInfo;
31
  this.idStart = config.idStart;
@@ -36,9 +38,11 @@ if (typeof BancaSellaForm == 'undefined') {
36
  this.waitImage = config.waitImage;
37
  this.GestPayExternalClass = config.GestPayExternalClass;
38
  this.successRedirect = config.successRedirect;
39
- this.enableFormToIframe= config.enableFormToIframe;
40
- this.code= config.code;
41
- this.isRecurringProfile= config.isRecurringProfile;
 
 
42
 
43
  if(!this.enableFormToIframe && this.isRecurringProfile){
44
  this.removePaymentMethod();
@@ -48,32 +52,30 @@ if (typeof BancaSellaForm == 'undefined') {
48
  $(this.showHidePaymentDivId).down('.step-title').on('click', this.checkClickPayment.bind(this));
49
  }
50
  },
 
51
  start : function(){
52
  if(!this.lock){
53
 
54
- this.showWait();
55
- this.GestPayExternalClass.CreatePaymentPage( this.merchantId, this.stringEnctipt, this.paymentPageLoad);
56
-
57
  $$(this.cssSelectorRadioPayment).each(
58
  function(item){
59
  Event.observe(item, 'click', BancaSellaForm.togglePaymentForm);
60
  }
61
  );
62
  //aggiorniamo lo stato del form al caricamento del pagamento
63
- payment.addAfterInitFunction('update-get-pay-form',BancaSellaForm.togglePaymentForm);
64
 
65
  //aggiungiamo la validazione del form con i dati della carta nello step di pagamento
66
  // e la rimozione del form per non far inviare i dati
67
- payment.addBeforeValidateFunction('before-validate-gest-pay',function(){
68
  if(!BancaSellaForm.lock){
69
  if(BancaSellaForm.enable){
70
  var validator = new Validation($(BancaSellaForm.formId ));
71
  if (!validator.validate())
72
  return false;
73
- var form =$(BancaSellaForm.formId );
74
- BancaSellaForm.realForm=form;
75
  Form.getElements(form).each(function (input){
76
- input.disabled=true;
77
  });
78
  }
79
  }
@@ -88,27 +90,31 @@ if (typeof BancaSellaForm == 'undefined') {
88
  if(BancaSellaForm.enable
89
  && $(BancaSellaForm.showHidePaymentDivId).hasClassName('allow')) {
90
  Form.getElements($(BancaSellaForm.formId )).each(function (input){
91
- if(input.hasAttribute('disabled') && input.readAttribute('disable') != false ){
92
- BancaSellaForm.enableInputs();
93
- return;
94
  }
95
  });
96
  }
97
  },
 
98
  toggleStatusForm : function (isEnable){
99
  if(isEnable){
100
  this.lock = false;
101
  this.enable = false;
102
  this.togglePaymentForm();
103
  //nascondo il messaggio del redirect dopo la conferma ordine
104
- $$(this.cssSelectorInfo).first().hide();
 
105
  }else{
106
  this.disableForm();
107
  //mostro il messaggio del redirect dopo la conferma ordine
108
- $$(this.cssSelectorInfo).first().show();
 
109
  this.lock = true;
110
  }
111
  },
 
112
  toggleForm: function (){
113
  if(!this.lock){
114
  if(this.enable && this.formId){
@@ -119,33 +125,31 @@ if (typeof BancaSellaForm == 'undefined') {
119
  }
120
  }
121
  },
 
122
  enableForm : function (){
123
  if(!this.lock){
124
  if(!this.enable ){
125
  $(this.formId).show();
126
- Form.enable( $(this.formId));
127
  this.enable = true;
128
  }
129
  return true;
130
  }
131
  return false;
132
  },
 
133
  disableForm : function(){
134
  if(!this.lock){
135
  if(this.enable ){
136
  $(this.formId).hide();
137
- Form.disable( $(this.formId));
138
  this.enable = false;
139
  }
140
  return true;
141
  }
142
  return false;
143
  },
144
- enableInputs : function (){
145
- Form.getElements($(BancaSellaForm.formId )).each(function (input){
146
- input.disabled=false;
147
- });
148
- },
149
  debugInputForm : function (){
150
  var obj ={
151
  CC : $F($(this.idStart+'_cc_number')),
@@ -166,6 +170,7 @@ if (typeof BancaSellaForm == 'undefined') {
166
  }
167
  return false;
168
  },
 
169
  paymentPageLoad : function( Result ){
170
  BancaSellaForm.hideWait();
171
  if(Result.ErrorCode != 10){
@@ -174,24 +179,67 @@ if (typeof BancaSellaForm == 'undefined') {
174
  BancaSellaForm.toggleStatusForm(true);
175
  }
176
  },
 
177
  sendPaymentIframe : function (){
178
  BancaSellaForm.showWait();
179
- BancaSellaForm.GestPayExternalClass.SendPayment ({
180
- CC : BancaSellaForm.ccData.cc,
181
- EXPMM : BancaSellaForm.ccData.expmm,
182
- EXPYY : BancaSellaForm.ccData.expyy,
183
- CVV2 : BancaSellaForm.ccData.cvv2,
184
- Name: BancaSellaForm.ccData.name,
185
- Email: BancaSellaForm.ccData.email
186
- },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
  function ( Result ) {
188
  BancaSellaForm.hideWait();
189
- BancaSellaForm.analizeResponse.delay(0.8,Result);
190
  }
191
  );
192
- return true;
193
  },
194
- analizeResponse : function(Result){
 
195
 
196
  if (Result.ErrorCode != 0){
197
  if (Result.ErrorCode == 8006){
@@ -234,25 +282,28 @@ if (typeof BancaSellaForm == 'undefined') {
234
  BancaSellaForm.showModalDialogCC(idErrorInput, Result.ErrorDescription);
235
  return false;
236
  }
237
- }else{
238
  //pagamento effettuato con successo oppure l'utente ha annullato il 3dsecure;
239
  url = BancaSellaForm.successRedirect + '?a='+ BancaSellaForm.merchantId + '&b='+ Result.EncryptedString;
240
  location.href = url;
241
  return;
242
  }
243
  },
 
244
  call3dSecure : function (TransKey, VBVRisp){
245
  BancaSellaForm.transKey=TransKey;
246
  var a = this.merchantId;
247
  var b = VBVRisp;
248
- var c= BancaSellaForm.confirmPage;
249
  var definitiveUrl = BancaSellaForm.authPage+'?a='+a+'&b='+b+'&c='+c ;
250
  BancaSellaForm.showModal(definitiveUrl);
251
  },
 
252
  redirectPaymentPage : function (){
253
  setLocation(BancaSellaForm.successRedirect);
254
  return;
255
  },
 
256
  showModal : function (url)
257
  {
258
  this.modal3d = new Window(
@@ -273,6 +324,7 @@ if (typeof BancaSellaForm == 'undefined') {
273
  this.modal3d.setZIndex(1000);
274
  this.modal3d.showCenter(true);
275
  },
 
276
  //chiamata dall'iframe e non in questa pagina
277
  sendPares : function (pares){
278
  this.modal3d.close();
@@ -283,11 +335,12 @@ if (typeof BancaSellaForm == 'undefined') {
283
  },
284
  function ( Result ) {
285
  BancaSellaForm.hideWait();
286
- BancaSellaForm.analizeResponse.delay(0.8,Result);
287
  }
288
  );
289
  return false;
290
  },
 
291
  showModalDialogCC : function( id, message ){
292
  var form = BancaSellaForm.realForm;
293
 
@@ -323,6 +376,7 @@ if (typeof BancaSellaForm == 'undefined') {
323
  alert(message);
324
  // BancaSellaForm.openAlert(message);
325
  },
 
326
  openAlert : function (message){
327
  Dialog.alert(message,
328
  { className:'magento', width:280, height:100, okLabel: "ok",
@@ -330,6 +384,7 @@ if (typeof BancaSellaForm == 'undefined') {
330
  }
331
  );
332
  },
 
333
  showWait : function(){
334
  Dialog.info('<img src="'+BancaSellaForm.waitImage+'" class="v-middle" />'+ Translator.translate('Please wait...'),
335
  { className:'magento',
@@ -339,20 +394,25 @@ if (typeof BancaSellaForm == 'undefined') {
339
  }
340
  );
341
  },
 
342
  hideWait: function(){
343
  Dialog.closeInfo();
344
  },
345
- saveDataCC :function (form){
346
- BancaSellaForm.ccData=[];
347
- BancaSellaForm.ccData.cc = $F(form.getElementsBySelector('#'+BancaSellaForm.idStart+'_cc_number').first());
348
- BancaSellaForm.ccData.expmm = $F(form.getElementsBySelector('#'+BancaSellaForm.idStart+'_cc_exp_mm').first());
349
- BancaSellaForm.ccData.expyy = $F(form.getElementsBySelector('#'+BancaSellaForm.idStart+'_cc_exp_yy').first());
350
- BancaSellaForm.ccData.cvv2 = $F(form.getElementsBySelector('#'+BancaSellaForm.idStart+'_cc_cvv').first());
351
- BancaSellaForm.ccData.name = $F(form.getElementsBySelector('#'+BancaSellaForm.idStart+'_cc_name').first());
352
- BancaSellaForm.ccData.email = $F(form.getElementsBySelector('#'+BancaSellaForm.idStart+'_cc_email').first());
 
 
 
353
  return true;
354
  },
355
- populateForm:function(form,id,enable){
 
356
  Form.getElements(form).each(function (input){
357
  input.disabled=enable;
358
  if(input.id == id){
@@ -396,12 +456,14 @@ if (typeof BancaSellaForm == 'undefined') {
396
  }
397
  });
398
  },
 
399
  checkAndCloseDialogCC : function(){
400
  if(BancaSellaForm.dialogCC){
401
  Windows.close('dialogcc');
402
  BancaSellaForm.dialogCC=false;
403
  }
404
  },
 
405
  removePaymentMethod : function(){
406
  if(this.formId){
407
  $(this.formId).hide();
@@ -411,54 +473,4 @@ if (typeof BancaSellaForm == 'undefined') {
411
  $paymentForm.up().up().hide();
412
  }
413
  };
414
- }
415
-
416
- if (typeof Review != 'undefined') {
417
- Review.addMethods({
418
- nextStep: function(transport){
419
- if (transport && transport.responseText) {
420
- response = eval('(' + transport.responseText + ')');
421
-
422
- if (!response.success) {
423
- var msg = response.error_messages;
424
- if (typeof(msg)=='object') {
425
- msg = msg.join("\n");
426
- }
427
- if (msg) {
428
- alert(msg);
429
- }
430
- if (response.update_section) {
431
- $('checkout-'+response.update_section.name+'-load').update(response.update_section.html);
432
- }
433
- if (response.goto_section) {
434
- checkout.gotoSection(response.goto_section);
435
- }
436
- }else{
437
- this.isSuccess = true;
438
- BancaSellaForm.redirectSuccessUrl = this.successUrl;
439
- if(!BancaSellaForm.lock && ($(BancaSellaForm.radioBancaSella).checked)){
440
-
441
- if (response.success) {
442
- BancaSellaForm.redirectAfterIframe = this.successUrl;
443
- }
444
- if (response.redirect) {
445
- BancaSellaForm.redirectAfterIframe = response.redirect;
446
- }
447
-
448
- BancaSellaForm.saveDataCC(BancaSellaForm.realForm);
449
- //inviamo i dati della carta
450
- BancaSellaForm.sendPaymentIframe();
451
- }else{
452
- if (response.redirect) {
453
- location.href = response.redirect;
454
- return;
455
- }
456
- if (response.success) {
457
- window.location=this.successUrl;
458
- }
459
- }
460
- }
461
- }
462
- }
463
- });
464
  }
1
  if (typeof BancaSellaForm == 'undefined') {
2
 
3
  var BancaSellaForm = {
4
+ formId: false,
5
+ merchantId: false,
6
+ stringEncrypt: false,
7
+ radioBancaSella: false,
8
+ cssSelectorInfo: false,
9
+ GestPayExternalClass: false,
10
+ enable: false,
11
+ idStart: false,
12
+ cssSelectorRadioPayment: false,
13
+ redirectSuccessUrl: false,
14
+ redirectAfterIframe: false,
15
+ confirmPage: false,
16
+ authPage: false,
17
+ dialogCC: false,
18
  lock: false,
19
+ modal3d: false,
20
+ successRedirect: false,
21
+ code: null,
22
+ enableFormToIframe: false,
23
+ isRecurringProfile: false,
24
+ enableRed: false,
25
+ enableRiskified: false,
26
 
27
  init : function (config){
28
  this.formId = config.formId;
29
  this.merchantId = config.merchantId;
30
+ this.stringEncrypt = config.stringEncrypt;
31
  this.radioBancaSella = config.radioBancaSella;
32
  this.cssSelectorInfo = config.cssSelectorInfo;
33
  this.idStart = config.idStart;
38
  this.waitImage = config.waitImage;
39
  this.GestPayExternalClass = config.GestPayExternalClass;
40
  this.successRedirect = config.successRedirect;
41
+ this.enableFormToIframe = config.enableFormToIframe;
42
+ this.code = config.code;
43
+ this.isRecurringProfile = config.isRecurringProfile;
44
+ this.enableRed = config.enableRed;
45
+ this.enableRiskified = config.enableRiskified;
46
 
47
  if(!this.enableFormToIframe && this.isRecurringProfile){
48
  this.removePaymentMethod();
52
  $(this.showHidePaymentDivId).down('.step-title').on('click', this.checkClickPayment.bind(this));
53
  }
54
  },
55
+
56
  start : function(){
57
  if(!this.lock){
58
 
 
 
 
59
  $$(this.cssSelectorRadioPayment).each(
60
  function(item){
61
  Event.observe(item, 'click', BancaSellaForm.togglePaymentForm);
62
  }
63
  );
64
  //aggiorniamo lo stato del form al caricamento del pagamento
65
+ payment.addAfterInitFunction('update-get-pay-form', BancaSellaForm.togglePaymentForm);
66
 
67
  //aggiungiamo la validazione del form con i dati della carta nello step di pagamento
68
  // e la rimozione del form per non far inviare i dati
69
+ payment.addBeforeValidateFunction('before-validate-gest-pay', function(){
70
  if(!BancaSellaForm.lock){
71
  if(BancaSellaForm.enable){
72
  var validator = new Validation($(BancaSellaForm.formId ));
73
  if (!validator.validate())
74
  return false;
75
+ var form = $(BancaSellaForm.formId);
76
+ BancaSellaForm.realForm = form;
77
  Form.getElements(form).each(function (input){
78
+ jQuery(input).prop('disabled', true);
79
  });
80
  }
81
  }
90
  if(BancaSellaForm.enable
91
  && $(BancaSellaForm.showHidePaymentDivId).hasClassName('allow')) {
92
  Form.getElements($(BancaSellaForm.formId )).each(function (input){
93
+ var $input = jQuery(input);
94
+ if($input.is(':visible') && $input.prop('disabled')){
95
+ $input.prop('disabled', false);
96
  }
97
  });
98
  }
99
  },
100
+
101
  toggleStatusForm : function (isEnable){
102
  if(isEnable){
103
  this.lock = false;
104
  this.enable = false;
105
  this.togglePaymentForm();
106
  //nascondo il messaggio del redirect dopo la conferma ordine
107
+ if($$(this.cssSelectorInfo).first())
108
+ $$(this.cssSelectorInfo).first().hide();
109
  }else{
110
  this.disableForm();
111
  //mostro il messaggio del redirect dopo la conferma ordine
112
+ if($$(this.cssSelectorInfo).first())
113
+ $$(this.cssSelectorInfo).first().show();
114
  this.lock = true;
115
  }
116
  },
117
+
118
  toggleForm: function (){
119
  if(!this.lock){
120
  if(this.enable && this.formId){
125
  }
126
  }
127
  },
128
+
129
  enableForm : function (){
130
  if(!this.lock){
131
  if(!this.enable ){
132
  $(this.formId).show();
133
+ Form.enable($(this.formId));
134
  this.enable = true;
135
  }
136
  return true;
137
  }
138
  return false;
139
  },
140
+
141
  disableForm : function(){
142
  if(!this.lock){
143
  if(this.enable ){
144
  $(this.formId).hide();
145
+ Form.disable($(this.formId));
146
  this.enable = false;
147
  }
148
  return true;
149
  }
150
  return false;
151
  },
152
+
 
 
 
 
153
  debugInputForm : function (){
154
  var obj ={
155
  CC : $F($(this.idStart+'_cc_number')),
170
  }
171
  return false;
172
  },
173
+
174
  paymentPageLoad : function( Result ){
175
  BancaSellaForm.hideWait();
176
  if(Result.ErrorCode != 10){
179
  BancaSellaForm.toggleStatusForm(true);
180
  }
181
  },
182
+
183
  sendPaymentIframe : function (){
184
  BancaSellaForm.showWait();
185
+ this.showWait();
186
+ var that = this;
187
+ if(BancaSellaForm.ccData.cc != "") {
188
+ if (this.enableRed || this.enableRiskified) {
189
+ // Get new EncryptedString
190
+ new Ajax.Request('/bancasellapro/gestpay/getEncryptedString',
191
+ {
192
+ onSuccess: function (t) {
193
+ that.stringEncrypt = t.responseJSON.b;
194
+ that.GestPayExternalClass.CreatePaymentPage(that.merchantId, that.stringEncrypt, function (Result) {
195
+ that.paymentPageLoad(Result);
196
+ that._sendPaymentIframe();
197
+ });
198
+ }
199
+ }
200
+ );
201
+ }
202
+ else {
203
+ this.GestPayExternalClass.CreatePaymentPage(this.merchantId, this.stringEncrypt, function (Result) {
204
+ that.paymentPageLoad(Result);
205
+ that._sendPaymentIframe();
206
+ });
207
+ }
208
+ }
209
+ else {
210
+ if(BancaSellaForm.ccData.token) {
211
+ this._sendPaymentWithToken();
212
+ }
213
+ else {
214
+ alert("Invalid data");
215
+ BancaSellaForm.hideWait();
216
+ }
217
+ }
218
+ return true;
219
+ },
220
+
221
+ _sendPaymentWithToken: function(){
222
+ document.location.href = '/bancasellapro/tokenization/payUsingToken/token/'+BancaSellaForm.ccData.token;
223
+ },
224
+
225
+ _sendPaymentIframe: function(){
226
+ var params = {
227
+ CC: BancaSellaForm.ccData.cc,
228
+ EXPMM: BancaSellaForm.ccData.expmm,
229
+ EXPYY: BancaSellaForm.ccData.expyy,
230
+ CVV2: BancaSellaForm.ccData.cvv2,
231
+ Name: BancaSellaForm.ccData.name,
232
+ Email: BancaSellaForm.ccData.email
233
+ }
234
+ BancaSellaForm.GestPayExternalClass.SendPayment(params,
235
  function ( Result ) {
236
  BancaSellaForm.hideWait();
237
+ BancaSellaForm.analyzeResponse.delay(0.8,Result);
238
  }
239
  );
 
240
  },
241
+
242
+ analyzeResponse : function(Result){
243
 
244
  if (Result.ErrorCode != 0){
245
  if (Result.ErrorCode == 8006){
282
  BancaSellaForm.showModalDialogCC(idErrorInput, Result.ErrorDescription);
283
  return false;
284
  }
285
+ } else {
286
  //pagamento effettuato con successo oppure l'utente ha annullato il 3dsecure;
287
  url = BancaSellaForm.successRedirect + '?a='+ BancaSellaForm.merchantId + '&b='+ Result.EncryptedString;
288
  location.href = url;
289
  return;
290
  }
291
  },
292
+
293
  call3dSecure : function (TransKey, VBVRisp){
294
  BancaSellaForm.transKey=TransKey;
295
  var a = this.merchantId;
296
  var b = VBVRisp;
297
+ var c = BancaSellaForm.confirmPage;
298
  var definitiveUrl = BancaSellaForm.authPage+'?a='+a+'&b='+b+'&c='+c ;
299
  BancaSellaForm.showModal(definitiveUrl);
300
  },
301
+
302
  redirectPaymentPage : function (){
303
  setLocation(BancaSellaForm.successRedirect);
304
  return;
305
  },
306
+
307
  showModal : function (url)
308
  {
309
  this.modal3d = new Window(
324
  this.modal3d.setZIndex(1000);
325
  this.modal3d.showCenter(true);
326
  },
327
+
328
  //chiamata dall'iframe e non in questa pagina
329
  sendPares : function (pares){
330
  this.modal3d.close();
335
  },
336
  function ( Result ) {
337
  BancaSellaForm.hideWait();
338
+ BancaSellaForm.analyzeResponse.delay(0.8,Result);
339
  }
340
  );
341
  return false;
342
  },
343
+
344
  showModalDialogCC : function( id, message ){
345
  var form = BancaSellaForm.realForm;
346
 
376
  alert(message);
377
  // BancaSellaForm.openAlert(message);
378
  },
379
+
380
  openAlert : function (message){
381
  Dialog.alert(message,
382
  { className:'magento', width:280, height:100, okLabel: "ok",
384
  }
385
  );
386
  },
387
+
388
  showWait : function(){
389
  Dialog.info('<img src="'+BancaSellaForm.waitImage+'" class="v-middle" />'+ Translator.translate('Please wait...'),
390
  { className:'magento',
394
  }
395
  );
396
  },
397
+
398
  hideWait: function(){
399
  Dialog.closeInfo();
400
  },
401
+
402
+ saveDataCC: function (form){
403
+ form = jQuery(form);
404
+ BancaSellaForm.ccData = {};
405
+ BancaSellaForm.ccData.token = form.find("[name='bancasella_iframe[token]']:checked").val();
406
+ BancaSellaForm.ccData.cc = form.find("[name='bancasella_iframe[cc_number]']").val();
407
+ BancaSellaForm.ccData.expmm = form.find("[name='bancasella_iframe[cc_exp_mm]']").val();
408
+ BancaSellaForm.ccData.expyy = form.find("[name='bancasella_iframe[cc_exp_yy]']").val();
409
+ BancaSellaForm.ccData.cvv2 = form.find("[name='bancasella_iframe[cc_cvv]']").val();
410
+ BancaSellaForm.ccData.name = form.find("[name='bancasella_iframe[cc_name]']").val();
411
+ BancaSellaForm.ccData.email = form.find("[name='bancasella_iframe[cc_email]']").val();
412
  return true;
413
  },
414
+
415
+ populateForm: function(form,id,enable){
416
  Form.getElements(form).each(function (input){
417
  input.disabled=enable;
418
  if(input.id == id){
456
  }
457
  });
458
  },
459
+
460
  checkAndCloseDialogCC : function(){
461
  if(BancaSellaForm.dialogCC){
462
  Windows.close('dialogcc');
463
  BancaSellaForm.dialogCC=false;
464
  }
465
  },
466
+
467
  removePaymentMethod : function(){
468
  if(this.formId){
469
  $(this.formId).hide();
473
  $paymentForm.up().up().hide();
474
  }
475
  };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
476
  }
{js → app/code/community/EasyNolo/BancaSellaPro/_additional_structure/js}/bancasellapro/gestpayform_onepagecheckout.js RENAMED
@@ -3,7 +3,7 @@ if (typeof(BancaSellaForm) == 'undefined') {
3
  var BancaSellaForm = {
4
  formId : false,
5
  merchantId : false,
6
- stringEnctipt : false,
7
  radioBancaSella : false,
8
  cssSelectorInfo : false,
9
  GestPayExternalClass : false,
@@ -26,7 +26,7 @@ if (typeof(BancaSellaForm) == 'undefined') {
26
  init : function (config){
27
  this.formId = config.formId;
28
  this.merchantId = config.merchantId;
29
- this.stringEnctipt = config.stringEnctipt;
30
  this.radioBancaSella = config.radioBancaSella;
31
  this.cssSelectorInfo = config.cssSelectorInfo;
32
  this.idStart = config.idStart;
@@ -413,10 +413,10 @@ if (typeof(BancaSellaForm) == 'undefined') {
413
  IWD.OPC.Checkout.showLoader();
414
  IWD.OPC.Checkout.lockPlaceOrder();
415
  if(callSendOrder){
416
- BancaSellaForm.GestPayExternalClass.CreatePaymentPage( BancaSellaForm.merchantId, BancaSellaForm.stringEnctipt, BancaSellaForm.paymentPageLoadToOrder);
417
  }
418
  else{
419
- BancaSellaForm.GestPayExternalClass.CreatePaymentPage( BancaSellaForm.merchantId, BancaSellaForm.stringEnctipt, BancaSellaForm.paymentPageLoad);
420
  }
421
  }
422
  };
@@ -559,7 +559,7 @@ if(typeof IWD.OPC != 'undefined'){
559
  IWD.OPC.Checkout.showLoader();
560
  }
561
  //aggiorno la stringa
562
- BancaSellaForm.stringEnctipt = response.encrypt_string;
563
 
564
  BancaSellaForm.createPagePaymentToOrder(IWD.OPC.saveOrderStatus===true);
565
 
3
  var BancaSellaForm = {
4
  formId : false,
5
  merchantId : false,
6
+ stringEncrypt : false,
7
  radioBancaSella : false,
8
  cssSelectorInfo : false,
9
  GestPayExternalClass : false,
26
  init : function (config){
27
  this.formId = config.formId;
28
  this.merchantId = config.merchantId;
29
+ this.stringEncrypt = config.stringEncrypt;
30
  this.radioBancaSella = config.radioBancaSella;
31
  this.cssSelectorInfo = config.cssSelectorInfo;
32
  this.idStart = config.idStart;
413
  IWD.OPC.Checkout.showLoader();
414
  IWD.OPC.Checkout.lockPlaceOrder();
415
  if(callSendOrder){
416
+ BancaSellaForm.GestPayExternalClass.CreatePaymentPage( BancaSellaForm.merchantId, BancaSellaForm.stringEncrypt, BancaSellaForm.paymentPageLoadToOrder);
417
  }
418
  else{
419
+ BancaSellaForm.GestPayExternalClass.CreatePaymentPage( BancaSellaForm.merchantId, BancaSellaForm.stringEncrypt, BancaSellaForm.paymentPageLoad);
420
  }
421
  }
422
  };
559
  IWD.OPC.Checkout.showLoader();
560
  }
561
  //aggiorno la stringa
562
+ BancaSellaForm.stringEncrypt = response.encrypt_string;
563
 
564
  BancaSellaForm.createPagePaymentToOrder(IWD.OPC.saveOrderStatus===true);
565
 
{js → app/code/community/EasyNolo/BancaSellaPro/_additional_structure/js}/bancasellapro/newtoken.js RENAMED
@@ -6,7 +6,7 @@ if (typeof EasyNoloTokenization == 'undefined') {
6
 
7
  this.formId = config.formId;
8
  this.merchantId = config.merchantId;
9
- this.stringEnctipt = config.stringEnctipt;
10
  this.waitImage = config.waitImage;
11
  this.GestPayExternalClass = config.GestPayExternalClass;
12
  this.successRedirect = config.successRedirect;
@@ -22,7 +22,7 @@ if (typeof EasyNoloTokenization == 'undefined') {
22
  },
23
  start : function(){
24
  this.showWait();
25
- this.GestPayExternalClass.CreatePaymentPage( this.merchantId, this.stringEnctipt, this.paymentPageLoad);
26
  },
27
  paymentPageLoad : function( Result ){
28
  EasyNoloTokenization.hideWait();
6
 
7
  this.formId = config.formId;
8
  this.merchantId = config.merchantId;
9
+ this.stringEncrypt = config.stringEncrypt;
10
  this.waitImage = config.waitImage;
11
  this.GestPayExternalClass = config.GestPayExternalClass;
12
  this.successRedirect = config.successRedirect;
22
  },
23
  start : function(){
24
  this.showWait();
25
+ this.GestPayExternalClass.CreatePaymentPage( this.merchantId, this.stringEncrypt, this.paymentPageLoad);
26
  },
27
  paymentPageLoad : function( Result ){
28
  EasyNoloTokenization.hideWait();
app/code/community/EasyNolo/BancaSellaPro/_additional_structure/js/bancasellapro/red_blackbox.js ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Created by Massimo Maino on 31/10/16.
3
+ */
4
+ // basic configurations must be on page before snare.js
5
+ window.io_install_stm = false, // do not install Active X
6
+ window.io_exclude_stm = 12, // do not run Active X
7
+ window.io_install_flash = false, // do not install Flash
8
+ window.io_enable_rip = true; // collect Real IP information
9
+
10
+ function io_bb_callback(blackBoxString, isComplete) {
11
+ if ( isComplete ) {
12
+ var element;
13
+ if(elemnt = document.getElementById('blackBox')){
14
+ element.value = blackBoxString;
15
+ }
16
+ else{
17
+ var div = document.createElement('div');
18
+ div.setAttribute('id', 'payment_form_gestpaypro_before');
19
+ var input = document.createElement('input');
20
+ input.setAttribute('type', 'hidden');
21
+ input.setAttribute('id', 'blackBox');
22
+ input.setAttribute('name', 'payment[blackBox]');
23
+ input.setAttribute('value', blackBoxString);
24
+ div.appendChild(input);
25
+ document.getElementById('co-payment-form').appendChild(div);
26
+ }
27
+ }
28
+ };
app/code/community/EasyNolo/BancaSellaPro/_additional_structure/js/bancasellapro/riskified.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function() {
2
+ function riskifiedBeaconLoad() {
3
+ var url = ('https:' == document.location.protocol ? 'https://' : 'http://')
4
+ + "beacon.riskified.com?shop=" + riskified_store_domain + "&sid=" + riskified_session_id;
5
+ var s = document.createElement('script');
6
+ s.type = 'text/javascript';
7
+ s.async = true;
8
+ s.src = url;
9
+ var x = document.getElementsByTagName('script')[0];
10
+ x.parentNode.insertBefore(s, x);
11
+ }
12
+ if (window.attachEvent)
13
+ window.attachEvent('onload', riskifiedBeaconLoad)
14
+ else
15
+ window.addEventListener('load', riskifiedBeaconLoad, false);
16
+ })();
app/code/community/EasyNolo/BancaSellaPro/_additional_structure/skin/.DS_Store ADDED
Binary file
app/code/community/EasyNolo/BancaSellaPro/_additional_structure/skin/adminhtml/.DS_Store ADDED
Binary file
app/code/community/EasyNolo/BancaSellaPro/_additional_structure/skin/adminhtml/default/.DS_Store ADDED
Binary file
app/code/community/EasyNolo/BancaSellaPro/_additional_structure/skin/adminhtml/default/default/.DS_Store ADDED
Binary file
app/code/community/EasyNolo/BancaSellaPro/_additional_structure/skin/adminhtml/default/default/images/.DS_Store ADDED
Binary file
app/code/community/EasyNolo/BancaSellaPro/_additional_structure/skin/adminhtml/default/default/images/bancasellapro/gestpay.png ADDED
Binary file
app/code/community/EasyNolo/BancaSellaPro/_additional_structure/skin/adminhtml/default/default/images/bancasellapro/red.png ADDED
Binary file
app/code/community/EasyNolo/BancaSellaPro/_additional_structure/skin/adminhtml/default/default/images/bancasellapro/riskified.png ADDED
Binary file
{skin → app/code/community/EasyNolo/BancaSellaPro/_additional_structure/skin}/frontend/base/default/images/easynolo_bancasella/wait.gif RENAMED
File without changes
app/code/community/EasyNolo/BancaSellaPro/_additional_structure/skin/frontend/base/default/js/easynolo_bancasella/gestpayform_onepagecheckout.js ADDED
@@ -0,0 +1,591 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if (typeof(BancaSellaForm) == 'undefined') {
2
+
3
+ var BancaSellaForm = {
4
+ formId : false,
5
+ merchantId : false,
6
+ stringEncrypt : false,
7
+ radioBancaSella : false,
8
+ cssSelectorInfo : false,
9
+ GestPayExternalClass : false,
10
+ enable : false,
11
+ idStart : false,
12
+ cssSelectorRadioPayment : false,
13
+ redirectSuccessUrl : false,
14
+ redirectAfterIframe : false,
15
+ confirmPage : false,
16
+ authPage : false,
17
+ dialogCC : false,
18
+ lock: false,
19
+ modal3d : false,
20
+ successRedirect : false,
21
+ initalized : false,
22
+ code:null,
23
+ enableFormToIframe:false,
24
+ isRecurringProfile:false,
25
+
26
+ init : function (config){
27
+ this.formId = config.formId;
28
+ this.merchantId = config.merchantId;
29
+ this.stringEncrypt = config.stringEncrypt;
30
+ this.radioBancaSella = config.radioBancaSella;
31
+ this.cssSelectorInfo = config.cssSelectorInfo;
32
+ this.idStart = config.idStart;
33
+ this.cssSelectorRadioPayment = config.cssSelectorRadioPayment;
34
+ this.showHidePaymentDivId = config.showHidePaymentDivId;
35
+ this.confirmPage = config.confirmPage;
36
+ this.authPage = config.authPage;
37
+ this.waitImage = config.waitImage;
38
+ this.GestPayExternalClass = config.GestPayExternalClass;
39
+ this.successRedirect = config.successRedirect;
40
+
41
+ this.enableFormToIframe= config.enableFormToIframe;
42
+ this.code= config.code;
43
+ this.isRecurringProfile= config.isRecurringProfile;
44
+
45
+ if(!this.enableFormToIframe && this.isRecurringProfile){
46
+ this.removePaymentMethod();
47
+ return;
48
+ }
49
+
50
+ document.observe("payment-method:switched", function(event) {
51
+ if(event.memo.method_code == "gestpaypro"){
52
+ if(!BancaSellaForm.initalized){
53
+ BancaSellaForm.start();
54
+ }
55
+ BancaSellaForm.toggleStatusForm(true);
56
+ }else{
57
+ BancaSellaForm.disableForm();
58
+ }
59
+ });
60
+
61
+ },
62
+ start : function(){
63
+ if(!this.lock){
64
+ this.showWait();
65
+ BancaSellaForm.initalized = true;
66
+ BancaSellaForm.createPagePaymentToOrder(false);
67
+
68
+ $$(this.cssSelectorRadioPayment).each(
69
+ function(item){
70
+ Event.observe(item, 'click', BancaSellaForm.togglePaymentForm);
71
+ }
72
+ );
73
+ //aggiorniamo lo stato del form al caricamento del pagamento
74
+ payment.addAfterInitFunction('update-get-pay-form',BancaSellaForm.togglePaymentForm);
75
+
76
+ //aggiungiamo i dati dell form ad una variabile interna per l'invio dei dati
77
+ payment.addBeforeValidateFunction('before-validate-gest-pay',function(){
78
+ if(!BancaSellaForm.lock){
79
+ if(BancaSellaForm.enable){
80
+ var form =$(BancaSellaForm.formId );
81
+ BancaSellaForm.realForm=form;
82
+ return;
83
+ }
84
+ }
85
+ BancaSellaForm.realForm = null;
86
+ });
87
+ }
88
+ },
89
+ toggleStatusForm : function (isEnable){
90
+ if(isEnable){
91
+ this.lock = false;
92
+ this.enable = false;
93
+ this.togglePaymentForm();
94
+ //nascondo il messaggio del redirect dopo la conferma ordine
95
+ $$(this.cssSelectorInfo).first().hide();
96
+ }else{
97
+ this.disableForm();
98
+ //mostro il messaggio del redirect dopo la conferma ordine
99
+ $$(this.cssSelectorInfo).first().show();
100
+ this.lock = true;
101
+ }
102
+ },
103
+ toggleForm: function (){
104
+ if(!this.lock){
105
+ if(this.enable && this.formId){
106
+ this.disableForm();
107
+ }
108
+ else{
109
+ this.enableForm();
110
+ }
111
+ }
112
+ },
113
+ enableForm : function (){
114
+ if(!this.lock){
115
+ $(this.formId).show();
116
+ Form.enable( $(this.formId));
117
+ this.enable = true;
118
+ return true;
119
+ }
120
+ return false;
121
+ },
122
+ disableForm : function(){
123
+ if(this.enable ){
124
+ $(this.formId).hide();
125
+ Form.disable( $(this.formId));
126
+ this.enable = false;
127
+ return true;
128
+ }
129
+ return false;
130
+ },
131
+ togglePaymentForm : function (){
132
+ if($(BancaSellaForm.radioBancaSella).checked){
133
+ BancaSellaForm.enableForm();
134
+ }else{
135
+ BancaSellaForm.disableForm();
136
+ }
137
+ return false;
138
+ },
139
+ paymentPageLoad : function( Result ){
140
+ if(Result.ErrorCode != 10){
141
+ //l'iframe non è stato creato
142
+ if(!this.enableFormToIframe && this.isRecurringProfile){
143
+ //se il pagamento era per un profilo ricorrente allora rimuovo la form
144
+ BancaSellaForm.removePaymentMethod();
145
+ return;
146
+ }else{
147
+ BancaSellaForm.toggleStatusForm(false);
148
+ }
149
+ }else{
150
+ BancaSellaForm.toggleStatusForm(true);
151
+ }
152
+ BancaSellaForm.hideWait();
153
+ BancaSellaForm.unlockPlaceOrder();
154
+ },
155
+ paymentPageLoadToOrder : function( Result ){
156
+ if(Result.ErrorCode != 10){
157
+ if(!BancaSellaForm.enableFormToIframe && BancaSellaForm.isRecurringProfile){
158
+ //se il pagamento era per un profilo ricorrente allora rimuovo la form
159
+ BancaSellaForm.removePaymentMethod();
160
+ return;
161
+ }else{
162
+ BancaSellaForm.toggleStatusForm(false);
163
+ }
164
+ }else{
165
+ BancaSellaForm.toggleStatusForm(true);
166
+ IWD.OPC.saveOrder();
167
+ IWD.OPC.Plugin.dispatch('savePaymentAfter');
168
+ }
169
+ BancaSellaForm.hideWait();
170
+ },
171
+ paymentPageLoadToSaveOrder : function( Result ){
172
+
173
+ BancaSellaForm.paymentPageLoad(Result);
174
+ IWD.OPC.saveOrder();
175
+
176
+ },
177
+ sendPaymentIframe : function (){
178
+ BancaSellaForm.showWait();
179
+ BancaSellaForm.GestPayExternalClass.SendPayment ({
180
+ CC : BancaSellaForm.ccData.cc,
181
+ EXPMM : BancaSellaForm.ccData.expmm,
182
+ EXPYY : BancaSellaForm.ccData.expyy,
183
+ CVV2 : BancaSellaForm.ccData.cvv2,
184
+ Name: BancaSellaForm.ccData.name,
185
+ Email: BancaSellaForm.ccData.email
186
+ },
187
+ function ( Result ) {
188
+ BancaSellaForm.hideWait();
189
+ BancaSellaForm.analizeResponse.delay(0.8,Result);
190
+ }
191
+ );
192
+ return true;
193
+ },
194
+ analizeResponse : function(Result){
195
+ if (Result.ErrorCode != 0){
196
+ if (Result.ErrorCode == 8006){
197
+ //3D Transaction
198
+ var TransKey = Result.TransKey;
199
+ var VBVRisp = Result.VBVRisp;
200
+ BancaSellaForm.call3dSecure ( TransKey, VBVRisp );
201
+ }else{
202
+
203
+ var idErrorInput = '';
204
+ if(Result.ErrorCode == 1119 || Result.ErrorCode == 1120){
205
+ idErrorInput= BancaSellaForm.idStart+'_cc_number';
206
+ }else
207
+ if(Result.ErrorCode == 1124 || Result.ErrorCode == 1126){
208
+ idErrorInput= BancaSellaForm.idStart+'_cc_exp_mm'
209
+ } else
210
+ if(Result.ErrorCode == 1125){
211
+ idErrorInput= BancaSellaForm.idStart+'_cc_exp_yy'
212
+ }else
213
+ if(Result.ErrorCode == 1149){
214
+ idErrorInput= BancaSellaForm.idStart+'_cc_cvv'
215
+ }else
216
+ {
217
+ //altri errori, uno dei possibili 4707
218
+ Dialog.alert(Result.ErrorDescription,
219
+ {
220
+ className:'magento',
221
+ width:300,
222
+ height:90,
223
+ zIndex:1000,
224
+ okLabel: Translator.translate('Complete payment on Banca Sella website'),
225
+ buttonClass: "scalable",
226
+ id: "alertRedirect",
227
+ title: Translator.translate('Payment authorization error'),
228
+ onOk: BancaSellaForm.redirectPaymentPage
229
+ }
230
+ );
231
+ return false;
232
+ }
233
+ BancaSellaForm.showModalDialogCC(idErrorInput, Result.ErrorDescription);
234
+ return false;
235
+ }
236
+ }else{
237
+ //pagamento effettuato con successo oppure l'utente ha annullato il 3dsecure;
238
+ setLocation(BancaSellaForm.successRedirect + '?a='+ BancaSellaForm.merchantId + '&b='+ Result.EncryptedString);
239
+ return;
240
+ }
241
+ },
242
+ call3dSecure : function (TransKey, VBVRisp){
243
+ BancaSellaForm.transKey=TransKey;
244
+ var a = this.merchantId;
245
+ var b = VBVRisp;
246
+ var c= BancaSellaForm.confirmPage;
247
+ var definitiveUrl = BancaSellaForm.authPage+'?a='+a+'&b='+b+'&c='+c ;
248
+ BancaSellaForm.showModal(definitiveUrl);
249
+ },
250
+ redirectPaymentPage : function (){
251
+ if(BancaSellaForm.isRecurringProfile){
252
+ //il pagamento ricorrente non puo essere effettuato su bancasella
253
+ setLocation(BancaSellaForm.redirectAfterIframe);
254
+ }else{
255
+ setLocation(BancaSellaForm.successRedirect);
256
+ }
257
+ return;
258
+ },
259
+ showModal : function (url)
260
+ {
261
+ this.modal3d = new Window(
262
+ {
263
+ className:'magento',
264
+ id:'gestpay_window',
265
+ title:Translator.translate('3D secure'),
266
+ url:url,
267
+ width:400,
268
+ height:400,
269
+ zIndex:1000,
270
+ minimizable: false,
271
+ maximizable : false,
272
+ closable:false,
273
+ destroyOnClose:true,
274
+ recenterAuto:true
275
+ });
276
+ this.modal3d.setZIndex(1000);
277
+ this.modal3d.showCenter(true);
278
+ },
279
+ //chiamata dall'iframe e non in questa pagina
280
+ sendPares : function (pares){
281
+ this.modal3d.close();
282
+ BancaSellaForm.showWait.delay(0.8);
283
+ this.GestPayExternalClass.SendPayment ({
284
+ PARes : pares ,
285
+ TransKey : BancaSellaForm.transKey
286
+ },
287
+ function ( Result ) {
288
+ BancaSellaForm.hideWait();
289
+ BancaSellaForm.analizeResponse.delay(0.8,Result);
290
+ }
291
+ );
292
+ return false;
293
+ },
294
+ showModalDialogCC : function( id, message ){
295
+ var form = BancaSellaForm.realForm;
296
+
297
+ BancaSellaForm.populateForm(form,id,false);
298
+
299
+ BancaSellaForm.checkAndCloseDialogCC();
300
+
301
+ if (!BancaSellaForm.dialogCC){
302
+
303
+ BancaSellaForm.dialogCC = Dialog.alert('<div id="modal-form"><ul class="form-list">'+form.innerHTML+'</ul></div>',
304
+ {
305
+ className:'magento',
306
+ closeOnEsc:false,
307
+ width:300,
308
+ height:400,
309
+ zIndex:1000,
310
+ okLabel: Translator.translate('Send Credit Card Data'),
311
+ buttonClass: "scalable",
312
+ id: "dialogcc",
313
+ title: Translator.translate('Please correct the highlighted fields'),
314
+ onOk: function (){
315
+ var validator = new Validation($('modal-form'));
316
+ if (!validator.validate())
317
+ return false;
318
+ BancaSellaForm.saveDataCC($('modal-form'));
319
+ BancaSellaForm.sendPaymentIframe.delay(0.8);
320
+ return true;
321
+ }
322
+ }
323
+ );
324
+ }
325
+ alert(message);
326
+ },
327
+ showWait : function(){
328
+ IWD.OPC.Checkout.showLoader();
329
+ IWD.OPC.Checkout.lockPlaceOrder();
330
+ },
331
+ hideWait: function(){
332
+ IWD.OPC.Checkout.hideLoader();
333
+ IWD.OPC.Checkout.unlockPlaceOrder();
334
+ },
335
+ lockPlaceOrder: function(){
336
+ IWD.OPC.Checkout.lockPlaceOrder();
337
+ },
338
+ unlockPlaceOrder: function(){
339
+ IWD.OPC.Checkout.unlockPlaceOrder();
340
+ },
341
+ saveDataCC :function (form){
342
+ BancaSellaForm.ccData=[];
343
+ BancaSellaForm.ccData.cc = $F(form.getElementsBySelector('#'+BancaSellaForm.idStart+'_cc_number').first());
344
+ BancaSellaForm.ccData.expmm = $F(form.getElementsBySelector('#'+BancaSellaForm.idStart+'_cc_exp_mm').first());
345
+ BancaSellaForm.ccData.expyy = $F(form.getElementsBySelector('#'+BancaSellaForm.idStart+'_cc_exp_yy').first());
346
+ BancaSellaForm.ccData.cvv2 = $F(form.getElementsBySelector('#'+BancaSellaForm.idStart+'_cc_cvv').first());
347
+ BancaSellaForm.ccData.name = $F(form.getElementsBySelector('#'+BancaSellaForm.idStart+'_cc_name').first());
348
+ BancaSellaForm.ccData.email = $F(form.getElementsBySelector('#'+BancaSellaForm.idStart+'_cc_email').first());
349
+ return true;
350
+ },
351
+ populateForm:function(form,id,enable){
352
+ Form.getElements(form).each(function (input){
353
+ input.disabled=enable;
354
+ if(input.id == id){
355
+ input.addClassName('validation-failed');
356
+ }else {
357
+ input.removeClassName('validation-failed');
358
+ }
359
+ switch (input.id){
360
+ case BancaSellaForm.idStart+'_cc_number':
361
+ input.setAttribute('value',BancaSellaForm.ccData.cc);
362
+ break;
363
+ case BancaSellaForm.idStart+'_cc_exp_mm':
364
+ options = input.childElements();
365
+ len = options.length;
366
+ for (var i = 0; i < len; i++) {
367
+ if(options[i].value == BancaSellaForm.ccData.expmm){
368
+ options[i].setAttribute('selected',true);
369
+ }
370
+ }
371
+ break;
372
+ case BancaSellaForm.idStart+'_cc_exp_yy':
373
+ options = input.childElements();
374
+ len = options.length;
375
+ for (var i = 0; i < len; i++) {
376
+ if(options[i].value == BancaSellaForm.ccData.expyy){
377
+ options[i].setAttribute('selected',true);
378
+ }
379
+ }
380
+ break;
381
+ case BancaSellaForm.idStart+'_cc_cvv':
382
+ input.setAttribute('value',BancaSellaForm.ccData.cvv2);
383
+ break;
384
+ case BancaSellaForm.idStart+'_cc_name':
385
+ input.setAttribute('value',BancaSellaForm.ccData.name);
386
+ break;
387
+ case BancaSellaForm.idStart+'_cc_email':
388
+ input.setAttribute('value',BancaSellaForm.ccData.email);
389
+ break;
390
+ default :
391
+ console.log('non ho trovato '+ input.id);
392
+ }
393
+ });
394
+ },
395
+ checkAndCloseDialogCC : function(){
396
+ if(BancaSellaForm.dialogCC){
397
+ Windows.close('dialogcc');
398
+ BancaSellaForm.dialogCC=false;
399
+ }
400
+ },
401
+ removePaymentMethod : function(){
402
+ $(this.formId).hide();
403
+ var $paymentForm = $('p_method_' + this.code);
404
+ $paymentForm.setAttribute('disabled','disabled');
405
+ $paymentForm.up('dt').hide();
406
+ },
407
+ createPagePaymentToOrder: function (callSendOrder){
408
+ IWD.OPC.Checkout.showLoader();
409
+ IWD.OPC.Checkout.lockPlaceOrder();
410
+ if(callSendOrder){
411
+ BancaSellaForm.GestPayExternalClass.CreatePaymentPage( BancaSellaForm.merchantId, BancaSellaForm.stringEncrypt, BancaSellaForm.paymentPageLoadToOrder);
412
+ }
413
+ else{
414
+ BancaSellaForm.GestPayExternalClass.CreatePaymentPage( BancaSellaForm.merchantId, BancaSellaForm.stringEncrypt, BancaSellaForm.paymentPageLoad);
415
+ }
416
+ }
417
+ };
418
+ }
419
+
420
+ // define jquery
421
+ if(typeof($j_opc) == 'undefined' || $j_opc == undefined || !$j_opc){
422
+ $j_opc = false;
423
+
424
+ if(typeof($ji) != 'undefined' && $ji != undefined && $ji)
425
+ $j_opc = $ji; // from iwd_all 2.x
426
+ else{
427
+ if(typeof($j) != 'undefined' && $j != undefined && $j)
428
+ $j_opc = $j; // from default magento 1.9
429
+ else{
430
+ if(typeof(jQuery) != 'undefined' && jQuery != undefined && jQuery)
431
+ $j_opc = jQuery;
432
+ }
433
+ }
434
+ }
435
+
436
+ if(typeof IWD.OPC != 'undefined'){
437
+
438
+ IWD.OPC.prepareOrderResponse = function (response){
439
+ IWD.OPC.Checkout.xhr = null;
440
+ if (typeof(response.error) != "undefined" && response.error!=false){
441
+ IWD.OPC.Checkout.hideLoader();
442
+ IWD.OPC.Checkout.unlockPlaceOrder();
443
+ IWD.OPC.saveOrderStatus = false;
444
+ $j_opc('.opc-message-container').html(response.error);
445
+ $j_opc('.opc-message-wrapper').show();
446
+ IWD.OPC.Plugin.dispatch('error');
447
+ return;
448
+ }
449
+
450
+ if (typeof(response.error_messages) != "undefined" && response.error_messages!=false){
451
+ IWD.OPC.Checkout.hideLoader();
452
+ IWD.OPC.Checkout.unlockPlaceOrder();
453
+
454
+ IWD.OPC.saveOrderStatus = false;
455
+ $j_opc('.opc-message-container').html(response.error_messages);
456
+ $j_opc('.opc-message-wrapper').show();
457
+ IWD.OPC.Plugin.dispatch('error');
458
+ return;
459
+ }
460
+
461
+
462
+
463
+ if (typeof(response.update_section) != "undefined"){
464
+ IWD.OPC.Checkout.hideLoader();
465
+ IWD.OPC.Checkout.unlockPlaceOrder();
466
+
467
+ //create catch for default logic - for not spam errors to console
468
+ try{
469
+ $j_opc('#checkout-' + response.update_section.name + '-load').html(response.update_section.html);
470
+ }catch(e){
471
+
472
+ }
473
+ IWD.OPC.prepareExtendPaymentForm();
474
+ $j_opc('#payflow-advanced-iframe').show();
475
+ $j_opc('#payflow-link-iframe').show();
476
+ $j_opc('#hss-iframe').show();
477
+ }
478
+
479
+ if(!BancaSellaForm.lock && ($(BancaSellaForm.radioBancaSella).checked)){
480
+ IWD.OPC.prepareExtendPaymentForm();
481
+ $j_opc('.opc-col-right').find('h3').first().text(Translator.translate('Please wait...'));
482
+ $j_opc('#opc-review-block').html('<div><p>'+Translator.translate('You are waiting the completion of payment')+'</p></div>');
483
+
484
+ if (response.redirect) {
485
+ BancaSellaForm.redirectAfterIframe = response.redirect;
486
+ }
487
+
488
+ BancaSellaForm.saveDataCC(BancaSellaForm.realForm);
489
+ //inviamo i dati della carta
490
+ BancaSellaForm.sendPaymentIframe();
491
+ }else{
492
+ if (typeof(response.redirect) !="undefined"){
493
+ if (response.redirect!==false){
494
+ setLocation(response.redirect);
495
+ return;
496
+ }
497
+ }
498
+ }
499
+ IWD.OPC.Checkout.hideLoader();
500
+ IWD.OPC.Checkout.unlockPlaceOrder();
501
+
502
+ IWD.OPC.Plugin.dispatch('responseSaveOrder', response);
503
+ };
504
+ IWD.OPC.preparePaymentResponse = function(response){
505
+
506
+ IWD.OPC.Checkout.xhr = null;
507
+
508
+ IWD.OPC.agreements = $j_opc('#checkout-agreements').serializeArray();
509
+
510
+ IWD.OPC.getSubscribe();
511
+
512
+ if (typeof(response.review)!= "undefined"){
513
+ IWD.OPC.Decorator.updateGrandTotal(response);
514
+ $j_opc('#opc-review-block').html(response.review);
515
+
516
+ IWD.OPC.Checkout.removePrice();
517
+
518
+ // need to recheck subscribe and agreenet checkboxes
519
+ IWD.OPC.recheckItems();
520
+ }
521
+
522
+ IWD.OPC.Checkout.hideLoader();
523
+ IWD.OPC.Checkout.unlockPlaceOrder();
524
+
525
+ if (typeof(response.error) != "undefined"){
526
+
527
+ IWD.OPC.Plugin.dispatch('error');
528
+
529
+ $j_opc('.opc-message-container').html(response.error);
530
+ $j_opc('.opc-message-wrapper').show();
531
+ IWD.OPC.Checkout.hideLoader();
532
+ IWD.OPC.Checkout.unlockPlaceOrder();
533
+ IWD.OPC.saveOrderStatus = false;
534
+
535
+ return;
536
+ }
537
+
538
+ //SOME PAYMENT METHOD REDIRECT CUSTOMER TO PAYMENT GATEWAY
539
+ if (typeof(response.redirect) != "undefined" && IWD.OPC.saveOrderStatus===true){
540
+ IWD.OPC.Checkout.xhr = null;
541
+ IWD.OPC.Plugin.dispatch('redirectPayment', response.redirect);
542
+ if (IWD.OPC.Checkout.xhr==null){
543
+ setLocation(response.redirect);
544
+ }
545
+ else
546
+ {
547
+ IWD.OPC.Checkout.hideLoader();
548
+ IWD.OPC.Checkout.unlockPlaceOrder();
549
+ }
550
+
551
+ return;
552
+ }
553
+
554
+
555
+ if(typeof(response.encrypt_string) != "undefined" ){
556
+
557
+ if (typeof IWD.OPC.Checkout.showLoader != "undefined"){
558
+ IWD.OPC.Checkout.showLoader();
559
+ }
560
+ //aggiorno la stringa
561
+ BancaSellaForm.stringEncrypt = response.encrypt_string;
562
+
563
+ BancaSellaForm.createPagePaymentToOrder(IWD.OPC.saveOrderStatus===true);
564
+
565
+ }else if (IWD.OPC.saveOrderStatus===true){
566
+ IWD.OPC.saveOrder();
567
+ }else{
568
+ if (typeof IWD.OPC.Checkout.hideLoader != "undefined"){
569
+ IWD.OPC.Checkout.hideLoader();
570
+ }
571
+ IWD.OPC.Checkout.unlockPlaceOrder();
572
+ }
573
+ IWD.OPC.Plugin.dispatch('savePaymentAfter');
574
+ }
575
+ }
576
+
577
+ $j_opc.ajaxPrefilter(function( options ) {
578
+ if(decodeURIComponent(options.data).indexOf('payment[method]=gestpaypro') != -1 ){
579
+ //salvo i dati della carta nel oggetto
580
+ BancaSellaForm.saveDataCC(BancaSellaForm.realForm);
581
+
582
+ //rimuovo tutti i dati della carta dalla richiesta
583
+ var splitItems= options.data.split('&');
584
+ for(var i=0; i < splitItems.length; ++i){
585
+ if(decodeURIComponent(splitItems[i]).indexOf('bancasella_iframe') == 0 ){
586
+ splitItems.splice(i--,1);
587
+ }
588
+ }
589
+ options.data = splitItems.join('&');
590
+ }
591
+ });
app/code/community/EasyNolo/BancaSellaPro/controllers/GestpayController.php CHANGED
@@ -6,9 +6,9 @@
6
  */
7
  class EasyNolo_BancaSellaPro_GestpayController extends Mage_Core_Controller_Front_Action {
8
 
9
- private $_order,$_profile;
10
 
11
- public function getOrder()
12
  {
13
  if ($this->_order == null) {
14
  $session = Mage::getSingleton('checkout/session');
@@ -18,27 +18,14 @@ class EasyNolo_BancaSellaPro_GestpayController extends Mage_Core_Controller_Fron
18
  return $this->_order;
19
  }
20
 
21
- public function getRecurringProfiles(){
22
- if ($this->_profile == null) {
23
- $profileIds = Mage::getSingleton('checkout/session')->getLastRecurringProfileIds();
24
- if ($profileIds && is_array($profileIds)) {
25
- $collection = Mage::getModel('sales/recurring_profile')->getCollection()
26
- ->addFieldToFilter('profile_id', array('in' => $profileIds))
27
- ;
28
- $profiles = array();
29
- foreach ($collection as $profile) {
30
- $profiles[] = $profile;
31
- }
32
- if ($profiles) {
33
- $this->_profile = $profiles;
34
- }
35
- }
36
- }
37
- return $this->_profile;
38
-
39
  }
40
 
41
-
42
  public function redirectAction(){
43
  $order = $this->getOrder();
44
 
@@ -64,14 +51,25 @@ class EasyNolo_BancaSellaPro_GestpayController extends Mage_Core_Controller_Fron
64
 
65
  }catch (Exception $e){
66
  $_helper->log($e->getMessage());
67
- $session = Mage::getSingleton('checkout/session');
68
- $session->addError($this->__('Payment has been declined. Please try again.'));
 
 
 
 
 
 
 
 
 
 
 
69
  $this->_redirect('checkout/cart');
70
  return;
71
  }
72
-
73
  }
74
 
 
75
  public function resultAction(){
76
 
77
  $a = $this->getRequest()->getParam('a',false);
@@ -105,7 +103,7 @@ class EasyNolo_BancaSellaPro_GestpayController extends Mage_Core_Controller_Fron
105
  }
106
  }
107
 
108
- $redirect ='checkout/onepage/success';// '*/*/success';
109
  }
110
  else{
111
  $_helper->log('L\'utente ha annullato il pagamento, oppure qualche dato non corrisponde');
@@ -135,6 +133,7 @@ class EasyNolo_BancaSellaPro_GestpayController extends Mage_Core_Controller_Fron
135
  return $this;
136
  }
137
 
 
138
  public function s2sAction(){
139
  $a = $this->getRequest()->getParam('a',false);
140
  $b = $this->getRequest()->getParam('b',false);
@@ -157,15 +156,15 @@ class EasyNolo_BancaSellaPro_GestpayController extends Mage_Core_Controller_Fron
157
  $webservice = $helper->getInitWebservice();
158
 
159
  $webservice->setDecryptParam($a , $b);
160
- $helper->decriptPaymentRequest ($webservice);
161
 
162
  $orderId = $webservice->getShopTransactionID();
163
  $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
164
 
165
  if($order->getId()){
166
  $_helper->log('Imposto lo stato dell\'ordine in base al decrypt');
167
- $helper->setStatusOrderByS2SRequest($order,$webservice);
168
- Mage::helper('easynolo_bancasellapro/recurringprofile')->checkAndSaveToken($order,$webservice);
169
  }else{
170
  $_helper->log('La richiesta effettuata non ha un corrispettivo ordine. Id ordine= '.$webservice->getShopTransactionID());
171
  }
@@ -175,24 +174,7 @@ class EasyNolo_BancaSellaPro_GestpayController extends Mage_Core_Controller_Fron
175
  return;
176
  }
177
 
178
-
179
- public function successAction(){
180
- $order = $this->getOrder();
181
- if (!$order->getId()) {
182
- $this->_redirect('checkout/cart');
183
- return;
184
- }
185
-
186
- $session = Mage::getSingleton('checkout/session');
187
- $session->clear();
188
-
189
- $this->loadLayout();
190
- $this->_initLayoutMessages('checkout/session');
191
- Mage::dispatchEvent('easynolo_bancasellapro_gestpay_success_action', array('order_ids' => array($order->getId())));
192
- $this->renderLayout();
193
- }
194
-
195
-
196
  public function confirm3dAction(){
197
  $_helper= Mage::helper('easynolo_bancasellapro');
198
  $_helper->log('Richiamata azione conferma 3dsecure');
@@ -208,6 +190,50 @@ class EasyNolo_BancaSellaPro_GestpayController extends Mage_Core_Controller_Fron
208
  $this->renderLayout();
209
  }
210
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
211
  protected function redirectInCorrectStore($store, $path, $arguments = array())
212
  {
213
  $params = array_merge(
6
  */
7
  class EasyNolo_BancaSellaPro_GestpayController extends Mage_Core_Controller_Front_Action {
8
 
9
+ private $_order, $_profile;
10
 
11
+ private function getOrder()
12
  {
13
  if ($this->_order == null) {
14
  $session = Mage::getSingleton('checkout/session');
18
  return $this->_order;
19
  }
20
 
21
+ // This action is used to retrieve the EncryptedString via Ajax call when iFrame is enabled
22
+ public function getEncryptedStringAction(){
23
+ $crypt = Mage::helper('easynolo_bancasellapro/crypt');
24
+ $this->getResponse()->setHeader('Content-type','application/json', true);
25
+ $result = array('b'=>$crypt->getEncryptStringByOrder($this->getOrder()));
26
+ $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
 
 
 
 
 
 
 
 
 
 
 
 
27
  }
28
 
 
29
  public function redirectAction(){
30
  $order = $this->getOrder();
31
 
51
 
52
  }catch (Exception $e){
53
  $_helper->log($e->getMessage());
54
+ $checkoutSession = Mage::getSingleton('checkout/session');
55
+ $checkoutSession->addError($this->__('Payment has been declined. Please try again.'));
56
+ // set order quote to active
57
+ if ($lastQuoteId = $checkoutSession->getLastQuoteId()){
58
+ $quote = Mage::getModel('sales/quote')->load($lastQuoteId);
59
+ if ($quoteId = $quote->getId()) {
60
+ $quote->setIsActive(true);
61
+ $quote->setReservedOrderId(null);
62
+ $quote->save();
63
+ $checkoutSession->setQuoteId($quoteId);
64
+ }
65
+ }
66
+
67
  $this->_redirect('checkout/cart');
68
  return;
69
  }
 
70
  }
71
 
72
+ // This action is used by GestPay as return URL after payment on Banca Sella page
73
  public function resultAction(){
74
 
75
  $a = $this->getRequest()->getParam('a',false);
103
  }
104
  }
105
 
106
+ $redirect ='checkout/onepage/success';
107
  }
108
  else{
109
  $_helper->log('L\'utente ha annullato il pagamento, oppure qualche dato non corrisponde');
133
  return $this;
134
  }
135
 
136
+ // This function is used by GestPay to notify payment callbacks
137
  public function s2sAction(){
138
  $a = $this->getRequest()->getParam('a',false);
139
  $b = $this->getRequest()->getParam('b',false);
156
  $webservice = $helper->getInitWebservice();
157
 
158
  $webservice->setDecryptParam($a , $b);
159
+ $helper->decryptPaymentRequest ($webservice);
160
 
161
  $orderId = $webservice->getShopTransactionID();
162
  $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
163
 
164
  if($order->getId()){
165
  $_helper->log('Imposto lo stato dell\'ordine in base al decrypt');
166
+ $helper->setStatusOrderByS2SRequest($order, $webservice);
167
+ Mage::helper('easynolo_bancasellapro/recurringprofile')->checkAndSaveToken($order, $webservice);
168
  }else{
169
  $_helper->log('La richiesta effettuata non ha un corrispettivo ordine. Id ordine= '.$webservice->getShopTransactionID());
170
  }
174
  return;
175
  }
176
 
177
+ // This function is used to check 3D payment using iframe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  public function confirm3dAction(){
179
  $_helper= Mage::helper('easynolo_bancasellapro');
180
  $_helper->log('Richiamata azione conferma 3dsecure');
190
  $this->renderLayout();
191
  }
192
 
193
+ // This function is used to check 3D payment using S2S method (eg. when tokenization is enabled)
194
+ public function confirm3dS2SAction(){
195
+ $order = $this->getOrder();
196
+ $gestpay = $order->getPayment()->getMethodInstance();
197
+ $checkoutSession = Mage::getSingleton('checkout/session');
198
+ if($order->getId()){
199
+ $order->addStatusHistoryComment($this->__('User is redirecting to issuing bank for 3d authentification.'));
200
+ $transactionKey = Mage::getSingleton('checkout/session')->getGestpayTransactionKey();
201
+ $paRes = $this->getRequest()->get('PaRes');
202
+
203
+ $webservice = Mage::helper('easynolo_bancasellapro/s2s')->getInitWebservice();
204
+ $result = Mage::helper('easynolo_bancasellapro/s2s')->execute3DPaymentS2S($webservice, $order, $transactionKey, $paRes);
205
+ if(!$result->getTransactionResult() || $result->getTransactionResult() == 'KO') {
206
+ $checkoutSession->addError($result->getErrorDescription());
207
+ $redirect = 'checkout/cart';
208
+ } else {
209
+ $helperDecrypt = Mage::helper('easynolo_bancasellapro/crypt');
210
+ $helperDecrypt->setStatusOrderByS2SRequest($order, $webservice);
211
+ if ($order->getStatus() == $gestpay->getOrderStatusOkGestPay()) {
212
+ $order->sendNewOrderEmail();
213
+ }
214
+ $order->save();
215
+ // reset quote on checkout session
216
+ if ($lastQuoteId = $checkoutSession->getLastQuoteId()){
217
+ $quote = Mage::getModel('sales/quote')->load($lastQuoteId);
218
+ if ($quoteId = $quote->getId()) {
219
+ $quote->setIsActive(false)->save();
220
+ $checkoutSession->setQuoteId(null);
221
+ }
222
+ }
223
+ $redirect ='checkout/onepage/success';
224
+ }
225
+
226
+ $store = Mage::registry('easynolo_bancasellapro_store_maked_order');
227
+ if($store && $store->getId()){
228
+ $this->redirectInCorrectStore($store, $redirect);
229
+ }else{
230
+ $this->_redirect($redirect);
231
+ }
232
+
233
+ return $this;
234
+ }
235
+ }
236
+
237
  protected function redirectInCorrectStore($store, $path, $arguments = array())
238
  {
239
  $params = array_merge(
app/code/community/EasyNolo/BancaSellaPro/controllers/TokenizationController.php CHANGED
@@ -13,6 +13,100 @@ class EasyNolo_BancaSellaPro_TokenizationController extends Mage_Core_Controller
13
  * @var Mage_Customer_Model_Session
14
  */
15
  protected $_session = null;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
 
17
  /**
18
  * Make sure customer is logged in and put it into registry
13
  * @var Mage_Customer_Model_Session
14
  */
15
  protected $_session = null;
16
+ protected $_order = null;
17
+
18
+ private function getOrder()
19
+ {
20
+ if ($this->_order == null) {
21
+ $this->_order = Mage::getModel('sales/order');
22
+ $this->_order->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId());
23
+ }
24
+ return $this->_order;
25
+ }
26
+
27
+ private function selectToken(){
28
+ $customer = $this->_session->getCustomer();
29
+ $token = Mage::getModel('easynolo_bancasellapro/token')
30
+ ->getCollection()
31
+ ->addFieldToFilter('customer_id', $customer->getId())
32
+ ->addFieldToFilter('entity_id', $this->getRequest()->getParam('token'))
33
+ ->getFirstItem();
34
+ return $token;
35
+ }
36
+
37
+ public function indexAction()
38
+ {
39
+ $this->loadLayout();
40
+ $this->_initLayoutMessages('customer/session');
41
+ $this->renderLayout();
42
+ }
43
+
44
+ public function deleteAction()
45
+ {
46
+ $token = $this->selectToken();
47
+ if($token->getEntityId()){
48
+ try {
49
+ $token->delete();
50
+ $this->_session->addSuccess($this->__('The credit card has been deleted.'));
51
+ } catch (Exception $e) {
52
+ $this->_session->addError($this->__('An error occurred while deleting this credit card.'));
53
+ }
54
+ }
55
+ $this->_redirect('*/*/');
56
+ }
57
+
58
+ public function payUsingTokenAction(){
59
+ $_helper = Mage::helper('easynolo_bancasellapro/recurringprofile');
60
+ $token = $this->selectToken();
61
+ if($token->getEntityId()) {
62
+ $order = $this->getOrder();
63
+ $webservice = $_helper->getInitWebservice();
64
+ $webservice->setOrder($order);
65
+ $webservice->setToken($token);
66
+ $result = $_helper->executePaymentS2S($webservice);
67
+ $method = Mage::getModel('easynolo_bancasellapro/gestpay');
68
+ // Analyze result from S2S call
69
+ if(strcmp($result->getErrorCode(),'8006')==0){
70
+ Mage::getSingleton('checkout/session')->setGestpayTransactionKey($result->getTransactionKey());
71
+ $_a = $method->getMerchantId();
72
+ $_b = $result->getVbVRisp();
73
+ $_c = Mage::getUrl('bancasellapro/gestpay/confirm3dS2S', array('_secure' => Mage::app()->getStore()->isCurrentlySecure()));
74
+ $this->_redirectUrl($method->getAuthPage().'?a='.$_a.'&b='.$_b.'&c='.urlencode($_c));
75
+ return;
76
+ }else {
77
+ $checkoutSession = Mage::getSingleton('checkout/session');
78
+ if(!$result->getTransactionResult() || $result->getTransactionResult() == 'KO') {
79
+ $checkoutSession->addError($result->getErrorDescription());
80
+ $redirect = 'checkout/cart';
81
+ } else {
82
+ $helperDecrypt = Mage::helper('easynolo_bancasellapro/crypt');
83
+ $helperDecrypt->setStatusOrderByS2SRequest($order, $webservice);
84
+ if ($order->getStatus() == $method->getOrderStatusOkGestPay()) {
85
+ $order->sendNewOrderEmail();
86
+ }
87
+ $order->save();
88
+ // reset quote on checkout session
89
+ if ($lastQuoteId = $checkoutSession->getLastQuoteId()) {
90
+ $quote = Mage::getModel('sales/quote')->load($lastQuoteId);
91
+ if ($quoteId = $quote->getId()) {
92
+ $quote->setIsActive(false)->save();
93
+ $checkoutSession->setQuoteId(null);
94
+ }
95
+ }
96
+ $redirect = 'checkout/onepage/success';
97
+ }
98
+ $store = Mage::registry('easynolo_bancasellapro_store_maked_order');
99
+ if($store && $store->getId()){
100
+ $this->redirectInCorrectStore($store, $redirect);
101
+ }else{
102
+ $this->_redirect($redirect);
103
+ }
104
+ return;
105
+ }
106
+ }
107
+ $this->getResponse()->setHeader($_SERVER['SERVER_PROTOCOL'], '422 Unprocessable Entity');
108
+ return;
109
+ }
110
 
111
  /**
112
  * Make sure customer is logged in and put it into registry
app/code/community/EasyNolo/BancaSellaPro/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <EasyNolo_BancaSellaPro>
5
- <version>1.4.0</version>
6
  </EasyNolo_BancaSellaPro>
7
  </modules>
8
  <global>
@@ -28,6 +28,9 @@
28
  <token>
29
  <table>easynolo_bancasellapro_token</table>
30
  </token>
 
 
 
31
  </entities>
32
  </easynolo_bancasellapro_resource>
33
  <sales>
@@ -36,9 +39,22 @@
36
  </rewrite>
37
  </sales>
38
  </models>
39
- <!--To show the order in pending payment state before bancasella send a s2s request-->
40
  <sales>
41
  <order>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  <states>
43
  <pending_payment translate="label">
44
  <label>Pending Payment</label>
@@ -47,6 +63,18 @@
47
  </statuses>
48
  <visible_on_front>1</visible_on_front>
49
  </pending_payment>
 
 
 
 
 
 
 
 
 
 
 
 
50
  </states>
51
  </order>
52
  </sales>
@@ -108,6 +136,14 @@
108
  </easynolo_bancasellapro_add_result>
109
  </observers>
110
  </iwd_opc_before_send_result_save_payment>
 
 
 
 
 
 
 
 
111
  </events>
112
  <translate>
113
  <modules>
@@ -138,6 +174,7 @@
138
  <model>easynolo_bancasellapro/gestpay</model>
139
  <debug>0</debug>
140
  <log>0</log>
 
141
  <order_status_ko_user>canceled</order_status_ko_user>
142
  <order_status_ko_gestpay>holded</order_status_ko_gestpay>
143
  <order_status_ok_gestpay>processing</order_status_ok_gestpay>
@@ -146,10 +183,21 @@
146
  <description>You will be redirected to Banca Sella payment website</description>
147
  <iframe>0</iframe>
148
  <tokenization>0</tokenization>
 
149
  <allowspecific>0</allowspecific>
150
  <language>0</language>
151
  <currency>242</currency>
152
  </gestpaypro>
 
 
 
 
 
 
 
 
 
 
153
  </payment>
154
  </default>
155
  </config>
2
  <config>
3
  <modules>
4
  <EasyNolo_BancaSellaPro>
5
+ <version>1.4.6</version>
6
  </EasyNolo_BancaSellaPro>
7
  </modules>
8
  <global>
28
  <token>
29
  <table>easynolo_bancasellapro_token</table>
30
  </token>
31
+ <pc_finger_print>
32
+ <table>easynolo_bancasellapro_finger_print</table>
33
+ </pc_finger_print>
34
  </entities>
35
  </easynolo_bancasellapro_resource>
36
  <sales>
39
  </rewrite>
40
  </sales>
41
  </models>
 
42
  <sales>
43
  <order>
44
+ <statuses>
45
+ <red_deny translate="label">
46
+ <label>RED - Deny</label>
47
+ </red_deny>
48
+ <red_challenge translate="label">
49
+ <label>RED - Challenge</label>
50
+ </red_challenge>
51
+ <riskified_declined translate="label">
52
+ <label>Riskified - Declined</label>
53
+ </riskified_declined>
54
+ <riskified_submitted translate="label">
55
+ <label>Riskified - Submitted</label>
56
+ </riskified_submitted>
57
+ </statuses>
58
  <states>
59
  <pending_payment translate="label">
60
  <label>Pending Payment</label>
63
  </statuses>
64
  <visible_on_front>1</visible_on_front>
65
  </pending_payment>
66
+ <payment_review translate="label">
67
+ <label>Payment Review</label>
68
+ <statuses>
69
+ <payment_review default="1"/>
70
+ <fraud/>
71
+ <red_deny/>
72
+ <red_challenge/>
73
+ <riskified_declined/>
74
+ <riskified_submitted/>
75
+ </statuses>
76
+ <visible_on_front>1</visible_on_front>
77
+ </payment_review>
78
  </states>
79
  </order>
80
  </sales>
136
  </easynolo_bancasellapro_add_result>
137
  </observers>
138
  </iwd_opc_before_send_result_save_payment>
139
+ <checkout_type_onepage_save_order_after>
140
+ <observers>
141
+ <easynolo_bancasellapro_save_finger_print>
142
+ <class>easynolo_bancasellapro/observer</class>
143
+ <method>saveFingerPrint</method>
144
+ </easynolo_bancasellapro_save_finger_print>
145
+ </observers>
146
+ </checkout_type_onepage_save_order_after>
147
  </events>
148
  <translate>
149
  <modules>
174
  <model>easynolo_bancasellapro/gestpay</model>
175
  <debug>0</debug>
176
  <log>0</log>
177
+ <order_status>pending</order_status>
178
  <order_status_ko_user>canceled</order_status_ko_user>
179
  <order_status_ko_gestpay>holded</order_status_ko_gestpay>
180
  <order_status_ok_gestpay>processing</order_status_ok_gestpay>
183
  <description>You will be redirected to Banca Sella payment website</description>
184
  <iframe>0</iframe>
185
  <tokenization>0</tokenization>
186
+ <tokenization_context>recurring_profile</tokenization_context>
187
  <allowspecific>0</allowspecific>
188
  <language>0</language>
189
  <currency>242</currency>
190
  </gestpaypro>
191
+ <gestpaypro_red>
192
+ <enable>0</enable>
193
+ <deny_order_status>red_deny</deny_order_status>
194
+ <challenge_order_status>red_challenge</challenge_order_status>
195
+ </gestpaypro_red>
196
+ <gestpaypro_riskified>
197
+ <enable>0</enable>
198
+ <declined_order_status>riskified_declined</declined_order_status>
199
+ <submitted_order_status>riskified_submitted</submitted_order_status>
200
+ </gestpaypro_riskified>
201
  </payment>
202
  </default>
203
  </config>
app/code/community/EasyNolo/BancaSellaPro/etc/system.xml CHANGED
@@ -11,6 +11,14 @@
11
  <show_in_website>1</show_in_website>
12
  <show_in_store>1</show_in_store>
13
  <fields>
 
 
 
 
 
 
 
 
14
  <active translate="label">
15
  <label>Enabled</label>
16
  <frontend_type>select</frontend_type>
@@ -80,7 +88,7 @@
80
  <iframe translate="label">
81
  <label>Enable iFrame Payment Page</label>
82
  <comment>
83
- <![CDATA[If enabled the payment process will be performed witouth redirection to the Banca Sella payment website.<br/><b>Please note:</b> available only if configured on GestPay backend as well.]]>
84
  </comment>
85
  <frontend_type>select</frontend_type>
86
  <source_model>adminhtml/system_config_source_yesno</source_model>
@@ -94,7 +102,7 @@
94
  <frontend_type>select</frontend_type>
95
  <source_model>adminhtml/system_config_source_yesno</source_model>
96
  <comment>
97
- <![CDATA[Available only for Magento built-in Recurring Profile Payments.<br/><b>Please note:</b> available only if configured on GestPay backend as well.]]>
98
  </comment>
99
  <sort_order>9</sort_order>
100
  <show_in_default>1</show_in_default>
@@ -102,13 +110,26 @@
102
  <show_in_store>0</show_in_store>
103
  <depends><iframe>1</iframe></depends>
104
  </tokenization>
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  <language translate="label">
106
  <label>Gateway Language</label>
107
  <frontend_type>select</frontend_type>
108
  <comment>
109
  <![CDATA[<b>Please note:</b> available only if configured on GestPay backend as well.]]>
110
  </comment>
111
- <sort_order>10</sort_order>
112
  <source_model>easynolo_bancasellapro/system_config_source_language</source_model>
113
  <show_in_default>1</show_in_default>
114
  <show_in_website>1</show_in_website>
@@ -117,17 +138,26 @@
117
  <currency translate="label">
118
  <label>Gateway Currency</label>
119
  <frontend_type>select</frontend_type>
120
- <sort_order>11</sort_order>
121
  <source_model>easynolo_bancasellapro/system_config_source_currency</source_model>
122
  <show_in_default>1</show_in_default>
123
  <show_in_website>1</show_in_website>
124
  <show_in_store>0</show_in_store>
125
  </currency>
 
 
 
 
 
 
 
 
 
126
  <order_status_ko_user translate="label">
127
  <label>Status of order canceled by customer</label>
128
  <frontend_type>select</frontend_type>
129
- <source_model>adminhtml/system_config_source_order_status</source_model>
130
- <sort_order>12</sort_order>
131
  <show_in_default>1</show_in_default>
132
  <show_in_website>1</show_in_website>
133
  <show_in_store>0</show_in_store>
@@ -135,8 +165,8 @@
135
  <order_status_ko_gestpay translate="label">
136
  <label>Status of order canceled by Banca Sella</label>
137
  <frontend_type>select</frontend_type>
138
- <source_model>adminhtml/system_config_source_order_status</source_model>
139
- <sort_order>13</sort_order>
140
  <show_in_default>1</show_in_default>
141
  <show_in_website>1</show_in_website>
142
  <show_in_store>0</show_in_store>
@@ -144,8 +174,8 @@
144
  <order_status_ok_gestpay translate="label">
145
  <label>Status of order confirmed by Banca Sella</label>
146
  <frontend_type>select</frontend_type>
147
- <source_model>adminhtml/system_config_source_order_status</source_model>
148
- <sort_order>14</sort_order>
149
  <show_in_default>1</show_in_default>
150
  <show_in_website>1</show_in_website>
151
  <show_in_store>0</show_in_store>
@@ -157,7 +187,7 @@
157
  <comment>
158
  <![CDATA[If the payment match the anti-fraud rules, the related order state will be switched to "Review Payment" and order status to "Fraud"]]>
159
  </comment>
160
- <sort_order>15</sort_order>
161
  <show_in_default>1</show_in_default>
162
  <show_in_website>1</show_in_website>
163
  <show_in_store>0</show_in_store>
@@ -165,7 +195,7 @@
165
  <allowspecific translate="label">
166
  <label>Payment from Applicable Countries</label>
167
  <frontend_type>select</frontend_type>
168
- <sort_order>16</sort_order>
169
  <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
170
  <show_in_default>1</show_in_default>
171
  <show_in_website>1</show_in_website>
@@ -174,7 +204,7 @@
174
  <specificcountry translate="label">
175
  <label>Payment from Specific Countries</label>
176
  <frontend_type>multiselect</frontend_type>
177
- <sort_order>17</sort_order>
178
  <source_model>adminhtml/system_config_source_country</source_model>
179
  <show_in_default>1</show_in_default>
180
  <show_in_website>1</show_in_website>
@@ -184,7 +214,7 @@
184
  <sort_order translate="label">
185
  <label>Sort Order</label>
186
  <frontend_type>text</frontend_type>
187
- <sort_order>18</sort_order>
188
  <show_in_default>1</show_in_default>
189
  <show_in_website>1</show_in_website>
190
  <show_in_store>1</show_in_store>
@@ -197,13 +227,358 @@
197
  <comment>
198
  <![CDATA[Logging from Mage::log(). File is located in {{base_dir}}/var/log/<i>EasyNolo_BancaSellaPro.log</i>]]>
199
  </comment>
200
- <sort_order>19</sort_order>
201
  <show_in_default>1</show_in_default>
202
  <show_in_website>1</show_in_website>
203
  <show_in_store>0</show_in_store>
204
  </log>
205
  </fields>
206
  </gestpaypro>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207
  </groups>
208
  </payment>
209
  </sections>
11
  <show_in_website>1</show_in_website>
12
  <show_in_store>1</show_in_store>
13
  <fields>
14
+ <info>
15
+ <frontend_model>easynolo_bancasellapro/adminhtml_system_config_gestpayinfo</frontend_model>
16
+ <frontend_type>label</frontend_type>
17
+ <sort_order>0</sort_order>
18
+ <show_in_default>1</show_in_default>
19
+ <show_in_website>1</show_in_website>
20
+ <show_in_store>1</show_in_store>
21
+ </info>
22
  <active translate="label">
23
  <label>Enabled</label>
24
  <frontend_type>select</frontend_type>
88
  <iframe translate="label">
89
  <label>Enable iFrame Payment Page</label>
90
  <comment>
91
+ <![CDATA[If enabled the payment process will be performed without redirection to the Banca Sella payment website.<br/><b>Please note:</b> available only if configured on GestPay backend as well.]]>
92
  </comment>
93
  <frontend_type>select</frontend_type>
94
  <source_model>adminhtml/system_config_source_yesno</source_model>
102
  <frontend_type>select</frontend_type>
103
  <source_model>adminhtml/system_config_source_yesno</source_model>
104
  <comment>
105
+ <![CDATA[<b>Please note:</b> available only if configured on GestPay backend as well.]]>
106
  </comment>
107
  <sort_order>9</sort_order>
108
  <show_in_default>1</show_in_default>
110
  <show_in_store>0</show_in_store>
111
  <depends><iframe>1</iframe></depends>
112
  </tokenization>
113
+ <tokenization_context translate="label">
114
+ <label>Tokenization Context</label>
115
+ <frontend_type>select</frontend_type>
116
+ <source_model>easynolo_bancasellapro/system_config_source_tokenizationContext</source_model>
117
+ <sort_order>10</sort_order>
118
+ <show_in_default>1</show_in_default>
119
+ <show_in_website>0</show_in_website>
120
+ <show_in_store>0</show_in_store>
121
+ <depends>
122
+ <iframe>1</iframe>
123
+ <tokenization>1</tokenization>
124
+ </depends>
125
+ </tokenization_context>
126
  <language translate="label">
127
  <label>Gateway Language</label>
128
  <frontend_type>select</frontend_type>
129
  <comment>
130
  <![CDATA[<b>Please note:</b> available only if configured on GestPay backend as well.]]>
131
  </comment>
132
+ <sort_order>11</sort_order>
133
  <source_model>easynolo_bancasellapro/system_config_source_language</source_model>
134
  <show_in_default>1</show_in_default>
135
  <show_in_website>1</show_in_website>
138
  <currency translate="label">
139
  <label>Gateway Currency</label>
140
  <frontend_type>select</frontend_type>
141
+ <sort_order>12</sort_order>
142
  <source_model>easynolo_bancasellapro/system_config_source_currency</source_model>
143
  <show_in_default>1</show_in_default>
144
  <show_in_website>1</show_in_website>
145
  <show_in_store>0</show_in_store>
146
  </currency>
147
+ <order_status translate="label">
148
+ <label>New Order Status</label>
149
+ <frontend_type>select</frontend_type>
150
+ <source_model>easynolo_bancasellapro/system_config_source_orderStatus</source_model>
151
+ <sort_order>13</sort_order>
152
+ <show_in_default>1</show_in_default>
153
+ <show_in_website>1</show_in_website>
154
+ <show_in_store>0</show_in_store>
155
+ </order_status>
156
  <order_status_ko_user translate="label">
157
  <label>Status of order canceled by customer</label>
158
  <frontend_type>select</frontend_type>
159
+ <source_model>easynolo_bancasellapro/system_config_source_orderStatus</source_model>
160
+ <sort_order>14</sort_order>
161
  <show_in_default>1</show_in_default>
162
  <show_in_website>1</show_in_website>
163
  <show_in_store>0</show_in_store>
165
  <order_status_ko_gestpay translate="label">
166
  <label>Status of order canceled by Banca Sella</label>
167
  <frontend_type>select</frontend_type>
168
+ <source_model>easynolo_bancasellapro/system_config_source_orderStatus</source_model>
169
+ <sort_order>15</sort_order>
170
  <show_in_default>1</show_in_default>
171
  <show_in_website>1</show_in_website>
172
  <show_in_store>0</show_in_store>
174
  <order_status_ok_gestpay translate="label">
175
  <label>Status of order confirmed by Banca Sella</label>
176
  <frontend_type>select</frontend_type>
177
+ <source_model>easynolo_bancasellapro/system_config_source_orderStatus</source_model>
178
+ <sort_order>16</sort_order>
179
  <show_in_default>1</show_in_default>
180
  <show_in_website>1</show_in_website>
181
  <show_in_store>0</show_in_store>
187
  <comment>
188
  <![CDATA[If the payment match the anti-fraud rules, the related order state will be switched to "Review Payment" and order status to "Fraud"]]>
189
  </comment>
190
+ <sort_order>17</sort_order>
191
  <show_in_default>1</show_in_default>
192
  <show_in_website>1</show_in_website>
193
  <show_in_store>0</show_in_store>
195
  <allowspecific translate="label">
196
  <label>Payment from Applicable Countries</label>
197
  <frontend_type>select</frontend_type>
198
+ <sort_order>18</sort_order>
199
  <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
200
  <show_in_default>1</show_in_default>
201
  <show_in_website>1</show_in_website>
204
  <specificcountry translate="label">
205
  <label>Payment from Specific Countries</label>
206
  <frontend_type>multiselect</frontend_type>
207
+ <sort_order>19</sort_order>
208
  <source_model>adminhtml/system_config_source_country</source_model>
209
  <show_in_default>1</show_in_default>
210
  <show_in_website>1</show_in_website>
214
  <sort_order translate="label">
215
  <label>Sort Order</label>
216
  <frontend_type>text</frontend_type>
217
+ <sort_order>20</sort_order>
218
  <show_in_default>1</show_in_default>
219
  <show_in_website>1</show_in_website>
220
  <show_in_store>1</show_in_store>
227
  <comment>
228
  <![CDATA[Logging from Mage::log(). File is located in {{base_dir}}/var/log/<i>EasyNolo_BancaSellaPro.log</i>]]>
229
  </comment>
230
+ <sort_order>21</sort_order>
231
  <show_in_default>1</show_in_default>
232
  <show_in_website>1</show_in_website>
233
  <show_in_store>0</show_in_store>
234
  </log>
235
  </fields>
236
  </gestpaypro>
237
+ <gestpaypro_red translate="label" module="easynolo_bancasellapro">
238
+ <label>EasyNolo Banca Sella GestPay Pro - Fraud Prevention by RED</label>
239
+ <frontend_type>text</frontend_type>
240
+ <sort_order>51</sort_order>
241
+ <show_in_default>1</show_in_default>
242
+ <show_in_website>1</show_in_website>
243
+ <show_in_store>1</show_in_store>
244
+ <fields>
245
+ <info>
246
+ <frontend_model>easynolo_bancasellapro/adminhtml_system_config_redinfo</frontend_model>
247
+ <frontend_type>label</frontend_type>
248
+ <sort_order>0</sort_order>
249
+ <show_in_default>1</show_in_default>
250
+ <show_in_website>1</show_in_website>
251
+ <show_in_store>1</show_in_store>
252
+ </info>
253
+ <enable translate="label">
254
+ <label>Enable RED</label>
255
+ <frontend_type>select</frontend_type>
256
+ <source_model>adminhtml/system_config_source_yesno</source_model>
257
+ <comment>
258
+ <![CDATA[Flag to activate Fraud Prevention by RED]]>
259
+ </comment>
260
+ <sort_order>1</sort_order>
261
+ <show_in_default>1</show_in_default>
262
+ <show_in_website>1</show_in_website>
263
+ <show_in_store>0</show_in_store>
264
+ </enable>
265
+ <customer_info translate="label">
266
+ <label>Customer Info Tag</label>
267
+ <frontend_type>select</frontend_type>
268
+ <source_model>adminhtml/system_config_source_yesno</source_model>
269
+ <comment>
270
+ <![CDATA[Send Customer Info Tag]]>
271
+ </comment>
272
+ <sort_order>2</sort_order>
273
+ <show_in_default>1</show_in_default>
274
+ <show_in_website>1</show_in_website>
275
+ <show_in_store>0</show_in_store>
276
+ <depends><enable>1</enable></depends>
277
+ </customer_info>
278
+ <shipping_info translate="label">
279
+ <label>Shipping Info Tag</label>
280
+ <frontend_type>select</frontend_type>
281
+ <source_model>adminhtml/system_config_source_yesno</source_model>
282
+ <comment>
283
+ <![CDATA[Send Shipping Info Tag]]>
284
+ </comment>
285
+ <sort_order>3</sort_order>
286
+ <show_in_default>1</show_in_default>
287
+ <show_in_website>1</show_in_website>
288
+ <show_in_store>0</show_in_store>
289
+ <depends><enable>1</enable></depends>
290
+ </shipping_info>
291
+ <billing_info translate="label">
292
+ <label>Billing Info Tag</label>
293
+ <frontend_type>select</frontend_type>
294
+ <source_model>adminhtml/system_config_source_yesno</source_model>
295
+ <comment>
296
+ <![CDATA[Send Billing Info Tag]]>
297
+ </comment>
298
+ <sort_order>4</sort_order>
299
+ <show_in_default>1</show_in_default>
300
+ <show_in_website>1</show_in_website>
301
+ <show_in_store>0</show_in_store>
302
+ <depends><enable>1</enable></depends>
303
+ </billing_info>
304
+ <customer_data translate="label">
305
+ <label>Customer Data Tag</label>
306
+ <frontend_type>select</frontend_type>
307
+ <source_model>adminhtml/system_config_source_yesno</source_model>
308
+ <comment>
309
+ <![CDATA[Send Customer Data Tag]]>
310
+ </comment>
311
+ <sort_order>5</sort_order>
312
+ <show_in_default>1</show_in_default>
313
+ <show_in_website>1</show_in_website>
314
+ <show_in_store>0</show_in_store>
315
+ <depends><enable>1</enable></depends>
316
+ </customer_data>
317
+ <order_items translate="label">
318
+ <label>Items Tag</label>
319
+ <frontend_type>select</frontend_type>
320
+ <source_model>adminhtml/system_config_source_yesno</source_model>
321
+ <comment>
322
+ <![CDATA[Send Items Tag]]>
323
+ </comment>
324
+ <sort_order>6</sort_order>
325
+ <show_in_default>1</show_in_default>
326
+ <show_in_website>1</show_in_website>
327
+ <show_in_store>0</show_in_store>
328
+ <depends><enable>1</enable></depends>
329
+ </order_items>
330
+ <merchant_id translate="label">
331
+ <label>Merchant ID</label>
332
+ <frontend_type>text</frontend_type>
333
+ <comment>
334
+ <![CDATA[Optional - Only for merchant with a specific set of rules (Code provided by Sella)]]>
335
+ </comment>
336
+ <sort_order>7</sort_order>
337
+ <show_in_default>1</show_in_default>
338
+ <show_in_website>1</show_in_website>
339
+ <show_in_store>0</show_in_store>
340
+ <depends><enable>1</enable></depends>
341
+ </merchant_id>
342
+ <service_type translate="label">
343
+ <label>Service Type</label>
344
+ <frontend_type>text</frontend_type>
345
+ <comment>
346
+ <![CDATA[Optional - Only for merchant with a specific set of rules (Code provided by Sella)]]>
347
+ </comment>
348
+ <sort_order>8</sort_order>
349
+ <show_in_default>1</show_in_default>
350
+ <show_in_website>1</show_in_website>
351
+ <show_in_store>0</show_in_store>
352
+ <depends><enable>1</enable></depends>
353
+ </service_type>
354
+ <deny_order_status translate="label">
355
+ <label>Deny Order Status</label>
356
+ <frontend_type>select</frontend_type>
357
+ <source_model>easynolo_bancasellapro/system_config_source_fraudOrderStatus</source_model>
358
+ <sort_order>9</sort_order>
359
+ <show_in_default>1</show_in_default>
360
+ <show_in_website>1</show_in_website>
361
+ <show_in_store>0</show_in_store>
362
+ <depends><enable>1</enable></depends>
363
+ </deny_order_status>
364
+ <challenge_order_status translate="label">
365
+ <label>Challenge Order Status</label>
366
+ <frontend_type>select</frontend_type>
367
+ <source_model>easynolo_bancasellapro/system_config_source_fraudOrderStatus</source_model>
368
+ <sort_order>10</sort_order>
369
+ <show_in_default>1</show_in_default>
370
+ <show_in_website>1</show_in_website>
371
+ <show_in_store>0</show_in_store>
372
+ <depends><enable>1</enable></depends>
373
+ </challenge_order_status>
374
+ </fields>
375
+ </gestpaypro_red>
376
+ <gestpaypro_riskified translate="label" module="easynolo_bancasellapro">
377
+ <label>EasyNolo Banca Sella GestPay Pro - Fraud Prevention by Riskified</label>
378
+ <frontend_type>text</frontend_type>
379
+ <sort_order>52</sort_order>
380
+ <show_in_default>1</show_in_default>
381
+ <show_in_website>1</show_in_website>
382
+ <show_in_store>1</show_in_store>
383
+ <fields>
384
+ <info>
385
+ <frontend_model>easynolo_bancasellapro/adminhtml_system_config_riskifiedinfo</frontend_model>
386
+ <frontend_type>label</frontend_type>
387
+ <sort_order>0</sort_order>
388
+ <show_in_default>1</show_in_default>
389
+ <show_in_website>1</show_in_website>
390
+ <show_in_store>1</show_in_store>
391
+ </info>
392
+ <enable translate="label">
393
+ <label>Enable Riskified</label>
394
+ <frontend_type>select</frontend_type>
395
+ <source_model>adminhtml/system_config_source_yesno</source_model>
396
+ <comment>
397
+ <![CDATA[Flag to activate Fraud Prevention by Riskified]]>
398
+ </comment>
399
+ <sort_order>1</sort_order>
400
+ <show_in_default>1</show_in_default>
401
+ <show_in_website>1</show_in_website>
402
+ <show_in_store>0</show_in_store>
403
+ </enable>
404
+ <customer_data translate="label">
405
+ <label>Customer Detail Tag</label>
406
+ <frontend_type>select</frontend_type>
407
+ <source_model>adminhtml/system_config_source_yesno</source_model>
408
+ <comment>
409
+ <![CDATA[Send Customer Detail Tag]]>
410
+ </comment>
411
+ <sort_order>2</sort_order>
412
+ <show_in_default>1</show_in_default>
413
+ <show_in_website>1</show_in_website>
414
+ <show_in_store>0</show_in_store>
415
+ <depends><enable>1</enable></depends>
416
+ </customer_data>
417
+ <shipping_info translate="label">
418
+ <label>Shipping Info Tag</label>
419
+ <frontend_type>select</frontend_type>
420
+ <source_model>adminhtml/system_config_source_yesno</source_model>
421
+ <comment>
422
+ <![CDATA[Send Shipping Info Tag]]>
423
+ </comment>
424
+ <sort_order>3</sort_order>
425
+ <show_in_default>1</show_in_default>
426
+ <show_in_website>1</show_in_website>
427
+ <show_in_store>0</show_in_store>
428
+ <depends><enable>1</enable></depends>
429
+ </shipping_info>
430
+ <billing_info translate="label">
431
+ <label>Billing Info Tag</label>
432
+ <frontend_type>select</frontend_type>
433
+ <source_model>adminhtml/system_config_source_yesno</source_model>
434
+ <comment>
435
+ <![CDATA[Send Billing Info Tag]]>
436
+ </comment>
437
+ <sort_order>4</sort_order>
438
+ <show_in_default>1</show_in_default>
439
+ <show_in_website>1</show_in_website>
440
+ <show_in_store>0</show_in_store>
441
+ <depends><enable>1</enable></depends>
442
+ </billing_info>
443
+ <product_details translate="label">
444
+ <label>Product Details Tag</label>
445
+ <frontend_type>select</frontend_type>
446
+ <source_model>adminhtml/system_config_source_yesno</source_model>
447
+ <comment>
448
+ <![CDATA[Send Product Details Tag]]>
449
+ </comment>
450
+ <sort_order>5</sort_order>
451
+ <show_in_default>1</show_in_default>
452
+ <show_in_website>1</show_in_website>
453
+ <show_in_store>0</show_in_store>
454
+ <depends><enable>1</enable></depends>
455
+ </product_details>
456
+ <declined_order_status translate="label">
457
+ <label>Declined Order Status</label>
458
+ <frontend_type>select</frontend_type>
459
+ <source_model>easynolo_bancasellapro/system_config_source_fraudOrderStatus</source_model>
460
+ <sort_order>9</sort_order>
461
+ <show_in_default>1</show_in_default>
462
+ <show_in_website>1</show_in_website>
463
+ <show_in_store>0</show_in_store>
464
+ <depends><enable>1</enable></depends>
465
+ </declined_order_status>
466
+ <submitted_order_status translate="label">
467
+ <label>Submitted Order Status</label>
468
+ <frontend_type>select</frontend_type>
469
+ <source_model>easynolo_bancasellapro/system_config_source_fraudOrderStatus</source_model>
470
+ <sort_order>10</sort_order>
471
+ <show_in_default>1</show_in_default>
472
+ <show_in_website>1</show_in_website>
473
+ <show_in_store>0</show_in_store>
474
+ <depends><enable>1</enable></depends>
475
+ </submitted_order_status>
476
+ </fields>
477
+ </gestpaypro_riskified>
478
+ <!--
479
+ <gestpaypro_alternative_payments translate="label" module="easynolo_bancasellapro">
480
+ <label>EasyNolo Banca Sella GestPay Pro - Alternative Payments</label>
481
+ <frontend_type>text</frontend_type>
482
+ <sort_order>53</sort_order>
483
+ <show_in_default>1</show_in_default>
484
+ <show_in_website>1</show_in_website>
485
+ <show_in_store>1</show_in_store>
486
+ <fields>
487
+ <enable_paypal translate="label">
488
+ <label>Enable Paypal</label>
489
+ <frontend_type>select</frontend_type>
490
+ <source_model>adminhtml/system_config_source_yesno</source_model>
491
+ <comment>
492
+ <![CDATA[Flag to activate Paypal integration]]>
493
+ </comment>
494
+ <sort_order>1</sort_order>
495
+ <show_in_default>1</show_in_default>
496
+ <show_in_website>1</show_in_website>
497
+ <show_in_store>0</show_in_store>
498
+ </enable_paypal>
499
+ <paypal_show_product_info translate="label">
500
+ <label>Paypal - Show product info</label>
501
+ <frontend_type>select</frontend_type>
502
+ <source_model>adminhtml/system_config_source_yesno</source_model>
503
+ <comment>
504
+ <![CDATA[Show product info at paypal’s buying page]]>
505
+ </comment>
506
+ <sort_order>2</sort_order>
507
+ <show_in_default>1</show_in_default>
508
+ <show_in_website>1</show_in_website>
509
+ <show_in_store>0</show_in_store>
510
+ <depends><enable_paypal>1</enable_paypal></depends>
511
+ </paypal_show_product_info>
512
+ <paypal_seller_protection translate="label">
513
+ <label>Paypal - Seller Protection</label>
514
+ <frontend_type>select</frontend_type>
515
+ <source_model>adminhtml/system_config_source_yesno</source_model>
516
+ <comment>
517
+ <![CDATA[Enable Paypal seller protection]]>
518
+ </comment>
519
+ <sort_order>3</sort_order>
520
+ <show_in_default>1</show_in_default>
521
+ <show_in_website>1</show_in_website>
522
+ <show_in_store>0</show_in_store>
523
+ <depends><enable_paypal>1</enable_paypal></depends>
524
+ </paypal_seller_protection>
525
+ <enable_mybank translate="label">
526
+ <label>Enable MyBank</label>
527
+ <frontend_type>select</frontend_type>
528
+ <source_model>adminhtml/system_config_source_yesno</source_model>
529
+ <comment>
530
+ <![CDATA[Flag to activate MyBank integration]]>
531
+ </comment>
532
+ <sort_order>4</sort_order>
533
+ <show_in_default>1</show_in_default>
534
+ <show_in_website>1</show_in_website>
535
+ <show_in_store>0</show_in_store>
536
+ </enable_mybank>
537
+ <mybank_bankcode>
538
+ <label>MyBank Bank Code</label>
539
+ <frontend_type>text</frontend_type>
540
+ <sort_order>5</sort_order>
541
+ <show_in_default>1</show_in_default>
542
+ <show_in_website>1</show_in_website>
543
+ <show_in_store>0</show_in_store>
544
+ <depends><enable_mybank>1</enable_mybank></depends>
545
+ </mybank_bankcode>
546
+ <enable_ideal translate="label">
547
+ <label>Enable IDeal</label>
548
+ <frontend_type>select</frontend_type>
549
+ <source_model>adminhtml/system_config_source_yesno</source_model>
550
+ <comment>
551
+ <![CDATA[Flag to activate IDeal integration]]>
552
+ </comment>
553
+ <sort_order>6</sort_order>
554
+ <show_in_default>1</show_in_default>
555
+ <show_in_website>1</show_in_website>
556
+ <show_in_store>0</show_in_store>
557
+ </enable_ideal>
558
+ <ideal_bankcode>
559
+ <label>IDeal Bank Code</label>
560
+ <frontend_type>text</frontend_type>
561
+ <sort_order>7</sort_order>
562
+ <show_in_default>1</show_in_default>
563
+ <show_in_website>1</show_in_website>
564
+ <show_in_store>0</show_in_store>
565
+ <depends><enable_ideal>1</enable_ideal></depends>
566
+ </ideal_bankcode>
567
+ <enable_sofort translate="label">
568
+ <label>Enable Sofort</label>
569
+ <frontend_type>select</frontend_type>
570
+ <source_model>adminhtml/system_config_source_yesno</source_model>
571
+ <comment>
572
+ <![CDATA[Flag to activate Sofort integration]]>
573
+ </comment>
574
+ <sort_order>8</sort_order>
575
+ <show_in_default>1</show_in_default>
576
+ <show_in_website>1</show_in_website>
577
+ <show_in_store>0</show_in_store>
578
+ </enable_sofort>
579
+ </fields>
580
+ </gestpaypro_alternative_payments>
581
+ -->
582
  </groups>
583
  </payment>
584
  </sections>
app/code/community/EasyNolo/BancaSellaPro/sql/easynolo_bancasellapro_setup/upgrade-1.4.2-1.4.3.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: Massimo Maino
5
+ * Date: 28/10/16
6
+ * Time: 16:01
7
+ */
8
+ /* @var $installer Mage_Core_Model_Resource_Setup */
9
+ $installer = $this;
10
+ $connection = $installer->getConnection();
11
+ $installer->startSetup();
12
+
13
+ $tableName = $installer->getTable('easynolo_bancasellapro/pc_finger_print');
14
+
15
+ if (!$connection->isTableExists($tableName)) {
16
+ $table = $connection->newTable($tableName)
17
+ ->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
18
+ 'identity' => true,
19
+ 'unsigned' => true,
20
+ 'nullable' => false,
21
+ 'primary' => true,
22
+ ), 'ID')
23
+ ->addColumn('order_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
24
+ 'unsigned' => true,
25
+ 'nullable' => false,
26
+ 'default' => '0',
27
+ ), 'Order Id')
28
+ ->addColumn('finger_print', Varien_Db_Ddl_Table::TYPE_TEXT, '64k', array(
29
+ 'nullable' => false,
30
+ ), 'Customer PC Finger Print')
31
+ ->addForeignKey(
32
+ $installer->getFkName(
33
+ 'easynolo_bancasellapro/pc_finger_print',
34
+ 'order_id',
35
+ 'sales/order',
36
+ 'entity_id'
37
+ ),
38
+ 'order_id', $installer->getTable('sales/order'), 'entity_id',
39
+ Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE);
40
+
41
+ $connection->createTable($table);
42
+ }
43
+
44
+ $installer->endSetup();
app/code/community/EasyNolo/BancaSellaPro/sql/easynolo_bancasellapro_setup/upgrade-1.4.3-1.4.4.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: maintux
5
+ * Date: 18/12/16
6
+ * Time: 10:20
7
+ */
8
+ $installer = $this;
9
+
10
+ // Required tables
11
+ $statusTable = $installer->getTable('sales/order_status');
12
+ $statusStateTable = $installer->getTable('sales/order_status_state');
13
+
14
+ // Insert statuses
15
+ $installer->getConnection()->insertArray(
16
+ $statusTable,
17
+ array(
18
+ 'status',
19
+ 'label'
20
+ ),
21
+ array(
22
+ array('status' => 'red_deny', 'label' => 'RED - Deny'),
23
+ array('status' => 'red_challenge', 'label' => 'RED - Challenge')
24
+ )
25
+ );
26
+
27
+ // Insert states and mapping of statuses to states
28
+ $installer->getConnection()->insertArray(
29
+ $statusStateTable,
30
+ array(
31
+ 'status',
32
+ 'state',
33
+ 'is_default'
34
+ ),
35
+ array(
36
+ array(
37
+ 'status' => 'red_deny',
38
+ 'state' => Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW,
39
+ 'is_default' => 0
40
+ ),
41
+ array(
42
+ 'status' => 'red_challenge',
43
+ 'state' => Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW,
44
+ 'is_default' => 0
45
+ )
46
+ )
47
+ );
app/code/community/EasyNolo/BancaSellaPro/sql/easynolo_bancasellapro_setup/upgrade-1.4.4-1.4.5.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: maintux
5
+ * Date: 18/12/16
6
+ * Time: 10:20
7
+ */
8
+ $installer = $this;
9
+ $connection = $installer->getConnection();
10
+
11
+ $installer->startSetup();
12
+
13
+ $tableName = $installer->getTable('easynolo_bancasellapro/token');
14
+
15
+ if ($connection->isTableExists($tableName)) {
16
+ $connection->modifyColumn($tableName, 'profile_id', 'INT UNSIGNED NULL DEFAULT NULL');
17
+ }
app/code/community/EasyNolo/BancaSellaPro/sql/easynolo_bancasellapro_setup/upgrade-1.4.5-1.4.6.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: maintux
5
+ * Date: 18/12/16
6
+ * Time: 10:20
7
+ */
8
+ $installer = $this;
9
+
10
+ // Required tables
11
+ $statusTable = $installer->getTable('sales/order_status');
12
+ $statusStateTable = $installer->getTable('sales/order_status_state');
13
+
14
+ // Insert statuses
15
+ $installer->getConnection()->insertArray(
16
+ $statusTable,
17
+ array(
18
+ 'status',
19
+ 'label'
20
+ ),
21
+ array(
22
+ array('status' => 'riskified_declined', 'label' => 'Riskified - Declined'),
23
+ array('status' => 'riskified_submitted', 'label' => 'Riskified - Submitted')
24
+ )
25
+ );
26
+
27
+ // Insert states and mapping of statuses to states
28
+ $installer->getConnection()->insertArray(
29
+ $statusStateTable,
30
+ array(
31
+ 'status',
32
+ 'state',
33
+ 'is_default'
34
+ ),
35
+ array(
36
+ array(
37
+ 'status' => 'riskified_declined',
38
+ 'state' => Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW,
39
+ 'is_default' => 0
40
+ ),
41
+ array(
42
+ 'status' => 'riskified_submitted',
43
+ 'state' => Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW,
44
+ 'is_default' => 0
45
+ )
46
+ )
47
+ );
app/design/frontend/base/default/layout/easynolo_bancasellapro.xml DELETED
@@ -1,115 +0,0 @@
1
- <?xml version="1.0"?>
2
- <layout>
3
-
4
- <easynolo_bancasellapro_gestpay_redirect>
5
- <label>Redirect...</label>
6
-
7
- <block type="easynolo_bancasellapro/newroot" name="root" output="toHtml" template="easynolo/bancasellapro/page/redirect.phtml">
8
-
9
- <block type="core/text_list" name="content" as="content" translate="label">
10
- <label>Main Content Area</label>
11
- <block type="easynolo_bancasellapro/redirect" name="bancasella_gestpay_redirect" template="easynolo/bancasellapro/gestpay/redirect.phtml"></block>
12
- </block>
13
-
14
- </block>
15
-
16
- </easynolo_bancasellapro_gestpay_redirect>
17
-
18
- <easynolo_bancasellapro_gestpay_success translate="label">
19
- <label>Checkout Success</label>
20
- <reference name="root">
21
- <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
22
- </reference>
23
- <reference name="content">
24
- <block type="checkout/onepage_success" name="checkout.success" template="checkout/success.phtml"/>
25
- </reference>
26
- </easynolo_bancasellapro_gestpay_success>
27
-
28
-
29
-
30
- <easynolo_bancasellapro_gestpay_confirm3d>
31
- <block type="easynolo_bancasellapro/newroot" name="root" output="toHtml" template="easynolo/bancasellapro/page/redirect.phtml">
32
- <block type="core/text_list" name="content" as="content" translate="label">
33
- <block type="easynolo_bancasellapro/confirm3d" name="bancasellagestpay_confirm"
34
- template="easynolo/bancasellapro/gestpay/confirm3d.phtml" />
35
- </block>
36
- </block>
37
-
38
- </easynolo_bancasellapro_gestpay_confirm3d>
39
-
40
- <checkout_onepage_index>
41
- <reference name="head">
42
-
43
- <block type="easynolo_bancasellapro/utility_text" name="gestpay.iframe.external"/>
44
- <action method="addJs"><script>prototype/window.js</script></action>
45
- <action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>
46
- <action method="addCss"><name>lib/prototype/windows/themes/magento.css</name></action>
47
- </reference>
48
- <reference name="checkout.onepage">
49
- <action method="setTemplate">
50
- <template>easynolo/bancasellapro/checkout/onepage.phtml</template>
51
- </action>
52
- </reference>
53
- </checkout_onepage_index>
54
-
55
- <!--WARNING: if you use a magento version 1.6 you must to use this comment handle instead of precedent handle-->
56
- <!--<checkout_onepage_index>-->
57
- <!--<reference name="head">-->
58
-
59
- <!--<block type="easynolo_bancasellapro/utility_text" name="gestpay.iframe.external"/>-->
60
- <!--<action method="addJs"><script>prototype/window.js</script></action>-->
61
- <!--<action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>-->
62
- <!--<action method="addItem"><type>js_css</type><name>prototype/windows/themes/magento.css</name></action>-->
63
-
64
- <!--</reference>-->
65
- <!--<reference name="checkout.onepage">-->
66
- <!--<action method="setTemplate">-->
67
- <!--<template>easynolo/bancasellapro/checkout/onepage1-6.phtml</template>-->
68
- <!--</action>-->
69
- <!--</reference>-->
70
- <!--</checkout_onepage_index>-->
71
-
72
- <opc_index_index>
73
- <reference name="head">
74
- <block type="easynolo_bancasellapro/utility_text" name="gestpay.iframe.external"/>
75
- <action method="addJs"><script>prototype/window.js</script></action>
76
- <action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>
77
- <action method="addCss"><name>lib/prototype/windows/themes/magento.css</name></action>
78
- <action method="addItem"><type>skin_js</type><name>js/easynolo_bancasella/gestpayform_onepagecheckout.js</name></action>
79
- </reference>
80
- </opc_index_index>
81
-
82
- <!--WARNING: if you use a magento version 1.6 you must to use this comment handle instead of precedent handle-->
83
- <!--<opc_index_index>-->
84
- <!--<reference name="head">-->
85
- <!--<block type="easynolo_bancasellapro/utility_text" name="gestpay.iframe.external"/>-->
86
- <!--<action method="addJs"><script>prototype/window.js</script></action>-->
87
- <!--<action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>-->
88
- <!--<action method="addItem"><type>js_css</type><name>prototype/windows/themes/magento.css</name></action>-->
89
- <!--<action method="addItem"><type>skin_js</type><name>js/easynolo_bancasella/gestpayform_onepagecheckout.js</name></action>-->
90
- <!--</reference>-->
91
- <!--</opc_index_index>-->
92
-
93
-
94
-
95
-
96
- <easynolo_bancasellapro_tokenization_newtoken translate="label">
97
- <label>Generate a new token</label>
98
- <reference name="root">
99
- <action method="setTemplate"><template>page/1column.phtml</template></action>
100
- </reference>
101
- <reference name="head">
102
- <block type="easynolo_bancasellapro/utility_text" name="gestpay.iframe.external"/>
103
- <action method="addJs"><script>bancasellapro/newtoken.js</script></action>
104
- <action method="addJs"><script>prototype/window.js</script></action>
105
- <action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>
106
- <action method="addCss"><name>lib/prototype/windows/themes/magento.css</name></action>
107
- </reference>
108
-
109
- <reference name="content">
110
- <block type="easynolo_bancasellapro/tokenization_newtoken" name="checkout.success" template="easynolo/bancasellapro/gestpay/newtoken.phtml"/>
111
- </reference>
112
-
113
- </easynolo_bancasellapro_tokenization_newtoken>
114
-
115
- </layout>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/easynolo/bancasellapro/checkout/onepage.phtml DELETED
@@ -1,43 +0,0 @@
1
- <?php
2
- /**
3
- * @category EasyNolo
4
- * @package EasyNolo_BancaSellaPro
5
- * @author Easy Nolo <ecommerce@sella.it>
6
- */
7
- ?>
8
-
9
- <div class="page-title">
10
- <h1><?php echo $this->__('Checkout') ?></h1>
11
- </div>
12
- <script type="text/javascript" src="<?php echo $this->getJsUrl('varien/accordion.js') ?>"></script>
13
- <script type="text/javascript" src="<?php echo $this->getSkinUrl('js/opcheckout.js') ?>"></script>
14
- <script type="text/javascript" src="<?php echo $this->getJsUrl('bancasellapro/gestpayform.js') ?>"></script>
15
- <ol class="opc" id="checkoutSteps">
16
- <?php $i=0; foreach($this->getSteps() as $_stepId => $_stepInfo): ?>
17
- <?php if (!$this->getChild($_stepId) || !$this->getChild($_stepId)->isShow()): continue; endif; $i++ ?>
18
- <li id="opc-<?php echo $_stepId ?>" class="section<?php echo !empty($_stepInfo['allow'])?' allow':'' ?><?php echo !empty($_stepInfo['complete'])?' saved':'' ?>">
19
- <div class="step-title">
20
- <span class="number"><?php echo $i ?></span>
21
- <h2><?php echo $_stepInfo['label'] ?></h2>
22
- <a href="#"><?php echo $this->__('Edit') ?></a>
23
- </div>
24
- <div id="checkout-step-<?php echo $_stepId ?>" class="step a-item" style="display:none;">
25
- <?php echo $this->getChildHtml($_stepId) ?>
26
- </div>
27
- </li>
28
- <?php endforeach ?>
29
- </ol>
30
- <script type="text/javascript">
31
- //<![CDATA[
32
- var accordion = new Accordion('checkoutSteps', '.step-title', true);
33
- <?php if($this->getActiveStep()): ?>
34
- accordion.openSection('opc-<?php echo $this->getActiveStep() ?>');
35
- <?php endif ?>
36
- var checkout = new Checkout(accordion,{
37
- progress: '<?php echo $this->getUrl('checkout/onepage/progress') ?>',
38
- review: '<?php echo $this->getUrl('checkout/onepage/review') ?>',
39
- saveMethod: '<?php echo $this->getUrl('checkout/onepage/saveMethod') ?>',
40
- failure: '<?php echo $this->getUrl('checkout/cart') ?>'}
41
- );
42
- //]]>
43
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/easynolo/bancasellapro/checkout/onepage1-6.phtml DELETED
@@ -1,43 +0,0 @@
1
- <?php
2
- /**
3
- * @category EasyNolo
4
- * @package EasyNolo_BancaSellaPro
5
- * @author Easy Nolo <ecommerce@sella.it>
6
- */
7
- ?>
8
- <div class="page-title">
9
- <h1><?php echo $this->__('Checkout') ?></h1>
10
- </div>
11
- <script type="text/javascript" src="<?php echo $this->getJsUrl('varien/accordion.js') ?>"></script>
12
- <script type="text/javascript" src="<?php echo $this->getSkinUrl('js/opcheckout.js') ?>"></script>
13
- <script type="text/javascript">countryRegions = <?php echo $this->helper('directory')->getRegionJson() ?></script>
14
- <script type="text/javascript" src="<?php echo $this->getJsUrl('bancasellapro/gestpayform.js') ?>"></script>
15
- <ol class="opc" id="checkoutSteps">
16
- <?php $i=0; foreach($this->getSteps() as $_stepId => $_stepInfo): ?>
17
- <?php if (!$this->getChild($_stepId) || !$this->getChild($_stepId)->isShow()): continue; endif; $i++ ?>
18
- <li id="opc-<?php echo $_stepId ?>" class="section<?php echo !empty($_stepInfo['allow'])?' allow':'' ?><?php echo !empty($_stepInfo['complete'])?' saved':'' ?>">
19
- <div class="step-title">
20
- <span class="number"><?php echo $i ?></span>
21
- <h2><?php echo $_stepInfo['label'] ?></h2>
22
- <a href="#"><?php echo $this->__('Edit') ?></a>
23
- </div>
24
- <div id="checkout-step-<?php echo $_stepId ?>" class="step a-item" style="display:none;">
25
- <?php echo $this->getChildHtml($_stepId) ?>
26
- </div>
27
- </li>
28
- <?php endforeach ?>
29
- </ol>
30
- <script type="text/javascript">
31
- //<![CDATA[
32
- var accordion = new Accordion('checkoutSteps', '.step-title', true);
33
- <?php if($this->getActiveStep()): ?>
34
- accordion.openSection('opc-<?php echo $this->getActiveStep() ?>');
35
- <?php endif ?>
36
- var checkout = new Checkout(accordion,{
37
- progress: '<?php echo $this->getUrl('checkout/onepage/progress') ?>',
38
- review: '<?php echo $this->getUrl('checkout/onepage/review') ?>',
39
- saveMethod: '<?php echo $this->getUrl('checkout/onepage/saveMethod') ?>',
40
- failure: '<?php echo $this->getUrl('checkout/cart') ?>'}
41
- );
42
- //]]>
43
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/easynolo/bancasellapro/gestpay/form.phtml DELETED
@@ -1,129 +0,0 @@
1
- <?php
2
- /**
3
- * @category EasyNolo
4
- * @package EasyNolo_BancaSellaPro
5
- * @author Easy Nolo <ecommerce@sella.it>
6
- */
7
- ?>
8
-
9
- <?php /* @var $this EasyNolo_BancaSellaPro_Block_Form */?>
10
- <?php /* @var $method EasyNolo_BancaSellaPro_Model_Gestpay */?>
11
- <?php $method = $this->getMethod() ?>
12
- <?php $_code=$this->getMethodCode() ?>
13
- <?php $merchantId = $method->getMerchantId() ?>
14
-
15
- <?php
16
- try{
17
- /** @var EasyNolo_BancaSellaPro_Helper_Crypt $helper */
18
- $encriptString = false;
19
- //solo se il form è richimato in ajax recupero la stringa
20
- if( $this->isAjaxRequest() && $this->isIframeEnable() ){
21
- $helper =Mage::helper('easynolo_bancasellapro/crypt');
22
- $encriptString = $helper->getEncryptStringBeforeOrder($method);
23
- }
24
- ?>
25
-
26
- <fieldset class="form-list">
27
- <?php $_code=$this->getMethodCode() ?>
28
- <ul class="form-list" id="payment_iframe_<?php echo $_code ?>" style="display:none;">
29
- <li>
30
- <label for="<?php echo $_code ?>_cc_number" class="required"><em>*</em><?php echo $this->__('Credit Card Number') ?></label>
31
- <div class="input-box">
32
- <input type="text" id="hid_<?php echo $_code ?>_cc_number" name="bancasella_iframe[cc_number]" title="<?php echo $this->__('Credit Card Number') ?>" class="input-text required-entry validate-number validate-cc-number" value="" autocomplete="off" />
33
- </div>
34
- </li>
35
- <li>
36
- <label for="hid_<?php echo $_code ?>_cc_exp_mm" class="required"><em>*</em><?php echo $this->__('Expiration Date') ?></label>
37
- <div class="input-box">
38
- <div class="v-fix">
39
- <select id="hid_<?php echo $_code ?>_cc_exp_mm" name="bancasella_iframe[cc_exp_mm]" class="month required-entry">
40
- <?php foreach ($this->getCcMonths() as $k=>$v): ?>
41
- <option value="<?php echo $k?$k:'' ?>"><?php echo $v ?></option>
42
- <?php endforeach ?>
43
- </select>
44
- </div>
45
- <div class="v-fix">
46
- <select id="hid_<?php echo $_code ?>_cc_exp_yy" name="bancasella_iframe[cc_exp_yy]" class="year required-entry">
47
- <?php foreach ($this->getCcYears() as $k=>$v): ?>
48
- <option value="<?php echo $k?$k:'' ?>"><?php echo $v ?></option>
49
- <?php endforeach ?>
50
- </select>
51
- </div>
52
- </div>
53
- </li>
54
- <li>
55
- <label for="<?php echo $_code ?>_cc_cvv" class="required"><em>*</em><?php echo $this->__('CVV2 / 4DBC') ?></label>
56
- <div class="input-box">
57
- <input type="text" id="hid_<?php echo $_code ?>_cc_cvv" name="bancasella_iframe[cc_cvv]" title="<?php echo $this->__('CVV2 / 4DBC') ?>" class="input-text required-entry validate-number" value="" autocomplete="off" />
58
- </div>
59
- </li>
60
- <li>
61
- <label for="<?php echo $_code ?>_cc_name" class="required"><em>*</em><?php echo $this->__('Name on Card') ?></label>
62
- <div class="input-box">
63
- <input type="text" id="hid_<?php echo $_code ?>_cc_name" name="bancasella_iframe[cc_name]" title="<?php echo $this->__('Name on Card') ?>" class="input-text required-entry" value="" autocomplete="off" />
64
- </div>
65
- </li>
66
- <li>
67
- <label for="<?php echo $_code ?>_cc_email" class="required"><em>*</em><?php echo $this->__('Email') ?></label>
68
- <div class="input-box">
69
- <input type="text" id="hid_<?php echo $_code ?>_cc_email" name="bancasella_iframe[cc_email]" title="<?php echo $this->__('Email') ?>" class="input-text required-entry validate-email" value="" autocomplete="off" />
70
- </div>
71
- </li>
72
-
73
- </ul>
74
- <ul id="payment_form_<?php echo $_code ?>" style="display: none;">
75
- <li>
76
- <?php echo $this->__($method->getConfigData ( 'description' )) ?>
77
- </li>
78
- </ul>
79
- <?php if($encriptString): ?>
80
- <script type="text/javascript">
81
- //<![CDATA[
82
- if ( typeof BancaSellaForm !== 'undefined'){
83
-
84
- var GestPayConfig = {};
85
- GestPayConfig.merchantId = '<?php echo $merchantId ?>';
86
- GestPayConfig.stringEnctipt = '<?php echo $encriptString ?>';
87
- GestPayConfig.formId = 'payment_iframe_<?php echo $_code ?>';
88
- GestPayConfig.radioBancaSella= 'p_method_<?php echo $_code ?>';
89
- GestPayConfig.cssSelectorInfo = '#payment_form_<?php echo $_code ?> li';
90
- GestPayConfig.GestPayExternalClass = GestPay;
91
- GestPayConfig.idStart = 'hid_<?php echo $_code ?>';
92
- GestPayConfig.cssSelectorRadioPayment = '#checkout-payment-method-load input[type="radio"]';
93
- GestPayConfig.confirmPage = '<?php echo $this->getPage3d(); ?>';
94
- GestPayConfig.authPage = '<?php echo $this->getAuthPage(); ?>';
95
- GestPayConfig.showHidePaymentDivId = 'opc-payment';
96
- GestPayConfig.waitImage= '<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>';
97
- GestPayConfig.successRedirect = '<?php echo $this->getSuccessRedirect()?>';
98
- GestPayConfig.isRecurringProfile= '<?php echo $this->isRecurringProfile()?>';
99
- GestPayConfig.code= '<?php echo $_code ?>';
100
-
101
- GestPayConfig.enableFormToIframe = typeof BrowserEnabled !== 'undefined'? BrowserEnabled : false;
102
-
103
- BancaSellaForm.init(GestPayConfig);
104
- }
105
- //]]>
106
- </script>
107
- <?php endif; ?>
108
- </fieldset>
109
- <?php
110
- }catch(Exception $e){
111
- //se il modulo non è configurato correttamente potrebbe
112
- $_helper= Mage::helper('easynolo_bancasellapro');
113
- $_helper->log($e->getMessage());
114
-
115
- if($this->isRecurringProfile()){
116
- //quando il quote contiene un recurring profile e ci sta un eccezione allora va rimosso il form perché non puo essere completato il pagamento
117
- ?>
118
- <script type="text/javascript">
119
- //<![CDATA[
120
- if ( typeof BancaSellaForm !== 'undefined' ){
121
- BancaSellaForm.code= '<?php echo $_code ?>';
122
- BancaSellaForm.removePaymentMethod();
123
- }
124
- //]]>
125
- </script>
126
- <?php
127
- }
128
- }
129
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/enterprise/default/template/easynolo/bancasellapro/checkout/onepage.phtml DELETED
@@ -1,42 +0,0 @@
1
- <div class="opc-wrapper">
2
- <div class="page-title">
3
- <?php echo $this->getChildHtml('checkoutCallout') ?>
4
- <h1><?php echo $this->__('Checkout') ?></h1>
5
- </div>
6
- <script type="text/javascript" src="<?php echo $this->getJsUrl('varien/accordion.js') ?>"></script>
7
- <script type="text/javascript" src="<?php echo $this->getSkinUrl('js/opcheckout.js') ?>"></script>
8
- <script type="text/javascript" src="<?php echo $this->getJsUrl('bancasellapro/gestpayform.js') ?>"></script>
9
- <script type="text/javascript">countryRegions = <?php echo $this->helper('directory')->getRegionJson() ?></script>
10
- <div class="opc-progress-container" id="col-right-opcheckout">
11
- <?php echo $this->getChildHtml('checkoutProgress') ?>
12
- </div>
13
- <ol class="opc" id="checkoutSteps">
14
- <?php $i=0; foreach($this->getSteps() as $_stepId => $_stepInfo): ?>
15
- <?php if (!$this->getChild($_stepId) || !$this->getChild($_stepId)->isShow()): continue; endif; $i++ ?>
16
- <li id="opc-<?php echo $_stepId ?>" class="section<?php echo !empty($_stepInfo['allow'])?' allow':'' ?><?php echo !empty($_stepInfo['complete'])?' saved':'' ?>">
17
- <div class="step-title">
18
- <span class="number"><?php echo $i ?></span>
19
- <h2><?php echo $_stepInfo['label'] ?></h2>
20
- <!--<a href="#"><?php echo $this->__('Edit') ?></a>-->
21
- </div>
22
- <div id="checkout-step-<?php echo $_stepId ?>" class="step a-item" style="display:none;">
23
- <?php echo $this->getChildHtml($_stepId) ?>
24
- </div>
25
- </li>
26
- <?php endforeach ?>
27
- </ol>
28
- <script type="text/javascript">
29
- //<![CDATA[
30
- var accordion = new Accordion('checkoutSteps', '.step-title', true);
31
- <?php if($this->getActiveStep()): ?>
32
- accordion.openSection('opc-<?php echo $this->getActiveStep() ?>');
33
- <?php endif ?>
34
- var checkout = new Checkout(accordion,{
35
- progress: '<?php echo $this->getUrl('checkout/onepage/progress') ?>',
36
- review: '<?php echo $this->getUrl('checkout/onepage/review') ?>',
37
- saveMethod: '<?php echo $this->getUrl('checkout/onepage/saveMethod') ?>',
38
- failure: '<?php echo $this->getUrl('checkout/cart') ?>'}
39
- );
40
- //]]>
41
- </script>
42
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/locale/en_US/EasyNolo_BancaSellaPro.csv DELETED
@@ -1,7 +0,0 @@
1
- Attendi il completamento del pagamento, Wait for the completion of payment
2
- Attendi..., Wait
3
- Problema sulla verifica della carta,Problem on the card verification
4
- Continua su bancasella, Continue on bancasella website
5
- Conferma,Confirm
6
- Correggi i campi evidenziati,Please correct the highlighted fields
7
- 3D secure,3D secure
 
 
 
 
 
 
 
app/locale/it_IT/EasyNolo_BancaSellaPro.csv DELETED
@@ -1,7 +0,0 @@
1
- Attendi il completamento del pagamento,Attendi il completamento del pagamento
2
- Attendi...,Attendi...
3
- Problema sulla verifica della carta,Problema sulla verifica della carta
4
- Continua su bancasella,Continua su bancasella
5
- Conferma,Conferma
6
- Correggi i campi evidenziati,Correggi i campi evidenziati
7
- 3D secure,3D secure
 
 
 
 
 
 
 
package.xml CHANGED
@@ -1,18 +1,69 @@
1
  <?xml version="1.0"?>
2
  <package>
3
- <name>EasyNolo_BancaSellaPro</name>
4
- <version>1.4.0.0</version>
5
  <stability>stable</stability>
6
- <license>GNU General Public License (GPL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>Plugin UFFICIALE per integrare Magento con il sistema di pagamento online Banca Sella</summary>
10
- <description>Plugin UFFICIALE per integrare Magento con il sistema di pagamento online Banca Sella</description>
11
- <notes>Plugin UFFICIALE per integrare Magento con il sistema di pagamento online Banca Sella.</notes>
12
- <authors><author><name>EasyNolo Spa</name><user>easynolospa</user><email>ecommerce@sella.it</email></author></authors>
13
- <date>2016-06-25</date>
14
- <time>17:00:35</time>
15
- <contents><target name="magecommunity"><dir name="EasyNolo"><dir name="BancaSellaPro"><dir name="Block"><file name="Confirm3d.php" hash="1748f46552f38387d9ef7a206ef64994"/><file name="Form.php" hash="6ffa41645293b4d66a8c0069a1bee68c"/><file name="Newroot.php" hash="37bd80f36e789a5337a3daff1d2cf7ff"/><file name="Redirect.php" hash="97ab12024835edc02493de228d57947c"/><dir name="Tokenization"><file name="Newtoken.php" hash="e73bfa0b89c2f2e5d1b3196914fedbb0"/></dir><dir name="Utility"><file name="Text.php" hash="8453faf49af4d416492f98aa65b9868d"/></dir></dir><file name="Exception.php" hash="9de691c89f0eb1c280ef92c31d2aa6a8"/><dir name="Helper"><file name="Baseclient.php" hash="20dc76a3a04cc054eaf5b8bb7a1005af"/><file name="Crypt.php" hash="d28e0850445f8ecd5744e5e2f7edd417"/><file name="Data.php" hash="be76c6ea71b0aeb653d2857e31526669"/><file name="Recurringprofile.php" hash="b1b972f4a7abe50c5b6e3e032d465617"/><file name="S2s.php" hash="e8a8dab8f4b99768e7b12ff6a9fe66d4"/></dir><dir name="Model"><file name="Gestpay.php" hash="dde99b1114c8fb82b50183b117626f0f"/><file name="Observer.php" hash="d35f9a5373b88c9db94a75586250755d"/><dir name="Resource"><dir name="Token"><file name="Collection.php" hash="e6b6104f94e9dcd2d28927090552ee61"/></dir><file name="Token.php" hash="3539976882da08550b612ae0316c7628"/></dir><dir name="Sales"><dir name="Recurring"><file name="Profile.php" hash="644520b275a0f535eb6b881d50a2e708"/></dir></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Currency.php" hash="098d64776e12ec7599ff9339e5c504b5"/><file name="Language.php" hash="92f4275a8911cf9e22fda7e22596fdd0"/><file name="PaymentAction.php" hash="c78defcf9655741b2c8423eee7f3fbeb"/></dir></dir></dir><file name="Token.php" hash="272442207ef26d9e2b0ac53272dfb107"/><dir name="Webservice"><file name="Abstract.php" hash="3edc6e1eca436b52b74b080071326d01"/><file name="Wscryptdecrypt.php" hash="5b982fbf80ca0ea4cec652bb55342f8d"/><file name="Wss2s.php" hash="2141061fa7bc360b34de21dc495fc03b"/></dir></dir><dir name="controllers"><file name="GestpayController.php" hash="d04ea1e625c9dc95b13fe9628aff7b37"/><file name="JsonController.php" hash="161a211f82dc838561250e071d6a0adb"/><file name="TokenizationController.php" hash="b1bfb614514d26710bf9227d5597b605"/></dir><dir name="etc"><file name="config.xml" hash="b8afdb4afba870ac6673367ceb94ae97"/><file name="jstranslator.xml" hash="920aae1d6d4503df794d8830b60e500e"/><file name="system.xml" hash="72d973b7fcf1d83135c8e27d01e97114"/></dir><dir name="sql"><dir name="easynolo_bancasellapro_setup"><file name="install-1.3.0.php" hash="aa542fc162f55557dbaf3f93165b6944"/><file name="upgrade-1.3.0-1.3.1.php" hash="43f9171d7beeaf6b350f76778bb2eb35"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="EasyNolo_BancaSellaPro.xml" hash="822546906a1d54b670c2610cab8761fb"/></dir></target><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="EasyNolo_BancaSellaPro.xml.Onepage.txt" hash="08b9164dcc646e2629907b5e90b43fff"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="easynolo_bancasellapro.xml" hash="9ef47cbd2c4af6176bea6c1de8a722db"/></dir><dir name="template"><dir name="easynolo"><dir name="bancasellapro"><dir name="checkout"><file name="onepage.phtml" hash="e374b0ca92ccb73c811807c2123fb0c1"/><file name="onepage1-6.phtml" hash="09caee142bab0224dd8c3aa495ad6bdb"/></dir><dir name="gestpay"><file name="confirm3d.phtml" hash="8b7a1172989831dd741cd24608d4dce6"/><file name="form.phtml" hash="6b8826ba976d73228a78cf4dc84e8fe0"/><file name="form_onepagecheckout.phtml" hash="1e0f91cecb259f839f138d4f53d0f52a"/><file name="newtoken.phtml" hash="ae142dd4c59a7e8e6a2a30a65ebfb6e6"/><file name="redirect.phtml" hash="16fc850ca5955abf0a13ad9e0feb5d47"/></dir><dir name="page"><file name="redirect.phtml" hash="b4355d7f50036ac9bbe065c797466edb"/></dir></dir></dir></dir></dir></dir><dir name="enterprise"><dir name="default"><dir name="layout"><file name="easynolo_bancasellapro.xml" hash="7bc6d917f3b38f9842d1a7d142e56db7"/></dir><dir name="template"><dir name="easynolo"><dir name="bancasellapro"><dir name="checkout"><file name="onepage.phtml" hash="c1f9e27e9a1c0779c46b515b84e6ffd8"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="bancasellapro"><file name="gestpayform.js" hash="8f75369fcc80dcfc31ad1f18bce2e2fe"/><file name="gestpayform_onepagecheckout.js" hash="97db1734fba29bda71ce28ea759f2ea1"/><file name="newtoken.js" hash="857173a9ba1f338b43efcea124d95946"/></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="easynolo_bancasella"><file name="wait.gif" hash="c717328261f92d92c1b1f550d222e0e4"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="EasyNolo_BancaSellaPro.csv" hash="3a67c88f9e1ddce1d5304e276a78e774"/></dir><dir name="it_IT"><file name="EasyNolo_BancaSellaPro.csv" hash="70be36e7a2ee8f97a195426d0b813160"/></dir></target></contents>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  <compatible/>
17
- <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
+ <name>EASYNOLOBANCASELLAPRO</name>
4
+ <version>1.4.6.0</version>
5
  <stability>stable</stability>
6
+ <license>GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>OFFICIAL extension for Magento that allow customers to pay through the GestPay payment gateway by Banca Sella</summary>
10
+ <description>&lt;p&gt;This module, provided by Easy Nolo (&lt;a href="https://www.easynolo.it"&gt;www.easynolo.it&lt;/a&gt;), is the OFFICIAL extension for Magento to enable in your online store a payment method that allow users to pay through credit cards supported by payment gateway GestPay of Banca Sella (&lt;a href="http://www.sella.it/"&gt;www.sella.it&lt;/a&gt;). The integration method implemented provide:&#xD;
11
+ &lt;ul&gt;&#xD;
12
+ &lt;li&gt;credit card payment through the redirection of the user to the page of Banca Sella payment gateway "GestPay" and subsequent return to the online store at the end of the transaction;&lt;/li&gt;&#xD;
13
+ &lt;li&gt;payment through iFrame Payent Page, in this case the Credit Card data will be send to Banca Sella from the Store Checkout Page, without redirection to the Banca Sella payment gateway.&lt;/li&gt;&#xD;
14
+ &lt;/ul&gt;&lt;/p&gt;&#xD;
15
+ &#xD;
16
+ &lt;h2&gt;Features&lt;/h2&gt;&#xD;
17
+ &lt;ul&gt;&#xD;
18
+ &lt;li&gt;Redirection of the user on the payment page of Banca Sella&lt;/li&gt;&#xD;
19
+ &lt;li&gt;iFrame Payment Page integration *&lt;/li&gt;&#xD;
20
+ &lt;li&gt;Magento built-in Recurring Profile Payments *&lt;/li&gt;&#xD;
21
+ &lt;li&gt;ReD fraud prevention *&lt;/li&gt;&#xD;
22
+ &lt;li&gt;Riskified fraud prevention *&lt;/li&gt;&#xD;
23
+ &lt;li&gt;One click payment with tokenization *&lt;/li&gt;&#xD;
24
+ &lt;li&gt;Account section for credit cards management *&lt;/li&gt;&#xD;
25
+ &lt;li&gt;Capture, Void, Refund through Magento built-in Invoicing system *&lt;/li&gt;&#xD;
26
+ &lt;li&gt;Ability to configure the Status of the order in case of payment is confirmed/canceled by Banca Sella or canceled by the user&lt;/li&gt;&#xD;
27
+ &lt;li&gt;Test Mode: payments will be send to https://testecomm.sella.it&lt;/li&gt;&#xD;
28
+ &lt;li&gt;Debug Mode: ability to turn on logging of the activities of the module. The logs are saved in the folder var/log of Magento installation&lt;/li&gt;&#xD;
29
+ &lt;/ul&gt;&#xD;
30
+ &#xD;
31
+ &lt;p&gt;* available only if configured on GestPay backend as well.&lt;/p&gt;&#xD;
32
+ &#xD;
33
+ &lt;h2&gt;Compatibility&lt;/h2&gt;&#xD;
34
+ &lt;p&gt;This module is compatible with these major Magento versions:&lt;/p&gt;&#xD;
35
+ &lt;ul&gt;&#xD;
36
+ &lt;li&gt;CE 1.7.0.2&lt;/li&gt;&#xD;
37
+ &lt;li&gt;CE 1.8.1.0&lt;/li&gt;&#xD;
38
+ &lt;li&gt;CE 1.9.2.4&lt;/li&gt;&#xD;
39
+ &lt;li&gt;CE 1.9.3.0&lt;/li&gt;&#xD;
40
+ &lt;/ul&gt;&#xD;
41
+ &#xD;
42
+ &lt;h2&gt;System Requirements&lt;/h2&gt;&#xD;
43
+ &lt;ul&gt;&#xD;
44
+ &lt;li&gt;PHP &gt;= 5.2.0&lt;/li&gt;&#xD;
45
+ &lt;li&gt;OpenSSL PHP extension&lt;/li&gt;&#xD;
46
+ &lt;li&gt;Curl PHP extension&lt;/li&gt;&#xD;
47
+ &lt;/ul&gt;&#xD;
48
+ &#xD;
49
+ &lt;h2&gt;Documentation&lt;/h2&gt;&#xD;
50
+ &lt;p&gt;If you have any issues with this extension, please refer to the &lt;a href="https://www.sella.it/gestpay/assets/pdf/EasyNolo_BancaSellaPro_v1.4.0.0_finale.pdf"&gt;Documentation&lt;/a&gt;&lt;/p&gt;&#xD;
51
+ &#xD;
52
+ &lt;h2&gt;Support&lt;/h2&gt;&#xD;
53
+ &lt;p /&gt;If you have any issues with this extension, please send an email to &lt;a href="mailto:ecommerce@sella.it"&gt;ecommerce@sella.it&lt;/a&gt;</description>
54
+ <notes>New features&#xD;
55
+ &lt;ul&gt;&#xD;
56
+ &lt;li&gt;ReD fraud prevention&lt;/li&gt;&#xD;
57
+ &lt;li&gt;Riskified fraud prevention&lt;/li&gt;&#xD;
58
+ &lt;li&gt;One click payment with tokenization&lt;/li&gt;&#xD;
59
+ &lt;li&gt;Account section for credit cards management&lt;/li&gt;&#xD;
60
+ &lt;/ul&gt;&#xD;
61
+ &#xD;
62
+ Please note: with this release the support for IWD one page checkout is unstable.</notes>
63
+ <authors><author><name>Easy Nolo SpA</name><user>easy_nolo</user><email>alessio.damonti@sella.it</email></author></authors>
64
+ <date>2017-02-22</date>
65
+ <time>19:08:31</time>
66
+ <contents><target name="magecommunity"><dir name="EasyNolo"><dir name="BancaSellaPro"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Gestpayinfo.php" hash="757a9fcc598903ef14f65ea60346973c"/><file name="Redinfo.php" hash="04e51c6969ae71afa2d97ea83a53c46a"/><file name="Riskifiedinfo.php" hash="be096697a36f22dd3e8b3a9aaad71437"/></dir></dir></dir><file name="Confirm3d.php" hash="1748f46552f38387d9ef7a206ef64994"/><file name="Form.php" hash="a8e2f0736a7753ab0b71855d0d40d68a"/><file name="Newroot.php" hash="37bd80f36e789a5337a3daff1d2cf7ff"/><file name="Redirect.php" hash="97ab12024835edc02493de228d57947c"/><dir name="Tokenization"><file name="List.php" hash="c429369a6bc2da9a21288339627c01aa"/><file name="Newtoken.php" hash="79340d48c433c20b8f920811aa14e8ac"/></dir><dir name="Utility"><file name="Text.php" hash="8453faf49af4d416492f98aa65b9868d"/></dir></dir><file name="Exception.php" hash="9de691c89f0eb1c280ef92c31d2aa6a8"/><dir name="Helper"><dir name="AlternativePayments"><file name="Ideal.php" hash="3fa26538914d9b088ba05d2c1361fef2"/><file name="Mybank.php" hash="599bb3d3f3ba6ea3b26f1e29f97bd52a"/><file name="Paypal.php" hash="8a02cea05c5c7c942858c774e9f32b03"/><file name="Sofort.php" hash="e715ba758ffebadbdef6122f6691993a"/></dir><file name="Baseclient.php" hash="9467261ed60b06ec2880741100c2c340"/><file name="Crypt.php" hash="2426982616bbabd8e472215ef467d1ab"/><file name="Data.php" hash="25c108a2cf883a8ca109c95cbcf89eb9"/><file name="Recurringprofile.php" hash="19300223aaa39527a9105fdc11a2dd7d"/><file name="Red.php" hash="d493b6a060a72e0c0ec5f432b96ab945"/><file name="Riskified.php" hash="ede6cc0d78d4f9506c553fdd190b63a2"/><file name="S2s.php" hash="834d7a8bf15e56c97657e06df0ba93d1"/></dir><dir name="Model"><file name="Gestpay.php" hash="bb6784bda7698e47e1c101450d03bdf8"/><file name="Observer.php" hash="62878d1a497eb59f45c2646c28fcf1b6"/><dir name="Resource"><dir name="Sales"><dir name="Order"><dir name="FingerPrint"><file name="Collection.php" hash="f7a7a232e6151cb83034281f843fba92"/></dir><file name="FingerPrint.php" hash="ffc79ae2661bc2afe460678de49c4248"/></dir></dir><dir name="Token"><file name="Collection.php" hash="e6b6104f94e9dcd2d28927090552ee61"/></dir><file name="Token.php" hash="3539976882da08550b612ae0316c7628"/></dir><dir name="Sales"><dir name="Order"><file name="FingerPrint.php" hash="a101ec48a1016362d8ac7ba8cc127939"/></dir><dir name="Recurring"><file name="Profile.php" hash="644520b275a0f535eb6b881d50a2e708"/></dir></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Currency.php" hash="098d64776e12ec7599ff9339e5c504b5"/><file name="FraudOrderStatus.php" hash="a1217938da5d7e1a305d5c746e3ac16e"/><file name="Language.php" hash="92f4275a8911cf9e22fda7e22596fdd0"/><file name="OrderStatus.php" hash="00a4cad29a4de65b1129f38496b057b7"/><file name="PaymentAction.php" hash="c78defcf9655741b2c8423eee7f3fbeb"/><file name="TokenizationContext.php" hash="dfba2748ab39b4e47ddfafca6dce8363"/></dir></dir></dir><file name="Token.php" hash="24af355118b97004990358e5128ca56e"/><dir name="Webservice"><file name="Abstract.php" hash="3edc6e1eca436b52b74b080071326d01"/><file name="Wscryptdecrypt.php" hash="0da6aa1d6cba7e18720ad70f9ea4f2f5"/><file name="Wss2s.php" hash="64ae83ababa31e05e44160bc58763d92"/></dir></dir><dir name="_additional_structure"><dir name="app"><dir name="design"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="easynolo_bancasellapro.xml" hash="b8cd400aa5cad187a460875a770594d2"/></dir><dir name="template"><dir name="easynolo"><dir name="bancasellapro"><dir name="gestpay"><file name="confirm3d.phtml" hash="8b7a1172989831dd741cd24608d4dce6"/><file name="form.phtml" hash="b620c85066f144cf41b7f7ed9bb4677a"/><file name="form_onepagecheckout.phtml" hash="93ae9ef2beabb96c8dde20ecf1db01ad"/><file name="iframe.phtml" hash="3d9d8f37d5a3f18c4f5c6cb6d09ebbd0"/><file name="newtoken.phtml" hash="b9b6b99fcd4968961b42339ba9536429"/><file name="redirect.phtml" hash="16fc850ca5955abf0a13ad9e0feb5d47"/><file name="riskified.phtml" hash="6f8aabdc6e8bf2da5ae75a039b2746ff"/><dir name="token"><file name="list.phtml" hash="be694e81b2da8d1827ce11a84f980ff6"/></dir></dir><dir name="page"><file name="redirect.phtml" hash="b4355d7f50036ac9bbe065c797466edb"/></dir></dir></dir></dir></dir></dir><dir name="enterprise"><dir name="default"><dir name="layout"><file name="easynolo_bancasellapro.xml" hash="bfd503f91a9592e74f4e388ce02c86ca"/></dir></dir></dir></dir></dir><dir name="etc"><dir name="modules"><file name="EasyNolo_BancaSellaPro.xml" hash="822546906a1d54b670c2610cab8761fb"/><file name="EasyNolo_BancaSellaPro.xml.Onepage.txt" hash="08b9164dcc646e2629907b5e90b43fff"/></dir></dir><dir name="locale"><dir name="en_US"><file name="EasyNolo_BancaSellaPro.csv" hash="1a6de8af46571d3f12bb4ce82da04029"/></dir><dir name="it_IT"><file name="EasyNolo_BancaSellaPro.csv" hash="0a5a3a4e2bb19b1bfb89dbca7f4850de"/></dir></dir></dir><dir name="js"><dir name="bancasellapro"><file name="gestpayform.js" hash="d0f1c5a486b66a0cd2b348ecf4b04e0b"/><file name="gestpayform_onepagecheckout.js" hash="01ae24adfa9701e4b1aba794650524cb"/><file name="newtoken.js" hash="98bb4c44bf502c53159fe6314d7f84b5"/><file name="red_blackbox.js" hash="d6ced1d3b0aaca6b763b7c47b804cee2"/><file name="riskified.js" hash="b944efe6f4ff018dcc1cd51c65fc3962"/></dir></dir><dir name="skin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="bancasellapro"><file name="gestpay.png" hash="55262a719e16c5c430e9e5b3c9514ce8"/><file name="red.png" hash="8d66e8c43c23f2665a85da5cc8287f0a"/><file name="riskified.png" hash="fb954640772e6e5f086541af5a99933c"/></dir><file name=".DS_Store" hash="f7847ee6fe55e78f563bb8eb8ff98eb0"/></dir><file name=".DS_Store" hash="81c7b110dc744add1c8adfe8d840f168"/></dir><file name=".DS_Store" hash="6532038dadb62592144f6493050d41a4"/></dir><file name=".DS_Store" hash="6532038dadb62592144f6493050d41a4"/></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="easynolo_bancasella"><file name="wait.gif" hash="c717328261f92d92c1b1f550d222e0e4"/></dir></dir><dir name="js"><dir name="easynolo_bancasella"><file name="gestpayform_onepagecheckout.js" hash="cb5f6557891d62a8d1036ac391daa376"/></dir></dir></dir></dir></dir><file name=".DS_Store" hash="45d69d6eb93bfa61459ebff9cbabcca1"/></dir><file name=".DS_Store" hash="5035bbba8a0f9b65ba299644037d06e4"/></dir><dir name="controllers"><file name="GestpayController.php" hash="dcac2e7116c5df57836ad7882656509e"/><file name="JsonController.php" hash="161a211f82dc838561250e071d6a0adb"/><file name="TokenizationController.php" hash="c6f33d49764033dc800186f764924802"/></dir><dir name="etc"><file name="config.xml" hash="e49c28a61e9aa647ede810bdcbb02862"/><file name="jstranslator.xml" hash="920aae1d6d4503df794d8830b60e500e"/><file name="system.xml" hash="0f460e922490122b3c8c73394902584a"/></dir><dir name="sql"><dir name="easynolo_bancasellapro_setup"><file name="install-1.3.0.php" hash="aa542fc162f55557dbaf3f93165b6944"/><file name="upgrade-1.3.0-1.3.1.php" hash="43f9171d7beeaf6b350f76778bb2eb35"/><file name="upgrade-1.4.2-1.4.3.php" hash="8b37559eb7129dab7705d4a0a9729d6a"/><file name="upgrade-1.4.3-1.4.4.php" hash="0b51164f6b9433ff3d51b7e3257025f4"/><file name="upgrade-1.4.4-1.4.5.php" hash="abb3f09e985c6911b0576a16812242ee"/><file name="upgrade-1.4.5-1.4.6.php" hash="aa1878bb0a9970e68fa9502e4380981a"/></dir></dir><file name=".DS_Store" hash="52cbad6360a0516bba6a86a3187846e7"/><file name=".project" hash="95ae41fab13d551617313d17856e6998"/></dir><file name=".DS_Store" hash="4969bb9919a3a8a4b531eafa1dadc929"/></dir></target></contents>
67
  <compatible/>
68
+ <dependencies><required><php><min>5.2.0</min><max>5.6.0</max></php></required></dependencies>
69
  </package>