Adyen_Payment - Version 2.1.0

Version Notes

Features & Fixes
* Show OneClick payments in Magento checkout
* New API payment method SEPA
* Add discount for the payment method open invoice (karna/Afterpay)
* Optimized UI in the payment step (for the default OnePage checkout and the OneStepCheckout module)
* Build in scan functionality for using Magento as cash register solution
* express checkout button for payments through the Adyen Shuttle
* Creditcard installments can now be setup foreach creditcard type
* Installment rate (in %) is now added to the installment setup
* For Klarna it is now possible to show date of birth and gender only when you select payment method open invoice
* Multicurrency problem with Api Payments solved
* Show reservationNumber for Klarna and AfterPay in the payment information of the order
* Directory lookup call to retrieve the payment methods shown in the payment step can now be cached for better performance
* Payment methods can now be sorted in the front-end
* Boleto firstname and lastname automatically filled in based on billing information
* For Boleto payments the paid amount is now shown in the payment information of the order detail page
* Possible to select different status for Boleto if the payment is overpaid or underpaid
* Full refund will send in Cancel\Refund request to Adyen if payment is not yet captured the order will be cancelled
* For payment method Klarna and after pay the fields are disabled on the Adyen HPP
* Payment methods in the checkout give back the language specific payment method text
* Add after pay logo in magento checkout
* Plugin version number and links for setting up now visible in the Adyen General settings sections

Download this release

Release Info

Developer Adyen
Extension Adyen_Payment
Version 2.1.0
Comparing to
See all releases


Code changes from version 2.0.3 to 2.1.0

Files changed (90) hide show
  1. app/code/community/Adyen/Payment/.DS_Store +0 -0
  2. app/code/community/Adyen/Payment/Block/Adminhtml/Form/Field/Installments.php +5 -1
  3. app/code/community/Adyen/Payment/Block/Adminhtml/Sales/Order/Creditmemo/Totals.php +62 -0
  4. app/code/community/Adyen/Payment/Block/Adminhtml/Sales/Order/Filter/Adyen.php +34 -1
  5. app/code/community/Adyen/Payment/Block/Adminhtml/Sales/Order/Invoice/Totals.php +63 -0
  6. app/code/community/Adyen/Payment/Block/Adminhtml/Sales/Order/Totals.php +63 -0
  7. app/code/community/Adyen/Payment/Block/Adminhtml/Version.php +9 -0
  8. app/code/community/Adyen/Payment/Block/Form/Boleto.php +31 -0
  9. app/code/community/Adyen/Payment/Block/Form/Hpp.php +2 -2
  10. app/code/community/Adyen/Payment/Block/Form/Oneclick.php +42 -0
  11. app/code/community/Adyen/Payment/Block/Form/Openinvoice.php +89 -0
  12. app/code/community/Adyen/Payment/Block/Form/Sepa.php +35 -0
  13. app/code/community/Adyen/Payment/Block/Info/Oneclick.php +31 -0
  14. app/code/community/Adyen/Payment/Block/Info/Sepa.php +43 -0
  15. app/code/community/Adyen/Payment/Block/PosExpressCheckout.php +41 -0
  16. app/code/community/Adyen/Payment/Block/Redirect.php +6 -2
  17. app/code/community/Adyen/Payment/Block/Sales/Order/Totals.php +62 -0
  18. app/code/community/Adyen/Payment/Block/ScanProduct.php +36 -0
  19. app/code/community/Adyen/Payment/Helper/Data.php +100 -23
  20. app/code/community/Adyen/Payment/Helper/Installments.php +21 -8
  21. app/code/community/Adyen/Payment/Model/.DS_Store +0 -0
  22. app/code/community/Adyen/Payment/Model/Adyen/.DS_Store +0 -0
  23. app/code/community/Adyen/Payment/Model/Adyen/Abstract.php +113 -7
  24. app/code/community/Adyen/Payment/Model/Adyen/Cc.php +84 -11
  25. app/code/community/Adyen/Payment/Model/Adyen/Data/Abstract.php +0 -5
  26. app/code/community/Adyen/Payment/Model/Adyen/Data/BankAccount.php +34 -0
  27. app/code/community/Adyen/Payment/Model/Adyen/Data/IdealPaymentRequest.php +2 -1
  28. app/code/community/Adyen/Payment/Model/Adyen/Data/Installments.php +32 -0
  29. app/code/community/Adyen/Payment/Model/Adyen/Data/InvoiceRow.php +4 -3
  30. app/code/community/Adyen/Payment/Model/Adyen/Data/ModificationRequest.php +6 -6
  31. app/code/community/Adyen/Payment/Model/Adyen/Data/OpenInvoiceDetailResult.php +26 -17
  32. app/code/community/Adyen/Payment/Model/Adyen/Data/PaymentRequest.php +74 -19
  33. app/code/community/Adyen/Payment/Model/Adyen/Data/Recurring.php +0 -3
  34. app/code/community/Adyen/Payment/Model/Adyen/Hpp.php +473 -437
  35. app/code/community/Adyen/Payment/Model/Adyen/Oneclick.php +114 -0
  36. app/code/community/Adyen/Payment/Model/Adyen/Openinvoice.php +197 -105
  37. app/code/community/Adyen/Payment/Model/Adyen/Pos.php +1 -1
  38. app/code/community/Adyen/Payment/Model/Adyen/Sepa.php +128 -0
  39. app/code/community/Adyen/Payment/Model/Event.php +6 -3
  40. app/code/community/Adyen/Payment/Model/Mysql4/Adyen/Event.php +14 -3
  41. app/code/community/Adyen/Payment/Model/Observer.php +0 -22
  42. app/code/community/Adyen/Payment/Model/Process.php +459 -356
  43. app/code/community/Adyen/Payment/Model/Sales/Quote/Address/Total/PaymentFee.php +70 -0
  44. app/code/community/Adyen/Payment/Model/Sales/Quote/Address/Total/PaymentInstallmentFee.php +120 -0
  45. app/code/community/Adyen/Payment/Model/Total/PaymentFee/Creditmemo.php +36 -0
  46. app/code/community/Adyen/Payment/Model/Total/PaymentFee/Invoice.php +36 -0
  47. app/code/community/Adyen/Payment/Model/Total/PaymentInstallmentFee/Creditmemo.php +36 -0
  48. app/code/community/Adyen/Payment/Model/Total/PaymentInstallmentFee/Invoice.php +36 -0
  49. app/code/community/Adyen/Payment/controllers/CheckoutPosController.php +85 -0
  50. app/code/community/Adyen/Payment/controllers/GetInstallmentsController.php +105 -0
  51. app/code/community/Adyen/Payment/controllers/UpdateCartController.php +77 -0
  52. app/code/community/Adyen/Payment/docs/.DS_Store +0 -0
  53. app/code/community/Adyen/Payment/etc/Payment.wsdl +923 -1133
  54. app/code/community/Adyen/Payment/etc/config.xml +140 -52
  55. app/code/community/Adyen/Payment/etc/system.xml +430 -103
  56. app/code/community/Adyen/Payment/sql/adyen_setup/mysql4-upgrade-2.0.3-2.1.0.php +41 -0
  57. app/design/adminhtml/default/default/template/adyen/form/hpp.phtml +1 -1
  58. app/design/adminhtml/default/default/template/adyen/form/sepa.phtml +110 -0
  59. app/design/adminhtml/default/default/template/adyen/info/boleto.phtml +3 -0
  60. app/design/adminhtml/default/default/template/adyen/info/cc.phtml +13 -1
  61. app/design/adminhtml/default/default/template/adyen/info/hpp.phtml +4 -1
  62. app/design/adminhtml/default/default/template/adyen/info/openinvoice.phtml +5 -0
  63. app/design/adminhtml/default/default/template/adyen/info/sepa.phtml +49 -0
  64. app/design/adminhtml/default/default/template/adyen/order/view/history.phtml +80 -0
  65. app/design/frontend/base/default/layout/adyen.xml +22 -0
  66. app/design/frontend/base/default/template/adyen/form/boleto.phtml +2 -2
  67. app/design/frontend/base/default/template/adyen/form/cc.phtml +49 -0
  68. app/design/frontend/base/default/template/adyen/form/hpp.phtml +107 -76
  69. app/design/frontend/base/default/template/adyen/form/oneclick.phtml +340 -0
  70. app/design/frontend/base/default/template/adyen/form/openinvoice.phtml +59 -9
  71. app/design/frontend/base/default/template/adyen/form/sepa.phtml +108 -0
  72. app/design/frontend/base/default/template/adyen/info/sepa.phtml +33 -0
  73. app/design/frontend/base/default/template/adyen/posExpressCheckout.phtml +14 -0
  74. app/design/frontend/base/default/template/adyen/scanProduct.phtml +143 -0
  75. app/design/frontend/default/adyen/template/checkout/onepage/payment/methods.phtml +149 -0
  76. app/design/frontend/default/adyen/template/onestepcheckout/checkout.phtml +1319 -0
  77. app/design/frontend/default/adyen/template/onestepcheckout/payment_method.phtml +217 -0
  78. app/design/frontend/enterprise/adyen/template/checkout/onepage/payment/methods.phtml +139 -0
  79. app/design/frontend/enterprise/adyen/template/onestepcheckout/checkout.phtml +1319 -0
  80. app/design/frontend/enterprise/adyen/template/onestepcheckout/payment_method.phtml +217 -0
  81. app/design/frontend/rwd/adyen/template/checkout/onepage/payment/methods.phtml +149 -0
  82. app/design/frontend/rwd/adyen/template/onestepcheckout/checkout.phtml +1319 -0
  83. app/design/frontend/rwd/adyen/template/onestepcheckout/payment_method.phtml +217 -0
  84. js/adyen/payment/adyen.encrypt.js +56 -60
  85. package.xml +28 -8
  86. skin/frontend/base/default/css/adyenstyle.css +17 -1
  87. skin/frontend/base/default/images/adyen/afterpay_default.png +0 -0
  88. skin/frontend/default/adyen/onestepcheckout/js/onestepcheckout.js +1051 -0
  89. skin/frontend/enterprise/adyen/onestepcheckout/js/onestepcheckout.js +1051 -0
  90. skin/frontend/rwd/adyen/onestepcheckout/js/onestepcheckout.js +1051 -0
app/code/community/Adyen/Payment/.DS_Store ADDED
Binary file
app/code/community/Adyen/Payment/Block/Adminhtml/Form/Field/Installments.php CHANGED
@@ -47,13 +47,17 @@ class Adyen_Payment_Block_Adminhtml_Form_Field_Installments extends Mage_Adminht
47
  'style' => 'width:100px',
48
  ));
49
  $this->addColumn('installment_boundary', array(
50
- 'label' => Mage::helper('adyen')->__('Minor Units (incl.)'),
51
  'style' => 'width:100px',
52
  ));
53
  $this->addColumn('installment_frequency', array(
54
  'label' => Mage::helper('adyen')->__('Maximum Number of Installments'),
55
  'style' => 'width:100px',
56
  ));
 
 
 
 
57
  $this->_addAfter = false;
58
  $this->_addButtonLabel = Mage::helper('adyen')->__('Add Installment Boundary');
59
  }
47
  'style' => 'width:100px',
48
  ));
49
  $this->addColumn('installment_boundary', array(
50
+ 'label' => Mage::helper('adyen')->__('Amount (incl.)'),
51
  'style' => 'width:100px',
52
  ));
53
  $this->addColumn('installment_frequency', array(
54
  'label' => Mage::helper('adyen')->__('Maximum Number of Installments'),
55
  'style' => 'width:100px',
56
  ));
57
+ $this->addColumn('installment_interest', array(
58
+ 'label' => Mage::helper('adyen')->__('Interest Rate (%)'),
59
+ 'style' => 'width:100px',
60
+ ));
61
  $this->_addAfter = false;
62
  $this->_addButtonLabel = Mage::helper('adyen')->__('Add Installment Boundary');
63
  }
app/code/community/Adyen/Payment/Block/Adminhtml/Sales/Order/Creditmemo/Totals.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adyen Payment Module
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Adyen
17
+ * @package Adyen_Payment
18
+ * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ /**
22
+ * @category Payment Gateway
23
+ * @package Adyen_Payment
24
+ * @author Adyen
25
+ * @property Adyen B.V
26
+ * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
27
+ */
28
+ class Adyen_Payment_Block_Adminhtml_Sales_Order_Creditmemo_Totals extends Mage_Adminhtml_Block_Sales_Order_Creditmemo_Totals {
29
+
30
+ protected function _initTotals()
31
+ {
32
+ parent::_initTotals();
33
+ $this->addTotal(
34
+ new Varien_Object(
35
+ array(
36
+ 'code' => 'payment_fee',
37
+ 'strong' => false,
38
+ 'value' => $this->getSource()->getPaymentFeeAmount(),
39
+ 'base_value'=> $this->getSource()->getBasePaymentFeeAmount(),
40
+ 'label' => $this->helper('adyen')->__('Payment Fee'),
41
+ 'area' => '',
42
+ )
43
+ ),
44
+ 'subtotal'
45
+ );
46
+
47
+ $this->addTotal(
48
+ new Varien_Object(
49
+ array(
50
+ 'code' => 'payment_installment_fee',
51
+ 'strong' => false,
52
+ 'value' => $this->getSource()->getPaymentInstallmentFeeAmount(),
53
+ 'base_value'=> $this->getSource()->getBasePaymentInstallmentFeeAmount(),
54
+ 'label' => $this->helper('adyen')->__('Payment Fee Installments'),
55
+ 'area' => '',
56
+ )
57
+ ),
58
+ 'subtotal'
59
+ );
60
+ return $this;
61
+ }
62
+ }
app/code/community/Adyen/Payment/Block/Adminhtml/Sales/Order/Filter/Adyen.php CHANGED
@@ -33,7 +33,40 @@ class Adyen_Payment_Block_Adminhtml_Sales_Order_Filter_Adyen extends Mage_Adminh
33
  array('label' => '', 'value' => null),
34
  );
35
  foreach ($events as $event) {
36
- $select[] = array('label' => $event['adyen_event_result'], 'value' => $event['adyen_event_result']);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  }
38
  return $select;
39
  }
33
  array('label' => '', 'value' => null),
34
  );
35
  foreach ($events as $event) {
36
+
37
+
38
+ switch($event['adyen_event_result']) {
39
+
40
+ case Adyen_Payment_Model_Event::ADYEN_EVENT_CAPTURE:
41
+ case Adyen_Payment_Model_Event::ADYEN_EVENT_CAPTURE_FAILED:
42
+ case Adyen_Payment_Model_Event::ADYEN_EVENT_REFUND:
43
+ case Adyen_Payment_Model_Event::ADYEN_EVENT_CANCEL_OR_REFUND:
44
+ case Adyen_Payment_Model_Event::ADYEN_EVENT_AUTHORISATION:
45
+
46
+ if ($event['adyen_event_result'] == Adyen_Payment_Model_Event::ADYEN_EVENT_REFUND) {
47
+ $eventNamePartialTrue = "(PARTIAL) " . $event['adyen_event_result'] . " : " . "TRUE";
48
+ $eventNamePartialFalse = "(PARTIAL) " . $event['adyen_event_result'] . " : " . "FALSE";
49
+
50
+ $select[] = array('label' => $eventNamePartialTrue, 'value' => $eventNamePartialTrue);
51
+ $select[] = array('label' => $eventNamePartialFalse, 'value' => $eventNamePartialFalse);
52
+ }
53
+
54
+ $eventNameTrue = $event['adyen_event_result'] . " : " . "TRUE";
55
+ $eventNameFalse = $event['adyen_event_result'] . " : " . "FALSE";
56
+ $select[] = array('label' => $eventNameTrue, 'value' => $eventNameTrue);
57
+ $select[] = array('label' => $eventNameFalse, 'value' => $eventNameFalse);
58
+
59
+ break;
60
+ default:
61
+ $select[] = array('label' => $event['adyen_event_result'], 'value' => $event['adyen_event_result']);
62
+ break;
63
+ }
64
+
65
+
66
+
67
+
68
+
69
+
70
  }
71
  return $select;
72
  }
app/code/community/Adyen/Payment/Block/Adminhtml/Sales/Order/Invoice/Totals.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adyen Payment Module
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Adyen
17
+ * @package Adyen_Payment
18
+ * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ /**
22
+ * @category Payment Gateway
23
+ * @package Adyen_Payment
24
+ * @author Adyen
25
+ * @property Adyen B.V
26
+ * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
27
+ */
28
+ class Adyen_Payment_Block_Adminhtml_Sales_Order_Invoice_Totals extends Mage_Adminhtml_Block_Sales_Order_Invoice_Totals {
29
+
30
+ protected function _initTotals()
31
+ {
32
+ parent::_initTotals();
33
+ $this->addTotal(
34
+ new Varien_Object(
35
+ array(
36
+ 'code' => 'payment_fee',
37
+ 'strong' => false,
38
+ 'value' => $this->getSource()->getPaymentFeeAmount(),
39
+ 'base_value'=> $this->getSource()->getBasePaymentFeeAmount(),
40
+ 'label' => $this->helper('adyen')->__('Payment Fee'),
41
+ 'area' => '',
42
+ )
43
+ ),
44
+ 'subtotal'
45
+ );
46
+
47
+ $this->addTotal(
48
+ new Varien_Object(
49
+ array(
50
+ 'code' => 'payment_installment_fee',
51
+ 'strong' => false,
52
+ 'value' => $this->getSource()->getPaymentInstallmentFeeAmount(),
53
+ 'base_value'=> $this->getSource()->getBasePaymentInstallmentFeeAmount(),
54
+ 'label' => $this->helper('adyen')->__('Payment Fee Installments'),
55
+ 'area' => '',
56
+ )
57
+ ),
58
+ 'subtotal'
59
+ );
60
+
61
+ return $this;
62
+ }
63
+ }
app/code/community/Adyen/Payment/Block/Adminhtml/Sales/Order/Totals.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adyen Payment Module
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Adyen
17
+ * @package Adyen_Payment
18
+ * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ /**
22
+ * @category Payment Gateway
23
+ * @package Adyen_Payment
24
+ * @author Adyen
25
+ * @property Adyen B.V
26
+ * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
27
+ */
28
+ class Adyen_Payment_Block_Adminhtml_Sales_Order_Totals extends Mage_Sales_Block_Order_Totals {
29
+
30
+ protected function _initTotals()
31
+ {
32
+ parent::_initTotals();
33
+ $this->addTotal(
34
+ new Varien_Object(
35
+ array(
36
+ 'code' => 'payment_fee',
37
+ 'strong' => false,
38
+ 'value' => $this->getSource()->getPaymentFeeAmount(),
39
+ 'base_value'=> $this->getSource()->getBasePaymentFeeAmount(),
40
+ 'label' => $this->helper('adyen')->__('Payment Fee'),
41
+ 'area' => '',
42
+ )
43
+ ),
44
+ 'subtotal'
45
+ );
46
+
47
+ $this->addTotal(
48
+ new Varien_Object(
49
+ array(
50
+ 'code' => 'payment_installment_fee',
51
+ 'strong' => false,
52
+ 'value' => $this->getSource()->getPaymentInstallmentFeeAmount(),
53
+ 'base_value'=> $this->getSource()->getBasePaymentInstallmentFeeAmount(),
54
+ 'label' => $this->helper('adyen')->__('Payment Fee Installments'),
55
+ 'area' => '',
56
+ )
57
+ ),
58
+ 'subtotal'
59
+ );
60
+
61
+ return $this;
62
+ }
63
+ }
app/code/community/Adyen/Payment/Block/Adminhtml/Version.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Adyen_Payment_Block_Adminhtml_Version extends Mage_Adminhtml_Block_System_Config_Form_Field
4
+ {
5
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
6
+ {
7
+ return (string) Mage::helper('adyen')->getExtensionVersion();
8
+ }
9
+ }
app/code/community/Adyen/Payment/Block/Form/Boleto.php CHANGED
@@ -41,4 +41,35 @@ class Adyen_Payment_Block_Form_Boleto extends Mage_Payment_Block_Form {
41
  return $this->getMethod()->getAvailableBoletoTypes();
42
  }
43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  }
41
  return $this->getMethod()->getAvailableBoletoTypes();
42
  }
43
 
44
+
45
+ public function getFirstname() {
46
+ $firstname = "";
47
+
48
+ // check if user is logged in
49
+ if (Mage::getSingleton('customer/session')->isLoggedIn()) {
50
+ /* Get the customer data */
51
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
52
+ $firstname = $customer->getFirstname();
53
+
54
+ } else {
55
+ $firstname = Mage::getSingleton('checkout/session')->getQuote()->getBillingAddress()->getFirstname();
56
+ }
57
+ return $firstname;
58
+ }
59
+
60
+ public function getLastname() {
61
+ $lastname = "";
62
+
63
+ // check if user is logged in
64
+ if (Mage::getSingleton('customer/session')->isLoggedIn()) {
65
+ /* Get the customer data */
66
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
67
+ $lastname = $customer->getLastname();
68
+
69
+ } else {
70
+ $lastname = Mage::getSingleton('checkout/session')->getQuote()->getBillingAddress()->getLastname();
71
+ }
72
+ return $lastname;
73
+ }
74
+
75
  }
app/code/community/Adyen/Payment/Block/Form/Hpp.php CHANGED
@@ -45,7 +45,7 @@ class Adyen_Payment_Block_Form_Hpp extends Mage_Payment_Block_Form {
45
  * @since 0.1.0.4
46
  * @return type
47
  */
48
- public function hppOptionsDisabled() {
49
- return Mage::getStoreConfig("payment/adyen_hpp/disable_hpptypes");
50
  }
51
  }
45
  * @since 0.1.0.4
46
  * @return type
47
  */
48
+ public function getHppOptionsDisabled() {
49
+ return $this->getMethod()->getHppOptionsDisabled();
50
  }
51
  }
app/code/community/Adyen/Payment/Block/Form/Oneclick.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adyen Payment Module
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Adyen
17
+ * @package Adyen_Payment
18
+ * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ /**
22
+ * @category Payment Gateway
23
+ * @package Adyen_Payment
24
+ * @author Adyen
25
+ * @property Adyen B.V
26
+ * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
27
+ */
28
+ class Adyen_Payment_Block_Form_Oneclick extends Adyen_Payment_Block_Form_Cc {
29
+
30
+ protected function _construct() {
31
+ parent::_construct();
32
+ $this->setTemplate('adyen/form/oneclick.phtml');
33
+ }
34
+
35
+ public function getlistRecurringDetails() {
36
+ return $this->getMethod()->getlistRecurringDetails();
37
+ }
38
+
39
+ public function isNotRecurring() {
40
+ return $this->getMethod()->isNotRecurring();
41
+ }
42
+ }
app/code/community/Adyen/Payment/Block/Form/Openinvoice.php CHANGED
@@ -27,9 +27,98 @@
27
  */
28
  class Adyen_Payment_Block_Form_Openinvoice extends Mage_Payment_Block_Form {
29
 
 
 
30
  protected function _construct() {
31
  $this->setTemplate('adyen/form/openinvoice.phtml');
 
 
 
 
 
 
 
 
 
 
 
 
32
  parent::_construct();
33
  }
34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  }
27
  */
28
  class Adyen_Payment_Block_Form_Openinvoice extends Mage_Payment_Block_Form {
29
 
30
+ protected $_dateInputs = array();
31
+
32
  protected function _construct() {
33
  $this->setTemplate('adyen/form/openinvoice.phtml');
34
+
35
+ /* Check if the customer is logged in or not */
36
+ if (Mage::getSingleton('customer/session')->isLoggedIn()) {
37
+
38
+ /* Get the customer data */
39
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
40
+
41
+ // set the default value
42
+ $this->setDate($customer->getDob());
43
+ $this->setGender($customer->getGender());
44
+ }
45
+
46
  parent::_construct();
47
  }
48
 
49
+
50
+ public function setDate($date)
51
+ {
52
+ $this->setTime($date ? strtotime($date) : false);
53
+ $this->setData('date', $date);
54
+ return $this;
55
+ }
56
+
57
+ public function getDay()
58
+ {
59
+ return $this->getTime() ? date('d', $this->getTime()) : '';
60
+ }
61
+
62
+ public function getMonth()
63
+ {
64
+ return $this->getTime() ? date('m', $this->getTime()) : '';
65
+ }
66
+
67
+ public function getYear()
68
+ {
69
+ return $this->getTime() ? date('Y', $this->getTime()) : '';
70
+ }
71
+
72
+ /**
73
+ * Returns format which will be applied for DOB in javascript
74
+ *
75
+ * @return string
76
+ */
77
+ public function getDateFormat()
78
+ {
79
+ return Mage::app()->getLocale()->getDateStrFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
80
+ }
81
+
82
+ /**
83
+ * Add date input html
84
+ *
85
+ * @param string $code
86
+ * @param string $html
87
+ */
88
+ public function setDateInput($code, $html)
89
+ {
90
+ $this->_dateInputs[$code] = $html;
91
+ }
92
+
93
+ /**
94
+ * Sort date inputs by dateformat order of current locale
95
+ *
96
+ * @return string
97
+ */
98
+ public function getSortedDateInputs()
99
+ {
100
+ $strtr = array(
101
+ '%b' => '%1$s',
102
+ '%B' => '%1$s',
103
+ '%m' => '%1$s',
104
+ '%d' => '%2$s',
105
+ '%e' => '%2$s',
106
+ '%Y' => '%3$s',
107
+ '%y' => '%3$s'
108
+ );
109
+
110
+ $dateFormat = preg_replace('/[^\%\w]/', '\\1', $this->getDateFormat());
111
+
112
+ return sprintf(strtr($dateFormat, $strtr),
113
+ $this->_dateInputs['m'], $this->_dateInputs['d'], $this->_dateInputs['y']);
114
+ }
115
+
116
+ public function genderShow() {
117
+ return $this->getMethod()->genderShow();
118
+ }
119
+
120
+ public function dobShow() {
121
+ return $this->getMethod()->dobShow();
122
+ }
123
+
124
  }
app/code/community/Adyen/Payment/Block/Form/Sepa.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adyen Payment Module
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Adyen
17
+ * @package Adyen_Payment
18
+ * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ /**
22
+ * @category Payment Gateway
23
+ * @package Adyen_Payment
24
+ * @author Adyen
25
+ * @property Adyen B.V
26
+ * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
27
+ */
28
+ class Adyen_Payment_Block_Form_Sepa extends Mage_Payment_Block_Form {
29
+
30
+ protected function _construct() {
31
+ parent::_construct();
32
+ $this->setTemplate('adyen/form/sepa.phtml');
33
+ }
34
+
35
+ }
app/code/community/Adyen/Payment/Block/Info/Oneclick.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adyen Payment Module
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Adyen
17
+ * @package Adyen_Payment
18
+ * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ /**
22
+ * @category Payment Gateway
23
+ * @package Adyen_Payment
24
+ * @author Adyen
25
+ * @property Adyen B.V
26
+ * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
27
+ */
28
+
29
+ class Adyen_Payment_Block_Info_Oneclick extends Adyen_Payment_Block_Info_Cc {
30
+
31
+ }
app/code/community/Adyen/Payment/Block/Info/Sepa.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adyen Payment Module
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Adyen
17
+ * @package Adyen_Payment
18
+ * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ /**
22
+ * @category Payment Gateway
23
+ * @package Adyen_Payment
24
+ * @author Adyen
25
+ * @property Adyen B.V
26
+ * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
27
+ */
28
+ class Adyen_Payment_Block_Info_Sepa extends Mage_Payment_Block_Info {
29
+
30
+ /**
31
+ * Init default template for block
32
+ */
33
+ protected function _construct() {
34
+ parent::_construct();
35
+ $this->setTemplate('adyen/info/sepa.phtml');
36
+ }
37
+
38
+ public function toPdf() {
39
+ $this->setTemplate('adyen/info/pdf/sepa.phtml');
40
+ return $this->toHtml();
41
+ }
42
+
43
+ }
app/code/community/Adyen/Payment/Block/PosExpressCheckout.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adyen Payment Module
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Adyen
17
+ * @package Adyen_Payment
18
+ * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ /**
22
+ * @category Payment Gateway
23
+ * @package Adyen_Payment
24
+ * @author Adyen
25
+ * @property Adyen B.V
26
+ * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
27
+ */
28
+ class Adyen_Payment_Block_PosExpressCheckout extends Mage_Core_Block_Template
29
+ {
30
+
31
+ public function hasExpressCheckout()
32
+ {
33
+ // must be login to show this checkout option
34
+ if(Mage::getSingleton('customer/session')->isLoggedIn()) {
35
+ return (string) Mage::helper('adyen')->hasExpressCheckout();
36
+ } else {
37
+ return false;
38
+ }
39
+ }
40
+
41
+ }
app/code/community/Adyen/Payment/Block/Redirect.php CHANGED
@@ -61,12 +61,16 @@
61
  $extra_paramaters = urlencode("/?originalCustomCurrency=".$adyFields['currencyCode']."&originalCustomAmount=".$adyFields['paymentAmount']. "&originalCustomMerchantReference=".$adyFields['merchantReference'] . "&originalCustomSessionId=".session_id());
62
 
63
  // add recurring before the callback url
64
- $recurring_parameters = "&recurringContract=".urlencode($adyFields['recurringContract'])."&shopperReference=".urlencode($adyFields['shopperReference']). "&shopperEmail=".urlencode($adyFields['shopperEmail']);
 
 
 
 
65
 
66
  // important url must be the latest parameter before extra parameters! otherwise extra parameters won't return in return url
67
  if($android !== false) { // && stripos($ua,'mobile') !== false) {
68
  // watch out some attributes are different from ios (sessionid and callback_automatic) added start_immediately
69
- $launchlink = "adyen://www.adyen.com/?sessionid=".date(U)."&amount=".$adyFields['paymentAmount']."&currency=".$adyFields['currencyCode']."&description=".$adyFields['merchantReference']. $recurring_parameters . "&start_immediately=1&callback_automatic=1&callback=".$url .$extra_paramaters;
70
  } else {
71
  //$launchlink = "adyen://payment?currency=".$adyFields['currencyCode']."&amount=".$adyFields['paymentAmount']."&description=".$adyFields['merchantReference']."&callback=".$url."&sessionId=".session_id()."&callbackAutomatic=1".$extra_paramaters;
72
  $launchlink = "adyen://payment?sessionId=".session_id()."&amount=".$adyFields['paymentAmount']."&currency=".$adyFields['currencyCode']."&description=".$adyFields['merchantReference']. $recurring_parameters . "&callbackAutomatic=1&callback=".$url .$extra_paramaters;
61
  $extra_paramaters = urlencode("/?originalCustomCurrency=".$adyFields['currencyCode']."&originalCustomAmount=".$adyFields['paymentAmount']. "&originalCustomMerchantReference=".$adyFields['merchantReference'] . "&originalCustomSessionId=".session_id());
62
 
63
  // add recurring before the callback url
64
+ if(empty($adyFields['recurringContract'])) {
65
+ $recurring_parameters = "";
66
+ } else {
67
+ $recurring_parameters = "&recurringContract=".urlencode($adyFields['recurringContract'])."&shopperReference=".urlencode($adyFields['shopperReference']). "&shopperEmail=".urlencode($adyFields['shopperEmail']);
68
+ }
69
 
70
  // important url must be the latest parameter before extra parameters! otherwise extra parameters won't return in return url
71
  if($android !== false) { // && stripos($ua,'mobile') !== false) {
72
  // watch out some attributes are different from ios (sessionid and callback_automatic) added start_immediately
73
+ $launchlink = "adyen://www.adyen.com/?sessionid=".date('U')."&amount=".$adyFields['paymentAmount']."&currency=".$adyFields['currencyCode']."&description=".$adyFields['merchantReference']. $recurring_parameters . "&start_immediately=1&callback_automatic=1&callback=".$url .$extra_paramaters;
74
  } else {
75
  //$launchlink = "adyen://payment?currency=".$adyFields['currencyCode']."&amount=".$adyFields['paymentAmount']."&description=".$adyFields['merchantReference']."&callback=".$url."&sessionId=".session_id()."&callbackAutomatic=1".$extra_paramaters;
76
  $launchlink = "adyen://payment?sessionId=".session_id()."&amount=".$adyFields['paymentAmount']."&currency=".$adyFields['currencyCode']."&description=".$adyFields['merchantReference']. $recurring_parameters . "&callbackAutomatic=1&callback=".$url .$extra_paramaters;
app/code/community/Adyen/Payment/Block/Sales/Order/Totals.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adyen Payment Module
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Adyen
17
+ * @package Adyen_Payment
18
+ * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ /**
22
+ * @category Payment Gateway
23
+ * @package Adyen_Payment
24
+ * @author Adyen
25
+ * @property Adyen B.V
26
+ * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
27
+ */
28
+ class Adyen_Payment_Block_Sales_Order_Totals extends Mage_Sales_Block_Order_Totals {
29
+
30
+ protected function _initTotals()
31
+ {
32
+ parent::_initTotals();
33
+ $this->addTotal(
34
+ new Varien_Object(
35
+ array(
36
+ 'code' => 'payment_fee',
37
+ 'strong' => false,
38
+ 'value' => $this->getSource()->getPaymentFeeAmount(),
39
+ 'base_value'=> $this->getSource()->getBasePaymentFeeAmount(),
40
+ 'label' => $this->helper('adyen')->__('Payment Fee'),
41
+ 'area' => '',
42
+ )
43
+ ),
44
+ 'subtotal'
45
+ );
46
+
47
+ $this->addTotal(
48
+ new Varien_Object(
49
+ array(
50
+ 'code' => 'payment_installment_fee',
51
+ 'strong' => false,
52
+ 'value' => $this->getSource()->getPaymentInstallmentFeeAmount(),
53
+ 'base_value'=> $this->getSource()->getBasePaymentInstallmentFeeAmount(),
54
+ 'label' => $this->helper('adyen')->__('Payment Fee Installments'),
55
+ 'area' => '',
56
+ )
57
+ ),
58
+ 'subtotal'
59
+ );
60
+ return $this;
61
+ }
62
+ }
app/code/community/Adyen/Payment/Block/ScanProduct.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adyen Payment Module
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Adyen
17
+ * @package Adyen_Payment
18
+ * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ /**
22
+ * @category Payment Gateway
23
+ * @package Adyen_Payment
24
+ * @author Adyen
25
+ * @property Adyen B.V
26
+ * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
27
+ */
28
+ class Adyen_Payment_Block_ScanProduct extends Mage_Core_Block_Template
29
+ {
30
+
31
+ public function hasEnableScanner()
32
+ {
33
+ return (string) Mage::helper('adyen')->hasEnableScanner();
34
+ }
35
+
36
+ }
app/code/community/Adyen/Payment/Helper/Data.php CHANGED
@@ -38,33 +38,110 @@ class Adyen_Payment_Helper_Data extends Mage_Payment_Helper_Data {
38
  }
39
 
40
  public function getBoletoTypes() {
41
- $_types = Mage::getConfig()->getNode('default/adyen/payment/boletotypes')->asArray();
42
- $types = array();
43
- foreach ($_types as $data) {
44
- $types[$data['code']] = $data['name'];
45
- }
46
- return $types;
47
  }
48
-
49
  public function getOpenInvoiceTypes() {
50
- $_types = Mage::getConfig()->getNode('default/adyen/payment/openinvoicetypes')->asArray();
51
- $types = array();
52
- foreach ($_types as $data) {
53
- $types[$data['code']] = $data['name'];
54
- }
55
- return $types;
56
  }
57
-
58
  public function getRecurringTypes() {
59
- $_types = Mage::getConfig()->getNode('default/adyen/payment/recurringtypes')->asArray();
60
- $types = array();
61
- foreach ($_types as $data) {
62
- $types[$data['code']] = $data['name'];
63
- }
64
- return $types;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  }
66
-
67
- public function getExtensionVersion() {
68
- return (string) Mage::getConfig()->getNode()->modules->Adyen_Payment->version;
 
 
 
 
69
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  }
38
  }
39
 
40
  public function getBoletoTypes() {
41
+ $_types = Mage::getConfig()->getNode('default/adyen/payment/boletotypes')->asArray();
42
+ $types = array();
43
+ foreach ($_types as $data) {
44
+ $types[$data['code']] = $data['name'];
45
+ }
46
+ return $types;
47
  }
48
+
49
  public function getOpenInvoiceTypes() {
50
+ $_types = Mage::getConfig()->getNode('default/adyen/payment/openinvoicetypes')->asArray();
51
+ $types = array();
52
+ foreach ($_types as $data) {
53
+ $types[$data['code']] = $data['name'];
54
+ }
55
+ return $types;
56
  }
57
+
58
  public function getRecurringTypes() {
59
+ $_types = Mage::getConfig()->getNode('default/adyen/payment/recurringtypes')->asArray();
60
+ $types = array();
61
+ foreach ($_types as $data) {
62
+ $types[$data['code']] = $data['name'];
63
+ }
64
+ return $types;
65
+ }
66
+
67
+ public function getExtensionVersion() {
68
+ return (string) Mage::getConfig()->getNode()->modules->Adyen_Payment->version;
69
+ }
70
+
71
+ public function hasEnableScanner() {
72
+ return (int) Mage::getStoreConfig('payment/adyen_pos/enable_scanner');
73
+ }
74
+
75
+ public function hasExpressCheckout() {
76
+ return (int) Mage::getStoreConfig('payment/adyen_pos/express_checkout');
77
+ }
78
+
79
+ public function getOrderStatus() {
80
+ return Mage::getStoreConfig('payment/adyen_abstract/order_status');
81
+ }
82
+
83
+ /**
84
+ * @param Mage_Sales_Model_Quote | Mage_Sales_Model_Order $object
85
+ */
86
+ public function isPaymentFeeEnabled($object)
87
+ {
88
+ $fee = Mage::getStoreConfig('payment/adyen_openinvoice/fee');
89
+ $paymentMethod = $object->getPayment()->getMethod() ;
90
+ if ($paymentMethod == 'adyen_openinvoice' && $fee > 0) {
91
+ return true;
92
+ }
93
+ else {
94
+ return false;
95
+ }
96
  }
97
+
98
+ /**
99
+ * @param Mage_Sales_Model_Quote | Mage_Sales_Model_Order $object
100
+ */
101
+ public function getPaymentFeeAmount($object)
102
+ {
103
+ return Mage::getStoreConfig('payment/adyen_openinvoice/fee');
104
  }
105
+
106
+ public function formatAmount($amount, $currency) {
107
+
108
+ // check the format
109
+ switch($currency) {
110
+ case "JPY":
111
+ case "IDR":
112
+ case "KRW":
113
+ case "BYR":
114
+ case "VND":
115
+ case "CVE":
116
+ case "DJF":
117
+ case "GNF":
118
+ case "PYG":
119
+ case "RWF":
120
+ case "UGX":
121
+ case "VUV":
122
+ case "XAF":
123
+ case "XOF":
124
+ case "XPF":
125
+ case "GHC":
126
+ $format = 0;
127
+ break;
128
+ case "MRO":
129
+ $format = 1;
130
+ break;
131
+ case "BHD":
132
+ case "JOD":
133
+ case "KWD":
134
+ case "OMR":
135
+ case "LYD":
136
+ case "TND":
137
+ $format = 3;
138
+ break;
139
+ default:
140
+ $format = 2;
141
+ break;
142
+ }
143
+
144
+ return number_format($amount, $format, '', '');
145
+ }
146
+
147
  }
app/code/community/Adyen/Payment/Helper/Installments.php CHANGED
@@ -79,13 +79,19 @@ class Adyen_Payment_Helper_Installments
79
  }
80
  unset($value['__empty']);
81
  foreach ($value as $_id => $row) {
82
- if (!is_array($row) || !array_key_exists('installment_currency',$row) || !array_key_exists('installment_boundary', $row) || !array_key_exists('installment_frequency', $row)) {
83
  return false;
84
  }
85
  }
86
  return true;
87
  }
88
 
 
 
 
 
 
 
89
  /**
90
  * Encode value to be used in Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
91
  * deserialized DB entry => HTML form
@@ -96,12 +102,18 @@ class Adyen_Payment_Helper_Installments
96
  {
97
  $result = array();
98
  foreach ($value as $triplet){
99
- list($currency,$boundary,$frequency) = $triplet;
 
 
 
 
 
100
  $_id = Mage::helper('core')->uniqHash('_');
101
  $result[$_id] = array(
102
  'installment_currency' => $currency,
103
  'installment_boundary' => $boundary,
104
  'installment_frequency' => $frequency,
 
105
  );
106
  }
107
  return $result;
@@ -118,13 +130,14 @@ class Adyen_Payment_Helper_Installments
118
  $result = array();
119
  unset($value['__empty']);
120
  foreach ($value as $_id => $row) {
121
- if (!is_array($row) || !array_key_exists('installment_currency',$row) || !array_key_exists('installment_boundary', $row) || !array_key_exists('installment_frequency', $row)) {
122
  continue;
123
  }
124
  $currency = $row['installment_currency'];
125
  $boundary = $row['installment_boundary'];
126
  $frequency = $row['installment_frequency'];
127
- $result[] = array($currency,$boundary,$frequency);
 
128
  }
129
  return $result;
130
  }
@@ -136,10 +149,10 @@ class Adyen_Payment_Helper_Installments
136
  * @param mixed $store
137
  * @return float|null
138
  */
139
- public function getConfigValue($curr,$amount, $store = null)
140
  {
141
- $value = Mage::getStoreConfig("payment/adyen_cc/installments", $store);
142
- $value = $this->_unserializeValue($value);
143
  if ($this->_isEncodedArrayFieldValue($value)) {
144
  $value = $this->_decodeArrayFieldValue($value);
145
  }
@@ -149,7 +162,7 @@ class Adyen_Payment_Helper_Installments
149
  list($currency,$boundary,$frequency) = $row;
150
  if ($curr == $currency){
151
  if($amount <= $boundary && ($boundary <= $cur_minimal_boundary || $cur_minimal_boundary == -1) ) {
152
- $cur_minimal_boundary = $boundary;
153
  $resulting_freq = $frequency;
154
  }
155
  if($boundary == "" && $cur_minimal_boundary == -1){
79
  }
80
  unset($value['__empty']);
81
  foreach ($value as $_id => $row) {
82
+ if (!is_array($row) || !array_key_exists('installment_currency',$row) || !array_key_exists('installment_boundary', $row) || !array_key_exists('installment_frequency', $row ) || !array_key_exists('installment_interest', $row )) {
83
  return false;
84
  }
85
  }
86
  return true;
87
  }
88
 
89
+ public function getInstallments($store = null, $ccType = "installments") {
90
+ $value = Mage::getStoreConfig("payment/adyen_cc/".$ccType, $store);
91
+ $value = $this->_unserializeValue($value);
92
+ return $value;
93
+ }
94
+
95
  /**
96
  * Encode value to be used in Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
97
  * deserialized DB entry => HTML form
102
  {
103
  $result = array();
104
  foreach ($value as $triplet){
105
+
106
+ $currency = (isset($triplet[0])) ? $triplet[0] : "";
107
+ $boundary = (isset($triplet[1])) ? $triplet[1] : "";
108
+ $frequency = (isset($triplet[2])) ? $triplet[2] : "";
109
+ $interest = (isset($triplet[3])) ? $triplet[3] : "";
110
+
111
  $_id = Mage::helper('core')->uniqHash('_');
112
  $result[$_id] = array(
113
  'installment_currency' => $currency,
114
  'installment_boundary' => $boundary,
115
  'installment_frequency' => $frequency,
116
+ 'installment_interest' => $interest
117
  );
118
  }
119
  return $result;
130
  $result = array();
131
  unset($value['__empty']);
132
  foreach ($value as $_id => $row) {
133
+ if (!is_array($row) || !array_key_exists('installment_currency',$row) || !array_key_exists('installment_boundary', $row) || !array_key_exists('installment_frequency', $row) || !array_key_exists('installment_interest', $row)) {
134
  continue;
135
  }
136
  $currency = $row['installment_currency'];
137
  $boundary = $row['installment_boundary'];
138
  $frequency = $row['installment_frequency'];
139
+ $interest = $row['installment_interest'];
140
+ $result[] = array($currency,$boundary,$frequency,$interest);
141
  }
142
  return $result;
143
  }
149
  * @param mixed $store
150
  * @return float|null
151
  */
152
+ public function getConfigValue($curr,$amount, $store = null, $ccType = "installments")
153
  {
154
+ $value = $this->getInstallments($store, $ccType);
155
+
156
  if ($this->_isEncodedArrayFieldValue($value)) {
157
  $value = $this->_decodeArrayFieldValue($value);
158
  }
162
  list($currency,$boundary,$frequency) = $row;
163
  if ($curr == $currency){
164
  if($amount <= $boundary && ($boundary <= $cur_minimal_boundary || $cur_minimal_boundary == -1) ) {
165
+ $cur_minimal_boundary = $boundary;
166
  $resulting_freq = $frequency;
167
  }
168
  if($boundary == "" && $cur_minimal_boundary == -1){
app/code/community/Adyen/Payment/Model/.DS_Store ADDED
Binary file
app/code/community/Adyen/Payment/Model/Adyen/.DS_Store ADDED
Binary file
app/code/community/Adyen/Payment/Model/Adyen/Abstract.php CHANGED
@@ -84,7 +84,19 @@ abstract class Adyen_Payment_Model_Adyen_Abstract extends Mage_Payment_Model_Met
84
  */
85
  public function refund(Varien_Object $payment, $amount) {
86
  $this->writeLog('refund fx called');
87
- parent::refund($payment, $amount);
 
 
 
 
 
 
 
 
 
 
 
 
88
  return $this;
89
  }
90
 
@@ -96,7 +108,7 @@ abstract class Adyen_Payment_Model_Adyen_Abstract extends Mage_Payment_Model_Met
96
  public function authorize(Varien_Object $payment, $amount) {
97
  parent::authorize($payment, $amount);
98
  $payment->setLastTransId($this->getTransactionId())->setIsTransactionPending(true);
99
- if ($this->getCode() == 'adyen_boleto' || $this->getCode() == 'adyen_cc' || $this->getCode() == 'adyen_elv') {
100
  $_authorizeResponse = $this->_processRequest($payment, $amount, "authorise");
101
  }
102
  return $this;
@@ -139,6 +151,15 @@ abstract class Adyen_Payment_Model_Adyen_Abstract extends Mage_Payment_Model_Met
139
  return $this->_processRequest($payment, $amount, "refund", $pspReference);
140
  }
141
 
 
 
 
 
 
 
 
 
 
142
  /**
143
  * Process the request here
144
  * @param Varien_Object $payment
@@ -150,14 +171,16 @@ abstract class Adyen_Payment_Model_Adyen_Abstract extends Mage_Payment_Model_Met
150
  $this->_initOrder();
151
  $this->_initService();
152
  $merchantAccount = trim($this->_getConfigData('merchantAccount'));
 
 
153
  $modificationResult = Mage::getModel('adyen/adyen_data_modificationResult');
154
  $requestData = Mage::getModel('adyen/adyen_data_modificationRequest')
155
  ->create($payment, $amount, $this->_order, $merchantAccount, $pspReference);
156
-
157
  switch ($request) {
158
  case "authorise":
159
  $requestData = Mage::getModel('adyen/adyen_data_paymentRequest')
160
- ->create($payment, $amount, $this->_order, $this->_paymentMethod, $merchantAccount);
161
 
162
  $response = $this->_service->authorise(array('paymentRequest' => $requestData));
163
  break;
@@ -177,6 +200,11 @@ abstract class Adyen_Payment_Model_Adyen_Abstract extends Mage_Payment_Model_Met
177
  'modificationRequest' => $requestData,
178
  'modificationResult' => $modificationResult));
179
  break;
 
 
 
 
 
180
  }
181
 
182
  if (!empty($response)) {
@@ -194,6 +222,81 @@ abstract class Adyen_Payment_Model_Adyen_Abstract extends Mage_Payment_Model_Met
194
  return $response;
195
  }
196
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
  /**
198
  * @desc authorise response
199
  * Process the response of the soap
@@ -215,6 +318,10 @@ abstract class Adyen_Payment_Model_Adyen_Abstract extends Mage_Payment_Model_Met
215
  $responseCode = $response->refundResult->response;
216
  $pspReference = $response->refundResult->pspReference;
217
  break;
 
 
 
 
218
  case "capture":
219
  $responseCode = $response->captureResult->response;
220
  $pspReference = $response->captureResult->pspReference;
@@ -245,9 +352,8 @@ abstract class Adyen_Payment_Model_Adyen_Abstract extends Mage_Payment_Model_Met
245
  $this->_addStatusHistory($payment, $responseCode, $pspReference, false, $pdfUrl);
246
  break;
247
  case '[capture-received]':
248
- $this->_addStatusHistory($payment, $responseCode, $pspReference);
249
- break;
250
  case '[refund-received]':
 
251
  $this->_addStatusHistory($payment, $responseCode, $pspReference);
252
  break;
253
  case "Error":
@@ -295,7 +401,7 @@ abstract class Adyen_Payment_Model_Adyen_Abstract extends Mage_Payment_Model_Met
295
  * @param unknown_type $amount
296
  * @param unknown_type $format
297
  */
298
- protected function _formatAmount($amount, $format = 2) {
299
  return (int) number_format($amount, $format, '', '');
300
  }
301
 
84
  */
85
  public function refund(Varien_Object $payment, $amount) {
86
  $this->writeLog('refund fx called');
87
+
88
+ $order = $payment->getOrder();
89
+ $pspReference = Mage::getModel('adyen/event')->getOriginalPspReference($order->getIncrementId());
90
+
91
+ // if amound is a full refund send a refund/cancelled request so if it is not captured yet it will cancel the order
92
+ $grandTotal = $order->getGrandTotal();
93
+
94
+ if($grandTotal == $amount) {
95
+ $order->getPayment()->getMethodInstance()->SendCancelOrRefund($payment, null, $pspReference);
96
+ } else {
97
+ $order->getPayment()->getMethodInstance()->sendRefundRequest($payment, $amount, $pspReference);
98
+ }
99
+
100
  return $this;
101
  }
102
 
108
  public function authorize(Varien_Object $payment, $amount) {
109
  parent::authorize($payment, $amount);
110
  $payment->setLastTransId($this->getTransactionId())->setIsTransactionPending(true);
111
+ if ($this->getCode() == 'adyen_boleto' || $this->getCode() == 'adyen_cc' || $this->getCode() == 'adyen_oneclick' || $this->getCode() == 'adyen_elv' || $this->getCode() == 'adyen_sepa') {
112
  $_authorizeResponse = $this->_processRequest($payment, $amount, "authorise");
113
  }
114
  return $this;
151
  return $this->_processRequest($payment, $amount, "refund", $pspReference);
152
  }
153
 
154
+ public function SendCancelOrRefund(Varien_Object $payment, $amount, $pspReference) {
155
+ if (empty($pspReference)) {
156
+ $this->writeLog('oops empty pspReference');
157
+ return $this;
158
+ }
159
+ $this->writeLog("sendCancelOrRefundRequest pspReference : $pspReference");
160
+ return $this->_processRequest($payment, null, "cancel_or_refund", $pspReference);
161
+ }
162
+
163
  /**
164
  * Process the request here
165
  * @param Varien_Object $payment
171
  $this->_initOrder();
172
  $this->_initService();
173
  $merchantAccount = trim($this->_getConfigData('merchantAccount'));
174
+ $recurringType = $this->_getConfigData('recurringtypes', 'adyen_abstract');
175
+ $enableMoto = (int) $this->_getConfigData('enable_moto', 'adyen_cc');
176
  $modificationResult = Mage::getModel('adyen/adyen_data_modificationResult');
177
  $requestData = Mage::getModel('adyen/adyen_data_modificationRequest')
178
  ->create($payment, $amount, $this->_order, $merchantAccount, $pspReference);
179
+
180
  switch ($request) {
181
  case "authorise":
182
  $requestData = Mage::getModel('adyen/adyen_data_paymentRequest')
183
+ ->create($payment, $amount, $this->_order, $this->_paymentMethod, $merchantAccount,$recurringType, $enableMoto);
184
 
185
  $response = $this->_service->authorise(array('paymentRequest' => $requestData));
186
  break;
200
  'modificationRequest' => $requestData,
201
  'modificationResult' => $modificationResult));
202
  break;
203
+ case "cancel_or_refund":
204
+ $response = $this->_service->cancelorrefund(array(
205
+ 'modificationRequest' => $requestData,
206
+ 'modificationResult' => $modificationResult));
207
+ break;
208
  }
209
 
210
  if (!empty($response)) {
222
  return $response;
223
  }
224
 
225
+ protected function _processRecurringRequest($customerId) {
226
+
227
+ $this->_initService();
228
+
229
+ // customerId
230
+ $merchantAccount = trim($this->_getConfigData('merchantAccount'));
231
+ $recurringType = $this->_getConfigData('recurringtypes', 'adyen_abstract');
232
+
233
+
234
+ // do not show the oneclick if recurring type is empty or recurring
235
+ if($recurringType == "ONECLICK" || $recurringType == "ONECLICK,RECURRING" || $recurringType == "RECURRING")
236
+ {
237
+ // recurring type is always ONECLICK
238
+ if($recurringType == "ONECLICK,RECURRING") {
239
+ $recurringType = "ONECLICK";
240
+ }
241
+
242
+ // rest call to get listrecurring details
243
+ $request = array(
244
+ "action" => "Recurring.listRecurringDetails",
245
+ "recurringDetailsRequest.merchantAccount" => $merchantAccount,
246
+ "recurringDetailsRequest.shopperReference" => $customerId,
247
+ "recurringDetailsRequest.recurring.contract" => $recurringType, // i.e.: "ONECLICK" Or "RECURRING"
248
+ );
249
+
250
+ $ch = curl_init();
251
+
252
+ $isConfigDemoMode = $this->getConfigDataDemoMode();
253
+ $wsUsername = $this->getConfigDataWsUserName();
254
+ $wsPassword = $this->getConfigDataWsPassword();
255
+
256
+ if ($isConfigDemoMode)
257
+ curl_setopt($ch, CURLOPT_URL, "https://pal-test.adyen.com/pal/adapter/httppost");
258
+ else
259
+ curl_setopt($ch, CURLOPT_URL, "https://pal-live.adyen.com/pal/adapter/httppost");
260
+
261
+ curl_setopt($ch, CURLOPT_HEADER, false);
262
+ curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC );
263
+ curl_setopt($ch, CURLOPT_USERPWD,$wsUsername.":".$wsPassword);
264
+ curl_setopt($ch, CURLOPT_POST,count($request));
265
+ curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($request));
266
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
267
+
268
+ $result = curl_exec($ch);
269
+
270
+ if($result === false) {
271
+ Mage::log("List recurring is failing error is: " . curl_error($ch), self::DEBUG_LEVEL, 'http-request.log',true);
272
+ Mage::throwException(Mage::helper('adyen')->__('List recurring is generating the error see the log'));
273
+ } else{
274
+ /**
275
+ * The $result contains a JSON array containing
276
+ * the available payment methods for the merchant account.
277
+ */
278
+ parse_str($result,$result);
279
+ Mage::log("List recurring result is: " . curl_error($ch), self::DEBUG_LEVEL, 'http-request.log',true);
280
+
281
+ // create a arraylist with the cards
282
+ $recurringCards = array();
283
+
284
+ foreach($result as $key => $value) {
285
+ // strip the key
286
+ $key = str_replace("recurringDetailsResult_details_", "", $key);
287
+ $key2 = strstr($key, '_');
288
+ $keyNumber = str_replace($key2, "", $key);
289
+ $keyAttribute = substr($key2, 1);
290
+ $recurringCards[$keyNumber][$keyAttribute] = $value;
291
+ }
292
+ // unset the recurringDetailsResult because this is not a card
293
+ unset($recurringCards["recurringDetailsResult"]);
294
+
295
+ return $recurringCards;
296
+ }
297
+ }
298
+ }
299
+
300
  /**
301
  * @desc authorise response
302
  * Process the response of the soap
318
  $responseCode = $response->refundResult->response;
319
  $pspReference = $response->refundResult->pspReference;
320
  break;
321
+ case "cancel_or_refund":
322
+ $responseCode = $response->cancelOrRefundResult->response;
323
+ $pspReference = $response->cancelOrRefundResult->pspReference;
324
+ break;
325
  case "capture":
326
  $responseCode = $response->captureResult->response;
327
  $pspReference = $response->captureResult->pspReference;
352
  $this->_addStatusHistory($payment, $responseCode, $pspReference, false, $pdfUrl);
353
  break;
354
  case '[capture-received]':
 
 
355
  case '[refund-received]':
356
+ case '[cancelOrRefund-received]':
357
  $this->_addStatusHistory($payment, $responseCode, $pspReference);
358
  break;
359
  case "Error":
401
  * @param unknown_type $amount
402
  * @param unknown_type $format
403
  */
404
+ protected function _numberFormat($amount, $format = 2) {
405
  return (int) number_format($amount, $format, '', '');
406
  }
407
 
app/code/community/Adyen/Payment/Model/Adyen/Cc.php CHANGED
@@ -31,7 +31,7 @@ class Adyen_Payment_Model_Adyen_Cc extends Adyen_Payment_Model_Adyen_Abstract {
31
  protected $_formBlockType = 'adyen/form_cc';
32
  protected $_infoBlockType = 'adyen/info_cc';
33
  protected $_paymentMethod = 'cc';
34
-
35
  /**
36
  * 1)Called everytime the adyen_cc is called or used in checkout
37
  * @description Assign data to info model instance
@@ -40,11 +40,15 @@ class Adyen_Payment_Model_Adyen_Cc extends Adyen_Payment_Model_Adyen_Abstract {
40
  * @return Mage_Payment_Model_Info
41
  */
42
  public function assignData($data) {
 
43
  if (!($data instanceof Varien_Object)) {
44
  $data = new Varien_Object($data);
45
  }
46
  $info = $this->getInfoInstance();
47
-
 
 
 
48
  if ($this->isCseEnabled()) {
49
  $info->setAdditionalInformation('encrypted_data', $data->getEncryptedData());
50
  }
@@ -58,24 +62,93 @@ class Adyen_Payment_Model_Adyen_Cc extends Adyen_Payment_Model_Adyen_Abstract {
58
  ->setCcCid($data->getCcCid())
59
  ->setPoNumber($data->getAdditionalData());
60
  }
61
-
 
 
 
 
 
 
 
 
62
  return $this;
63
  }
64
 
65
- public function getPossibleInstallments(){
66
  // retrieving quote
67
  $quote = (Mage::getModel('checkout/type_onepage') !== false)? Mage::getModel('checkout/type_onepage')->getQuote(): Mage::getModel('checkout/session')->getQuote();
68
-
69
- $amount = (double) $quote->getGrandTotal();
70
- $currency = $quote->getQuoteCurrencyCode();
71
-
72
- $max_installments = Mage::helper('adyen/installments')->getConfigValue($currency,$amount);
73
-
74
  $result = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  for($i=1;$i<=$max_installments;$i++){
76
- $partial_amount = ((double)$amount)/$i;
 
 
 
 
 
 
 
 
 
 
77
  $result[(string)$i] = $i."x ".$currency." ".number_format($partial_amount,2);
78
  }
 
 
79
 
80
  return $result;
81
  }
31
  protected $_formBlockType = 'adyen/form_cc';
32
  protected $_infoBlockType = 'adyen/info_cc';
33
  protected $_paymentMethod = 'cc';
34
+
35
  /**
36
  * 1)Called everytime the adyen_cc is called or used in checkout
37
  * @description Assign data to info model instance
40
  * @return Mage_Payment_Model_Info
41
  */
42
  public function assignData($data) {
43
+
44
  if (!($data instanceof Varien_Object)) {
45
  $data = new Varien_Object($data);
46
  }
47
  $info = $this->getInfoInstance();
48
+
49
+ // set number of installements
50
+ $info->setAdditionalInformation('number_of_installments', $data->getAdditionalData());
51
+
52
  if ($this->isCseEnabled()) {
53
  $info->setAdditionalInformation('encrypted_data', $data->getEncryptedData());
54
  }
62
  ->setCcCid($data->getCcCid())
63
  ->setPoNumber($data->getAdditionalData());
64
  }
65
+
66
+ // recalculate the totals so that extra fee is defined
67
+ $quote = (Mage::getModel('checkout/type_onepage') !== false)? Mage::getModel('checkout/type_onepage')->getQuote(): Mage::getModel('checkout/session')->getQuote();
68
+ $quote->setTotalsCollectedFlag(false);
69
+ $quote->collectTotals();
70
+ // not needed
71
+ // $quote->save();
72
+
73
+
74
  return $this;
75
  }
76
 
77
+ public function getPossibleInstallments() {
78
  // retrieving quote
79
  $quote = (Mage::getModel('checkout/type_onepage') !== false)? Mage::getModel('checkout/type_onepage')->getQuote(): Mage::getModel('checkout/session')->getQuote();
80
+
81
+ // get selected payment method for now
82
+ $payment = $quote->getPayment();
83
+
 
 
84
  $result = array();
85
+
86
+ if($quote->isVirtual()) {
87
+ $address = $this->getBillingAddress();
88
+ } else {
89
+ $address = $quote->getShippingAddress();
90
+ }
91
+
92
+ // distract the already included added fee for installment you selected before
93
+ if($address->getBasePaymentInstallmentFeeAmount() > 0) {
94
+ $amount = (double) ($quote->getGrandTotal() - $address->getBasePaymentInstallmentFeeAmount());
95
+ } else {
96
+ $amount = (double) $quote->getGrandTotal();
97
+ }
98
+
99
+ $currency = $quote->getQuoteCurrencyCode();
100
+
101
+ $ccTypeInstallments = null;
102
+ // check if creditcard type is already selected if this is the case show installments for this card if they have one configured
103
+ if($payment && !empty($payment)) {
104
+ if($payment->getMethod()) {
105
+ $info = $payment->getMethodInstance();
106
+
107
+ $instance = $info->getInfoInstance();
108
+ $ccType = $instance->getCcType();
109
+
110
+ // this creditcard type is selected
111
+ if($ccType != "") {
112
+
113
+ // installment key where installents are saved in settings
114
+ $ccTypeInstallments = "installments_".$ccType;
115
+
116
+ // check if this type has installments configured
117
+ $all_installments = Mage::helper('adyen/installments')->getInstallments(null, $ccTypeInstallments);
118
+
119
+ if(empty($all_installments)) {
120
+ // no installments congigure fall back on default
121
+ $ccTypeInstallments = null;
122
+ } else {
123
+ $max_installments = Mage::helper('adyen/installments')->getConfigValue($currency,$amount, null, $ccTypeInstallments);
124
+ }
125
+ }
126
+ }
127
+ }
128
+
129
+ // Fallback to the default installments if creditcard type has no one configured
130
+ if($ccTypeInstallments == null) {
131
+ $max_installments = Mage::helper('adyen/installments')->getConfigValue($currency,$amount, null);
132
+ $all_installments = Mage::helper('adyen/installments')->getInstallments();
133
+ }
134
+
135
+ // result array here
136
  for($i=1;$i<=$max_installments;$i++){
137
+
138
+ // check if installment has extra interest
139
+ $key = $i-1;
140
+ $installment = $all_installments[$key];
141
+ if(isset($installment[3]) && $installment[3] > 0) {
142
+ $total_amount_with_interest = $amount + ($amount * ($installment[3] / 100));
143
+ } else {
144
+ $total_amount_with_interest = $amount;
145
+ }
146
+
147
+ $partial_amount = ((double)$total_amount_with_interest)/$i;
148
  $result[(string)$i] = $i."x ".$currency." ".number_format($partial_amount,2);
149
  }
150
+
151
+
152
 
153
  return $result;
154
  }
app/code/community/Adyen/Payment/Model/Adyen/Data/Abstract.php CHANGED
@@ -36,9 +36,4 @@ class Adyen_Payment_Model_Adyen_Data_Abstract {
36
  protected function _getCheckout() {
37
  return Mage::getSingleton('checkout/session');
38
  }
39
-
40
- protected function _formatAmount($amount, $format = 2) {
41
- return number_format($amount, $format, '', '');
42
- }
43
-
44
  }
36
  protected function _getCheckout() {
37
  return Mage::getSingleton('checkout/session');
38
  }
 
 
 
 
 
39
  }
app/code/community/Adyen/Payment/Model/Adyen/Data/BankAccount.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adyen Payment Module
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Adyen
17
+ * @package Adyen_Payment
18
+ * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ /**
22
+ * @category Payment Gateway
23
+ * @package Adyen_Payment
24
+ * @author Adyen
25
+ * @property Adyen B.V
26
+ * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
27
+ */
28
+ class Adyen_Payment_Model_Adyen_Data_BankAccount extends Adyen_Payment_Model_Adyen_Data_Abstract {
29
+
30
+ public $iban;
31
+ public $ownerName;
32
+ public $countryCode;
33
+
34
+ }
app/code/community/Adyen/Payment/Model/Adyen/Data/IdealPaymentRequest.php CHANGED
@@ -39,11 +39,12 @@ class Adyen_Payment_Model_Adyen_Data_IdealPaymentRequest extends Adyen_Payment_M
39
  $incrementId = $order->getIncrementId();
40
  $orderCurrencyCode = $order->getOrderCurrencyCode();
41
  $customerId = $order->getCustomerId();
 
42
 
43
  $this->reference = $incrementId;
44
  $this->merchantAccount = $merchantAccount;
45
  $this->amount->currency = $orderCurrencyCode;
46
- $this->amount->value = $this->_formatAmount($amount);
47
 
48
  //shopper data
49
  $customerEmail = $order->getCustomerEmail();
39
  $incrementId = $order->getIncrementId();
40
  $orderCurrencyCode = $order->getOrderCurrencyCode();
41
  $customerId = $order->getCustomerId();
42
+ $currency = $order->getOrderCurrencyCode();
43
 
44
  $this->reference = $incrementId;
45
  $this->merchantAccount = $merchantAccount;
46
  $this->amount->currency = $orderCurrencyCode;
47
+ $this->amount->value = Mage::helper('adyen')->formatAmount($amount, $currency);
48
 
49
  //shopper data
50
  $customerEmail = $order->getCustomerEmail();
app/code/community/Adyen/Payment/Model/Adyen/Data/Installments.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adyen Payment Module
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Adyen
17
+ * @package Adyen_Payment
18
+ * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ /**
22
+ * @category Payment Gateway
23
+ * @package Adyen_Payment
24
+ * @author Adyen
25
+ * @property Adyen B.V
26
+ * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
27
+ */
28
+ class Adyen_Payment_Model_Adyen_Data_Installments extends Adyen_Payment_Model_Adyen_Data_Abstract {
29
+
30
+ public $value;
31
+
32
+ }
app/code/community/Adyen/Payment/Model/Adyen/Data/InvoiceRow.php CHANGED
@@ -36,10 +36,11 @@ class Adyen_Payment_Model_Adyen_Data_InvoiceRow extends Adyen_Payment_Model_Adye
36
  public $vatCategory;
37
 
38
  public function create($item, $count, $order) {
39
- $this->currency = $order->getOrderCurrencyCode();
 
40
  $this->description = $item->getName();
41
- $this->itemPrice = $this->_formatAmount($item->getPrice());
42
- $this->itemVAT = $this->_formatAmount(($item->getTaxAmount()>0 && $item->getPriceInclTax()>0)?$item->getPriceInclTax() - $item->getPrice():$item->getTaxAmount());
43
  $this->lineReference = $count;
44
  $this->numberOfItems = (int) $item->getQtyOrdered();
45
  $this->vatCategory = "None";
36
  public $vatCategory;
37
 
38
  public function create($item, $count, $order) {
39
+ $currency = $order->getOrderCurrencyCode();
40
+ $this->currency = $currency;
41
  $this->description = $item->getName();
42
+ $this->itemPrice = Mage::helper('adyen')->formatAmount($item->getPrice(), $currency);
43
+ $this->itemVAT = Mage::helper('adyen')->formatAmount(($item->getTaxAmount()>0 && $item->getPriceInclTax()>0)?$item->getPriceInclTax() - $item->getPrice():$item->getTaxAmount(), $currency);
44
  $this->lineReference = $count;
45
  $this->numberOfItems = (int) $item->getQtyOrdered();
46
  $this->vatCategory = "None";
app/code/community/Adyen/Payment/Model/Adyen/Data/ModificationRequest.php CHANGED
@@ -33,16 +33,16 @@ class Adyen_Payment_Model_Adyen_Data_ModificationRequest extends Adyen_Payment_M
33
  public $modificationAmount;
34
  public $originalReference;
35
 
36
- public function __construct() {
37
- $this->modificationAmount = new Adyen_Payment_Model_Adyen_Data_Amount();
38
- }
39
-
40
  public function create(Varien_Object $payment, $amount, $order, $merchantAccount, $pspReference = null) {
 
41
  $this->anyType2anyTypeMap = null;
42
  $this->authorisationCode = null;
43
  $this->merchantAccount = $merchantAccount;
44
- $this->modificationAmount->value = $this->_formatAmount($amount);
45
- $this->modificationAmount->currency = $order->getOrderCurrencyCode();
 
 
 
46
  $this->originalReference = $pspReference;
47
  return $this;
48
  }
33
  public $modificationAmount;
34
  public $originalReference;
35
 
 
 
 
 
36
  public function create(Varien_Object $payment, $amount, $order, $merchantAccount, $pspReference = null) {
37
+ $currency = $order->getOrderCurrencyCode();
38
  $this->anyType2anyTypeMap = null;
39
  $this->authorisationCode = null;
40
  $this->merchantAccount = $merchantAccount;
41
+ if($amount) {
42
+ $this->modificationAmount = new Adyen_Payment_Model_Adyen_Data_Amount();
43
+ $this->modificationAmount->value = Mage::helper('adyen')->formatAmount($amount, $currency);
44
+ $this->modificationAmount->currency = $currency;
45
+ }
46
  $this->originalReference = $pspReference;
47
  return $this;
48
  }
app/code/community/Adyen/Payment/Model/Adyen/Data/OpenInvoiceDetailResult.php CHANGED
@@ -31,11 +31,11 @@ class Adyen_Payment_Model_Adyen_Data_OpenInvoiceDetailResult extends Adyen_Payme
31
 
32
  public function create($request) {
33
  $incrementId = $request->request->reference;
34
-
35
  //amaount negative
36
  $amount = (float)$request->request->amount->value / 100;
37
- $isRefund = ($amount <= 0 ) ? true : false;
38
-
39
  if (empty($incrementId))
40
  return false;
41
  $order = Mage::getModel('sales/order')->loadByIncrementId($incrementId);
@@ -48,9 +48,9 @@ class Adyen_Payment_Model_Adyen_Data_OpenInvoiceDetailResult extends Adyen_Payme
48
  $lines[] = Mage::getModel('adyen/adyen_data_invoiceRow')->create($item, $count, $order );
49
  $count++;
50
  }
51
-
52
  //discount cost
53
- if($order->getDiscountAmount() > 0)
54
  {
55
  $cost = new Varien_Object();
56
  $cost->setName(Mage::helper('adyen')->__('Total Discount'));
@@ -59,7 +59,7 @@ class Adyen_Payment_Model_Adyen_Data_OpenInvoiceDetailResult extends Adyen_Payme
59
  $lines[] = Mage::getModel('adyen/adyen_data_invoiceRow')->create($cost, $count, $order);
60
  $count++;
61
  }
62
-
63
  //shipping cost
64
  if($order->getShippingAmount() > 0 || $order->getShippingTaxAmount() > 0)
65
  {
@@ -72,6 +72,15 @@ class Adyen_Payment_Model_Adyen_Data_OpenInvoiceDetailResult extends Adyen_Payme
72
  $count++;
73
  }
74
 
 
 
 
 
 
 
 
 
 
75
  // Klarna wants tax cost provided in the lines of the products so overal tax cost is not needed anymore
76
  // $cost = new Varien_Object();
77
  // $cost->setName(Mage::helper('adyen')->__('Tax'));
@@ -79,15 +88,15 @@ class Adyen_Payment_Model_Adyen_Data_OpenInvoiceDetailResult extends Adyen_Payme
79
  // $cost->setQtyOrdered(1);
80
  // $lines[] = Mage::getModel('adyen/adyen_data_invoiceRow')->create($cost, $count, $order);
81
  // $count++;
82
-
83
  /**
84
  * Refund line, heads up $lines is overwritten!
85
  */
86
- if ($isRefund === true) {
87
  $refundLine = $this->extractRefundLine($order, $amount);
88
- $lines = Mage::getModel('adyen/adyen_data_invoiceRow')->create($refundLine, $count, $order);
89
  }
90
-
91
  //all lines
92
  $InvoiceLine = Mage::getModel('adyen/adyen_data_invoiceLine')->create($lines);
93
  @$this->result->lines = $InvoiceLine;
@@ -97,15 +106,15 @@ class Adyen_Payment_Model_Adyen_Data_OpenInvoiceDetailResult extends Adyen_Payme
97
 
98
  return $this;
99
  }
100
-
101
  public function extractRefundLine($order , $amount) {
102
- $_extract = new Varien_Object();
103
- $_extract->setName('Refund / Correction');
104
- $_extract->setPrice($amount);
105
- $_extract->setTaxAmount(0);
106
- $_extract->setQtyOrdered(1);
107
  return $_extract;
108
-
109
  }
110
 
111
  }
31
 
32
  public function create($request) {
33
  $incrementId = $request->request->reference;
34
+
35
  //amaount negative
36
  $amount = (float)$request->request->amount->value / 100;
37
+ $isRefund = ($amount <= 0 ) ? true : false;
38
+
39
  if (empty($incrementId))
40
  return false;
41
  $order = Mage::getModel('sales/order')->loadByIncrementId($incrementId);
48
  $lines[] = Mage::getModel('adyen/adyen_data_invoiceRow')->create($item, $count, $order );
49
  $count++;
50
  }
51
+
52
  //discount cost
53
+ if($order->getDiscountAmount() > 0 || $order->getDiscountAmount() < 0)
54
  {
55
  $cost = new Varien_Object();
56
  $cost->setName(Mage::helper('adyen')->__('Total Discount'));
59
  $lines[] = Mage::getModel('adyen/adyen_data_invoiceRow')->create($cost, $count, $order);
60
  $count++;
61
  }
62
+
63
  //shipping cost
64
  if($order->getShippingAmount() > 0 || $order->getShippingTaxAmount() > 0)
65
  {
72
  $count++;
73
  }
74
 
75
+ if($order->getPaymentFeeAmount() > 0) {
76
+ $cost = new Varien_Object();
77
+ $cost->setName(Mage::helper('adyen')->__('Payment Fee'));
78
+ $cost->setPrice($order->getPaymentFeeAmount());
79
+ $cost->setQtyOrdered(1);
80
+ $lines[] = Mage::getModel('adyen/adyen_data_invoiceRow')->create($cost, $count, $order);
81
+ $count++;
82
+ }
83
+
84
  // Klarna wants tax cost provided in the lines of the products so overal tax cost is not needed anymore
85
  // $cost = new Varien_Object();
86
  // $cost->setName(Mage::helper('adyen')->__('Tax'));
88
  // $cost->setQtyOrdered(1);
89
  // $lines[] = Mage::getModel('adyen/adyen_data_invoiceRow')->create($cost, $count, $order);
90
  // $count++;
91
+
92
  /**
93
  * Refund line, heads up $lines is overwritten!
94
  */
95
+ if ($isRefund === true) {
96
  $refundLine = $this->extractRefundLine($order, $amount);
97
+ $lines = Mage::getModel('adyen/adyen_data_invoiceRow')->create($refundLine, $count, $order);
98
  }
99
+
100
  //all lines
101
  $InvoiceLine = Mage::getModel('adyen/adyen_data_invoiceLine')->create($lines);
102
  @$this->result->lines = $InvoiceLine;
106
 
107
  return $this;
108
  }
109
+
110
  public function extractRefundLine($order , $amount) {
111
+ $_extract = new Varien_Object();
112
+ $_extract->setName('Refund / Correction');
113
+ $_extract->setPrice($amount);
114
+ $_extract->setTaxAmount(0);
115
+ $_extract->setQtyOrdered(1);
116
  return $_extract;
117
+
118
  }
119
 
120
  }
app/code/community/Adyen/Payment/Model/Adyen/Data/PaymentRequest.php CHANGED
@@ -53,6 +53,7 @@ class Adyen_Payment_Model_Adyen_Data_PaymentRequest extends Adyen_Payment_Model_
53
  // added for boleto
54
  public $shopperName;
55
  public $socialSecurityNumber;
 
56
 
57
  public function __construct() {
58
  $this->browserInfo = new Adyen_Payment_Model_Adyen_Data_BrowserInfo();
@@ -61,25 +62,34 @@ class Adyen_Payment_Model_Adyen_Data_PaymentRequest extends Adyen_Payment_Model_
61
  $this->elv = new Adyen_Payment_Model_Adyen_Data_Elv();
62
  $this->additionalData = new Adyen_Payment_Model_Adyen_Data_AdditionalData();
63
  $this->shopperName = new Adyen_Payment_Model_Adyen_Data_ShopperName(); // for boleto
 
64
  }
65
 
66
- public function create(Varien_Object $payment, $amount, $order, $paymentMethod = null, $merchantAccount = null) {
67
  $incrementId = $order->getIncrementId();
68
  $orderCurrencyCode = $order->getOrderCurrencyCode();
 
 
69
  $customerId = $order->getCustomerId();
 
70
 
71
  $this->reference = $incrementId;
72
  $this->merchantAccount = $merchantAccount;
73
  $this->amount->currency = $orderCurrencyCode;
74
- $this->amount->value = $this->_formatAmount($amount);
75
 
76
  //shopper data
77
  $customerEmail = $order->getCustomerEmail();
78
  $this->shopperEmail = $customerEmail;
79
  $this->shopperIP = $order->getRemoteIp();
80
- $this->shopperReference = $customerId;
81
-
82
-
 
 
 
 
 
83
  /**
84
  * Browser info
85
  * @var unknown_type
@@ -92,6 +102,7 @@ class Adyen_Payment_Model_Adyen_Data_PaymentRequest extends Adyen_Payment_Model_
92
  $elv = unserialize($payment->getPoNumber());
93
  $this->card = null;
94
  $this->shopperName = null;
 
95
  $this->elv->accountHolderName = $elv['account_owner'];
96
  $this->elv->bankAccountNumber = $elv['account_number'];
97
  $this->elv->bankLocation = $elv['bank_location'];
@@ -99,10 +110,32 @@ class Adyen_Payment_Model_Adyen_Data_PaymentRequest extends Adyen_Payment_Model_
99
  $this->elv->bankName = $elv['bank_name'];
100
  break;
101
  case "cc":
102
- $this->shopperName = null;
 
 
103
  $this->elv = null;
104
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  if (Mage::getModel('adyen/adyen_cc')->isCseEnabled()) {
 
 
 
 
 
106
  $this->card = null;
107
  $kv = new Adyen_Payment_Model_Adyen_Data_AdditionalDataKVPair();
108
  $kv->key = new SoapVar("card.encrypted.json", XSD_STRING, "string", "http://www.w3.org/2001/XMLSchema");
@@ -110,33 +143,55 @@ class Adyen_Payment_Model_Adyen_Data_PaymentRequest extends Adyen_Payment_Model_
110
  $this->additionalData->entry = $kv;
111
  }
112
  else {
113
- $this->card->cvc = $payment->getCcCid();
114
- $this->card->expiryMonth = $payment->getCcExpMonth();
115
- $this->card->expiryYear = $payment->getCcExpYear();
116
- $this->card->holderName = $payment->getCcOwner();
117
- $this->card->number = $payment->getCcNumber();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  }
119
-
120
  // installments
121
- if(Mage::helper('adyen/installments')->isInstallmentsEnabled()){
122
- $kv = new Adyen_Payment_Model_Adyen_Data_AdditionalDataKVPair();
123
- $kv->key = new SoapVar("installments", XSD_STRING, "string", "http://www.w3.org/2001/XMLSchema");
124
- $kv->value = new SoapVar($payment->getPoNumber(), XSD_STRING, "string", "http://www.w3.org/2001/XMLSchema");
125
- $this->additionalData->entry = $kv;
126
  }
127
  break;
128
  case "boleto":
129
  $boleto = unserialize($payment->getPoNumber());
130
  $this->card = null;
131
  $this->elv = null;
 
132
  $this->socialSecurityNumber = $boleto['social_security_number'];
133
  $this->selectedBrand = $boleto['selected_brand'];
134
  $this->shopperName->firstName = $boleto['firstname'];
135
  $this->shopperName->lastName = $boleto['lastname'];
136
  $this->deliveryDate = $boleto['delivery_date'];
137
  break;
 
 
 
 
 
 
 
 
 
 
138
  }
139
-
140
  return $this;
141
  }
142
 
53
  // added for boleto
54
  public $shopperName;
55
  public $socialSecurityNumber;
56
+ const GUEST_ID = 'customer_';
57
 
58
  public function __construct() {
59
  $this->browserInfo = new Adyen_Payment_Model_Adyen_Data_BrowserInfo();
62
  $this->elv = new Adyen_Payment_Model_Adyen_Data_Elv();
63
  $this->additionalData = new Adyen_Payment_Model_Adyen_Data_AdditionalData();
64
  $this->shopperName = new Adyen_Payment_Model_Adyen_Data_ShopperName(); // for boleto
65
+ $this->bankAccount = new Adyen_Payment_Model_Adyen_Data_BankAccount(); // for SEPA
66
  }
67
 
68
+ public function create(Varien_Object $payment, $amount, $order, $paymentMethod = null, $merchantAccount = null, $recurringType = null, $enableMoto = null) {
69
  $incrementId = $order->getIncrementId();
70
  $orderCurrencyCode = $order->getOrderCurrencyCode();
71
+ // override amount because this amount uses the right currency
72
+ $amount = $order->getGrandTotal();
73
  $customerId = $order->getCustomerId();
74
+ $realOrderId = $order->getRealOrderId();
75
 
76
  $this->reference = $incrementId;
77
  $this->merchantAccount = $merchantAccount;
78
  $this->amount->currency = $orderCurrencyCode;
79
+ $this->amount->value = Mage::helper('adyen')->formatAmount($amount, $orderCurrencyCode);
80
 
81
  //shopper data
82
  $customerEmail = $order->getCustomerEmail();
83
  $this->shopperEmail = $customerEmail;
84
  $this->shopperIP = $order->getRemoteIp();
85
+ $this->shopperReference = (!empty($customerId)) ? $customerId : self::GUEST_ID . $realOrderId;
86
+
87
+ // add recurring type for oneclick and recurring
88
+ if($recurringType) {
89
+ $this->recurring = new Adyen_Payment_Model_Adyen_Data_Recurring();
90
+ $this->recurring->contract = $recurringType;
91
+ }
92
+
93
  /**
94
  * Browser info
95
  * @var unknown_type
102
  $elv = unserialize($payment->getPoNumber());
103
  $this->card = null;
104
  $this->shopperName = null;
105
+ $this->bankAccount = null;
106
  $this->elv->accountHolderName = $elv['account_owner'];
107
  $this->elv->bankAccountNumber = $elv['account_number'];
108
  $this->elv->bankLocation = $elv['bank_location'];
110
  $this->elv->bankName = $elv['bank_name'];
111
  break;
112
  case "cc":
113
+ case "oneclick":
114
+
115
+ $this->shopperName = null;
116
  $this->elv = null;
117
+ $this->bankAccount = null;
118
+
119
+ $recurringDetailReference = $payment->getAdditionalInformation("recurring_detail_reference");
120
+
121
+ // set shopperInteraction
122
+ if($recurringType == "RECURRING") {
123
+ $this->shopperInteraction = "ContAuth";
124
+ } else {
125
+ $this->shopperInteraction = "Ecommerce";
126
+ }
127
+
128
+
129
+ if(Mage::app()->getStore()->isAdmin() && $enableMoto != null && $enableMoto == 1) {
130
+ $this->shopperInteraction = "Moto";
131
+ }
132
+
133
  if (Mage::getModel('adyen/adyen_cc')->isCseEnabled()) {
134
+
135
+ if($recurringDetailReference && $recurringDetailReference != "") {
136
+ $this->selectedRecurringDetailReference = $recurringDetailReference;
137
+ }
138
+
139
  $this->card = null;
140
  $kv = new Adyen_Payment_Model_Adyen_Data_AdditionalDataKVPair();
141
  $kv->key = new SoapVar("card.encrypted.json", XSD_STRING, "string", "http://www.w3.org/2001/XMLSchema");
143
  $this->additionalData->entry = $kv;
144
  }
145
  else {
146
+
147
+ if($recurringDetailReference && $recurringDetailReference != "") {
148
+ $this->selectedRecurringDetailReference = $recurringDetailReference;
149
+
150
+ if($recurringType != "RECURRING") {
151
+ $this->card->cvc = $payment->getCcCid();
152
+ }
153
+
154
+ // TODO: check if expirymonth and year is changed if so add this in the card object
155
+ $this->card->expiryMonth = $payment->getCcExpMonth();
156
+ $this->card->expiryYear = $payment->getCcExpYear();
157
+
158
+ } else {
159
+ $this->card->cvc = $payment->getCcCid();
160
+ $this->card->expiryMonth = $payment->getCcExpMonth();
161
+ $this->card->expiryYear = $payment->getCcExpYear();
162
+ $this->card->holderName = $payment->getCcOwner();
163
+ $this->card->number = $payment->getCcNumber();
164
+ }
165
  }
166
+
167
  // installments
168
+ if(Mage::helper('adyen/installments')->isInstallmentsEnabled() && $payment->getAdditionalInformation('number_of_installments') > 0){
169
+ $this->installments = new Adyen_Payment_Model_Adyen_Data_Installments();
170
+ $this->installments->value = $payment->getAdditionalInformation('number_of_installments');
 
 
171
  }
172
  break;
173
  case "boleto":
174
  $boleto = unserialize($payment->getPoNumber());
175
  $this->card = null;
176
  $this->elv = null;
177
+ $this->bankAccount = null;
178
  $this->socialSecurityNumber = $boleto['social_security_number'];
179
  $this->selectedBrand = $boleto['selected_brand'];
180
  $this->shopperName->firstName = $boleto['firstname'];
181
  $this->shopperName->lastName = $boleto['lastname'];
182
  $this->deliveryDate = $boleto['delivery_date'];
183
  break;
184
+ case "sepa":
185
+ $sepa = unserialize($payment->getPoNumber());
186
+ $this->card = null;
187
+ $this->elv = null;
188
+ $this->shopperName = null;
189
+ $this->bankAccount->iban = $sepa['iban'];
190
+ $this->bankAccount->ownerName = $sepa['account_name'];
191
+ $this->bankAccount->countryCode = $sepa['country'];
192
+ $this->selectedBrand = "sepadirectdebit";
193
+ break;
194
  }
 
195
  return $this;
196
  }
197
 
app/code/community/Adyen/Payment/Model/Adyen/Data/Recurring.php CHANGED
@@ -30,7 +30,4 @@ class Adyen_Payment_Model_Adyen_Data_Recurring extends Adyen_Payment_Model_Adyen
30
  public $contract;
31
  public $recurringDetailName = null;
32
 
33
- public function __construct() {
34
- $this->contract = $this->_getConfigData('recurringtypes', 'adyen_abstract');
35
- }
36
  }
30
  public $contract;
31
  public $recurringDetailName = null;
32
 
 
 
 
33
  }
app/code/community/Adyen/Payment/Model/Adyen/Hpp.php CHANGED
@@ -1,437 +1,473 @@
1
- <?php
2
-
3
- /**
4
- * Adyen Payment Module
5
- *
6
- * NOTICE OF LICENSE
7
- *
8
- * This source file is subject to the Open Software License (OSL 3.0)
9
- * that is bundled with this package in the file LICENSE.txt.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://opensource.org/licenses/osl-3.0.php
12
- * If you did not receive a copy of the license and are unable to
13
- * obtain it through the world-wide-web, please send an email
14
- * to license@magentocommerce.com so we can send you a copy immediately.
15
- *
16
- * @category Adyen
17
- * @package Adyen_Payment
18
- * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
19
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
- */
21
- /**
22
- * @category Payment Gateway
23
- * @package Adyen_Payment
24
- * @author Adyen
25
- * @property Adyen B.V
26
- * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
27
- */
28
- class Adyen_Payment_Model_Adyen_Hpp extends Adyen_Payment_Model_Adyen_Abstract {
29
- /**
30
- * @var DUMMY_EMAIL used when email is empty
31
- */
32
- const DUMMY_EMAIL = 'dummy@dummy.com';
33
- /**
34
- * @var GUEST_ID , used when order is placed by guests
35
- */
36
- const GUEST_ID = 'customer_';
37
-
38
- protected $_canUseInternal = false;
39
- protected $_code = 'adyen_hpp';
40
- protected $_formBlockType = 'adyen/form_hpp';
41
- protected $_infoBlockType = 'adyen/info_hpp';
42
- protected $_paymentMethod = 'hpp';
43
- protected $_testModificationUrl = 'https://pal-test.adyen.com/pal/adapter/httppost';
44
- protected $_liveModificationUrl = 'https://pal-live.adyen.com/pal/adapter/httppost';
45
-
46
- /**
47
- * @desc Get checkout session namespace
48
- *
49
- * @return Mage_Checkout_Model_Session
50
- */
51
- public function getCheckout() {
52
- return Mage::getSingleton('checkout/session');
53
- }
54
-
55
- public function assignData($data) {
56
- if (!($data instanceof Varien_Object)) {
57
- $data = new Varien_Object($data);
58
- }
59
- $info = $this->getInfoInstance();
60
- $hppType = $data->getHppType();
61
- $info->setCcType($hppType)
62
- ->setPoNumber($data->getData('hpp_ideal_type')); /* @note misused field */
63
- $config = Mage::getStoreConfig("payment/adyen_hpp/disable_hpptypes");
64
- if (empty($hppType) && empty($config)) {
65
- Mage::throwException(Mage::helper('adyen')->__('Payment Method is complusory in order to process your payment'));
66
- }
67
- return $this;
68
- }
69
-
70
- /**
71
- * @desc Called just after asssign data
72
- */
73
- public function prepareSave() {
74
- parent::prepareSave();
75
- }
76
-
77
- /**
78
- * @desc Get current quote
79
- *
80
- * @return Mage_Sales_Model_Quote
81
- */
82
- public function getQuote() {
83
- return $this->getCheckout()->getQuote();
84
- }
85
-
86
- public function getOrderPlaceRedirectUrl() {
87
- return Mage::getUrl('adyen/process/redirect');
88
- }
89
-
90
- /**
91
- * @desc prepare params array to send it to gateway page via POST
92
- * @return array
93
- */
94
- public function getFormFields() {
95
- $this->_initOrder();
96
- $order = $this->_order;
97
- $realOrderId = $order->getRealOrderId();
98
- $orderCurrencyCode = $order->getOrderCurrencyCode();
99
- $skinCode = trim($this->_getConfigData('skinCode', 'adyen_hpp'));
100
- $amount = $this->_formatAmount($order->getGrandTotal(),(($orderCurrencyCode=='IDR')?0:2));
101
- $merchantAccount = trim($this->_getConfigData('merchantAccount'));
102
- $customerEmail = $order->getCustomerEmail();
103
- $shopperEmail = (!empty($customerEmail)) ? $customerEmail : self::DUMMY_EMAIL;
104
- $customerId = $order->getCustomerId();
105
- $shopperIP = $order->getRemoteIp();
106
- $browserInfo = $_SERVER['HTTP_USER_AGENT'];
107
- $shopperLocale = trim($this->_getConfigData('shopperlocale'));
108
- $shopperLocale = (!empty($shopperLocale)) ? $shopperLocale : Mage::app()->getLocale()->getLocaleCode();
109
- $countryCode = trim($this->_getConfigData('countryCode'));
110
- $countryCode = (!empty($countryCode)) ? $countryCode : false;
111
-
112
-
113
- // if directory lookup is enabled use the billingadress as countrycode
114
- if($countryCode == false) {
115
- if(is_object($order->getBillingAddress()) && $order->getBillingAddress()->getCountry() != "") {
116
- $countryCode = $order->getBillingAddress()->getCountry();
117
- }
118
- }
119
-
120
- $adyFields = array();
121
- $deliveryDays = (int) $this->_getConfigData('delivery_days', 'adyen_hpp');
122
- $deliveryDays = (!empty($deliveryDays)) ? $deliveryDays : 55;
123
- $adyFields['merchantAccount'] = $merchantAccount;
124
- $adyFields['merchantReference'] = $realOrderId;
125
- $adyFields['paymentAmount'] = $amount;
126
- $adyFields['currencyCode'] = $orderCurrencyCode;
127
- $adyFields['shipBeforeDate'] = date("Y-m-d", mktime(date("H"), date("i"), date("s"), date("m"), date("j") + $deliveryDays, date("Y")));
128
- $adyFields['skinCode'] = $skinCode;
129
- $adyFields['shopperLocale'] = $shopperLocale;
130
- $adyFields['countryCode'] = $countryCode;
131
- $adyFields['shopperIP'] = $shopperIP;
132
- $adyFields['browserInfo'] = $browserInfo;
133
-
134
- //order data
135
- $items = $order->getAllItems();
136
- $shipmentAmount = number_format($order->getShippingAmount() + $order->getShippingTaxAmount(), 2, ',', ' ');
137
- $prodDetails = Mage::helper('adyen')->__('Shipment cost: %s %s <br />', $shipmentAmount, $orderCurrencyCode);
138
- $prodDetails .= Mage::helper('adyen')->__('Order rows: <br />');
139
- foreach ($items as $item) {
140
- if ($item->getParentItem()) {
141
- continue;
142
- }
143
- $name = $item->getName();
144
- $qtyOrdered = $this->_formatAmount($item->getQtyOrdered(), '0');
145
- $rowTotal = number_format($item->getRowTotalInclTax(), 2, ',', ' ');
146
- $prodDetails .= Mage::helper('adyen')->__('%s ( Qty: %s ) (Price: %s %s ) <br />', $name, $qtyOrdered, $rowTotal, $orderCurrencyCode);
147
- }
148
- $adyFields['orderData'] = base64_encode(gzencode($prodDetails)); //depreacated by Adyen
149
- $adyFields['sessionValidity'] = date(DATE_ATOM, mktime(date("H") + 1, date("i"), date("s"), date("m"), date("j"), date("Y")));
150
- $adyFields['shopperEmail'] = $shopperEmail;
151
-
152
- // recurring
153
- $recurringType = trim($this->_getConfigData('recurringtypes', 'adyen_abstract'));
154
- $adyFields['recurringContract'] = $recurringType;
155
- $adyFields['shopperReference'] = (!empty($customerId)) ? $customerId : self::GUEST_ID . $realOrderId;
156
-
157
- //blocked methods
158
- $adyFields['blockedMethods'] = "";
159
-
160
- $openinvoiceType = $this->_getConfigData('openinvoicetypes', 'adyen_openinvoice');
161
- if($this->_code == "adyen_openinvoice" && $openinvoiceType == "klarna") {
162
- $adyFields['billingAddressType'] = "1";
163
- $adyFields['deliveryAddressType'] = "1";
164
- $adyFields['shopperType'] = "1";
165
- } else {
166
- $adyFields['billingAddressType'] = "";
167
- $adyFields['deliveryAddressType'] = "";
168
- $adyFields['shopperType'] = "";
169
- }
170
-
171
- //the data that needs to be signed is a concatenated string of the form data
172
- $sign = $adyFields['paymentAmount'] .
173
- $adyFields['currencyCode'] .
174
- $adyFields['shipBeforeDate'] .
175
- $adyFields['merchantReference'] .
176
- $adyFields['skinCode'] .
177
- $adyFields['merchantAccount'] .
178
- $adyFields['sessionValidity'] .
179
- $adyFields['shopperEmail'] .
180
- $adyFields['shopperReference'] .
181
- $adyFields['recurringContract'] .
182
- $adyFields['blockedMethods'] .
183
- $adyFields['billingAddressType'] .
184
- $adyFields['deliveryAddressType'] .
185
- $adyFields['shopperType'];
186
-
187
- //Generate HMAC encrypted merchant signature
188
- $secretWord = $this->_getSecretWord();
189
- $signMac = Zend_Crypt_Hmac::compute($secretWord, 'sha1', $sign);
190
- $adyFields['merchantSig'] = base64_encode(pack('H*', $signMac));
191
-
192
- // get extra fields
193
- $adyFields = Mage::getModel('adyen/adyen_openinvoice')->getOptionalFormFields($adyFields,$this->_order);
194
-
195
- //IDEAL
196
- if (strpos($this->getInfoInstance()->getCcType(),"ideal") !== false) {
197
- $bankData = $this->getInfoInstance()->getPoNumber();
198
- if (!empty($bankData)) {
199
- $id = explode(DS, $bankData);
200
- $adyFields['skipSelection'] = 'true';
201
- $adyFields['brandCode'] = $this->getInfoInstance()->getCcType();
202
- $adyFields['idealIssuerId'] = $id['0'];
203
- }
204
- }
205
-
206
- // pos over hpp
207
- // disable this because no one using this and it will always show POS payment method
208
- // $terminalcode = 'redirect';
209
- // $adyFields['pos.serial_number'] = $terminalcode;
210
- // // calculate signatature pos
211
- // $strsign = "merchantSig:pos.serial_number|" . $adyFields['merchantSig'] . ":" . $terminalcode;
212
- // $signPOS = Zend_Crypt_Hmac::compute($secretWord, 'sha1', $strsign);
213
- // $adyFields['pos.sig'] = base64_encode(pack('H*', $signPOS));
214
-
215
- Mage::log($adyFields, self::DEBUG_LEVEL, 'http-request.log',true);
216
-
217
- return $adyFields;
218
- }
219
-
220
- protected function _getSecretWord($options = null) {
221
- switch ($this->getConfigDataDemoMode()) {
222
- case true:
223
- $secretWord = trim($this->_getConfigData('secret_wordt', 'adyen_hpp'));
224
- break;
225
- default:
226
- $secretWord = trim($this->_getConfigData('secret_wordp', 'adyen_hpp'));
227
- break;
228
- }
229
- return $secretWord;
230
- }
231
-
232
- /**
233
- * @desc Get url of Adyen payment
234
- * @return string
235
- * @todo add brandCode here
236
- */
237
- public function getFormUrl() {
238
- $brandCode = $this->getInfoInstance()->getCcType();
239
- $paymentRoutine = $this->_getConfigData('payment_routines', 'adyen_hpp');
240
- $isConfigDemoMode = $this->getConfigDataDemoMode();
241
- switch ($isConfigDemoMode) {
242
- case true:
243
- if ($paymentRoutine == 'single' && empty($brandCode)) {
244
- $url = 'https://test.adyen.com/hpp/pay.shtml';
245
- } else {
246
- $url = (empty($brandCode)) ?
247
- 'https://test.adyen.com/hpp/select.shtml' :
248
- "https://test.adyen.com/hpp/details.shtml?brandCode=$brandCode";
249
- }
250
- break;
251
- default:
252
- if ($paymentRoutine == 'single' && empty($brandCode)) {
253
- $url = 'https://live.adyen.com/hpp/pay.shtml';
254
- } else {
255
- $url = (empty($brandCode)) ?
256
- 'https://live.adyen.com/hpp/select.shtml' :
257
- "https://live.adyen.com/hpp/details.shtml?brandCode=$brandCode";
258
- }
259
- break;
260
- }
261
-
262
- //IDEAL
263
- $idealBankUrl = false;
264
- $bankData = $this->getInfoInstance()->getPoNumber();
265
- if ($brandCode == 'ideal' && !empty($bankData)) {
266
- $idealBankUrl = ($isConfigDemoMode == true) ?
267
- 'https://test.adyen.com/hpp/redirectIdeal.shtml' :
268
- 'https://live.adyen.com/hpp/redirectIdeal.shtml';
269
- }
270
-
271
-
272
- return (!empty($idealBankUrl)) ? $idealBankUrl : $url;
273
- }
274
-
275
- public function getFormName() {
276
- return "Adyen HPP";
277
- }
278
-
279
- /**
280
- * Return redirect block type
281
- *
282
- * @return string
283
- */
284
- public function getRedirectBlockType() {
285
- return $this->_redirectBlockType;
286
- }
287
-
288
- public function isInitializeNeeded() {
289
- return true;
290
- }
291
-
292
- public function initialize($paymentAction, $stateObject) {
293
- $state = Mage_Sales_Model_Order::STATE_NEW;
294
- $stateObject->setState($state);
295
- $stateObject->setStatus($this->_getConfigData('order_status'));
296
- }
297
-
298
- public function getConfigPaymentAction() {
299
- return true;
300
- }
301
-
302
-
303
- public function getAvailableHPPTypes() {
304
-
305
- $orderCurrencyCode = Mage::helper('checkout/cart')->getQuote()->getQuoteCurrencyCode();
306
- $skinCode = trim($this->_getConfigData('skinCode', 'adyen_hpp'));
307
- $merchantAccount = trim($this->_getConfigData('merchantAccount'));
308
- $amount = $this->_formatAmount(Mage::helper('checkout/cart')->getQuote()->getGrandTotal(),(($orderCurrencyCode=='IDR')?0:2));
309
- $sessionValidity = date(DATE_ATOM, mktime(date("H") + 1, date("i"), date("s"), date("m"), date("j"), date("Y")));
310
-
311
-
312
- $countryCode = trim($this->_getConfigData('countryCode'));
313
-
314
- if(empty($countryCode)) {
315
-
316
- // check if billingcountry is filled in
317
- if(is_object(Mage::helper('checkout/cart')->getQuote()->getBillingAddress()) && Mage::helper('checkout/cart')->getQuote()->getBillingAddress()->getCountry() != "") {
318
- $countryCode = Mage::helper('checkout/cart')->getQuote()->getBillingAddress()->getCountry();
319
- } else {
320
- $countryCode = ""; // don't set countryCode so you get all the payment methods
321
- // You could do ip lookup but availability and performace is not guaranteed
322
- // $ip = $this->getClientIp();
323
- // $countryCode = file_get_contents('http://api.hostip.info/country.php?ip='.$ip);
324
- }
325
- }
326
-
327
- // directory lookup to search for available payment methods
328
- $adyFields = array(
329
- "paymentAmount" => $amount,
330
- "currencyCode" => $orderCurrencyCode,
331
- "merchantReference" => "Get Payment methods",
332
- "skinCode" => $skinCode,
333
- "merchantAccount" => $merchantAccount,
334
- "sessionValidity" => $sessionValidity,
335
- "countryCode" => $countryCode,
336
- "merchantSig" => "",
337
- );
338
-
339
- $sign = $adyFields['paymentAmount'] .
340
- $adyFields['currencyCode'] .
341
- $adyFields['merchantReference'] .
342
- $adyFields['skinCode'] .
343
- $adyFields['merchantAccount'] .
344
- $adyFields['sessionValidity'];
345
-
346
- //Generate HMAC encrypted merchant signature
347
- $secretWord = $this->_getSecretWord();
348
- $signMac = Zend_Crypt_Hmac::compute($secretWord, 'sha1', $sign);
349
- $adyFields['merchantSig'] = base64_encode(pack('H*', $signMac));
350
-
351
- $ch = curl_init();
352
-
353
- $isConfigDemoMode = $this->getConfigDataDemoMode();
354
- if ($isConfigDemoMode)
355
- curl_setopt($ch, CURLOPT_URL, "https://test.adyen.com/hpp/directory.shtml");
356
- else
357
- curl_setopt($ch, CURLOPT_URL, "https://live.adyen.com/hpp/directory.shtml");
358
-
359
- curl_setopt($ch, CURLOPT_HEADER, false);
360
- curl_setopt($ch, CURLOPT_POST,count($adyFields));
361
- curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($adyFields));
362
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // do not print results if you do curl_exec
363
-
364
- $results = curl_exec($ch);
365
-
366
- if($results === false) {
367
- echo "Error: " . curl_error($ch);
368
- Mage::log("Payment methods are not available on this merchantaccount\skin result is: " . curl_error($ch), self::DEBUG_LEVEL, 'http-request.log',true);
369
- Mage::throwException(Mage::helper('adyen')->__('Payment methods are not available on this merchantaccount\skin'));
370
- } else{
371
- /**
372
- * The $result contains a JSON array containing
373
- * the available payment methods for the merchant account.
374
- */
375
- $results_json = json_decode($results);
376
-
377
- if($results_json == null) {
378
- // no valid json so show the error
379
- echo $results;
380
- Mage::log("Payment methods are empty on this merchantaccount\skin. results_json is incorrect result is:" . $results_json, self::DEBUG_LEVEL, 'http-request.log',true);
381
- Mage::throwException(Mage::helper('adyen')->__('Payment methods are empty on this merchantaccount\skin'));
382
- }
383
-
384
- $payment_methods = $results_json->paymentMethods;
385
-
386
- $result_array = array();
387
- foreach($payment_methods as $payment_method) {
388
-
389
- // if openinvoice is activated don't show this in HPP options
390
- if(Mage::getStoreConfig("payment/adyen_openinvoice/active")) {
391
- if(Mage::getStoreConfig("payment/adyen_openinvoice/openinvoicetypes") == $payment_method->brandCode) {
392
- continue;
393
- }
394
- }
395
-
396
- $result_array[$payment_method->brandCode]['name'] = $payment_method->name;
397
-
398
- if(isset($payment_method->issuers)) {
399
- // for ideal go through the issuers
400
- if(count($payment_method->issuers) > 0)
401
- {
402
- foreach($payment_method->issuers as $issuer) {
403
- $result_array[$payment_method->brandCode]['issuers'][$issuer->issuerId] = $issuer->name;
404
- }
405
- }
406
- ksort($result_array[$payment_method->brandCode]['issuers']); // sort on key
407
- }
408
- }
409
- }
410
- return $result_array;
411
- }
412
-
413
- // Function to get the client ip address
414
- public function getClientIp() {
415
-
416
- $ipaddress = '';
417
-
418
- if (isset($_SERVER['HTTP_CLIENT_IP']))
419
- $ipaddress = $_SERVER['HTTP_CLIENT_IP'];
420
- else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))
421
- $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
422
- else if(isset($_SERVER['HTTP_X_FORWARDED']))
423
- $ipaddress = $_SERVER['HTTP_X_FORWARDED'];
424
- else if(isset($_SERVER['HTTP_FORWARDED_FOR']))
425
- $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];
426
- else if(isset($_SERVER['HTTP_FORWARDED']))
427
- $ipaddress = $_SERVER['HTTP_FORWARDED'];
428
- else if(isset($_SERVER['REMOTE_ADDR']))
429
- $ipaddress = $_SERVER['REMOTE_ADDR'];
430
- else
431
- $ipaddress = '';
432
-
433
- return $ipaddress;
434
- }
435
-
436
-
437
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adyen Payment Module
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Adyen
17
+ * @package Adyen_Payment
18
+ * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ /**
22
+ * @category Payment Gateway
23
+ * @package Adyen_Payment
24
+ * @author Adyen
25
+ * @property Adyen B.V
26
+ * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
27
+ */
28
+ class Adyen_Payment_Model_Adyen_Hpp extends Adyen_Payment_Model_Adyen_Abstract {
29
+ /**
30
+ * @var DUMMY_EMAIL used when email is empty
31
+ */
32
+ const DUMMY_EMAIL = 'dummy@dummy.com';
33
+ /**
34
+ * @var GUEST_ID , used when order is placed by guests
35
+ */
36
+ const GUEST_ID = 'customer_';
37
+
38
+ protected $_canUseInternal = false;
39
+ protected $_code = 'adyen_hpp';
40
+ protected $_formBlockType = 'adyen/form_hpp';
41
+ protected $_infoBlockType = 'adyen/info_hpp';
42
+ protected $_paymentMethod = 'hpp';
43
+ protected $_testModificationUrl = 'https://pal-test.adyen.com/pal/adapter/httppost';
44
+ protected $_liveModificationUrl = 'https://pal-live.adyen.com/pal/adapter/httppost';
45
+
46
+ /**
47
+ * @desc Get checkout session namespace
48
+ *
49
+ * @return Mage_Checkout_Model_Session
50
+ */
51
+ public function getCheckout() {
52
+ return Mage::getSingleton('checkout/session');
53
+ }
54
+
55
+ public function assignData($data) {
56
+ if (!($data instanceof Varien_Object)) {
57
+ $data = new Varien_Object($data);
58
+ }
59
+ $info = $this->getInfoInstance();
60
+ $hppType = $data->getHppType();
61
+ $info->setCcType($hppType)
62
+ ->setPoNumber($data->getData('hpp_ideal_type')); /* @note misused field */
63
+ $config = Mage::getStoreConfig("payment/adyen_hpp/disable_hpptypes");
64
+ if (empty($hppType) && empty($config)) {
65
+ Mage::throwException(Mage::helper('adyen')->__('Payment Method is complusory in order to process your payment'));
66
+ }
67
+ return $this;
68
+ }
69
+
70
+ /**
71
+ * @desc Called just after asssign data
72
+ */
73
+ public function prepareSave() {
74
+ parent::prepareSave();
75
+ }
76
+
77
+ /**
78
+ * @desc Get current quote
79
+ *
80
+ * @return Mage_Sales_Model_Quote
81
+ */
82
+ public function getQuote() {
83
+ return $this->getCheckout()->getQuote();
84
+ }
85
+
86
+ public function getOrderPlaceRedirectUrl() {
87
+ return Mage::getUrl('adyen/process/redirect');
88
+ }
89
+
90
+ /**
91
+ * @desc prepare params array to send it to gateway page via POST
92
+ * @return array
93
+ */
94
+ public function getFormFields() {
95
+ $this->_initOrder();
96
+ $order = $this->_order;
97
+ $realOrderId = $order->getRealOrderId();
98
+ $orderCurrencyCode = $order->getOrderCurrencyCode();
99
+ $skinCode = trim($this->_getConfigData('skinCode', 'adyen_hpp'));
100
+ $amount = Mage::helper('adyen')->formatAmount($order->getGrandTotal(), $orderCurrencyCode);
101
+ $merchantAccount = trim($this->_getConfigData('merchantAccount'));
102
+ $customerEmail = $order->getCustomerEmail();
103
+ $shopperEmail = (!empty($customerEmail)) ? $customerEmail : self::DUMMY_EMAIL;
104
+ $customerId = $order->getCustomerId();
105
+ $shopperIP = $order->getRemoteIp();
106
+ $browserInfo = $_SERVER['HTTP_USER_AGENT'];
107
+ $shopperLocale = trim($this->_getConfigData('shopperlocale'));
108
+ $shopperLocale = (!empty($shopperLocale)) ? $shopperLocale : Mage::app()->getLocale()->getLocaleCode();
109
+ $countryCode = trim($this->_getConfigData('countryCode'));
110
+ $countryCode = (!empty($countryCode)) ? $countryCode : false;
111
+
112
+
113
+ // if directory lookup is enabled use the billingadress as countrycode
114
+ if($countryCode == false) {
115
+ if(is_object($order->getBillingAddress()) && $order->getBillingAddress()->getCountry() != "") {
116
+ $countryCode = $order->getBillingAddress()->getCountry();
117
+ }
118
+ }
119
+
120
+ $adyFields = array();
121
+ $deliveryDays = (int) $this->_getConfigData('delivery_days', 'adyen_hpp');
122
+ $deliveryDays = (!empty($deliveryDays)) ? $deliveryDays : 55;
123
+ $adyFields['merchantAccount'] = $merchantAccount;
124
+ $adyFields['merchantReference'] = $realOrderId;
125
+ $adyFields['paymentAmount'] = $amount;
126
+ $adyFields['currencyCode'] = $orderCurrencyCode;
127
+ $adyFields['shipBeforeDate'] = date("Y-m-d", mktime(date("H"), date("i"), date("s"), date("m"), date("j") + $deliveryDays, date("Y")));
128
+ $adyFields['skinCode'] = $skinCode;
129
+ $adyFields['shopperLocale'] = $shopperLocale;
130
+ $adyFields['countryCode'] = $countryCode;
131
+ $adyFields['shopperIP'] = $shopperIP;
132
+ $adyFields['browserInfo'] = $browserInfo;
133
+
134
+ //order data
135
+ $items = $order->getAllItems();
136
+ $shipmentAmount = number_format($order->getShippingAmount() + $order->getShippingTaxAmount(), 2, ',', ' ');
137
+ $prodDetails = Mage::helper('adyen')->__('Shipment cost: %s %s <br />', $shipmentAmount, $orderCurrencyCode);
138
+ $prodDetails .= Mage::helper('adyen')->__('Order rows: <br />');
139
+ foreach ($items as $item) {
140
+ if ($item->getParentItem()) {
141
+ continue;
142
+ }
143
+ $name = $item->getName();
144
+ $qtyOrdered = $this->_numberFormat($item->getQtyOrdered(), '0');
145
+ $rowTotal = number_format($item->getRowTotalInclTax(), 2, ',', ' ');
146
+ $prodDetails .= Mage::helper('adyen')->__('%s ( Qty: %s ) (Price: %s %s ) <br />', $name, $qtyOrdered, $rowTotal, $orderCurrencyCode);
147
+ }
148
+ $adyFields['orderData'] = base64_encode(gzencode($prodDetails)); //depreacated by Adyen
149
+ $adyFields['sessionValidity'] = date(DATE_ATOM, mktime(date("H") + 1, date("i"), date("s"), date("m"), date("j"), date("Y")));
150
+ $adyFields['shopperEmail'] = $shopperEmail;
151
+
152
+ // recurring
153
+ $recurringType = trim($this->_getConfigData('recurringtypes', 'adyen_abstract'));
154
+ $adyFields['recurringContract'] = $recurringType;
155
+ $adyFields['shopperReference'] = (!empty($customerId)) ? $customerId : self::GUEST_ID . $realOrderId;
156
+
157
+ //blocked methods
158
+ $adyFields['blockedMethods'] = "";
159
+
160
+ $openinvoiceType = $this->_getConfigData('openinvoicetypes', 'adyen_openinvoice');
161
+
162
+ if($this->_code == "adyen_openinvoice" || $this->getInfoInstance()->getCcType() == "klarna" || $this->getInfoInstance()->getCcType() == "afterpay_default") {
163
+ $adyFields['billingAddressType'] = "1";
164
+ $adyFields['deliveryAddressType'] = "1";
165
+ $adyFields['shopperType'] = "1";
166
+ } else {
167
+ $adyFields['billingAddressType'] = "";
168
+ $adyFields['deliveryAddressType'] = "";
169
+ $adyFields['shopperType'] = "";
170
+ }
171
+
172
+ //the data that needs to be signed is a concatenated string of the form data
173
+ $sign = $adyFields['paymentAmount'] .
174
+ $adyFields['currencyCode'] .
175
+ $adyFields['shipBeforeDate'] .
176
+ $adyFields['merchantReference'] .
177
+ $adyFields['skinCode'] .
178
+ $adyFields['merchantAccount'] .
179
+ $adyFields['sessionValidity'] .
180
+ $adyFields['shopperEmail'] .
181
+ $adyFields['shopperReference'] .
182
+ $adyFields['recurringContract'] .
183
+ $adyFields['blockedMethods'] .
184
+ $adyFields['billingAddressType'] .
185
+ $adyFields['deliveryAddressType'] .
186
+ $adyFields['shopperType'];
187
+
188
+ //Generate HMAC encrypted merchant signature
189
+ $secretWord = $this->_getSecretWord();
190
+ $signMac = Zend_Crypt_Hmac::compute($secretWord, 'sha1', $sign);
191
+ $adyFields['merchantSig'] = base64_encode(pack('H*', $signMac));
192
+
193
+ // get extra fields
194
+ $adyFields = Mage::getModel('adyen/adyen_openinvoice')->getOptionalFormFields($adyFields,$this->_order);
195
+
196
+ //IDEAL
197
+ if (strpos($this->getInfoInstance()->getCcType(),"ideal") !== false) {
198
+ $bankData = $this->getInfoInstance()->getPoNumber();
199
+ if (!empty($bankData)) {
200
+ $id = explode(DS, $bankData);
201
+ $adyFields['skipSelection'] = 'true';
202
+ $adyFields['brandCode'] = $this->getInfoInstance()->getCcType();
203
+ $adyFields['idealIssuerId'] = $id['0'];
204
+ }
205
+ }
206
+
207
+
208
+ // if option to put Return Url in request from magento is enabled add this in the request
209
+ $returnUrlInRequest = $this->_getConfigData('return_url_in_request', 'adyen_hpp');
210
+ if($returnUrlInRequest){
211
+ $url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK, true)."adyen/process/success";
212
+ $adyFields['resURL'] = $url;
213
+ }
214
+
215
+ // pos over hpp
216
+ // disable this because no one using this and it will always show POS payment method
217
+ // $terminalcode = 'redirect';
218
+ // $adyFields['pos.serial_number'] = $terminalcode;
219
+ // // calculate signatature pos
220
+ // $strsign = "merchantSig:pos.serial_number|" . $adyFields['merchantSig'] . ":" . $terminalcode;
221
+ // $signPOS = Zend_Crypt_Hmac::compute($secretWord, 'sha1', $strsign);
222
+ // $adyFields['pos.sig'] = base64_encode(pack('H*', $signPOS));
223
+
224
+ Mage::log($adyFields, self::DEBUG_LEVEL, 'http-request.log',true);
225
+
226
+ return $adyFields;
227
+ }
228
+
229
+ protected function _getSecretWord($options = null) {
230
+ switch ($this->getConfigDataDemoMode()) {
231
+ case true:
232
+ $secretWord = trim($this->_getConfigData('secret_wordt', 'adyen_hpp'));
233
+ break;
234
+ default:
235
+ $secretWord = trim($this->_getConfigData('secret_wordp', 'adyen_hpp'));
236
+ break;
237
+ }
238
+ return $secretWord;
239
+ }
240
+
241
+ /**
242
+ * @desc Get url of Adyen payment
243
+ * @return string
244
+ * @todo add brandCode here
245
+ */
246
+ public function getFormUrl() {
247
+ $brandCode = $this->getInfoInstance()->getCcType();
248
+ $paymentRoutine = $this->_getConfigData('payment_routines', 'adyen_hpp');
249
+ $isConfigDemoMode = $this->getConfigDataDemoMode();
250
+ switch ($isConfigDemoMode) {
251
+ case true:
252
+ if ($paymentRoutine == 'single' && empty($brandCode)) {
253
+ $url = 'https://test.adyen.com/hpp/pay.shtml';
254
+ } else {
255
+ $url = (empty($brandCode)) ?
256
+ 'https://test.adyen.com/hpp/select.shtml' :
257
+ "https://test.adyen.com/hpp/details.shtml?brandCode=$brandCode";
258
+ }
259
+ break;
260
+ default:
261
+ if ($paymentRoutine == 'single' && empty($brandCode)) {
262
+ $url = 'https://live.adyen.com/hpp/pay.shtml';
263
+ } else {
264
+ $url = (empty($brandCode)) ?
265
+ 'https://live.adyen.com/hpp/select.shtml' :
266
+ "https://live.adyen.com/hpp/details.shtml?brandCode=$brandCode";
267
+ }
268
+ break;
269
+ }
270
+
271
+ //IDEAL
272
+ $idealBankUrl = false;
273
+ $bankData = $this->getInfoInstance()->getPoNumber();
274
+ if ($brandCode == 'ideal' && !empty($bankData)) {
275
+ $idealBankUrl = ($isConfigDemoMode == true) ?
276
+ 'https://test.adyen.com/hpp/redirectIdeal.shtml' :
277
+ 'https://live.adyen.com/hpp/redirectIdeal.shtml';
278
+ }
279
+
280
+
281
+ return (!empty($idealBankUrl)) ? $idealBankUrl : $url;
282
+ }
283
+
284
+ public function getFormName() {
285
+ return "Adyen HPP";
286
+ }
287
+
288
+ /**
289
+ * Return redirect block type
290
+ *
291
+ * @return string
292
+ */
293
+ public function getRedirectBlockType() {
294
+ return $this->_redirectBlockType;
295
+ }
296
+
297
+ public function isInitializeNeeded() {
298
+ return true;
299
+ }
300
+
301
+ public function initialize($paymentAction, $stateObject) {
302
+ $state = Mage_Sales_Model_Order::STATE_NEW;
303
+ $stateObject->setState($state);
304
+ $stateObject->setStatus($this->_getConfigData('order_status'));
305
+ }
306
+
307
+ public function getConfigPaymentAction() {
308
+ return true;
309
+ }
310
+
311
+
312
+ public function getAvailableHPPTypes() {
313
+
314
+ $orderCurrencyCode = Mage::helper('checkout/cart')->getQuote()->getQuoteCurrencyCode();
315
+ $skinCode = trim($this->_getConfigData('skinCode', 'adyen_hpp'));
316
+ $merchantAccount = trim($this->_getConfigData('merchantAccount'));
317
+ $amount = Mage::helper('adyen')->formatAmount(Mage::helper('checkout/cart')->getQuote()->getGrandTotal(), $orderCurrencyCode);
318
+ $sessionValidity = date(DATE_ATOM, mktime(date("H") + 1, date("i"), date("s"), date("m"), date("j"), date("Y")));
319
+ $cacheDirectoryLookup = trim($this->_getConfigData('cache_directory_lookup', 'adyen_hpp'));
320
+
321
+
322
+ $countryCode = trim($this->_getConfigData('countryCode'));
323
+
324
+ if(empty($countryCode)) {
325
+
326
+ // check if billingcountry is filled in
327
+ if(is_object(Mage::helper('checkout/cart')->getQuote()->getBillingAddress()) && Mage::helper('checkout/cart')->getQuote()->getBillingAddress()->getCountry() != "") {
328
+ $countryCode = Mage::helper('checkout/cart')->getQuote()->getBillingAddress()->getCountry();
329
+ } else {
330
+ $countryCode = ""; // don't set countryCode so you get all the payment methods
331
+ // You could do ip lookup but availability and performace is not guaranteed
332
+ // $ip = $this->getClientIp();
333
+ // $countryCode = file_get_contents('http://api.hostip.info/country.php?ip='.$ip);
334
+ }
335
+ }
336
+
337
+ // check if cache setting is on
338
+ if($cacheDirectoryLookup) {
339
+ // cache name has variables merchantAccount, skinCode, currencycode and country code. Amound is not cached because of performance issues
340
+ $cacheId = 'cache_directory_lookup_request_' . $merchantAccount . "_" . $skinCode . "_" . $orderCurrencyCode . "_" . $countryCode;
341
+ // check if this request is already cached
342
+ if (false !== ($data = Mage::app()->getCache()->load($cacheId))) {
343
+ // return result from cache
344
+ return unserialize($data);
345
+ }
346
+ }
347
+ // directory lookup to search for available payment methods
348
+ $adyFields = array(
349
+ "paymentAmount" => $amount,
350
+ "currencyCode" => $orderCurrencyCode,
351
+ "merchantReference" => "Get Payment methods",
352
+ "skinCode" => $skinCode,
353
+ "merchantAccount" => $merchantAccount,
354
+ "sessionValidity" => $sessionValidity,
355
+ "countryCode" => $countryCode,
356
+ "shopperLocale" => $countryCode,
357
+ "merchantSig" => "",
358
+ );
359
+
360
+ $sign = $adyFields['paymentAmount'] .
361
+ $adyFields['currencyCode'] .
362
+ $adyFields['merchantReference'] .
363
+ $adyFields['skinCode'] .
364
+ $adyFields['merchantAccount'] .
365
+ $adyFields['sessionValidity'];
366
+
367
+ //Generate HMAC encrypted merchant signature
368
+ $secretWord = $this->_getSecretWord();
369
+
370
+ if($secretWord == "") {
371
+ Mage::throwException(Mage::helper('adyen')->__('You forgot to fill in HMAC key for Test or Live'));
372
+ }
373
+
374
+ $signMac = Zend_Crypt_Hmac::compute($secretWord, 'sha1', $sign);
375
+ $adyFields['merchantSig'] = base64_encode(pack('H*', $signMac));
376
+
377
+ $ch = curl_init();
378
+
379
+ $isConfigDemoMode = $this->getConfigDataDemoMode();
380
+ if ($isConfigDemoMode)
381
+ curl_setopt($ch, CURLOPT_URL, "https://test.adyen.com/hpp/directory.shtml");
382
+ else
383
+ curl_setopt($ch, CURLOPT_URL, "https://live.adyen.com/hpp/directory.shtml");
384
+
385
+ curl_setopt($ch, CURLOPT_HEADER, false);
386
+ curl_setopt($ch, CURLOPT_POST,count($adyFields));
387
+ curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($adyFields));
388
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // do not print results if you do curl_exec
389
+
390
+ $results = curl_exec($ch);
391
+
392
+ if($results === false) {
393
+ echo "Error: " . curl_error($ch);
394
+ Mage::log("Payment methods are not available on this merchantaccount\skin result is: " . curl_error($ch), self::DEBUG_LEVEL, 'http-request.log',true);
395
+ Mage::throwException(Mage::helper('adyen')->__('Payment methods are not available on this merchantaccount\skin'));
396
+ } else{
397
+ /**
398
+ * The $result contains a JSON array containing
399
+ * the available payment methods for the merchant account.
400
+ */
401
+ $results_json = json_decode($results);
402
+
403
+ if($results_json == null) {
404
+ // no valid json so show the error
405
+ echo $results;
406
+ Mage::log("Payment methods are empty on this merchantaccount\skin. results_json is incorrect result is:" . $results_json, self::DEBUG_LEVEL, 'http-request.log',true);
407
+ Mage::throwException(Mage::helper('adyen')->__('Payment methods are empty on this merchantaccount\skin'));
408
+ }
409
+
410
+ $payment_methods = $results_json->paymentMethods;
411
+
412
+ $result_array = array();
413
+ foreach($payment_methods as $payment_method) {
414
+
415
+ // if openinvoice is activated don't show this in HPP options
416
+ if(Mage::getStoreConfig("payment/adyen_openinvoice/active")) {
417
+ if(Mage::getStoreConfig("payment/adyen_openinvoice/openinvoicetypes") == $payment_method->brandCode) {
418
+ continue;
419
+ }
420
+ }
421
+
422
+ $result_array[$payment_method->brandCode]['name'] = $payment_method->name;
423
+
424
+ if(isset($payment_method->issuers)) {
425
+ // for ideal go through the issuers
426
+ if(count($payment_method->issuers) > 0)
427
+ {
428
+ foreach($payment_method->issuers as $issuer) {
429
+ $result_array[$payment_method->brandCode]['issuers'][$issuer->issuerId] = $issuer->name;
430
+ }
431
+ }
432
+ ksort($result_array[$payment_method->brandCode]['issuers']); // sort on key
433
+ }
434
+ }
435
+ }
436
+
437
+ // if cache is on cache this result
438
+ if($cacheDirectoryLookup) {
439
+ Mage::app()->getCache()->save(serialize($result_array), $cacheId);
440
+ }
441
+
442
+ return $result_array;
443
+ }
444
+
445
+ public function getHppOptionsDisabled() {
446
+ return Mage::getStoreConfig("payment/adyen_hpp/disable_hpptypes");
447
+ }
448
+
449
+ // Function to get the client ip address
450
+ public function getClientIp() {
451
+
452
+ $ipaddress = '';
453
+
454
+ if (isset($_SERVER['HTTP_CLIENT_IP']))
455
+ $ipaddress = $_SERVER['HTTP_CLIENT_IP'];
456
+ else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))
457
+ $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
458
+ else if(isset($_SERVER['HTTP_X_FORWARDED']))
459
+ $ipaddress = $_SERVER['HTTP_X_FORWARDED'];
460
+ else if(isset($_SERVER['HTTP_FORWARDED_FOR']))
461
+ $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];
462
+ else if(isset($_SERVER['HTTP_FORWARDED']))
463
+ $ipaddress = $_SERVER['HTTP_FORWARDED'];
464
+ else if(isset($_SERVER['REMOTE_ADDR']))
465
+ $ipaddress = $_SERVER['REMOTE_ADDR'];
466
+ else
467
+ $ipaddress = '';
468
+
469
+ return $ipaddress;
470
+ }
471
+
472
+
473
+ }
app/code/community/Adyen/Payment/Model/Adyen/Oneclick.php ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adyen Payment Module
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Adyen
17
+ * @package Adyen_Payment
18
+ * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ /**
22
+ * @category Payment Gateway
23
+ * @package Adyen_Payment
24
+ * @author Adyen
25
+ * @property Adyen B.V
26
+ * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
27
+ */
28
+ class Adyen_Payment_Model_Adyen_Oneclick extends Adyen_Payment_Model_Adyen_Cc {
29
+
30
+ protected $_code = 'adyen_oneclick';
31
+ protected $_formBlockType = 'adyen/form_oneclick';
32
+ protected $_infoBlockType = 'adyen/info_oneclick';
33
+ protected $_paymentMethod = 'oneclick';
34
+ protected $_canUseInternal = false; // not possible through backoffice interface
35
+
36
+
37
+ /*
38
+ * only enable if adyen_cc is enabled
39
+ */
40
+ public function isAvailable($quote = null)
41
+ {
42
+ $isAvailable = parent::isAvailable($quote);
43
+
44
+ // check if adyen_cc is enabled if not disable oneclick as well
45
+ $isCCActive = $this->_getConfigData('active', 'adyen_cc');
46
+ if(!$isCCActive)
47
+ return false;
48
+
49
+ return $isAvailable;
50
+ }
51
+ public function assignData($data) {
52
+ if (!($data instanceof Varien_Object)) {
53
+ $data = new Varien_Object($data);
54
+ }
55
+ $info = $this->getInfoInstance();
56
+
57
+ // check if selected payment is a recurring payment
58
+ if($data->getRecurring() != "") {
59
+
60
+ // get the selected recurring card
61
+ $recurringSelectedKey = $data->getRecurring();
62
+
63
+ // get cvc code for this creditcard
64
+ $recurringDetailReferenceKey = "recurringDetailReference_".$recurringSelectedKey;
65
+ $cvcKey = "oneclick_cid_".$recurringSelectedKey;
66
+
67
+ // don't use magic getter but get the key because this is a variable value
68
+ $recurringDetailReference = $data->getData($recurringDetailReferenceKey);
69
+ //$cvc = $data->getData($cvcKey);
70
+
71
+ // save information as additional information so you don't have to add column in table
72
+ $info->setAdditionalInformation('recurring_detail_reference', $recurringDetailReference);
73
+
74
+ if ($this->isCseEnabled()) {
75
+ $info->setAdditionalInformation('encrypted_data', $data->getEncryptedDataOneclick());
76
+ }
77
+ else {
78
+
79
+ if($data->getRecurring() != "") {
80
+
81
+ // check if expiry month and year is changed
82
+ $expiryMonth = $data->getData("oneclick_exp_month" . $recurringSelectedKey);
83
+ $expiryYear = $data->getData("oneclick_exp_year_" . $recurringSelectedKey);
84
+
85
+ // just set default data for info block only
86
+ $info->setCcType($data->getData("oneclick_type_" . $recurringSelectedKey))
87
+ ->setCcOwner($data->getData("oneclick_owner_" . $recurringSelectedKey))
88
+ ->setCcLast4($data->getData("oneclick_last_4_" . $recurringSelectedKey))
89
+ ->setCcExpMonth($data->getData("oneclick_exp_month_" . $recurringSelectedKey))
90
+ ->setCcExpYear($data->getData("oneclick_exp_year_" . $recurringSelectedKey))
91
+ ->setCcCid($data->getData("oneclick_cid_" . $recurringSelectedKey));
92
+ }
93
+ }
94
+ } else {
95
+ Mage::throwException(Mage::helper('adyen')->__('Payment Method is complusory in order to process your payment'));
96
+ }
97
+ return $this;
98
+ }
99
+
100
+ public function getlistRecurringDetails()
101
+ {
102
+ $quote = (Mage::getModel('checkout/type_onepage') !== false)? Mage::getModel('checkout/type_onepage')->getQuote(): Mage::getModel('checkout/session')->getQuote();
103
+ $customerId = $quote->getCustomerId();
104
+ return $this->_processRecurringRequest($customerId);
105
+ }
106
+
107
+ public function isNotRecurring() {
108
+ $recurring_type = $this->_getConfigData('recurringtypes', 'adyen_abstract');
109
+ if($recurring_type == "RECURRING")
110
+ return false;
111
+ return true;
112
+ }
113
+
114
+ }
app/code/community/Adyen/Payment/Model/Adyen/Openinvoice.php CHANGED
@@ -27,7 +27,7 @@
27
  */
28
  class Adyen_Payment_Model_Adyen_Openinvoice extends Adyen_Payment_Model_Adyen_Hpp {
29
 
30
- protected $_canUseInternal = false;
31
  protected $_code = 'adyen_openinvoice';
32
  protected $_formBlockType = 'adyen/form_openinvoice';
33
  protected $_infoBlockType = 'adyen/info_openinvoice';
@@ -37,30 +37,71 @@ class Adyen_Payment_Model_Adyen_Openinvoice extends Adyen_Payment_Model_Adyen_Hp
37
  if (!($data instanceof Varien_Object)) {
38
  $data = new Varien_Object($data);
39
  }
 
40
  $info = $this->getInfoInstance();
41
  $info->setCcType('openinvoice');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  return $this;
43
  }
44
 
45
  /**
46
  * @desc Get url of Adyen payment
47
- * @return string
48
  * @todo add brandCode here
49
  */
50
  public function getFormUrl() {
51
- $paymentRoutine = $this->_getConfigData('payment_routines', 'adyen_hpp');
52
- $openinvoiceType = $this->_getConfigData('openinvoicetypes', 'adyen_openinvoice');
53
 
54
  switch ($this->getConfigDataDemoMode()) {
55
  case true:
56
- if ($paymentRoutine == 'single' && empty($openinvoiceType)) {
57
  $url = 'https://test.adyen.com/hpp/pay.shtml';
58
  } else {
59
  $url = "https://test.adyen.com/hpp/details.shtml?brandCode=".$openinvoiceType;
60
  }
61
  break;
62
  default:
63
- if ($paymentRoutine == 'single' && empty($openinvoiceType)) {
64
  $url = 'https://live.adyen.com/hpp/pay.shtml';
65
  } else {
66
  $url = "https://live.adyen.com/hpp/details.shtml?brandCode=".$openinvoiceType;
@@ -69,9 +110,9 @@ class Adyen_Payment_Model_Adyen_Openinvoice extends Adyen_Payment_Model_Adyen_Hp
69
  }
70
  return $url;
71
  }
72
-
73
  public function getFormName() {
74
- return "Adyen HPP";
75
  }
76
 
77
  /**
@@ -84,12 +125,12 @@ class Adyen_Payment_Model_Adyen_Openinvoice extends Adyen_Payment_Model_Adyen_Hp
84
  $adyFields = $this->getOptionalFormFields($adyFields,$this->_order);
85
  return $adyFields;
86
  }
87
-
88
  public function getOptionalFormFields($adyFields,$order) {
89
  if (empty($order)) return $adyFields;
90
-
91
  $secretWord = $this->_getSecretWord();
92
-
93
  $billingAddress = $order->getBillingAddress();
94
  $adyFields['shopper.firstName'] = $billingAddress->getFirstname();
95
  $adyFields['shopper.lastName'] = $billingAddress->getLastname();
@@ -100,133 +141,176 @@ class Adyen_Payment_Model_Adyen_Openinvoice extends Adyen_Payment_Model_Adyen_Hp
100
  $adyFields['billingAddress.stateOrProvince'] = $billingAddress->getRegion();
101
  $adyFields['billingAddress.country'] = $billingAddress->getCountryId();
102
  $sign = $adyFields['billingAddress.street'] .
103
- $adyFields['billingAddress.houseNumberOrName'] .
104
- $adyFields['billingAddress.city'] .
105
- $adyFields['billingAddress.postalCode'] .
106
- $adyFields['billingAddress.stateOrProvince'] .
107
- $adyFields['billingAddress.country']
108
  ;
109
  //Generate HMAC encrypted merchant signature
110
  $signMac = Zend_Crypt_Hmac::compute($secretWord, 'sha1', $sign);
111
  $adyFields['billingAddressSig'] = base64_encode(pack('H*', $signMac));
112
 
113
-
114
  $deliveryAddress = $order->getShippingAddress();
115
  if($deliveryAddress != null)
116
  {
117
- $adyFields['deliveryAddress.street'] = $this->getStreet($deliveryAddress)->getName();
118
- $adyFields['deliveryAddress.houseNumberOrName'] = $this->getStreet($deliveryAddress)->getHouseNumber();
119
- $adyFields['deliveryAddress.city'] = $deliveryAddress->getCity();
120
- $adyFields['deliveryAddress.postalCode'] = $deliveryAddress->getPostcode();
121
- $adyFields['deliveryAddress.stateOrProvince'] = $deliveryAddress->getRegion();
122
- $adyFields['deliveryAddress.country'] = $deliveryAddress->getCountryId();
123
- $sign = $adyFields['deliveryAddress.street'] .
124
- $adyFields['deliveryAddress.houseNumberOrName'] .
125
- $adyFields['deliveryAddress.city'] .
126
- $adyFields['deliveryAddress.postalCode'] .
127
- $adyFields['deliveryAddress.stateOrProvince'] .
128
- $adyFields['deliveryAddress.country']
129
- ;
130
- //Generate HMAC encrypted merchant signature
131
- $secretWord = $this->_getSecretWord();
132
- $signMac = Zend_Crypt_Hmac::compute($secretWord, 'sha1', $sign);
133
- $adyFields['deliveryAddressSig'] = base64_encode(pack('H*', $signMac));
134
- }
135
-
 
 
136
 
137
- if ($adyFields['shopperReference'] != self::GUEST_ID) {
138
  $customer = Mage::getModel('customer/customer')->load($adyFields['shopperReference']);
139
- $adyFields['shopper.gender'] = strtoupper($this->getCustomerAttributeText($customer, 'gender'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
  $adyFields['shopper.infix'] = $customer->getPrefix();
141
  $dob = $customer->getDob();
142
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  if (!empty($dob)) {
144
  $adyFields['shopper.dateOfBirthDayOfMonth'] = $this->getDate($dob, 'd');
145
  $adyFields['shopper.dateOfBirthMonth'] = $this->getDate($dob, 'm');
146
  $adyFields['shopper.dateOfBirthYear'] = $this->getDate($dob, 'Y');
147
  }
148
  }
149
-
150
  // for sweden add here your socialSecurityNumber
151
  // $adyFields['shopper.socialSecurityNumber'] = "Result of your custom input field";
152
 
153
  $adyFields['shopper.telephoneNumber'] = $billingAddress->getTelephone();
154
-
155
  $openinvoiceType = $this->_getConfigData('openinvoicetypes', 'adyen_openinvoice');
156
 
157
- if($this->_code == "adyen_openinvoice" && $openinvoiceType == "klarna") {
158
- // initialize values if they are empty
159
- (isset($adyFields['shopper.gender'])) ? $adyFields['shopper.gender'] : "";
160
- (isset($adyFields['shopper.infix'])) ? $adyFields['shopper.infix'] : "";
161
- (isset($adyFields['shopper.dateOfBirthDayOfMonth'])) ? $adyFields['shopper.dateOfBirthDayOfMonth'] : "";
162
- (isset($adyFields['shopper.dateOfBirthMonth'])) ? $adyFields['shopper.dateOfBirthMonth'] : "";
163
- (isset($adyFields['shopper.dateOfBirthYear'])) ? $adyFields['shopper.dateOfBirthYear'] : "";
164
-
165
- $shoppperSign = $adyFields['shopper.firstName'] . $adyFields['shopper.infix'] . $adyFields['shopper.lastName'] . $adyFields['shopper.gender'] . $adyFields['shopper.dateOfBirthDayOfMonth'] . $adyFields['shopper.dateOfBirthMonth'] . $adyFields['shopper.dateOfBirthYear'] . $adyFields['shopper.telephoneNumber'];
166
- $shopperSignMac = Zend_Crypt_Hmac::compute($secretWord, 'sha1', $shoppperSign);
167
- $adyFields['shopperSig'] = base64_encode(pack('H*', $shopperSignMac));
168
- }
169
 
 
 
 
 
 
170
 
171
  $count = 0;
172
  $currency = $order->getOrderCurrencyCode();
173
  $additional_data_sign = array();
174
 
175
  foreach ($order->getItemsCollection() as $item) {
176
- //skip dummies
177
- if ($item->isDummy()) continue;
178
-
179
- ++$count;
180
- $linename = "line".$count;
181
- $additional_data_sign['openinvoicedata.' . $linename . '.currencyCode'] = $currency;
182
- $additional_data_sign['openinvoicedata.' . $linename . '.description'] = $item->getName();
183
- $additional_data_sign['openinvoicedata.' . $linename . '.itemAmount'] = $this->_formatAmount($item->getPrice());
184
- $additional_data_sign['openinvoicedata.' . $linename . '.itemVatAmount'] = $this->_formatAmount(($item->getTaxAmount()>0 && $item->getPriceInclTax()>0)?$item->getPriceInclTax() - $item->getPrice():$item->getTaxAmount());
185
- $additional_data_sign['openinvoicedata.' . $linename . '.numberOfItems'] = (int) $item->getQtyOrdered();
186
- $additional_data_sign['openinvoicedata.' . $linename . '.vatCategory'] = "None";
187
  }
188
-
189
  //discount cost
190
-
191
- if($order->getDiscountAmount() > 0)
192
  {
193
  $linename = "line".++$count;
194
  $additional_data_sign['openinvoicedata.' . $linename . '.currencyCode'] = $currency;
195
  $additional_data_sign['openinvoicedata.' . $linename . '.description'] = Mage::helper('adyen')->__('Total Discount');
196
- $additional_data_sign['openinvoicedata.' . $linename . '.itemAmount'] = $this->_formatAmount($order->getDiscountAmount());
197
  $additional_data_sign['openinvoicedata.' . $linename . '.itemVatAmount'] = "0";
198
  $additional_data_sign['openinvoicedata.' . $linename . '.numberOfItems'] = 1;
199
  $additional_data_sign['openinvoicedata.' . $linename . '.vatCategory'] = "None";
200
- }
201
-
202
  //shipping cost
203
  if($order->getShippingAmount() > 0 || $order->getShippingTaxAmount() > 0)
204
  {
205
  $linename = "line".++$count;
206
  $additional_data_sign['openinvoicedata.' . $linename . '.currencyCode'] = $currency;
207
  $additional_data_sign['openinvoicedata.' . $linename . '.description'] = $order->getShippingDescription();
208
- $additional_data_sign['openinvoicedata.' . $linename . '.itemAmount'] = $this->_formatAmount($order->getShippingAmount());
209
- $additional_data_sign['openinvoicedata.' . $linename . '.itemVatAmount'] = $this->_formatAmount($order->getShippingTaxAmount());
210
  $additional_data_sign['openinvoicedata.' . $linename . '.numberOfItems'] = 1;
211
  $additional_data_sign['openinvoicedata.' . $linename . '.vatCategory'] = "None";
212
  }
213
 
 
 
 
 
 
 
 
 
 
 
214
  // Klarna wants tax cost provided in the lines of the products so overal tax cost is not needed anymore
215
  // $linename = "line".++$count;
216
  // $additional_data_sign['openinvoicedata.' . $linename . '.currencyCode'] = $currency;
217
  // $additional_data_sign['openinvoicedata.' . $linename . '.description'] = Mage::helper('adyen')->__('Tax');
218
- // $additional_data_sign['openinvoicedata.' . $linename . '.itemAmount'] = $this->_formatAmount($order->getTaxAmount());
219
  // $additional_data_sign['openinvoicedata.' . $linename . '.itemVatAmount'] = "0";
220
  // $additional_data_sign['openinvoicedata.' . $linename . '.numberOfItems'] = 1;
221
  // $additional_data_sign['openinvoicedata.' . $linename . '.vatCategory'] = "None";
222
-
223
  // general for invoicelines
224
  $additional_data_sign['openinvoicedata.refundDescription'] = "Refund / Correction for ".$adyFields['merchantReference'];
225
  $additional_data_sign['openinvoicedata.numberOfLines'] = $count;
226
-
227
  // add merchantsignature in additional signature
228
  $additional_data_sign['merchantSig'] = $adyFields['merchantSig'];
229
-
230
  // generate signature
231
  ksort($additional_data_sign);
232
 
@@ -234,37 +318,37 @@ class Adyen_Payment_Model_Adyen_Openinvoice extends Adyen_Payment_Model_Adyen_Hp
234
  $sign_additional_data_keys = "";
235
  $sign_additional_data_values = "";
236
  foreach($additional_data_sign as $key => $value) {
237
-
238
- // add to fields
239
- $adyFields[$key] = $value;
240
-
241
- // create sign
242
- $sign_additional_data_keys .= $key;
243
- $sign_additional_data_values .= $value;
244
-
245
- $keys = array_keys($additional_data_sign);
246
- if(end($keys) != $key) {
247
- $sign_additional_data_keys .= ":";
248
- $sign_additional_data_values .= ":";
249
- }
250
  }
251
-
252
  $sign_additional_data = $sign_additional_data_keys . "|" . $sign_additional_data_values;
253
-
254
  $signMac = Zend_Crypt_Hmac::compute($secretWord, 'sha1', $sign_additional_data);
255
  $adyFields['openinvoicedata.sig'] = base64_encode(pack('H*', $signMac));
256
-
257
-
258
  Mage::log($adyFields, self::DEBUG_LEVEL, 'http-request.log');
259
-
260
  return $adyFields;
261
- }
262
 
263
  /**
264
  * Get Attribute label
265
  * @param type $customer
266
  * @param type $code
267
- * @return type
268
  */
269
  public function getCustomerAttributeText($customer, $code='gender') {
270
  $helper = Mage::helper('adyen');
@@ -284,21 +368,21 @@ class Adyen_Payment_Model_Adyen_Openinvoice extends Adyen_Payment_Model_Adyen_Hp
284
  $timeStamp = new DateTime($date);
285
  return $timeStamp->format($format);
286
  }
287
-
288
- /**
289
  * Street format
290
  * @param type $address
291
- * @return Varien_Object
292
  */
293
  public function getStreet($address) {
294
  if (empty($address)) return false;
295
  $street = self::formatStreet($address->getStreet());
296
  $streetName = $street['0'];
297
  unset($street['0']);
298
- $streetNr = implode('',$street);
299
  return new Varien_Object(array('name' => $streetName, 'house_number' => $streetNr));
300
  }
301
-
302
  /**
303
  * Fix this one string street + number
304
  * @example street + number
@@ -308,14 +392,22 @@ class Adyen_Payment_Model_Adyen_Openinvoice extends Adyen_Payment_Model_Adyen_Hp
308
  static public function formatStreet($street) {
309
  if (count($street) != 1) {
310
  return $street;
311
- }
312
  preg_match('/((\s\d{0,10})|(\s\d{0,10}\w{1,3}))$/i', $street['0'], $houseNumber, PREG_OFFSET_CAPTURE);
313
  if(!empty($houseNumber['0'])) {
314
- $_houseNumber = trim($houseNumber['0']['0']);
315
- $position = $houseNumber['0']['1'];
316
- $streeName = trim(substr($street['0'], 0, $position));
317
- $street = array($streeName,$_houseNumber);
318
  }
319
  return $street;
320
  }
 
 
 
 
 
 
 
 
321
  }
27
  */
28
  class Adyen_Payment_Model_Adyen_Openinvoice extends Adyen_Payment_Model_Adyen_Hpp {
29
 
30
+ protected $_canUseInternal = false;
31
  protected $_code = 'adyen_openinvoice';
32
  protected $_formBlockType = 'adyen/form_openinvoice';
33
  protected $_infoBlockType = 'adyen/info_openinvoice';
37
  if (!($data instanceof Varien_Object)) {
38
  $data = new Varien_Object($data);
39
  }
40
+
41
  $info = $this->getInfoInstance();
42
  $info->setCcType('openinvoice');
43
+
44
+ // check if option gender or date of birth is enabled
45
+ $genderShow = $this->genderShow();
46
+ $dobShow = $this->dobShow();
47
+
48
+ if($genderShow || $dobShow) {
49
+
50
+ // set gender and dob to the quote
51
+ $quote = $this->getQuote();
52
+
53
+ // dob must be in yyyy-MM-dd
54
+ $dob = $data->getYear() . "-" . $data->getMonth() . "-" . $data->getDay();
55
+
56
+ if($dobShow)
57
+ $quote->setCustomerDob($dob);
58
+
59
+ if($genderShow) {
60
+ $quote->setCustomerGender($data->getGender());
61
+ // Fix for OneStepCheckout (won't convert quote customerGender to order object)
62
+ $info->setAdditionalInformation('customerGender', $data->getGender());
63
+ }
64
+
65
+ /* Check if the customer is logged in or not */
66
+ if (Mage::getSingleton('customer/session')->isLoggedIn()) {
67
+
68
+ /* Get the customer data */
69
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
70
+
71
+ // set the email and/or gender
72
+ if($dobShow)
73
+ $customer->setDob($dob);
74
+
75
+ if($genderShow)
76
+ $customer->setGender($data->getGender());
77
+
78
+ // save changes into customer
79
+ $customer->save();
80
+ }
81
+ }
82
+
83
  return $this;
84
  }
85
 
86
  /**
87
  * @desc Get url of Adyen payment
88
+ * @return string
89
  * @todo add brandCode here
90
  */
91
  public function getFormUrl() {
92
+ $paymentRoutine = $this->_getConfigData('payment_routines', 'adyen_hpp');
93
+ $openinvoiceType = $this->_getConfigData('openinvoicetypes', 'adyen_openinvoice');
94
 
95
  switch ($this->getConfigDataDemoMode()) {
96
  case true:
97
+ if ($paymentRoutine == 'single' && empty($openinvoiceType)) {
98
  $url = 'https://test.adyen.com/hpp/pay.shtml';
99
  } else {
100
  $url = "https://test.adyen.com/hpp/details.shtml?brandCode=".$openinvoiceType;
101
  }
102
  break;
103
  default:
104
+ if ($paymentRoutine == 'single' && empty($openinvoiceType)) {
105
  $url = 'https://live.adyen.com/hpp/pay.shtml';
106
  } else {
107
  $url = "https://live.adyen.com/hpp/details.shtml?brandCode=".$openinvoiceType;
110
  }
111
  return $url;
112
  }
113
+
114
  public function getFormName() {
115
+ return "Adyen HPP";
116
  }
117
 
118
  /**
125
  $adyFields = $this->getOptionalFormFields($adyFields,$this->_order);
126
  return $adyFields;
127
  }
128
+
129
  public function getOptionalFormFields($adyFields,$order) {
130
  if (empty($order)) return $adyFields;
131
+
132
  $secretWord = $this->_getSecretWord();
133
+
134
  $billingAddress = $order->getBillingAddress();
135
  $adyFields['shopper.firstName'] = $billingAddress->getFirstname();
136
  $adyFields['shopper.lastName'] = $billingAddress->getLastname();
141
  $adyFields['billingAddress.stateOrProvince'] = $billingAddress->getRegion();
142
  $adyFields['billingAddress.country'] = $billingAddress->getCountryId();
143
  $sign = $adyFields['billingAddress.street'] .
144
+ $adyFields['billingAddress.houseNumberOrName'] .
145
+ $adyFields['billingAddress.city'] .
146
+ $adyFields['billingAddress.postalCode'] .
147
+ $adyFields['billingAddress.stateOrProvince'] .
148
+ $adyFields['billingAddress.country']
149
  ;
150
  //Generate HMAC encrypted merchant signature
151
  $signMac = Zend_Crypt_Hmac::compute($secretWord, 'sha1', $sign);
152
  $adyFields['billingAddressSig'] = base64_encode(pack('H*', $signMac));
153
 
154
+
155
  $deliveryAddress = $order->getShippingAddress();
156
  if($deliveryAddress != null)
157
  {
158
+ $adyFields['deliveryAddress.street'] = $this->getStreet($deliveryAddress)->getName();
159
+ $adyFields['deliveryAddress.houseNumberOrName'] = $this->getStreet($deliveryAddress)->getHouseNumber();
160
+ $adyFields['deliveryAddress.city'] = $deliveryAddress->getCity();
161
+ $adyFields['deliveryAddress.postalCode'] = $deliveryAddress->getPostcode();
162
+ $adyFields['deliveryAddress.stateOrProvince'] = $deliveryAddress->getRegion();
163
+ $adyFields['deliveryAddress.country'] = $deliveryAddress->getCountryId();
164
+ $sign = $adyFields['deliveryAddress.street'] .
165
+ $adyFields['deliveryAddress.houseNumberOrName'] .
166
+ $adyFields['deliveryAddress.city'] .
167
+ $adyFields['deliveryAddress.postalCode'] .
168
+ $adyFields['deliveryAddress.stateOrProvince'] .
169
+ $adyFields['deliveryAddress.country']
170
+ ;
171
+ //Generate HMAC encrypted merchant signature
172
+ $secretWord = $this->_getSecretWord();
173
+ $signMac = Zend_Crypt_Hmac::compute($secretWord, 'sha1', $sign);
174
+ $adyFields['deliveryAddressSig'] = base64_encode(pack('H*', $signMac));
175
+ }
176
+
177
+
178
+ if ($adyFields['shopperReference'] != (self::GUEST_ID . $order->getRealOrderId())) {
179
 
 
180
  $customer = Mage::getModel('customer/customer')->load($adyFields['shopperReference']);
181
+
182
+ if($this->getCustomerAttributeText($customer, 'gender') != "") {
183
+ $adyFields['shopper.gender'] = strtoupper($this->getCustomerAttributeText($customer, 'gender'));
184
+ } else {
185
+ // fix for OneStepCheckout (guest is not logged in but uses email that exists with account)
186
+ $_customer = Mage::getModel('customer/customer');
187
+ if($order->getCustomerGender()) {
188
+ $customerGender = $order->getCustomerGender();
189
+ } else {
190
+ // this is still empty for OneStepCheckout so uses extra saved parameter
191
+ $payment = $order->getPayment();
192
+ $customerGender = $payment->getAdditionalInformation('customerGender');
193
+ }
194
+ $adyFields['shopper.gender'] = strtoupper($_customer->getResource()->getAttribute('gender')->getSource()->getOptionText($customerGender));
195
+ }
196
+
197
  $adyFields['shopper.infix'] = $customer->getPrefix();
198
  $dob = $customer->getDob();
199
 
200
+ if (!empty($dob)) {
201
+ $adyFields['shopper.dateOfBirthDayOfMonth'] = $this->getDate($dob, 'd');
202
+ $adyFields['shopper.dateOfBirthMonth'] = $this->getDate($dob, 'm');
203
+ $adyFields['shopper.dateOfBirthYear'] = $this->getDate($dob, 'Y');
204
+ } else {
205
+ // fix for OneStepCheckout (guest is not logged in but uses email that exists with account)
206
+ $dob = $order->getCustomerDob();
207
+ if (!empty($dob)) {
208
+ $adyFields['shopper.dateOfBirthDayOfMonth'] = $this->getDate($dob, 'd');
209
+ $adyFields['shopper.dateOfBirthMonth'] = $this->getDate($dob, 'm');
210
+ $adyFields['shopper.dateOfBirthYear'] = $this->getDate($dob, 'Y');
211
+ }
212
+ }
213
+ } else {
214
+ // checkout as guest use details from the order
215
+ $_customer = Mage::getModel('customer/customer');
216
+ $adyFields['shopper.gender'] = strtoupper($_customer->getResource()->getAttribute('gender')->getSource()->getOptionText($order->getCustomerGender()));
217
+ $adyFields['shopper.infix'] = $order->getCustomerPrefix();
218
+ $dob = $order->getCustomerDob();
219
  if (!empty($dob)) {
220
  $adyFields['shopper.dateOfBirthDayOfMonth'] = $this->getDate($dob, 'd');
221
  $adyFields['shopper.dateOfBirthMonth'] = $this->getDate($dob, 'm');
222
  $adyFields['shopper.dateOfBirthYear'] = $this->getDate($dob, 'Y');
223
  }
224
  }
 
225
  // for sweden add here your socialSecurityNumber
226
  // $adyFields['shopper.socialSecurityNumber'] = "Result of your custom input field";
227
 
228
  $adyFields['shopper.telephoneNumber'] = $billingAddress->getTelephone();
229
+
230
  $openinvoiceType = $this->_getConfigData('openinvoicetypes', 'adyen_openinvoice');
231
 
232
+ if($this->_code == "adyen_openinvoice" || $this->getInfoInstance()->getCcType() == "klarna" || $this->getInfoInstance()->getCcType() == "afterpay_default" ) {
233
+ // initialize values if they are empty
234
+ $adyFields['shopper.gender'] = (isset($adyFields['shopper.gender'])) ? $adyFields['shopper.gender'] : "";
235
+ $adyFields['shopper.infix'] = (isset($adyFields['shopper.infix'])) ? $adyFields['shopper.infix'] : "";
236
+ $adyFields['shopper.dateOfBirthDayOfMonth'] = (isset($adyFields['shopper.dateOfBirthDayOfMonth'])) ? $adyFields['shopper.dateOfBirthDayOfMonth'] : "";
237
+ $adyFields['shopper.dateOfBirthMonth'] = (isset($adyFields['shopper.dateOfBirthMonth'])) ? $adyFields['shopper.dateOfBirthMonth'] : "";
238
+ $adyFields['shopper.dateOfBirthYear'] = (isset($adyFields['shopper.dateOfBirthYear'])) ? $adyFields['shopper.dateOfBirthYear'] : "";
 
 
 
 
 
239
 
240
+ $shoppperSign = $adyFields['shopper.firstName'] . $adyFields['shopper.infix'] . $adyFields['shopper.lastName'] . $adyFields['shopper.gender'] . $adyFields['shopper.dateOfBirthDayOfMonth'] . $adyFields['shopper.dateOfBirthMonth'] . $adyFields['shopper.dateOfBirthYear'] . $adyFields['shopper.telephoneNumber'];
241
+ $shopperSignMac = Zend_Crypt_Hmac::compute($secretWord, 'sha1', $shoppperSign);
242
+ $adyFields['shopperSig'] = base64_encode(pack('H*', $shopperSignMac));
243
+ }
244
+
245
 
246
  $count = 0;
247
  $currency = $order->getOrderCurrencyCode();
248
  $additional_data_sign = array();
249
 
250
  foreach ($order->getItemsCollection() as $item) {
251
+ //skip dummies
252
+ if ($item->isDummy()) continue;
253
+
254
+ ++$count;
255
+ $linename = "line".$count;
256
+ $additional_data_sign['openinvoicedata.' . $linename . '.currencyCode'] = $currency;
257
+ $additional_data_sign['openinvoicedata.' . $linename . '.description'] = $item->getName();
258
+ $additional_data_sign['openinvoicedata.' . $linename . '.itemAmount'] = Mage::helper('adyen')->formatAmount($item->getPrice(), $currency);
259
+ $additional_data_sign['openinvoicedata.' . $linename . '.itemVatAmount'] = Mage::helper('adyen')->formatAmount(($item->getTaxAmount()>0 && $item->getPriceInclTax()>0)?$item->getPriceInclTax() - $item->getPrice():$item->getTaxAmount(), $currency);
260
+ $additional_data_sign['openinvoicedata.' . $linename . '.numberOfItems'] = (int) $item->getQtyOrdered();
261
+ $additional_data_sign['openinvoicedata.' . $linename . '.vatCategory'] = "None";
262
  }
263
+
264
  //discount cost
265
+ if($order->getDiscountAmount() > 0 || $order->getDiscountAmount() < 0)
 
266
  {
267
  $linename = "line".++$count;
268
  $additional_data_sign['openinvoicedata.' . $linename . '.currencyCode'] = $currency;
269
  $additional_data_sign['openinvoicedata.' . $linename . '.description'] = Mage::helper('adyen')->__('Total Discount');
270
+ $additional_data_sign['openinvoicedata.' . $linename . '.itemAmount'] = Mage::helper('adyen')->formatAmount($order->getDiscountAmount(), $currency);
271
  $additional_data_sign['openinvoicedata.' . $linename . '.itemVatAmount'] = "0";
272
  $additional_data_sign['openinvoicedata.' . $linename . '.numberOfItems'] = 1;
273
  $additional_data_sign['openinvoicedata.' . $linename . '.vatCategory'] = "None";
274
+ }
275
+
276
  //shipping cost
277
  if($order->getShippingAmount() > 0 || $order->getShippingTaxAmount() > 0)
278
  {
279
  $linename = "line".++$count;
280
  $additional_data_sign['openinvoicedata.' . $linename . '.currencyCode'] = $currency;
281
  $additional_data_sign['openinvoicedata.' . $linename . '.description'] = $order->getShippingDescription();
282
+ $additional_data_sign['openinvoicedata.' . $linename . '.itemAmount'] = Mage::helper('adyen')->formatAmount($order->getShippingAmount(), $currency);
283
+ $additional_data_sign['openinvoicedata.' . $linename . '.itemVatAmount'] = Mage::helper('adyen')->formatAmount($order->getShippingTaxAmount(), $currency);
284
  $additional_data_sign['openinvoicedata.' . $linename . '.numberOfItems'] = 1;
285
  $additional_data_sign['openinvoicedata.' . $linename . '.vatCategory'] = "None";
286
  }
287
 
288
+ if($order->getPaymentFeeAmount() > 0) {
289
+ $linename = "line".++$count;
290
+ $additional_data_sign['openinvoicedata.' . $linename . '.currencyCode'] = $currency;
291
+ $additional_data_sign['openinvoicedata.' . $linename . '.description'] = Mage::helper('adyen')->__('Payment Fee');
292
+ $additional_data_sign['openinvoicedata.' . $linename . '.itemAmount'] = Mage::helper('adyen')->formatAmount($order->getPaymentFeeAmount(), $currency);
293
+ $additional_data_sign['openinvoicedata.' . $linename . '.itemVatAmount'] = "0";
294
+ $additional_data_sign['openinvoicedata.' . $linename . '.numberOfItems'] = 1;
295
+ $additional_data_sign['openinvoicedata.' . $linename . '.vatCategory'] = "None";
296
+ }
297
+
298
  // Klarna wants tax cost provided in the lines of the products so overal tax cost is not needed anymore
299
  // $linename = "line".++$count;
300
  // $additional_data_sign['openinvoicedata.' . $linename . '.currencyCode'] = $currency;
301
  // $additional_data_sign['openinvoicedata.' . $linename . '.description'] = Mage::helper('adyen')->__('Tax');
302
+ // $additional_data_sign['openinvoicedata.' . $linename . '.itemAmount'] = Mage::helper('adyen')->formatAmount($order->getTaxAmount(), $currency);
303
  // $additional_data_sign['openinvoicedata.' . $linename . '.itemVatAmount'] = "0";
304
  // $additional_data_sign['openinvoicedata.' . $linename . '.numberOfItems'] = 1;
305
  // $additional_data_sign['openinvoicedata.' . $linename . '.vatCategory'] = "None";
306
+
307
  // general for invoicelines
308
  $additional_data_sign['openinvoicedata.refundDescription'] = "Refund / Correction for ".$adyFields['merchantReference'];
309
  $additional_data_sign['openinvoicedata.numberOfLines'] = $count;
310
+
311
  // add merchantsignature in additional signature
312
  $additional_data_sign['merchantSig'] = $adyFields['merchantSig'];
313
+
314
  // generate signature
315
  ksort($additional_data_sign);
316
 
318
  $sign_additional_data_keys = "";
319
  $sign_additional_data_values = "";
320
  foreach($additional_data_sign as $key => $value) {
321
+
322
+ // add to fields
323
+ $adyFields[$key] = $value;
324
+
325
+ // create sign
326
+ $sign_additional_data_keys .= $key;
327
+ $sign_additional_data_values .= $value;
328
+
329
+ $keys = array_keys($additional_data_sign);
330
+ if(end($keys) != $key) {
331
+ $sign_additional_data_keys .= ":";
332
+ $sign_additional_data_values .= ":";
333
+ }
334
  }
335
+
336
  $sign_additional_data = $sign_additional_data_keys . "|" . $sign_additional_data_values;
337
+
338
  $signMac = Zend_Crypt_Hmac::compute($secretWord, 'sha1', $sign_additional_data);
339
  $adyFields['openinvoicedata.sig'] = base64_encode(pack('H*', $signMac));
340
+
341
+
342
  Mage::log($adyFields, self::DEBUG_LEVEL, 'http-request.log');
343
+
344
  return $adyFields;
345
+ }
346
 
347
  /**
348
  * Get Attribute label
349
  * @param type $customer
350
  * @param type $code
351
+ * @return type
352
  */
353
  public function getCustomerAttributeText($customer, $code='gender') {
354
  $helper = Mage::helper('adyen');
368
  $timeStamp = new DateTime($date);
369
  return $timeStamp->format($format);
370
  }
371
+
372
+ /**
373
  * Street format
374
  * @param type $address
375
+ * @return Varien_Object
376
  */
377
  public function getStreet($address) {
378
  if (empty($address)) return false;
379
  $street = self::formatStreet($address->getStreet());
380
  $streetName = $street['0'];
381
  unset($street['0']);
382
+ $streetNr = implode('',$street);
383
  return new Varien_Object(array('name' => $streetName, 'house_number' => $streetNr));
384
  }
385
+
386
  /**
387
  * Fix this one string street + number
388
  * @example street + number
392
  static public function formatStreet($street) {
393
  if (count($street) != 1) {
394
  return $street;
395
+ }
396
  preg_match('/((\s\d{0,10})|(\s\d{0,10}\w{1,3}))$/i', $street['0'], $houseNumber, PREG_OFFSET_CAPTURE);
397
  if(!empty($houseNumber['0'])) {
398
+ $_houseNumber = trim($houseNumber['0']['0']);
399
+ $position = $houseNumber['0']['1'];
400
+ $streeName = trim(substr($street['0'], 0, $position));
401
+ $street = array($streeName,$_houseNumber);
402
  }
403
  return $street;
404
  }
405
+
406
+ public function genderShow() {
407
+ return $this->_getConfigData('gender_show', 'adyen_openinvoice');
408
+ }
409
+
410
+ public function dobShow() {
411
+ return $this->_getConfigData('dob_show', 'adyen_openinvoice');
412
+ }
413
  }
app/code/community/Adyen/Payment/Model/Adyen/Pos.php CHANGED
@@ -85,7 +85,7 @@ class Adyen_Payment_Model_Adyen_Pos extends Adyen_Payment_Model_Adyen_Abstract {
85
  $order = $this->_order;
86
  $realOrderId = $order->getRealOrderId();
87
  $orderCurrencyCode = $order->getOrderCurrencyCode();
88
- $amount = $this->_formatAmount($order->getGrandTotal(),(($orderCurrencyCode=='IDR')?0:2));
89
  $customerId = $order->getCustomerId();
90
  $customerEmail = $order->getCustomerEmail();
91
 
85
  $order = $this->_order;
86
  $realOrderId = $order->getRealOrderId();
87
  $orderCurrencyCode = $order->getOrderCurrencyCode();
88
+ $amount = Mage::helper('adyen')->formatAmount($order->getGrandTotal(),$orderCurrencyCode);
89
  $customerId = $order->getCustomerId();
90
  $customerEmail = $order->getCustomerEmail();
91
 
app/code/community/Adyen/Payment/Model/Adyen/Sepa.php ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adyen Payment Module
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Adyen
17
+ * @package Adyen_Payment
18
+ * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ /**
22
+ * @category Payment Gateway
23
+ * @package Adyen_Payment
24
+ * @author Adyen
25
+ * @property Adyen B.V
26
+ * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
27
+ */
28
+ class Adyen_Payment_Model_Adyen_Sepa extends Adyen_Payment_Model_Adyen_Abstract {
29
+
30
+ protected $_code = 'adyen_sepa';
31
+ protected $_formBlockType = 'adyen/form_sepa';
32
+ protected $_infoBlockType = 'adyen/info_sepa';
33
+ protected $_paymentMethod = 'sepa';
34
+
35
+ /**
36
+ * 1)Called everytime the adyen_sepa is called or used in checkout
37
+ * @descrition Assign data to info model instance
38
+ *
39
+ * @param mixed $data
40
+ * @return Mage_Payment_Model_Info
41
+ */
42
+ public function assignData($data) {
43
+
44
+ if (!($data instanceof Varien_Object)) {
45
+ $data = new Varien_Object($data);
46
+ }
47
+
48
+ $info = $this->getInfoInstance();
49
+ $sepa = array(
50
+ 'account_name' => $data->getAccountName(),
51
+ 'iban' => $data->getIban(),
52
+ 'country' => $data->getCountry()
53
+ );
54
+
55
+ $info = $this->getInfoInstance();
56
+ $info->setCcOwner($data->getOwner())
57
+ ->setCcType($data->getBankLocation())
58
+ ->setCcLast4(substr($data->getAccountNumber(), -4))
59
+ ->setCcNumber($data->getAccountNumber())
60
+ ->setCcNumberEnc($data->getBankCode())
61
+ ->setPoNumber(serialize($sepa)); /* @note misused field for the elv */
62
+ return $this;
63
+ }
64
+
65
+ public function validate()
66
+ {
67
+ parent::validate();
68
+
69
+ // check if validator is on
70
+ $ibanValidation = $this->_getConfigData("validate_iban", "adyen_sepa");
71
+
72
+ if($ibanValidation) {
73
+
74
+ $info = $this->getInfoInstance();
75
+ $sepa = unserialize($info->getPoNumber());
76
+
77
+ if(!$this->validateIban($sepa['iban']) || empty($sepa['iban'])){
78
+ $errorCode = 'invalid_data';
79
+ $errorMsg = Mage::helper('adyen')->__('Invalid Iban number.');
80
+ Mage::throwException($errorMsg);
81
+ }
82
+ }
83
+ return $this;
84
+ }
85
+
86
+ public function validateIban($iban) {
87
+
88
+ $iban = strtolower(str_replace(' ','',$iban));
89
+ $Countries = array('al'=>28,'ad'=>24,'at'=>20,'az'=>28,'bh'=>22,'be'=>16,'ba'=>20,'br'=>29,'bg'=>22,'cr'=>21,'hr'=>21,'cy'=>28,'cz'=>24,'dk'=>18,'do'=>28,'ee'=>20,'fo'=>18,'fi'=>18,'fr'=>27,'ge'=>22,'de'=>22,'gi'=>23,'gr'=>27,'gl'=>18,'gt'=>28,'hu'=>28,'is'=>26,'ie'=>22,'il'=>23,'it'=>27,'jo'=>30,'kz'=>20,'kw'=>30,'lv'=>21,'lb'=>28,'li'=>21,'lt'=>20,'lu'=>20,'mk'=>19,'mt'=>31,'mr'=>27,'mu'=>30,'mc'=>27,'md'=>24,'me'=>22,'nl'=>18,'no'=>15,'pk'=>24,'ps'=>29,'pl'=>28,'pt'=>25,'qa'=>29,'ro'=>24,'sm'=>27,'sa'=>24,'rs'=>22,'sk'=>24,'si'=>19,'es'=>24,'se'=>24,'ch'=>21,'tn'=>24,'tr'=>26,'ae'=>23,'gb'=>22,'vg'=>24);
90
+ $Chars = array('a'=>10,'b'=>11,'c'=>12,'d'=>13,'e'=>14,'f'=>15,'g'=>16,'h'=>17,'i'=>18,'j'=>19,'k'=>20,'l'=>21,'m'=>22,'n'=>23,'o'=>24,'p'=>25,'q'=>26,'r'=>27,'s'=>28,'t'=>29,'u'=>30,'v'=>31,'w'=>32,'x'=>33,'y'=>34,'z'=>35);
91
+
92
+ if(isset($Countries[substr($iban,0,2)]) && strlen($iban) == $Countries[substr($iban,0,2)]){
93
+
94
+ $MovedChar = substr($iban, 4).substr($iban,0,4);
95
+ $MovedCharArray = str_split($MovedChar);
96
+ $NewString = "";
97
+
98
+ foreach($MovedCharArray AS $key => $value){
99
+ if(!is_numeric($MovedCharArray[$key])){
100
+ $MovedCharArray[$key] = $Chars[$MovedCharArray[$key]];
101
+ }
102
+ $NewString .= $MovedCharArray[$key];
103
+ }
104
+
105
+ if(bcmod($NewString, '97') == 1)
106
+ {
107
+ return TRUE;
108
+ }
109
+ else{
110
+ return FALSE;
111
+ }
112
+ }
113
+ else{
114
+ return FALSE;
115
+ }
116
+ }
117
+
118
+ /**
119
+ * Called just after asssign data
120
+ *
121
+ * @return Mage_Payment_Model_Abstract
122
+ */
123
+ public function prepareSave() {
124
+ //@todo encryption or so
125
+ parent::prepareSave();
126
+ }
127
+
128
+ }
app/code/community/Adyen/Payment/Model/Event.php CHANGED
@@ -34,11 +34,13 @@ class Adyen_Payment_Model_Event extends Mage_Core_Model_Abstract {
34
  const ADYEN_EVENT_REFUSED = 'REFUSED';
35
  const ADYEN_EVENT_ERROR = 'ERROR';
36
  const ADYEN_EVENT_REFUND = 'REFUND';
 
37
  const ADYEN_EVENT_CAPTURE = 'CAPTURE';
 
38
  const ADYEN_EVENT_CANCELLATION = 'CANCELLATION';
39
  const ADYEN_EVENT_POSAPPROVED = 'POS_APPROVED';
40
  const ADYEN_EVENT_HANDLEDEXTERNALLY = 'HANDLED_EXTERNALLY';
41
-
42
  /**
43
  * Initialize resources
44
  */
@@ -52,8 +54,9 @@ class Adyen_Payment_Model_Event extends Mage_Core_Model_Abstract {
52
  * @param type $dbEventCode
53
  * @return boolean true if the event is a duplicate
54
  */
55
- public function isDuplicate($pspReference, $event) {
56
- $result = $this->getResource()->getEvent(trim($pspReference), trim($event));
 
57
  return (empty($result)) ? false : true;
58
  }
59
 
34
  const ADYEN_EVENT_REFUSED = 'REFUSED';
35
  const ADYEN_EVENT_ERROR = 'ERROR';
36
  const ADYEN_EVENT_REFUND = 'REFUND';
37
+ const ADYEN_EVENT_CANCEL_OR_REFUND = 'CANCEL_OR_REFUND';
38
  const ADYEN_EVENT_CAPTURE = 'CAPTURE';
39
+ const ADYEN_EVENT_CAPTURE_FAILED = 'CAPTURE_FAILED';
40
  const ADYEN_EVENT_CANCELLATION = 'CANCELLATION';
41
  const ADYEN_EVENT_POSAPPROVED = 'POS_APPROVED';
42
  const ADYEN_EVENT_HANDLEDEXTERNALLY = 'HANDLED_EXTERNALLY';
43
+
44
  /**
45
  * Initialize resources
46
  */
54
  * @param type $dbEventCode
55
  * @return boolean true if the event is a duplicate
56
  */
57
+ public function isDuplicate($pspReference, $event, $success) {
58
+ $success = (trim($success) == "true") ? true : false;
59
+ $result = $this->getResource()->getEvent(trim($pspReference), trim($event), $success);
60
  return (empty($result)) ? false : true;
61
  }
62
 
app/code/community/Adyen/Payment/Model/Mysql4/Adyen/Event.php CHANGED
@@ -39,13 +39,24 @@ class Adyen_Payment_Model_Mysql4_Adyen_Event extends Mage_Core_Model_Mysql4_Abst
39
  * @param type $adyenEventCode
40
  * @return type
41
  */
42
- public function getEvent($pspReference, $adyenEventCode) {
43
  $db = $this->_getReadAdapter();
44
- $sql = $db->select()
 
 
45
  ->from($this->getMainTable(), array('*'))
46
  ->where('adyen_event_code = ?', $adyenEventCode)
47
  ->where('psp_reference = ?', $pspReference)
48
- ;
 
 
 
 
 
 
 
 
 
49
  $stmt = $db->query($sql);
50
  return $stmt->fetch();
51
  }
39
  * @param type $adyenEventCode
40
  * @return type
41
  */
42
+ public function getEvent($pspReference, $adyenEventCode, $success = null) {
43
  $db = $this->_getReadAdapter();
44
+
45
+ if($success == null) {
46
+ $sql = $db->select()
47
  ->from($this->getMainTable(), array('*'))
48
  ->where('adyen_event_code = ?', $adyenEventCode)
49
  ->where('psp_reference = ?', $pspReference)
50
+ ;
51
+ } else {
52
+ $sql = $db->select()
53
+ ->from($this->getMainTable(), array('*'))
54
+ ->where('adyen_event_code = ?', $adyenEventCode)
55
+ ->where('psp_reference = ?', $pspReference)
56
+ ->where('success = ?', $success)
57
+ ;
58
+ }
59
+
60
  $stmt = $db->query($sql);
61
  return $stmt->fetch();
62
  }
app/code/community/Adyen/Payment/Model/Observer.php CHANGED
@@ -49,28 +49,6 @@ class Adyen_Payment_Model_Observer {
49
  return false;
50
  }
51
 
52
- /**
53
- * @desc online refund only
54
- * @param Mage_Sales_Model_Order_Creditmemo $observer
55
- */
56
- public function refund(Varien_Event_Observer $observer) {
57
- $event = $observer->getEvent();
58
- $eventNameCmp = strcmp($event->getName(), 'sales_order_creditmemo_refund');
59
- $offline = (bool) $event->getCreditmemo()->getData('offline_requested');
60
- if ($eventNameCmp === 0 && !$offline) {
61
- $order = $event->getCreditmemo()->getOrder();
62
- $isAdyen = $this->isPaymentMethodAdyen($order);
63
- if (!$isAdyen)
64
- return false;
65
- $grandTotal = $event->getCreditmemo()->getGrandTotal();
66
- $payment = $order->getPayment();
67
- $pspReference = Mage::getModel('adyen/event')->getOriginalPspReference($order->getIncrementId());
68
- $order->getPayment()->getMethodInstance()->sendRefundRequest($payment, $grandTotal, $pspReference);
69
- return true;
70
- }
71
- return false;
72
- }
73
-
74
  /**
75
  * Determine if the payment method is Adyen
76
  * @param type $order
49
  return false;
50
  }
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  /**
53
  * Determine if the payment method is Adyen
54
  * @param type $order
app/code/community/Adyen/Payment/Model/Process.php CHANGED
@@ -34,17 +34,17 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
34
  * @throws Exception
35
  */
36
  public function processResponse($soapItem = null) {
37
-
38
- $response = (!empty($soapItem)) ? $soapItem : $this->getRequest()->getParams();
39
  Mage::getResourceModel('adyen/adyen_debug')->assignData($response);
40
- $actionName = $this->getRequest()->getActionName();
41
- $helper = Mage::helper('adyen');
42
-
43
  if (empty($response)) {
44
- Mage::log('blanco on response, please check your webserver that the result url accepts parameters', Zend_Log::CRIT, "adyen_notification.log", true);
45
  return "401";
46
  }
47
-
48
  $varienObj = new Varien_Object();
49
  foreach ($response as $code => $value) {
50
  if ($code == 'amount') {
@@ -57,10 +57,10 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
57
 
58
  // if version is added to notification url (?version=true) then only return the version of the plugin (only works from verion 1.0.0.8)
59
  if($varienObj->getData('version')) {
60
- echo $helper->getExtensionVersion();
61
- exit;
62
  }
63
-
64
  //authenticate
65
  $authStatus = Mage::getModel('adyen/authenticate')->authenticate($actionName, $varienObj);
66
  if (!$authStatus) {
@@ -70,12 +70,12 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
70
  }
71
 
72
  $incrementId = $varienObj->getData('merchantReference');
73
-
74
- try{
75
-
76
  //get order && payment objects
77
  $order = Mage::getModel('sales/order');
78
-
79
  //error
80
  $orderExist = $this->_incrementIdExist($incrementId);
81
  if (empty($orderExist)) {
@@ -101,146 +101,146 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
101
 
102
  return $status;
103
  }
104
-
105
-
106
- public function processPosResponse() {
107
-
108
- $helper = Mage::helper('adyen');
109
- $response = $_REQUEST;
110
-
111
-
112
- $varienObj = new Varien_Object();
113
- foreach ($response as $code => $value) {
114
- if ($code == 'amount') {
115
- if (is_object($value))
116
- $value = $value->value;
117
- $code = 'value';
118
- }
119
- $varienObj->setData($code, $value);
120
- }
121
-
122
- $actionName = $this->getRequest()->getActionName();
123
- $result = $varienObj->getData('result');
124
-
125
- // check if result comes from POS device comes form POS
126
- if($actionName == "successPos" && $result != "") {
127
-
128
- $checksum = $varienObj->getData('checksum');
129
-
130
- // for android checksum is called cs
131
- if($checksum == "") {
132
- $checksum = $varienObj->getData('cs');
133
- }
134
-
135
- $amount = $varienObj->getData('originalCustomAmount');
136
- $currency = $varienObj->getData('originalCustomCurrency');
137
- $session_id = $varienObj->getData('sessionId');
138
-
139
-
140
- // for android sessionis is with low i
141
- if($session_id == "") {
142
- $session_id = $varienObj->getData('sessionid');
143
- }
144
-
145
- // calculate amount checksum
146
- $amount_checksum = 0;
147
-
148
- for($i=0;$i<strlen($amount);$i++)
149
- {
150
- // ASCII value use ord
151
- $checksum_calc = ord($amount[$i]) - 48;
152
- $amount_checksum += $checksum_calc;
153
- }
154
-
155
- $currency_checksum = 0;
156
- for($i=0;$i<strlen($currency);$i++)
157
- {
158
- $checksum_calc = ord($currency[$i]) - 64;
159
- $currency_checksum += $checksum_calc;
160
- }
161
-
162
- $result_checksum = 0;
163
- for($i=0;$i<strlen($result);$i++)
164
- {
165
- $checksum_calc = ord($result[$i]) - 64;
166
- $result_checksum += $checksum_calc;
167
- }
168
-
169
- $session_id_checksum = 0;
170
- for($i=0;$i<strlen($session_id);$i++)
171
- {
172
- $checksum_calc = ord($session_id[$i]) - 48;
173
- $session_id_checksum += $checksum_calc;
174
- }
175
-
176
- $total_result_checksum = (($amount_checksum + $currency_checksum + $result_checksum) * $session_id_checksum) % 100;
177
-
178
- // check if request is valid
179
- if($total_result_checksum == $checksum) {
180
-
181
- //get order && payment objects
182
- $order = Mage::getModel('sales/order');
183
- //$incrementId = $varienObj->getData('merchantReference');
184
- $incrementId = $varienObj->getData('originalCustomMerchantReference');
185
-
186
- //error
187
- $orderExist = $this->_incrementIdExist($incrementId);
188
-
189
- if (empty($orderExist)) {
190
- $this->_writeLog("unknown order : $incrementId");
191
- } else {
192
- $order->loadByIncrementId($incrementId);
193
-
194
- if($result == 'APPROVED') {
195
- // wait for notification to finish the order
196
-
197
- // set adyen event status on true
198
- $order->setAdyenEventCode(Adyen_Payment_Model_Event::ADYEN_EVENT_POSAPPROVED);
199
-
200
- $comment = Mage::helper('adyen')
201
- ->__('%s <br /> Result: %s <br /> paymentMethod: %s', 'Adyen App Result URL Notification:', $result, 'POS');
202
-
203
- $order->addStatusHistoryComment($comment, false);
204
-
205
- try {
206
- $order->save();
207
- } catch (Exception $e) {
208
- Mage::logException($e);
209
- }
210
- } else {
211
-
212
- $isBankTransfer = Mage::getModel('adyen/event')
213
- ->isBanktransfer($order->getIncrementId());
214
- //attempt to hold/cancel (exceptional to BankTransfer they stay in previous status/pending)
215
-
216
- if (!$isBankTransfer) {
217
-
218
- $comment = Mage::helper('adyen')
219
- ->__('%s <br /> Result: %s <br /> paymentMethod: %s', 'Adyen App Result URL Notification:', $result, 'POS');
220
-
221
- $order->addStatusHistoryComment($comment, Mage_Sales_Model_Order::STATE_CANCELED);
222
-
223
- $order->setActionFlag(Mage_Sales_Model_Order::ACTION_FLAG_CANCEL, true);
224
-
225
- if (!$order->canCancel()) {
226
- $this->_writeLog('order can not be canceled', $order);
227
- $order->addStatusHistoryComment($helper->__('Order can not be canceled'), Mage_Sales_Model_Order::STATE_CANCELED);
228
- $order->save();
229
-
230
- } else {
231
- $order->cancel()->save();
232
- }
233
-
234
- } else {
235
- $this->_addStatusHistoryComment($order, $params, $order->getStatus());
236
- $status = true;
237
- }
238
- }
239
- }
240
- }
241
- }
242
- // close the window
243
- $html = "<html><body>
244
  <script type=\"text/javascript\">
245
  function closeWindow() {
246
  window.open('', '_self', '');
@@ -249,103 +249,103 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
249
  setTimeout(closeWindow, 500);
250
  </script>
251
  </body></html>";
252
-
253
- return $html;
254
  }
255
-
256
  public function processCashResponse()
257
  {
258
- $response = $_REQUEST;
259
-
260
- $varienObj = new Varien_Object();
261
- foreach ($response as $code => $value) {
262
- if ($code == 'amount') {
263
- if (is_object($value))
264
- $value = $value->value;
265
- $code = 'value';
266
- }
267
- $varienObj->setData($code, $value);
268
- }
269
-
270
- $pspReference = $varienObj->getData('pspReference');
271
- $merchantReference = $varienObj->getData('merchantReference');
272
- $skinCode = $varienObj->getData('skinCode');
273
- $paymentAmount = $varienObj->getData('paymentAmount');
274
- $currencyCode = $varienObj->getData('currencyCode');
275
- $customPaymentMethod = $varienObj->getData('c_cash');
276
- $paymentMethod = $varienObj->getData('paymentMethod');
277
- $merchantSig = $varienObj->getData('merchantSig');
278
-
279
- $sign = $pspReference .
280
- $merchantReference .
281
- $skinCode .
282
- $paymentAmount .
283
- $currencyCode .
284
- $customPaymentMethod . $paymentMethod;
285
-
286
- $secretWord = $this->_getSecretWord();
287
- $signMac = Zend_Crypt_Hmac::compute($secretWord, 'sha1', $sign);
288
- $calMerchantSig = base64_encode(pack('H*', $signMac));
289
-
290
- // check if signatures are the same
291
- if($calMerchantSig == $merchantSig) {
292
-
293
- //get order && payment objects
294
- $order = Mage::getModel('sales/order');
295
-
296
- //error
297
- $orderExist = $this->_incrementIdExist($merchantReference);
298
-
299
- if (empty($orderExist)) {
300
- $this->_writeLog("unknown order : $merchantReference");
301
- } else {
302
- $order->loadByIncrementId($merchantReference);
303
-
304
- $comment = Mage::helper('adyen')
305
- ->__('Adyen Cash Result URL Notification: <br /> pspReference: %s <br /> paymentMethod: %s', $pspReference, $paymentMethod);
306
-
307
- $status = true;
308
-
309
- $history = Mage::getModel('sales/order_status_history')
310
- ->setStatus($status)
311
- ->setComment($comment)
312
- ->setEntityName("order")
313
- ->setOrder($order);
314
- $history->save();
315
-
316
- return $status;
317
- }
318
- }
319
- return false;
320
  }
321
-
322
  protected function _getSecretWord($options = null) {
323
- switch ($this->getConfigDataDemoMode()) {
324
- case true:
325
- $secretWord = trim($this->_getConfigData('secret_wordt', 'adyen_hpp'));
326
- break;
327
- default:
328
- $secretWord = trim($this->_getConfigData('secret_wordp', 'adyen_hpp'));
329
- break;
330
- }
331
- return $secretWord;
332
  }
333
-
334
  /**
335
  * Used via Payment method.Notice via configuration ofcourse Y or N
336
  * @return boolean true on demo, else false
337
  */
338
  public function getConfigDataDemoMode() {
339
- if ($this->_getConfigData('demoMode') == 'Y') {
340
- return true;
341
- }
342
- return false;
343
  }
344
-
345
  /**
346
  * @desc check order existance
347
  * @param type $incrementId
348
- * @return type
349
  */
350
  protected function _incrementIdExist($incrementId) {
351
  return Mage::getResourceModel('adyen/order')->orderExist($incrementId);
@@ -354,51 +354,73 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
354
  /**
355
  * @desc Adyen attribute handling
356
  * @param Varien_Object $order
357
- * @param type $response
358
  */
359
  protected function _addAdyenAttributes(Varien_Object $order, $response, $updateAdyenStatus = true) {
 
 
 
 
 
360
  $pspReference = $response->getData('pspReference');
361
  $eventCode = $response->getData('eventCode');
362
  $authResult = $response->getData('authResult');
363
  $incrementId = $response->getData('merchantReference');
364
  $paymentMethod = $response->getData('paymentMethod');
 
365
  $eventData = (!empty($eventCode)) ? $eventCode : $authResult;
366
  $paymentObj = $order->getPayment();
367
-
368
  $paymentObj->setLastTransId($incrementId)
369
- ->setAdyenPaymentMethod($paymentMethod)
370
- ->setCcType($paymentMethod)
371
- ;
372
 
373
  // only update this when authroization notification is not yet processed
374
  Mage::log("AdyenEventCode in paymentobject order:".$order->getAdyenEventCode(), Zend_Log::DEBUG, "adyen_notification.log", true);
375
  Mage::log("paymentobject order authResult:".$authResult, Zend_Log::DEBUG, "adyen_notification.log", true);
376
-
377
  if(!(substr($order->getAdyenEventCode(), 0, 13) == Adyen_Payment_Model_Event::ADYEN_EVENT_AUTHORISATION && $authResult == Adyen_Payment_Model_Event::ADYEN_EVENT_AUTHORISED)){
378
- Mage::log("update paymentobject eventcode with:".$eventData, Zend_Log::DEBUG, "adyen_notification.log", true);
379
- $paymentObj->setAdyenEventCode($eventData);
380
  }
381
-
382
  //only original here
383
  if ($eventCode == Adyen_Payment_Model_Event::ADYEN_EVENT_AUTHORISED
384
- || $eventCode == Adyen_Payment_Model_Event::ADYEN_EVENT_AUTHORISATION)
385
  {
386
  $paymentObj->setAdyenPspReference($pspReference);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
387
  }
388
-
389
  try {
390
- //save all response data for a pure duplicate detection
391
- Mage::getModel('adyen/event')
392
- ->setPspReference($pspReference)
393
- ->setAdyenEventCode($eventCode)
394
- ->setAdyenEventResult($eventData)
395
- ->setIncrementId($incrementId)
396
- ->setPaymentMethod($paymentMethod)
397
- ->setCreatedAt(now())
398
- ->saveData($updateAdyenStatus) // don't update the adyen status
399
- ;
 
400
  } catch (Exception $e) {
401
- Mage::log($e->getMessage(), Zend_Log::DEBUG, "adyen_notification.log", true);
402
  }
403
  }
404
 
@@ -407,8 +429,8 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
407
  * @param Varien_Object $params
408
  */
409
  protected function _processPostSuccess($order, $params) {
410
-
411
- //set these attributes here
412
  $this->_addAdyenAttributes($order, $params, false);
413
  $status = false;
414
  $authResult = $params->getData('authResult');
@@ -416,27 +438,27 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
416
  switch ($authResult) {
417
  case Adyen_Payment_Model_Event::ADYEN_EVENT_AUTHORISED:
418
  case Adyen_Payment_Model_Event::ADYEN_EVENT_PENDING:
419
- Mage::log("PAYMENT POST URL BEFORE SAVING STATUS:".$order->getStatus(), Zend_Log::DEBUG, "adyen_notification.log", true);
420
-
421
- $type = "Adyen Result URL Notification(s):";
422
- $pspReference = $params->getData('pspReference');
423
- $paymentMethod = $params->getData('paymentMethod');
424
-
425
- $comment = Mage::helper('adyen')
426
- ->__('%s <br /> authResult: %s <br /> pspReference: %s <br /> paymentMethod: %s', $type, $authResult, $pspReference, $paymentMethod);
427
-
428
- $history = Mage::getModel('sales/order_status_history')
429
- ->setStatus($status)
430
- ->setComment($comment)
431
- ->setEntityName("order")
432
- ->setOrder($order);
433
- $history->save();
434
- $status = true;
435
- // don't save the order because of interferrence with order status (set by notifications)
436
  break;
437
  case Adyen_Payment_Model_Event::ADYEN_EVENT_CANCELLED:
438
  $isBankTransfer = Mage::getModel('adyen/event')
439
- ->isBanktransfer($order->getIncrementId());
440
  //attempt to hold/cancel (exceptional to BankTransfer they stay in previous status/pending)
441
  if (!$isBankTransfer) {
442
  $this->_addStatusHistoryComment($order, $params);
@@ -463,7 +485,7 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
463
  * @desc process notifications
464
  * @param type $order
465
  * @param type $response
466
- * @return type
467
  */
468
  public function notificationHandler($order, $response) {
469
  $payment = $order->getPayment()->getMethodInstance();
@@ -473,19 +495,19 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
473
 
474
  //handle duplicates
475
  $isDuplicate = Mage::getModel('adyen/event')
476
- ->isDuplicate($pspReference, $eventCode);
477
  if ($isDuplicate) {
478
- $payment->writeLog("#skipping duplicate notification pspReference:$pspReference && eventCode: $eventCode");
479
  return false; //hmt
480
  }
481
 
482
  //set these attributes here
483
  $this->_addAdyenAttributes($order, $response);
484
-
485
  //add comment to the order
486
  if (strcmp($success, 'false') == 0 || !$success) {
487
  $status = ($order->isCanceled() || ($order->getState() === Mage_Sales_Model_Order::STATE_PENDING_PAYMENT)) ?
488
- Mage_Sales_Model_Order::STATE_CANCELED : $order->getStatus();
489
  $this->_addStatusHistoryComment($order, $response, $status);
490
  } else {
491
  $this->_addStatusHistoryComment($order, $response, $order->getStatus());
@@ -507,57 +529,103 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
507
  /**
508
  * @desc process notifications
509
  * @param type $order
510
- * @param type $response
511
  */
512
  protected function _processNotifications($order, $response) {
513
  $valid = $this->notificationHandler($order, $response); //hmt: added $valid
514
-
515
  if ($valid) {
516
- $eventCode = trim($response->getData('eventCode'));
517
-
518
- $success = (bool) trim($response->getData('success'));
519
- switch ($eventCode) {
520
- case Adyen_Payment_Model_Event::ADYEN_EVENT_REFUND:
521
 
522
- $this->refundOrder($order, $response);
523
- //refund completed
524
- $this->setRefundAuthorized($order, $success);
525
- break;
526
- case Adyen_Payment_Model_Event::ADYEN_EVENT_PENDING:
527
- //add comment to the order
528
- break;
529
- case Adyen_Payment_Model_Event::ADYEN_EVENT_HANDLEDEXTERNALLY:
530
- case Adyen_Payment_Model_Event::ADYEN_EVENT_AUTHORISATION:
531
- //pre-authorise if success
532
- $order->sendNewOrderEmail(); // send order email
533
-
534
- $this->setPrePaymentAuthorized($order, $success);
535
-
536
- $this->createInvoice($order, $response);
537
- break;
538
- case Adyen_Payment_Model_Event::ADYEN_EVENT_CAPTURE:
539
- $this->setPaymentAuthorized($order, $success);
540
- break;
541
- case Adyen_Payment_Model_Event::ADYEN_EVENT_CANCELLATION:
542
- case Adyen_Payment_Model_Event::ADYEN_EVENT_CANCELLED:
543
- $this->holdCancelOrder($order, $response);
544
- break;
545
- default:
546
- //@todo fix me cancel && error here
547
- $order->getPayment()->getMethodInstance()->writeLog('notification event not supported!');
548
- break;
549
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
550
  }
551
  }
552
 
553
  /**
554
  * @since v0.1.0.5
555
  * @param type $order
556
- * @param type $success
557
  */
558
- public function setPaymentAuthorized($order, $success = false) {
559
  if ($success && !empty($order)) {
 
560
  $status = $this->_getConfigData('payment_authorized');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
561
  $status = (!empty($status)) ? $status : $order->getStatus();
562
  $order->addStatusHistoryComment(Mage::helper('adyen')->__('Adyen Payment Successfully completed'), $status);
563
  $order->sendOrderUpdateEmail((bool) $this->_getConfigData('send_update_mail'));
@@ -571,7 +639,7 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
571
  /**
572
  * @since v0.1.0.5
573
  * @param type $order
574
- * @param type $success
575
  */
576
  public function setPrePaymentAuthorized($order, $success = false) {
577
  if ($success && !empty($order)) {
@@ -589,7 +657,7 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
589
  /**
590
  * @since v0.1.0.8
591
  * @param type $order
592
- * @param type $success
593
  */
594
  public function setRefundAuthorized($order, $success = false) {
595
  if ($success && !empty($order)) {
@@ -614,7 +682,7 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
614
  $paymentMethod = trim($response->getData('paymentMethod'));
615
  $captureMode = trim($this->_getConfigData('capture_mode'));
616
  // payment method ideal and cash has direct capture
617
- if (strcmp($paymentMethod, 'ideal') === 0 || strcmp($paymentMethod, 'c_cash') === 0 ) {
618
  return true;
619
  }
620
  if (strcmp($captureMode, 'manual') === 0) {
@@ -639,7 +707,7 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
639
  //skip orders with [refund-received]
640
  $pspReference = trim($response->getData('pspReference'));
641
  $result = Mage::getModel('adyen/event')
642
- ->getEvent($pspReference, '[refund-received]');
643
  if (!empty($result)) {
644
  $this->_writeLog("\nSkip refund process, as refund initiated via Magento id: {$order->getIncrementId()}");
645
  return false;
@@ -660,14 +728,14 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
660
 
661
  try {
662
  Mage::getModel('core/resource_transaction')
663
- ->addObject($creditmemo)
664
- ->addObject($creditmemo->getOrder())
665
- ->save();
666
  //refund
667
  $creditmemo->refund();
668
  $transactionSave = Mage::getModel('core/resource_transaction')
669
- ->addObject($creditmemo)
670
- ->addObject($creditmemo->getOrder());
671
  if ($creditmemo->getInvoice()) {
672
  $transactionSave->addObject($creditmemo->getInvoice());
673
  }
@@ -688,7 +756,7 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
688
  * @desc Create invoice
689
  * @param type $order
690
  * @param type $response
691
- * @return type
692
  */
693
  public function createInvoice($order, $response) {
694
  $payment = $order->getPayment()->getMethodInstance();
@@ -700,35 +768,38 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
700
  $_status = $this->_getConfigData('order_status');
701
  $_mail = (bool) $this->_getConfigData('send_update_mail');
702
  $value = trim($response->getData('value'));
703
-
704
- //create invoice
705
  if (strcmp($order->getState(), Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW) == 0) {
706
  $order->setState(Mage_Sales_Model_Order::STATE_NEW);
707
  }
708
 
709
  //capture mode
710
  if (!$this->isAutoCapture($response)) {
711
- $order->addStatusHistoryComment(Mage::helper('adyen')->__('Capture Mode set to Manual'));
712
- $order->sendOrderUpdateEmail($_mail);
713
- $order->save();
714
- return false;
715
  }
716
-
 
 
 
717
  if ($order->canInvoice()) {
718
  $invoice = $order->prepareInvoice();
719
  $invoice->getOrder()->setIsInProcess(true);
720
  $invoice->register()->capture();
721
  try {
722
  Mage::getModel('core/resource_transaction')
723
- ->addObject($invoice)
724
- ->addObject($invoice->getOrder())
725
- ->save();
726
  } catch (Exception $e) {
727
  $payment->writeLog($e->getMessage());
728
  }
729
 
730
  //selected adyen status
731
- $this->setPaymentAuthorized($order, $success);
732
 
733
  if ($invoiceAutoMail) {
734
  $invoice->sendEmail();
@@ -741,11 +812,11 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
741
  /**
742
  * @desc order comments or history
743
  * @param type $order
744
- * @param Varien_Object $response
745
  */
746
  protected function _addStatusHistoryComment($order, Varien_Object $response, $status = false) {
747
- Mage::log("_addStatusHistoryComment", Zend_Log::DEBUG, "adyen_notification.log", true);
748
-
749
  //notification
750
  $pspReference = $response->getData('pspReference');
751
  $success = trim($response->getData('success'));
@@ -753,6 +824,8 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
753
  $eventCode = $response->getData('eventCode');
754
  $reason = $response->getData('reason');
755
  $success = (!empty($reason)) ? "$success_result <br />reason:$reason" : $success_result;
 
 
756
 
757
  //post
758
  $authResult = $response->getData('authResult');
@@ -765,26 +838,56 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
765
  $type = (!empty($authResult)) ? 'Adyen Result URL Notification(s):' : 'Adyen HTTP Notification(s):';
766
  switch ($type) {
767
  case 'Adyen Result URL Notification(s):':
768
- /*PCD*/ // choose not to update the adyen_event_code in the order when the order is already on notification:Authorisation status and authresult = resultURL:Authorised
769
  if(!(substr($order->getAdyenEventCode(), 0, 13) == Adyen_Payment_Model_Event::ADYEN_EVENT_AUTHORISATION && $authResult == Adyen_Payment_Model_Event::ADYEN_EVENT_AUTHORISED)){
770
- Mage::log("Adyen Result URL order authResult:".$authResult, Zend_Log::DEBUG, "adyen_notification.log", true);
771
-
772
- $order->setAdyenEventCode($authResult);
773
  }
774
  $comment = Mage::helper('adyen')
775
- ->__('%s <br /> authResult: %s <br /> pspReference: %s <br /> paymentMethod: %s', $type, $authResult, $pspReference, $paymentMethod);
776
  break;
777
  default:
778
- Mage::log("default order authResult:".$eventCode . " : " . strtoupper($success_result), Zend_Log::DEBUG, "adyen_notification.log", true);
779
-
780
- $order->setAdyenEventCode($eventCode . " : " . strtoupper($success_result));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
781
  $comment = Mage::helper('adyen')
782
- ->__('%s <br /> eventCode: %s <br /> pspReference: %s <br /> paymentMethod: %s <br /> success: %s ', $type, $eventCode, $pspReference, $paymentMethod, $success);
 
783
  break;
784
  }
785
- $order->addStatusHistoryComment($comment, $status);
786
 
787
- /*PCD*/ $order->save();
 
788
  }
789
 
790
  /**
@@ -898,4 +1001,4 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
898
  return Mage::app()->getRequest();
899
  }
900
 
901
- }
34
  * @throws Exception
35
  */
36
  public function processResponse($soapItem = null) {
37
+
38
+ $response = (!empty($soapItem)) ? $soapItem : $this->getRequest()->getParams();
39
  Mage::getResourceModel('adyen/adyen_debug')->assignData($response);
40
+ $actionName = $this->getRequest()->getActionName();
41
+ $helper = Mage::helper('adyen');
42
+
43
  if (empty($response)) {
44
+ Mage::log('blanco on response, please check your webserver that the result url accepts parameters', Zend_Log::CRIT, "adyen_notification.log", true);
45
  return "401";
46
  }
47
+
48
  $varienObj = new Varien_Object();
49
  foreach ($response as $code => $value) {
50
  if ($code == 'amount') {
57
 
58
  // if version is added to notification url (?version=true) then only return the version of the plugin (only works from verion 1.0.0.8)
59
  if($varienObj->getData('version')) {
60
+ echo $helper->getExtensionVersion();
61
+ exit;
62
  }
63
+
64
  //authenticate
65
  $authStatus = Mage::getModel('adyen/authenticate')->authenticate($actionName, $varienObj);
66
  if (!$authStatus) {
70
  }
71
 
72
  $incrementId = $varienObj->getData('merchantReference');
73
+
74
+ try{
75
+
76
  //get order && payment objects
77
  $order = Mage::getModel('sales/order');
78
+
79
  //error
80
  $orderExist = $this->_incrementIdExist($incrementId);
81
  if (empty($orderExist)) {
101
 
102
  return $status;
103
  }
104
+
105
+
106
+ public function processPosResponse() {
107
+
108
+ $helper = Mage::helper('adyen');
109
+ $response = $_REQUEST;
110
+
111
+
112
+ $varienObj = new Varien_Object();
113
+ foreach ($response as $code => $value) {
114
+ if ($code == 'amount') {
115
+ if (is_object($value))
116
+ $value = $value->value;
117
+ $code = 'value';
118
+ }
119
+ $varienObj->setData($code, $value);
120
+ }
121
+
122
+ $actionName = $this->getRequest()->getActionName();
123
+ $result = $varienObj->getData('result');
124
+
125
+ // check if result comes from POS device comes form POS
126
+ if($actionName == "successPos" && $result != "") {
127
+
128
+ $checksum = $varienObj->getData('checksum');
129
+
130
+ // for android checksum is called cs
131
+ if($checksum == "") {
132
+ $checksum = $varienObj->getData('cs');
133
+ }
134
+
135
+ $amount = $varienObj->getData('originalCustomAmount');
136
+ $currency = $varienObj->getData('originalCustomCurrency');
137
+ $session_id = $varienObj->getData('sessionId');
138
+
139
+
140
+ // for android sessionis is with low i
141
+ if($session_id == "") {
142
+ $session_id = $varienObj->getData('sessionid');
143
+ }
144
+
145
+ // calculate amount checksum
146
+ $amount_checksum = 0;
147
+
148
+ for($i=0;$i<strlen($amount);$i++)
149
+ {
150
+ // ASCII value use ord
151
+ $checksum_calc = ord($amount[$i]) - 48;
152
+ $amount_checksum += $checksum_calc;
153
+ }
154
+
155
+ $currency_checksum = 0;
156
+ for($i=0;$i<strlen($currency);$i++)
157
+ {
158
+ $checksum_calc = ord($currency[$i]) - 64;
159
+ $currency_checksum += $checksum_calc;
160
+ }
161
+
162
+ $result_checksum = 0;
163
+ for($i=0;$i<strlen($result);$i++)
164
+ {
165
+ $checksum_calc = ord($result[$i]) - 64;
166
+ $result_checksum += $checksum_calc;
167
+ }
168
+
169
+ $session_id_checksum = 0;
170
+ for($i=0;$i<strlen($session_id);$i++)
171
+ {
172
+ $checksum_calc = ord($session_id[$i]) - 48;
173
+ $session_id_checksum += $checksum_calc;
174
+ }
175
+
176
+ $total_result_checksum = (($amount_checksum + $currency_checksum + $result_checksum) * $session_id_checksum) % 100;
177
+
178
+ // check if request is valid
179
+ if($total_result_checksum == $checksum) {
180
+
181
+ //get order && payment objects
182
+ $order = Mage::getModel('sales/order');
183
+ //$incrementId = $varienObj->getData('merchantReference');
184
+ $incrementId = $varienObj->getData('originalCustomMerchantReference');
185
+
186
+ //error
187
+ $orderExist = $this->_incrementIdExist($incrementId);
188
+
189
+ if (empty($orderExist)) {
190
+ $this->_writeLog("unknown order : $incrementId");
191
+ } else {
192
+ $order->loadByIncrementId($incrementId);
193
+
194
+ if($result == 'APPROVED') {
195
+ // wait for notification to finish the order
196
+
197
+ // set adyen event status on true
198
+ $order->setAdyenEventCode(Adyen_Payment_Model_Event::ADYEN_EVENT_POSAPPROVED);
199
+
200
+ $comment = Mage::helper('adyen')
201
+ ->__('%s <br /> Result: %s <br /> paymentMethod: %s', 'Adyen App Result URL Notification:', $result, 'POS');
202
+
203
+ $order->addStatusHistoryComment($comment, false);
204
+
205
+ try {
206
+ $order->save();
207
+ } catch (Exception $e) {
208
+ Mage::logException($e);
209
+ }
210
+ } else {
211
+
212
+ $isBankTransfer = Mage::getModel('adyen/event')
213
+ ->isBanktransfer($order->getIncrementId());
214
+ //attempt to hold/cancel (exceptional to BankTransfer they stay in previous status/pending)
215
+
216
+ if (!$isBankTransfer) {
217
+
218
+ $comment = Mage::helper('adyen')
219
+ ->__('%s <br /> Result: %s <br /> paymentMethod: %s', 'Adyen App Result URL Notification:', $result, 'POS');
220
+
221
+ $order->addStatusHistoryComment($comment, Mage_Sales_Model_Order::STATE_CANCELED);
222
+
223
+ $order->setActionFlag(Mage_Sales_Model_Order::ACTION_FLAG_CANCEL, true);
224
+
225
+ if (!$order->canCancel()) {
226
+ $this->_writeLog('order can not be canceled', $order);
227
+ $order->addStatusHistoryComment($helper->__('Order can not be canceled'), Mage_Sales_Model_Order::STATE_CANCELED);
228
+ $order->save();
229
+
230
+ } else {
231
+ $order->cancel()->save();
232
+ }
233
+
234
+ } else {
235
+ $this->_addStatusHistoryComment($order, $varienObj, $order->getStatus());
236
+ $status = true;
237
+ }
238
+ }
239
+ }
240
+ }
241
+ }
242
+ // close the window
243
+ $html = "<html><body>
244
  <script type=\"text/javascript\">
245
  function closeWindow() {
246
  window.open('', '_self', '');
249
  setTimeout(closeWindow, 500);
250
  </script>
251
  </body></html>";
252
+
253
+ return $html;
254
  }
255
+
256
  public function processCashResponse()
257
  {
258
+ $response = $_REQUEST;
259
+
260
+ $varienObj = new Varien_Object();
261
+ foreach ($response as $code => $value) {
262
+ if ($code == 'amount') {
263
+ if (is_object($value))
264
+ $value = $value->value;
265
+ $code = 'value';
266
+ }
267
+ $varienObj->setData($code, $value);
268
+ }
269
+
270
+ $pspReference = $varienObj->getData('pspReference');
271
+ $merchantReference = $varienObj->getData('merchantReference');
272
+ $skinCode = $varienObj->getData('skinCode');
273
+ $paymentAmount = $varienObj->getData('paymentAmount');
274
+ $currencyCode = $varienObj->getData('currencyCode');
275
+ $customPaymentMethod = $varienObj->getData('c_cash');
276
+ $paymentMethod = $varienObj->getData('paymentMethod');
277
+ $merchantSig = $varienObj->getData('merchantSig');
278
+
279
+ $sign = $pspReference .
280
+ $merchantReference .
281
+ $skinCode .
282
+ $paymentAmount .
283
+ $currencyCode .
284
+ $customPaymentMethod . $paymentMethod;
285
+
286
+ $secretWord = $this->_getSecretWord();
287
+ $signMac = Zend_Crypt_Hmac::compute($secretWord, 'sha1', $sign);
288
+ $calMerchantSig = base64_encode(pack('H*', $signMac));
289
+
290
+ // check if signatures are the same
291
+ if($calMerchantSig == $merchantSig) {
292
+
293
+ //get order && payment objects
294
+ $order = Mage::getModel('sales/order');
295
+
296
+ //error
297
+ $orderExist = $this->_incrementIdExist($merchantReference);
298
+
299
+ if (empty($orderExist)) {
300
+ $this->_writeLog("unknown order : $merchantReference");
301
+ } else {
302
+ $order->loadByIncrementId($merchantReference);
303
+
304
+ $comment = Mage::helper('adyen')
305
+ ->__('Adyen Cash Result URL Notification: <br /> pspReference: %s <br /> paymentMethod: %s', $pspReference, $paymentMethod);
306
+
307
+ $status = true;
308
+
309
+ $history = Mage::getModel('sales/order_status_history')
310
+ ->setStatus($status)
311
+ ->setComment($comment)
312
+ ->setEntityName("order")
313
+ ->setOrder($order);
314
+ $history->save();
315
+
316
+ return $status;
317
+ }
318
+ }
319
+ return false;
320
  }
321
+
322
  protected function _getSecretWord($options = null) {
323
+ switch ($this->getConfigDataDemoMode()) {
324
+ case true:
325
+ $secretWord = trim($this->_getConfigData('secret_wordt', 'adyen_hpp'));
326
+ break;
327
+ default:
328
+ $secretWord = trim($this->_getConfigData('secret_wordp', 'adyen_hpp'));
329
+ break;
330
+ }
331
+ return $secretWord;
332
  }
333
+
334
  /**
335
  * Used via Payment method.Notice via configuration ofcourse Y or N
336
  * @return boolean true on demo, else false
337
  */
338
  public function getConfigDataDemoMode() {
339
+ if ($this->_getConfigData('demoMode') == 'Y') {
340
+ return true;
341
+ }
342
+ return false;
343
  }
344
+
345
  /**
346
  * @desc check order existance
347
  * @param type $incrementId
348
+ * @return type
349
  */
350
  protected function _incrementIdExist($incrementId) {
351
  return Mage::getResourceModel('adyen/order')->orderExist($incrementId);
354
  /**
355
  * @desc Adyen attribute handling
356
  * @param Varien_Object $order
357
+ * @param type $response
358
  */
359
  protected function _addAdyenAttributes(Varien_Object $order, $response, $updateAdyenStatus = true) {
360
+ $klarnaReservationNumber = $response->getData('additionalData_additionalData_acquirerReference');
361
+ $ccLast4 = $response->getData('additionalData_cardSummary');
362
+ $avsResult = $response->getData('additionalData_avsResult');
363
+ $cvcResult = $response->getData('additionalData_cvcResult');
364
+ $boletoPaidAmount = $response->getData('additionalData_boletobancario_paidAmount');
365
  $pspReference = $response->getData('pspReference');
366
  $eventCode = $response->getData('eventCode');
367
  $authResult = $response->getData('authResult');
368
  $incrementId = $response->getData('merchantReference');
369
  $paymentMethod = $response->getData('paymentMethod');
370
+ $success = (trim($response->getData('success')) == "true") ? true : false;
371
  $eventData = (!empty($eventCode)) ? $eventCode : $authResult;
372
  $paymentObj = $order->getPayment();
373
+
374
  $paymentObj->setLastTransId($incrementId)
375
+ ->setAdyenPaymentMethod($paymentMethod)
376
+ ->setCcType($paymentMethod)
377
+ ;
378
 
379
  // only update this when authroization notification is not yet processed
380
  Mage::log("AdyenEventCode in paymentobject order:".$order->getAdyenEventCode(), Zend_Log::DEBUG, "adyen_notification.log", true);
381
  Mage::log("paymentobject order authResult:".$authResult, Zend_Log::DEBUG, "adyen_notification.log", true);
382
+
383
  if(!(substr($order->getAdyenEventCode(), 0, 13) == Adyen_Payment_Model_Event::ADYEN_EVENT_AUTHORISATION && $authResult == Adyen_Payment_Model_Event::ADYEN_EVENT_AUTHORISED)){
384
+ Mage::log("update paymentobject eventcode with:".$eventData, Zend_Log::DEBUG, "adyen_notification.log", true);
385
+ $paymentObj->setAdyenEventCode($eventData);
386
  }
387
+
388
  //only original here
389
  if ($eventCode == Adyen_Payment_Model_Event::ADYEN_EVENT_AUTHORISED
390
+ || $eventCode == Adyen_Payment_Model_Event::ADYEN_EVENT_AUTHORISATION)
391
  {
392
  $paymentObj->setAdyenPspReference($pspReference);
393
+ if($klarnaReservationNumber != "") {
394
+ $paymentObj->setAdyenKlarnaNumber($klarnaReservationNumber);
395
+ }
396
+ if($ccLast4 != "") {
397
+ $paymentObj->setccLast4($ccLast4);
398
+ }
399
+ if($avsResult != "") {
400
+ $paymentObj->setAdyenAvsResult($avsResult);
401
+ }
402
+ if($cvcResult != "") {
403
+ $paymentObj->setAdyenCvcResult($cvcResult);
404
+ }
405
+ if($boletoPaidAmount != "") {
406
+ $paymentObj->setAdyenBoletoPaidAmount($boletoPaidAmount);
407
+ }
408
  }
409
+
410
  try {
411
+ //save all response data for a pure duplicate detection
412
+ Mage::getModel('adyen/event')
413
+ ->setPspReference($pspReference)
414
+ ->setAdyenEventCode($eventCode)
415
+ ->setAdyenEventResult($eventData)
416
+ ->setIncrementId($incrementId)
417
+ ->setPaymentMethod($paymentMethod)
418
+ ->setCreatedAt(now())
419
+ ->setSuccess($success)
420
+ ->saveData($updateAdyenStatus) // don't update the adyen status
421
+ ;
422
  } catch (Exception $e) {
423
+ Mage::log($e->getMessage(), Zend_Log::DEBUG, "adyen_notification.log", true);
424
  }
425
  }
426
 
429
  * @param Varien_Object $params
430
  */
431
  protected function _processPostSuccess($order, $params) {
432
+
433
+ //set these attributes here
434
  $this->_addAdyenAttributes($order, $params, false);
435
  $status = false;
436
  $authResult = $params->getData('authResult');
438
  switch ($authResult) {
439
  case Adyen_Payment_Model_Event::ADYEN_EVENT_AUTHORISED:
440
  case Adyen_Payment_Model_Event::ADYEN_EVENT_PENDING:
441
+ Mage::log("PAYMENT POST URL BEFORE SAVING STATUS:".$order->getStatus(), Zend_Log::DEBUG, "adyen_notification.log", true);
442
+
443
+ $type = "Adyen Result URL Notification(s):";
444
+ $pspReference = $params->getData('pspReference');
445
+ $paymentMethod = $params->getData('paymentMethod');
446
+
447
+ $comment = Mage::helper('adyen')
448
+ ->__('%s <br /> authResult: %s <br /> pspReference: %s <br /> paymentMethod: %s', $type, $authResult, $pspReference, $paymentMethod);
449
+
450
+ $history = Mage::getModel('sales/order_status_history')
451
+ ->setStatus($status)
452
+ ->setComment($comment)
453
+ ->setEntityName("order")
454
+ ->setOrder($order);
455
+ $history->save();
456
+ $status = true;
457
+ // don't save the order because of interferrence with order status (set by notifications)
458
  break;
459
  case Adyen_Payment_Model_Event::ADYEN_EVENT_CANCELLED:
460
  $isBankTransfer = Mage::getModel('adyen/event')
461
+ ->isBanktransfer($order->getIncrementId());
462
  //attempt to hold/cancel (exceptional to BankTransfer they stay in previous status/pending)
463
  if (!$isBankTransfer) {
464
  $this->_addStatusHistoryComment($order, $params);
485
  * @desc process notifications
486
  * @param type $order
487
  * @param type $response
488
+ * @return type
489
  */
490
  public function notificationHandler($order, $response) {
491
  $payment = $order->getPayment()->getMethodInstance();
495
 
496
  //handle duplicates
497
  $isDuplicate = Mage::getModel('adyen/event')
498
+ ->isDuplicate($pspReference, $eventCode, $success);
499
  if ($isDuplicate) {
500
+ $payment->writeLog("#skipping duplicate notification pspReference:$pspReference && eventCode: $eventCode && success: $success");
501
  return false; //hmt
502
  }
503
 
504
  //set these attributes here
505
  $this->_addAdyenAttributes($order, $response);
506
+
507
  //add comment to the order
508
  if (strcmp($success, 'false') == 0 || !$success) {
509
  $status = ($order->isCanceled() || ($order->getState() === Mage_Sales_Model_Order::STATE_PENDING_PAYMENT)) ?
510
+ Mage_Sales_Model_Order::STATE_CANCELED : $order->getStatus();
511
  $this->_addStatusHistoryComment($order, $response, $status);
512
  } else {
513
  $this->_addStatusHistoryComment($order, $response, $order->getStatus());
529
  /**
530
  * @desc process notifications
531
  * @param type $order
532
+ * @param type $response
533
  */
534
  protected function _processNotifications($order, $response) {
535
  $valid = $this->notificationHandler($order, $response); //hmt: added $valid
536
+
537
  if ($valid) {
538
+ $eventCode = trim($response->getData('eventCode'));
 
 
 
 
539
 
540
+ $success = (bool) trim($response->getData('success'));
541
+ $payment_method = trim($response->getData('paymentMethod'));
542
+ switch ($eventCode) {
543
+ case Adyen_Payment_Model_Event::ADYEN_EVENT_REFUND:
544
+
545
+ $this->refundOrder($order, $response);
546
+ //refund completed
547
+ $this->setRefundAuthorized($order, $success);
548
+ break;
549
+ case Adyen_Payment_Model_Event::ADYEN_EVENT_PENDING:
550
+ //add comment to the order
551
+ break;
552
+ case Adyen_Payment_Model_Event::ADYEN_EVENT_HANDLEDEXTERNALLY:
553
+ case Adyen_Payment_Model_Event::ADYEN_EVENT_AUTHORISATION:
554
+ //pre-authorise if success
555
+ $order->sendNewOrderEmail(); // send order email
556
+
557
+ /*
558
+ * For AliPay or UnionPay sometimes it first send a AUTHORISATION false notification and then
559
+ * a AUTHORISATION true notification. The second time it must revert the cancelled of the first notification before we can
560
+ * assign a new status
561
+ */
562
+ if($success == "true") {
563
+ if($payment_method == "alipay" || $payment_method == "unionpay") {
564
+ foreach ($order->getAllItems() as $item) {
565
+ $item->setQtyCanceled(0);
566
+ $item->save();
567
+ }
568
+ }
569
+ }
570
+ $this->setPrePaymentAuthorized($order, $success);
571
+
572
+ $this->createInvoice($order, $response);
573
+ break;
574
+ case Adyen_Payment_Model_Event::ADYEN_EVENT_CAPTURE:
575
+ $this->setPaymentAuthorized($order, $success, $response);
576
+ break;
577
+ case Adyen_Payment_Model_Event::ADYEN_EVENT_CAPTURE_FAILED:
578
+ case Adyen_Payment_Model_Event::ADYEN_EVENT_CANCELLATION:
579
+ case Adyen_Payment_Model_Event::ADYEN_EVENT_CANCELLED:
580
+ $this->holdCancelOrder($order, $response);
581
+ break;
582
+ default:
583
+ //@todo fix me cancel && error here
584
+ $order->getPayment()->getMethodInstance()->writeLog('notification event not supported!');
585
+ break;
586
+ }
587
  }
588
  }
589
 
590
  /**
591
  * @since v0.1.0.5
592
  * @param type $order
593
+ * @param type $success
594
  */
595
+ public function setPaymentAuthorized($order, $success = false, $response) {
596
  if ($success && !empty($order)) {
597
+
598
  $status = $this->_getConfigData('payment_authorized');
599
+
600
+ // check for boleto if payment is totally paid
601
+ if($order->getPayment()->getMethod() == "adyen_boleto") {
602
+
603
+ // check if paid amount is the same as orginal amount
604
+ $orginalAmount = trim($response->getData('additionalData_boletobancario_originalAmount'));
605
+ $paidAmount = trim($response->getData('additionalData_boletobancario_paidAmount'));
606
+
607
+ if($orginalAmount != $paidAmount) {
608
+
609
+ // not the full amount is paid. Check if it is underpaid or overpaid
610
+ // strip the BRL of the string
611
+ $orginalAmount = str_replace("BRL", "", $orginalAmount);
612
+ $orginalAmount = floatval(trim($orginalAmount));
613
+
614
+ $paidAmount = str_replace("BRL", "", $paidAmount);
615
+ $paidAmount = floatval(trim($paidAmount));
616
+
617
+ if($paidAmount > $orginalAmount) {
618
+ $overpaidStatus = $this->_getConfigData('order_overpaid_status', 'adyen_boleto');
619
+ // check if there is selected a status if not fall back to the default
620
+ $status = (!empty($overpaidStatus)) ? $overpaidStatus : $status;
621
+ } else {
622
+ $underpaidStatus = $this->_getConfigData('order_underpaid_status', 'adyen_boleto');
623
+ // check if there is selected a status if not fall back to the default
624
+ $status = (!empty($underpaidStatus)) ? $underpaidStatus : $status;
625
+ }
626
+ }
627
+ }
628
+
629
  $status = (!empty($status)) ? $status : $order->getStatus();
630
  $order->addStatusHistoryComment(Mage::helper('adyen')->__('Adyen Payment Successfully completed'), $status);
631
  $order->sendOrderUpdateEmail((bool) $this->_getConfigData('send_update_mail'));
639
  /**
640
  * @since v0.1.0.5
641
  * @param type $order
642
+ * @param type $success
643
  */
644
  public function setPrePaymentAuthorized($order, $success = false) {
645
  if ($success && !empty($order)) {
657
  /**
658
  * @since v0.1.0.8
659
  * @param type $order
660
+ * @param type $success
661
  */
662
  public function setRefundAuthorized($order, $success = false) {
663
  if ($success && !empty($order)) {
682
  $paymentMethod = trim($response->getData('paymentMethod'));
683
  $captureMode = trim($this->_getConfigData('capture_mode'));
684
  // payment method ideal and cash has direct capture
685
+ if (strcmp($paymentMethod, 'ideal') === 0 || strcmp($paymentMethod, 'c_cash' ) === 0 ) {
686
  return true;
687
  }
688
  if (strcmp($captureMode, 'manual') === 0) {
707
  //skip orders with [refund-received]
708
  $pspReference = trim($response->getData('pspReference'));
709
  $result = Mage::getModel('adyen/event')
710
+ ->getEvent($pspReference, '[refund-received]');
711
  if (!empty($result)) {
712
  $this->_writeLog("\nSkip refund process, as refund initiated via Magento id: {$order->getIncrementId()}");
713
  return false;
728
 
729
  try {
730
  Mage::getModel('core/resource_transaction')
731
+ ->addObject($creditmemo)
732
+ ->addObject($creditmemo->getOrder())
733
+ ->save();
734
  //refund
735
  $creditmemo->refund();
736
  $transactionSave = Mage::getModel('core/resource_transaction')
737
+ ->addObject($creditmemo)
738
+ ->addObject($creditmemo->getOrder());
739
  if ($creditmemo->getInvoice()) {
740
  $transactionSave->addObject($creditmemo->getInvoice());
741
  }
756
  * @desc Create invoice
757
  * @param type $order
758
  * @param type $response
759
+ * @return type
760
  */
761
  public function createInvoice($order, $response) {
762
  $payment = $order->getPayment()->getMethodInstance();
768
  $_status = $this->_getConfigData('order_status');
769
  $_mail = (bool) $this->_getConfigData('send_update_mail');
770
  $value = trim($response->getData('value'));
771
+
772
+ //create invoice
773
  if (strcmp($order->getState(), Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW) == 0) {
774
  $order->setState(Mage_Sales_Model_Order::STATE_NEW);
775
  }
776
 
777
  //capture mode
778
  if (!$this->isAutoCapture($response)) {
779
+ $order->addStatusHistoryComment(Mage::helper('adyen')->__('Capture Mode set to Manual'));
780
+ $order->sendOrderUpdateEmail($_mail);
781
+ $order->save();
782
+ return false;
783
  }
784
+
785
+ //$order->addStatusHistoryComment(Mage::helper('adyen')->__('Adyen Payment Successfully completed'), $status);
786
+
787
+
788
  if ($order->canInvoice()) {
789
  $invoice = $order->prepareInvoice();
790
  $invoice->getOrder()->setIsInProcess(true);
791
  $invoice->register()->capture();
792
  try {
793
  Mage::getModel('core/resource_transaction')
794
+ ->addObject($invoice)
795
+ ->addObject($invoice->getOrder())
796
+ ->save();
797
  } catch (Exception $e) {
798
  $payment->writeLog($e->getMessage());
799
  }
800
 
801
  //selected adyen status
802
+ $this->setPaymentAuthorized($order, $success, $response);
803
 
804
  if ($invoiceAutoMail) {
805
  $invoice->sendEmail();
812
  /**
813
  * @desc order comments or history
814
  * @param type $order
815
+ * @param Varien_Object $response
816
  */
817
  protected function _addStatusHistoryComment($order, Varien_Object $response, $status = false) {
818
+ Mage::log("_addStatusHistoryComment", Zend_Log::DEBUG, "adyen_notification.log", true);
819
+
820
  //notification
821
  $pspReference = $response->getData('pspReference');
822
  $success = trim($response->getData('success'));
824
  $eventCode = $response->getData('eventCode');
825
  $reason = $response->getData('reason');
826
  $success = (!empty($reason)) ? "$success_result <br />reason:$reason" : $success_result;
827
+ $klarnaReservationNumber = $response->getData('additionalData_additionalData_acquirerReference');
828
+ $boletoPaidAmount = $response->getData('additionalData_boletobancario_paidAmount');
829
 
830
  //post
831
  $authResult = $response->getData('authResult');
838
  $type = (!empty($authResult)) ? 'Adyen Result URL Notification(s):' : 'Adyen HTTP Notification(s):';
839
  switch ($type) {
840
  case 'Adyen Result URL Notification(s):':
841
+ /*PCD*/ // choose not to update the adyen_event_code in the order when the order is already on notification:Authorisation status and authresult = resultURL:Authorised
842
  if(!(substr($order->getAdyenEventCode(), 0, 13) == Adyen_Payment_Model_Event::ADYEN_EVENT_AUTHORISATION && $authResult == Adyen_Payment_Model_Event::ADYEN_EVENT_AUTHORISED)){
843
+ Mage::log("Adyen Result URL order authResult:".$authResult, Zend_Log::DEBUG, "adyen_notification.log", true);
844
+
845
+ $order->setAdyenEventCode($authResult);
846
  }
847
  $comment = Mage::helper('adyen')
848
+ ->__('%s <br /> authResult: %s <br /> pspReference: %s <br /> paymentMethod: %s', $type, $authResult, $pspReference, $paymentMethod);
849
  break;
850
  default:
851
+ Mage::log("default order authResult:".$eventCode . " : " . strtoupper($success_result), Zend_Log::DEBUG, "adyen_notification.log", true);
852
+
853
+ if($eventCode == Adyen_Payment_Model_Event::ADYEN_EVENT_REFUND) {
854
+
855
+ $currency = $order->getOrderCurrencyCode();
856
+
857
+ // check if it is a full or partial refund
858
+ $amount = Mage::helper('adyen')->formatAmount(($response->getValue() / 100), $currency);
859
+ $orderAmount = Mage::helper('adyen')->formatAmount($order->getGrandTotal(), $currency);
860
+
861
+ if($amount == $orderAmount) {
862
+ $order->setAdyenEventCode($eventCode . " : " . strtoupper($success_result));
863
+ } else {
864
+ $order->setAdyenEventCode("(PARTIAL) " . $eventCode . " : " . strtoupper($success_result));
865
+ }
866
+ } else {
867
+ $order->setAdyenEventCode($eventCode . " : " . strtoupper($success_result));
868
+ }
869
+
870
+ // if payment method is klarna or openinvoice/afterpay show the reservartion number
871
+ if(($paymentMethod == "klarna" || $paymentMethod == "afterpay_default" || $paymentMethod == "openinvoice") && ($klarnaReservationNumber != null && $klarnaReservationNumber != "")) {
872
+ $klarnaReservationNumberText = "<br /> reservationNumber: " . $klarnaReservationNumber;
873
+ } else {
874
+ $klarnaReservationNumberText = "";
875
+ }
876
+
877
+ if($boletoPaidAmount != null && $boletoPaidAmount != "") {
878
+ $boletoPaidAmountText = "<br /> Paid amount: " . $boletoPaidAmount;
879
+ } else {
880
+ $boletoPaidAmountText = "";
881
+ }
882
+
883
  $comment = Mage::helper('adyen')
884
+ ->__('%s <br /> eventCode: %s <br /> pspReference: %s <br /> paymentMethod: %s <br /> success: %s %s %s', $type, $eventCode, $pspReference, $paymentMethod, $success, $klarnaReservationNumberText, $boletoPaidAmountText);
885
+
886
  break;
887
  }
 
888
 
889
+ $order->addStatusHistoryComment($comment, $status);
890
+ $order->save();
891
  }
892
 
893
  /**
1001
  return Mage::app()->getRequest();
1002
  }
1003
 
1004
+ }
app/code/community/Adyen/Payment/Model/Sales/Quote/Address/Total/PaymentFee.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adyen Payment Module
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Adyen
17
+ * @package Adyen_Payment
18
+ * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ /**
22
+ * @category Payment Gateway
23
+ * @package Adyen_Payment
24
+ * @author Adyen
25
+ * @property Adyen B.V
26
+ * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
27
+ */
28
+ class Adyen_Payment_Model_Sales_Quote_Address_Total_PaymentFee extends Mage_Sales_Model_Quote_Address_Total_Abstract
29
+ {
30
+ protected $_code = 'payment_fee';
31
+
32
+ public function collect(Mage_Sales_Model_Quote_Address $address)
33
+ {
34
+ parent::collect($address);
35
+
36
+ $this->_setAmount(0);
37
+ $this->_setBaseAmount(0);
38
+
39
+ $quote = $address->getQuote();
40
+ $val = Mage::Helper('adyen')->isPaymentFeeEnabled($quote);
41
+ if ($address->getAllItems() && $val) {
42
+ $currentAmount = $address->getPaymentFeeAmount();
43
+ $fee = Mage::Helper('adyen')->getPaymentFeeAmount($quote);
44
+ $balance = $fee - $currentAmount;
45
+
46
+ $address->setPaymentFeeAmount($address->getQuote()->getStore()->convertPrice($balance));
47
+ $address->setBasePaymentFeeAmount($balance);
48
+
49
+ $address->setGrandTotal($address->getGrandTotal() + $address->getPaymentFeeAmount());
50
+ $address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBasePaymentFeeAmount());
51
+ }
52
+
53
+ return $this;
54
+ }
55
+
56
+ public function fetch(Mage_Sales_Model_Quote_Address $address)
57
+ {
58
+ $amt = $address->getPaymentFeeAmount();
59
+
60
+ if ($amt != 0) {
61
+ $address->addTotal(array(
62
+ 'code'=>$this->getCode(),
63
+ 'title'=> Mage::helper('adyen')->__('Payment Fee'),
64
+ 'value'=> $amt
65
+ ));
66
+ }
67
+
68
+ return $this;
69
+ }
70
+ }
app/code/community/Adyen/Payment/Model/Sales/Quote/Address/Total/PaymentInstallmentFee.php ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adyen Payment Module
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Adyen
17
+ * @package Adyen_Payment
18
+ * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ /**
22
+ * @category Payment Gateway
23
+ * @package Adyen_Payment
24
+ * @author Adyen
25
+ * @property Adyen B.V
26
+ * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
27
+ */
28
+ class Adyen_Payment_Model_Sales_Quote_Address_Total_PaymentInstallmentFee extends Mage_Sales_Model_Quote_Address_Total_Abstract
29
+ {
30
+ protected $_code = 'payment_installment_fee';
31
+
32
+ /*
33
+ * keep in mind that collect is running twice if you save payment method.
34
+ * First time before the payment step save and second time after payment step change
35
+ */
36
+ public function collect(Mage_Sales_Model_Quote_Address $address)
37
+ {
38
+ parent::collect($address);
39
+
40
+ $quote = $address->getQuote();
41
+
42
+ if ($address->getAllItems()) {
43
+ $currentAmount = $address->getPaymentInstallmentFeeAmount();
44
+ $payment = $quote->getPayment();
45
+
46
+ if($payment && !empty($payment)) {
47
+
48
+ $paymentMethod = $quote->getPayment()->getMethod() ;
49
+
50
+ if($paymentMethod == "adyen_cc") {
51
+
52
+ $info = $payment->getMethodInstance();
53
+
54
+ $instance = $info->getInfoInstance();
55
+ $numberOfInstallments = $instance->getAdditionalInformation('number_of_installments');
56
+
57
+ if($numberOfInstallments > 0)
58
+ {
59
+ // get the Interest Rate of this installment
60
+
61
+ // get cc type
62
+ $ccType = $instance->getCcType();
63
+
64
+ // get installment for this specific card type
65
+ $ccTypeInstallments = "installments_".$ccType;
66
+
67
+ $all_installments = Mage::helper('adyen/installments')->getInstallments(null, $ccTypeInstallments);
68
+ if(empty($all_installments)) {
69
+ // use default installments
70
+ $all_installments = Mage::helper('adyen/installments')->getInstallments();
71
+ }
72
+
73
+ $installmentKey = $numberOfInstallments - 1;
74
+
75
+ $installment = $all_installments[$installmentKey];
76
+
77
+ if($installment != null && is_array($installment)) {
78
+
79
+ // check if interest rate is filled in
80
+ if(isset($installment[3]) && $installment[3] > 0) {
81
+
82
+ $this->_setAmount(0);
83
+ $this->_setBaseAmount(0);
84
+
85
+ $interestRate = $installment[3];
86
+ $grandTotal = $address->getGrandTotal();
87
+ $fee = ($grandTotal / 100) * $interestRate;
88
+
89
+ $balance = $fee - $currentAmount;
90
+
91
+ $address->setPaymentInstallmentFeeAmount($address->getQuote()->getStore()->convertPrice($balance));
92
+ $address->setBasePaymentInstallmentFeeAmount($balance);
93
+
94
+ $address->setGrandTotal($address->getGrandTotal() + $address->getPaymentInstallmentFeeAmount());
95
+ $address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBasePaymentInstallmentFeeAmount());
96
+ }
97
+ }
98
+ }
99
+ }
100
+ }
101
+ }
102
+
103
+ return $this;
104
+ }
105
+
106
+ public function fetch(Mage_Sales_Model_Quote_Address $address)
107
+ {
108
+ $amt = $address->getPaymentInstallmentFeeAmount();
109
+
110
+ if ($amt != 0) {
111
+ $address->addTotal(array(
112
+ 'code'=>$this->getCode(),
113
+ 'title'=> Mage::helper('adyen')->__('Installment Fee'),
114
+ 'value'=> $amt
115
+ ));
116
+ }
117
+
118
+ return $this;
119
+ }
120
+ }
app/code/community/Adyen/Payment/Model/Total/PaymentFee/Creditmemo.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adyen Payment Module
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Adyen
17
+ * @package Adyen_Payment
18
+ * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ /**
22
+ * @category Payment Gateway
23
+ * @package Adyen_Payment
24
+ * @author Adyen
25
+ * @property Adyen B.V
26
+ * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
27
+ */
28
+ class Adyen_Payment_Model_Total_PaymentFee_Creditmemo extends Mage_Sales_Model_Order_Creditmemo_Total_Abstract
29
+ {
30
+ public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
31
+ {
32
+ $creditmemo->setGrandTotal($creditmemo->getGrandTotal()+$creditmemo->getPaymentFeeAmount());
33
+ $creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal()+$creditmemo->getBasePaymentFeeAmount());
34
+ return $this;
35
+ }
36
+ }
app/code/community/Adyen/Payment/Model/Total/PaymentFee/Invoice.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adyen Payment Module
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Adyen
17
+ * @package Adyen_Payment
18
+ * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ /**
22
+ * @category Payment Gateway
23
+ * @package Adyen_Payment
24
+ * @author Adyen
25
+ * @property Adyen B.V
26
+ * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
27
+ */
28
+ class Adyen_Payment_Model_Total_PaymentFee_Invoice extends Mage_Sales_Model_Order_Invoice_Total_Abstract
29
+ {
30
+ public function collect(Mage_Sales_Model_Order_Invoice $invoice)
31
+ {
32
+ $invoice->setGrandTotal($invoice->getGrandTotal()+$invoice->getPaymentFeeAmount());
33
+ $invoice->setBaseGrandTotal($invoice->getBaseGrandTotal()+$invoice->getBasePaymentFeeAmount());
34
+ return $this;
35
+ }
36
+ }
app/code/community/Adyen/Payment/Model/Total/PaymentInstallmentFee/Creditmemo.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adyen Payment Module
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Adyen
17
+ * @package Adyen_Payment
18
+ * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ /**
22
+ * @category Payment Gateway
23
+ * @package Adyen_Payment
24
+ * @author Adyen
25
+ * @property Adyen B.V
26
+ * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
27
+ */
28
+ class Adyen_Payment_Model_Total_PaymentInstallmentFee_Creditmemo extends Mage_Sales_Model_Order_Creditmemo_Total_Abstract
29
+ {
30
+ public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
31
+ {
32
+ $creditmemo->setGrandTotal($creditmemo->getGrandTotal()+$creditmemo->getPaymentInstallmentFeeAmount());
33
+ $creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal()+$creditmemo->getBasePaymentInstallmentFeeAmount());
34
+ return $this;
35
+ }
36
+ }
app/code/community/Adyen/Payment/Model/Total/PaymentInstallmentFee/Invoice.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adyen Payment Module
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Adyen
17
+ * @package Adyen_Payment
18
+ * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ /**
22
+ * @category Payment Gateway
23
+ * @package Adyen_Payment
24
+ * @author Adyen
25
+ * @property Adyen B.V
26
+ * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
27
+ */
28
+ class Adyen_Payment_Model_Total_PaymentInstallmentFee_Invoice extends Mage_Sales_Model_Order_Invoice_Total_Abstract
29
+ {
30
+ public function collect(Mage_Sales_Model_Order_Invoice $invoice)
31
+ {
32
+ $invoice->setGrandTotal($invoice->getGrandTotal()+$invoice->getPaymentInstallmentFeeAmount());
33
+ $invoice->setBaseGrandTotal($invoice->getBaseGrandTotal()+$invoice->getBasePaymentInstallmentFeeAmount());
34
+ return $this;
35
+ }
36
+ }
app/code/community/Adyen/Payment/controllers/CheckoutPosController.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adyen Payment Module
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Adyen
17
+ * @package Adyen_Payment
18
+ * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ /**
22
+ * @category Payment Gateway
23
+ * @package Adyen_Payment
24
+ * @author Adyen
25
+ * @property Adyen B.V
26
+ * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
27
+ */
28
+
29
+ class Adyen_Payment_CheckoutPosController extends Mage_Core_Controller_Front_Action {
30
+
31
+ public function indexAction()
32
+ {
33
+
34
+ $customer = Mage::getSingleton('customer/session');
35
+
36
+ // only proceed if customer is logged in
37
+ if($customer->isLoggedIn()) {
38
+
39
+ // get email
40
+ $params = $this->getRequest()->getParams();
41
+ $adyenPosEmail = isset($params['adyenPosEmail']) ? $params['adyenPosEmail'] : "";
42
+ $quote = (Mage::getModel('checkout/type_onepage') !== false)? Mage::getModel('checkout/type_onepage')->getQuote(): Mage::getModel('checkout/session')->getQuote();
43
+
44
+ // get customer object from session
45
+ $customerObject = Mage::getModel('customer/customer')->load($customer->getId());
46
+
47
+ // important update the shippingaddress and billingaddress this can be null sometimes.
48
+ $quote->assignCustomerWithAddressChange($customerObject);
49
+
50
+ // update email with customer Email
51
+ if($adyenPosEmail != "") {
52
+ $quote->setCustomerEmail($adyenPosEmail);
53
+ }
54
+
55
+ $shippingAddress = $quote->getShippingAddress();
56
+
57
+ $shippingAddress->setCollectShippingRates(true)->collectShippingRates()
58
+ ->setShippingMethod('freeshipping_freeshipping')
59
+ ->setPaymentMethod('adyen_pos');
60
+
61
+ $quote->getPayment()->importData(array('method' => 'adyen_pos'));
62
+ $quote->collectTotals()->save();
63
+ $session = Mage::getSingleton('checkout/session');
64
+
65
+ $service = Mage::getModel('sales/service_quote', $quote);
66
+ $service->submitAll();
67
+ $order = $service->getOrder();
68
+
69
+ $oderStatus = Mage::helper('adyen')->getOrderStatus();
70
+ $order->setStatus($oderStatus);
71
+ $order->save();
72
+
73
+ // add order information to the session
74
+ $session->setLastOrderId($order->getId())
75
+ ->setLastRealOrderId($order->getIncrementId())
76
+ ->setLastSuccessQuoteId($order->getQuoteId())
77
+ ->setLastQuoteId($order->getQuoteId());
78
+
79
+ $this->_redirect('adyen/process/redirect');
80
+ return $this;
81
+ } else {
82
+ Mage::throwException('Customer is not logged in.');
83
+ }
84
+ }
85
+ }
app/code/community/Adyen/Payment/controllers/GetInstallmentsController.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adyen Payment Module
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Adyen
17
+ * @package Adyen_Payment
18
+ * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ /**
22
+ * @category Payment Gateway
23
+ * @package Adyen_Payment
24
+ * @author Adyen
25
+ * @property Adyen B.V
26
+ * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
27
+ */
28
+
29
+ class Adyen_Payment_GetInstallmentsController extends Mage_Core_Controller_Front_Action {
30
+
31
+ public function indexAction()
32
+ {
33
+
34
+ $params = $this->getRequest()->getParams();
35
+
36
+ // get installments for cctype
37
+ $ccType = $params['ccType'];
38
+
39
+ // get installments
40
+ $quote = (Mage::getModel('checkout/type_onepage') !== false)? Mage::getModel('checkout/type_onepage')->getQuote(): Mage::getModel('checkout/session')->getQuote();
41
+
42
+ if($quote->isVirtual()) {
43
+ $address = $this->getBillingAddress();
44
+ } else {
45
+ $address = $quote->getShippingAddress();
46
+ }
47
+
48
+ // distract the already included added fee for installment you selected before
49
+ if($address->getBasePaymentInstallmentFeeAmount() > 0) {
50
+ $amount = (double) ($quote->getGrandTotal() - $address->getBasePaymentInstallmentFeeAmount());
51
+ } else {
52
+ $amount = (double) $quote->getGrandTotal();
53
+ }
54
+
55
+ $currency = $quote->getQuoteCurrencyCode();
56
+
57
+
58
+ // this creditcard type is selected
59
+ if($ccType != "") {
60
+
61
+ // installment key where installents are saved in settings
62
+ $ccTypeInstallments = "installments_".$ccType;
63
+
64
+ // check if this type has installments configured
65
+ $all_installments = Mage::helper('adyen/installments')->getInstallments(null, $ccTypeInstallments);
66
+
67
+ if(empty($all_installments)) {
68
+ // no installments congigure fall back on default
69
+ $ccTypeInstallments = null;
70
+ } else {
71
+ $max_installments = Mage::helper('adyen/installments')->getConfigValue($currency,$amount, null, $ccTypeInstallments);
72
+ }
73
+ }
74
+
75
+ // Fallback to the default installments if creditcard type has no one configured
76
+ if($ccTypeInstallments == null) {
77
+ $max_installments = Mage::helper('adyen/installments')->getConfigValue($currency,$amount, null);
78
+ $all_installments = Mage::helper('adyen/installments')->getInstallments();
79
+ }
80
+
81
+ // result array here
82
+ for($i=1;$i<=$max_installments;$i++){
83
+
84
+ // check if installment has extra interest
85
+ $key = $i-1;
86
+ $installment = $all_installments[$key];
87
+ if(isset($installment[3]) && $installment[3] > 0) {
88
+ $total_amount_with_interest = $amount + ($amount * ($installment[3] / 100));
89
+ } else {
90
+ $total_amount_with_interest = $amount;
91
+ }
92
+
93
+ $partial_amount = ((double)$total_amount_with_interest)/$i;
94
+ $result[(string)$i] = $i."x ".$currency." ".number_format($partial_amount,2);
95
+ }
96
+
97
+ $jsonData = json_encode($result);
98
+ $this->getResponse()->setHeader('Content-type', 'application/json');
99
+ $this->getResponse()->setBody($jsonData);
100
+
101
+
102
+
103
+ }
104
+
105
+ }
app/code/community/Adyen/Payment/controllers/UpdateCartController.php ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Adyen Payment Module
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Adyen
17
+ * @package Adyen_Payment
18
+ * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ /**
22
+ * @category Payment Gateway
23
+ * @package Adyen_Payment
24
+ * @author Adyen
25
+ * @property Adyen B.V
26
+ * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
27
+ */
28
+
29
+ class Adyen_Payment_UpdateCartController extends Mage_Core_Controller_Front_Action {
30
+
31
+ public function indexAction()
32
+ {
33
+
34
+ $params = $this->getRequest()->getParams();
35
+ $code = (isset($params['code'])) ? $params['code'] : "";
36
+ $customCode = (isset($params['customcode'])) ? $params['customcode'] : "";
37
+
38
+ // check if barcdoe is from scanner or filled in manually
39
+ if($code != "") {
40
+ $sku = $code;
41
+ } else if($customCode != "") {
42
+ $sku = $customCode;
43
+ } else {
44
+ // no barcode
45
+ $sku = "";
46
+ }
47
+
48
+ if($sku != "") {
49
+ $productId = Mage::getModel('catalog/product')
50
+ ->getIdBySku(trim($sku));
51
+
52
+ if($productId > 0)
53
+ {
54
+ // Initiate product model
55
+ $product = Mage::getModel('catalog/product');
56
+
57
+ // Load specific product whose tier price want to update
58
+ $product ->load($productId);
59
+
60
+ if($product)
61
+ {
62
+ $cart = Mage::getSingleton('checkout/cart');
63
+ $cart->addProduct($product, array('qty'=>'1'));
64
+ $cart->save();
65
+ }
66
+ }
67
+ }
68
+
69
+ // render the content so ajax call can update template
70
+ $this->loadLayout();
71
+ $layout = $this->getLayout();
72
+ $block = $layout->getBlock("content");
73
+
74
+ $this->getResponse()->setBody($block->toHtml());
75
+ }
76
+
77
+ }
app/code/community/Adyen/Payment/docs/.DS_Store ADDED
Binary file
app/code/community/Adyen/Payment/etc/Payment.wsdl CHANGED
@@ -1,1135 +1,925 @@
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <wsdl:definitions targetNamespace="http://payment.services.adyen.com" xmlns:ns1="http://common.services.adyen.com" xmlns:soapenc12="http://www.w3.org/2003/05/soap-encoding" xmlns:tns="http://payment.services.adyen.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
3
- <wsdl:types>
4
- <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://payment.services.adyen.com">
5
- <xsd:import namespace="http://common.services.adyen.com" />
6
- <xsd:complexType name="PaymentRequest">
7
- <xsd:sequence>
8
- <xsd:element minOccurs="0" name="additionalAmount" nillable="true" type="ns1:Amount"/>
9
- <xsd:element minOccurs="0" name="additionalData" nillable="true" type="tns:anyType2anyTypeMap"/>
10
- <xsd:element minOccurs="0" name="amount" nillable="true" type="ns1:Amount"/>
11
- <xsd:element minOccurs="0" name="bankAccount" nillable="true" type="tns:BankAccount"/>
12
- <xsd:element minOccurs="0" name="billingAddress" nillable="true" type="ns1:Address"/>
13
- <xsd:element minOccurs="0" name="browserInfo" nillable="true" type="ns1:BrowserInfo"/>
14
- <xsd:element minOccurs="0" name="card" nillable="true" type="tns:Card"/>
15
- <xsd:element minOccurs="0" name="dccQuote" nillable="true" type="tns:ForexQuote"/>
16
- <xsd:element minOccurs="0" name="deliveryAddress" nillable="true" type="ns1:Address"/>
17
- <xsd:element minOccurs="0" name="deliveryDate" type="xsd:dateTime"/>
18
- <xsd:element minOccurs="0" name="deviceFingerprint" nillable="true" type="xsd:string"/>
19
- <xsd:element minOccurs="0" name="elv" nillable="true" type="tns:ELV"/>
20
- <xsd:element minOccurs="0" name="fraudOffset" nillable="true" type="xsd:int"/>
21
- <xsd:element minOccurs="0" name="installments" nillable="true" type="ns1:Installments"/>
22
- <xsd:element minOccurs="0" name="merchantAccount" nillable="true" type="xsd:string"/>
23
- <xsd:element minOccurs="0" name="mpiData" nillable="true" type="tns:ThreeDSecureData"/>
24
- <xsd:element minOccurs="0" name="orderReference" nillable="true" type="xsd:string"/>
25
- <xsd:element minOccurs="0" name="persistentCookie" nillable="true" type="xsd:string"/>
26
- <xsd:element minOccurs="0" name="recurring" nillable="true" type="tns:Recurring"/>
27
- <xsd:element minOccurs="0" name="reference" nillable="true" type="xsd:string"/>
28
- <xsd:element minOccurs="0" name="referrer" nillable="true" type="xsd:string"/>
29
- <xsd:element minOccurs="0" name="selectedBrand" nillable="true" type="xsd:string"/>
30
- <xsd:element minOccurs="0" name="selectedRecurringDetailReference" nillable="true" type="xsd:string"/>
31
- <xsd:element minOccurs="0" name="sessionId" nillable="true" type="xsd:string"/>
32
- <xsd:element minOccurs="0" name="shopperEmail" nillable="true" type="xsd:string"/>
33
- <xsd:element minOccurs="0" name="shopperIP" nillable="true" type="xsd:string"/>
34
- <xsd:element minOccurs="0" name="shopperInteraction" nillable="true" type="xsd:string"/>
35
- <xsd:element minOccurs="0" name="shopperLocale" nillable="true" type="xsd:string"/>
36
- <xsd:element minOccurs="0" name="shopperName" nillable="true" type="ns1:Name"/>
37
- <xsd:element minOccurs="0" name="shopperReference" nillable="true" type="xsd:string"/>
38
- <xsd:element minOccurs="0" name="shopperStatement" nillable="true" type="xsd:string"/>
39
- <xsd:element minOccurs="0" name="skinCode" nillable="true" type="xsd:string"/>
40
- <xsd:element minOccurs="0" name="socialSecurityNumber" nillable="true" type="xsd:string"/>
41
- </xsd:sequence>
42
- </xsd:complexType>
43
- <xsd:complexType name="BankAccount">
44
- <xsd:sequence>
45
- <xsd:element minOccurs="0" name="bankAccountNumber" nillable="true" type="xsd:string"/>
46
- <xsd:element minOccurs="0" name="bankCode" nillable="true" type="xsd:string"/>
47
- <xsd:element minOccurs="0" name="bankLocationId" nillable="true" type="xsd:string"/>
48
- <xsd:element minOccurs="0" name="bankName" nillable="true" type="xsd:string"/>
49
- <xsd:element minOccurs="0" name="bic" nillable="true" type="xsd:string"/>
50
- <xsd:element minOccurs="0" name="checkCode" nillable="true" type="xsd:string"/>
51
- <xsd:element minOccurs="0" name="countryCode" nillable="true" type="xsd:string"/>
52
- <xsd:element minOccurs="0" name="iban" nillable="true" type="xsd:string"/>
53
- <xsd:element minOccurs="0" name="ownerName" nillable="true" type="xsd:string"/>
54
- </xsd:sequence>
55
- </xsd:complexType>
56
- <xsd:complexType name="ForexQuote">
57
- <xsd:sequence>
58
- <xsd:element minOccurs="0" name="account" nillable="true" type="xsd:string"/>
59
- <xsd:element minOccurs="0" name="accountType" nillable="true" type="xsd:string"/>
60
- <xsd:element minOccurs="0" name="baseAmount" nillable="true" type="ns1:Amount"/>
61
- <xsd:element minOccurs="0" name="basePoints" type="xsd:int"/>
62
- <xsd:element minOccurs="0" name="buy" nillable="true" type="ns1:Amount"/>
63
- <xsd:element minOccurs="0" name="interbank" nillable="true" type="ns1:Amount"/>
64
- <xsd:element minOccurs="0" name="reference" nillable="true" type="xsd:string"/>
65
- <xsd:element minOccurs="0" name="sell" nillable="true" type="ns1:Amount"/>
66
- <xsd:element minOccurs="0" name="signature" nillable="true" type="xsd:string"/>
67
- <xsd:element minOccurs="0" name="source" nillable="true" type="xsd:string"/>
68
- <xsd:element minOccurs="0" name="type" nillable="true" type="xsd:string"/>
69
- <xsd:element minOccurs="0" name="validTill" type="xsd:dateTime"/>
70
- </xsd:sequence>
71
- </xsd:complexType>
72
- <xsd:complexType name="Recurring">
73
- <xsd:sequence>
74
- <xsd:element minOccurs="0" name="contract" nillable="true" type="xsd:string"/>
75
- <xsd:element minOccurs="0" name="recurringDetailName" nillable="true" type="xsd:string"/>
76
- </xsd:sequence>
77
- </xsd:complexType>
78
- <xsd:complexType name="anyType2anyTypeMap">
79
- <xsd:sequence>
80
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="entry">
81
- <xsd:complexType>
82
- <xsd:sequence>
83
- <xsd:element maxOccurs="1" minOccurs="0" name="key" type="xsd:anyType"/>
84
- <xsd:element maxOccurs="1" minOccurs="0" name="value" type="xsd:anyType"/>
85
- </xsd:sequence>
86
- </xsd:complexType>
87
- </xsd:element>
88
- </xsd:sequence>
89
- </xsd:complexType>
90
- <xsd:complexType name="ThreeDSecureData">
91
- <xsd:sequence>
92
- <xsd:element minOccurs="0" name="authenticationResponse" nillable="true" type="xsd:string"/>
93
- <xsd:element minOccurs="0" name="cavv" nillable="true" type="xsd:base64Binary"/>
94
- <xsd:element minOccurs="0" name="cavvAlgorithm" nillable="true" type="xsd:string"/>
95
- <xsd:element minOccurs="0" name="directoryResponse" nillable="true" type="xsd:string"/>
96
- <xsd:element minOccurs="0" name="eci" nillable="true" type="xsd:string"/>
97
- <xsd:element minOccurs="0" name="xid" nillable="true" type="xsd:base64Binary"/>
98
- </xsd:sequence>
99
- </xsd:complexType>
100
- <xsd:complexType name="ELV">
101
- <xsd:sequence>
102
- <xsd:element minOccurs="0" name="accountHolderName" nillable="true" type="xsd:string"/>
103
- <xsd:element minOccurs="0" name="bankAccountNumber" nillable="true" type="xsd:string"/>
104
- <xsd:element minOccurs="0" name="bankLocation" nillable="true" type="xsd:string"/>
105
- <xsd:element minOccurs="0" name="bankLocationId" nillable="true" type="xsd:string"/>
106
- <xsd:element minOccurs="0" name="bankName" nillable="true" type="xsd:string"/>
107
- </xsd:sequence>
108
- </xsd:complexType>
109
- <xsd:complexType name="Card">
110
- <xsd:sequence>
111
- <xsd:element minOccurs="0" name="billingAddress" nillable="true" type="ns1:Address"/>
112
- <xsd:element minOccurs="0" name="brand" nillable="true" type="xsd:string"/>
113
- <xsd:element minOccurs="0" name="cvc" nillable="true" type="xsd:string"/>
114
- <xsd:element minOccurs="0" name="expiryMonth" nillable="true" type="xsd:string"/>
115
- <xsd:element minOccurs="0" name="expiryYear" nillable="true" type="xsd:string"/>
116
- <xsd:element minOccurs="0" name="holderName" nillable="true" type="xsd:string"/>
117
- <xsd:element minOccurs="0" name="issueNumber" nillable="true" type="xsd:string"/>
118
- <xsd:element minOccurs="0" name="number" nillable="true" type="xsd:string"/>
119
- <xsd:element minOccurs="0" name="startMonth" nillable="true" type="xsd:string"/>
120
- <xsd:element minOccurs="0" name="startYear" nillable="true" type="xsd:string"/>
121
- </xsd:sequence>
122
- </xsd:complexType>
123
- <xsd:element name="checkFraud">
124
- <xsd:complexType>
125
- <xsd:sequence>
126
- <xsd:element maxOccurs="1" minOccurs="1" name="paymentRequest" nillable="true" type="tns:PaymentRequest"/>
127
- </xsd:sequence>
128
- </xsd:complexType>
129
- </xsd:element>
130
- <xsd:complexType name="PaymentResult">
131
- <xsd:sequence>
132
- <xsd:element minOccurs="0" name="additionalData" nillable="true" type="tns:anyType2anyTypeMap"/>
133
- <xsd:element minOccurs="0" name="authCode" nillable="true" type="xsd:string"/>
134
- <xsd:element minOccurs="0" name="dccAmount" nillable="true" type="ns1:Amount"/>
135
- <xsd:element minOccurs="0" name="dccSignature" nillable="true" type="xsd:string"/>
136
- <xsd:element minOccurs="0" name="fraudResult" nillable="true" type="tns:FraudResult"/>
137
- <xsd:element minOccurs="0" name="issuerUrl" nillable="true" type="xsd:string"/>
138
- <xsd:element minOccurs="0" name="md" nillable="true" type="xsd:string"/>
139
- <xsd:element minOccurs="0" name="paRequest" nillable="true" type="xsd:string"/>
140
- <xsd:element minOccurs="0" name="pspReference" nillable="true" type="xsd:string"/>
141
- <xsd:element minOccurs="0" name="refusalReason" nillable="true" type="xsd:string"/>
142
- <xsd:element minOccurs="0" name="resultCode" nillable="true" type="xsd:string"/>
143
- </xsd:sequence>
144
- </xsd:complexType>
145
- <xsd:complexType name="FraudResult">
146
- <xsd:sequence>
147
- <xsd:element minOccurs="0" name="accountScore" type="xsd:int"/>
148
- <xsd:element minOccurs="0" name="results" nillable="true" type="tns:ArrayOfFraudCheckResult"/>
149
- </xsd:sequence>
150
- </xsd:complexType>
151
- <xsd:complexType name="ArrayOfFraudCheckResult">
152
- <xsd:sequence>
153
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="FraudCheckResult" nillable="true" type="tns:FraudCheckResult"/>
154
- </xsd:sequence>
155
- </xsd:complexType>
156
- <xsd:complexType name="FraudCheckResult">
157
- <xsd:sequence>
158
- <xsd:element minOccurs="0" name="accountScore" type="xsd:int"/>
159
- <xsd:element minOccurs="0" name="checkId" type="xsd:int"/>
160
- <xsd:element minOccurs="0" name="name" nillable="true" type="xsd:string"/>
161
- </xsd:sequence>
162
- </xsd:complexType>
163
- <xsd:element name="checkFraudResponse">
164
- <xsd:complexType>
165
- <xsd:sequence>
166
- <xsd:element maxOccurs="1" minOccurs="1" name="paymentResult" nillable="true" type="tns:PaymentResult"/>
167
- </xsd:sequence>
168
- </xsd:complexType>
169
- </xsd:element>
170
- <xsd:element name="ServiceException" type="ns1:ServiceException"/>
171
- <xsd:element name="refundWithData">
172
- <xsd:complexType>
173
- <xsd:sequence>
174
- <xsd:element maxOccurs="1" minOccurs="1" name="request" nillable="true" type="tns:PaymentRequest"/>
175
- </xsd:sequence>
176
- </xsd:complexType>
177
- </xsd:element>
178
- <xsd:element name="refundWithDataResponse">
179
- <xsd:complexType>
180
- <xsd:sequence>
181
- <xsd:element maxOccurs="1" minOccurs="1" name="result" nillable="true" type="tns:PaymentResult"/>
182
- </xsd:sequence>
183
- </xsd:complexType>
184
- </xsd:element>
185
- <xsd:element name="authorise">
186
- <xsd:complexType>
187
- <xsd:sequence>
188
- <xsd:element maxOccurs="1" minOccurs="1" name="paymentRequest" nillable="true" type="tns:PaymentRequest"/>
189
- </xsd:sequence>
190
- </xsd:complexType>
191
- </xsd:element>
192
- <xsd:element name="authoriseResponse">
193
- <xsd:complexType>
194
- <xsd:sequence>
195
- <xsd:element maxOccurs="1" minOccurs="1" name="paymentResult" nillable="true" type="tns:PaymentResult"/>
196
- </xsd:sequence>
197
- </xsd:complexType>
198
- </xsd:element>
199
- <xsd:complexType name="ModificationRequest">
200
- <xsd:sequence>
201
- <xsd:element minOccurs="0" name="additionalData" nillable="true" type="tns:anyType2anyTypeMap"/>
202
- <xsd:element minOccurs="0" name="authorisationCode" nillable="true" type="xsd:string"/>
203
- <xsd:element minOccurs="0" name="merchantAccount" nillable="true" type="xsd:string"/>
204
- <xsd:element minOccurs="0" name="modificationAmount" nillable="true" type="ns1:Amount"/>
205
- <xsd:element minOccurs="0" name="originalReference" nillable="true" type="xsd:string"/>
206
- <xsd:element minOccurs="0" name="reference" nillable="true" type="xsd:string"/>
207
- </xsd:sequence>
208
- </xsd:complexType>
209
- <xsd:element name="authoriseReferral">
210
- <xsd:complexType>
211
- <xsd:sequence>
212
- <xsd:element maxOccurs="1" minOccurs="1" name="modificationRequest" nillable="true" type="tns:ModificationRequest"/>
213
- </xsd:sequence>
214
- </xsd:complexType>
215
- </xsd:element>
216
- <xsd:complexType name="ModificationResult">
217
- <xsd:sequence>
218
- <xsd:element minOccurs="0" name="additionalData" nillable="true" type="tns:anyType2anyTypeMap"/>
219
- <xsd:element minOccurs="0" name="pspReference" nillable="true" type="xsd:string"/>
220
- <xsd:element minOccurs="0" name="response" nillable="true" type="xsd:string"/>
221
- </xsd:sequence>
222
- </xsd:complexType>
223
- <xsd:element name="authoriseReferralResponse">
224
- <xsd:complexType>
225
- <xsd:sequence>
226
- <xsd:element maxOccurs="1" minOccurs="1" name="authoriseReferralResult" nillable="true" type="tns:ModificationResult"/>
227
- </xsd:sequence>
228
- </xsd:complexType>
229
- </xsd:element>
230
- <xsd:complexType name="DirectDebitRequest">
231
- <xsd:sequence>
232
- <xsd:element minOccurs="0" name="additionalAmount" nillable="true" type="ns1:Amount"/>
233
- <xsd:element minOccurs="0" name="additionalData" nillable="true" type="tns:anyType2anyTypeMap"/>
234
- <xsd:element minOccurs="0" name="amount" nillable="true" type="ns1:Amount"/>
235
- <xsd:element minOccurs="0" name="bankAccount" nillable="true" type="tns:BankAccount"/>
236
- <xsd:element minOccurs="0" name="billingAddress" nillable="true" type="ns1:Address"/>
237
- <xsd:element minOccurs="0" name="browserInfo" nillable="true" type="ns1:BrowserInfo"/>
238
- <xsd:element minOccurs="0" name="dccQuote" nillable="true" type="tns:ForexQuote"/>
239
- <xsd:element minOccurs="0" name="deliveryAddress" nillable="true" type="ns1:Address"/>
240
- <xsd:element minOccurs="0" name="deliveryDate" type="xsd:dateTime"/>
241
- <xsd:element minOccurs="0" name="deviceFingerprint" nillable="true" type="xsd:string"/>
242
- <xsd:element minOccurs="0" name="fraudOffset" nillable="true" type="xsd:int"/>
243
- <xsd:element minOccurs="0" name="installments" nillable="true" type="ns1:Installments"/>
244
- <xsd:element minOccurs="0" name="merchantAccount" nillable="true" type="xsd:string"/>
245
- <xsd:element minOccurs="0" name="orderReference" nillable="true" type="xsd:string"/>
246
- <xsd:element minOccurs="0" name="persistentCookie" nillable="true" type="xsd:string"/>
247
- <xsd:element minOccurs="0" name="recurring" nillable="true" type="tns:Recurring"/>
248
- <xsd:element minOccurs="0" name="reference" nillable="true" type="xsd:string"/>
249
- <xsd:element minOccurs="0" name="referrer" nillable="true" type="xsd:string"/>
250
- <xsd:element minOccurs="0" name="selectedBrand" nillable="true" type="xsd:string"/>
251
- <xsd:element minOccurs="0" name="selectedRecurringDetailReference" nillable="true" type="xsd:string"/>
252
- <xsd:element minOccurs="0" name="sessionId" nillable="true" type="xsd:string"/>
253
- <xsd:element minOccurs="0" name="shopperEmail" nillable="true" type="xsd:string"/>
254
- <xsd:element minOccurs="0" name="shopperIP" nillable="true" type="xsd:string"/>
255
- <xsd:element minOccurs="0" name="shopperInteraction" nillable="true" type="xsd:string"/>
256
- <xsd:element minOccurs="0" name="shopperLocale" nillable="true" type="xsd:string"/>
257
- <xsd:element minOccurs="0" name="shopperName" nillable="true" type="ns1:Name"/>
258
- <xsd:element minOccurs="0" name="shopperReference" nillable="true" type="xsd:string"/>
259
- <xsd:element minOccurs="0" name="shopperStatement" nillable="true" type="xsd:string"/>
260
- <xsd:element minOccurs="0" name="skinCode" nillable="true" type="xsd:string"/>
261
- <xsd:element minOccurs="0" name="socialSecurityNumber" nillable="true" type="xsd:string"/>
262
- </xsd:sequence>
263
- </xsd:complexType>
264
- <xsd:element name="directdebit">
265
- <xsd:complexType>
266
- <xsd:sequence>
267
- <xsd:element maxOccurs="1" minOccurs="1" name="request" nillable="true" type="tns:DirectDebitRequest"/>
268
- </xsd:sequence>
269
- </xsd:complexType>
270
- </xsd:element>
271
- <xsd:complexType name="DirectDebitResponse">
272
- <xsd:sequence>
273
- <xsd:element minOccurs="0" name="additionalData" nillable="true" type="tns:anyType2anyTypeMap"/>
274
- <xsd:element minOccurs="0" name="fraudResult" nillable="true" type="tns:FraudResult"/>
275
- <xsd:element minOccurs="0" name="pspReference" nillable="true" type="xsd:string"/>
276
- <xsd:element minOccurs="0" name="refusalReason" nillable="true" type="xsd:string"/>
277
- <xsd:element minOccurs="0" name="resultCode" nillable="true" type="xsd:string"/>
278
- </xsd:sequence>
279
- </xsd:complexType>
280
- <xsd:element name="directdebitResponse">
281
- <xsd:complexType>
282
- <xsd:sequence>
283
- <xsd:element maxOccurs="1" minOccurs="1" name="response" nillable="true" type="tns:DirectDebitResponse"/>
284
- </xsd:sequence>
285
- </xsd:complexType>
286
- </xsd:element>
287
- <xsd:element name="cancel">
288
- <xsd:complexType>
289
- <xsd:sequence>
290
- <xsd:element maxOccurs="1" minOccurs="1" name="modificationRequest" nillable="true" type="tns:ModificationRequest"/>
291
- </xsd:sequence>
292
- </xsd:complexType>
293
- </xsd:element>
294
- <xsd:element name="cancelResponse">
295
- <xsd:complexType>
296
- <xsd:sequence>
297
- <xsd:element maxOccurs="1" minOccurs="1" name="cancelResult" nillable="true" type="tns:ModificationResult"/>
298
- </xsd:sequence>
299
- </xsd:complexType>
300
- </xsd:element>
301
- <xsd:complexType name="BalanceCheckRequest">
302
- <xsd:sequence>
303
- <xsd:element minOccurs="0" name="additionalAmount" nillable="true" type="ns1:Amount"/>
304
- <xsd:element minOccurs="0" name="additionalData" nillable="true" type="tns:anyType2anyTypeMap"/>
305
- <xsd:element minOccurs="0" name="amount" nillable="true" type="ns1:Amount"/>
306
- <xsd:element minOccurs="0" name="bankAccount" nillable="true" type="tns:BankAccount"/>
307
- <xsd:element minOccurs="0" name="billingAddress" nillable="true" type="ns1:Address"/>
308
- <xsd:element minOccurs="0" name="browserInfo" nillable="true" type="ns1:BrowserInfo"/>
309
- <xsd:element minOccurs="0" name="card" nillable="true" type="tns:Card"/>
310
- <xsd:element minOccurs="0" name="dccQuote" nillable="true" type="tns:ForexQuote"/>
311
- <xsd:element minOccurs="0" name="deliveryAddress" nillable="true" type="ns1:Address"/>
312
- <xsd:element minOccurs="0" name="deliveryDate" type="xsd:dateTime"/>
313
- <xsd:element minOccurs="0" name="deviceFingerprint" nillable="true" type="xsd:string"/>
314
- <xsd:element minOccurs="0" name="elv" nillable="true" type="tns:ELV"/>
315
- <xsd:element minOccurs="0" name="fraudOffset" nillable="true" type="xsd:int"/>
316
- <xsd:element minOccurs="0" name="installments" nillable="true" type="ns1:Installments"/>
317
- <xsd:element minOccurs="0" name="merchantAccount" nillable="true" type="xsd:string"/>
318
- <xsd:element minOccurs="0" name="mpiData" nillable="true" type="tns:ThreeDSecureData"/>
319
- <xsd:element minOccurs="0" name="orderReference" nillable="true" type="xsd:string"/>
320
- <xsd:element minOccurs="0" name="persistentCookie" nillable="true" type="xsd:string"/>
321
- <xsd:element minOccurs="0" name="recurring" nillable="true" type="tns:Recurring"/>
322
- <xsd:element minOccurs="0" name="reference" nillable="true" type="xsd:string"/>
323
- <xsd:element minOccurs="0" name="referrer" nillable="true" type="xsd:string"/>
324
- <xsd:element minOccurs="0" name="selectedBrand" nillable="true" type="xsd:string"/>
325
- <xsd:element minOccurs="0" name="selectedRecurringDetailReference" nillable="true" type="xsd:string"/>
326
- <xsd:element minOccurs="0" name="sessionId" nillable="true" type="xsd:string"/>
327
- <xsd:element minOccurs="0" name="shopperEmail" nillable="true" type="xsd:string"/>
328
- <xsd:element minOccurs="0" name="shopperIP" nillable="true" type="xsd:string"/>
329
- <xsd:element minOccurs="0" name="shopperInteraction" nillable="true" type="xsd:string"/>
330
- <xsd:element minOccurs="0" name="shopperLocale" nillable="true" type="xsd:string"/>
331
- <xsd:element minOccurs="0" name="shopperName" nillable="true" type="ns1:Name"/>
332
- <xsd:element minOccurs="0" name="shopperReference" nillable="true" type="xsd:string"/>
333
- <xsd:element minOccurs="0" name="shopperStatement" nillable="true" type="xsd:string"/>
334
- <xsd:element minOccurs="0" name="skinCode" nillable="true" type="xsd:string"/>
335
- <xsd:element minOccurs="0" name="socialSecurityNumber" nillable="true" type="xsd:string"/>
336
- </xsd:sequence>
337
- </xsd:complexType>
338
- <xsd:element name="balanceCheck">
339
- <xsd:complexType>
340
- <xsd:sequence>
341
- <xsd:element maxOccurs="1" minOccurs="1" name="request" nillable="true" type="tns:BalanceCheckRequest"/>
342
- </xsd:sequence>
343
- </xsd:complexType>
344
- </xsd:element>
345
- <xsd:complexType name="BalanceCheckResult">
346
- <xsd:sequence>
347
- <xsd:element minOccurs="0" name="additionalData" nillable="true" type="tns:anyType2anyTypeMap"/>
348
- <xsd:element minOccurs="0" name="currentBalance" nillable="true" type="ns1:Amount"/>
349
- <xsd:element minOccurs="0" name="pspReference" nillable="true" type="xsd:string"/>
350
- <xsd:element minOccurs="0" name="responseCode" nillable="true" type="tns:BalanceCheckResponseCode"/>
351
- </xsd:sequence>
352
- </xsd:complexType>
353
- <xsd:simpleType name="BalanceCheckResponseCode">
354
- <xsd:restriction base="xsd:string">
355
- <xsd:enumeration value="OK"/>
356
- <xsd:enumeration value="NO_BALANCE"/>
357
- <xsd:enumeration value="NOT_CHECKED"/>
358
- <xsd:enumeration value="NOT_ALLOWED"/>
359
- </xsd:restriction>
360
- </xsd:simpleType>
361
- <xsd:element name="balanceCheckResponse">
362
- <xsd:complexType>
363
- <xsd:sequence>
364
- <xsd:element maxOccurs="1" minOccurs="1" name="response" nillable="true" type="tns:BalanceCheckResult"/>
365
- </xsd:sequence>
366
- </xsd:complexType>
367
- </xsd:element>
368
- <xsd:complexType name="AddressCheckRequest">
369
- <xsd:sequence>
370
- <xsd:element minOccurs="0" name="additionalAmount" nillable="true" type="ns1:Amount"/>
371
- <xsd:element minOccurs="0" name="additionalData" nillable="true" type="tns:anyType2anyTypeMap"/>
372
- <xsd:element minOccurs="0" name="amount" nillable="true" type="ns1:Amount"/>
373
- <xsd:element minOccurs="0" name="billingAddress" nillable="true" type="ns1:Address"/>
374
- <xsd:element minOccurs="0" name="browserInfo" nillable="true" type="ns1:BrowserInfo"/>
375
- <xsd:element minOccurs="0" name="card" nillable="true" type="tns:Card"/>
376
- <xsd:element minOccurs="0" name="dccQuote" nillable="true" type="tns:ForexQuote"/>
377
- <xsd:element minOccurs="0" name="deliveryAddress" nillable="true" type="ns1:Address"/>
378
- <xsd:element minOccurs="0" name="deliveryDate" type="xsd:dateTime"/>
379
- <xsd:element minOccurs="0" name="deviceFingerprint" nillable="true" type="xsd:string"/>
380
- <xsd:element minOccurs="0" name="fraudOffset" nillable="true" type="xsd:int"/>
381
- <xsd:element minOccurs="0" name="installments" nillable="true" type="ns1:Installments"/>
382
- <xsd:element minOccurs="0" name="merchantAccount" nillable="true" type="xsd:string"/>
383
- <xsd:element minOccurs="0" name="orderReference" nillable="true" type="xsd:string"/>
384
- <xsd:element minOccurs="0" name="persistentCookie" nillable="true" type="xsd:string"/>
385
- <xsd:element minOccurs="0" name="recurring" nillable="true" type="tns:Recurring"/>
386
- <xsd:element minOccurs="0" name="reference" nillable="true" type="xsd:string"/>
387
- <xsd:element minOccurs="0" name="referrer" nillable="true" type="xsd:string"/>
388
- <xsd:element minOccurs="0" name="selectedBrand" nillable="true" type="xsd:string"/>
389
- <xsd:element minOccurs="0" name="selectedRecurringDetailReference" nillable="true" type="xsd:string"/>
390
- <xsd:element minOccurs="0" name="sessionId" nillable="true" type="xsd:string"/>
391
- <xsd:element minOccurs="0" name="shopperEmail" nillable="true" type="xsd:string"/>
392
- <xsd:element minOccurs="0" name="shopperIP" nillable="true" type="xsd:string"/>
393
- <xsd:element minOccurs="0" name="shopperInteraction" nillable="true" type="xsd:string"/>
394
- <xsd:element minOccurs="0" name="shopperLocale" nillable="true" type="xsd:string"/>
395
- <xsd:element minOccurs="0" name="shopperName" nillable="true" type="ns1:Name"/>
396
- <xsd:element minOccurs="0" name="shopperReference" nillable="true" type="xsd:string"/>
397
- <xsd:element minOccurs="0" name="shopperStatement" nillable="true" type="xsd:string"/>
398
- <xsd:element minOccurs="0" name="skinCode" nillable="true" type="xsd:string"/>
399
- <xsd:element minOccurs="0" name="socialSecurityNumber" nillable="true" type="xsd:string"/>
400
- </xsd:sequence>
401
- </xsd:complexType>
402
- <xsd:element name="addressCheck">
403
- <xsd:complexType>
404
- <xsd:sequence>
405
- <xsd:element maxOccurs="1" minOccurs="1" name="request" nillable="true" type="tns:AddressCheckRequest"/>
406
- </xsd:sequence>
407
- </xsd:complexType>
408
- </xsd:element>
409
- <xsd:complexType name="AddressCheckResult">
410
- <xsd:sequence>
411
- <xsd:element minOccurs="0" name="additionalData" nillable="true" type="tns:anyType2anyTypeMap"/>
412
- <xsd:element minOccurs="0" name="authCode" nillable="true" type="xsd:string"/>
413
- <xsd:element minOccurs="0" name="fraudResult" nillable="true" type="tns:FraudResult"/>
414
- <xsd:element minOccurs="0" name="pspReference" nillable="true" type="xsd:string"/>
415
- <xsd:element minOccurs="0" name="refusalReason" nillable="true" type="xsd:string"/>
416
- <xsd:element minOccurs="0" name="resultCode" nillable="true" type="xsd:string"/>
417
- </xsd:sequence>
418
- </xsd:complexType>
419
- <xsd:element name="addressCheckResponse">
420
- <xsd:complexType>
421
- <xsd:sequence>
422
- <xsd:element maxOccurs="1" minOccurs="1" name="response" nillable="true" type="tns:AddressCheckResult"/>
423
- </xsd:sequence>
424
- </xsd:complexType>
425
- </xsd:element>
426
- <xsd:complexType name="PaymentRequest3d">
427
- <xsd:sequence>
428
- <xsd:element minOccurs="0" name="additionalAmount" nillable="true" type="ns1:Amount"/>
429
- <xsd:element minOccurs="0" name="additionalData" nillable="true" type="tns:anyType2anyTypeMap"/>
430
- <xsd:element minOccurs="0" name="amount" nillable="true" type="ns1:Amount"/>
431
- <xsd:element minOccurs="0" name="billingAddress" nillable="true" type="ns1:Address"/>
432
- <xsd:element minOccurs="0" name="browserInfo" nillable="true" type="ns1:BrowserInfo"/>
433
- <xsd:element minOccurs="0" name="dccQuote" nillable="true" type="tns:ForexQuote"/>
434
- <xsd:element minOccurs="0" name="deliveryAddress" nillable="true" type="ns1:Address"/>
435
- <xsd:element minOccurs="0" name="deliveryDate" type="xsd:dateTime"/>
436
- <xsd:element minOccurs="0" name="deviceFingerprint" nillable="true" type="xsd:string"/>
437
- <xsd:element minOccurs="0" name="fraudOffset" nillable="true" type="xsd:int"/>
438
- <xsd:element minOccurs="0" name="installments" nillable="true" type="ns1:Installments"/>
439
- <xsd:element minOccurs="0" name="md" nillable="true" type="xsd:string"/>
440
- <xsd:element minOccurs="0" name="merchantAccount" nillable="true" type="xsd:string"/>
441
- <xsd:element minOccurs="0" name="orderReference" nillable="true" type="xsd:string"/>
442
- <xsd:element minOccurs="0" name="paResponse" nillable="true" type="xsd:string"/>
443
- <xsd:element minOccurs="0" name="persistentCookie" nillable="true" type="xsd:string"/>
444
- <xsd:element minOccurs="0" name="recurring" nillable="true" type="tns:Recurring"/>
445
- <xsd:element minOccurs="0" name="reference" nillable="true" type="xsd:string"/>
446
- <xsd:element minOccurs="0" name="referrer" nillable="true" type="xsd:string"/>
447
- <xsd:element minOccurs="0" name="selectedBrand" nillable="true" type="xsd:string"/>
448
- <xsd:element minOccurs="0" name="selectedRecurringDetailReference" nillable="true" type="xsd:string"/>
449
- <xsd:element minOccurs="0" name="sessionId" nillable="true" type="xsd:string"/>
450
- <xsd:element minOccurs="0" name="shopperEmail" nillable="true" type="xsd:string"/>
451
- <xsd:element minOccurs="0" name="shopperIP" nillable="true" type="xsd:string"/>
452
- <xsd:element minOccurs="0" name="shopperInteraction" nillable="true" type="xsd:string"/>
453
- <xsd:element minOccurs="0" name="shopperLocale" nillable="true" type="xsd:string"/>
454
- <xsd:element minOccurs="0" name="shopperName" nillable="true" type="ns1:Name"/>
455
- <xsd:element minOccurs="0" name="shopperReference" nillable="true" type="xsd:string"/>
456
- <xsd:element minOccurs="0" name="shopperStatement" nillable="true" type="xsd:string"/>
457
- <xsd:element minOccurs="0" name="skinCode" nillable="true" type="xsd:string"/>
458
- <xsd:element minOccurs="0" name="socialSecurityNumber" nillable="true" type="xsd:string"/>
459
- </xsd:sequence>
460
- </xsd:complexType>
461
- <xsd:element name="authorise3d">
462
- <xsd:complexType>
463
- <xsd:sequence>
464
- <xsd:element maxOccurs="1" minOccurs="1" name="paymentRequest3d" nillable="true" type="tns:PaymentRequest3d"/>
465
- </xsd:sequence>
466
- </xsd:complexType>
467
- </xsd:element>
468
- <xsd:element name="authorise3dResponse">
469
- <xsd:complexType>
470
- <xsd:sequence>
471
- <xsd:element maxOccurs="1" minOccurs="1" name="paymentResult" nillable="true" type="tns:PaymentResult"/>
472
- </xsd:sequence>
473
- </xsd:complexType>
474
- </xsd:element>
475
- <xsd:element name="refund">
476
- <xsd:complexType>
477
- <xsd:sequence>
478
- <xsd:element maxOccurs="1" minOccurs="1" name="modificationRequest" nillable="true" type="tns:ModificationRequest"/>
479
- </xsd:sequence>
480
- </xsd:complexType>
481
- </xsd:element>
482
- <xsd:element name="refundResponse">
483
- <xsd:complexType>
484
- <xsd:sequence>
485
- <xsd:element maxOccurs="1" minOccurs="1" name="refundResult" nillable="true" type="tns:ModificationResult"/>
486
- </xsd:sequence>
487
- </xsd:complexType>
488
- </xsd:element>
489
- <xsd:element name="capture">
490
- <xsd:complexType>
491
- <xsd:sequence>
492
- <xsd:element maxOccurs="1" minOccurs="1" name="modificationRequest" nillable="true" type="tns:ModificationRequest"/>
493
- </xsd:sequence>
494
- </xsd:complexType>
495
- </xsd:element>
496
- <xsd:element name="captureResponse">
497
- <xsd:complexType>
498
- <xsd:sequence>
499
- <xsd:element maxOccurs="1" minOccurs="1" name="captureResult" nillable="true" type="tns:ModificationResult"/>
500
- </xsd:sequence>
501
- </xsd:complexType>
502
- </xsd:element>
503
- <xsd:element name="cancelOrRefund">
504
- <xsd:complexType>
505
- <xsd:sequence>
506
- <xsd:element maxOccurs="1" minOccurs="1" name="modificationRequest" nillable="true" type="tns:ModificationRequest"/>
507
- </xsd:sequence>
508
- </xsd:complexType>
509
- </xsd:element>
510
- <xsd:element name="cancelOrRefundResponse">
511
- <xsd:complexType>
512
- <xsd:sequence>
513
- <xsd:element maxOccurs="1" minOccurs="1" name="cancelOrRefundResult" nillable="true" type="tns:ModificationResult"/>
514
- </xsd:sequence>
515
- </xsd:complexType>
516
- </xsd:element>
517
- <xsd:complexType name="FundTransferRequest">
518
- <xsd:sequence>
519
- <xsd:element minOccurs="0" name="additionalData" nillable="true" type="tns:anyType2anyTypeMap"/>
520
- <xsd:element minOccurs="0" name="authorisationCode" nillable="true" type="xsd:string"/>
521
- <xsd:element minOccurs="0" name="merchantAccount" nillable="true" type="xsd:string"/>
522
- <xsd:element minOccurs="0" name="modificationAmount" nillable="true" type="ns1:Amount"/>
523
- <xsd:element minOccurs="0" name="originalReference" nillable="true" type="xsd:string"/>
524
- <xsd:element minOccurs="0" name="reference" nillable="true" type="xsd:string"/>
525
- <xsd:element minOccurs="0" name="shopperEmail" nillable="true" type="xsd:string"/>
526
- <xsd:element minOccurs="0" name="shopperStatement" nillable="true" type="xsd:string"/>
527
- </xsd:sequence>
528
- </xsd:complexType>
529
- <xsd:element name="fundTransfer">
530
- <xsd:complexType>
531
- <xsd:sequence>
532
- <xsd:element maxOccurs="1" minOccurs="1" name="request" nillable="true" type="tns:FundTransferRequest"/>
533
- </xsd:sequence>
534
- </xsd:complexType>
535
- </xsd:element>
536
- <xsd:complexType name="FundTransferResult">
537
- <xsd:sequence>
538
- <xsd:element minOccurs="0" name="additionalData" nillable="true" type="tns:anyType2anyTypeMap"/>
539
- <xsd:element minOccurs="0" name="pspReference" nillable="true" type="xsd:string"/>
540
- <xsd:element minOccurs="0" name="response" nillable="true" type="xsd:string"/>
541
- </xsd:sequence>
542
- </xsd:complexType>
543
- <xsd:element name="fundTransferResponse">
544
- <xsd:complexType>
545
- <xsd:sequence>
546
- <xsd:element maxOccurs="1" minOccurs="1" name="result" nillable="true" type="tns:FundTransferResult"/>
547
- </xsd:sequence>
548
- </xsd:complexType>
549
- </xsd:element>
550
- </xsd:schema>
551
- <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://common.services.adyen.com">
552
- <xsd:complexType name="Amount">
553
- <xsd:sequence>
554
- <xsd:element minOccurs="0" name="currency" nillable="true" type="xsd:string"/>
555
- <xsd:element minOccurs="0" name="value" type="xsd:long"/>
556
- </xsd:sequence>
557
- </xsd:complexType>
558
- <xsd:complexType name="Installments">
559
- <xsd:sequence>
560
- <xsd:element minOccurs="0" name="value" type="xsd:short"/>
561
- </xsd:sequence>
562
- </xsd:complexType>
563
- <xsd:complexType name="Address">
564
- <xsd:sequence>
565
- <xsd:element minOccurs="0" name="city" nillable="true" type="xsd:string"/>
566
- <xsd:element minOccurs="0" name="country" nillable="true" type="xsd:string"/>
567
- <xsd:element minOccurs="0" name="houseNumberOrName" nillable="true" type="xsd:string"/>
568
- <xsd:element minOccurs="0" name="postalCode" nillable="true" type="xsd:string"/>
569
- <xsd:element minOccurs="0" name="stateOrProvince" nillable="true" type="xsd:string"/>
570
- <xsd:element minOccurs="0" name="street" nillable="true" type="xsd:string"/>
571
- </xsd:sequence>
572
- </xsd:complexType>
573
- <xsd:complexType name="BrowserInfo">
574
- <xsd:sequence>
575
- <xsd:element minOccurs="0" name="acceptHeader" nillable="true" type="xsd:string"/>
576
- <xsd:element minOccurs="0" name="userAgent" nillable="true" type="xsd:string"/>
577
- </xsd:sequence>
578
- </xsd:complexType>
579
- <xsd:complexType name="Name">
580
- <xsd:sequence>
581
- <xsd:element minOccurs="0" name="firstName" nillable="true" type="xsd:string"/>
582
- <xsd:element minOccurs="0" name="gender" nillable="true" type="ns1:Gender"/>
583
- <xsd:element minOccurs="0" name="infix" nillable="true" type="xsd:string"/>
584
- <xsd:element minOccurs="0" name="lastName" nillable="true" type="xsd:string"/>
585
- </xsd:sequence>
586
- </xsd:complexType>
587
- <xsd:simpleType name="Gender">
588
- <xsd:restriction base="xsd:string">
589
- <xsd:enumeration value="MALE"/>
590
- <xsd:enumeration value="FEMALE"/>
591
- <xsd:enumeration value="UNKNOWN"/>
592
- </xsd:restriction>
593
- </xsd:simpleType>
594
- <xsd:complexType name="ServiceException">
595
- <xsd:sequence>
596
- <xsd:element minOccurs="0" name="error" nillable="true" type="ns1:Error"/>
597
- <xsd:element minOccurs="0" name="faultActor" nillable="true" type="xsd:string"/>
598
- <xsd:element minOccurs="0" name="faultCode" nillable="true" type="xsd:string"/>
599
- <xsd:element minOccurs="0" name="faultDetail" nillable="true" type="xsd:anyType"/>
600
- <xsd:element minOccurs="0" name="faultString" nillable="true" type="xsd:string"/>
601
- <xsd:element minOccurs="0" name="type" nillable="true" type="ns1:Type"/>
602
- </xsd:sequence>
603
- </xsd:complexType>
604
- <xsd:simpleType name="Error">
605
- <xsd:restriction base="xsd:string">
606
- <xsd:enumeration value="Unknown"/>
607
- <xsd:enumeration value="NotAllowed"/>
608
- <xsd:enumeration value="NoAmountSpecified"/>
609
- <xsd:enumeration value="InvalidCardNumber"/>
610
- <xsd:enumeration value="UnableToDetermineVariant"/>
611
- <xsd:enumeration value="CVCisNotTheRightLength"/>
612
- <xsd:enumeration value="InvalidLoyaltyAmountSpecified"/>
613
- <xsd:enumeration value="InvalidPaRes3dSecure"/>
614
- <xsd:enumeration value="SessionAlreadyUsed"/>
615
- <xsd:enumeration value="RecurringNotEnabled"/>
616
- <xsd:enumeration value="InvalidBankAccountNumber"/>
617
- <xsd:enumeration value="InvalidVariant"/>
618
- <xsd:enumeration value="InvalidBankDetailsMissing"/>
619
- <xsd:enumeration value="InvalidBankCountry"/>
620
- <xsd:enumeration value="BankCountryNotSupported"/>
621
- <xsd:enumeration value="OpenInvoiceLinesMissing"/>
622
- <xsd:enumeration value="OpenInvoiceLineInvalid"/>
623
- <xsd:enumeration value="OpenInvoiceLinesInvalidTotalAmount"/>
624
- <xsd:enumeration value="InvalidDateOfBirth"/>
625
- <xsd:enumeration value="InvalidBillingAddress"/>
626
- <xsd:enumeration value="InvalidDeliveryAddress"/>
627
- <xsd:enumeration value="InvalidShopperName"/>
628
- <xsd:enumeration value="MissingShopperEmail"/>
629
- <xsd:enumeration value="MissingShopperReference"/>
630
- <xsd:enumeration value="MissingPhoneNumber"/>
631
- <xsd:enumeration value="MobilePhoneNumberOnly"/>
632
- <xsd:enumeration value="InvalidPhoneNumber"/>
633
- <xsd:enumeration value="RecurringInvalidContract"/>
634
- <xsd:enumeration value="BankAccountOrBankLocationIdNotValid"/>
635
- <xsd:enumeration value="AccountHolderMissing"/>
636
- <xsd:enumeration value="CardHolderNameMissing"/>
637
- <xsd:enumeration value="InvalidExpiry"/>
638
- <xsd:enumeration value="MissingMerchantReference"/>
639
- <xsd:enumeration value="BillingAddressCityProblem"/>
640
- <xsd:enumeration value="BillingAddressStreetProblem"/>
641
- <xsd:enumeration value="BillingAddressHouseNumberOrNameProblem"/>
642
- <xsd:enumeration value="BillingAddressCountryProblem"/>
643
- <xsd:enumeration value="BillingAddressStateOrProvinceProblem"/>
644
- <xsd:enumeration value="OpenInvoiceFailedToRetrieveDetails"/>
645
- <xsd:enumeration value="InvalidAmount"/>
646
- <xsd:enumeration value="UnsupportedCurrency"/>
647
- <xsd:enumeration value="RecurringRequiredFields"/>
648
- <xsd:enumeration value="InvalidCardExpiryOnInPast"/>
649
- <xsd:enumeration value="InvalidCardExpiry"/>
650
- <xsd:enumeration value="BankNameOrBankLocationIsNotValid"/>
651
- <xsd:enumeration value="InvalidIdealMerchantReturnUrl"/>
652
- <xsd:enumeration value="InvalidCardStartDateInFuture"/>
653
- <xsd:enumeration value="InvalidIssuerCountryCode"/>
654
- <xsd:enumeration value="InvalidSocialSecurityNumber"/>
655
- <xsd:enumeration value="DeliveryAddressCityProblem"/>
656
- <xsd:enumeration value="DeliveryAddressStreetProblem"/>
657
- <xsd:enumeration value="DeliveryAddressHouseNumberOrNameProblem"/>
658
- <xsd:enumeration value="DeliveryAddressCountryProblem"/>
659
- <xsd:enumeration value="DeliveryAddressStateOrProvinceProblem"/>
660
- <xsd:enumeration value="InvalidInstallments"/>
661
- <xsd:enumeration value="InvalidCVC"/>
662
- <xsd:enumeration value="MissingAdditionalData"/>
663
- <xsd:enumeration value="MissingAcquirer"/>
664
- <xsd:enumeration value="MissingAuthorisationMid"/>
665
- <xsd:enumeration value="MissingFields"/>
666
- <xsd:enumeration value="MissingRequiredField"/>
667
- <xsd:enumeration value="InvalidNumberOfRequests"/>
668
- <xsd:enumeration value="PayoutStoreDetailNotAllowed"/>
669
- <xsd:enumeration value="InvalidIBAN"/>
670
- <xsd:enumeration value="InconsistentIban"/>
671
- <xsd:enumeration value="InvalidBIC"/>
672
- <xsd:enumeration value="GenerationDateMissing"/>
673
- <xsd:enumeration value="GenerationDateParseError"/>
674
- <xsd:enumeration value="GenerationDateNotInRange"/>
675
- <xsd:enumeration value="UnableToLoadPrivateKey"/>
676
- <xsd:enumeration value="UnableToDecryptData"/>
677
- <xsd:enumeration value="JSONParseError"/>
678
- <xsd:enumeration value="Invoice_MissingInvoiceProject"/>
679
- <xsd:enumeration value="Invoice_MissingInvoiceBatch"/>
680
- <xsd:enumeration value="Invoice_MissingCreditorAccount"/>
681
- <xsd:enumeration value="Invoice_MissingProjectCode"/>
682
- <xsd:enumeration value="Invoice_CreditorAccountNotFound"/>
683
- <xsd:enumeration value="Invoice_ProjectNotFound"/>
684
- <xsd:enumeration value="Invoice_InvoiceProjectCouldNotBeCreated"/>
685
- <xsd:enumeration value="Invoice_InvoiceBatchAlreadyExists"/>
686
- <xsd:enumeration value="Invoice_InvoiceBatchCouldNotBeCreated"/>
687
- <xsd:enumeration value="Invoice_InvoiceBatchPeriodExceeded"/>
688
- <xsd:enumeration value="InvoiceMissingInvoice"/>
689
- <xsd:enumeration value="InvoiceMissingCreditorAccountCode"/>
690
- <xsd:enumeration value="InvoiceMissingInvoiceProjectAccountCode"/>
691
- <xsd:enumeration value="InvoiceMissingDebtorCode"/>
692
- <xsd:enumeration value="InvoiceMissingDebtorFirstName"/>
693
- <xsd:enumeration value="InvoiceMissingDebtorLastName"/>
694
- <xsd:enumeration value="InvoiceMissingDebtorStreetAddress"/>
695
- <xsd:enumeration value="InvoiceMissingDebtorPostalCode"/>
696
- <xsd:enumeration value="InvoiceMissingDebtorCity"/>
697
- <xsd:enumeration value="InvoiceMissingDebtorCountryCode"/>
698
- <xsd:enumeration value="InvoiceMissingDebtorAddressCountryCode"/>
699
- <xsd:enumeration value="InvoiceMissingDebtorEmailAddress"/>
700
- <xsd:enumeration value="InvoiceMissingDebtorPhoneNumber"/>
701
- <xsd:enumeration value="InvoiceMissingInvoicePayment"/>
702
- <xsd:enumeration value="InvoiceMissingReference"/>
703
- <xsd:enumeration value="InvoiceInvalidCreditorAccount"/>
704
- <xsd:enumeration value="InvoiceInvalidInvoiceProject"/>
705
- <xsd:enumeration value="InvoiceInvalidDebtor"/>
706
- <xsd:enumeration value="InvoiceInvalidPaymentAmount"/>
707
- <xsd:enumeration value="InvoiceInvalidPaymentCurrency"/>
708
- <xsd:enumeration value="InvoiceInvalidDebtorType"/>
709
- <xsd:enumeration value="InvoiceDoesNotExists"/>
710
- <xsd:enumeration value="InvoiceDoesNotExistsForDebtor"/>
711
- <xsd:enumeration value="InvoicePaymentAmountTooHigh"/>
712
- <xsd:enumeration value="InvoiceAlreadyPaid"/>
713
- <xsd:enumeration value="InvoiceErrorStoreDebtor"/>
714
- <xsd:enumeration value="InvoiceErrorStoreInvoice"/>
715
- <xsd:enumeration value="InvoiceErrorCheckInvoiceReference"/>
716
- <xsd:enumeration value="InvoiceErrorSearchInvoices"/>
717
- <xsd:enumeration value="InvoiceErrorNoInvoiceConfiguration"/>
718
- <xsd:enumeration value="InvoiceErrorInvalidInvoiceConfiguration"/>
719
- <xsd:enumeration value="RechargeContractNotFound"/>
720
- <xsd:enumeration value="RechargeTooManyPaymentDetails"/>
721
- <xsd:enumeration value="RechargeInvalidContract"/>
722
- <xsd:enumeration value="RechargeDetailNotFound"/>
723
- <xsd:enumeration value="RechargeFailedToDisable"/>
724
- <xsd:enumeration value="RechargeDetailNotAvailableForContract"/>
725
- <xsd:enumeration value="RechargeNoApplicableContractTypeLeft"/>
726
- <xsd:enumeration value="InvalidMerchantAccount"/>
727
- <xsd:enumeration value="RequestMissing"/>
728
- <xsd:enumeration value="InternalError"/>
729
- <xsd:enumeration value="UnableToProcess"/>
730
- <xsd:enumeration value="PaymentDetailsAreNotSupported"/>
731
- <xsd:enumeration value="OriginalPspReferenceInvalidForThisEnvironment"/>
732
- <xsd:enumeration value="InvalidAcquirerAccount"/>
733
- <xsd:enumeration value="InvalidConfigurationAuthorisationMid"/>
734
- <xsd:enumeration value="InvalidConfigurationAcquirerPassword"/>
735
- <xsd:enumeration value="InvalidConfigurationApiKey"/>
736
- <xsd:enumeration value="InvalidConfigurationRedirectUrl"/>
737
- <xsd:enumeration value="InvalidConfigurationAcquirerAccountData"/>
738
- <xsd:enumeration value="InvalidConfigurationCurrencyCode"/>
739
- <xsd:enumeration value="InvalidConfigurationAuthorisationTerminalId"/>
740
- <xsd:enumeration value="InvalidConfigurationSerialNumber"/>
741
- <xsd:enumeration value="InvalidConfigurationPassword"/>
742
- <xsd:enumeration value="InvalidConfigurationProjectId"/>
743
- <xsd:enumeration value="InvalidConfigurationMerchantCategoryCode"/>
744
- <xsd:enumeration value="InvalidConfigurationMerchantName"/>
745
- </xsd:restriction>
746
- </xsd:simpleType>
747
- <xsd:simpleType name="Type">
748
- <xsd:restriction base="xsd:string">
749
- <xsd:enumeration value="internal"/>
750
- <xsd:enumeration value="validation"/>
751
- <xsd:enumeration value="security"/>
752
- <xsd:enumeration value="configuration"/>
753
- </xsd:restriction>
754
- </xsd:simpleType>
755
- </xsd:schema>
756
- </wsdl:types>
757
- <wsdl:message name="cancelOrRefundRequest">
758
- <wsdl:part name="parameters" element="tns:cancelOrRefund">
759
- </wsdl:part>
760
- </wsdl:message>
761
- <wsdl:message name="refundRequest">
762
- <wsdl:part name="parameters" element="tns:refund">
763
- </wsdl:part>
764
- </wsdl:message>
765
- <wsdl:message name="checkFraudResponse">
766
- <wsdl:part name="parameters" element="tns:checkFraudResponse">
767
- </wsdl:part>
768
- </wsdl:message>
769
- <wsdl:message name="cancelResponse">
770
- <wsdl:part name="parameters" element="tns:cancelResponse">
771
- </wsdl:part>
772
- </wsdl:message>
773
- <wsdl:message name="directdebitResponse">
774
- <wsdl:part name="parameters" element="tns:directdebitResponse">
775
- </wsdl:part>
776
- </wsdl:message>
777
- <wsdl:message name="ServiceException">
778
- <wsdl:part name="ServiceException" element="tns:ServiceException">
779
- </wsdl:part>
780
- </wsdl:message>
781
- <wsdl:message name="authoriseResponse">
782
- <wsdl:part name="parameters" element="tns:authoriseResponse">
783
- </wsdl:part>
784
- </wsdl:message>
785
- <wsdl:message name="captureResponse">
786
- <wsdl:part name="parameters" element="tns:captureResponse">
787
- </wsdl:part>
788
- </wsdl:message>
789
- <wsdl:message name="balanceCheckRequest">
790
- <wsdl:part name="parameters" element="tns:balanceCheck">
791
- </wsdl:part>
792
- </wsdl:message>
793
- <wsdl:message name="authoriseRequest">
794
- <wsdl:part name="parameters" element="tns:authorise">
795
- </wsdl:part>
796
- </wsdl:message>
797
- <wsdl:message name="directdebitRequest">
798
- <wsdl:part name="parameters" element="tns:directdebit">
799
- </wsdl:part>
800
- </wsdl:message>
801
- <wsdl:message name="refundWithDataResponse">
802
- <wsdl:part name="parameters" element="tns:refundWithDataResponse">
803
- </wsdl:part>
804
- </wsdl:message>
805
- <wsdl:message name="refundResponse">
806
- <wsdl:part name="parameters" element="tns:refundResponse">
807
- </wsdl:part>
808
- </wsdl:message>
809
- <wsdl:message name="cancelOrRefundResponse">
810
- <wsdl:part name="parameters" element="tns:cancelOrRefundResponse">
811
- </wsdl:part>
812
- </wsdl:message>
813
- <wsdl:message name="cancelRequest">
814
- <wsdl:part name="parameters" element="tns:cancel">
815
- </wsdl:part>
816
- </wsdl:message>
817
- <wsdl:message name="checkFraudRequest">
818
- <wsdl:part name="parameters" element="tns:checkFraud">
819
- </wsdl:part>
820
- </wsdl:message>
821
- <wsdl:message name="fundTransferResponse">
822
- <wsdl:part name="parameters" element="tns:fundTransferResponse">
823
- </wsdl:part>
824
- </wsdl:message>
825
- <wsdl:message name="authorise3dRequest">
826
- <wsdl:part name="parameters" element="tns:authorise3d">
827
- </wsdl:part>
828
- </wsdl:message>
829
- <wsdl:message name="captureRequest">
830
- <wsdl:part name="parameters" element="tns:capture">
831
- </wsdl:part>
832
- </wsdl:message>
833
- <wsdl:message name="authorise3dResponse">
834
- <wsdl:part name="parameters" element="tns:authorise3dResponse">
835
- </wsdl:part>
836
- </wsdl:message>
837
- <wsdl:message name="fundTransferRequest">
838
- <wsdl:part name="parameters" element="tns:fundTransfer">
839
- </wsdl:part>
840
- </wsdl:message>
841
- <wsdl:message name="addressCheckResponse">
842
- <wsdl:part name="parameters" element="tns:addressCheckResponse">
843
- </wsdl:part>
844
- </wsdl:message>
845
- <wsdl:message name="authoriseReferralRequest">
846
- <wsdl:part name="parameters" element="tns:authoriseReferral">
847
- </wsdl:part>
848
- </wsdl:message>
849
- <wsdl:message name="authoriseReferralResponse">
850
- <wsdl:part name="parameters" element="tns:authoriseReferralResponse">
851
- </wsdl:part>
852
- </wsdl:message>
853
- <wsdl:message name="addressCheckRequest">
854
- <wsdl:part name="parameters" element="tns:addressCheck">
855
- </wsdl:part>
856
- </wsdl:message>
857
- <wsdl:message name="balanceCheckResponse">
858
- <wsdl:part name="parameters" element="tns:balanceCheckResponse">
859
- </wsdl:part>
860
- </wsdl:message>
861
- <wsdl:message name="refundWithDataRequest">
862
- <wsdl:part name="parameters" element="tns:refundWithData">
863
- </wsdl:part>
864
- </wsdl:message>
865
- <wsdl:portType name="PaymentPortType">
866
- <wsdl:operation name="checkFraud">
867
- <wsdl:input name="checkFraudRequest" message="tns:checkFraudRequest">
868
- </wsdl:input>
869
- <wsdl:output name="checkFraudResponse" message="tns:checkFraudResponse">
870
- </wsdl:output>
871
- <wsdl:fault name="ServiceException" message="tns:ServiceException">
872
- </wsdl:fault>
873
- </wsdl:operation>
874
- <wsdl:operation name="refundWithData">
875
- <wsdl:input name="refundWithDataRequest" message="tns:refundWithDataRequest">
876
- </wsdl:input>
877
- <wsdl:output name="refundWithDataResponse" message="tns:refundWithDataResponse">
878
- </wsdl:output>
879
- <wsdl:fault name="ServiceException" message="tns:ServiceException">
880
- </wsdl:fault>
881
- </wsdl:operation>
882
- <wsdl:operation name="authorise">
883
- <wsdl:input name="authoriseRequest" message="tns:authoriseRequest">
884
- </wsdl:input>
885
- <wsdl:output name="authoriseResponse" message="tns:authoriseResponse">
886
- </wsdl:output>
887
- <wsdl:fault name="ServiceException" message="tns:ServiceException">
888
- </wsdl:fault>
889
- </wsdl:operation>
890
- <wsdl:operation name="authoriseReferral">
891
- <wsdl:input name="authoriseReferralRequest" message="tns:authoriseReferralRequest">
892
- </wsdl:input>
893
- <wsdl:output name="authoriseReferralResponse" message="tns:authoriseReferralResponse">
894
- </wsdl:output>
895
- <wsdl:fault name="ServiceException" message="tns:ServiceException">
896
- </wsdl:fault>
897
- </wsdl:operation>
898
- <wsdl:operation name="directdebit">
899
- <wsdl:input name="directdebitRequest" message="tns:directdebitRequest">
900
- </wsdl:input>
901
- <wsdl:output name="directdebitResponse" message="tns:directdebitResponse">
902
- </wsdl:output>
903
- <wsdl:fault name="ServiceException" message="tns:ServiceException">
904
- </wsdl:fault>
905
- </wsdl:operation>
906
- <wsdl:operation name="cancel">
907
- <wsdl:input name="cancelRequest" message="tns:cancelRequest">
908
- </wsdl:input>
909
- <wsdl:output name="cancelResponse" message="tns:cancelResponse">
910
- </wsdl:output>
911
- <wsdl:fault name="ServiceException" message="tns:ServiceException">
912
- </wsdl:fault>
913
- </wsdl:operation>
914
- <wsdl:operation name="balanceCheck">
915
- <wsdl:input name="balanceCheckRequest" message="tns:balanceCheckRequest">
916
- </wsdl:input>
917
- <wsdl:output name="balanceCheckResponse" message="tns:balanceCheckResponse">
918
- </wsdl:output>
919
- <wsdl:fault name="ServiceException" message="tns:ServiceException">
920
- </wsdl:fault>
921
- </wsdl:operation>
922
- <wsdl:operation name="addressCheck">
923
- <wsdl:input name="addressCheckRequest" message="tns:addressCheckRequest">
924
- </wsdl:input>
925
- <wsdl:output name="addressCheckResponse" message="tns:addressCheckResponse">
926
- </wsdl:output>
927
- <wsdl:fault name="ServiceException" message="tns:ServiceException">
928
- </wsdl:fault>
929
- </wsdl:operation>
930
- <wsdl:operation name="authorise3d">
931
- <wsdl:input name="authorise3dRequest" message="tns:authorise3dRequest">
932
- </wsdl:input>
933
- <wsdl:output name="authorise3dResponse" message="tns:authorise3dResponse">
934
- </wsdl:output>
935
- <wsdl:fault name="ServiceException" message="tns:ServiceException">
936
- </wsdl:fault>
937
- </wsdl:operation>
938
- <wsdl:operation name="refund">
939
- <wsdl:input name="refundRequest" message="tns:refundRequest">
940
- </wsdl:input>
941
- <wsdl:output name="refundResponse" message="tns:refundResponse">
942
- </wsdl:output>
943
- <wsdl:fault name="ServiceException" message="tns:ServiceException">
944
- </wsdl:fault>
945
- </wsdl:operation>
946
- <wsdl:operation name="capture">
947
- <wsdl:input name="captureRequest" message="tns:captureRequest">
948
- </wsdl:input>
949
- <wsdl:output name="captureResponse" message="tns:captureResponse">
950
- </wsdl:output>
951
- <wsdl:fault name="ServiceException" message="tns:ServiceException">
952
- </wsdl:fault>
953
- </wsdl:operation>
954
- <wsdl:operation name="cancelOrRefund">
955
- <wsdl:input name="cancelOrRefundRequest" message="tns:cancelOrRefundRequest">
956
- </wsdl:input>
957
- <wsdl:output name="cancelOrRefundResponse" message="tns:cancelOrRefundResponse">
958
- </wsdl:output>
959
- <wsdl:fault name="ServiceException" message="tns:ServiceException">
960
- </wsdl:fault>
961
- </wsdl:operation>
962
- <wsdl:operation name="fundTransfer">
963
- <wsdl:input name="fundTransferRequest" message="tns:fundTransferRequest">
964
- </wsdl:input>
965
- <wsdl:output name="fundTransferResponse" message="tns:fundTransferResponse">
966
- </wsdl:output>
967
- <wsdl:fault name="ServiceException" message="tns:ServiceException">
968
- </wsdl:fault>
969
- </wsdl:operation>
970
- </wsdl:portType>
971
- <wsdl:binding name="PaymentHttpBinding" type="tns:PaymentPortType">
972
- <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
973
- <wsdl:operation name="checkFraud">
974
- <wsdlsoap:operation soapAction=""/>
975
- <wsdl:input name="checkFraudRequest">
976
- <wsdlsoap:body use="literal"/>
977
- </wsdl:input>
978
- <wsdl:output name="checkFraudResponse">
979
- <wsdlsoap:body use="literal"/>
980
- </wsdl:output>
981
- <wsdl:fault name="ServiceException">
982
- <wsdlsoap:fault name="ServiceException" use="literal"/>
983
- </wsdl:fault>
984
- </wsdl:operation>
985
- <wsdl:operation name="refundWithData">
986
- <wsdlsoap:operation soapAction=""/>
987
- <wsdl:input name="refundWithDataRequest">
988
- <wsdlsoap:body use="literal"/>
989
- </wsdl:input>
990
- <wsdl:output name="refundWithDataResponse">
991
- <wsdlsoap:body use="literal"/>
992
- </wsdl:output>
993
- <wsdl:fault name="ServiceException">
994
- <wsdlsoap:fault name="ServiceException" use="literal"/>
995
- </wsdl:fault>
996
- </wsdl:operation>
997
- <wsdl:operation name="authorise">
998
- <wsdlsoap:operation soapAction=""/>
999
- <wsdl:input name="authoriseRequest">
1000
- <wsdlsoap:body use="literal"/>
1001
- </wsdl:input>
1002
- <wsdl:output name="authoriseResponse">
1003
- <wsdlsoap:body use="literal"/>
1004
- </wsdl:output>
1005
- <wsdl:fault name="ServiceException">
1006
- <wsdlsoap:fault name="ServiceException" use="literal"/>
1007
- </wsdl:fault>
1008
- </wsdl:operation>
1009
- <wsdl:operation name="authoriseReferral">
1010
- <wsdlsoap:operation soapAction=""/>
1011
- <wsdl:input name="authoriseReferralRequest">
1012
- <wsdlsoap:body use="literal"/>
1013
- </wsdl:input>
1014
- <wsdl:output name="authoriseReferralResponse">
1015
- <wsdlsoap:body use="literal"/>
1016
- </wsdl:output>
1017
- <wsdl:fault name="ServiceException">
1018
- <wsdlsoap:fault name="ServiceException" use="literal"/>
1019
- </wsdl:fault>
1020
- </wsdl:operation>
1021
- <wsdl:operation name="directdebit">
1022
- <wsdlsoap:operation soapAction=""/>
1023
- <wsdl:input name="directdebitRequest">
1024
- <wsdlsoap:body use="literal"/>
1025
- </wsdl:input>
1026
- <wsdl:output name="directdebitResponse">
1027
- <wsdlsoap:body use="literal"/>
1028
- </wsdl:output>
1029
- <wsdl:fault name="ServiceException">
1030
- <wsdlsoap:fault name="ServiceException" use="literal"/>
1031
- </wsdl:fault>
1032
- </wsdl:operation>
1033
- <wsdl:operation name="cancel">
1034
- <wsdlsoap:operation soapAction=""/>
1035
- <wsdl:input name="cancelRequest">
1036
- <wsdlsoap:body use="literal"/>
1037
- </wsdl:input>
1038
- <wsdl:output name="cancelResponse">
1039
- <wsdlsoap:body use="literal"/>
1040
- </wsdl:output>
1041
- <wsdl:fault name="ServiceException">
1042
- <wsdlsoap:fault name="ServiceException" use="literal"/>
1043
- </wsdl:fault>
1044
- </wsdl:operation>
1045
- <wsdl:operation name="balanceCheck">
1046
- <wsdlsoap:operation soapAction=""/>
1047
- <wsdl:input name="balanceCheckRequest">
1048
- <wsdlsoap:body use="literal"/>
1049
- </wsdl:input>
1050
- <wsdl:output name="balanceCheckResponse">
1051
- <wsdlsoap:body use="literal"/>
1052
- </wsdl:output>
1053
- <wsdl:fault name="ServiceException">
1054
- <wsdlsoap:fault name="ServiceException" use="literal"/>
1055
- </wsdl:fault>
1056
- </wsdl:operation>
1057
- <wsdl:operation name="addressCheck">
1058
- <wsdlsoap:operation soapAction=""/>
1059
- <wsdl:input name="addressCheckRequest">
1060
- <wsdlsoap:body use="literal"/>
1061
- </wsdl:input>
1062
- <wsdl:output name="addressCheckResponse">
1063
- <wsdlsoap:body use="literal"/>
1064
- </wsdl:output>
1065
- <wsdl:fault name="ServiceException">
1066
- <wsdlsoap:fault name="ServiceException" use="literal"/>
1067
- </wsdl:fault>
1068
- </wsdl:operation>
1069
- <wsdl:operation name="authorise3d">
1070
- <wsdlsoap:operation soapAction=""/>
1071
- <wsdl:input name="authorise3dRequest">
1072
- <wsdlsoap:body use="literal"/>
1073
- </wsdl:input>
1074
- <wsdl:output name="authorise3dResponse">
1075
- <wsdlsoap:body use="literal"/>
1076
- </wsdl:output>
1077
- <wsdl:fault name="ServiceException">
1078
- <wsdlsoap:fault name="ServiceException" use="literal"/>
1079
- </wsdl:fault>
1080
- </wsdl:operation>
1081
- <wsdl:operation name="refund">
1082
- <wsdlsoap:operation soapAction=""/>
1083
- <wsdl:input name="refundRequest">
1084
- <wsdlsoap:body use="literal"/>
1085
- </wsdl:input>
1086
- <wsdl:output name="refundResponse">
1087
- <wsdlsoap:body use="literal"/>
1088
- </wsdl:output>
1089
- <wsdl:fault name="ServiceException">
1090
- <wsdlsoap:fault name="ServiceException" use="literal"/>
1091
- </wsdl:fault>
1092
- </wsdl:operation>
1093
- <wsdl:operation name="capture">
1094
- <wsdlsoap:operation soapAction=""/>
1095
- <wsdl:input name="captureRequest">
1096
- <wsdlsoap:body use="literal"/>
1097
- </wsdl:input>
1098
- <wsdl:output name="captureResponse">
1099
- <wsdlsoap:body use="literal"/>
1100
- </wsdl:output>
1101
- <wsdl:fault name="ServiceException">
1102
- <wsdlsoap:fault name="ServiceException" use="literal"/>
1103
- </wsdl:fault>
1104
- </wsdl:operation>
1105
- <wsdl:operation name="cancelOrRefund">
1106
- <wsdlsoap:operation soapAction=""/>
1107
- <wsdl:input name="cancelOrRefundRequest">
1108
- <wsdlsoap:body use="literal"/>
1109
- </wsdl:input>
1110
- <wsdl:output name="cancelOrRefundResponse">
1111
- <wsdlsoap:body use="literal"/>
1112
- </wsdl:output>
1113
- <wsdl:fault name="ServiceException">
1114
- <wsdlsoap:fault name="ServiceException" use="literal"/>
1115
- </wsdl:fault>
1116
- </wsdl:operation>
1117
- <wsdl:operation name="fundTransfer">
1118
- <wsdlsoap:operation soapAction=""/>
1119
- <wsdl:input name="fundTransferRequest">
1120
- <wsdlsoap:body use="literal"/>
1121
- </wsdl:input>
1122
- <wsdl:output name="fundTransferResponse">
1123
- <wsdlsoap:body use="literal"/>
1124
- </wsdl:output>
1125
- <wsdl:fault name="ServiceException">
1126
- <wsdlsoap:fault name="ServiceException" use="literal"/>
1127
- </wsdl:fault>
1128
- </wsdl:operation>
1129
- </wsdl:binding>
1130
- <wsdl:service name="Payment">
1131
- <wsdl:port name="PaymentHttpPort" binding="tns:PaymentHttpBinding">
1132
- <wsdlsoap:address location="http://localhost:8080/pal/servlet/soap/Payment"/>
1133
- </wsdl:port>
1134
- </wsdl:service>
1135
  </wsdl:definitions>
1
  <?xml version="1.0" encoding="UTF-8"?>
2
+ <wsdl:definitions xmlns:ns1="http://common.services.adyen.com" xmlns:tns="http://payment.services.adyen.com" xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc12="http://www.w3.org/2003/05/soap-encoding" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope" targetNamespace="http://payment.services.adyen.com">
3
+ <wsdl:types>
4
+ <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://payment.services.adyen.com">
5
+ <xsd:import namespace="http://common.services.adyen.com"/>
6
+ <xsd:complexType name="BalanceCheckRequest">
7
+ <xsd:sequence>
8
+ <xsd:element minOccurs="0" name="additionalAmount" nillable="true" type="ns1:Amount"/>
9
+ <xsd:element minOccurs="0" name="additionalData" nillable="true" type="tns:anyType2anyTypeMap"/>
10
+ <xsd:element minOccurs="0" name="amount" nillable="true" type="ns1:Amount"/>
11
+ <xsd:element minOccurs="0" name="bankAccount" nillable="true" type="tns:BankAccount"/>
12
+ <xsd:element minOccurs="0" name="billingAddress" nillable="true" type="ns1:Address"/>
13
+ <xsd:element minOccurs="0" name="browserInfo" nillable="true" type="ns1:BrowserInfo"/>
14
+ <xsd:element minOccurs="0" name="captureDelayHours" nillable="true" type="xsd:int"/>
15
+ <xsd:element minOccurs="0" name="card" nillable="true" type="tns:Card"/>
16
+ <xsd:element minOccurs="0" name="dateOfBirth" nillable="true" type="xsd:dateTime"/>
17
+ <xsd:element minOccurs="0" name="dccQuote" nillable="true" type="tns:ForexQuote"/>
18
+ <xsd:element minOccurs="0" name="deliveryAddress" nillable="true" type="ns1:Address"/>
19
+ <xsd:element minOccurs="0" name="deviceFingerprint" nillable="true" type="xsd:string"/>
20
+ <xsd:element minOccurs="0" name="elv" nillable="true" type="tns:ELV"/>
21
+ <xsd:element minOccurs="0" name="fraudOffset" nillable="true" type="xsd:int"/>
22
+ <xsd:element minOccurs="0" name="installments" nillable="true" type="ns1:Installments"/>
23
+ <xsd:element minOccurs="0" name="merchantAccount" nillable="true" type="xsd:string"/>
24
+ <xsd:element minOccurs="0" name="mpiData" nillable="true" type="tns:ThreeDSecureData"/>
25
+ <xsd:element minOccurs="0" name="orderReference" nillable="true" type="xsd:string"/>
26
+ <xsd:element minOccurs="0" name="recurring" nillable="true" type="tns:Recurring"/>
27
+ <xsd:element minOccurs="0" name="reference" nillable="true" type="xsd:string"/>
28
+ <xsd:element minOccurs="0" name="selectedBrand" nillable="true" type="xsd:string"/>
29
+ <xsd:element minOccurs="0" name="selectedRecurringDetailReference" nillable="true" type="xsd:string"/>
30
+ <xsd:element minOccurs="0" name="sessionId" nillable="true" type="xsd:string"/>
31
+ <xsd:element minOccurs="0" name="shopperEmail" nillable="true" type="xsd:string"/>
32
+ <xsd:element minOccurs="0" name="shopperIP" nillable="true" type="xsd:string"/>
33
+ <xsd:element minOccurs="0" name="shopperInteraction" nillable="true" type="xsd:string"/>
34
+ <xsd:element minOccurs="0" name="shopperLocale" nillable="true" type="xsd:string"/>
35
+ <xsd:element minOccurs="0" name="shopperName" nillable="true" type="ns1:Name"/>
36
+ <xsd:element minOccurs="0" name="shopperReference" nillable="true" type="xsd:string"/>
37
+ <xsd:element minOccurs="0" name="shopperStatement" nillable="true" type="xsd:string"/>
38
+ <xsd:element minOccurs="0" name="socialSecurityNumber" nillable="true" type="xsd:string"/>
39
+ <xsd:element minOccurs="0" name="telephoneNumber" nillable="true" type="xsd:string"/>
40
+ </xsd:sequence>
41
+ </xsd:complexType>
42
+ <xsd:complexType name="BalanceCheckResult">
43
+ <xsd:sequence>
44
+ <xsd:element minOccurs="0" name="additionalData" nillable="true" type="tns:anyType2anyTypeMap"/>
45
+ <xsd:element minOccurs="0" name="currentBalance" nillable="true" type="ns1:Amount"/>
46
+ <xsd:element minOccurs="0" name="pspReference" nillable="true" type="xsd:string"/>
47
+ <xsd:element minOccurs="0" name="responseCode" nillable="true" type="tns:BalanceCheckResponseCode"/>
48
+ </xsd:sequence>
49
+ </xsd:complexType>
50
+ <xsd:simpleType name="BalanceCheckResponseCode">
51
+ <xsd:restriction base="xsd:string">
52
+ <xsd:enumeration value="OK"/>
53
+ <xsd:enumeration value="NO_BALANCE"/>
54
+ <xsd:enumeration value="NOT_CHECKED"/>
55
+ <xsd:enumeration value="NOT_ALLOWED"/>
56
+ </xsd:restriction>
57
+ </xsd:simpleType>
58
+ <xsd:complexType name="BankAccount">
59
+ <xsd:sequence>
60
+ <xsd:element minOccurs="0" name="bankAccountNumber" nillable="true" type="xsd:string"/>
61
+ <xsd:element minOccurs="0" name="bankLocationId" nillable="true" type="xsd:string"/>
62
+ <xsd:element minOccurs="0" name="bankName" nillable="true" type="xsd:string"/>
63
+ <xsd:element minOccurs="0" name="bic" nillable="true" type="xsd:string"/>
64
+ <xsd:element minOccurs="0" name="countryCode" nillable="true" type="xsd:string"/>
65
+ <xsd:element minOccurs="0" name="iban" nillable="true" type="xsd:string"/>
66
+ <xsd:element minOccurs="0" name="ownerName" nillable="true" type="xsd:string"/>
67
+ </xsd:sequence>
68
+ </xsd:complexType>
69
+ <xsd:complexType name="Card">
70
+ <xsd:sequence>
71
+ <xsd:element minOccurs="0" name="billingAddress" nillable="true" type="ns1:Address"/>
72
+ <xsd:element minOccurs="0" name="brand" nillable="true" type="xsd:string"/>
73
+ <xsd:element minOccurs="0" name="cvc" nillable="true">
74
+ <xsd:simpleType>
75
+ <xsd:restriction base="xsd:string">
76
+ <xsd:minLength value="1"/>
77
+ <xsd:maxLength value="20"/>
78
+ </xsd:restriction>
79
+ </xsd:simpleType>
80
+ </xsd:element>
81
+ <xsd:element minOccurs="1" name="expiryMonth">
82
+ <xsd:simpleType>
83
+ <xsd:restriction base="xsd:string">
84
+ <xsd:minLength value="2"/>
85
+ <xsd:maxLength value="2"/>
86
+ </xsd:restriction>
87
+ </xsd:simpleType>
88
+ </xsd:element>
89
+ <xsd:element minOccurs="1" name="expiryYear">
90
+ <xsd:simpleType>
91
+ <xsd:restriction base="xsd:string">
92
+ <xsd:minLength value="4"/>
93
+ <xsd:maxLength value="4"/>
94
+ </xsd:restriction>
95
+ </xsd:simpleType>
96
+ </xsd:element>
97
+ <xsd:element minOccurs="1" name="holderName">
98
+ <xsd:simpleType>
99
+ <xsd:restriction base="xsd:string">
100
+ <xsd:minLength value="1"/>
101
+ <xsd:maxLength value="50"/>
102
+ </xsd:restriction>
103
+ </xsd:simpleType>
104
+ </xsd:element>
105
+ <xsd:element minOccurs="0" name="issueNumber" nillable="true">
106
+ <xsd:simpleType>
107
+ <xsd:restriction base="xsd:string">
108
+ <xsd:minLength value="1"/>
109
+ <xsd:maxLength value="2"/>
110
+ </xsd:restriction>
111
+ </xsd:simpleType>
112
+ </xsd:element>
113
+ <xsd:element minOccurs="1" name="number">
114
+ <xsd:simpleType>
115
+ <xsd:restriction base="xsd:string">
116
+ <xsd:minLength value="4"/>
117
+ <xsd:maxLength value="19"/>
118
+ </xsd:restriction>
119
+ </xsd:simpleType>
120
+ </xsd:element>
121
+ <xsd:element minOccurs="0" name="startMonth" nillable="true">
122
+ <xsd:simpleType>
123
+ <xsd:restriction base="xsd:string">
124
+ <xsd:minLength value="2"/>
125
+ <xsd:maxLength value="2"/>
126
+ </xsd:restriction>
127
+ </xsd:simpleType>
128
+ </xsd:element>
129
+ <xsd:element minOccurs="0" name="startYear" nillable="true">
130
+ <xsd:simpleType>
131
+ <xsd:restriction base="xsd:string">
132
+ <xsd:minLength value="4"/>
133
+ <xsd:maxLength value="4"/>
134
+ </xsd:restriction>
135
+ </xsd:simpleType>
136
+ </xsd:element>
137
+ </xsd:sequence>
138
+ </xsd:complexType>
139
+ <xsd:complexType name="DirectDebitRequest">
140
+ <xsd:sequence>
141
+ <xsd:element minOccurs="0" name="additionalAmount" nillable="true" type="ns1:Amount"/>
142
+ <xsd:element minOccurs="0" name="additionalData" nillable="true" type="tns:anyType2anyTypeMap"/>
143
+ <xsd:element minOccurs="0" name="amount" nillable="true" type="ns1:Amount"/>
144
+ <xsd:element minOccurs="0" name="bankAccount" nillable="true" type="tns:BankAccount"/>
145
+ <xsd:element minOccurs="0" name="billingAddress" nillable="true" type="ns1:Address"/>
146
+ <xsd:element minOccurs="0" name="browserInfo" nillable="true" type="ns1:BrowserInfo"/>
147
+ <xsd:element minOccurs="0" name="captureDelayHours" nillable="true" type="xsd:int"/>
148
+ <xsd:element minOccurs="0" name="dateOfBirth" nillable="true" type="xsd:dateTime"/>
149
+ <xsd:element minOccurs="0" name="dccQuote" nillable="true" type="tns:ForexQuote"/>
150
+ <xsd:element minOccurs="0" name="deliveryAddress" nillable="true" type="ns1:Address"/>
151
+ <xsd:element minOccurs="0" name="deviceFingerprint" nillable="true" type="xsd:string"/>
152
+ <xsd:element minOccurs="0" name="fraudOffset" nillable="true" type="xsd:int"/>
153
+ <xsd:element minOccurs="0" name="installments" nillable="true" type="ns1:Installments"/>
154
+ <xsd:element minOccurs="0" name="merchantAccount" nillable="true" type="xsd:string"/>
155
+ <xsd:element minOccurs="0" name="orderReference" nillable="true" type="xsd:string"/>
156
+ <xsd:element minOccurs="0" name="recurring" nillable="true" type="tns:Recurring"/>
157
+ <xsd:element minOccurs="0" name="reference" nillable="true" type="xsd:string"/>
158
+ <xsd:element minOccurs="0" name="selectedBrand" nillable="true" type="xsd:string"/>
159
+ <xsd:element minOccurs="0" name="selectedRecurringDetailReference" nillable="true" type="xsd:string"/>
160
+ <xsd:element minOccurs="0" name="sessionId" nillable="true" type="xsd:string"/>
161
+ <xsd:element minOccurs="0" name="shopperEmail" nillable="true" type="xsd:string"/>
162
+ <xsd:element minOccurs="0" name="shopperIP" nillable="true" type="xsd:string"/>
163
+ <xsd:element minOccurs="0" name="shopperInteraction" nillable="true" type="xsd:string"/>
164
+ <xsd:element minOccurs="0" name="shopperLocale" nillable="true" type="xsd:string"/>
165
+ <xsd:element minOccurs="0" name="shopperName" nillable="true" type="ns1:Name"/>
166
+ <xsd:element minOccurs="0" name="shopperReference" nillable="true" type="xsd:string"/>
167
+ <xsd:element minOccurs="0" name="shopperStatement" nillable="true" type="xsd:string"/>
168
+ <xsd:element minOccurs="0" name="socialSecurityNumber" nillable="true" type="xsd:string"/>
169
+ <xsd:element minOccurs="0" name="telephoneNumber" nillable="true" type="xsd:string"/>
170
+ </xsd:sequence>
171
+ </xsd:complexType>
172
+ <xsd:complexType name="DirectDebitResponse">
173
+ <xsd:sequence>
174
+ <xsd:element minOccurs="0" name="additionalData" nillable="true" type="tns:anyType2anyTypeMap"/>
175
+ <xsd:element minOccurs="0" name="fraudResult" nillable="true" type="tns:FraudResult"/>
176
+ <xsd:element minOccurs="0" name="pspReference" nillable="true" type="xsd:string"/>
177
+ <xsd:element minOccurs="0" name="refusalReason" nillable="true" type="xsd:string"/>
178
+ <xsd:element minOccurs="0" name="resultCode" nillable="true" type="xsd:string"/>
179
+ </xsd:sequence>
180
+ </xsd:complexType>
181
+ <xsd:complexType name="ELV">
182
+ <xsd:sequence>
183
+ <xsd:element minOccurs="0" name="accountHolderName" nillable="true" type="xsd:string"/>
184
+ <xsd:element minOccurs="0" name="bankAccountNumber" nillable="true" type="xsd:string"/>
185
+ <xsd:element minOccurs="0" name="bankLocation" nillable="true" type="xsd:string"/>
186
+ <xsd:element minOccurs="0" name="bankLocationId" nillable="true" type="xsd:string"/>
187
+ <xsd:element minOccurs="0" name="bankName" nillable="true" type="xsd:string"/>
188
+ </xsd:sequence>
189
+ </xsd:complexType>
190
+ <xsd:complexType name="ForexQuote">
191
+ <xsd:sequence>
192
+ <xsd:element minOccurs="0" name="account" nillable="true" type="xsd:string"/>
193
+ <xsd:element minOccurs="0" name="accountType" nillable="true" type="xsd:string"/>
194
+ <xsd:element minOccurs="0" name="baseAmount" nillable="true" type="ns1:Amount"/>
195
+ <xsd:element minOccurs="1" name="basePoints" type="xsd:int"/>
196
+ <xsd:element minOccurs="0" name="buy" nillable="true" type="ns1:Amount"/>
197
+ <xsd:element minOccurs="0" name="interbank" nillable="true" type="ns1:Amount"/>
198
+ <xsd:element minOccurs="0" name="reference" nillable="true" type="xsd:string"/>
199
+ <xsd:element minOccurs="0" name="sell" nillable="true" type="ns1:Amount"/>
200
+ <xsd:element minOccurs="0" name="signature" nillable="true" type="xsd:string"/>
201
+ <xsd:element minOccurs="0" name="source" nillable="true" type="xsd:string"/>
202
+ <xsd:element minOccurs="0" name="type" nillable="true" type="xsd:string"/>
203
+ <xsd:element minOccurs="1" name="validTill" type="xsd:dateTime"/>
204
+ </xsd:sequence>
205
+ </xsd:complexType>
206
+ <xsd:complexType name="FraudCheckResult">
207
+ <xsd:sequence>
208
+ <xsd:element minOccurs="1" name="accountScore" type="xsd:int"/>
209
+ <xsd:element minOccurs="1" name="checkId" type="xsd:int"/>
210
+ <xsd:element minOccurs="1" name="name" type="xsd:string"/>
211
+ </xsd:sequence>
212
+ </xsd:complexType>
213
+ <xsd:complexType name="FraudResult">
214
+ <xsd:sequence>
215
+ <xsd:element minOccurs="1" name="accountScore" type="xsd:int"/>
216
+ <xsd:element minOccurs="0" name="results" nillable="true" type="tns:ArrayOfFraudCheckResult"/>
217
+ </xsd:sequence>
218
+ </xsd:complexType>
219
+ <xsd:complexType name="FundTransferRequest">
220
+ <xsd:sequence>
221
+ <xsd:element minOccurs="0" name="additionalData" nillable="true" type="tns:anyType2anyTypeMap"/>
222
+ <xsd:element minOccurs="0" name="authorisationCode" nillable="true" type="xsd:string"/>
223
+ <xsd:element minOccurs="0" name="merchantAccount" nillable="true" type="xsd:string"/>
224
+ <xsd:element minOccurs="0" name="modificationAmount" nillable="true" type="ns1:Amount"/>
225
+ <xsd:element minOccurs="0" name="originalReference" nillable="true" type="xsd:string"/>
226
+ <xsd:element minOccurs="0" name="reference" nillable="true" type="xsd:string"/>
227
+ <xsd:element minOccurs="0" name="shopperEmail" nillable="true" type="xsd:string"/>
228
+ <xsd:element minOccurs="0" name="shopperStatement" nillable="true" type="xsd:string"/>
229
+ </xsd:sequence>
230
+ </xsd:complexType>
231
+ <xsd:complexType name="FundTransferResult">
232
+ <xsd:sequence>
233
+ <xsd:element minOccurs="0" name="additionalData" nillable="true" type="tns:anyType2anyTypeMap"/>
234
+ <xsd:element minOccurs="0" name="pspReference" nillable="true" type="xsd:string"/>
235
+ <xsd:element minOccurs="0" name="response" nillable="true" type="xsd:string"/>
236
+ </xsd:sequence>
237
+ </xsd:complexType>
238
+ <xsd:complexType name="ModificationRequest">
239
+ <xsd:sequence>
240
+ <xsd:element minOccurs="0" name="additionalData" nillable="true" type="tns:anyType2anyTypeMap"/>
241
+ <xsd:element minOccurs="0" name="authorisationCode" nillable="true" type="xsd:string"/>
242
+ <xsd:element minOccurs="0" name="merchantAccount" nillable="true" type="xsd:string"/>
243
+ <xsd:element minOccurs="0" name="modificationAmount" nillable="true" type="ns1:Amount"/>
244
+ <xsd:element minOccurs="0" name="originalReference" nillable="true" type="xsd:string"/>
245
+ <xsd:element minOccurs="0" name="reference" nillable="true" type="xsd:string"/>
246
+ </xsd:sequence>
247
+ </xsd:complexType>
248
+ <xsd:complexType name="ModificationResult">
249
+ <xsd:sequence>
250
+ <xsd:element minOccurs="0" name="additionalData" nillable="true" type="tns:anyType2anyTypeMap"/>
251
+ <xsd:element minOccurs="0" name="pspReference" nillable="true" type="xsd:string"/>
252
+ <xsd:element minOccurs="0" name="response" nillable="true" type="xsd:string"/>
253
+ </xsd:sequence>
254
+ </xsd:complexType>
255
+ <xsd:complexType name="PaymentRequest">
256
+ <xsd:sequence>
257
+ <xsd:element minOccurs="0" name="additionalAmount" nillable="true" type="ns1:Amount"/>
258
+ <xsd:element minOccurs="0" name="additionalData" nillable="true" type="tns:anyType2anyTypeMap"/>
259
+ <xsd:element minOccurs="0" name="amount" nillable="true" type="ns1:Amount"/>
260
+ <xsd:element minOccurs="0" name="bankAccount" nillable="true" type="tns:BankAccount"/>
261
+ <xsd:element minOccurs="0" name="billingAddress" nillable="true" type="ns1:Address"/>
262
+ <xsd:element minOccurs="0" name="browserInfo" nillable="true" type="ns1:BrowserInfo"/>
263
+ <xsd:element minOccurs="0" name="captureDelayHours" nillable="true" type="xsd:int"/>
264
+ <xsd:element minOccurs="0" name="card" nillable="true" type="tns:Card"/>
265
+ <xsd:element minOccurs="0" name="dateOfBirth" nillable="true" type="xsd:dateTime"/>
266
+ <xsd:element minOccurs="0" name="dccQuote" nillable="true" type="tns:ForexQuote"/>
267
+ <xsd:element minOccurs="0" name="deliveryAddress" nillable="true" type="ns1:Address"/>
268
+ <xsd:element minOccurs="0" name="deviceFingerprint" nillable="true" type="xsd:string"/>
269
+ <xsd:element minOccurs="0" name="elv" nillable="true" type="tns:ELV"/>
270
+ <xsd:element minOccurs="0" name="fraudOffset" nillable="true" type="xsd:int"/>
271
+ <xsd:element minOccurs="0" name="installments" nillable="true" type="ns1:Installments"/>
272
+ <xsd:element minOccurs="0" name="merchantAccount" nillable="true" type="xsd:string"/>
273
+ <xsd:element minOccurs="0" name="mpiData" nillable="true" type="tns:ThreeDSecureData"/>
274
+ <xsd:element minOccurs="0" name="orderReference" nillable="true" type="xsd:string"/>
275
+ <xsd:element minOccurs="0" name="recurring" nillable="true" type="tns:Recurring"/>
276
+ <xsd:element minOccurs="0" name="reference" nillable="true" type="xsd:string"/>
277
+ <xsd:element minOccurs="0" name="selectedBrand" nillable="true" type="xsd:string"/>
278
+ <xsd:element minOccurs="0" name="selectedRecurringDetailReference" nillable="true" type="xsd:string"/>
279
+ <xsd:element minOccurs="0" name="sessionId" nillable="true" type="xsd:string"/>
280
+ <xsd:element minOccurs="0" name="shopperEmail" nillable="true" type="xsd:string"/>
281
+ <xsd:element minOccurs="0" name="shopperIP" nillable="true" type="xsd:string"/>
282
+ <xsd:element minOccurs="0" name="shopperInteraction" nillable="true" type="xsd:string"/>
283
+ <xsd:element minOccurs="0" name="shopperLocale" nillable="true" type="xsd:string"/>
284
+ <xsd:element minOccurs="0" name="shopperName" nillable="true" type="ns1:Name"/>
285
+ <xsd:element minOccurs="0" name="shopperReference" nillable="true" type="xsd:string"/>
286
+ <xsd:element minOccurs="0" name="shopperStatement" nillable="true" type="xsd:string"/>
287
+ <xsd:element minOccurs="0" name="socialSecurityNumber" nillable="true" type="xsd:string"/>
288
+ <xsd:element minOccurs="0" name="telephoneNumber" nillable="true" type="xsd:string"/>
289
+ </xsd:sequence>
290
+ </xsd:complexType>
291
+ <xsd:complexType name="PaymentRequest3d">
292
+ <xsd:sequence>
293
+ <xsd:element minOccurs="0" name="additionalAmount" nillable="true" type="ns1:Amount"/>
294
+ <xsd:element minOccurs="0" name="additionalData" nillable="true" type="tns:anyType2anyTypeMap"/>
295
+ <xsd:element minOccurs="0" name="amount" nillable="true" type="ns1:Amount"/>
296
+ <xsd:element minOccurs="0" name="billingAddress" nillable="true" type="ns1:Address"/>
297
+ <xsd:element minOccurs="0" name="browserInfo" nillable="true" type="ns1:BrowserInfo"/>
298
+ <xsd:element minOccurs="0" name="captureDelayHours" nillable="true" type="xsd:int"/>
299
+ <xsd:element minOccurs="0" name="dateOfBirth" nillable="true" type="xsd:dateTime"/>
300
+ <xsd:element minOccurs="0" name="dccQuote" nillable="true" type="tns:ForexQuote"/>
301
+ <xsd:element minOccurs="0" name="deliveryAddress" nillable="true" type="ns1:Address"/>
302
+ <xsd:element minOccurs="0" name="deviceFingerprint" nillable="true" type="xsd:string"/>
303
+ <xsd:element minOccurs="0" name="fraudOffset" nillable="true" type="xsd:int"/>
304
+ <xsd:element minOccurs="0" name="installments" nillable="true" type="ns1:Installments"/>
305
+ <xsd:element minOccurs="0" name="md" nillable="true" type="xsd:string"/>
306
+ <xsd:element minOccurs="0" name="merchantAccount" nillable="true" type="xsd:string"/>
307
+ <xsd:element minOccurs="0" name="orderReference" nillable="true" type="xsd:string"/>
308
+ <xsd:element minOccurs="0" name="paResponse" nillable="true" type="xsd:string"/>
309
+ <xsd:element minOccurs="0" name="recurring" nillable="true" type="tns:Recurring"/>
310
+ <xsd:element minOccurs="0" name="reference" nillable="true" type="xsd:string"/>
311
+ <xsd:element minOccurs="0" name="selectedBrand" nillable="true" type="xsd:string"/>
312
+ <xsd:element minOccurs="0" name="selectedRecurringDetailReference" nillable="true" type="xsd:string"/>
313
+ <xsd:element minOccurs="0" name="sessionId" nillable="true" type="xsd:string"/>
314
+ <xsd:element minOccurs="0" name="shopperEmail" nillable="true" type="xsd:string"/>
315
+ <xsd:element minOccurs="0" name="shopperIP" nillable="true" type="xsd:string"/>
316
+ <xsd:element minOccurs="0" name="shopperInteraction" nillable="true" type="xsd:string"/>
317
+ <xsd:element minOccurs="0" name="shopperLocale" nillable="true" type="xsd:string"/>
318
+ <xsd:element minOccurs="0" name="shopperName" nillable="true" type="ns1:Name"/>
319
+ <xsd:element minOccurs="0" name="shopperReference" nillable="true" type="xsd:string"/>
320
+ <xsd:element minOccurs="0" name="shopperStatement" nillable="true" type="xsd:string"/>
321
+ <xsd:element minOccurs="0" name="socialSecurityNumber" nillable="true" type="xsd:string"/>
322
+ <xsd:element minOccurs="0" name="telephoneNumber" nillable="true" type="xsd:string"/>
323
+ </xsd:sequence>
324
+ </xsd:complexType>
325
+ <xsd:complexType name="PaymentResult">
326
+ <xsd:sequence>
327
+ <xsd:element minOccurs="0" name="additionalData" nillable="true" type="tns:anyType2anyTypeMap"/>
328
+ <xsd:element minOccurs="0" name="authCode" nillable="true" type="xsd:string"/>
329
+ <xsd:element minOccurs="0" name="dccAmount" nillable="true" type="ns1:Amount"/>
330
+ <xsd:element minOccurs="0" name="dccSignature" nillable="true" type="xsd:string"/>
331
+ <xsd:element minOccurs="0" name="fraudResult" nillable="true" type="tns:FraudResult"/>
332
+ <xsd:element minOccurs="0" name="issuerUrl" nillable="true" type="xsd:string"/>
333
+ <xsd:element minOccurs="0" name="md" nillable="true" type="xsd:string"/>
334
+ <xsd:element minOccurs="0" name="paRequest" nillable="true" type="xsd:string"/>
335
+ <xsd:element minOccurs="0" name="pspReference" nillable="true" type="xsd:string"/>
336
+ <xsd:element minOccurs="0" name="refusalReason" nillable="true" type="xsd:string"/>
337
+ <xsd:element minOccurs="0" name="resultCode" nillable="true" type="xsd:string"/>
338
+ </xsd:sequence>
339
+ </xsd:complexType>
340
+ <xsd:complexType name="Recurring">
341
+ <xsd:sequence>
342
+ <xsd:element minOccurs="0" name="contract" nillable="true" type="xsd:string"/>
343
+ <xsd:element minOccurs="0" name="recurringDetailName" nillable="true" type="xsd:string"/>
344
+ </xsd:sequence>
345
+ </xsd:complexType>
346
+ <xsd:complexType name="ThreeDSecureData">
347
+ <xsd:sequence>
348
+ <xsd:element minOccurs="0" name="authenticationResponse" nillable="true" type="xsd:string"/>
349
+ <xsd:element minOccurs="0" name="cavv" nillable="true" type="xsd:base64Binary"/>
350
+ <xsd:element minOccurs="0" name="cavvAlgorithm" nillable="true" type="xsd:string"/>
351
+ <xsd:element minOccurs="0" name="directoryResponse" nillable="true" type="xsd:string"/>
352
+ <xsd:element minOccurs="0" name="eci" nillable="true" type="xsd:string"/>
353
+ <xsd:element minOccurs="0" name="xid" nillable="true" type="xsd:base64Binary"/>
354
+ </xsd:sequence>
355
+ </xsd:complexType>
356
+ <xsd:complexType name="ArrayOfFraudCheckResult">
357
+ <xsd:sequence>
358
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="FraudCheckResult" nillable="true" type="tns:FraudCheckResult"/>
359
+ </xsd:sequence>
360
+ </xsd:complexType>
361
+ <xsd:complexType name="anyType2anyTypeMap">
362
+ <xsd:sequence>
363
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="entry">
364
+ <xsd:complexType>
365
+ <xsd:sequence>
366
+ <xsd:element maxOccurs="1" minOccurs="0" name="key" type="xsd:anyType"/>
367
+ <xsd:element maxOccurs="1" minOccurs="0" name="value" type="xsd:anyType"/>
368
+ </xsd:sequence>
369
+ </xsd:complexType>
370
+ </xsd:element>
371
+ </xsd:sequence>
372
+ </xsd:complexType>
373
+ <xsd:element name="ServiceException" type="ns1:ServiceException"/>
374
+ <xsd:element name="authorise">
375
+ <xsd:complexType>
376
+ <xsd:sequence>
377
+ <xsd:element maxOccurs="1" minOccurs="1" name="paymentRequest" nillable="true" type="tns:PaymentRequest"/>
378
+ </xsd:sequence>
379
+ </xsd:complexType>
380
+ </xsd:element>
381
+ <xsd:element name="authorise3d">
382
+ <xsd:complexType>
383
+ <xsd:sequence>
384
+ <xsd:element maxOccurs="1" minOccurs="1" name="paymentRequest3d" nillable="true" type="tns:PaymentRequest3d"/>
385
+ </xsd:sequence>
386
+ </xsd:complexType>
387
+ </xsd:element>
388
+ <xsd:element name="authorise3dResponse">
389
+ <xsd:complexType>
390
+ <xsd:sequence>
391
+ <xsd:element maxOccurs="1" minOccurs="1" name="paymentResult" nillable="true" type="tns:PaymentResult"/>
392
+ </xsd:sequence>
393
+ </xsd:complexType>
394
+ </xsd:element>
395
+ <xsd:element name="authoriseReferral">
396
+ <xsd:complexType>
397
+ <xsd:sequence>
398
+ <xsd:element maxOccurs="1" minOccurs="1" name="modificationRequest" nillable="true" type="tns:ModificationRequest"/>
399
+ </xsd:sequence>
400
+ </xsd:complexType>
401
+ </xsd:element>
402
+ <xsd:element name="authoriseReferralResponse">
403
+ <xsd:complexType>
404
+ <xsd:sequence>
405
+ <xsd:element maxOccurs="1" minOccurs="1" name="authoriseReferralResult" nillable="true" type="tns:ModificationResult"/>
406
+ </xsd:sequence>
407
+ </xsd:complexType>
408
+ </xsd:element>
409
+ <xsd:element name="authoriseResponse">
410
+ <xsd:complexType>
411
+ <xsd:sequence>
412
+ <xsd:element maxOccurs="1" minOccurs="1" name="paymentResult" nillable="true" type="tns:PaymentResult"/>
413
+ </xsd:sequence>
414
+ </xsd:complexType>
415
+ </xsd:element>
416
+ <xsd:element name="balanceCheck">
417
+ <xsd:complexType>
418
+ <xsd:sequence>
419
+ <xsd:element maxOccurs="1" minOccurs="1" name="request" nillable="true" type="tns:BalanceCheckRequest"/>
420
+ </xsd:sequence>
421
+ </xsd:complexType>
422
+ </xsd:element>
423
+ <xsd:element name="balanceCheckResponse">
424
+ <xsd:complexType>
425
+ <xsd:sequence>
426
+ <xsd:element maxOccurs="1" minOccurs="1" name="response" nillable="true" type="tns:BalanceCheckResult"/>
427
+ </xsd:sequence>
428
+ </xsd:complexType>
429
+ </xsd:element>
430
+ <xsd:element name="cancel">
431
+ <xsd:complexType>
432
+ <xsd:sequence>
433
+ <xsd:element maxOccurs="1" minOccurs="1" name="modificationRequest" nillable="true" type="tns:ModificationRequest"/>
434
+ </xsd:sequence>
435
+ </xsd:complexType>
436
+ </xsd:element>
437
+ <xsd:element name="cancelOrRefund">
438
+ <xsd:complexType>
439
+ <xsd:sequence>
440
+ <xsd:element maxOccurs="1" minOccurs="1" name="modificationRequest" nillable="true" type="tns:ModificationRequest"/>
441
+ </xsd:sequence>
442
+ </xsd:complexType>
443
+ </xsd:element>
444
+ <xsd:element name="cancelOrRefundResponse">
445
+ <xsd:complexType>
446
+ <xsd:sequence>
447
+ <xsd:element maxOccurs="1" minOccurs="1" name="cancelOrRefundResult" nillable="true" type="tns:ModificationResult"/>
448
+ </xsd:sequence>
449
+ </xsd:complexType>
450
+ </xsd:element>
451
+ <xsd:element name="cancelResponse">
452
+ <xsd:complexType>
453
+ <xsd:sequence>
454
+ <xsd:element maxOccurs="1" minOccurs="1" name="cancelResult" nillable="true" type="tns:ModificationResult"/>
455
+ </xsd:sequence>
456
+ </xsd:complexType>
457
+ </xsd:element>
458
+ <xsd:element name="capture">
459
+ <xsd:complexType>
460
+ <xsd:sequence>
461
+ <xsd:element maxOccurs="1" minOccurs="1" name="modificationRequest" nillable="true" type="tns:ModificationRequest"/>
462
+ </xsd:sequence>
463
+ </xsd:complexType>
464
+ </xsd:element>
465
+ <xsd:element name="captureResponse">
466
+ <xsd:complexType>
467
+ <xsd:sequence>
468
+ <xsd:element maxOccurs="1" minOccurs="1" name="captureResult" nillable="true" type="tns:ModificationResult"/>
469
+ </xsd:sequence>
470
+ </xsd:complexType>
471
+ </xsd:element>
472
+ <xsd:element name="checkFraud">
473
+ <xsd:complexType>
474
+ <xsd:sequence>
475
+ <xsd:element maxOccurs="1" minOccurs="1" name="paymentRequest" nillable="true" type="tns:PaymentRequest"/>
476
+ </xsd:sequence>
477
+ </xsd:complexType>
478
+ </xsd:element>
479
+ <xsd:element name="checkFraudResponse">
480
+ <xsd:complexType>
481
+ <xsd:sequence>
482
+ <xsd:element maxOccurs="1" minOccurs="1" name="paymentResult" nillable="true" type="tns:PaymentResult"/>
483
+ </xsd:sequence>
484
+ </xsd:complexType>
485
+ </xsd:element>
486
+ <xsd:element name="directdebit">
487
+ <xsd:complexType>
488
+ <xsd:sequence>
489
+ <xsd:element maxOccurs="1" minOccurs="1" name="request" nillable="true" type="tns:DirectDebitRequest"/>
490
+ </xsd:sequence>
491
+ </xsd:complexType>
492
+ </xsd:element>
493
+ <xsd:element name="directdebitResponse">
494
+ <xsd:complexType>
495
+ <xsd:sequence>
496
+ <xsd:element maxOccurs="1" minOccurs="1" name="response" nillable="true" type="tns:DirectDebitResponse"/>
497
+ </xsd:sequence>
498
+ </xsd:complexType>
499
+ </xsd:element>
500
+ <xsd:element name="fundTransfer">
501
+ <xsd:complexType>
502
+ <xsd:sequence>
503
+ <xsd:element maxOccurs="1" minOccurs="1" name="request" nillable="true" type="tns:FundTransferRequest"/>
504
+ </xsd:sequence>
505
+ </xsd:complexType>
506
+ </xsd:element>
507
+ <xsd:element name="fundTransferResponse">
508
+ <xsd:complexType>
509
+ <xsd:sequence>
510
+ <xsd:element maxOccurs="1" minOccurs="1" name="result" nillable="true" type="tns:FundTransferResult"/>
511
+ </xsd:sequence>
512
+ </xsd:complexType>
513
+ </xsd:element>
514
+ <xsd:element name="refund">
515
+ <xsd:complexType>
516
+ <xsd:sequence>
517
+ <xsd:element maxOccurs="1" minOccurs="1" name="modificationRequest" nillable="true" type="tns:ModificationRequest"/>
518
+ </xsd:sequence>
519
+ </xsd:complexType>
520
+ </xsd:element>
521
+ <xsd:element name="refundResponse">
522
+ <xsd:complexType>
523
+ <xsd:sequence>
524
+ <xsd:element maxOccurs="1" minOccurs="1" name="refundResult" nillable="true" type="tns:ModificationResult"/>
525
+ </xsd:sequence>
526
+ </xsd:complexType>
527
+ </xsd:element>
528
+ <xsd:element name="refundWithData">
529
+ <xsd:complexType>
530
+ <xsd:sequence>
531
+ <xsd:element maxOccurs="1" minOccurs="1" name="request" nillable="true" type="tns:PaymentRequest"/>
532
+ </xsd:sequence>
533
+ </xsd:complexType>
534
+ </xsd:element>
535
+ <xsd:element name="refundWithDataResponse">
536
+ <xsd:complexType>
537
+ <xsd:sequence>
538
+ <xsd:element maxOccurs="1" minOccurs="1" name="result" nillable="true" type="tns:PaymentResult"/>
539
+ </xsd:sequence>
540
+ </xsd:complexType>
541
+ </xsd:element>
542
+ </xsd:schema>
543
+ <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://common.services.adyen.com">
544
+ <xsd:complexType name="Address">
545
+ <xsd:sequence>
546
+ <xsd:element minOccurs="0" name="city" nillable="true" type="xsd:string"/>
547
+ <xsd:element minOccurs="0" name="country" nillable="true" type="xsd:string"/>
548
+ <xsd:element minOccurs="0" name="houseNumberOrName" nillable="true" type="xsd:string"/>
549
+ <xsd:element minOccurs="0" name="postalCode" nillable="true" type="xsd:string"/>
550
+ <xsd:element minOccurs="0" name="stateOrProvince" nillable="true" type="xsd:string"/>
551
+ <xsd:element minOccurs="0" name="street" nillable="true" type="xsd:string"/>
552
+ </xsd:sequence>
553
+ </xsd:complexType>
554
+ <xsd:complexType name="Amount">
555
+ <xsd:sequence>
556
+ <xsd:element minOccurs="1" name="currency">
557
+ <xsd:simpleType>
558
+ <xsd:restriction base="xsd:string">
559
+ <xsd:minLength value="3"/>
560
+ <xsd:maxLength value="3"/>
561
+ </xsd:restriction>
562
+ </xsd:simpleType>
563
+ </xsd:element>
564
+ <xsd:element minOccurs="1" name="value" type="xsd:long"/>
565
+ </xsd:sequence>
566
+ </xsd:complexType>
567
+ <xsd:complexType name="BrowserInfo">
568
+ <xsd:sequence>
569
+ <xsd:element minOccurs="1" name="acceptHeader">
570
+ <xsd:simpleType>
571
+ <xsd:restriction base="xsd:string">
572
+ <xsd:minLength value="10"/>
573
+ <xsd:maxLength value="50"/>
574
+ </xsd:restriction>
575
+ </xsd:simpleType>
576
+ </xsd:element>
577
+ <xsd:element minOccurs="1" name="userAgent">
578
+ <xsd:simpleType>
579
+ <xsd:restriction base="xsd:string">
580
+ <xsd:minLength value="10"/>
581
+ <xsd:maxLength value="50"/>
582
+ </xsd:restriction>
583
+ </xsd:simpleType>
584
+ </xsd:element>
585
+ </xsd:sequence>
586
+ </xsd:complexType>
587
+ <xsd:complexType name="Installments">
588
+ <xsd:sequence>
589
+ <xsd:element minOccurs="0" name="value" type="xsd:short"/>
590
+ </xsd:sequence>
591
+ </xsd:complexType>
592
+ <xsd:complexType name="Name">
593
+ <xsd:sequence>
594
+ <xsd:element minOccurs="0" name="firstName" nillable="true" type="xsd:string"/>
595
+ <xsd:element minOccurs="0" name="gender" nillable="true" type="ns1:Gender"/>
596
+ <xsd:element minOccurs="0" name="infix" nillable="true" type="xsd:string"/>
597
+ <xsd:element minOccurs="0" name="lastName" nillable="true" type="xsd:string"/>
598
+ </xsd:sequence>
599
+ </xsd:complexType>
600
+ <xsd:simpleType name="Gender">
601
+ <xsd:restriction base="xsd:string">
602
+ <xsd:enumeration value="MALE"/>
603
+ <xsd:enumeration value="FEMALE"/>
604
+ <xsd:enumeration value="UNKNOWN"/>
605
+ </xsd:restriction>
606
+ </xsd:simpleType>
607
+ <xsd:complexType name="ServiceException">
608
+ <xsd:sequence>
609
+ <xsd:element minOccurs="0" name="error" nillable="true" type="ns1:Error"/>
610
+ <xsd:element minOccurs="0" name="type" nillable="true" type="ns1:Type"/>
611
+ </xsd:sequence>
612
+ </xsd:complexType>
613
+ <xsd:simpleType name="Error">
614
+ <xsd:restriction base="xsd:string">
615
+ <xsd:enumeration value="Unknown"/>
616
+ <xsd:enumeration value="NotAllowed"/>
617
+ <xsd:enumeration value="NoAmountSpecified"/>
618
+ <xsd:enumeration value="UnableToDetermineVariant"/>
619
+ <xsd:enumeration value="InvalidMerchantAccount"/>
620
+ <xsd:enumeration value="RequestMissing"/>
621
+ <xsd:enumeration value="InternalError"/>
622
+ <xsd:enumeration value="UnableToProcess"/>
623
+ <xsd:enumeration value="PaymentDetailsAreNotSupported"/>
624
+ </xsd:restriction>
625
+ </xsd:simpleType>
626
+ <xsd:simpleType name="Type">
627
+ <xsd:restriction base="xsd:string">
628
+ <xsd:enumeration value="internal"/>
629
+ <xsd:enumeration value="validation"/>
630
+ <xsd:enumeration value="security"/>
631
+ <xsd:enumeration value="configuration"/>
632
+ </xsd:restriction>
633
+ </xsd:simpleType>
634
+ </xsd:schema>
635
+ </wsdl:types>
636
+ <wsdl:message name="ServiceException">
637
+ <wsdl:part name="ServiceException" element="tns:ServiceException"/>
638
+ </wsdl:message>
639
+ <wsdl:message name="authorise3dRequest">
640
+ <wsdl:part name="parameters" element="tns:authorise3d"/>
641
+ </wsdl:message>
642
+ <wsdl:message name="authorise3dResponse">
643
+ <wsdl:part name="parameters" element="tns:authorise3dResponse"/>
644
+ </wsdl:message>
645
+ <wsdl:message name="authoriseReferralRequest">
646
+ <wsdl:part name="parameters" element="tns:authoriseReferral"/>
647
+ </wsdl:message>
648
+ <wsdl:message name="authoriseReferralResponse">
649
+ <wsdl:part name="parameters" element="tns:authoriseReferralResponse"/>
650
+ </wsdl:message>
651
+ <wsdl:message name="authoriseRequest">
652
+ <wsdl:part name="parameters" element="tns:authorise"/>
653
+ </wsdl:message>
654
+ <wsdl:message name="authoriseResponse">
655
+ <wsdl:part name="parameters" element="tns:authoriseResponse"/>
656
+ </wsdl:message>
657
+ <wsdl:message name="balanceCheckRequest">
658
+ <wsdl:part name="parameters" element="tns:balanceCheck"/>
659
+ </wsdl:message>
660
+ <wsdl:message name="balanceCheckResponse">
661
+ <wsdl:part name="parameters" element="tns:balanceCheckResponse"/>
662
+ </wsdl:message>
663
+ <wsdl:message name="cancelOrRefundRequest">
664
+ <wsdl:part name="parameters" element="tns:cancelOrRefund"/>
665
+ </wsdl:message>
666
+ <wsdl:message name="cancelOrRefundResponse">
667
+ <wsdl:part name="parameters" element="tns:cancelOrRefundResponse"/>
668
+ </wsdl:message>
669
+ <wsdl:message name="cancelRequest">
670
+ <wsdl:part name="parameters" element="tns:cancel"/>
671
+ </wsdl:message>
672
+ <wsdl:message name="cancelResponse">
673
+ <wsdl:part name="parameters" element="tns:cancelResponse"/>
674
+ </wsdl:message>
675
+ <wsdl:message name="captureRequest">
676
+ <wsdl:part name="parameters" element="tns:capture"/>
677
+ </wsdl:message>
678
+ <wsdl:message name="captureResponse">
679
+ <wsdl:part name="parameters" element="tns:captureResponse"/>
680
+ </wsdl:message>
681
+ <wsdl:message name="checkFraudRequest">
682
+ <wsdl:part name="parameters" element="tns:checkFraud"/>
683
+ </wsdl:message>
684
+ <wsdl:message name="checkFraudResponse">
685
+ <wsdl:part name="parameters" element="tns:checkFraudResponse"/>
686
+ </wsdl:message>
687
+ <wsdl:message name="directdebitRequest">
688
+ <wsdl:part name="parameters" element="tns:directdebit"/>
689
+ </wsdl:message>
690
+ <wsdl:message name="directdebitResponse">
691
+ <wsdl:part name="parameters" element="tns:directdebitResponse"/>
692
+ </wsdl:message>
693
+ <wsdl:message name="fundTransferRequest">
694
+ <wsdl:part name="parameters" element="tns:fundTransfer"/>
695
+ </wsdl:message>
696
+ <wsdl:message name="fundTransferResponse">
697
+ <wsdl:part name="parameters" element="tns:fundTransferResponse"/>
698
+ </wsdl:message>
699
+ <wsdl:message name="refundRequest">
700
+ <wsdl:part name="parameters" element="tns:refund"/>
701
+ </wsdl:message>
702
+ <wsdl:message name="refundResponse">
703
+ <wsdl:part name="parameters" element="tns:refundResponse"/>
704
+ </wsdl:message>
705
+ <wsdl:message name="refundWithDataRequest">
706
+ <wsdl:part name="parameters" element="tns:refundWithData"/>
707
+ </wsdl:message>
708
+ <wsdl:message name="refundWithDataResponse">
709
+ <wsdl:part name="parameters" element="tns:refundWithDataResponse"/>
710
+ </wsdl:message>
711
+ <wsdl:portType name="PaymentPortType">
712
+ <wsdl:operation name="authorise">
713
+ <wsdl:input name="authoriseRequest" message="tns:authoriseRequest"/>
714
+ <wsdl:output name="authoriseResponse" message="tns:authoriseResponse"/>
715
+ <wsdl:fault name="ServiceException" message="tns:ServiceException"/>
716
+ </wsdl:operation>
717
+ <wsdl:operation name="authorise3d">
718
+ <wsdl:input name="authorise3dRequest" message="tns:authorise3dRequest"/>
719
+ <wsdl:output name="authorise3dResponse" message="tns:authorise3dResponse"/>
720
+ <wsdl:fault name="ServiceException" message="tns:ServiceException"/>
721
+ </wsdl:operation>
722
+ <wsdl:operation name="authoriseReferral">
723
+ <wsdl:input name="authoriseReferralRequest" message="tns:authoriseReferralRequest"/>
724
+ <wsdl:output name="authoriseReferralResponse" message="tns:authoriseReferralResponse"/>
725
+ <wsdl:fault name="ServiceException" message="tns:ServiceException"/>
726
+ </wsdl:operation>
727
+ <wsdl:operation name="balanceCheck">
728
+ <wsdl:input name="balanceCheckRequest" message="tns:balanceCheckRequest"/>
729
+ <wsdl:output name="balanceCheckResponse" message="tns:balanceCheckResponse"/>
730
+ <wsdl:fault name="ServiceException" message="tns:ServiceException"/>
731
+ </wsdl:operation>
732
+ <wsdl:operation name="cancel">
733
+ <wsdl:input name="cancelRequest" message="tns:cancelRequest"/>
734
+ <wsdl:output name="cancelResponse" message="tns:cancelResponse"/>
735
+ <wsdl:fault name="ServiceException" message="tns:ServiceException"/>
736
+ </wsdl:operation>
737
+ <wsdl:operation name="cancelOrRefund">
738
+ <wsdl:input name="cancelOrRefundRequest" message="tns:cancelOrRefundRequest"/>
739
+ <wsdl:output name="cancelOrRefundResponse" message="tns:cancelOrRefundResponse"/>
740
+ <wsdl:fault name="ServiceException" message="tns:ServiceException"/>
741
+ </wsdl:operation>
742
+ <wsdl:operation name="capture">
743
+ <wsdl:input name="captureRequest" message="tns:captureRequest"/>
744
+ <wsdl:output name="captureResponse" message="tns:captureResponse"/>
745
+ <wsdl:fault name="ServiceException" message="tns:ServiceException"/>
746
+ </wsdl:operation>
747
+ <wsdl:operation name="checkFraud">
748
+ <wsdl:input name="checkFraudRequest" message="tns:checkFraudRequest"/>
749
+ <wsdl:output name="checkFraudResponse" message="tns:checkFraudResponse"/>
750
+ <wsdl:fault name="ServiceException" message="tns:ServiceException"/>
751
+ </wsdl:operation>
752
+ <wsdl:operation name="directdebit">
753
+ <wsdl:input name="directdebitRequest" message="tns:directdebitRequest"/>
754
+ <wsdl:output name="directdebitResponse" message="tns:directdebitResponse"/>
755
+ <wsdl:fault name="ServiceException" message="tns:ServiceException"/>
756
+ </wsdl:operation>
757
+ <wsdl:operation name="fundTransfer">
758
+ <wsdl:input name="fundTransferRequest" message="tns:fundTransferRequest"/>
759
+ <wsdl:output name="fundTransferResponse" message="tns:fundTransferResponse"/>
760
+ <wsdl:fault name="ServiceException" message="tns:ServiceException"/>
761
+ </wsdl:operation>
762
+ <wsdl:operation name="refund">
763
+ <wsdl:input name="refundRequest" message="tns:refundRequest"/>
764
+ <wsdl:output name="refundResponse" message="tns:refundResponse"/>
765
+ <wsdl:fault name="ServiceException" message="tns:ServiceException"/>
766
+ </wsdl:operation>
767
+ <wsdl:operation name="refundWithData">
768
+ <wsdl:input name="refundWithDataRequest" message="tns:refundWithDataRequest"/>
769
+ <wsdl:output name="refundWithDataResponse" message="tns:refundWithDataResponse"/>
770
+ <wsdl:fault name="ServiceException" message="tns:ServiceException"/>
771
+ </wsdl:operation>
772
+ </wsdl:portType>
773
+ <wsdl:binding name="PaymentHttpBinding" type="tns:PaymentPortType">
774
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
775
+ <wsdl:operation name="authorise">
776
+ <wsdlsoap:operation soapAction=""/>
777
+ <wsdl:input name="authoriseRequest">
778
+ <wsdlsoap:body use="literal"/>
779
+ </wsdl:input>
780
+ <wsdl:output name="authoriseResponse">
781
+ <wsdlsoap:body use="literal"/>
782
+ </wsdl:output>
783
+ <wsdl:fault name="ServiceException">
784
+ <wsdlsoap:fault name="ServiceException" use="literal"/>
785
+ </wsdl:fault>
786
+ </wsdl:operation>
787
+ <wsdl:operation name="authorise3d">
788
+ <wsdlsoap:operation soapAction=""/>
789
+ <wsdl:input name="authorise3dRequest">
790
+ <wsdlsoap:body use="literal"/>
791
+ </wsdl:input>
792
+ <wsdl:output name="authorise3dResponse">
793
+ <wsdlsoap:body use="literal"/>
794
+ </wsdl:output>
795
+ <wsdl:fault name="ServiceException">
796
+ <wsdlsoap:fault name="ServiceException" use="literal"/>
797
+ </wsdl:fault>
798
+ </wsdl:operation>
799
+ <wsdl:operation name="authoriseReferral">
800
+ <wsdlsoap:operation soapAction=""/>
801
+ <wsdl:input name="authoriseReferralRequest">
802
+ <wsdlsoap:body use="literal"/>
803
+ </wsdl:input>
804
+ <wsdl:output name="authoriseReferralResponse">
805
+ <wsdlsoap:body use="literal"/>
806
+ </wsdl:output>
807
+ <wsdl:fault name="ServiceException">
808
+ <wsdlsoap:fault name="ServiceException" use="literal"/>
809
+ </wsdl:fault>
810
+ </wsdl:operation>
811
+ <wsdl:operation name="balanceCheck">
812
+ <wsdlsoap:operation soapAction=""/>
813
+ <wsdl:input name="balanceCheckRequest">
814
+ <wsdlsoap:body use="literal"/>
815
+ </wsdl:input>
816
+ <wsdl:output name="balanceCheckResponse">
817
+ <wsdlsoap:body use="literal"/>
818
+ </wsdl:output>
819
+ <wsdl:fault name="ServiceException">
820
+ <wsdlsoap:fault name="ServiceException" use="literal"/>
821
+ </wsdl:fault>
822
+ </wsdl:operation>
823
+ <wsdl:operation name="cancel">
824
+ <wsdlsoap:operation soapAction=""/>
825
+ <wsdl:input name="cancelRequest">
826
+ <wsdlsoap:body use="literal"/>
827
+ </wsdl:input>
828
+ <wsdl:output name="cancelResponse">
829
+ <wsdlsoap:body use="literal"/>
830
+ </wsdl:output>
831
+ <wsdl:fault name="ServiceException">
832
+ <wsdlsoap:fault name="ServiceException" use="literal"/>
833
+ </wsdl:fault>
834
+ </wsdl:operation>
835
+ <wsdl:operation name="cancelOrRefund">
836
+ <wsdlsoap:operation soapAction=""/>
837
+ <wsdl:input name="cancelOrRefundRequest">
838
+ <wsdlsoap:body use="literal"/>
839
+ </wsdl:input>
840
+ <wsdl:output name="cancelOrRefundResponse">
841
+ <wsdlsoap:body use="literal"/>
842
+ </wsdl:output>
843
+ <wsdl:fault name="ServiceException">
844
+ <wsdlsoap:fault name="ServiceException" use="literal"/>
845
+ </wsdl:fault>
846
+ </wsdl:operation>
847
+ <wsdl:operation name="capture">
848
+ <wsdlsoap:operation soapAction=""/>
849
+ <wsdl:input name="captureRequest">
850
+ <wsdlsoap:body use="literal"/>
851
+ </wsdl:input>
852
+ <wsdl:output name="captureResponse">
853
+ <wsdlsoap:body use="literal"/>
854
+ </wsdl:output>
855
+ <wsdl:fault name="ServiceException">
856
+ <wsdlsoap:fault name="ServiceException" use="literal"/>
857
+ </wsdl:fault>
858
+ </wsdl:operation>
859
+ <wsdl:operation name="checkFraud">
860
+ <wsdlsoap:operation soapAction=""/>
861
+ <wsdl:input name="checkFraudRequest">
862
+ <wsdlsoap:body use="literal"/>
863
+ </wsdl:input>
864
+ <wsdl:output name="checkFraudResponse">
865
+ <wsdlsoap:body use="literal"/>
866
+ </wsdl:output>
867
+ <wsdl:fault name="ServiceException">
868
+ <wsdlsoap:fault name="ServiceException" use="literal"/>
869
+ </wsdl:fault>
870
+ </wsdl:operation>
871
+ <wsdl:operation name="directdebit">
872
+ <wsdlsoap:operation soapAction=""/>
873
+ <wsdl:input name="directdebitRequest">
874
+ <wsdlsoap:body use="literal"/>
875
+ </wsdl:input>
876
+ <wsdl:output name="directdebitResponse">
877
+ <wsdlsoap:body use="literal"/>
878
+ </wsdl:output>
879
+ <wsdl:fault name="ServiceException">
880
+ <wsdlsoap:fault name="ServiceException" use="literal"/>
881
+ </wsdl:fault>
882
+ </wsdl:operation>
883
+ <wsdl:operation name="fundTransfer">
884
+ <wsdlsoap:operation soapAction=""/>
885
+ <wsdl:input name="fundTransferRequest">
886
+ <wsdlsoap:body use="literal"/>
887
+ </wsdl:input>
888
+ <wsdl:output name="fundTransferResponse">
889
+ <wsdlsoap:body use="literal"/>
890
+ </wsdl:output>
891
+ <wsdl:fault name="ServiceException">
892
+ <wsdlsoap:fault name="ServiceException" use="literal"/>
893
+ </wsdl:fault>
894
+ </wsdl:operation>
895
+ <wsdl:operation name="refund">
896
+ <wsdlsoap:operation soapAction=""/>
897
+ <wsdl:input name="refundRequest">
898
+ <wsdlsoap:body use="literal"/>
899
+ </wsdl:input>
900
+ <wsdl:output name="refundResponse">
901
+ <wsdlsoap:body use="literal"/>
902
+ </wsdl:output>
903
+ <wsdl:fault name="ServiceException">
904
+ <wsdlsoap:fault name="ServiceException" use="literal"/>
905
+ </wsdl:fault>
906
+ </wsdl:operation>
907
+ <wsdl:operation name="refundWithData">
908
+ <wsdlsoap:operation soapAction=""/>
909
+ <wsdl:input name="refundWithDataRequest">
910
+ <wsdlsoap:body use="literal"/>
911
+ </wsdl:input>
912
+ <wsdl:output name="refundWithDataResponse">
913
+ <wsdlsoap:body use="literal"/>
914
+ </wsdl:output>
915
+ <wsdl:fault name="ServiceException">
916
+ <wsdlsoap:fault name="ServiceException" use="literal"/>
917
+ </wsdl:fault>
918
+ </wsdl:operation>
919
+ </wsdl:binding>
920
+ <wsdl:service name="Payment">
921
+ <wsdl:port name="PaymentHttpPort" binding="tns:PaymentHttpBinding">
922
+ <wsdlsoap:address location="https://pal-test.adyen.com/pal/servlet/Payment/V100"/>
923
+ </wsdl:port>
924
+ </wsdl:service>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
925
  </wsdl:definitions>
app/code/community/Adyen/Payment/etc/config.xml CHANGED
@@ -29,7 +29,7 @@
29
  <config>
30
  <modules>
31
  <Adyen_Payment>
32
- <version>2.0.2</version>
33
  </Adyen_Payment>
34
  </modules>
35
  <global>
@@ -80,14 +80,81 @@
80
  <adyen>
81
  <class>Adyen_Payment_Block</class>
82
  </adyen>
 
 
 
 
 
 
 
 
 
 
 
 
83
  </blocks>
84
  <payment>
85
  <groups>
86
  <adyen>Adyen</adyen>
87
  </groups>
88
- </payment>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  </global>
90
-
91
  <frontend>
92
  <secure_url>
93
  <adyen_process>/adyen/process</adyen_process>
@@ -118,7 +185,7 @@
118
  </updates>
119
  </layout>
120
  </frontend>
121
-
122
  <adminhtml>
123
  <layout>
124
  <updates>
@@ -145,14 +212,6 @@
145
  </adyen_manual_online_capture>
146
  </observers>
147
  </sales_order_invoice_pay>
148
- <sales_order_creditmemo_refund>
149
- <observers>
150
- <adyen_online_refund>
151
- <class>adyen/observer</class>
152
- <method>refund</method>
153
- </adyen_online_refund>
154
- </observers>
155
- </sales_order_creditmemo_refund>
156
  </events>
157
  </adminhtml>
158
  <default>
@@ -173,9 +232,9 @@
173
  <payment_pending>pending</payment_pending>
174
  <payment_authorized>processing</payment_authorized>
175
  <capture_mode>auto</capture_mode>
176
- <recurringtypes>ONECLICK</recurringtypes>
177
  </adyen_abstract>
178
- <adyen_hpp>
179
  <customer_id backend_model="adminhtml/system_config_backend_encrypted"/>
180
  <currency>EUR</currency>
181
  <model>adyen/adyen_hpp</model>
@@ -192,14 +251,19 @@
192
  <payment_authorized>processing</payment_authorized>
193
  <allowspecific>0</allowspecific>
194
  <disable_hpptypes>0</disable_hpptypes>
 
 
 
195
  </adyen_hpp>
196
- <adyen_pos>
197
- <active>0</active>
198
- <model>adyen/adyen_pos</model>
199
- <title>Adyen POS</title>
200
- <recurringtypes>ONECLICK</recurringtypes>
201
- <comment>sdf</comment>
202
- <allowspecific>0</allowspecific>
 
 
203
  </adyen_pos>
204
  <adyen_openinvoice translate="title" module="adyen">
205
  <active>0</active>
@@ -208,7 +272,10 @@
208
  <order_status>pending</order_status>
209
  <title>Adyen Open Invoice</title>
210
  <openinvoicetypes>openinvoice</openinvoicetypes>
211
- </adyen_openinvoice>
 
 
 
212
  <adyen_cc translate="title" module="adyen">
213
  <active>0</active>
214
  <model>adyen/adyen_cc</model>
@@ -219,28 +286,49 @@
219
  <enable_installments>0</enable_installments>
220
  <cse_enabled>0</cse_enabled>
221
  <cse_public_key></cse_public_key>
 
222
  <account_id>99999</account_id>
223
  <trxuser_id>99999</trxuser_id>
224
  <trxuser_password>0</trxuser_password>
225
  <adminaction_password>5cfgRT34xsdedtFLdfHxj7tfwx24fe</adminaction_password>
226
  <wsdl>https://pal-test.adyen.com/pal/Payment.wsdl</wsdl>
 
227
  </adyen_cc>
 
 
 
 
 
 
 
 
228
  <adyen_elv translate="title" module="adyen">
229
  <active>0</active>
230
  <model>adyen/adyen_elv</model>
231
  <group>adyen</group>
232
  <order_status>processing</order_status>
233
  <title>Adyen ELV</title>
234
- </adyen_elv>
 
235
  <adyen_boleto translate="title" module="adyen">
236
- <active>0</active>
237
  <model>adyen/adyen_boleto</model>
238
  <group>adyen</group>
239
  <order_status>processing</order_status>
240
  <title>Adyen Boleto</title>
241
  <delivery_days>5</delivery_days>
242
- </adyen_boleto>
243
- </payment>
 
 
 
 
 
 
 
 
 
 
244
  <adyen>
245
  <payment>
246
  <cctypes>
@@ -274,12 +362,6 @@
274
  <order>40</order>
275
  <is_cvv_required>1</is_cvv_required>
276
  </DC>
277
- <SS>
278
- <code>SS</code>
279
- <name>Switch/Solo</name>
280
- <order>50</order>
281
- <is_cvv_required>1</is_cvv_required>
282
- </SS>
283
  <MO>
284
  <code>MO</code>
285
  <name>Maestro</name>
@@ -300,12 +382,12 @@
300
  </CB>
301
  </cctypes>
302
  <boletotypes>
303
- <boletobancario_hsbc>
304
  <code>boletobancario_hsbc</code>
305
  <name>boletobancario_hsbc</name>
306
  <order>0</order>
307
  </boletobancario_hsbc>
308
- <boletobancario_itau>
309
  <code>boletobancario_itau</code>
310
  <name>boletobancario_itau</name>
311
  <order>0</order>
@@ -327,40 +409,46 @@
327
  </boletobancario_bancodobrasil>
328
  </boletotypes>
329
  <openinvoicetypes>
330
- <afterpay>
331
  <code>openinvoice</code>
332
  <name>AfterPay</name>
333
  <order>10</order>
334
  </afterpay>
335
- <klarna>
336
  <code>klarna</code>
337
  <name>Klarna</name>
338
  <order>20</order>
339
  </klarna>
340
  </openinvoicetypes>
341
  <recurringtypes>
342
- <none>
343
- <code></code>
344
- <name>NONE</name>
345
- <order>10</order>
346
- </none>
347
- <oneclick>
348
- <code>ONECLICK</code>
349
  <name>ONECLICK</name>
350
  <order>20</order>
351
- </oneclick>
352
- <recurring>
353
- <code>RECURRING</code>
354
  <name>RECURRING</name>
355
  <order>30</order>
356
- </recurring>
357
- <oneclickrecurring>
358
- <code>ONECLICK,RECURRING</code>
359
  <name>ONECLICK,RECURRING</name>
360
  <order>40</order>
361
- </oneclickrecurring>
362
  </recurringtypes>
363
- </payment>
364
- </adyen>
 
 
 
 
 
 
365
  </default>
366
  </config>
29
  <config>
30
  <modules>
31
  <Adyen_Payment>
32
+ <version>2.1.0</version>
33
  </Adyen_Payment>
34
  </modules>
35
  <global>
80
  <adyen>
81
  <class>Adyen_Payment_Block</class>
82
  </adyen>
83
+ <adminhtml>
84
+ <rewrite>
85
+ <sales_order_totals>Adyen_Payment_Block_Adminhtml_Sales_Order_Totals</sales_order_totals>
86
+ <sales_order_invoice_totals>Adyen_Payment_Block_Adminhtml_Sales_Order_Invoice_Totals</sales_order_invoice_totals>
87
+ <sales_order_creditmemo_totals>Adyen_Payment_Block_Adminhtml_Sales_Order_Creditmemo_Totals</sales_order_creditmemo_totals>
88
+ </rewrite>
89
+ </adminhtml>
90
+ <sales>
91
+ <rewrite>
92
+ <order_totals>Adyen_Payment_Block_Sales_Order_Totals</order_totals>
93
+ </rewrite>
94
+ </sales>
95
  </blocks>
96
  <payment>
97
  <groups>
98
  <adyen>Adyen</adyen>
99
  </groups>
100
+ </payment>
101
+ <fieldsets>
102
+ <sales_convert_quote_address>
103
+ <payment_fee_amount><to_order>*</to_order></payment_fee_amount>
104
+ <base_payment_fee_amount><to_order>*</to_order></base_payment_fee_amount>
105
+ <payment_installment_fee_amount><to_order>*</to_order></payment_installment_fee_amount>
106
+ <base_payment_installment_fee_amount><to_order>*</to_order></base_payment_installment_fee_amount>
107
+ </sales_convert_quote_address>
108
+ <sales_convert_order>
109
+ <payment_fee_amount><to_invoice>*</to_invoice></payment_fee_amount>
110
+ <base_payment_fee_amount><to_invoice>*</to_invoice></base_payment_fee_amount>
111
+ <payment_installment_fee_amount><to_invoice>*</to_invoice></payment_installment_fee_amount>
112
+ <base_payment_installment_fee_amount><to_invoice>*</to_invoice></base_payment_installment_fee_amount>
113
+ <payment_fee_amount><to_cm>*</to_cm></payment_fee_amount>
114
+ <base_payment_fee_amount><to_cm>*</to_cm></base_payment_fee_amount>
115
+ <payment_installment_fee_amount><to_invoice>*</to_invoice></payment_installment_fee_amount>
116
+ <base_payment_installment_fee_amount><to_invoice>*</to_invoice></base_payment_installment_fee_amount>
117
+ <payment_installment_fee_amount><to_cm>*</to_cm></payment_installment_fee_amount>
118
+ <base_payment_installment_fee_amount><to_cm>*</to_cm></base_payment_installment_fee_amount>
119
+ </sales_convert_order>
120
+ </fieldsets>
121
+ <sales>
122
+ <quote>
123
+ <totals>
124
+ <payment_fee>
125
+ <class>adyen/sales_quote_address_total_paymentFee</class>
126
+ <after>subtotal,discount</after>
127
+ <before>grand_total,tax</before>
128
+ </payment_fee>
129
+ <payment_installment_fee>
130
+ <class>adyen/sales_quote_address_total_paymentInstallmentFee</class>
131
+ <after>grand_total</after>
132
+ </payment_installment_fee>
133
+ </totals>
134
+ </quote>
135
+ <order_invoice>
136
+ <totals>
137
+ <payment_fee>
138
+ <class>adyen/total_paymentFee_invoice</class>
139
+ </payment_fee>
140
+ <payment_installment_fee>
141
+ <class>adyen/total_paymentInstallmentFee_invoice</class>
142
+ </payment_installment_fee>
143
+ </totals>
144
+ </order_invoice>
145
+ <order_creditmemo>
146
+ <totals>
147
+ <payment_fee>
148
+ <class>adyen/total_paymentFee_creditmemo</class>
149
+ </payment_fee>
150
+ <payment_installment_fee>
151
+ <class>adyen/total_paymentInstallmentFee_creditmemo</class>
152
+ </payment_installment_fee>
153
+ </totals>
154
+ </order_creditmemo>
155
+ </sales>
156
  </global>
157
+
158
  <frontend>
159
  <secure_url>
160
  <adyen_process>/adyen/process</adyen_process>
185
  </updates>
186
  </layout>
187
  </frontend>
188
+
189
  <adminhtml>
190
  <layout>
191
  <updates>
212
  </adyen_manual_online_capture>
213
  </observers>
214
  </sales_order_invoice_pay>
 
 
 
 
 
 
 
 
215
  </events>
216
  </adminhtml>
217
  <default>
232
  <payment_pending>pending</payment_pending>
233
  <payment_authorized>processing</payment_authorized>
234
  <capture_mode>auto</capture_mode>
235
+ <recurringtypes>ONECLICK</recurringtypes>
236
  </adyen_abstract>
237
+ <adyen_hpp translate="title" module="adyen">
238
  <customer_id backend_model="adminhtml/system_config_backend_encrypted"/>
239
  <currency>EUR</currency>
240
  <model>adyen/adyen_hpp</model>
251
  <payment_authorized>processing</payment_authorized>
252
  <allowspecific>0</allowspecific>
253
  <disable_hpptypes>0</disable_hpptypes>
254
+ <sort_order>30</sort_order>
255
+ <cache_directory_lookup>0</cache_directory_lookup>
256
+ <return_url_in_request>0</return_url_in_request>
257
  </adyen_hpp>
258
+ <adyen_pos translate="title" module="adyen">
259
+ <active>0</active>
260
+ <model>adyen/adyen_pos</model>
261
+ <title>Adyen POS</title>
262
+ <recurringtypes>ONECLICK</recurringtypes>
263
+ <enable_scanner>0</enable_scanner>
264
+ <express_checkout>0</express_checkout>
265
+ <allowspecific>0</allowspecific>
266
+ <sort_order>80</sort_order>
267
  </adyen_pos>
268
  <adyen_openinvoice translate="title" module="adyen">
269
  <active>0</active>
272
  <order_status>pending</order_status>
273
  <title>Adyen Open Invoice</title>
274
  <openinvoicetypes>openinvoice</openinvoicetypes>
275
+ <gender_show>0</gender_show>
276
+ <dob_show>0</dob_show>
277
+ <sort_order>40</sort_order>
278
+ </adyen_openinvoice>
279
  <adyen_cc translate="title" module="adyen">
280
  <active>0</active>
281
  <model>adyen/adyen_cc</model>
286
  <enable_installments>0</enable_installments>
287
  <cse_enabled>0</cse_enabled>
288
  <cse_public_key></cse_public_key>
289
+ <enable_moto>0</enable_moto>
290
  <account_id>99999</account_id>
291
  <trxuser_id>99999</trxuser_id>
292
  <trxuser_password>0</trxuser_password>
293
  <adminaction_password>5cfgRT34xsdedtFLdfHxj7tfwx24fe</adminaction_password>
294
  <wsdl>https://pal-test.adyen.com/pal/Payment.wsdl</wsdl>
295
+ <sort_order>20</sort_order>
296
  </adyen_cc>
297
+ <adyen_oneclick translate="title" module="adyen">
298
+ <active>0</active>
299
+ <model>adyen/adyen_oneclick</model>
300
+ <group>adyen</group>
301
+ <order_status>processing</order_status>
302
+ <title>Adyen OneClick</title>
303
+ <sort_order>1</sort_order>
304
+ </adyen_oneclick>
305
  <adyen_elv translate="title" module="adyen">
306
  <active>0</active>
307
  <model>adyen/adyen_elv</model>
308
  <group>adyen</group>
309
  <order_status>processing</order_status>
310
  <title>Adyen ELV</title>
311
+ <sort_order>50</sort_order>
312
+ </adyen_elv>
313
  <adyen_boleto translate="title" module="adyen">
314
+ <active>0</active>
315
  <model>adyen/adyen_boleto</model>
316
  <group>adyen</group>
317
  <order_status>processing</order_status>
318
  <title>Adyen Boleto</title>
319
  <delivery_days>5</delivery_days>
320
+ <sort_order>70</sort_order>
321
+ </adyen_boleto>
322
+ <adyen_sepa translate="title" module="adyen">
323
+ <active>0</active>
324
+ <model>adyen/adyen_sepa</model>
325
+ <group>adyen</group>
326
+ <order_status>processing</order_status>
327
+ <title>Adyen SEPA</title>
328
+ <sort_order>60</sort_order>
329
+ <validate_iban>0</validate_iban>
330
+ </adyen_sepa>
331
+ </payment>
332
  <adyen>
333
  <payment>
334
  <cctypes>
362
  <order>40</order>
363
  <is_cvv_required>1</is_cvv_required>
364
  </DC>
 
 
 
 
 
 
365
  <MO>
366
  <code>MO</code>
367
  <name>Maestro</name>
382
  </CB>
383
  </cctypes>
384
  <boletotypes>
385
+ <boletobancario_hsbc>
386
  <code>boletobancario_hsbc</code>
387
  <name>boletobancario_hsbc</name>
388
  <order>0</order>
389
  </boletobancario_hsbc>
390
+ <boletobancario_itau>
391
  <code>boletobancario_itau</code>
392
  <name>boletobancario_itau</name>
393
  <order>0</order>
409
  </boletobancario_bancodobrasil>
410
  </boletotypes>
411
  <openinvoicetypes>
412
+ <afterpay>
413
  <code>openinvoice</code>
414
  <name>AfterPay</name>
415
  <order>10</order>
416
  </afterpay>
417
+ <klarna>
418
  <code>klarna</code>
419
  <name>Klarna</name>
420
  <order>20</order>
421
  </klarna>
422
  </openinvoicetypes>
423
  <recurringtypes>
424
+ <none>
425
+ <code></code>
426
+ <name>NONE</name>
427
+ <order>10</order>
428
+ </none>
429
+ <oneclick>
430
+ <code>ONECLICK</code>
431
  <name>ONECLICK</name>
432
  <order>20</order>
433
+ </oneclick>
434
+ <recurring>
435
+ <code>RECURRING</code>
436
  <name>RECURRING</name>
437
  <order>30</order>
438
+ </recurring>
439
+ <oneclickrecurring>
440
+ <code>ONECLICK,RECURRING</code>
441
  <name>ONECLICK,RECURRING</name>
442
  <order>40</order>
443
+ </oneclickrecurring>
444
  </recurringtypes>
445
+ </payment>
446
+ </adyen>
447
+ <sales>
448
+ <totals_sort>
449
+ <payment_fee>15</payment_fee>
450
+ <payment_installment_fee>16</payment_installment_fee>
451
+ </totals_sort>
452
+ </sales>
453
  </default>
454
  </config>
app/code/community/Adyen/Payment/etc/system.xml CHANGED
@@ -30,7 +30,7 @@
30
  <sections>
31
  <payment>
32
  <groups>
33
- <!-- @default -->
34
  <adyen_abstract translate="label" module="adyen">
35
  <label>Adyen Default Settings</label>
36
  <frontend_type>text</frontend_type>
@@ -38,7 +38,21 @@
38
  <show_in_default>1</show_in_default>
39
  <show_in_website>1</show_in_website>
40
  <show_in_store>1</show_in_store>
 
 
 
 
 
41
  <fields>
 
 
 
 
 
 
 
 
 
42
  <merchantAccount translate="label">
43
  <label>Merchant Account</label>
44
  <comment>You can find this in the Adyen backoffice.</comment>
@@ -56,6 +70,7 @@
56
  <show_in_default>1</show_in_default>
57
  <show_in_website>1</show_in_website>
58
  <show_in_store>1</show_in_store>
 
59
  </demoMode>
60
  <order_status translate="label">
61
  <label>New order status</label>
@@ -85,7 +100,7 @@
85
  <sort_order>50</sort_order>
86
  <show_in_default>1</show_in_default>
87
  <show_in_website>1</show_in_website>
88
- <show_in_store>0</show_in_store>
89
  </payment_pre_authorized>
90
  <payment_cancelled translate="label">
91
  <label>Order status cancelled payment</label>
@@ -96,7 +111,7 @@
96
  <show_in_default>1</show_in_default>
97
  <show_in_website>1</show_in_website>
98
  <show_in_store>0</show_in_store>
99
- </payment_cancelled>
100
  <refund_authorized translate="label">
101
  <label>Refund authorise (refund success)</label>
102
  <comment>(optional) leave empty if you are not sure</comment>
@@ -106,7 +121,7 @@
106
  <show_in_default>1</show_in_default>
107
  <show_in_website>1</show_in_website>
108
  <show_in_store>0</show_in_store>
109
- </refund_authorized>
110
  <notification_username translate="label">
111
  <label>Notification Username</label>
112
  <comment>Should match your "notifications settings" in your Adyen account.</comment>
@@ -136,14 +151,14 @@
136
  <show_in_store>0</show_in_store>
137
  </capture_mode>
138
  <recurringtypes translate="label">
139
- <label>Recurring Type</label>
140
- <frontend_type>select</frontend_type>
141
- <source_model>adyen/source_recurringType</source_model>
142
- <sort_order>78</sort_order>
143
- <show_in_default>1</show_in_default>
144
- <show_in_website>1</show_in_website>
145
- <show_in_store>1</show_in_store>
146
- </recurringtypes>
147
  <ws_username_test translate="label">
148
  <label>Adyen ws username for Test</label>
149
  <comment>Normally this will be ws@Company.YourCompanyCode</comment>
@@ -152,7 +167,7 @@
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
- </ws_username_test>
156
  <ws_password_test translate="label">
157
  <label>Adyen ws password for Test</label>
158
  <comment>The password of the ws user for Test</comment>
@@ -161,7 +176,7 @@
161
  <show_in_default>1</show_in_default>
162
  <show_in_website>1</show_in_website>
163
  <show_in_store>0</show_in_store>
164
- </ws_password_test>
165
  <ws_username_live translate="label">
166
  <label>Adyen ws username for Live</label>
167
  <comment>Normally this will be ws@Company.YourCompanyCode</comment>
@@ -170,7 +185,7 @@
170
  <show_in_default>1</show_in_default>
171
  <show_in_website>1</show_in_website>
172
  <show_in_store>0</show_in_store>
173
- </ws_username_live>
174
  <ws_password_live translate="label">
175
  <label>Adyen ws password for Live</label>
176
  <comment>The password of the ws user for Live</comment>
@@ -217,14 +232,14 @@
217
  <show_in_default>1</show_in_default>
218
  <show_in_website>1</show_in_website>
219
  <show_in_store>0</show_in_store>
220
- </send_invoice_update_mail>
221
  </fields>
222
  </adyen_abstract>
223
- <!-- @Hpp only -->
224
  <adyen_hpp translate="label" module="adyen">
225
  <label>Adyen HPP</label>
226
  <frontend_type>text</frontend_type>
227
- <sort_order>301</sort_order>
228
  <show_in_default>1</show_in_default>
229
  <show_in_website>1</show_in_website>
230
  <show_in_store>1</show_in_store>
@@ -233,33 +248,41 @@
233
  <label>Enabled</label>
234
  <frontend_type>select</frontend_type>
235
  <source_model>adminhtml/system_config_source_yesno</source_model>
236
- <sort_order>1</sort_order>
237
  <show_in_default>1</show_in_default>
238
  <show_in_website>1</show_in_website>
239
- <show_in_store>1</show_in_store>
240
  </active>
241
  <title translate="label">
242
  <label>Title</label>
243
  <frontend_type>text</frontend_type>
244
- <sort_order>2</sort_order>
245
  <show_in_default>1</show_in_default>
246
  <show_in_website>1</show_in_website>
247
  <show_in_store>1</show_in_store>
248
- </title>
 
 
 
 
 
 
 
 
249
  <skinCode translate="label">
250
  <label>Skin Code</label>
251
  <comment>The skin code you want to use (You can find this in the admin are of your Adyen account)</comment>
252
  <frontend_type>text</frontend_type>
253
- <sort_order>3</sort_order>
254
  <show_in_default>1</show_in_default>
255
  <show_in_website>1</show_in_website>
256
  <show_in_store>1</show_in_store>
257
- </skinCode>
258
  <secret_wordt translate="label">
259
  <label>HMAC Key for Test</label>
260
  <comment>Should match with the HMAC test key in the Adyen backoffice.</comment>
261
  <frontend_type>text</frontend_type>
262
- <sort_order>4</sort_order>
263
  <show_in_default>1</show_in_default>
264
  <show_in_website>1</show_in_website>
265
  <show_in_store>1</show_in_store>
@@ -268,17 +291,17 @@
268
  <label>HMAC Key for Live</label>
269
  <comment>Should match with the HMAC live key in the Adyen backoffice.</comment>
270
  <frontend_type>text</frontend_type>
271
- <sort_order>5</sort_order>
272
  <show_in_default>1</show_in_default>
273
  <show_in_website>1</show_in_website>
274
  <show_in_store>1</show_in_store>
275
- </secret_wordp>
276
  <payment_routines translate="label">
277
  <label>Payment Flow Selection</label>
278
  <comment>Adyen provide you with 2 types of payment routines. Multi-page and Single Page</comment>
279
  <frontend_type>select</frontend_type>
280
  <source_model>adyen/source_PaymentRoutines</source_model>
281
- <sort_order>6</sort_order>
282
  <show_in_default>1</show_in_default>
283
  <show_in_website>1</show_in_website>
284
  <show_in_store>0</show_in_store>
@@ -287,7 +310,7 @@
287
  <label>Days for Delivery</label>
288
  <comment>How many days to be added to the current date for delivery. ONLY numbers allowed.</comment>
289
  <frontend_type>text</frontend_type>
290
- <sort_order>7</sort_order>
291
  <show_in_default>1</show_in_default>
292
  <show_in_website>1</show_in_website>
293
  <show_in_store>0</show_in_store>
@@ -297,15 +320,36 @@
297
  <comment>If you say yes here, payment methods in the checkout won't be displayed and you will be redirected to the Adyen HPP to make the selection.</comment>
298
  <frontend_type>select</frontend_type>
299
  <source_model>adminhtml/system_config_source_yesno</source_model>
300
- <sort_order>9</sort_order>
301
  <show_in_default>1</show_in_default>
302
  <show_in_website>0</show_in_website>
303
- <show_in_store>0</show_in_store>
304
  </disable_hpptypes>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
305
  <allowspecific translate="label">
306
  <label>Payment to applicable countries</label>
307
  <frontend_type>allowspecific</frontend_type>
308
- <sort_order>12</sort_order>
309
  <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
310
  <show_in_default>1</show_in_default>
311
  <show_in_website>1</show_in_website>
@@ -314,20 +358,20 @@
314
  <specificcountry translate="label">
315
  <label>Payment to Specific countries</label>
316
  <frontend_type>multiselect</frontend_type>
317
- <sort_order>13</sort_order>
318
  <source_model>adminhtml/system_config_source_country</source_model>
319
  <show_in_default>1</show_in_default>
320
  <show_in_website>1</show_in_website>
321
  <show_in_store>1</show_in_store>
322
- <depends><allowspecific>1</allowspecific></depends>
323
- </specificcountry>
324
  </fields>
325
  </adyen_hpp>
326
- <!-- @Pos only -->
327
  <adyen_pos translate="label" module="adyen">
328
  <label>Adyen POS</label>
329
  <frontend_type>text</frontend_type>
330
- <sort_order>302</sort_order>
331
  <show_in_default>1</show_in_default>
332
  <show_in_website>1</show_in_website>
333
  <show_in_store>1</show_in_store>
@@ -339,7 +383,7 @@
339
  <sort_order>10</sort_order>
340
  <show_in_default>1</show_in_default>
341
  <show_in_website>1</show_in_website>
342
- <show_in_store>1</show_in_store>
343
  </active>
344
  <title translate="label">
345
  <label>Title</label>
@@ -349,16 +393,44 @@
349
  <show_in_website>1</show_in_website>
350
  <show_in_store>1</show_in_store>
351
  </title>
 
 
 
 
 
 
 
 
352
  <recurringtypes translate="label">
353
- <label>Recurring Type</label>
354
- <comment>You can set different value for POS because you have to have the permission of the customer</comment>
355
- <frontend_type>select</frontend_type>
356
- <source_model>adyen/source_recurringType</source_model>
357
- <sort_order>30</sort_order>
358
- <show_in_default>1</show_in_default>
359
- <show_in_website>1</show_in_website>
360
- <show_in_store>1</show_in_store>
361
- </recurringtypes>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
362
  <allowspecific translate="label">
363
  <label>Payment to applicable countries</label>
364
  <frontend_type>allowspecific</frontend_type>
@@ -376,15 +448,15 @@
376
  <show_in_default>1</show_in_default>
377
  <show_in_website>1</show_in_website>
378
  <show_in_store>1</show_in_store>
379
- <depends><allowspecific>1</allowspecific></depends>
380
- </specificcountry>
381
  </fields>
382
  </adyen_pos>
383
- <!-- @Openinvoice only -->
384
  <adyen_openinvoice translate="label" module="adyen">
385
  <label>Adyen OpenInvoice</label>
386
  <frontend_type>text</frontend_type>
387
- <sort_order>303</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>
@@ -393,54 +465,89 @@
393
  <label>Enabled</label>
394
  <frontend_type>select</frontend_type>
395
  <source_model>adminhtml/system_config_source_yesno</source_model>
396
- <sort_order>1</sort_order>
397
  <show_in_default>1</show_in_default>
398
  <show_in_website>1</show_in_website>
399
- <show_in_store>1</show_in_store>
400
  </active>
401
  <title translate="label">
402
  <label>Title</label>
403
  <frontend_type>text</frontend_type>
404
- <sort_order>2</sort_order>
405
  <show_in_default>1</show_in_default>
406
  <show_in_website>1</show_in_website>
407
  <show_in_store>1</show_in_store>
408
  </title>
 
 
 
 
 
 
 
 
409
  <openinvoicetypes translate="label">
410
  <label>OpenInvoice Type</label>
411
  <frontend_type>select</frontend_type>
412
  <source_model>adyen/source_openinvoiceType</source_model>
413
- <sort_order>3</sort_order>
414
  <show_in_default>1</show_in_default>
415
  <show_in_website>1</show_in_website>
416
  <show_in_store>1</show_in_store>
417
- </openinvoicetypes>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
418
  <allowspecific translate="label">
419
  <label>Payment to applicable countries</label>
420
  <frontend_type>allowspecific</frontend_type>
421
- <sort_order>4</sort_order>
422
  <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
423
  <show_in_default>1</show_in_default>
424
  <show_in_website>1</show_in_website>
425
  <show_in_store>1</show_in_store>
426
- </allowspecific>
427
  <specificcountry translate="label">
428
  <label>Payment to Specific countries</label>
429
  <frontend_type>multiselect</frontend_type>
430
- <sort_order>5</sort_order>
431
  <source_model>adminhtml/system_config_source_country</source_model>
432
  <show_in_default>1</show_in_default>
433
  <show_in_website>1</show_in_website>
434
  <show_in_store>1</show_in_store>
435
- <depends><allowspecific>1</allowspecific></depends>
436
- </specificcountry>
437
  </fields>
438
- </adyen_openinvoice>
439
- <!-- @CC only -->
440
  <adyen_cc translate="label" module="adyen">
441
  <label>Adyen CC</label>
442
  <frontend_type>text</frontend_type>
443
- <sort_order>304</sort_order>
444
  <show_in_default>1</show_in_default>
445
  <show_in_website>1</show_in_website>
446
  <show_in_store>1</show_in_store>
@@ -449,24 +556,32 @@
449
  <label>Enabled</label>
450
  <frontend_type>select</frontend_type>
451
  <source_model>adminhtml/system_config_source_yesno</source_model>
452
- <sort_order>1</sort_order>
453
  <show_in_default>1</show_in_default>
454
  <show_in_website>1</show_in_website>
455
- <show_in_store>1</show_in_store>
456
  </active>
457
  <title translate="label">
458
  <label>Title</label>
459
  <frontend_type>text</frontend_type>
460
- <sort_order>2</sort_order>
461
  <show_in_default>1</show_in_default>
462
  <show_in_website>1</show_in_website>
463
  <show_in_store>1</show_in_store>
464
  </title>
 
 
 
 
 
 
 
 
465
  <cctypes translate="label">
466
  <label>Credit Card Types</label>
467
  <frontend_type>multiselect</frontend_type>
468
  <source_model>adyen/source_ccType</source_model>
469
- <sort_order>4</sort_order>
470
  <show_in_default>1</show_in_default>
471
  <show_in_website>1</show_in_website>
472
  <show_in_store>1</show_in_store>
@@ -475,7 +590,7 @@
475
  <label>Enable Client-Side Encryption</label>
476
  <frontend_type>select</frontend_type>
477
  <source_model>adminhtml/system_config_source_yesno</source_model>
478
- <sort_order>6</sort_order>
479
  <show_in_default>1</show_in_default>
480
  <show_in_website>1</show_in_website>
481
  <show_in_store>1</show_in_store>
@@ -483,16 +598,16 @@
483
  <cse_publickey translate="label">
484
  <label>Client-Side Encryption Public Key</label>
485
  <frontend_type>textarea</frontend_type>
486
- <sort_order>7</sort_order>
487
  <show_in_default>1</show_in_default>
488
  <show_in_website>1</show_in_website>
489
  <show_in_store>1</show_in_store>
490
- <depends><cse_enabled>1</cse_enabled></depends>
491
  </cse_publickey>
492
  <allowspecific translate="label">
493
  <label>Payment to applicable countries</label>
494
  <frontend_type>allowspecific</frontend_type>
495
- <sort_order>9</sort_order>
496
  <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
497
  <show_in_default>1</show_in_default>
498
  <show_in_website>1</show_in_website>
@@ -501,38 +616,120 @@
501
  <specificcountry translate="label">
502
  <label>Payment to Specific countries</label>
503
  <frontend_type>multiselect</frontend_type>
504
- <sort_order>10</sort_order>
505
  <source_model>adminhtml/system_config_source_country</source_model>
506
  <show_in_default>1</show_in_default>
507
  <show_in_website>1</show_in_website>
508
  <show_in_store>1</show_in_store>
509
- <depends><allowspecific>1</allowspecific></depends>
510
  </specificcountry>
 
 
 
 
 
 
 
 
 
 
511
  <enable_installments translate="label">
512
- <label>Enable Installments</label>
513
- <frontend_type>select</frontend_type>
514
  <source_model>adminhtml/system_config_source_yesno</source_model>
515
- <sort_order>11</sort_order>
516
  <show_in_default>1</show_in_default>
517
  <show_in_website>1</show_in_website>
518
  <show_in_store>1</show_in_store>
519
  </enable_installments>
520
  <installments translate="label">
521
- <label>Installments</label>
522
  <frontend_model>adyen/adminhtml_form_field_installments</frontend_model>
523
  <backend_model>adyen/system_config_backend_installments</backend_model>
524
- <sort_order>12</sort_order>
525
  <show_in_default>1</show_in_default>
526
  <show_in_website>1</show_in_website>
527
  <show_in_store>1</show_in_store>
528
- </installments>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
529
  </fields>
530
- </adyen_cc>
531
- <!-- @Elv only -->
532
- <adyen_elv translate="label" module="adyen">
533
- <label>Adyen ELV</label>
534
  <frontend_type>text</frontend_type>
535
- <sort_order>305</sort_order>
536
  <show_in_default>1</show_in_default>
537
  <show_in_website>1</show_in_website>
538
  <show_in_store>1</show_in_store>
@@ -544,7 +741,8 @@
544
  <sort_order>1</sort_order>
545
  <show_in_default>1</show_in_default>
546
  <show_in_website>1</show_in_website>
547
- <show_in_store>1</show_in_store>
 
548
  </active>
549
  <title translate="label">
550
  <label>Title</label>
@@ -554,32 +752,68 @@
554
  <show_in_website>1</show_in_website>
555
  <show_in_store>1</show_in_store>
556
  </title>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
557
  <allowspecific translate="label">
558
  <label>Payment to applicable countries</label>
559
  <frontend_type>allowspecific</frontend_type>
560
- <sort_order>5</sort_order>
561
  <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
562
  <show_in_default>1</show_in_default>
563
  <show_in_website>1</show_in_website>
564
  <show_in_store>1</show_in_store>
565
- </allowspecific>
566
  <specificcountry translate="label">
567
  <label>Payment to Specific countries</label>
568
  <frontend_type>multiselect</frontend_type>
569
- <sort_order>6</sort_order>
570
  <source_model>adminhtml/system_config_source_country</source_model>
571
  <show_in_default>1</show_in_default>
572
  <show_in_website>1</show_in_website>
573
  <show_in_store>1</show_in_store>
574
- <depends><allowspecific>1</allowspecific></depends>
575
- </specificcountry>
576
  </fields>
577
  </adyen_elv>
578
- <!-- @boleto only -->
579
  <adyen_boleto translate="label" module="adyen">
580
  <label>Adyen Boleto</label>
581
  <frontend_type>text</frontend_type>
582
- <sort_order>306</sort_order>
583
  <show_in_default>1</show_in_default>
584
  <show_in_website>1</show_in_website>
585
  <show_in_store>1</show_in_store>
@@ -588,24 +822,32 @@
588
  <label>Enabled</label>
589
  <frontend_type>select</frontend_type>
590
  <source_model>adminhtml/system_config_source_yesno</source_model>
591
- <sort_order>1</sort_order>
592
  <show_in_default>1</show_in_default>
593
  <show_in_website>1</show_in_website>
594
- <show_in_store>1</show_in_store>
595
  </active>
596
  <title translate="label">
597
  <label>Title</label>
598
  <frontend_type>text</frontend_type>
599
- <sort_order>2</sort_order>
600
  <show_in_default>1</show_in_default>
601
  <show_in_website>1</show_in_website>
602
  <show_in_store>1</show_in_store>
603
  </title>
 
 
 
 
 
 
 
 
604
  <delivery_days translate="label">
605
  <label>Days for Delivery</label>
606
  <comment>How many days to be added to the current date for delivery. ONLY numbers allowed.</comment>
607
  <frontend_type>text</frontend_type>
608
- <sort_order>3</sort_order>
609
  <show_in_default>1</show_in_default>
610
  <show_in_website>1</show_in_website>
611
  <show_in_store>0</show_in_store>
@@ -614,32 +856,117 @@
614
  <label>Boleto Types</label>
615
  <frontend_type>multiselect</frontend_type>
616
  <source_model>adyen/source_boletoType</source_model>
617
- <sort_order>4</sort_order>
618
  <show_in_default>1</show_in_default>
619
  <show_in_website>1</show_in_website>
620
  <show_in_store>1</show_in_store>
621
  </boletotypes>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
622
  <allowspecific translate="label">
623
  <label>Payment to applicable countries</label>
624
  <frontend_type>allowspecific</frontend_type>
625
- <sort_order>5</sort_order>
626
  <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
627
  <show_in_default>1</show_in_default>
628
  <show_in_website>1</show_in_website>
629
  <show_in_store>1</show_in_store>
630
- </allowspecific>
631
  <specificcountry translate="label">
632
  <label>Payment to Specific countries</label>
633
  <frontend_type>multiselect</frontend_type>
634
- <sort_order>6</sort_order>
635
  <source_model>adminhtml/system_config_source_country</source_model>
636
  <show_in_default>1</show_in_default>
637
  <show_in_website>1</show_in_website>
638
  <show_in_store>1</show_in_store>
639
  <depends><allowspecific>1</allowspecific></depends>
640
- </specificcountry>
641
  </fields>
642
- </adyen_boleto>
643
  </groups>
644
  </payment>
645
  </sections>
30
  <sections>
31
  <payment>
32
  <groups>
33
+ <!-- @default -->
34
  <adyen_abstract translate="label" module="adyen">
35
  <label>Adyen Default Settings</label>
36
  <frontend_type>text</frontend_type>
38
  <show_in_default>1</show_in_default>
39
  <show_in_website>1</show_in_website>
40
  <show_in_store>1</show_in_store>
41
+ <!--<comment>Click the following link for an instructional video on how to set up the Adyen Magento plugin, or here to download an integration guide or here to sign up for a test account. The latest version of the Adyen Magento plugin is also available through GitHub. If you have any further questions, please visit the Adyen.com website or email magento@adyen.com.</comment>-->
42
+ <comment><![CDATA[<p>Click the following link for an <a target="_blank" href="https://www.adyen.com/home/payment-services/plug-ins/magento#video">instructional video on how to set up the Adyen Magento plugin</a>, or <a target="_blank" href="https://www.adyen.com/dam/documentation/manuals/AdyenMagentoExtension.pdf">here to download an integration guide</a> or <a target="_blank" href="https://www.adyen.com/home/payment-services/plug-ins/magento#form">here to sign up for a test account</a>.
43
+ The latest version of the <a target="_blank" href="https://github.com/adyenpayments/magento/releases">Adyen Magento plugin is also available through GitHub</a>.
44
+ If you have any further questions, please visit the <a target="_blank" href="http://www.adyen.com">Adyen.com</a> website or email <a href="mailto:magento@adyen.com">magento@adyen.com</a>.
45
+ </p>]]></comment>
46
  <fields>
47
+ <version translate="label">
48
+             <label>Extension version</label>
49
+                     <frontend_type>label</frontend_type>
50
+                     <frontend_model>Adyen_Payment_Block_Adminhtml_Version</frontend_model>
51
+                     <sort_order>0</sort_order>
52
+                     <show_in_default>1</show_in_default>
53
+                     <show_in_website>1</show_in_website>
54
+                     <show_in_store>1</show_in_store>
55
+         </version>
56
  <merchantAccount translate="label">
57
  <label>Merchant Account</label>
58
  <comment>You can find this in the Adyen backoffice.</comment>
70
  <show_in_default>1</show_in_default>
71
  <show_in_website>1</show_in_website>
72
  <show_in_store>1</show_in_store>
73
+ <comment><![CDATA[In test mode you must use test cards. You can find them <a target="_blank" href="http://adyen.com/test-card-numbers">here</a>]]></comment>
74
  </demoMode>
75
  <order_status translate="label">
76
  <label>New order status</label>
100
  <sort_order>50</sort_order>
101
  <show_in_default>1</show_in_default>
102
  <show_in_website>1</show_in_website>
103
+ <show_in_store>0</show_in_store>
104
  </payment_pre_authorized>
105
  <payment_cancelled translate="label">
106
  <label>Order status cancelled payment</label>
111
  <show_in_default>1</show_in_default>
112
  <show_in_website>1</show_in_website>
113
  <show_in_store>0</show_in_store>
114
+ </payment_cancelled>
115
  <refund_authorized translate="label">
116
  <label>Refund authorise (refund success)</label>
117
  <comment>(optional) leave empty if you are not sure</comment>
121
  <show_in_default>1</show_in_default>
122
  <show_in_website>1</show_in_website>
123
  <show_in_store>0</show_in_store>
124
+ </refund_authorized>
125
  <notification_username translate="label">
126
  <label>Notification Username</label>
127
  <comment>Should match your "notifications settings" in your Adyen account.</comment>
151
  <show_in_store>0</show_in_store>
152
  </capture_mode>
153
  <recurringtypes translate="label">
154
+ <label>Recurring Type</label>
155
+ <frontend_type>select</frontend_type>
156
+ <source_model>adyen/source_recurringType</source_model>
157
+ <sort_order>78</sort_order>
158
+ <show_in_default>1</show_in_default>
159
+ <show_in_website>1</show_in_website>
160
+ <show_in_store>1</show_in_store>
161
+ </recurringtypes>
162
  <ws_username_test translate="label">
163
  <label>Adyen ws username for Test</label>
164
  <comment>Normally this will be ws@Company.YourCompanyCode</comment>
167
  <show_in_default>1</show_in_default>
168
  <show_in_website>1</show_in_website>
169
  <show_in_store>0</show_in_store>
170
+ </ws_username_test>
171
  <ws_password_test translate="label">
172
  <label>Adyen ws password for Test</label>
173
  <comment>The password of the ws user for Test</comment>
176
  <show_in_default>1</show_in_default>
177
  <show_in_website>1</show_in_website>
178
  <show_in_store>0</show_in_store>
179
+ </ws_password_test>
180
  <ws_username_live translate="label">
181
  <label>Adyen ws username for Live</label>
182
  <comment>Normally this will be ws@Company.YourCompanyCode</comment>
185
  <show_in_default>1</show_in_default>
186
  <show_in_website>1</show_in_website>
187
  <show_in_store>0</show_in_store>
188
+ </ws_username_live>
189
  <ws_password_live translate="label">
190
  <label>Adyen ws password for Live</label>
191
  <comment>The password of the ws user for Live</comment>
232
  <show_in_default>1</show_in_default>
233
  <show_in_website>1</show_in_website>
234
  <show_in_store>0</show_in_store>
235
+ </send_invoice_update_mail>
236
  </fields>
237
  </adyen_abstract>
238
+ <!-- @Hpp only -->
239
  <adyen_hpp translate="label" module="adyen">
240
  <label>Adyen HPP</label>
241
  <frontend_type>text</frontend_type>
242
+ <sort_order>310</sort_order>
243
  <show_in_default>1</show_in_default>
244
  <show_in_website>1</show_in_website>
245
  <show_in_store>1</show_in_store>
248
  <label>Enabled</label>
249
  <frontend_type>select</frontend_type>
250
  <source_model>adminhtml/system_config_source_yesno</source_model>
251
+ <sort_order>10</sort_order>
252
  <show_in_default>1</show_in_default>
253
  <show_in_website>1</show_in_website>
254
+ <show_in_store>1</show_in_store>
255
  </active>
256
  <title translate="label">
257
  <label>Title</label>
258
  <frontend_type>text</frontend_type>
259
+ <sort_order>20</sort_order>
260
  <show_in_default>1</show_in_default>
261
  <show_in_website>1</show_in_website>
262
  <show_in_store>1</show_in_store>
263
+ </title>
264
+ <sort_order translate="label">
265
+ <label>Sort Order</label>
266
+ <frontend_type>text</frontend_type>
267
+ <sort_order>25</sort_order>
268
+ <show_in_default>1</show_in_default>
269
+ <show_in_website>1</show_in_website>
270
+ <show_in_store>0</show_in_store>
271
+ </sort_order>
272
  <skinCode translate="label">
273
  <label>Skin Code</label>
274
  <comment>The skin code you want to use (You can find this in the admin are of your Adyen account)</comment>
275
  <frontend_type>text</frontend_type>
276
+ <sort_order>30</sort_order>
277
  <show_in_default>1</show_in_default>
278
  <show_in_website>1</show_in_website>
279
  <show_in_store>1</show_in_store>
280
+ </skinCode>
281
  <secret_wordt translate="label">
282
  <label>HMAC Key for Test</label>
283
  <comment>Should match with the HMAC test key in the Adyen backoffice.</comment>
284
  <frontend_type>text</frontend_type>
285
+ <sort_order>40</sort_order>
286
  <show_in_default>1</show_in_default>
287
  <show_in_website>1</show_in_website>
288
  <show_in_store>1</show_in_store>
291
  <label>HMAC Key for Live</label>
292
  <comment>Should match with the HMAC live key in the Adyen backoffice.</comment>
293
  <frontend_type>text</frontend_type>
294
+ <sort_order>50</sort_order>
295
  <show_in_default>1</show_in_default>
296
  <show_in_website>1</show_in_website>
297
  <show_in_store>1</show_in_store>
298
+ </secret_wordp>
299
  <payment_routines translate="label">
300
  <label>Payment Flow Selection</label>
301
  <comment>Adyen provide you with 2 types of payment routines. Multi-page and Single Page</comment>
302
  <frontend_type>select</frontend_type>
303
  <source_model>adyen/source_PaymentRoutines</source_model>
304
+ <sort_order>60</sort_order>
305
  <show_in_default>1</show_in_default>
306
  <show_in_website>1</show_in_website>
307
  <show_in_store>0</show_in_store>
310
  <label>Days for Delivery</label>
311
  <comment>How many days to be added to the current date for delivery. ONLY numbers allowed.</comment>
312
  <frontend_type>text</frontend_type>
313
+ <sort_order>70</sort_order>
314
  <show_in_default>1</show_in_default>
315
  <show_in_website>1</show_in_website>
316
  <show_in_store>0</show_in_store>
320
  <comment>If you say yes here, payment methods in the checkout won't be displayed and you will be redirected to the Adyen HPP to make the selection.</comment>
321
  <frontend_type>select</frontend_type>
322
  <source_model>adminhtml/system_config_source_yesno</source_model>
323
+ <sort_order>90</sort_order>
324
  <show_in_default>1</show_in_default>
325
  <show_in_website>0</show_in_website>
326
+ <show_in_store>0</show_in_store>
327
  </disable_hpptypes>
328
+ <cache_directory_lookup>
329
+ <label>Cache payment method call</label>
330
+ <comment>Enable this if you having trouble with performance and you don't have any amount rules setup in your skin in the Adyen backoffice.</comment>
331
+ <frontend_type>select</frontend_type>
332
+ <source_model>adminhtml/system_config_source_yesno</source_model>
333
+ <sort_order>100</sort_order>
334
+ <show_in_default>1</show_in_default>
335
+ <show_in_website>1</show_in_website>
336
+ <show_in_store>1</show_in_store>
337
+ <depends><disable_hpptypes>0</disable_hpptypes></depends>
338
+ </cache_directory_lookup>
339
+ <return_url_in_request>
340
+ <label>Return url in request</label>
341
+ <comment>If you have a multi webshop and you want to use one skin only, enable this option</comment>
342
+ <frontend_type>select</frontend_type>
343
+ <source_model>adminhtml/system_config_source_yesno</source_model>
344
+ <sort_order>110</sort_order>
345
+ <show_in_default>1</show_in_default>
346
+ <show_in_website>1</show_in_website>
347
+ <show_in_store>1</show_in_store>
348
+ </return_url_in_request>
349
  <allowspecific translate="label">
350
  <label>Payment to applicable countries</label>
351
  <frontend_type>allowspecific</frontend_type>
352
+ <sort_order>120</sort_order>
353
  <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
354
  <show_in_default>1</show_in_default>
355
  <show_in_website>1</show_in_website>
358
  <specificcountry translate="label">
359
  <label>Payment to Specific countries</label>
360
  <frontend_type>multiselect</frontend_type>
361
+ <sort_order>130</sort_order>
362
  <source_model>adminhtml/system_config_source_country</source_model>
363
  <show_in_default>1</show_in_default>
364
  <show_in_website>1</show_in_website>
365
  <show_in_store>1</show_in_store>
366
+ <depends><allowspecific>1</allowspecific></depends>
367
+ </specificcountry>
368
  </fields>
369
  </adyen_hpp>
370
+ <!-- @Pos only -->
371
  <adyen_pos translate="label" module="adyen">
372
  <label>Adyen POS</label>
373
  <frontend_type>text</frontend_type>
374
+ <sort_order>320</sort_order>
375
  <show_in_default>1</show_in_default>
376
  <show_in_website>1</show_in_website>
377
  <show_in_store>1</show_in_store>
383
  <sort_order>10</sort_order>
384
  <show_in_default>1</show_in_default>
385
  <show_in_website>1</show_in_website>
386
+ <show_in_store>1</show_in_store>
387
  </active>
388
  <title translate="label">
389
  <label>Title</label>
393
  <show_in_website>1</show_in_website>
394
  <show_in_store>1</show_in_store>
395
  </title>
396
+ <sort_order translate="label">
397
+ <label>Sort Order</label>
398
+ <frontend_type>text</frontend_type>
399
+ <sort_order>25</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
+ </sort_order>
404
  <recurringtypes translate="label">
405
+ <label>Recurring Type</label>
406
+ <comment>You can set different value for POS because you have to have the permission of the customer</comment>
407
+ <frontend_type>select</frontend_type>
408
+ <source_model>adyen/source_recurringType</source_model>
409
+ <sort_order>30</sort_order>
410
+ <show_in_default>1</show_in_default>
411
+ <show_in_website>1</show_in_website>
412
+ <show_in_store>1</show_in_store>
413
+ </recurringtypes>
414
+ <enable_scanner translate="label">
415
+ <label>Enable Scanner</label>
416
+ <comment>If you enable this you have the possiblity to scan products with a hand scanner on the shopping cart page and this will automatically add products to the shopping cart based on the same SKU name</comment>
417
+ <frontend_type>select</frontend_type>
418
+ <source_model>adminhtml/system_config_source_yesno</source_model>
419
+ <sort_order>35</sort_order>
420
+ <show_in_default>1</show_in_default>
421
+ <show_in_website>1</show_in_website>
422
+ <show_in_store>1</show_in_store>
423
+ </enable_scanner>
424
+ <express_checkout>
425
+ <label>Express checkout</label>
426
+ <comment>This will show a checkout buttton on the shopping cart to directly do a POS payment without going to the checkout steps. You must be loged into your account</comment>
427
+ <frontend_type>select</frontend_type>
428
+ <source_model>adminhtml/system_config_source_yesno</source_model>
429
+ <sort_order>36</sort_order>
430
+ <show_in_default>1</show_in_default>
431
+ <show_in_website>1</show_in_website>
432
+ <show_in_store>1</show_in_store>
433
+ </express_checkout>
434
  <allowspecific translate="label">
435
  <label>Payment to applicable countries</label>
436
  <frontend_type>allowspecific</frontend_type>
448
  <show_in_default>1</show_in_default>
449
  <show_in_website>1</show_in_website>
450
  <show_in_store>1</show_in_store>
451
+ <depends><allowspecific>1</allowspecific></depends>
452
+ </specificcountry>
453
  </fields>
454
  </adyen_pos>
455
+ <!-- @Openinvoice only -->
456
  <adyen_openinvoice translate="label" module="adyen">
457
  <label>Adyen OpenInvoice</label>
458
  <frontend_type>text</frontend_type>
459
+ <sort_order>330</sort_order>
460
  <show_in_default>1</show_in_default>
461
  <show_in_website>1</show_in_website>
462
  <show_in_store>1</show_in_store>
465
  <label>Enabled</label>
466
  <frontend_type>select</frontend_type>
467
  <source_model>adminhtml/system_config_source_yesno</source_model>
468
+ <sort_order>10</sort_order>
469
  <show_in_default>1</show_in_default>
470
  <show_in_website>1</show_in_website>
471
+ <show_in_store>1</show_in_store>
472
  </active>
473
  <title translate="label">
474
  <label>Title</label>
475
  <frontend_type>text</frontend_type>
476
+ <sort_order>20</sort_order>
477
  <show_in_default>1</show_in_default>
478
  <show_in_website>1</show_in_website>
479
  <show_in_store>1</show_in_store>
480
  </title>
481
+ <sort_order translate="label">
482
+ <label>Sort Order</label>
483
+ <frontend_type>text</frontend_type>
484
+ <sort_order>25</sort_order>
485
+ <show_in_default>1</show_in_default>
486
+ <show_in_website>1</show_in_website>
487
+ <show_in_store>0</show_in_store>
488
+ </sort_order>
489
  <openinvoicetypes translate="label">
490
  <label>OpenInvoice Type</label>
491
  <frontend_type>select</frontend_type>
492
  <source_model>adyen/source_openinvoiceType</source_model>
493
+ <sort_order>30</sort_order>
494
  <show_in_default>1</show_in_default>
495
  <show_in_website>1</show_in_website>
496
  <show_in_store>1</show_in_store>
497
+ </openinvoicetypes>
498
+ <gender_show translate="label">
499
+ <label>Show Gender</label>
500
+ <frontend_type>select</frontend_type>
501
+ <source_model>adminhtml/system_config_source_yesno</source_model>
502
+ <sort_order>35</sort_order>
503
+ <show_in_default>1</show_in_default>
504
+ <show_in_website>1</show_in_website>
505
+ <show_in_store>1</show_in_store>
506
+ </gender_show>
507
+ <dob_show translate="label">
508
+ <label>Show Date of Birth</label>
509
+ <frontend_type>select</frontend_type>
510
+ <source_model>adminhtml/system_config_source_yesno</source_model>
511
+ <sort_order>36</sort_order>
512
+ <show_in_default>1</show_in_default>
513
+ <show_in_website>1</show_in_website>
514
+ <show_in_store>1</show_in_store>
515
+ </dob_show>
516
+ <fee translate="label">
517
+ <label>Fee</label>
518
+ <frontend_type>text</frontend_type>
519
+ <sort_order>37</sort_order>
520
+ <show_in_default>1</show_in_default>
521
+ <show_in_website>1</show_in_website>
522
+ <show_in_store>1</show_in_store>
523
+ <validate>validate-number</validate>
524
+ </fee>
525
  <allowspecific translate="label">
526
  <label>Payment to applicable countries</label>
527
  <frontend_type>allowspecific</frontend_type>
528
+ <sort_order>40</sort_order>
529
  <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
530
  <show_in_default>1</show_in_default>
531
  <show_in_website>1</show_in_website>
532
  <show_in_store>1</show_in_store>
533
+ </allowspecific>
534
  <specificcountry translate="label">
535
  <label>Payment to Specific countries</label>
536
  <frontend_type>multiselect</frontend_type>
537
+ <sort_order>50</sort_order>
538
  <source_model>adminhtml/system_config_source_country</source_model>
539
  <show_in_default>1</show_in_default>
540
  <show_in_website>1</show_in_website>
541
  <show_in_store>1</show_in_store>
542
+ <depends><allowspecific>1</allowspecific></depends>
543
+ </specificcountry>
544
  </fields>
545
+ </adyen_openinvoice>
546
+ <!-- @CC only -->
547
  <adyen_cc translate="label" module="adyen">
548
  <label>Adyen CC</label>
549
  <frontend_type>text</frontend_type>
550
+ <sort_order>340</sort_order>
551
  <show_in_default>1</show_in_default>
552
  <show_in_website>1</show_in_website>
553
  <show_in_store>1</show_in_store>
556
  <label>Enabled</label>
557
  <frontend_type>select</frontend_type>
558
  <source_model>adminhtml/system_config_source_yesno</source_model>
559
+ <sort_order>10</sort_order>
560
  <show_in_default>1</show_in_default>
561
  <show_in_website>1</show_in_website>
562
+ <show_in_store>1</show_in_store>
563
  </active>
564
  <title translate="label">
565
  <label>Title</label>
566
  <frontend_type>text</frontend_type>
567
+ <sort_order>20</sort_order>
568
  <show_in_default>1</show_in_default>
569
  <show_in_website>1</show_in_website>
570
  <show_in_store>1</show_in_store>
571
  </title>
572
+ <sort_order translate="label">
573
+ <label>Sort Order</label>
574
+ <frontend_type>text</frontend_type>
575
+ <sort_order>25</sort_order>
576
+ <show_in_default>1</show_in_default>
577
+ <show_in_website>1</show_in_website>
578
+ <show_in_store>0</show_in_store>
579
+ </sort_order>
580
  <cctypes translate="label">
581
  <label>Credit Card Types</label>
582
  <frontend_type>multiselect</frontend_type>
583
  <source_model>adyen/source_ccType</source_model>
584
+ <sort_order>40</sort_order>
585
  <show_in_default>1</show_in_default>
586
  <show_in_website>1</show_in_website>
587
  <show_in_store>1</show_in_store>
590
  <label>Enable Client-Side Encryption</label>
591
  <frontend_type>select</frontend_type>
592
  <source_model>adminhtml/system_config_source_yesno</source_model>
593
+ <sort_order>60</sort_order>
594
  <show_in_default>1</show_in_default>
595
  <show_in_website>1</show_in_website>
596
  <show_in_store>1</show_in_store>
598
  <cse_publickey translate="label">
599
  <label>Client-Side Encryption Public Key</label>
600
  <frontend_type>textarea</frontend_type>
601
+ <sort_order>70</sort_order>
602
  <show_in_default>1</show_in_default>
603
  <show_in_website>1</show_in_website>
604
  <show_in_store>1</show_in_store>
605
+ <depends><cse_enabled>1</cse_enabled></depends>
606
  </cse_publickey>
607
  <allowspecific translate="label">
608
  <label>Payment to applicable countries</label>
609
  <frontend_type>allowspecific</frontend_type>
610
+ <sort_order>90</sort_order>
611
  <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
612
  <show_in_default>1</show_in_default>
613
  <show_in_website>1</show_in_website>
616
  <specificcountry translate="label">
617
  <label>Payment to Specific countries</label>
618
  <frontend_type>multiselect</frontend_type>
619
+ <sort_order>100</sort_order>
620
  <source_model>adminhtml/system_config_source_country</source_model>
621
  <show_in_default>1</show_in_default>
622
  <show_in_website>1</show_in_website>
623
  <show_in_store>1</show_in_store>
624
+ <depends><allowspecific>1</allowspecific></depends>
625
  </specificcountry>
626
+ <enable_moto>
627
+ <label>Enable MOTO for backend orders</label>
628
+ <frontend_type>select</frontend_type>
629
+ <source_model>adminhtml/system_config_source_yesno</source_model>
630
+ <sort_order>105</sort_order>
631
+ <show_in_default>1</show_in_default>
632
+ <show_in_website>1</show_in_website>
633
+ <show_in_store>1</show_in_store>
634
+ <comment><![CDATA[Important you have to activate MOTO for your acocunt contact magento@adyen.com. For more information <a target="_blank" href="https://www.adyen.com/dam/documentation/manuals/MotoManual.pdf">check our MOTO manual</a>]]></comment>
635
+ </enable_moto>
636
  <enable_installments translate="label">
637
+ <label>Enable Installments</label>
638
+ <frontend_type>select</frontend_type>
639
  <source_model>adminhtml/system_config_source_yesno</source_model>
640
+ <sort_order>110</sort_order>
641
  <show_in_default>1</show_in_default>
642
  <show_in_website>1</show_in_website>
643
  <show_in_store>1</show_in_store>
644
  </enable_installments>
645
  <installments translate="label">
646
+ <label>Installments default</label>
647
  <frontend_model>adyen/adminhtml_form_field_installments</frontend_model>
648
  <backend_model>adyen/system_config_backend_installments</backend_model>
649
+ <sort_order>120</sort_order>
650
  <show_in_default>1</show_in_default>
651
  <show_in_website>1</show_in_website>
652
  <show_in_store>1</show_in_store>
653
+ <comments>This is the fallback if specific credit card type has no installments configured</comments>
654
+ </installments>
655
+ <installments_AE translate="label">
656
+ <label>Installments For American Express</label>
657
+ <frontend_model>adyen/adminhtml_form_field_installments</frontend_model>
658
+ <backend_model>adyen/system_config_backend_installments</backend_model>
659
+ <sort_order>130</sort_order>
660
+ <show_in_default>1</show_in_default>
661
+ <show_in_website>1</show_in_website>
662
+ <show_in_store>1</show_in_store>
663
+ </installments_AE>
664
+ <installments_VI translate="label">
665
+ <label>Installments For Visa</label>
666
+ <frontend_model>adyen/adminhtml_form_field_installments</frontend_model>
667
+ <backend_model>adyen/system_config_backend_installments</backend_model>
668
+ <sort_order>140</sort_order>
669
+ <show_in_default>1</show_in_default>
670
+ <show_in_website>1</show_in_website>
671
+ <show_in_store>1</show_in_store>
672
+ </installments_VI>
673
+ <installments_MC translate="label">
674
+ <label>Installments For Master Card</label>
675
+ <frontend_model>adyen/adminhtml_form_field_installments</frontend_model>
676
+ <backend_model>adyen/system_config_backend_installments</backend_model>
677
+ <sort_order>150</sort_order>
678
+ <show_in_default>1</show_in_default>
679
+ <show_in_website>1</show_in_website>
680
+ <show_in_store>1</show_in_store>
681
+ </installments_MC>
682
+ <installments_DI translate="label">
683
+ <label>Installments For Discover</label>
684
+ <frontend_model>adyen/adminhtml_form_field_installments</frontend_model>
685
+ <backend_model>adyen/system_config_backend_installments</backend_model>
686
+ <sort_order>160</sort_order>
687
+ <show_in_default>1</show_in_default>
688
+ <show_in_website>1</show_in_website>
689
+ <show_in_store>1</show_in_store>
690
+ </installments_DI>
691
+ <installments_DC translate="label">
692
+ <label>Installments For Diners Club</label>
693
+ <frontend_model>adyen/adminhtml_form_field_installments</frontend_model>
694
+ <backend_model>adyen/system_config_backend_installments</backend_model>
695
+ <sort_order>170</sort_order>
696
+ <show_in_default>1</show_in_default>
697
+ <show_in_website>1</show_in_website>
698
+ <show_in_store>1</show_in_store>
699
+ </installments_DC>
700
+ <installments_MO translate="label">
701
+ <label>Installments For Maestro</label>
702
+ <frontend_model>adyen/adminhtml_form_field_installments</frontend_model>
703
+ <backend_model>adyen/system_config_backend_installments</backend_model>
704
+ <sort_order>180</sort_order>
705
+ <show_in_default>1</show_in_default>
706
+ <show_in_website>1</show_in_website>
707
+ <show_in_store>1</show_in_store>
708
+ </installments_MO>
709
+ <installments_JC translate="label">
710
+ <label>Installments For JCB</label>
711
+ <frontend_model>adyen/adminhtml_form_field_installments</frontend_model>
712
+ <backend_model>adyen/system_config_backend_installments</backend_model>
713
+ <sort_order>190</sort_order>
714
+ <show_in_default>1</show_in_default>
715
+ <show_in_website>1</show_in_website>
716
+ <show_in_store>1</show_in_store>
717
+ </installments_JC>
718
+ <installments_CB translate="label">
719
+ <label>Installments For CarteBleue</label>
720
+ <frontend_model>adyen/adminhtml_form_field_installments</frontend_model>
721
+ <backend_model>adyen/system_config_backend_installments</backend_model>
722
+ <sort_order>200</sort_order>
723
+ <show_in_default>1</show_in_default>
724
+ <show_in_website>1</show_in_website>
725
+ <show_in_store>1</show_in_store>
726
+ </installments_CB>
727
  </fields>
728
+ </adyen_cc>
729
+ <adyen_oneclick>
730
+ <label>Adyen OneClick</label>
 
731
  <frontend_type>text</frontend_type>
732
+ <sort_order>350</sort_order>
733
  <show_in_default>1</show_in_default>
734
  <show_in_website>1</show_in_website>
735
  <show_in_store>1</show_in_store>
741
  <sort_order>1</sort_order>
742
  <show_in_default>1</show_in_default>
743
  <show_in_website>1</show_in_website>
744
+ <show_in_store>1</show_in_store>
745
+ <comment>One Click payments only work if you have Adyen CC enabled</comment>
746
  </active>
747
  <title translate="label">
748
  <label>Title</label>
752
  <show_in_website>1</show_in_website>
753
  <show_in_store>1</show_in_store>
754
  </title>
755
+ </fields>
756
+ </adyen_oneclick>
757
+ <!-- @Elv only -->
758
+ <adyen_elv translate="label" module="adyen">
759
+ <label>Adyen ELV</label>
760
+ <frontend_type>text</frontend_type>
761
+ <sort_order>360</sort_order>
762
+ <show_in_default>1</show_in_default>
763
+ <show_in_website>1</show_in_website>
764
+ <show_in_store>1</show_in_store>
765
+ <fields>
766
+ <active translate="label">
767
+ <label>Enabled</label>
768
+ <frontend_type>select</frontend_type>
769
+ <source_model>adminhtml/system_config_source_yesno</source_model>
770
+ <sort_order>10</sort_order>
771
+ <show_in_default>1</show_in_default>
772
+ <show_in_website>1</show_in_website>
773
+ <show_in_store>1</show_in_store>
774
+ </active>
775
+ <title translate="label">
776
+ <label>Title</label>
777
+ <frontend_type>text</frontend_type>
778
+ <sort_order>20</sort_order>
779
+ <show_in_default>1</show_in_default>
780
+ <show_in_website>1</show_in_website>
781
+ <show_in_store>1</show_in_store>
782
+ </title>
783
+ <sort_order translate="label">
784
+ <label>Sort Order</label>
785
+ <frontend_type>text</frontend_type>
786
+ <sort_order>25</sort_order>
787
+ <show_in_default>1</show_in_default>
788
+ <show_in_website>1</show_in_website>
789
+ <show_in_store>0</show_in_store>
790
+ </sort_order>
791
  <allowspecific translate="label">
792
  <label>Payment to applicable countries</label>
793
  <frontend_type>allowspecific</frontend_type>
794
+ <sort_order>50</sort_order>
795
  <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
796
  <show_in_default>1</show_in_default>
797
  <show_in_website>1</show_in_website>
798
  <show_in_store>1</show_in_store>
799
+ </allowspecific>
800
  <specificcountry translate="label">
801
  <label>Payment to Specific countries</label>
802
  <frontend_type>multiselect</frontend_type>
803
+ <sort_order>60</sort_order>
804
  <source_model>adminhtml/system_config_source_country</source_model>
805
  <show_in_default>1</show_in_default>
806
  <show_in_website>1</show_in_website>
807
  <show_in_store>1</show_in_store>
808
+ <depends><allowspecific>1</allowspecific></depends>
809
+ </specificcountry>
810
  </fields>
811
  </adyen_elv>
812
+ <!-- @boleto only -->
813
  <adyen_boleto translate="label" module="adyen">
814
  <label>Adyen Boleto</label>
815
  <frontend_type>text</frontend_type>
816
+ <sort_order>370</sort_order>
817
  <show_in_default>1</show_in_default>
818
  <show_in_website>1</show_in_website>
819
  <show_in_store>1</show_in_store>
822
  <label>Enabled</label>
823
  <frontend_type>select</frontend_type>
824
  <source_model>adminhtml/system_config_source_yesno</source_model>
825
+ <sort_order>10</sort_order>
826
  <show_in_default>1</show_in_default>
827
  <show_in_website>1</show_in_website>
828
+ <show_in_store>1</show_in_store>
829
  </active>
830
  <title translate="label">
831
  <label>Title</label>
832
  <frontend_type>text</frontend_type>
833
+ <sort_order>20</sort_order>
834
  <show_in_default>1</show_in_default>
835
  <show_in_website>1</show_in_website>
836
  <show_in_store>1</show_in_store>
837
  </title>
838
+ <sort_order translate="label">
839
+ <label>Sort Order</label>
840
+ <frontend_type>text</frontend_type>
841
+ <sort_order>25</sort_order>
842
+ <show_in_default>1</show_in_default>
843
+ <show_in_website>1</show_in_website>
844
+ <show_in_store>0</show_in_store>
845
+ </sort_order>
846
  <delivery_days translate="label">
847
  <label>Days for Delivery</label>
848
  <comment>How many days to be added to the current date for delivery. ONLY numbers allowed.</comment>
849
  <frontend_type>text</frontend_type>
850
+ <sort_order>30</sort_order>
851
  <show_in_default>1</show_in_default>
852
  <show_in_website>1</show_in_website>
853
  <show_in_store>0</show_in_store>
856
  <label>Boleto Types</label>
857
  <frontend_type>multiselect</frontend_type>
858
  <source_model>adyen/source_boletoType</source_model>
859
+ <sort_order>40</sort_order>
860
  <show_in_default>1</show_in_default>
861
  <show_in_website>1</show_in_website>
862
  <show_in_store>1</show_in_store>
863
  </boletotypes>
864
+ <order_underpaid_status translate="label">
865
+ <label>Order status underpaid</label>
866
+ <comment>With Boleto it is possible to pay less than the full amount. Select here the status if this is the case. If you leave this empty it will take the Order status authorised payment as default status</comment>
867
+ <frontend_type>select</frontend_type>
868
+ <source_model>adminhtml/system_config_source_order_status_processing</source_model>
869
+ <sort_order>45</sort_order>
870
+ <show_in_default>1</show_in_default>
871
+ <show_in_website>1</show_in_website>
872
+ <show_in_store>0</show_in_store>
873
+ </order_underpaid_status>
874
+ <order_overpaid_status translate="label">
875
+ <label>Order status overpaid</label>
876
+ <comment>With Boleto it is possible to pay more than the total amount. Select here the status if this is the case. If you leave this empty it will take the Order status authorised payment as default status</comment>
877
+ <frontend_type>select</frontend_type>
878
+ <source_model>adminhtml/system_config_source_order_status_processing</source_model>
879
+ <sort_order>45</sort_order>
880
+ <show_in_default>1</show_in_default>
881
+ <show_in_website>1</show_in_website>
882
+ <show_in_store>0</show_in_store>
883
+ </order_overpaid_status>
884
+ <allowspecific translate="label">
885
+ <label>Payment to applicable countries</label>
886
+ <frontend_type>allowspecific</frontend_type>
887
+ <sort_order>50</sort_order>
888
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
889
+ <show_in_default>1</show_in_default>
890
+ <show_in_website>1</show_in_website>
891
+ <show_in_store>1</show_in_store>
892
+ </allowspecific>
893
+ <specificcountry translate="label">
894
+ <label>Payment to Specific countries</label>
895
+ <frontend_type>multiselect</frontend_type>
896
+ <sort_order>60</sort_order>
897
+ <source_model>adminhtml/system_config_source_country</source_model>
898
+ <show_in_default>1</show_in_default>
899
+ <show_in_website>1</show_in_website>
900
+ <show_in_store>1</show_in_store>
901
+ <depends><allowspecific>1</allowspecific></depends>
902
+ </specificcountry>
903
+ </fields>
904
+ </adyen_boleto>
905
+ <!-- @SEPA only -->
906
+ <adyen_sepa translate="label" module="adyen">
907
+ <label>Adyen SEPA</label>
908
+ <frontend_type>text</frontend_type>
909
+ <sort_order>380</sort_order>
910
+ <show_in_default>1</show_in_default>
911
+ <show_in_website>1</show_in_website>
912
+ <show_in_store>1</show_in_store>
913
+ <fields>
914
+ <active translate="label">
915
+ <label>Enabled</label>
916
+ <frontend_type>select</frontend_type>
917
+ <source_model>adminhtml/system_config_source_yesno</source_model>
918
+ <sort_order>10</sort_order>
919
+ <show_in_default>1</show_in_default>
920
+ <show_in_website>1</show_in_website>
921
+ <show_in_store>1</show_in_store>
922
+ </active>
923
+ <title translate="label">
924
+ <label>Title</label>
925
+ <frontend_type>text</frontend_type>
926
+ <sort_order>20</sort_order>
927
+ <show_in_default>1</show_in_default>
928
+ <show_in_website>1</show_in_website>
929
+ <show_in_store>1</show_in_store>
930
+ </title>
931
+ <sort_order translate="label">
932
+ <label>Sort Order</label>
933
+ <frontend_type>text</frontend_type>
934
+ <sort_order>25</sort_order>
935
+ <show_in_default>1</show_in_default>
936
+ <show_in_website>1</show_in_website>
937
+ <show_in_store>0</show_in_store>
938
+ </sort_order>
939
+ <validate_iban>
940
+ <label>Validate Iban</label>
941
+ <frontend_type>select</frontend_type>
942
+ <source_model>adminhtml/system_config_source_yesno</source_model>
943
+ <sort_order>30</sort_order>
944
+ <comment>This is a basic validation on the Iban number.</comment>
945
+ <show_in_default>1</show_in_default>
946
+ <show_in_website>1</show_in_website>
947
+ <show_in_store>1</show_in_store>
948
+ </validate_iban>
949
  <allowspecific translate="label">
950
  <label>Payment to applicable countries</label>
951
  <frontend_type>allowspecific</frontend_type>
952
+ <sort_order>50</sort_order>
953
  <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
954
  <show_in_default>1</show_in_default>
955
  <show_in_website>1</show_in_website>
956
  <show_in_store>1</show_in_store>
957
+ </allowspecific>
958
  <specificcountry translate="label">
959
  <label>Payment to Specific countries</label>
960
  <frontend_type>multiselect</frontend_type>
961
+ <sort_order>60</sort_order>
962
  <source_model>adminhtml/system_config_source_country</source_model>
963
  <show_in_default>1</show_in_default>
964
  <show_in_website>1</show_in_website>
965
  <show_in_store>1</show_in_store>
966
  <depends><allowspecific>1</allowspecific></depends>
967
+ </specificcountry>
968
  </fields>
969
+ </adyen_sepa>
970
  </groups>
971
  </payment>
972
  </sections>
app/code/community/Adyen/Payment/sql/adyen_setup/mysql4-upgrade-2.0.3-2.1.0.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ /* @var $installer Adyen_Payment_Model_Entity_Setup */
6
+ $installer->startSetup();
7
+
8
+ $installer->getConnection()->addColumn($this->getTable('sales/quote_address'), 'payment_fee_amount', "decimal(12,4) null default null");
9
+ $installer->getConnection()->addColumn($this->getTable('sales/quote_address'), 'base_payment_fee_amount', "decimal(12,4) null default null");
10
+
11
+ $installer->getConnection()->addColumn($this->getTable('sales/order'), 'payment_fee_amount', "decimal(12,4) null default null");
12
+ $installer->getConnection()->addColumn($this->getTable('sales/order'), 'base_payment_fee_amount', "decimal(12,4) null default null");
13
+
14
+ $installer->getConnection()->addColumn($this->getTable('sales/invoice'), 'payment_fee_amount', "decimal(12,4) null default null");
15
+ $installer->getConnection()->addColumn($this->getTable('sales/invoice'), 'base_payment_fee_amount', "decimal(12,4) null default null");
16
+
17
+ $installer->getConnection()->addColumn($this->getTable('sales/creditmemo'), 'payment_fee_amount', "decimal(12,4) null default null");
18
+ $installer->getConnection()->addColumn($this->getTable('sales/creditmemo'), 'base_payment_fee_amount', "decimal(12,4) null default null");
19
+
20
+ $installer->getConnection()->addColumn($this->getTable('adyen/event'), 'success', "tinyint(1) null default null");
21
+
22
+ $installer->addAttribute('order_payment', 'adyen_klarna_number', array());
23
+
24
+ $installer->getConnection()->addColumn($this->getTable('sales/quote_address'), 'payment_installment_fee_amount', "decimal(12,4) null default null");
25
+ $installer->getConnection()->addColumn($this->getTable('sales/quote_address'), 'base_payment_installment_fee_amount', "decimal(12,4) null default null");
26
+
27
+ $installer->getConnection()->addColumn($this->getTable('sales/order'), 'payment_installment_fee_amount', "decimal(12,4) null default null");
28
+ $installer->getConnection()->addColumn($this->getTable('sales/order'), 'base_payment_installment_fee_amount', "decimal(12,4) null default null");
29
+
30
+ $installer->getConnection()->addColumn($this->getTable('sales/invoice'), 'payment_installment_fee_amount', "decimal(12,4) null default null");
31
+ $installer->getConnection()->addColumn($this->getTable('sales/invoice'), 'base_payment_installment_fee_amount', "decimal(12,4) null default null");
32
+
33
+ $installer->getConnection()->addColumn($this->getTable('sales/creditmemo'), 'payment_installment_fee_amount', "decimal(12,4) null default null");
34
+ $installer->getConnection()->addColumn($this->getTable('sales/creditmemo'), 'base_payment_installment_fee_amount', "decimal(12,4) null default null");
35
+
36
+ $installer->addAttribute('order_payment', 'adyen_avs_result', array());
37
+ $installer->addAttribute('order_payment', 'adyen_cvc_result', array());
38
+
39
+ $installer->addAttribute('order_payment', 'adyen_boleto_paid_amount', array());
40
+
41
+ $installer->endSetup();
app/design/adminhtml/default/default/template/adyen/form/hpp.phtml CHANGED
@@ -27,7 +27,7 @@
27
  ?>
28
  <?php $_code = $this->getMethodCode() ?>
29
 
30
- <?php $disabled = $this->hppOptionsDisabled(); ?>
31
  <?php $enabledTypes = $this->getHppAvailableTypes(); ?>
32
  <?php $idealList = $this->getIdealAvailableTypes();?>
33
 
27
  ?>
28
  <?php $_code = $this->getMethodCode() ?>
29
 
30
+ <?php $disabled = $this->getHppOptionsDisabled(); ?>
31
  <?php $enabledTypes = $this->getHppAvailableTypes(); ?>
32
  <?php $idealList = $this->getIdealAvailableTypes();?>
33
 
app/design/adminhtml/default/default/template/adyen/form/sepa.phtml ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Adyen Payment Module
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @category Adyen
16
+ * @package Adyen_Payment
17
+ * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+ /**
21
+ * @category Payment Gateway
22
+ * @package Adyen_Payment
23
+ * @author Adyen
24
+ * @property Adyen B.V
25
+ * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
26
+ */
27
+ $_code=$this->getMethodCode();
28
+ ?>
29
+
30
+ <ul id="payment_form_<?php echo $_code ?>" style="display:none">
31
+
32
+ <li>
33
+ <div class="input-box">
34
+ <label for="<?php echo $_code ?>_account_number"><?php echo $this->__('Bank account holder name') ?> <span class="required">*</span></label><br />
35
+ <input
36
+ type="text" id="<?php echo $_code ?>_account_name" name="payment[account_name]"
37
+ title="<?php echo $this->__('Bank account holder name') ?>"
38
+ class="validate-ipayment-sepa-account-name required-entry input-text"
39
+ value="" autocomplete="off"
40
+ />
41
+ </div>
42
+ </li>
43
+ <li>
44
+ <div class="input-box">
45
+ <label for="<?php echo $_code ?>_iban"><?php echo $this->__('IBAN') ?> <span class="required">*</span></label><br />
46
+ <input
47
+ type="text" id="<?php echo $_code ?>_iban" name="payment[iban]"
48
+ title="<?php echo $this->__('IBAN') ?>"
49
+ class="validate-ipayment-sepa-iban required-entry input-text"
50
+ value="" autocomplete="off"
51
+ />
52
+ </div>
53
+ </li>
54
+
55
+ <li>
56
+ <div class="input-box">
57
+ <label for="<?php echo $_code ?>_country"><?php echo $this->__('Country') ?> <span class="required">*</span></label><br />
58
+
59
+
60
+ <select id="<?php echo $_code ?>_country" name="payment[country]" name="payment[country]" title="<?php echo $this->__('Country') ?>" class="validate-ipayment-sepa-country required-entry input-select">
61
+ <option value="">--</option>
62
+ <option value="AT">Austria</option>
63
+ <option value="BE">Belgium</option>
64
+ <option value="BG">Bulgaria</option>
65
+ <option value="CH">Switzerland</option>
66
+ <option value="CY">Cyprus</option>
67
+ <option value="CZ">Czech Republic</option>
68
+ <option value="DE">Germany</option>
69
+ <option value="DK">Denmark</option>
70
+ <option value="EE">Estonia</option>
71
+ <option value="ES">Spain</option>
72
+ <option value="FI">Finland</option>
73
+ <option value="FR">France</option>
74
+ <option value="GB">United Kingdom</option>
75
+ <option value="GF">French Guiana</option>
76
+ <option value="GI">Gibraltar</option>
77
+ <option value="GP">Guadeloupe</option>
78
+ <option value="GR">Greece</option>
79
+ <option value="HR">Croatia</option>
80
+ <option value="HU">Hungary</option>
81
+ <option value="IE">Ireland</option>
82
+ <option value="IS">Iceland</option>
83
+ <option value="IT">Italy</option>
84
+ <option value="LI">Liechtenstein</option>
85
+ <option value="LT">Lithuania</option>
86
+ <option value="LU">Luxembourg</option>
87
+ <option value="LV">Latvia</option>
88
+ <option value="MC">Monaco</option>
89
+ <option value="MQ">Martinique</option>
90
+ <option value="MT">Malta</option>
91
+ <option value="NL">Netherlands</option>
92
+ <option value="NO">Norway</option>
93
+ <option value="PL">Poland</option>
94
+ <option value="PT">Portugal</option>
95
+ <option value="RE">Réunion</option>
96
+ <option value="RO">Romania</option>
97
+ <option value="SE">Sweden</option>
98
+ <option value="SI">Slovenia</option>
99
+ <option value="SK">Slovakia</option>
100
+ </select>
101
+ </div>
102
+ </li>
103
+ </ul>
104
+
105
+ <div>
106
+ <span id="ipayment-sepa-please-wait" style="display:none;" class="opc-please-wait">
107
+ <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" class="v-middle" alt=""/> &nbsp; <?php echo $this->__('Submitting payment information...') ?> &nbsp;
108
+ </span>
109
+ </div>
110
+
app/design/adminhtml/default/default/template/adyen/info/boleto.phtml CHANGED
@@ -47,4 +47,7 @@
47
  <?php echo Mage::helper('adyen')->__('Firstname: %s', $this->htmlEscape($boleto['firstname'])) ?><br/>
48
  <?php echo Mage::helper('adyen')->__('Lastname: %s', $this->htmlEscape($boleto['lastname'])) ?><br/>
49
  <?php echo Mage::helper('adyen')->__('Boleto PDf: <a target="_blank" href="%s" title="Boleto PDF">Download</a>', $this->getInfo()->getOrder()->getAdyenBoletoPdf()) ?><br/>
 
 
 
50
  <?php endif;?>
47
  <?php echo Mage::helper('adyen')->__('Firstname: %s', $this->htmlEscape($boleto['firstname'])) ?><br/>
48
  <?php echo Mage::helper('adyen')->__('Lastname: %s', $this->htmlEscape($boleto['lastname'])) ?><br/>
49
  <?php echo Mage::helper('adyen')->__('Boleto PDf: <a target="_blank" href="%s" title="Boleto PDF">Download</a>', $this->getInfo()->getOrder()->getAdyenBoletoPdf()) ?><br/>
50
+ <?php if($_info->getAdyenBoletoPaidAmount() != null && $_info->getAdyenBoletoPaidAmount() != ""): ?>
51
+ <?php echo Mage::helper('adyen')->__('Paid amount: %s', $this->htmlEscape($_info->getAdyenBoletoPaidAmount())) ?> <br/>
52
+ <?php endif; ?>
53
  <?php endif;?>
app/design/adminhtml/default/default/template/adyen/info/cc.phtml CHANGED
@@ -37,7 +37,7 @@ echo ($cseEnabled ? " (with Client-Side Encryption)" : "");
37
  <?php else :?>
38
  <?php if($this->getMethod()->getConfigDataDemoMode()): ?>
39
  <?php echo Mage::helper('adyen')->__('Adyen PSP Reference: <a href="https://ca-test.adyen.com/ca/ca/payments/searchPayments.shtml?query=%s&skipList=firstResult" target="__blank">%s</a>', $this->htmlEscape($_info->getAdyenPspReference()), $this->htmlEscape($_info->getAdyenPspReference())) ?> <br/>
40
- <?php else : ?>
41
  <?php echo Mage::helper('adyen')->__('Adyen PSP Reference: <a href="https://ca-live.adyen.com/ca/ca/payments/searchPayments.shtml?query=%s&skipList=firstResult" target="__blank">%s</a>', $this->htmlEscape($_info->getAdyenPspReference()), $this->htmlEscape($_info->getAdyenPspReference())) ?> <br/>
42
  <?php endif; ?>
43
  <?php endif;?>
@@ -50,5 +50,17 @@ echo ($cseEnabled ? " (with Client-Side Encryption)" : "");
50
  <?php echo Mage::helper('adyen')->__('Credit Card Type: %s', $this->htmlEscape($this->getCcTypeName())) ?><br/>
51
  <?php echo Mage::helper('adyen')->__('Credit Card Number: xxxx-%s', $this->htmlEscape($this->getInfo()->getCcLast4())) ?><br/>
52
  <?php echo Mage::helper('adyen')->__('Expiration Date: %s/%s', $this->htmlEscape($this->getCcExpMonth()), $this->htmlEscape($this->getInfo()->getCcExpYear())) ?><br/>
 
 
 
53
  <?php endif;?>
 
 
 
 
 
 
 
 
 
54
  <?php endif;?>
37
  <?php else :?>
38
  <?php if($this->getMethod()->getConfigDataDemoMode()): ?>
39
  <?php echo Mage::helper('adyen')->__('Adyen PSP Reference: <a href="https://ca-test.adyen.com/ca/ca/payments/searchPayments.shtml?query=%s&skipList=firstResult" target="__blank">%s</a>', $this->htmlEscape($_info->getAdyenPspReference()), $this->htmlEscape($_info->getAdyenPspReference())) ?> <br/>
40
+ <?php else : ?>
41
  <?php echo Mage::helper('adyen')->__('Adyen PSP Reference: <a href="https://ca-live.adyen.com/ca/ca/payments/searchPayments.shtml?query=%s&skipList=firstResult" target="__blank">%s</a>', $this->htmlEscape($_info->getAdyenPspReference()), $this->htmlEscape($_info->getAdyenPspReference())) ?> <br/>
42
  <?php endif; ?>
43
  <?php endif;?>
50
  <?php echo Mage::helper('adyen')->__('Credit Card Type: %s', $this->htmlEscape($this->getCcTypeName())) ?><br/>
51
  <?php echo Mage::helper('adyen')->__('Credit Card Number: xxxx-%s', $this->htmlEscape($this->getInfo()->getCcLast4())) ?><br/>
52
  <?php echo Mage::helper('adyen')->__('Expiration Date: %s/%s', $this->htmlEscape($this->getCcExpMonth()), $this->htmlEscape($this->getInfo()->getCcExpYear())) ?><br/>
53
+ <?php else : ?>
54
+ <?php echo Mage::helper('adyen')->__('Credit Card Type: %s', $this->htmlEscape($this->getCcTypeName())) ?><br/>
55
+ <?php echo Mage::helper('adyen')->__('Credit Card Number: xxxx-%s', $this->htmlEscape($this->getInfo()->getCcLast4())) ?><br/>
56
  <?php endif;?>
57
+
58
+ <?php if($this->htmlEscape($this->getInfo()->getAdyenAvsResult()) != ""): ?>
59
+ <?php echo Mage::helper('adyen')->__('Avs result: %s', $this->htmlEscape($this->getInfo()->getAdyenAvsResult())) ?><br/>
60
+ <?php endif; ?>
61
+
62
+ <?php if($this->htmlEscape($this->getInfo()->getAdyenCvcResult()) != ""): ?>
63
+ <?php echo Mage::helper('adyen')->__('Cvc result: %s', $this->htmlEscape($this->getInfo()->getAdyenCvcResult())) ?><br/>
64
+ <?php endif; ?>
65
+
66
  <?php endif;?>
app/design/adminhtml/default/default/template/adyen/info/hpp.phtml CHANGED
@@ -49,5 +49,8 @@
49
  ?>
50
  <?php echo $this->__('Bank: %s', $this->htmlEscape($label)) ?><br/>
51
  <?php endif; ?>
52
- <?php endif; ?>
 
 
 
53
  <?php endif; ?>
49
  ?>
50
  <?php echo $this->__('Bank: %s', $this->htmlEscape($label)) ?><br/>
51
  <?php endif; ?>
52
+ <?php endif; ?>
53
+ <?php if($_info->getAdyenKlarnaNumber() != null && $_info->getAdyenKlarnaNumber() != ""): ?>
54
+ <?php echo Mage::helper('adyen')->__('Klarna reservation number: %s', $this->htmlEscape($_info->getAdyenKlarnaNumber())) ?> <br/>
55
+ <?php endif; ?>
56
  <?php endif; ?>
app/design/adminhtml/default/default/template/adyen/info/openinvoice.phtml CHANGED
@@ -36,6 +36,11 @@
36
  <?php echo Mage::helper('adyen')->__('Adyen PSP Reference: <a href="https://ca-live.adyen.com/ca/ca/payments/searchPayments.shtml?query=%s&skipList=firstResult" target="__blank">%s</a>', $this->htmlEscape($_info->getAdyenPspReference()), $this->htmlEscape($_info->getAdyenPspReference())) ?> <br/>
37
  <?php endif; ?>
38
  <?php endif;?>
 
 
 
 
 
39
  <?php $paymentMethod = $_info->getAdyenPaymentMethod() ?>
40
  <?php if (!empty($paymentMethod)): ?>
41
  <?php echo $this->__('Payment Method: %s', $this->htmlEscape($paymentMethod)) ?><br/>
36
  <?php echo Mage::helper('adyen')->__('Adyen PSP Reference: <a href="https://ca-live.adyen.com/ca/ca/payments/searchPayments.shtml?query=%s&skipList=firstResult" target="__blank">%s</a>', $this->htmlEscape($_info->getAdyenPspReference()), $this->htmlEscape($_info->getAdyenPspReference())) ?> <br/>
37
  <?php endif; ?>
38
  <?php endif;?>
39
+
40
+ <?php if($_info->getAdyenKlarnaNumber() != null && $_info->getAdyenKlarnaNumber() != ""): ?>
41
+ <?php echo Mage::helper('adyen')->__('Klarna reservation number: %s', $this->htmlEscape($_info->getAdyenKlarnaNumber())) ?> <br/>
42
+ <?php endif; ?>
43
+
44
  <?php $paymentMethod = $_info->getAdyenPaymentMethod() ?>
45
  <?php if (!empty($paymentMethod)): ?>
46
  <?php echo $this->__('Payment Method: %s', $this->htmlEscape($paymentMethod)) ?><br/>
app/design/adminhtml/default/default/template/adyen/info/sepa.phtml ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Adyen Payment Module
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @category Adyen
16
+ * @package Adyen_Payment
17
+ * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+ /**
21
+ * @category Payment Gateway
22
+ * @package Adyen_Payment
23
+ * @author Adyen
24
+ * @property Adyen B.V
25
+ * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
26
+ */
27
+ ?>
28
+ <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br/>
29
+ <?php if ($_info = $this->getInfo()): ?>
30
+ <?php if ($_info->getAdyenPspReference() == ''): ?>
31
+ <?php echo Mage::helper('adyen')->__('Payment has not been processed yet.') ?> <br/>
32
+ <?php else :?>
33
+ <?php if($this->getMethod()->getConfigDataDemoMode()): ?>
34
+ <?php echo Mage::helper('adyen')->__('Adyen PSP Reference: <a href="https://ca-test.adyen.com/ca/ca/payments/searchPayments.shtml?query=%s&skipList=firstResult" target="__blank">%s</a>', $this->htmlEscape($_info->getAdyenPspReference()), $this->htmlEscape($_info->getAdyenPspReference())) ?> <br/>
35
+ <?php else : ?>
36
+ <?php echo Mage::helper('adyen')->__('Adyen PSP Reference: <a href="https://ca-live.adyen.com/ca/ca/payments/searchPayments.shtml?query=%s&skipList=firstResult" target="__blank">%s</a>', $this->htmlEscape($_info->getAdyenPspReference()), $this->htmlEscape($_info->getAdyenPspReference())) ?> <br/>
37
+ <?php endif; ?>
38
+ <?php endif;?>
39
+ <?php $paymentMethod = $_info->getAdyenPaymentMethod() ?>
40
+ <?php if (!empty($paymentMethod)): ?>
41
+ <?php echo $this->__('Payment Method: %s', $this->htmlEscape($paymentMethod)) ?><br/>
42
+ <?php endif; ?>
43
+
44
+
45
+ <?php $elv = unserialize($this->getInfo()->getPoNumber())?>
46
+ <?php echo Mage::helper('adyen')->__('Account holder: %s', $this->htmlEscape($elv['account_name'])) ?><br/>
47
+ <?php echo Mage::helper('adyen')->__('IBAN: %s', $this->htmlEscape($elv['iban'])) ?><br/>
48
+ <?php echo Mage::helper('adyen')->__('Country: %s', $this->htmlEscape($elv['country'])) ?><br/>
49
+ <?php endif;?>
app/design/adminhtml/default/default/template/adyen/order/view/history.phtml ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <div id="order_history_block">
28
+ <?php if ($this->canAddComment()):?>
29
+ <div id="history_form" class="order-history-form">
30
+ <div><?php echo Mage::helper('sales')->__('Add Order Comments') ?></div>
31
+ <span class="field-row">
32
+ <label class="normal" for="history_status"><?php echo Mage::helper('sales')->__('Status') ?></label><br/>
33
+ <select name="history[status]" class="select" id="history_status">
34
+ <?php foreach ($this->getStatuses() as $_code=>$_label): ?>
35
+ <option value="<?php echo $_code ?>"<?php if($_code==$this->getOrder()->getStatus()): ?> selected="selected"<?php endif; ?>><?php echo $_label ?></option>
36
+ <?php endforeach; ?>
37
+ </select>
38
+ </span>
39
+ <span class="field-row">
40
+ <label class="normal" for="history_comment"><?php echo Mage::helper('sales')->__('Comment') ?></label>
41
+ <textarea name="history[comment]" rows="3" cols="5" style="height:6em; width:99%;" id="history_comment"></textarea>
42
+ </span>
43
+ <div class="f-left">
44
+ <?php if ($this->canSendCommentEmail()): ?>
45
+ <input name="history[is_customer_notified]" type="checkbox" id="history_notify" value="1" /><label class="normal" for="history_notify"> <?php echo Mage::helper('sales')->__('Notify Customer by Email') ?></label><br />
46
+ <?php endif; ?>
47
+ <input name="history[is_visible_on_front]" type="checkbox" id="history_visible" value="1" /><label class="normal" for="history_visible"> <?php echo Mage::helper('sales')->__('Visible on Frontend') ?></label>
48
+ </div>
49
+ <div class="f-right">
50
+ <?php echo $this->getChildHtml('submit_button') ?>
51
+ </div>
52
+ <div class="clear"></div>
53
+ </div>
54
+ <div class="divider"></div>
55
+ <?php endif;?>
56
+ <ul class="note-list">
57
+ <?php foreach ($this->getOrder()->getStatusHistoryCollection(true) as $_item): ?>
58
+ <li>
59
+ <strong><?php echo $this->helper('core')->formatDate($_item->getCreatedAtDate(), 'medium') ?></strong>
60
+ <?php echo $this->helper('core')->formatTime($_item->getCreatedAtDate(), 'medium') ?><span class="separator">|</span><strong><?php echo $_item->getStatusLabel() ?></strong><br/><small><?php echo $this->helper('sales')->__('Customer') ?>
61
+ <strong class="subdue">
62
+ <?php if ($this->isCustomerNotificationNotApplicable($_item)): ?>
63
+ <?php echo $this->helper('sales')->__('Notification Not Applicable') ?>
64
+ <?php elseif ($_item->getIsCustomerNotified()): ?>
65
+ <?php echo $this->helper('sales')->__('Notified') ?>
66
+ <img src="<?php echo $this->getSkinUrl('images/ico_success.gif') ?>" width="16" height="16" alt="" />
67
+ <?php else: ?>
68
+ <?php echo $this->helper('sales')->__('Not Notified') ?>
69
+ <?php endif; ?>
70
+ </strong></small>
71
+ <?php if ($_item->getComment()): ?>
72
+ <br/><?php echo $_item->getComment()) ?>
73
+ <?php endif; ?>
74
+ </li>
75
+ <?php endforeach; ?>
76
+ </ul>
77
+ <script type="text/javascript">
78
+ if($('order_status'))$('order_status').update('<?php echo $this->getOrder()->getStatusLabel() ?>');
79
+ </script>
80
+ </div>
app/design/frontend/base/default/layout/adyen.xml CHANGED
@@ -27,12 +27,34 @@
27
  */
28
  -->
29
  <layout version="0.1.0">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  <checkout_onepage_index>
31
  <reference name="head">
32
  <action method="addJs"><script>adyen/payment/elv.js</script></action>
33
  <action method="addCss"><stylesheet>css/adyenstyle.css</stylesheet></action>
34
  </reference>
35
  </checkout_onepage_index>
 
 
 
 
 
 
 
 
36
  <checkout_multishipping_billing>
37
  <reference name="head">
38
  <action method="addJs"><script>adyen/payment/elv.js</script></action>
27
  */
28
  -->
29
  <layout version="0.1.0">
30
+
31
+ <adyen_updatecart_index>
32
+ <update handle="checkout_cart_index" />
33
+ </adyen_updatecart_index>
34
+
35
+ <checkout_cart_index>
36
+ <reference name="top.container">
37
+ <block type="adyen/scanProduct" name="adyen.scanProduct" template="adyen/scanProduct.phtml"/>
38
+ </reference>
39
+ <reference name="checkout.cart.methods">
40
+ <block type="adyen/posExpressCheckout" before="-" name="adyen.pos.express.checkout" template="adyen/posExpressCheckout.phtml"/>
41
+ </reference>
42
+ </checkout_cart_index>
43
+
44
  <checkout_onepage_index>
45
  <reference name="head">
46
  <action method="addJs"><script>adyen/payment/elv.js</script></action>
47
  <action method="addCss"><stylesheet>css/adyenstyle.css</stylesheet></action>
48
  </reference>
49
  </checkout_onepage_index>
50
+
51
+ <onestepcheckout_index_index>
52
+ <reference name="head">
53
+ <action method="addJs"><script>adyen/payment/elv.js</script></action>
54
+ <action method="addCss"><stylesheet>css/adyenstyle.css</stylesheet></action>
55
+ </reference>
56
+ </onestepcheckout_index_index>
57
+
58
  <checkout_multishipping_billing>
59
  <reference name="head">
60
  <action method="addJs"><script>adyen/payment/elv.js</script></action>
app/design/frontend/base/default/template/adyen/form/boleto.phtml CHANGED
@@ -59,7 +59,7 @@ $_code=$this->getMethodCode();
59
  type="text" id="<?php echo $_code ?>?>_firstname" name="payment[firstname]"
60
  title="<?php echo $this->__('Firstname') ?>"
61
  class="validate-ipayment-boleto-firstname required-entry input-text"
62
- value="" />
63
  </div>
64
  </li>
65
  <li>
@@ -69,7 +69,7 @@ $_code=$this->getMethodCode();
69
  type="text" id="<?php echo $_code ?>_lastname" name="payment[lastname]"
70
  title="<?php echo $this->__('Lastname') ?>"
71
  class="validate-ipayment-boleto-lastname required-entry input-text"
72
- value="" />
73
  </div>
74
  </li>
75
  </ul>
59
  type="text" id="<?php echo $_code ?>?>_firstname" name="payment[firstname]"
60
  title="<?php echo $this->__('Firstname') ?>"
61
  class="validate-ipayment-boleto-firstname required-entry input-text"
62
+ value="<?php echo $this->getFirstname() ?>" />
63
  </div>
64
  </li>
65
  <li>
69
  type="text" id="<?php echo $_code ?>_lastname" name="payment[lastname]"
70
  title="<?php echo $this->__('Lastname') ?>"
71
  class="validate-ipayment-boleto-lastname required-entry input-text"
72
+ value="<?php echo $this->getLastname() ?>" />
73
  </div>
74
  </li>
75
  </ul>
app/design/frontend/base/default/template/adyen/form/cc.phtml CHANGED
@@ -99,6 +99,48 @@
99
  </li>
100
  <?php endif;?>
101
  </ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  <?php if ($this->isCseEnabled()): ?>
103
  <input type="hidden" id="<?php echo $_code ?>_encrypted_form_expiry_generationtime" value="<?php echo date("c"); ?>" data-encrypted-name="generationtime" />
104
  <input type="hidden" id="adyen-cse-form" />
@@ -142,6 +184,13 @@
142
  originalSaveMethod();
143
  });
144
  }
 
 
 
 
 
 
 
145
  }
146
 
147
  if (document.readyState === "complete") {
99
  </li>
100
  <?php endif;?>
101
  </ul>
102
+
103
+ <script type="text/javascript">
104
+
105
+ var ChangeCCType= function(event) {
106
+
107
+ // clear the select box
108
+ document.getElementById('<?php echo $_code ?>_installments').options.length = 0;
109
+
110
+ // get the installments for this cardtype
111
+ var ccType = $('<?php echo $_code?>_cc_type').value;
112
+
113
+ var url = '<?php echo $this->getUrl('adyen/GetInstallments'); ?>';
114
+
115
+ new Ajax.Request(url, {
116
+ parameters: {ccType: ccType, isAjax: 1, method: 'POST'},
117
+ onSuccess: function(transport) {
118
+
119
+ if(transport.status == 200) {
120
+
121
+ var response = transport.responseText.evalJSON();
122
+
123
+ for (var key in response) {
124
+
125
+ // change the installments
126
+ var opt = document.createElement('option');
127
+ opt.text = response[key]
128
+ opt.value = key;
129
+ $('<?php echo $_code ?>_installments').options.add(opt);
130
+
131
+ }
132
+ }
133
+ },
134
+ onFailure: function(){
135
+ alert('<?php echo $this->jsQuoteEscape($this->__('Server Error. Please try again.')) ?>');
136
+ }
137
+ });
138
+ }
139
+ // event on change Credit Card Type
140
+ Event.observe($('<?php echo $_code?>_cc_type'), 'change', ChangeCCType);
141
+
142
+ </script>
143
+
144
  <?php if ($this->isCseEnabled()): ?>
145
  <input type="hidden" id="<?php echo $_code ?>_encrypted_form_expiry_generationtime" value="<?php echo date("c"); ?>" data-encrypted-name="generationtime" />
146
  <input type="hidden" id="adyen-cse-form" />
184
  originalSaveMethod();
185
  });
186
  }
187
+
188
+ // Fix for the onestepcheckout plugins
189
+ if($('onestepcheckout-place-order')) {
190
+ $('onestepcheckout-place-order').observe('click', function(e) {
191
+ cse.call(this);
192
+ });
193
+ }
194
  }
195
 
196
  if (document.readyState === "complete") {
app/design/frontend/base/default/template/adyen/form/hpp.phtml CHANGED
@@ -27,86 +27,117 @@
27
  ?>
28
  <?php $_code = $this->getMethodCode() ?>
29
 
30
- <?php $disabled = $this->hppOptionsDisabled(); ?>
31
- <?php $enabledTypes = $this->getHppAvailableTypes(); ?>
32
- <?php //$idealList = $this->getIdealAvailableTypes();?>
33
 
 
 
 
34
 
 
 
35
 
36
- <fieldset class="form-list">
37
- <ul id="payment_form_<?php echo $_code ?>" style="display:none">
38
- <li>
39
- <?php echo $this->__('You will be redirected to Adyen website when you place an order.') ?>
40
- </li>
41
- <?php if(empty($disabled) && !empty($enabledTypes)): ?>
42
- <li>
43
- <label for="<?php echo $_code ?>_hpp_type" class="required"><em>*</em><?php echo $this->__('Hosted Payment Type') ?></label>
44
- <div class="input-box required-entry">
45
- <?php foreach ($enabledTypes as $_typeCode=>$_type): ?>
46
- <?php $_typeName = $_type['name']; ?>
47
- <?php $filename = Mage::getBaseDir().DS.'skin'.DS.'frontend'.DS.'base'.DS.'default'.DS.'images'.DS.'adyen'.DS."$_typeCode.png" ?>
48
- <table>
49
- <tr>
50
- <td width="20px">
51
- <input type="radio" id="hpp_type_<?php echo $_typeCode ?>" name="payment[hpp_type]" value="<?php echo $_typeCode ?>"/>
52
- </td>
53
- <?php if (file_exists($filename)): ?>
54
- <td width="80px"><img src="<?php echo $this->getSkinUrl('images'.DS.'adyen'.DS."$_typeCode.png") ?>" alt="<?php echo $_typeName ?>" /></td>
55
- <?php endif ?>
56
-
57
- <?php if ($_typeName == "pm.c_cash.buttonName"):
58
- $_typeName = "Cash";
59
- endif; ?>
60
- <td><?php echo $this->__($_typeName) ?></td>
61
-
62
- <?php if ($_typeCode == 'ideal' && !empty($_type['issuers'])): ?>
63
- <td class="payment_form_ideal">
64
- <fieldset class="form-list">
65
- <ul id="payment_form_ideal" style="display:none">
66
- <?php
67
- foreach ($_type['issuers'] as $_issueId => $_IssueLabel): ?>
68
  <?php
69
- $_bankFile = strtoupper(str_replace(" ", '', $_IssueLabel));
70
- $_filename = Mage::getBaseDir().DS.'skin'.DS.'frontend'.DS.'base'.DS.'default'.DS.'images'.DS.'adyen'.DS."$_bankFile.png";
71
- if (empty($_issueId) || empty($_IssueLabel)) continue;
72
- ?>
73
- <table class="banks">
74
- <tr>
75
- <td width="20px">
76
- <input type="radio" id="hpp_ideal_type_<?php echo $_issueId ?>" name="payment[hpp_ideal_type]" value="<?php echo $_issueId .DS. $_IssueLabel ?>"/>
77
- </td>
78
- <?php if (file_exists($_filename)): ?>
79
- <td width="80px"><img src="<?php echo $this->getSkinUrl('images'.DS.'adyen'.DS."$_bankFile.png") ?>" alt="<?php echo $_IssueLabel ?>" label="<?php echo $_IssueLabel ?>" /></td>
80
- <?php else: ?>
81
- <td width="80px" class="label_hpp_ideal_type"><label width="80px" for="ideal_type_label_<?php echo $_issueId ?>"><?php echo $_IssueLabel ?></label></td>
82
- <?php endif; ?>
83
- </tr>
84
- </table>
85
- <?php endforeach ?>
86
- </ul>
87
- </fieldset>
88
- </td>
89
- <?php endif; ?>
90
- </tr>
91
- </table>
92
- <script type="text/javascript">
93
- //<![CDATA[
94
-
95
- var IdealChecked= function() {
96
- var method = $('hpp_type_<?php echo $_typeCode?>');
97
- if (method.value == 'ideal') {
98
- $('payment_form_ideal').show();
99
- } else {
100
- $('payment_form_ideal').hide();
101
- }
102
- };
103
- Event.observe($('hpp_type_<?php echo $_typeCode?>'), 'change', IdealChecked);
104
-
105
- //]]>
106
- </script>
107
- <?php endforeach ?>
108
- </div>
109
- </li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  <?php endif; ?>
111
  </ul>
112
  </fieldset>
27
  ?>
28
  <?php $_code = $this->getMethodCode() ?>
29
 
30
+ <?php $disabled = $this->getHppOptionsDisabled();?>
 
 
31
 
32
+ <fieldset class="">
33
+ <?php $hidePaymentMethod = ($disabled) ? ' style="display: none;"' : '';?>
34
+ <?php
35
 
36
+ // use a different name if hpp options is in the checkout, then this form must always be visable so change the id from basic to let this ignore in the switchMethod javascript call of Magento
37
+ $paymentmethodId = ($disabled) ? "payment_form_" : "hpp_payment_form_";
38
 
39
+ ?>
40
+ <ul id="<?php echo $paymentmethodId . $_code ?>"<?php echo $hidePaymentMethod; ?>>
41
+ <?php
42
+ if(empty($disabled)):
43
+ $enabledTypes = $this->getHppAvailableTypes();
44
+ if(!empty($enabledTypes)):
45
+ ?>
46
+ <li>
47
+ <div class="input-box required-entry">
48
+ <?php foreach ($enabledTypes as $_typeCode=>$_type): ?>
49
+ <?php $_typeName = $_type['name']; ?>
50
+ <?php $filename = Mage::getBaseDir().DS.'skin'.DS.'frontend'.DS.'base'.DS.'default'.DS.'images'.DS.'adyen'.DS."$_typeCode.png" ?>
51
+ <table>
52
+ <tr>
53
+ <td width="20px">
54
+ <input type="radio" id="hpp_type_<?php echo $_typeCode ?>" name="payment[hpp_type]" value="<?php echo $_typeCode ?>"/>
55
+ </td>
56
+ <?php if (file_exists($filename)): ?>
57
+ <td width="80px"><img src="<?php echo $this->getSkinUrl('images'.DS.'adyen'.DS."$_typeCode.png") ?>" alt="<?php echo $_typeName ?>" /></td>
58
+ <?php endif ?>
59
+
60
+ <?php if ($_typeName == "pm.c_cash.buttonName"):
61
+ $_typeName = "Cash";
62
+ endif; ?>
63
+ <td><?php echo $this->__($_typeName) ?></td>
64
+
65
+ <?php if ($_typeCode == 'ideal' && !empty($_type['issuers'])): ?>
66
+ <td class="payment_form_ideal">
67
+ <fieldset class="form-list">
68
+ <ul id="payment_form_ideal" style="display:none">
 
 
69
  <?php
70
+ foreach ($_type['issuers'] as $_issueId => $_IssueLabel): ?>
71
+ <?php
72
+ $_bankFile = strtoupper(str_replace(" ", '', $_IssueLabel));
73
+ $_filename = Mage::getBaseDir().DS.'skin'.DS.'frontend'.DS.'base'.DS.'default'.DS.'images'.DS.'adyen'.DS."$_bankFile.png";
74
+ if (empty($_issueId) || empty($_IssueLabel)) continue;
75
+ ?>
76
+ <table class="banks">
77
+ <tr>
78
+ <td width="20px">
79
+ <input type="radio" id="hpp_ideal_type_<?php echo $_issueId ?>" name="payment[hpp_ideal_type]" value="<?php echo $_issueId .DS. $_IssueLabel ?>"/>
80
+ </td>
81
+ <?php if (file_exists($_filename)): ?>
82
+ <td width="80px"><img src="<?php echo $this->getSkinUrl('images'.DS.'adyen'.DS."$_bankFile.png") ?>" alt="<?php echo $_IssueLabel ?>" label="<?php echo $_IssueLabel ?>" /></td>
83
+ <?php else: ?>
84
+ <td width="80px" class="label_hpp_ideal_type"><label width="80px" for="ideal_type_label_<?php echo $_issueId ?>"><?php echo $_IssueLabel ?></label></td>
85
+ <?php endif; ?>
86
+ </tr>
87
+ </table>
88
+ <?php endforeach ?>
89
+ </ul>
90
+ </fieldset>
91
+ </td>
92
+ <?php endif; ?>
93
+ </tr>
94
+ </table>
95
+ <script type="text/javascript">
96
+ //<![CDATA[
97
+
98
+ var IdealChecked= function() {
99
+
100
+ // uncheck hpp_oneclick if exists
101
+ if($('oneclick_payment_form_adyen_oneclick'))
102
+ {
103
+ var form = $('oneclick_payment_form_adyen_oneclick');
104
+ var elements = form.getElementsByTagName('input');
105
+ for (var i=0; i<elements.length; i++) elements[i].checked = false;
106
+
107
+ // hide open cvc field
108
+ $$('.cvc_block').each(
109
+ function (e) {
110
+ e.setStyle({display:'none'});
111
+ }
112
+ );
113
+
114
+ }
115
+
116
+ var method = $('hpp_type_<?php echo $_typeCode?>');
117
+
118
+ // set the adyen_hpp payment method
119
+ $('p_method_adyen_hpp').checked = true;
120
+
121
+ payment.switchMethod("adyen_hpp");
122
+
123
+
124
+ if (method.value == 'ideal') {
125
+ $('payment_form_ideal').show();
126
+ } else {
127
+ $('payment_form_ideal').hide();
128
+ }
129
+ };
130
+ Event.observe($('hpp_type_<?php echo $_typeCode?>'), 'change', IdealChecked);
131
+ //]]>
132
+ </script>
133
+ <?php endforeach ?>
134
+ </div>
135
+ </li>
136
+ <?php endif; ?>
137
+ <?php else: ?>
138
+ <li>
139
+ <?php echo $this->__('You will be redirected to Adyen website when you place an order.') ?>
140
+ </li>
141
  <?php endif; ?>
142
  </ul>
143
  </fieldset>
app/design/frontend/base/default/template/adyen/form/oneclick.phtml ADDED
@@ -0,0 +1,340 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Adyen Payment Module
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @category Adyen
16
+ * @package Adyen_Payment
17
+ * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+ /**
21
+ * @category Payment Gateway
22
+ * @package Adyen_Payment
23
+ * @author Adyen
24
+ * @property Adyen B.V
25
+ * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
26
+ */
27
+ ?>
28
+ <?php $_code=$this->getMethodCode() ?>
29
+
30
+
31
+ <div id="oneclick-cse" class="">
32
+
33
+ <?php $_listRecurringDetails = $this->getlistRecurringDetails(); ?>
34
+
35
+ <?php if(!empty($_listRecurringDetails)): ?>
36
+
37
+ <h3><?php echo $this->__('Pay using previously stored details') ?></h3>
38
+ <ul id="oneclick_payment_form_<?php echo $_code ?>" class="recurring-creditcards">
39
+ <?php
40
+ $count = 0;
41
+ foreach($_listRecurringDetails as $key => $value):?>
42
+ <?php if(isset($value["recurringDetailReference"]) && isset($value["variant"]) && isset($value["card_number"]) && isset($value["card_expiryMonth"]) && isset($value["card_expiryYear"])): ?>
43
+ <li>
44
+ <input id="recurring_type_<?php echo $key; ?>" class="recurring_type" type="radio" name="payment[recurring]" value="<?php echo $key; ?>" />
45
+ <input type="hidden" name="payment[recurringDetailReference_<?php echo $key; ?>]" value="<?php echo $value["recurringDetailReference"] ?>" />
46
+
47
+ <input type="hidden" name="payment[oneclick_owner_<?php echo $key; ?>]" value="<?php echo $value["card_holderName"] ?>" />
48
+ <input type="hidden" name="payment[oneclick_type_<?php echo $key; ?>]" value="<?php echo $value["variant"] ?>" />
49
+ <input type="hidden" name="payment[oneclick_last_4_<?php echo $key; ?>]" value="<?php echo $value["card_number"] ?>" />
50
+
51
+ <input type="hidden" id="card_expiry_month_<?php echo $key; ?>" name="card_expiry_month_<?php echo $key; ?>" value="<?php echo $value["card_expiryMonth"] ?>" />
52
+ <input type="hidden" id="card_expiry_year_<?php echo $key; ?>" name="card_expiry_year_<?php echo $key; ?>" value="<?php echo $value["card_expiryYear"] ?>" />
53
+
54
+ <div class="creditcard-block">
55
+ <?php
56
+ $_bankFile = $value["variant"];
57
+ $_filename = Mage::getBaseDir().DS.'skin'.DS.'frontend'.DS.'base'.DS.'default'.DS.'images'.DS.'adyen'.DS. $_bankFile ."_small.png";
58
+
59
+ ?>
60
+ <?php if (file_exists($_filename)){ ?>
61
+ <img src="<?php echo $this->getSkinUrl('images'.DS.'adyen'.DS. $_bankFile . "_small.png") ?>" alt="<?php echo $_bankFile ?>" label="<?php echo $_bankFile ?>" />
62
+ <?php } ?>
63
+
64
+
65
+ <div class="columns three a">
66
+ <label><?php echo $this->__('Credit Card Number') ?></label>
67
+ <span>****</span> <?php echo $value["card_number"]; ?>
68
+ </div>
69
+
70
+ <div class="columns three b">
71
+ <label><?php echo $this->__('Expiration Date') ?><a href="#" id="update-expiration-date-<?php echo $key; ?>" class="update-expiration-date" style="display:none;"><?php echo $this->__('(update)') ?></a></label>
72
+
73
+ <div id="static-card-expiry-<?php echo $key; ?>" class="static-card-expiry">
74
+ <?php echo $value["card_expiryMonth"] . " /" . $value["card_expiryYear"]; ?>
75
+ </div>
76
+ <div id="changable-card-expiry-<?php echo $key; ?>" class="changable-card-expiry" style="display:none;">
77
+ <select id="<?php echo $_code ?>_expiration_<?php echo $key; ?>" <?php echo (!$this->isCseEnabled() ? "name=\"payment[oneclick_exp_month_".$key."]\"" : ""); ?> class="month validate-oneclick-exp required-entry">
78
+ <?php foreach ($this->getCcMonths() as $k=>$v): ?>
79
+ <option value="<?php echo $k?$k:'' ?>"<?php if($k==$value["card_expiryMonth"]): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
80
+ <?php endforeach ?>
81
+ </select>
82
+
83
+ <select id="<?php echo $_code ?>_expiration_yr_<?php echo $key; ?>" <?php echo (!$this->isCseEnabled() ? "name=\"payment[oneclick_exp_year_".$key."]\"" : ""); ?> class="year required-entry">
84
+ <?php foreach ($this->getCcYears() as $k=>$v): ?>
85
+ <option value="<?php echo $k?$k:'' ?>"<?php if($k==$value["card_expiryYear"]): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
86
+ <?php endforeach ?>
87
+ </select>
88
+ </div>
89
+ </div>
90
+
91
+
92
+ <?php if($this->isNotRecurring()): ?>
93
+ <div class="columns three c">
94
+ <label><?php echo $this->__('Card Verification Number') ?></label>
95
+ <?php if($this->hasVerification()): ?>
96
+ <div style="display:none;" class="cvc_block" id="cvc_block_<?php echo $key;?>">
97
+ <input type="text" title="<?php echo $this->__('Card Verification Number') ?>" class="input-text cvv required-entry" id="<?php echo $_code ?>_oneclick_cid_<?php echo $key; ?>" <?php echo (!$this->isCseEnabled() ? "name=\"payment[oneclick_cid_".$key."]\"" : ""); ?> value="" />
98
+ <a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
99
+ </div>
100
+ <?php endif; ?>
101
+ </div>
102
+ <?php endif; ?>
103
+
104
+ <div style="clear:both;"></div>
105
+
106
+ <div class="creditcard-holder-name"><?php echo $value["card_holderName"]; ?></div>
107
+
108
+ <div style="clear:both;"></div>
109
+ </div>
110
+ <?php ++$count; ?>
111
+ </li>
112
+ <?php endif; ?>
113
+ <?php endforeach; ?>
114
+ </ul>
115
+
116
+ <h3 class="other-payment"><?php echo $this->__('Or pay using one of the methods below') ?></h3>
117
+
118
+ <script type="text/javascript">
119
+
120
+ // update-expiration-date action
121
+ $$('.update-expiration-date').each(function(element) {
122
+ element.observe('click', updateExpirationDate);
123
+ });
124
+
125
+ // show the expiration month and year
126
+ function updateExpirationDate(event) {
127
+
128
+ // hide the link
129
+ this.hide();
130
+
131
+ // show expiration month and year
132
+ var id = this.id.replace("update-expiration-date-", "");
133
+ var changableId = "changable-card-expiry-" + id;
134
+ var staticId = "static-card-expiry-" + id;
135
+
136
+ // show changeble card expiry
137
+ $(staticId).hide();
138
+ $(changableId).show();
139
+
140
+ event.preventDefault();
141
+ }
142
+
143
+ // change selection of recurring card
144
+ $$(".recurring_type").invoke('observe', 'change', function() {
145
+
146
+ // set the adyen_oneclick payment method
147
+ $('p_method_adyen_oneclick').checked = true;
148
+ payment.switchMethod("adyen_oneclick");
149
+
150
+ // uncheck hpp_method if exists
151
+ if($('hpp_payment_form_adyen_hpp'))
152
+ {
153
+ var form = $('hpp_payment_form_adyen_hpp');
154
+ var elements = form.getElementsByTagName('input');
155
+ for (var i=0; i<elements.length; i++) elements[i].checked = false;
156
+ }
157
+
158
+ // remove all the data-encrypted-name="cvc" for CSE
159
+ removeAllAttributeCvc();
160
+
161
+ // remove all the data-encrypted-name="expiryMonth" and data-encrypted-name="expiryYear" for CSE
162
+ removeAllAttributeExpiryMonthAndYear();
163
+
164
+ // hide all the open blocks
165
+ hideCvcBlocks();
166
+
167
+ // open the selected block
168
+ var key = this.value;
169
+ var id = "cvc_block_" + key;
170
+
171
+ // hide changeble card and show static expiration date
172
+ hideChangableCardExpiry()
173
+
174
+ // show static version of expiry month and year when switching creditcard
175
+ showStaticCardExpiry();
176
+
177
+ // hide the update expiration date link for recurring cards
178
+ hideExpirationDate();
179
+
180
+ // show current recurring block update link
181
+ var updateLink = "update-expiration-date-"+key;
182
+ $(updateLink).setStyle({
183
+ display: 'inline'
184
+ });
185
+
186
+ // set data-encrypted-name="cvc" to this element
187
+ var cvv = "adyen_oneclick_oneclick_cid_"+key;
188
+ var expiryMonth = "adyen_oneclick_expiration_" + key;
189
+ var expiryYear = "adyen_oneclick_expiration_yr_"+key;
190
+
191
+ // reset the custom input datemonth and dateyear by the static version (could be changed by customer)
192
+ var card_expiry_month = 'card_expiry_month_'+key;
193
+ var card_expiry_year = 'card_expiry_year_'+key;
194
+ $(expiryMonth).value = $(card_expiry_month).value;
195
+ $(expiryYear).value = $(card_expiry_year).value;
196
+
197
+ // only set data-encrypted-name="expiryMonth" and data-encrypted-name="expiryYear" for the selected card
198
+ $(expiryMonth).setAttribute('data-encrypted-name-oneclick', "expiryMonth");
199
+ $(expiryYear).setAttribute('data-encrypted-name-oneclick', "expiryYear");
200
+ $(cvv).setAttribute('data-encrypted-name-oneclick', "cvc");
201
+
202
+ // show the cvc input field
203
+ $(id).show();
204
+ });
205
+
206
+ // remove all cvc data-encrypted-name attributes
207
+ // and uncheck HPP payment method selection
208
+ function removeAllAttributeCvc() {
209
+
210
+ var form = $('hpp_payment_form_adyen_hpp');
211
+ if(form)
212
+ {
213
+ var elements = form.getElementsByTagName('input');
214
+ for (var i=0; i<elements.length; i++) elements[i].checked = false;
215
+ }
216
+
217
+ $$('.cvv').each(
218
+ function (e) {
219
+ e.removeAttribute("data-encrypted-name-oneclick");
220
+ }
221
+ );
222
+ }
223
+
224
+ // remove all the data-encrypted-name="expiryMonth" and data-encrypted-name="expiryYear" for CSE
225
+ function removeAllAttributeExpiryMonthAndYear() {
226
+ $$('.month').each(
227
+ function (e) {
228
+ e.removeAttribute("data-encrypted-name-oneclick");
229
+ }
230
+ );
231
+
232
+ $$('.year').each(
233
+ function (e) {
234
+ e.removeAttribute("data-encrypted-name-oneclick");
235
+ }
236
+ );
237
+ }
238
+
239
+ // hide all the cvc blocks for the recurring cards
240
+ function hideCvcBlocks() {
241
+ $$('.cvc_block').each(
242
+ function (e) {
243
+ e.setStyle({display:'none'});
244
+ }
245
+ );
246
+ }
247
+
248
+ function hideChangableCardExpiry() {
249
+ $$('.changable-card-expiry').each(
250
+ function (e) {
251
+ e.setStyle({display:'none'});
252
+ }
253
+ );
254
+ }
255
+
256
+ // show the non changable card expiry month and ydaear
257
+ function showStaticCardExpiry() {
258
+ $$('.static-card-expiry').each(
259
+ function (e) {
260
+ e.setStyle({display:'block'});
261
+ }
262
+ );
263
+ }
264
+
265
+ // hide the update expiration date link for recurring cards
266
+ function hideExpirationDate() {
267
+ $$('.update-expiration-date').each(
268
+ function (e) {
269
+ e.hide();
270
+ }
271
+ );
272
+ }
273
+ </script>
274
+ <?php endif; ?>
275
+
276
+ <?php if ($this->isCseEnabled()): ?>
277
+ <input type="hidden" id="<?php echo $_code ?>_encrypted_form_expiry_generationtime" value="<?php echo date("c"); ?>" data-encrypted-name-oneclick="generationtime" />
278
+ <input type="hidden" id="adyen-cse-form" />
279
+ <script type="text/javascript">
280
+ //<![CDATA[
281
+ var cse_form = document.getElementById('adyen-cse-form').form;
282
+ var cse_key = <?php echo json_encode($this->getCsePublicKey()); ?>;
283
+ var cse_options_oneclick = {
284
+ name: 'payment[encrypted_data_oneclick]',
285
+ force: true,
286
+ dataEncryptedName: "data-encrypted-name-oneclick"
287
+ };
288
+ var cseOneClick = function() {
289
+ if (payment.currentMethod && payment.currentMethod == '<?php echo $_code ?>') {
290
+ try {
291
+ adyen.encrypt.createEncryptedForm(cse_form, cse_key, cse_options_oneclick);
292
+ } catch (e) {
293
+ var encryptionFailed = true;
294
+ }
295
+ var encryptedForm = document.getElementById(cse_options_oneclick.name);
296
+ if (encryptionFailed || !encryptedForm || encryptedForm.value.length == 0) {
297
+ alert("Warning: Adyen Client Side Encryption cannot succeed.");
298
+ }
299
+ }
300
+ }
301
+ var cse_oneclick_initialize = function() {
302
+ if (typeof adyen === 'undefined') {
303
+ js = document.createElement("script");
304
+ js.type = "text/javascript";
305
+ js.src = "<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS); ?>adyen/payment/adyen.encrypt.js";
306
+ document.body.appendChild(js);
307
+ }
308
+ if (typeof payment.save !== 'undefined') {
309
+ payment.save = payment.save.wrap(function(originalSaveMethod) {
310
+ cseOneClick.call(this);
311
+ originalSaveMethod();
312
+ });
313
+ }
314
+ if (typeof checkout.save !== 'undefined') {
315
+ checkout.save = checkout.save.wrap(function(originalSaveMethod) {
316
+ cseOneClick.call(this);
317
+ originalSaveMethod();
318
+ });
319
+ }
320
+
321
+ // Fix for the onestepcheckout plugins
322
+ if($('onestepcheckout-place-order')) {
323
+ $('onestepcheckout-place-order').observe('click', function(e) {
324
+ cseOneClick.call(this);
325
+ });
326
+ }
327
+ }
328
+
329
+ if (document.readyState === "complete") {
330
+ cse_oneclick_initialize();
331
+ }
332
+ else {
333
+ Event.observe(window, 'load', cse_oneclick_initialize);
334
+ }
335
+ //]]>
336
+ </script>
337
+ <?php endif;?>
338
+
339
+
340
+ </div>
app/design/frontend/base/default/template/adyen/form/openinvoice.phtml CHANGED
@@ -27,16 +27,66 @@
27
  ?>
28
  <?php //TODO add a form to add data here, currently only on Adyen. ?>
29
  <?php $_code = $this->getMethodCode(); ?>
30
- <fieldset class="form-list">
31
- <ul id="payment_form_<?php echo $_code ?>" style="display:none">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  <li>
33
- <?php echo $this->__('You will be redirected to Adyen website when you place an order.') ?>
34
  </li>
35
  </ul>
36
  </fieldset>
37
- <div>
38
- <span id="ipayment-elv-please-wait" style="display:none;" class="opc-please-wait">
39
- <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" class="v-middle" alt=""/> &nbsp; <?php echo $this->__('Submitting payment information...') ?> &nbsp;
40
- </span>
41
- </div>
42
-
27
  ?>
28
  <?php //TODO add a form to add data here, currently only on Adyen. ?>
29
  <?php $_code = $this->getMethodCode(); ?>
30
+ <fieldset class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none">
31
+ <ul>
32
+
33
+ <?php if($this->genderShow()):?>
34
+ <li><label for="gender" class="required"><em>*</em><?php echo $this->__('Gender') ?></label>
35
+ <div class="input-box">
36
+ <select id="gender" name="payment[gender]" title="<?php echo $this->__('Gender') ?>" class="validate-select">
37
+ <?php $options = Mage::getResourceSingleton('customer/customer')->getAttribute('gender')->getSource()->getAllOptions();?>
38
+ <?php $value = $this->getGender();?>
39
+ <?php foreach ($options as $option):?>
40
+ <option value="<?php echo $option['value'] ?>"<?php if ($option['value'] == $value) echo ' selected="selected"' ?>><?php echo $option['label'] ?></option>
41
+ <?php endforeach;?>
42
+ </select>
43
+ </div>
44
+ </li>
45
+ <?php endif; ?>
46
+
47
+ <?php if($this->dobShow()):?>
48
+ <li>
49
+ <label for="month" class="required"><em>*</em><?php echo $this->__('Date of Birth') ?></label>
50
+ <div class="input-box customer-dob">
51
+ <?php
52
+ $this->setDateInput('d',
53
+ '<div class="dob-day">
54
+ <input type="text" id="day" name="payment[day]" value="' . $this->getDay() . '" title="' . $this->__('Day') . '" class="input-text validate-custom" />
55
+ <label for="' . $this->getFieldId('day') . '">' . $this->__('DD') . '</label>
56
+ </div>'
57
+ );
58
+
59
+ $this->setDateInput('m',
60
+ '<div class="dob-month">
61
+ <input type="text" id="month" name="payment[month]" value="' . $this->getMonth() . '" title="' . $this->__('Month') . '" class="input-text validate-custom" ' . $this->getFieldParams() . ' />
62
+ <label for="' . $this->getFieldId('month') . '">' . $this->__('MM') . '</label>
63
+ </div>'
64
+ );
65
+
66
+ $this->setDateInput('y',
67
+ '<div class="dob-year">
68
+ <input type="text" id="year" name="payment[year]" value="' . $this->getYear() . '" title="' . $this->__('Year') . '" class="input-text validate-custom" ' . $this->getFieldParams() . ' />
69
+ <label for="' . $this->getFieldId('year') . '">' . $this->__('YYYY') . '</label>
70
+ </div>'
71
+ );
72
+ ?>
73
+ <?php echo $this->getSortedDateInputs() ?>
74
+ <div class="dob-full" style="display:none;">
75
+ <input type="hidden" id="dob" name="payment[dob]" />
76
+ </div>
77
+
78
+ <div class="validation-advice" style="display:none;"></div>
79
+ </div>
80
+ <script type="text/javascript">
81
+ //<![CDATA[
82
+ var customer_dob = new Varien.DOB('.customer-dob', true, '<?php echo $this->getDateFormat() ?>');
83
+ //]]>
84
+ </script>
85
+ </li>
86
+ <?php endif; ?>
87
+
88
  <li>
89
+ <?php echo $this->__('You will be redirected to Adyen website when you place an order.') ?>
90
  </li>
91
  </ul>
92
  </fieldset>
 
 
 
 
 
 
app/design/frontend/base/default/template/adyen/form/sepa.phtml ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Adyen Payment Module
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @category Adyen
16
+ * @package Adyen_Payment
17
+ * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+ /**
21
+ * @category Payment Gateway
22
+ * @package Adyen_Payment
23
+ * @author Adyen
24
+ * @property Adyen B.V
25
+ * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
26
+ */
27
+ $_code=$this->getMethodCode();
28
+ ?>
29
+ <fieldset class="form-list">
30
+ <ul id="payment_form_<?php echo $_code ?>" style="display:none">
31
+
32
+ <li>
33
+ <div class="input-box">
34
+ <label for="<?php echo $_code ?>_account_number"><?php echo $this->__('Bank account holder name') ?> <span class="required">*</span></label><br />
35
+ <input
36
+ type="text" id="<?php echo $_code ?>_account_name" name="payment[account_name]"
37
+ title="<?php echo $this->__('Bank account holder name') ?>"
38
+ class="validate-ipayment-sepa-account-name required-entry input-text"
39
+ value="" autocomplete="off"
40
+ />
41
+ </div>
42
+ </li>
43
+ <li>
44
+ <div class="input-box">
45
+ <label for="<?php echo $_code ?>_iban"><?php echo $this->__('IBAN') ?> <span class="required">*</span></label><br />
46
+ <input
47
+ type="text" id="<?php echo $_code ?>_iban" name="payment[iban]"
48
+ title="<?php echo $this->__('IBAN') ?>"
49
+ class="validate-ipayment-sepa-iban required-entry input-text"
50
+ value="" autocomplete="off"
51
+ />
52
+ </div>
53
+ </li>
54
+
55
+ <li>
56
+ <div class="input-box">
57
+ <label for="<?php echo $_code ?>_country"><?php echo $this->__('Country') ?> <span class="required">*</span></label><br />
58
+ <select id="<?php echo $_code ?>_country" name="payment[country]" name="payment[country]" title="<?php echo $this->__('Country') ?>" class="validate-ipayment-sepa-country required-entry input-√√√">
59
+ <option value="">--</option>
60
+ <option value="AT">Austria</option>
61
+ <option value="BE">Belgium</option>
62
+ <option value="BG">Bulgaria</option>
63
+ <option value="CH">Switzerland</option>
64
+ <option value="CY">Cyprus</option>
65
+ <option value="CZ">Czech Republic</option>
66
+ <option value="DE">Germany</option>
67
+ <option value="DK">Denmark</option>
68
+ <option value="EE">Estonia</option>
69
+ <option value="ES">Spain</option>
70
+ <option value="FI">Finland</option>
71
+ <option value="FR">France</option>
72
+ <option value="GB">United Kingdom</option>
73
+ <option value="GF">French Guiana</option>
74
+ <option value="GI">Gibraltar</option>
75
+ <option value="GP">Guadeloupe</option>
76
+ <option value="GR">Greece</option>
77
+ <option value="HR">Croatia</option>
78
+ <option value="HU">Hungary</option>
79
+ <option value="IE">Ireland</option>
80
+ <option value="IS">Iceland</option>
81
+ <option value="IT">Italy</option>
82
+ <option value="LI">Liechtenstein</option>
83
+ <option value="LT">Lithuania</option>
84
+ <option value="LU">Luxembourg</option>
85
+ <option value="LV">Latvia</option>
86
+ <option value="MC">Monaco</option>
87
+ <option value="MQ">Martinique</option>
88
+ <option value="MT">Malta</option>
89
+ <option value="NL">Netherlands</option>
90
+ <option value="NO">Norway</option>
91
+ <option value="PL">Poland</option>
92
+ <option value="PT">Portugal</option>
93
+ <option value="RE">Réunion</option>
94
+ <option value="RO">Romania</option>
95
+ <option value="SE">Sweden</option>
96
+ <option value="SI">Slovenia</option>
97
+ <option value="SK">Slovakia</option>
98
+ </select>
99
+ </div>
100
+ </li>
101
+ </ul>
102
+ </fieldset>
103
+ <div>
104
+ <span id="ipayment-sepa-please-wait" style="display:none;" class="opc-please-wait">
105
+ <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" class="v-middle" alt=""/> &nbsp; <?php echo $this->__('Submitting payment information...') ?> &nbsp;
106
+ </span>
107
+ </div>
108
+
app/design/frontend/base/default/template/adyen/info/sepa.phtml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Adyen Payment Module
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @category Adyen
16
+ * @package Adyen_Payment
17
+ * @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+ /**
21
+ * @category Payment Gateway
22
+ * @package Adyen_Payment
23
+ * @author Adyen
24
+ * @property Adyen B.V
25
+ * @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
26
+ */
27
+ ?>
28
+ <?php if ($_info = $this->getInfo()): ?>
29
+ <?php $sepa = unserialize($this->getInfo()->getPoNumber())?>
30
+ <?php echo Mage::helper('adyen')->__('Bank account holder name: %s', $this->htmlEscape($sepa['account_name'])) ?><br/>
31
+ <?php echo Mage::helper('adyen')->__('IBAN: %s', $this->htmlEscape($sepa['iban'])) ?><br/>
32
+ <?php echo Mage::helper('adyen')->__('Country: %s', $this->htmlEscape($sepa['country'])) ?><br/>
33
+ <?php endif; ?>
app/design/frontend/base/default/template/adyen/posExpressCheckout.phtml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php if($this->hasExpressCheckout()): ?>
3
+
4
+ <form action="<?php echo $this->getUrl("adyen/checkoutPos"); ?>" method="post">
5
+ <input style="width:250px;" type="text" class="input-text" name="adyenPosEmail" id="adyenPosEmail" value="" size="60" placeholder="Email" autocapitalize="off"/>
6
+
7
+ <button id="StartScan" style="" type="submit" title="Start Auto Scanning" class="button btn-proceed-checkout btn-checkout">
8
+ <span><span>Checkout with POS</span></span>
9
+ </button>
10
+
11
+ </form>
12
+ <div>-OR-</div>
13
+
14
+ <?php endif; ?>
app/design/frontend/base/default/template/adyen/scanProduct.phtml ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php if($this->hasEnableScanner()): ?>
3
+ <div id="adyenCustomScanWrapper">
4
+ <form id="addToCartBarCode" method='post' action="<?php echo $this->getUrl("adyen/updateCart/index"); ?>">
5
+
6
+ <h3>Barcode scanner</h3>
7
+
8
+ <div id="scan">
9
+ <input type="text" class="input-text" name="code" id="inpscan" value="" size="60" placeholder="Scan barcode with scanner" autofocus/>
10
+ </div>
11
+
12
+ <div id="customscan" style="display:none;">
13
+ <input type="text" class="input-text" name="customcode" id="inpcustomscan" value="" size="60" placeholder="Fil in custom barcode">
14
+ <button id="SubmitCustomScan" type="button" title="Submit" class="button btn-proceed-checkout btn-checkout">
15
+ <span><span>Add</span></span>
16
+ </button>
17
+ </div>
18
+
19
+ <br />
20
+ <button id="StopCustomScan" type="button" title="Custom barcode" class="button btn-proceed-checkout btn-checkout">
21
+ <span><span>Custom barcode</span></span>
22
+ </button>
23
+
24
+ <button id="StartScan" style="display:none; margin:0;" type="button" title="Start Auto Scanning" class="button btn-proceed-checkout btn-checkout">
25
+ <span><span>Start Auto Scanning</span></span>
26
+ </button>
27
+
28
+ </form>
29
+
30
+
31
+ <script type="text/javascript">
32
+
33
+
34
+ var intervalId;
35
+ var scanInProgress = false;
36
+
37
+ // show autostart button for IOS because they block the onload focus event
38
+ var iOS = ( navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false );
39
+ if(iOS) {
40
+ // show auto startscan buttton
41
+ $('StartScan').show();
42
+ }
43
+
44
+ $('inpscan').observe('focus', function(e){
45
+ $('StartScan').hide();
46
+ intervalId = setInterval('scan()', 250);
47
+ });
48
+
49
+ $('inpscan').observe('blur', function(e){
50
+
51
+ clearInterval(intervalId);
52
+ $('StartScan').show();
53
+ });
54
+
55
+ $('StartScan').observe('click', function(e){
56
+
57
+ $('scan').show();
58
+ $('customscan').hide();
59
+
60
+ $('StopCustomScan').show();
61
+
62
+ $('inpscan').focus();
63
+ intervalId = setInterval('scan()', 250);
64
+ $('StartScan').hide();
65
+
66
+ });
67
+
68
+ $('StopCustomScan').observe('click', function(e){
69
+ $('scan').hide();
70
+ $('customscan').show();
71
+ $('inpcustomscan').focus();
72
+ $('StopCustomScan').hide();
73
+ $('StartScan').show();
74
+
75
+ });
76
+
77
+ $('SubmitCustomScan').observe('click', function(e){
78
+ var value = $('inpcustomscan').value;;
79
+ ajaxCall(value);
80
+ $('inpcustomscan').value = "";
81
+ $('inpcustomscan').focus();
82
+ e.preventDefault();
83
+ });
84
+
85
+
86
+
87
+ // check if scan is done with scanning
88
+ function checkValueInput(value) {
89
+
90
+ var currentValue = $('inpscan').value;
91
+
92
+ if(value == currentValue) {
93
+ // DO ajax call
94
+ ajaxCall(value);
95
+ $('inpscan').value = "";
96
+ this.scanInProgress = false;
97
+ return;
98
+ }
99
+
100
+ // call same function after certain period of time
101
+ var test = setTimeout("checkValueInput($('inpscan').value)", 100);
102
+ }
103
+
104
+
105
+ function scan() {
106
+
107
+ if(this.scanInProgress === false) {
108
+
109
+ // get value
110
+ var value = $('inpscan').value;
111
+ if(value) {
112
+ this.scanInProgress = true;
113
+
114
+ // extra check for full input from scanner
115
+ setTimeout("checkValueInput($('inpscan').value)", 250);
116
+ }
117
+ }
118
+ }
119
+
120
+ function ajaxCall(code) {
121
+
122
+ var form = document.getElementById("addToCartBarCode");
123
+ new Ajax.Request(form.action, {
124
+ parameters: {code: code, isAjax: 1, method: 'POST'},
125
+ onSuccess: function(transport) {
126
+
127
+ var response = transport.responseText;
128
+ // update
129
+ $$('.col-main').each(
130
+ function (e) {
131
+ e.update(response);
132
+ }
133
+ );
134
+ },
135
+ onFailure: function(){
136
+ alert('<?php echo $this->jsQuoteEscape($this->__('Server Error. Please try again.')) ?>');
137
+ }
138
+ });
139
+
140
+ }
141
+ </script>
142
+ </div>
143
+ <?php endif; ?>
app/design/frontend/default/adyen/template/checkout/onepage/payment/methods.phtml ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * One page checkout payment methods
30
+ *
31
+ * @var $this Mage_Checkout_Block_Onepage_Payment_Methods
32
+ */
33
+ ?>
34
+
35
+ <?php
36
+ $methods = $this->getMethods();
37
+ $oneMethod = count($methods) <= 1;
38
+ ?>
39
+ <?php if (empty($methods)): ?>
40
+ <dt>
41
+ <?php echo $this->__('No Payment Methods') ?>
42
+ </dt>
43
+ <?php else:
44
+ foreach ($methods as $_method):
45
+ $_code = $_method->getCode();
46
+
47
+ $_style = "";
48
+ if($_code == "adyen_hpp") {
49
+
50
+ // get method and check if config payment/adyen_hpp/disable_hpptypes is set
51
+ $disabled = $_method->getHppOptionsDisabled();
52
+ if(!$disabled) {
53
+ $_style = ($_code == "adyen_hpp" && !$oneMethod) ? "display:none" : "";
54
+ }
55
+ } else if ($_code == "adyen_oneclick" && !$oneMethod) {
56
+ $_style = "display:none";
57
+ }
58
+
59
+ ?>
60
+ <dt style="<?php echo $_style; ?>">
61
+ <?php if(!$oneMethod): ?>
62
+ <input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" title="<?php echo $this->escapeHtml($_method->getTitle()) ?>" <?php if($this->getSelectedMethodCode()==$_code): ?> checked="checked"<?php endif; ?> class="radio" />
63
+ <?php else: ?>
64
+ <span class="no-display"><input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" checked="checked" class="radio" /></span>
65
+ <?php $oneMethod = $_code; ?>
66
+ <?php endif; ?>
67
+
68
+ <?php if(($_code == "adyen_hpp" && $disabled) || ($_code != "adyen_hpp")): ?>
69
+ <label for="p_method_<?php echo $_code ?>"><?php echo $this->escapeHtml($this->getMethodTitle($_method)) ?> <?php echo $this->getMethodLabelAfterHtml($_method) ?></label>
70
+ <?php endif; ?>
71
+ </dt>
72
+
73
+ <?php if ($html = $this->getPaymentMethodFormHtml($_method)): ?>
74
+ <dd>
75
+ <?php echo $html; ?>
76
+ </dd>
77
+ <?php endif; ?>
78
+ <script type="text/javascript">
79
+ //<![CDATA[
80
+
81
+ var SwitchMethod= function() {
82
+ var method = $('p_method_<?php echo $_code?>').value;
83
+
84
+ if(method != "adyen_hpp") {
85
+ // check if hpp is enabled if so clear the selected option because you select different payment method
86
+ if($('hpp_payment_form_adyen_hpp'))
87
+ {
88
+ var form = $('hpp_payment_form_adyen_hpp');
89
+ var elements = form.getElementsByTagName('input');
90
+ for (var i=0; i<elements.length; i++) elements[i].checked = false;
91
+ }
92
+ }
93
+
94
+ // check if adyen_oneclick is enabled
95
+ if(method != "adyen_oneclick") {
96
+ if($('oneclick_payment_form_adyen_oneclick'))
97
+ {
98
+ // if so clear the selected option because you select different payment method
99
+ var form = $('oneclick_payment_form_adyen_oneclick');
100
+ var elements = form.getElementsByTagName('input');
101
+ for (var i=0; i<elements.length; i++) elements[i].checked = false;
102
+
103
+ // don't show the cvc field
104
+ $$('.cvc_block').each(
105
+ function (e) {
106
+ e.setStyle({display:'none'});
107
+ }
108
+ );
109
+ }
110
+ }
111
+ payment.switchMethod(method);
112
+ };
113
+ Event.observe($('p_method_<?php echo $_code ?>'), 'change', SwitchMethod);
114
+
115
+ //]]>
116
+ </script>
117
+ <?php endforeach;
118
+ endif;
119
+ ?>
120
+ <?php echo $this->getChildChildHtml('additional'); ?>
121
+ <script type="text/javascript">
122
+ //<![CDATA[
123
+ <?php echo $this->getChildChildHtml('scripts'); ?>
124
+ payment.init();
125
+ <?php if (is_string($oneMethod)): ?>
126
+ payment.switchMethod('<?php echo $oneMethod ?>');
127
+ <?php endif; ?>
128
+
129
+ // always enable the hpp payment options if this payment method is on
130
+ if($('hpp_payment_form_adyen_hpp'))
131
+ {
132
+ var form = $('hpp_payment_form_adyen_hpp');
133
+ var elements = form.getElementsByTagName('input');
134
+ for (var i=0; i<elements.length; i++) elements[i].disabled = false;
135
+ }
136
+
137
+ // always enable the oneclick payments options if this payment method is on
138
+ if($('oneclick_payment_form_adyen_oneclick'))
139
+ {
140
+ var form = $('oneclick_payment_form_adyen_oneclick');
141
+ var elements = form.getElementsByTagName('input');
142
+ for (var i=0; i<elements.length; i++) elements[i].disabled = false;
143
+
144
+ // always enable the selectboxes for the oneclick creditcards
145
+ var elements = form.getElementsByTagName('select');
146
+ for (var i=0; i<elements.length; i++) elements[i].disabled = false;
147
+ }
148
+ //]]>
149
+ </script>
app/design/frontend/default/adyen/template/onestepcheckout/checkout.phtml ADDED
@@ -0,0 +1,1319 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $step_counter = 1;
4
+ $helper = Mage::helper('onestepcheckout/checkout');
5
+
6
+ ?>
7
+ <?php if(!$this->canCheckout() || !$this->validateMinimumAmount()): ?>
8
+ <?php if($this->settings['checkout_title']): ?>
9
+ <h1 class="onestepcheckout-title"><?php echo $this->settings['checkout_title']; ?></h1>
10
+ <?php endif; ?>
11
+
12
+ <?php if($this->canCheckout() && !$this->validateMinimumAmount()): ?>
13
+ <p><?php echo Mage::getStoreConfig('sales/minimum_order/description'); ?></p>
14
+ <p><a href="<?php echo $this->getUrl(''); ?>"><?php echo $this->__('Back to homepage'); ?></a></p>
15
+ <?php else: ?>
16
+ <p><?php echo $this->__('You need to have products in your cart to checkout, and your cart is empty.'); ?></p>
17
+ <p><a href="<?php echo $this->getUrl(''); ?>"><?php echo $this->__('Back to homepage'); ?></a></p>
18
+ <?php endif; ?>
19
+ <?php else: ?>
20
+
21
+ <form id="onestepcheckout-form" method="post" action="<?php echo $this->getUrl('onestepcheckout', array('_secure'=>true)); ?>">
22
+ <fieldset class="group-select" style="margin: 0;">
23
+
24
+ <?php if($this->settings['checkout_title']): ?>
25
+ <h1 class="onestepcheckout-title"><?php echo $this->settings['checkout_title']; ?></h1>
26
+ <?php endif; ?>
27
+
28
+ <?php if($this->settings['checkout_description']): ?>
29
+ <p class="onestepcheckout-description"><?php echo $this->settings['checkout_description']; ?></p>
30
+ <?php endif; ?>
31
+
32
+ <?php if(!$this->isCustomerLoggedIn() && $helper->showLoginLink()): ?>
33
+ <p class="onestepcheckout-login-link">
34
+ <a id="onestepcheckout-login-link" href="javascript:void(0); return: false;"><?php echo $this->__('Already registered? Click here to login.'); ?></a>
35
+ </p>
36
+ <?php endif; ?>
37
+
38
+ <?php if(isset($this->formErrors['unknown_source_error'])): ?>
39
+ <div class="onestepcheckout-error">
40
+ <?php echo $this->formErrors['unknown_source_error']; ?>
41
+ </div>
42
+ <?php endif; ?>
43
+ <div class="onestepcheckout-threecolumns checkoutcontainer onestepcheckout-skin-<?php echo $this->settings['skin']; ?> <?php if(Mage::helper('onestepcheckout')->isEnterprise()): ?>onestepcheckout-enterprise<?php endif; ?>">
44
+ <div class="onestepcheckout-column-left">
45
+ <div id="billing_address">
46
+ <script type="text/javascript">
47
+ var billing = new Billing();
48
+
49
+ </script>
50
+ <ul>
51
+ <li>
52
+ <p class="onestepcheckout-numbers onestepcheckout-numbers-<?php echo $step_counter++; ?>"><?php echo $this->__('Billing address'); ?></p>
53
+ <?php if(isset($this->formErrors['billing_error']) && count($this->formErrors['billing_errors']) > 0): ?>
54
+ <div class="onestepcheckout-error">
55
+ <?php echo $this->__('Please check red fields below and try again.'); ?>
56
+ </div>
57
+ <?php endif; ?>
58
+ </li>
59
+ <?php if ($this->customerHasAddresses()): ?>
60
+ <li>
61
+ <label for="billing-address-select"><?php echo $this->__('Select a billing address from your address book or enter a new address.') ?></label>
62
+ <div class="input-box">
63
+ <?php echo $this->getAddressesHtmlSelect('billing') ?>
64
+ </div>
65
+ </li>
66
+ <?php endif; ?>
67
+ <li>
68
+ <div>
69
+ <ul id="billing_address_list" <?php echo (($this->customerHasAddresses() && !$this->getNewAddressSelectValueOnError('billing')) ? 'style = "display:none"' : false ); ?>>
70
+ <?php echo $this->getChildHtml('billing_address');?>
71
+ <?php $addressAttributes = $this->getChild('customer_form_billing_address_user_defined_attributes');?>
72
+ <?php if ($addressAttributes): ?>
73
+ <?php $addressAttributes->setEntity($this->getQuote()->getBillingAddress())->setEntityType('customer_address');?>
74
+ <?php $addressAttributes->setFieldIdFormat('billing:%1$s')->setFieldNameFormat('billing[%1$s]');?>
75
+ <?php echo $addressAttributes->setExcludeFileAttributes(true)->setShowContainer(false)->toHtml()?>
76
+ <?php endif;?>
77
+ <?php $customerAttributes = $this->getChild('customer_form_customer_user_defined_attributes');?>
78
+ <?php if ($customerAttributes): ?>
79
+ <?php $customerAttributes->setEntityModelClass('customer/customer')->setFieldIdFormat('billing:%1$s');?>
80
+ <?php $customerAttributes->setFieldNameFormat('billing[%1$s]')->setShowContainer(false);?>
81
+ <?php echo $customerAttributes->setExcludeFileAttributes(true)->toHtml()?>
82
+ <?php endif;?>
83
+ </ul>
84
+ </div>
85
+ </li>
86
+ <li>
87
+ <?php $uncheck = (!empty($_POST['billing']) && empty($_POST['billing']['use_for_shipping']));?>
88
+ <?php if($this->differentShippingAvailable()): ?>
89
+ <div class="input-box input-different-shipping">
90
+ <input type="checkbox" name="billing[use_for_shipping]" id="billing:use_for_shipping_yes" value="1" <?php echo (($this->sameAsBilling() && !$uncheck) ? 'checked="checked" ':'')?>/>
91
+ <label for="billing:use_for_shipping_yes"><?php echo $this->__('Ship to the same address')?></label>
92
+ </div>
93
+ <?php else: ?>
94
+ <input type="hidden" name="billing[use_for_shipping]" id="billing:use_for_shipping_yes" value="1" />
95
+ <?php endif; ?>
96
+ </li>
97
+ </ul>
98
+ </div>
99
+ <?php if($this->differentShippingAvailable()): ?>
100
+ <div id="shipping_address" <?php echo (($this->sameAsBilling() && !$uncheck) ? 'style="display: none"': false);?>>
101
+ <script type="text/javascript">
102
+ var shipping = new Shipping();
103
+ </script>
104
+ <ul>
105
+ <li class="shipping-address-title">
106
+ <?php echo $this->__('Shipping address'); ?>
107
+ </li>
108
+ <?php if ($this->customerHasAddresses()): ?>
109
+ <li class="form-alt">
110
+ <label for="shipping-address-select"><?php echo $this->__('Select a shipping address from your address book or enter a new address.') ?></label>
111
+ <div class="input-box"><?php echo $this->getAddressesHtmlSelect('shipping') ?></div>
112
+ </li>
113
+ <?php endif ?>
114
+ <li id="shipping_address_list" <?php if($this->customerHasAddresses() && !$this->getNewAddressSelectValueOnError('shipping')) { echo ' style="display: none;" '; } ?>>
115
+ <div id="">
116
+ <ul>
117
+ <?php echo $this->getChildHtml('shipping_address');?>
118
+ <?php $addressAttributes = $this->getChild('customer_form_shipping_address_user_defined_attributes');?>
119
+ <?php if ($addressAttributes): ?>
120
+ <?php $addressAttributes->setEntity($this->getQuote()->getShippingAddress())->setEntityType('customer_address');?>
121
+ <?php $addressAttributes->setFieldIdFormat('shipping:%1$s')->setFieldNameFormat('shipping[%1$s]');?>
122
+ <?php echo $addressAttributes->setExcludeFileAttributes(true)->setShowContainer(false)->toHtml()?>
123
+ <?php endif;?>
124
+ </ul>
125
+ <input type="hidden" name="shipping[address_id]" value="<?php echo $this->getQuote()->getShippingAddress()->getId() ?>" id="shipping:address_id" />
126
+ <!-- END LIST OF SHIPPIING FIELDS -->
127
+ </div>
128
+ </li>
129
+ </ul>
130
+ </div>
131
+ <?php endif; ?>
132
+ </div>
133
+
134
+ <div class="onestepcheckout-column-middle">
135
+
136
+
137
+ <?php if(!$this->isVirtual()): ?>
138
+ <?php if(Mage::getStoreConfig('onestepcheckout/general/hide_shipping_method')):?>
139
+ <?php if(isset($this->formErrors['shipping_method']) && $this->formErrors['shipping_method']): ?>
140
+ <div class="onestepcheckout-error onestepcheckout-shipment-method-error">
141
+ <?php echo $this->__('Please choose a shipping method.'); ?>
142
+ </div>
143
+ <?php endif; ?>
144
+ <?php echo $this->getChildHtml('choose-shipping-method'); ?>
145
+ <?php else:?>
146
+ <div class="onestepcheckout-shipping-method">
147
+ <p class="onestepcheckout-numbers onestepcheckout-numbers-<?php echo $step_counter++; ?>"><?php echo $this->__('Shipping method'); ?></p>
148
+
149
+ <?php if(isset($this->formErrors['shipping_method']) && $this->formErrors['shipping_method']): ?>
150
+ <div class="onestepcheckout-error onestepcheckout-shipment-method-error">
151
+ <?php echo $this->__('Please choose a shipping method.'); ?>
152
+ </div>
153
+ <?php endif; ?>
154
+
155
+ <div class="onestepcheckout-shipping-method-block">
156
+ <?php echo $this->getChildHtml('choose-shipping-method'); ?>
157
+ </div>
158
+ </div>
159
+ <?php endif; ?>
160
+ <?php endif; ?>
161
+
162
+ <?php if(Mage::getStoreConfig('onestepcheckout/general/hide_payment_method')):?>
163
+ <?php if(!empty($this->formErrors['payment_method'])): ?>
164
+ <div class="onestepcheckout-error onestepcheckout-payment-method-error">
165
+ <?php echo $this->__('Please choose a payment method.'); ?>
166
+ </div>
167
+ <?php endif; ?>
168
+ <?php if(!empty($this->formErrors['payment_method_error'])): ?>
169
+ <div class="onestepcheckout-error onestepcheckout-payment-method-error">
170
+ <?php echo $this->__('Please enter valid details below.'); ?>
171
+ </div>
172
+ <?php endif; ?>
173
+ <?php echo $this->getChildHtml('choose-payment-method'); ?>
174
+ <?php else: ?>
175
+ <p class="onestepcheckout-numbers onestepcheckout-numbers-<?php echo $step_counter++; ?>"><?php echo $this->__('Payment method'); ?></p>
176
+ <?php if(isset($this->formErrors['payment_method']) && $this->formErrors['payment_method']): ?>
177
+ <div class="onestepcheckout-error onestepcheckout-payment-method-error">
178
+ <?php echo $this->__('Please choose a payment method.'); ?>
179
+ </div>
180
+ <?php else: ?>
181
+ <?php if(isset($this->formErrors['payment_method_error'])): ?>
182
+ <div class="onestepcheckout-error onestepcheckout-payment-method-error">
183
+ <?php echo $this->__('Please enter valid details below.'); ?>
184
+ </div>
185
+ <?php endif; ?>
186
+ <?php endif; ?>
187
+
188
+ <?php echo $this->getChildHtml('choose-payment-method'); ?>
189
+
190
+ <div class="tool-tip" id="payment-tool-tip" style="display:none;">
191
+ <div class="btn-close">
192
+ <a href="javascript:void(0);" id="payment-tool-tip-close"><img src="<?php echo $this->getSkinUrl('images/btn_window_close.gif') ?>" alt="<?php echo $this->__('Close') ?>" /></a>
193
+ </div>
194
+ <div class="block-content">
195
+ <img src="<?php echo $this->getSkinUrl('images/cvv.gif') ?>" alt="<?php echo $this->__('Card Verification Number Visual Reference') ?>" />
196
+ </div>
197
+ </div>
198
+ <?php endif; ?>
199
+ </div>
200
+
201
+ <div class="onestepcheckout-column-right">
202
+
203
+ <p class="onestepcheckout-numbers onestepcheckout-numbers-4"><?php echo $this->__('Review your order'); ?></p>
204
+
205
+ <div class="onestepcheckout-summary">
206
+ <?php echo $this->getChildHtml('summary'); ?>
207
+ </div>
208
+
209
+ <?php if($this->settings['enable_discount']): ?>
210
+ <div class="onestepcheckout-coupons">
211
+ <div id="coupon-notice" style="display: none;"></div>
212
+ <?php $_couponcode = $this->getQuote()->getCouponCode(); ?>
213
+ <label for="id_couponcode"><?php echo $this->__('Coupon code:'); ?></label><br/>
214
+ <input class="input-text" type="text" name="onestepcheckout-couponcode" id="id_couponcode" value="<?php echo Mage::helper('core')->escapeHtml($_couponcode); ?>" />
215
+ <br/>
216
+ <button id="onestepcheckout-coupon-add" class="form-button-alt button" type="button"><span><span><?php echo $this->__('Apply Coupon'); ?></span></span></button>
217
+ <button id="onestepcheckout-coupon-remove" class="form-button-alt button" type="button" style="<?php if($_couponcode == '') { echo 'display: none;'; } ?>"><span><span><?php echo $this->__('Cancel Coupon'); ?></span></span></button>
218
+ <script>
219
+ Event.observe(window, 'load', function() {
220
+ $('onestepcheckout-coupon-add').observe('click', function(e) {
221
+
222
+ var coupon = $('id_couponcode').getValue();
223
+ var couponNotice = $('coupon-notice');
224
+
225
+ couponNotice.hide();
226
+
227
+ if(coupon == '') {
228
+ alert('<?php echo $this->__('Please enter a valid coupon code.'); ?>');
229
+ return;
230
+ }
231
+
232
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/add_coupon', array('_secure'=>true)); ?>';
233
+ var parameters = {code: coupon};
234
+ var shipping_methods = $$('dl.shipment-methods').first();
235
+
236
+ var form = $('onestepcheckout-form');
237
+ var payment_hpp_ideal_type = $RF(form, 'payment[hpp_ideal_type]');
238
+ var payment_hpp_type = $RF(form, 'payment[hpp_type]');
239
+ var payment_recurring_type = $RF(form, 'payment[recurring]');
240
+ var payment_recurring_type_cvc = $('adyen_oneclick_oneclick_cid_'+payment_recurring_type);
241
+ var payment_methods = $$('div.payment-methods').first();
242
+
243
+ var summary = $$('div.onestepcheckout-summary').first();
244
+
245
+ if(shipping_methods){
246
+ shipping_methods.update('<div class="loading-ajax">&nbsp;</div>');
247
+ }
248
+
249
+ if(payment_methods){
250
+ payment_methods.update('<div class="loading-ajax">&nbsp;</div>');
251
+ }
252
+
253
+ summary.update('<div class="loading-ajax">&nbsp;</div>');
254
+
255
+ new Ajax.Request(url, {
256
+ method: 'post',
257
+ parameters: parameters,
258
+ onSuccess: function(transport) {
259
+ if(transport.status == 200) {
260
+
261
+ var response = transport.responseText.evalJSON();
262
+
263
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/set_methods_separate', array('_secure'=>true)); ?>';
264
+ var update_payments = <?php echo $this->settings['enable_update_payment_on_shipping'] ? 'true' : 'false'; ?>;
265
+
266
+ if(shipping_methods){
267
+ shipping_methods.hide();
268
+ shipping_methods.update(response.shipping_method);
269
+ shipping_methods.show();
270
+ $$('dl.shipment-methods input').invoke('observe', 'click', get_separate_save_methods_function(url, update_payments));
271
+ $$('dl.shipment-methods input').invoke('observe', 'click', function() {
272
+ $$('div.onestepcheckout-shipment-method-error').each(function(item) {
273
+ new Effect.Fade(item);
274
+ });
275
+ });
276
+ }
277
+
278
+ if(payment_methods){
279
+ payment_methods.hide();
280
+ payment_methods.replace(response.payment_method);
281
+ payment_methods.show();
282
+
283
+ paymentContainer = $('container_payment_method_' + payment.currentMethod)
284
+ paymentForm = $('payment_form_' + payment.currentMethod)
285
+ var payment_method = $RF(form, 'payment[method]');
286
+
287
+ if(paymentContainer != null){
288
+ paymentContainer.show();
289
+ }
290
+ if(paymentForm != null){
291
+ paymentForm.show();
292
+ } else if(payment_method == "adyen_hpp") { // check if payment type is hpp (this has other id so should come in else )
293
+ // set sub payment method back
294
+ $('hpp_type_'+payment_hpp_type).checked = true;
295
+
296
+ // check if ideal payment bank is chosen
297
+ if(payment_hpp_type == "ideal") {
298
+ if(payment_hpp_ideal_type) {
299
+ // get issue_id this is before the slash
300
+ var issue_id = payment_hpp_ideal_type.substr(0, payment_hpp_ideal_type.indexOf('/'));
301
+ $('hpp_ideal_type_'+issue_id).checked = true;
302
+ }
303
+ $('payment_form_ideal').show();
304
+ }
305
+ } else if(payment_method == "adyen_oneclick") { // check if payment type is hpp
306
+ // set sub payment method back
307
+ $('recurring_type_'+payment_recurring_type).checked = true;
308
+ // set back the cvc code
309
+ $('adyen_oneclick_oneclick_cid_'+payment_recurring_type).value = payment_recurring_type_cvc.value;
310
+ // show the cvc code block
311
+ var cvc_block = "cvc_block_" + payment_recurring_type;
312
+ $(cvc_block).show();
313
+ }
314
+
315
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
316
+ $$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
317
+ $$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
318
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
319
+ $$('div.onestepcheckout-payment-method-error').each(function(item) {
320
+ new Effect.Fade(item);
321
+ });
322
+ });
323
+ }
324
+
325
+ summary.hide();
326
+ summary.update(response.summary);
327
+ summary.show();
328
+
329
+ if(response.success) {
330
+
331
+ couponNotice.update(response.message);
332
+ couponNotice.removeClassName('error-msg');
333
+ couponNotice.addClassName('success-msg');
334
+ couponNotice.show();
335
+ /* Show remove button */
336
+ $('onestepcheckout-coupon-remove').show();
337
+ }
338
+ else {
339
+
340
+ couponNotice.update(response.message);
341
+ couponNotice.removeClassName('success-msg');
342
+ couponNotice.addClassName('error-msg');
343
+ couponNotice.show();
344
+ /* Hide remove button */
345
+ $('onestepcheckout-coupon-remove').hide();
346
+ }
347
+ }
348
+ }
349
+ });
350
+ });
351
+
352
+ $('onestepcheckout-coupon-remove').observe('click', function(e) {
353
+
354
+ var coupon = $('id_couponcode').getValue();
355
+ var couponNotice = $('coupon-notice');
356
+
357
+ couponNotice.hide();
358
+
359
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/add_coupon', array('_secure'=>true)); ?>';
360
+ var parameters = {code: coupon, remove: '1'};
361
+ var shipping_methods = $$('dl.shipment-methods').first();
362
+ var payment_methods = $$('div.payment-methods').first();
363
+ var summary = $$('div.onestepcheckout-summary').first();
364
+
365
+ if(shipping_methods){
366
+ shipping_methods.update('<div class="loading-ajax">&nbsp;</div>');
367
+ }
368
+
369
+ if(payment_methods){
370
+ payment_methods.update('<div class="loading-ajax">&nbsp;</div>');
371
+ }
372
+ summary.update('<div class="loading-ajax">&nbsp;</div>');
373
+
374
+ new Ajax.Request(url, {
375
+ method: 'post',
376
+ parameters: parameters,
377
+ onSuccess: function(transport) {
378
+ if(transport.status == 200) {
379
+ var response = transport.responseText.evalJSON();
380
+
381
+ if(response.success){
382
+ $('id_couponcode').setValue('')
383
+ $('onestepcheckout-coupon-remove').hide();
384
+ }
385
+
386
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/set_methods_separate', array('_secure'=>true)); ?>';
387
+ var update_payments = <?php echo $this->settings['enable_update_payment_on_shipping'] ? 'true' : 'false'; ?>;
388
+
389
+ if(shipping_methods){
390
+ shipping_methods.hide();
391
+ shipping_methods.update(response.shipping_method);
392
+ shipping_methods.show();
393
+ $$('dl.shipment-methods input').invoke('observe', 'click', get_separate_save_methods_function(url, update_payments));
394
+ $$('dl.shipment-methods input').invoke('observe', 'click', function() {
395
+ $$('div.onestepcheckout-shipment-method-error').each(function(item) {
396
+ new Effect.Fade(item);
397
+ });
398
+ });
399
+ }
400
+
401
+ if(payment_methods){
402
+ payment_methods.hide();
403
+ payment_methods.replace(response.payment_method);
404
+ payment_methods.show();
405
+
406
+ paymentContainer = $('container_payment_method_' + payment.currentMethod)
407
+ paymentForm = $('payment_form_' + payment.currentMethod)
408
+
409
+ if(paymentContainer != null){
410
+ paymentContainer.show();
411
+ }
412
+
413
+ if(paymentForm != null){
414
+ paymentForm.show();
415
+ }
416
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
417
+ $$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
418
+ $$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
419
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
420
+ $$('div.onestepcheckout-payment-method-error').each(function(item) {
421
+ new Effect.Fade(item);
422
+ });
423
+ });
424
+ }
425
+
426
+ summary.hide();
427
+ summary.update(response.summary);
428
+ summary.show();
429
+
430
+ couponNotice.hide();
431
+ couponNotice.update(response.message);
432
+ couponNotice.removeClassName('error-msg');
433
+ couponNotice.addClassName('success-msg');
434
+ couponNotice.show();
435
+ }
436
+ }
437
+ });
438
+ });
439
+ });
440
+ </script>
441
+ </div>
442
+ <?php endif; ?>
443
+
444
+ <?php if($this->settings['enable_giftcard']): ?>
445
+ <div class="onestepcheckout-giftcards">
446
+ <div id="giftcard-notice" style="display: none;"></div>
447
+ <?php
448
+ $_hasGiftCards = unserialize($this->getQuote()->getGiftCards());
449
+ $_giftcardcode = $this->getQuote()->getgiftcardCode(); ?>
450
+ <label for="id_giftcardcode"><?php echo $this->__('giftcard code:'); ?></label><br/>
451
+ <input class="input-text" type="text" name="onestepcheckout-giftcardcode" id="id_giftcardcode" value="<?php echo Mage::helper('core')->escapeHtml($_giftcardcode); ?>" />
452
+ <br/>
453
+ <button id="onestepcheckout-giftcard-add" class="form-button-alt button" type="button"><span><span><?php echo $this->__('Apply gift card'); ?></span></span></button>
454
+ <button id="onestepcheckout-giftcard-remove" class="form-button-alt button" type="button" style="<?php if(empty($_hasGiftCards)) { echo 'display: none;'; } ?>"><span><span><?php echo $this->__('Cancel gift card'); ?></span></span></button>
455
+ <script>
456
+ document.observe('dom:loaded', function() {
457
+ $('onestepcheckout-giftcard-add').observe('click', function(e) {
458
+ var giftcard = $('id_giftcardcode').getValue();
459
+ var giftcardNotice = $('giftcard-notice');
460
+ giftcardNotice.hide();
461
+ if(giftcard == '') {
462
+ alert('<?php echo $this->__('Please enter a valid giftcard code.'); ?>');
463
+ return;
464
+ }
465
+
466
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/add_giftcard', array('_secure'=>true)); ?>';
467
+ var parameters = {code: giftcard};
468
+ var shipping_methods = $$('dl.shipment-methods').first();
469
+ var payment_methods = $$('div.payment-methods').first();
470
+ var summary = $$('div.onestepcheckout-summary').first();
471
+
472
+ if(shipping_methods){
473
+ shipping_methods.update('<div class="loading-ajax">&nbsp;</div>');
474
+ }
475
+
476
+ if(payment_methods){
477
+ payment_methods.update('<div class="loading-ajax">&nbsp;</div>');
478
+ }
479
+ summary.update('<div class="loading-ajax">&nbsp;</div>');
480
+
481
+ new Ajax.Request(url+Math.random(1000), {
482
+ method: 'post',
483
+ parameters: parameters,
484
+ onSuccess: function(transport) {
485
+ if(transport.status == 200) {
486
+
487
+ var response = transport.responseText.evalJSON();
488
+
489
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/set_methods_separate', array('_secure'=>true)); ?>';
490
+ var update_payments = <?php echo $this->settings['enable_update_payment_on_shipping'] ? 'true' : 'false'; ?>;
491
+
492
+ if(shipping_methods){
493
+ shipping_methods.hide();
494
+ shipping_methods.update(response.shipping_method);
495
+ shipping_methods.show();
496
+ $$('dl.shipment-methods input').invoke('observe', 'click', get_separate_save_methods_function(url, update_payments));
497
+ $$('dl.shipment-methods input').invoke('observe', 'click', function() {
498
+ $$('div.onestepcheckout-shipment-method-error').each(function(item) {
499
+ new Effect.Fade(item);
500
+ });
501
+ });
502
+ }
503
+
504
+ if(payment_methods){
505
+ //payment_methods.hide();
506
+ payment_methods.replace(response.payment_method);
507
+ //payment_methods.show();
508
+
509
+ paymentContainer = $('container_payment_method_' + payment.currentMethod)
510
+ paymentForm = $('payment_form_' + payment.currentMethod)
511
+
512
+ if(paymentContainer != null){
513
+ paymentContainer.show();
514
+ }
515
+ if(paymentForm != null){
516
+ paymentForm.show();
517
+ }
518
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
519
+ $$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
520
+ $$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
521
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
522
+ $$('div.onestepcheckout-payment-method-error').each(function(item) {
523
+ new Effect.Fade(item);
524
+ });
525
+ });
526
+ }
527
+
528
+ if(response.success) {
529
+ summary.update(response.summary);
530
+ giftcardNotice.update(response.message);
531
+ giftcardNotice.removeClassName('error-msg');
532
+ giftcardNotice.addClassName('success-msg');
533
+ giftcardNotice.show();
534
+ /* Show remove button */
535
+ $('onestepcheckout-giftcard-remove').show();
536
+ }
537
+ else {
538
+ summary.update(response.summary);
539
+ giftcardNotice.update(response.message);
540
+ giftcardNotice.removeClassName('success-msg');
541
+ giftcardNotice.addClassName('error-msg');
542
+ giftcardNotice.show();
543
+ /* Hide remove button */
544
+ //$('onestepcheckout-giftcard-remove').hide();
545
+ }
546
+ }
547
+ }
548
+ });
549
+ });
550
+
551
+ $('onestepcheckout-giftcard-remove').observe('click', function(e) {
552
+ var giftcard = $('id_giftcardcode').getValue();
553
+ var giftcardNotice = $('giftcard-notice');
554
+ giftcardNotice.hide();
555
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/add_giftcard', array('_secure'=>true)); ?>';
556
+ var parameters = {code: giftcard, remove: '1'};
557
+ var shipping_methods = $$('dl.shipment-methods').first();
558
+ var payment_methods = $$('div.payment-methods').first();
559
+ var summary = $$('div.onestepcheckout-summary').first();
560
+
561
+ if(shipping_methods){
562
+ shipping_methods.update('<div class="loading-ajax">&nbsp;</div>');
563
+ }
564
+
565
+ if(payment_methods){
566
+ payment_methods.update('<div class="loading-ajax">&nbsp;</div>');
567
+ }
568
+ summary.update('<div class="loading-ajax">&nbsp;</div>');
569
+
570
+ new Ajax.Request(url, {
571
+ method: 'post',
572
+ parameters: parameters,
573
+ onSuccess: function(transport) {
574
+ if(transport.status == 200) {
575
+ var response = transport.responseText.evalJSON();
576
+
577
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/set_methods_separate', array('_secure'=>true)); ?>';
578
+ var update_payments = <?php echo $this->settings['enable_update_payment_on_shipping'] ? 'true' : 'false'; ?>;
579
+
580
+ if(shipping_methods){
581
+ shipping_methods.hide();
582
+ shipping_methods.update(response.shipping_method);
583
+ shipping_methods.show();
584
+ $$('dl.shipment-methods input').invoke('observe', 'click', get_separate_save_methods_function(url, update_payments));
585
+ $$('dl.shipment-methods input').invoke('observe', 'click', function() {
586
+ $$('div.onestepcheckout-shipment-method-error').each(function(item) {
587
+ new Effect.Fade(item);
588
+ });
589
+ });
590
+ }
591
+
592
+ if(payment_methods){
593
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
594
+ $$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
595
+ $$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
596
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
597
+ $$('div.onestepcheckout-payment-method-error').each(function(item) {
598
+ new Effect.Fade(item);
599
+ });
600
+ });
601
+ payment_methods.hide();
602
+ payment_methods.replace(response.payment_method);
603
+ payment_methods.show();
604
+
605
+ paymentContainer = $('container_payment_method_' + payment.currentMethod)
606
+ paymentForm = $('payment_form_' + payment.currentMethod)
607
+
608
+ if(paymentContainer != null){
609
+ paymentContainer.show();
610
+ }
611
+ if(paymentForm != null){
612
+ paymentForm.show();
613
+ }
614
+ }
615
+
616
+ if(response.success){
617
+ $('id_giftcardcode').setValue('')
618
+ $('onestepcheckout-giftcard-remove').hide();
619
+ }
620
+ var summary = $$('div.onestepcheckout-summary').first();
621
+
622
+ summary.hide();
623
+ summary.update(response.summary);
624
+ summary.show();
625
+
626
+ giftcardNotice.hide();
627
+ giftcardNotice.update(response.message);
628
+ giftcardNotice.removeClassName('error-msg');
629
+ giftcardNotice.addClassName('success-msg');
630
+ giftcardNotice.show();
631
+ }
632
+ }
633
+ });
634
+ });
635
+ });
636
+ </script>
637
+ </div>
638
+ <?php endif; ?>
639
+
640
+ <?php if($this->settings['enable_comments']): ?>
641
+ <div class="onestepcheckout-comments">
642
+ <label for="id_comments"><?php echo $this->__('Comments'); ?></label><br/>
643
+ <textarea id="id_comments" name="onestepcheckout_comments"><?php if(isset($_POST['onestepcheckout_comments'])) { echo Mage::helper('core')->escapeHtml($_POST['onestepcheckout_comments']); } ?></textarea>
644
+ </div>
645
+ <?php endif; ?>
646
+
647
+ <?php if($this->settings['enable_gift_messages']): ?>
648
+ <div id="onestepcheckout-giftmessages">
649
+ <div class="onestepcheckout-giftmessagecontainer">
650
+ <?php echo $this->helper('onestepcheckout/message')->getInline('onepage_checkout', $this->getQuote(), $this->getDontDisplayContainer()) ?>
651
+ </div>
652
+ </div>
653
+ <?php endif; ?>
654
+
655
+ <?php $customerEmail = (($this->isCustomerLoggedIn())) ? $this->getQuote()->getCustomer()->getEmail() : false ;?>
656
+ <?php if($this->settings['enable_newsletter'] && !$this->isSubScribed($customerEmail)): ?>
657
+ <div class="onestepcheckout-enable-newsletter">
658
+ <input type="checkbox" id="id_subscribe_newsletter" name="subscribe_newsletter" value="1" <?php if($this->settings['newsletter_default_checked']): ?>checked="checked"<?php endif; ?> />
659
+ <label for="id_subscribe_newsletter"><?php echo $this->__('Subscribe to our newsletter'); ?></label>
660
+ </div>
661
+ <?php endif; ?>
662
+
663
+ <?php $_extraProductsHelper = Mage::helper('onestepcheckout/extraproducts'); ?>
664
+ <?php if($_extraProductsHelper->hasExtraProducts()): ?>
665
+ <div class="onestepcheckout-extraproducts">
666
+ <ul>
667
+ <?php foreach($_extraProductsHelper->getExtraProducts() as $product): ?>
668
+ <li><input type="checkbox" class="onestepcheckout-extra-product"
669
+ <?php if($_extraProductsHelper->productInCart($product->getId())): ?>
670
+ checked="checked" <?php endif; ?>
671
+ name="extra_products_<?php echo $product->getId(); ?>"
672
+ id="id_extra_product_<?php echo $product->getId(); ?>" /> &nbsp;
673
+ <label for="id_extra_product_<?php echo $product->getId(); ?>"> <?php echo $product->getName(); ?>
674
+ <span><?php echo Mage::helper('checkout')->formatPrice($product->getPrice()); ?></span>
675
+ </label></li>
676
+ <?php endforeach; ?>
677
+ </ul>
678
+ </div>
679
+
680
+ <script>
681
+ Event.observe(window, 'load', function() {
682
+ $$('input.onestepcheckout-extra-product').invoke('observe', 'click', function(e) {
683
+ var id_temp = e.element().id.split('id_extra_product_');
684
+ if(id_temp.length == 2) {
685
+ var product_id = id_temp[1];
686
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/add_extra_product'); ?>';
687
+ var parameters = {
688
+ product_id: product_id
689
+ }
690
+
691
+ if(!e.element().checked) {
692
+ parameters['remove'] = 1;
693
+ }
694
+
695
+ var summary = $$('div.onestepcheckout-summary').first();
696
+ summary.update('<div class="loading-ajax">&nbsp;</div>');
697
+
698
+ new Ajax.Request(url, {
699
+ method: 'post',
700
+ parameters: parameters,
701
+ onSuccess: function(transport) {
702
+ summary.update(transport.responseText);
703
+ }
704
+ });
705
+ };
706
+ });
707
+ });
708
+ </script>
709
+ <?php endif; ?>
710
+
711
+ <?php
712
+ /**
713
+ * Feedbackdropdown start
714
+ */
715
+ ?>
716
+ <?php if(!empty($this->settings['feedback']['enable_feedback']) && !empty($this->settings['feedback']['feedback_values'])):?>
717
+ <?php
718
+ $selectedFeedBackFields = $this->getRequest()->getPost('onestepcheckout-feedback', false);
719
+ $feedbackValues = unserialize($this->settings['feedback']['feedback_values']);
720
+ ?>
721
+ <div class="onestepcheckout-feedback" id="">
722
+ <label for="id_feedback"><?php echo $this->__('How did you hear about us?'); ?></label><br>
723
+ <select style="" name="onestepcheckout-feedback" id="id_feedback" defaultvalue="">
724
+ <option value=""><?php echo $this->__('Please choose'); ?></option>
725
+ <?php foreach($feedbackValues as $value => $label):
726
+ $selected= (!empty($selectedFeedBackFields) && $selectedFeedBackFields == $value) ? ' selected' : '';
727
+ ?>
728
+ <option value="<?php echo $value?>" <?php echo $selected;?>><?php echo $label['value']?></option>
729
+ <?php endforeach;?>
730
+ <?php if(!empty($this->settings['feedback']['enable_feedback_freetext'])):
731
+ $selected= (empty($feedbackValues[$selectedFeedBackFields]) && $selectedFeedBackFields != '') ? ' selected' : '';
732
+ ?>
733
+ <option value="freetext" <?php echo $selected;?>><?php echo $this->__('Other'); ?></option>
734
+ <?php endif;?>
735
+ </select>
736
+ </div>
737
+ <?php if(!empty($this->settings['feedback']['enable_feedback_freetext'])):?>
738
+ <script type="text/javascript">
739
+ $('id_feedback').observe('change', function (event){
740
+ if(this.getValue() == 'freetext'){
741
+ $('id_feedback_freetext_div').show();
742
+ } else {
743
+ $('id_feedback_freetext_div').hide();
744
+ }
745
+ });
746
+ </script>
747
+ <div id='id_feedback_freetext_div' class="onestepcheckout-feedback-freetext"<?php echo ((!empty($selectedFeedBackFields) && $selectedFeedBackFields == 'freetext') ? '' : ' style="display: none;"'); ?>>
748
+ <label for="id_feedback_freetext"><?php echo $this->__('Please specify:'); ?></label><br/>
749
+ <textarea id="id_feedback_freetext" name="onestepcheckout-feedback-freetext"><?php echo Mage::helper('core')->escapeHtml($this->getRequest()->getPost('onestepcheckout-feedback-freetext', false));?></textarea>
750
+ </div>
751
+ <?php endif; ?>
752
+ <?php endif; ?>
753
+ <?php
754
+ /**
755
+ * Feedbackdropdown end
756
+ */
757
+ ?>
758
+
759
+ <?php if($this->settings['enable_terms']): //deprecated?>
760
+ <div class="onestepcheckout-enable-terms">
761
+ <?php
762
+
763
+ if(isset($this->formErrors['terms_error']) && $this->formErrors['terms_error']) {
764
+ $terms_error = true;
765
+ }
766
+ else {
767
+ if($_SERVER['REQUEST_METHOD'] == 'POST') {
768
+ $terms_error = false;
769
+ }
770
+ else {
771
+ $terms_error = true;
772
+ }
773
+ }
774
+ ?>
775
+
776
+ <input class="required-entry" type="checkbox" id="id_accept_terms" name="accept_terms" value="1" <?php if(!$terms_error) echo "checked=\"checked\""; ?> />
777
+ <label for="id_accept_terms"><?php echo $this->__('I accept the <a id="onestepcheckout-toc-link" target="_blank" href="javascript:void(0);">Terms and Conditions</a>'); ?></label>
778
+
779
+ <?php if(isset($this->formErrors['terms_error']) && $this->formErrors['terms_error']): ?>
780
+ <div class="onestepcheckout-error onestepcheckout-terms-error">
781
+ <?php echo $this->__('You must accept our terms to continue.'); ?>
782
+ </div>
783
+ <?php endif; ?>
784
+
785
+ </div>
786
+ <?php endif; ?>
787
+
788
+ <?php
789
+ /**
790
+ * Default magento agreements
791
+ */
792
+ ?>
793
+ <?php if($this->settings['enable_default_terms']): ?>
794
+ <?php if(!empty($this->formErrors['agreements_error'])):?>
795
+ <div class="onestepcheckout-error onestepcheckout-terms-error">
796
+ <?php echo $this->__('Please agree to all the terms and conditions before placing the order.'); ?>
797
+ </div>
798
+ <?php endif;?>
799
+ <?php echo $this->getChildHtml('agreements') ?>
800
+ <script type="text/javascript">
801
+
802
+ var termsmodals = new Object;
803
+
804
+ document.observe('dom:loaded', function() {
805
+ $$('.checkout-agreements li p input').each(
806
+ function(elem){
807
+ elem.addClassName('required-entry');
808
+ }
809
+ );
810
+ });
811
+
812
+ <?php if($this->settings['enable_textarea']):?>
813
+ document.observe('dom:loaded', function() {
814
+ $$('.checkout-agreements li p label').each(
815
+ function(elem){
816
+ elem.up().insert('<a href="javascript:void(0);" onclick="termsmodals[\'' + elem.htmlFor + '\'].open();">' + elem.innerHTML + '</a>');
817
+ elem.hide();
818
+ }
819
+ );
820
+ $$('div.agreement-content').each(
821
+ function(element){
822
+ element.id = 'agreement-div-' + element.up('li').down('input').id;
823
+ $$('body')[0].insert(element);
824
+ }
825
+ );
826
+ $$('.checkout-agreements li p input').each(
827
+ function(elem){
828
+ window.termsmodals[elem.id] = new Control.Modal($('agreement-div-' + elem.id),{
829
+ overlayOpacity: 0.75,
830
+ className: 'oscmodal',
831
+ fade: true,
832
+ closeOnClick: true,
833
+ height: 400,
834
+ width: 700
835
+ });
836
+ }
837
+ );
838
+ });
839
+ <?php endif;?>
840
+
841
+ </script>
842
+ <?php endif;?>
843
+ <?php
844
+ /**
845
+ * Default magento agreements end
846
+ */
847
+ ?>
848
+
849
+ <div class="onestepcheckout-place-order-wrapper">
850
+ <button type="button" title="<?php echo $this->__('Place order now'); ?>" id="onestepcheckout-place-order" class="large orange onestepcheckout-button onestepcheckout-place-order" onclick="javascript:void(0);"><span><span><?php echo $this->__('Place order now'); ?></span></span></button>
851
+ </div>
852
+ </div>
853
+ <div style="clear: both;">&nbsp;</div>
854
+ </div>
855
+ </fieldset>
856
+ </form>
857
+
858
+ <?php if(!$this->isCustomerLoggedIn() && $helper->showLoginLink()): ?>
859
+ <?php echo $this->getChildHtml('login-popup'); ?>
860
+ <?php endif; ?>
861
+
862
+ <?php if($helper->isValidateEmail()): ?>
863
+ <script>
864
+ $('billing:email').observe('blur', function(e) {
865
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/check_email', array('_secure'=>true)); ?>';
866
+ var email = e.element().getValue();
867
+ var parameters = { email: email };
868
+
869
+ new Ajax.Request(url, {
870
+ parameters: parameters,
871
+ onComplete: function(response) {
872
+ if(response.status == 200) {
873
+ var result = response.responseText.evalJSON().result;
874
+ if(result == 'invalid') {
875
+ $('onestepcheckout-email-error-message').update('<?php echo $this->__('Invalid email address.'); ?>');
876
+ $('onestepcheckout-email-error').show();
877
+ }
878
+ else if(result == 'exists') {
879
+ <?php if($this->settings['registration_order_without_password']): ?>
880
+ // Remove the password fields if the email exists in database
881
+ $('onestepcheckout-li-password').hide();
882
+ <?php endif; ?>
883
+ $('onestepcheckout-email-error-message').update('<?php echo $this->__('Email address already registered. Please <a href="javascript:void(0);" onclick="login_popup.show(); return false;">login now</a> or use a different email address.'); ?>');
884
+ $('onestepcheckout-email-error').show();
885
+ $('id_onestepcheckout_username').value = email;
886
+ }
887
+ else {
888
+ $('onestepcheckout-email-error').hide();
889
+ }
890
+ }
891
+ }
892
+ })
893
+
894
+ });
895
+ Validation.add('validate-email', '<?php echo $this->__('This is a required field.') ?>', function(v) {
896
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/check_email', array('_secure'=>true)); ?>';
897
+ var email = v;
898
+ var parameters = { email: email };
899
+ var value = Validation.get('IsEmpty').test(v) || /^([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*@([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*\.(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]){2,})$/i.test(v)
900
+
901
+ new Ajax.Request(url, {
902
+ parameters: parameters,
903
+ asynchronous: false,
904
+ onComplete: function(response) {
905
+ if(response.status == 200) {
906
+ var result = response.responseText.evalJSON().result;
907
+ if(result == 'invalid') {
908
+ value = false;
909
+ } else if(result == 'exists') {
910
+ <?php if($this->settings['registration_order_without_password']): ?>
911
+ $('onestepcheckout-li-password').hide();
912
+ <?php endif; ?>
913
+ $('onestepcheckout-email-error-message').update('<?php echo $this->__('Email address already registered. Please <a href="javascript:void(0);" onclick="login_popup.show(); return false;">login now</a> or use a different email address.'); ?>');
914
+ $('onestepcheckout-email-error').show();
915
+ $('id_onestepcheckout_username').value = email;
916
+ value = false;
917
+ }
918
+ }
919
+ }
920
+ })
921
+ return value;
922
+ });
923
+ </script>
924
+ <?php endif; ?>
925
+
926
+ <?php if($this->settings['enable_terms']): ?>
927
+ <div id="onestepcheckout-toc-popup" style="display: none;">
928
+
929
+ <div class="onestepcheckout-popup-wrapper">
930
+ <div class="onestepcheckout-popup-wrapper-inner">
931
+ <h1><?php echo $this->settings['terms_title']; ?></h1>
932
+
933
+ <div class="onestepcheckout-toc-terms">
934
+ <?php echo $this->settings['terms_contents']; ?>
935
+ </div>
936
+
937
+ <p class="close"><a href="javascript:void(0);"><?php echo $this->__('Close'); ?></a></p>
938
+ </div>
939
+ </div>
940
+ <div class="onestepcheckout-popup-footer">&nbsp;</div>
941
+ </div>
942
+ <script>
943
+ Event.observe(window, 'load', function() {
944
+
945
+ var termsPopup = new Control.Modal($('onestepcheckout-toc-popup'), {
946
+ overlayOpacity: 0.65,
947
+ fade: true,
948
+ fadeDuration: 0.3
949
+ });
950
+
951
+ $('onestepcheckout-toc-link').observe('click', function(e) {
952
+ e.preventDefault();
953
+ termsPopup.open();
954
+ });
955
+
956
+ $$('div#onestepcheckout-toc-popup p.close a').invoke('observe', 'click', function(e) {
957
+ e.preventDefault();
958
+ termsPopup.close();
959
+ });
960
+
961
+ });
962
+
963
+ /*
964
+ var popup;
965
+ Event.observe(window, 'load', function() {
966
+ popup = new OneStepCheckout_Popup('onestepcheckout-toc-popup','onestepcheckout-toc-link', 'div#onestepcheckout-toc-popup p.close a');
967
+ });
968
+ */
969
+ </script>
970
+ <?php endif; ?>
971
+
972
+
973
+
974
+
975
+
976
+ <script>
977
+ <?php if($this->hasFormErrors()): ?>
978
+ if($$('div.input-error').length > 0) {
979
+ var input = $$('div.input-error')[0].select('input');
980
+ if(input.length == 1) {
981
+ input[0].focus();
982
+ }
983
+ }
984
+ <?php endif; ?>
985
+ </script>
986
+
987
+ <?php if(!$this->settings['exclude_region']): ?>
988
+ <script type="text/javascript">countryRegions = <?php echo $this->helper('directory')->getRegionJson() ?></script>
989
+ <script type="text/javascript">
990
+ //<![CDATA[
991
+ var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', countryRegions, undefined, 'billing:postcode');
992
+
993
+ <?php if($this->settings['enable_different_shipping'] && !$this->isVirtual()): ?>
994
+ var shippingRegionUpdater = new RegionUpdater('shipping:country_id', 'shipping:region', 'shipping:region_id', countryRegions, undefined, 'shipping:postcode');
995
+ <?php endif; ?>
996
+ //]]>
997
+ </script>
998
+ <?php endif; ?>
999
+
1000
+
1001
+ <script type="text/javascript">
1002
+
1003
+ Event.observe(window, 'load', function() {
1004
+ if ($$('div.shopping-cart-totals').length == 1) {
1005
+ }
1006
+ else {
1007
+
1008
+ already_placing_order = false;
1009
+ review = false;
1010
+ reviewmodal = false;
1011
+
1012
+ /* Handle place order click event */
1013
+ $$('.onestepcheckout-place-order').each(function(elem){
1014
+ elem.observe('click', function(e) {
1015
+ Event.stop(e);
1016
+
1017
+ // First validate the form
1018
+ var form = new VarienForm('onestepcheckout-form');
1019
+
1020
+ if(!form.validator.validate()) {
1021
+ Event.stop(e);
1022
+ } else {
1023
+
1024
+ if(!already_placing_order && $$('.loading-ajax').length <= 0 ) {
1025
+ <?php if(!empty($helper->settings['addressreview']['enable_addressreview'])):?>
1026
+ var addressTemplates = {
1027
+ shipping: '<?php echo str_replace("\r", '', str_replace("\n", '', $helper->settings['addressreview']['shipping_template']));?>',
1028
+ billing: '<?php echo str_replace("\r", '', str_replace("\n", '', $helper->settings['addressreview']['billing_template']));?>'
1029
+ };
1030
+ addressPreview(addressTemplates, 'addressreview');
1031
+ if(!review){
1032
+ review = true;
1033
+ if(!reviewmodal){
1034
+ reviewmodal = new Control.Modal($('addressreview'),{
1035
+ overlayOpacity: 0.75,
1036
+ className: 'oscmodal',
1037
+ fade: true,
1038
+ closeOnClick: false
1039
+ });
1040
+ }
1041
+ reviewmodal.open();
1042
+ reviewmodal.observe('beforeClose',function(){
1043
+ review = false;
1044
+ });
1045
+ return true;
1046
+ Event.stop(e);
1047
+ } else {
1048
+ reviewmodal.close();
1049
+ }
1050
+ <?php endif;?>
1051
+ already_placing_order = true;
1052
+
1053
+ var submitelement = $('onestepcheckout-place-order');
1054
+ /* Disable button to avoid multiple clicks */
1055
+ submitelement.removeClassName('orange').addClassName('grey');
1056
+ submitelement.disabled = true;
1057
+
1058
+ var loaderelement = new Element('span').
1059
+ addClassName('onestepcheckout-place-order-loading').
1060
+ update('<?php echo $this->__('Please wait, processing your order...'); ?>');
1061
+
1062
+ submitelement.parentNode.appendChild(loaderelement);
1063
+
1064
+ /* Submit the form */
1065
+ $('onestepcheckout-form').submit();
1066
+ }
1067
+ }
1068
+ });
1069
+ });
1070
+
1071
+
1072
+ // This is a separate page
1073
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/set_methods_separate', array('_secure'=>true)); ?>';
1074
+ var update_payments = <?php echo $this->settings['enable_update_payment_on_shipping'] ? 'true' : 'false'; ?>;
1075
+
1076
+ $$('dl.shipment-methods input').invoke('observe', 'click', get_separate_save_methods_function(url, update_payments));
1077
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
1078
+ $$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
1079
+ $$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
1080
+
1081
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
1082
+ $$('div.onestepcheckout-payment-method-error').each(function(item) {
1083
+ new Effect.Fade(item);
1084
+ });
1085
+ });
1086
+
1087
+ $$('dl.shipment-methods input').invoke('observe', 'click', function() {
1088
+ $$('div.onestepcheckout-shipment-method-error').each(function(item) {
1089
+ new Effect.Fade(item);
1090
+ });
1091
+ });
1092
+
1093
+ var has_hidden_terms = false;
1094
+
1095
+ if($('id_accept_terms') != null) {
1096
+
1097
+ $('id_accept_terms').observe('click', function(e) {
1098
+ var element = e.element();
1099
+
1100
+ if(element.checked) {
1101
+ $$('div.onestepcheckout-terms-error').each(function(item) {
1102
+ new Effect.Fade(item);
1103
+ has_hidden_terms = true;
1104
+ });
1105
+ }
1106
+ else {
1107
+ if(has_hidden_terms) {
1108
+ $$('div.onestepcheckout-terms-error').each(function(item) {
1109
+ new Effect.Appear(item);
1110
+ has_hidden_terms = false;
1111
+ });
1112
+ }
1113
+ }
1114
+ });
1115
+ }
1116
+ }
1117
+
1118
+ var form = $('onestepcheckout-form');
1119
+
1120
+ /* Highlight selected payment method if one set */
1121
+ if($RF(form, 'payment[method]') != null) {
1122
+ try {
1123
+ var payment_method = $RF(form, 'payment[method]');
1124
+ $('container_payment_method_' + payment_method).show();
1125
+ $('payment_form_' + payment_method).show();
1126
+ } catch(err) {
1127
+
1128
+ }
1129
+ }
1130
+
1131
+ /* Set default shipping method if not set */
1132
+ if($RF(form, 'shipping_method') == null) {
1133
+ try {
1134
+ var method = '<?php echo $this->_getDefaultShippingMethod(); ?>';
1135
+ if(method != '') {
1136
+ $('s_method_' + method).checked = true;
1137
+ get_separate_save_methods_function(url);
1138
+ }
1139
+ } catch(err) {
1140
+
1141
+ }
1142
+ }
1143
+ //submit what's available on load
1144
+ get_separate_save_methods_function(url)();
1145
+
1146
+ <?php if($this->differentShippingAvailable()): ?>
1147
+ $('billing:use_for_shipping_yes').observe('click', function(e) {
1148
+ var element = e.element();
1149
+ if(element.checked){
1150
+ $('shipping_address').hide();
1151
+ } else {
1152
+ if($('shipping-address-select') && $('shipping-address-select').value == ''){
1153
+ $('shipping_address_list').show()
1154
+ }
1155
+ $('shipping_address').show();
1156
+ <?php if(!$this->isCustomerLoggedIn()):?>
1157
+ $('shipping_address_list').show()
1158
+ <?php endif;?>
1159
+ <?php if($this->isCustomerLoggedIn()):?>
1160
+ if(!$('shipping-address-select') && $('shipping_address_list').getStyle('display')=='none'){
1161
+ $('shipping_address_list').show()
1162
+ }
1163
+ <?php endif;?>
1164
+ }
1165
+
1166
+ <?php if($this->settings['enable_ajax_save_billing']): ?>
1167
+ get_save_billing_function('<?php echo $this->getUrl('onestepcheckout/ajax/save_billing', array('_secure'=>true)); ?>', '<?php echo $this->getUrl('onestepcheckout/ajax/set_methods_separate', array('_secure'=>true)); ?>', <?php echo $this->settings['enable_update_payment_on_shipping'] ? 'true' : 'false'; ?>, true)();
1168
+ <?php endif; ?>
1169
+
1170
+ });
1171
+ <?php endif; ?>
1172
+ <?php
1173
+ $triggers = Mage::getStoreConfig('onestepcheckout/ajax_update/ajax_save_billing_fields');
1174
+ if(!empty($triggers)){
1175
+ $triggers = str_replace('country', 'country_id', $triggers);
1176
+ $triggers = str_replace('state/region', 'region_id', $triggers);
1177
+ $triggers = explode(',',$triggers);
1178
+ if(in_array('region_id',$triggers)){
1179
+ $triggers[] = 'region';
1180
+ }
1181
+ }
1182
+ ?>
1183
+
1184
+ <?php if(Mage::getStoreConfig('onestepcheckout/ajax_update/enable_ajax_save_billing') && !empty($triggers)):?>
1185
+
1186
+ var url_save_billing = '<?php echo $this->getUrl('onestepcheckout/ajax/save_billing', array('_secure'=>true)); ?>';
1187
+ var url_set_methods = '<?php echo $this->getUrl('onestepcheckout/ajax/set_methods_separate', array('_secure'=>true)); ?>';
1188
+ var update_payments = <?php echo $this->settings['enable_update_payment_on_shipping'] ? 'true' : 'false'; ?>;
1189
+ var update_on_initial = false;
1190
+
1191
+ var euvat = $('euvat_action_validate_taxvat');
1192
+
1193
+ if(euvat !== null){
1194
+ euvat.observe('change', get_save_billing_function(url_save_billing, url_set_methods, update_payments, true));
1195
+ }
1196
+
1197
+ var euvatid = $('billing:vat_id');
1198
+
1199
+ if(euvatid !== null){
1200
+ euvatid.observe('change', get_save_billing_function(url_save_billing, url_set_methods, update_payments, true));
1201
+ }
1202
+
1203
+ triggers = ['<?php echo implode ('\',\'',$triggers)?>'];
1204
+ btriggered = [];
1205
+ striggered = [];
1206
+
1207
+ <?php
1208
+ foreach($triggers as $value){
1209
+ echo (($this->getQuote()->getBillingAddress()->getData($value)) ? 'btriggered.push(\'billing:'.$value.'\');' : '');
1210
+ echo (($this->getQuote()->getShippingAddress()->getData($value)) ? 'striggered.push(\'shipping:'.$value.'\');' : '');
1211
+ }
1212
+ ?>
1213
+
1214
+
1215
+ bcountry_id = $('billing:country_id');
1216
+ if(bcountry_id){
1217
+ if(bcountry_id.getValue()){
1218
+ if(!btriggered.include('billing:country_id')){
1219
+ btriggered.push('billing:country_id');
1220
+ }
1221
+ }
1222
+ }
1223
+ scountry_id = $('shipping:country_id');
1224
+ if(scountry_id){
1225
+ if(scountry_id.getValue()){
1226
+ if(!striggered.include('shipping:country_id')){
1227
+ striggered.push('shipping:country_id');
1228
+ }
1229
+ }
1230
+ }
1231
+
1232
+ batriggered = false;
1233
+ satriggered = false;
1234
+
1235
+ changeTimer = false;
1236
+ changeInterval = 1000;
1237
+
1238
+ triggers.each(function(item){
1239
+ var belement = $('billing:'+item);
1240
+ if(belement){
1241
+ belement.observe('change', function(e){
1242
+ var element = e.element();
1243
+ var id = element.id;
1244
+ var tagname = element.tagName;
1245
+ if(tagname === 'SELECT'){
1246
+ clearTimeout(changeTimer);
1247
+ changeTimer = setTimeout(bcallbackEvent, changeInterval, id);
1248
+ } else {
1249
+ bcallbackEvent(id);
1250
+ }
1251
+ });
1252
+ }
1253
+
1254
+ var selement = $('shipping:'+item);
1255
+ if(selement){
1256
+ selement.observe('change', function(e){
1257
+ var element = e.element();
1258
+ var id = element.id;
1259
+ var tagname = element.tagName;
1260
+ if(tagname === 'SELECT'){
1261
+ clearTimeout(changeTimer);
1262
+ changeTimer = setTimeout(scallbackEvent, changeInterval, id);
1263
+ } else {
1264
+ scallbackEvent(id);
1265
+ }
1266
+ });
1267
+ }
1268
+ });
1269
+
1270
+ function scallbackEvent (id){
1271
+ if(!striggered.include(id)){
1272
+ striggered.push(id);
1273
+ }
1274
+ if(striggered.length >= triggers.length-1){
1275
+ satriggered = true;
1276
+ }
1277
+ get_save_billing_function(url_save_billing, url_set_methods, update_payments, satriggered)();
1278
+ }
1279
+
1280
+
1281
+ function bcallbackEvent (id){
1282
+ if(!btriggered.include(id)){
1283
+ btriggered.push(id);
1284
+ }
1285
+ if(btriggered.length >= triggers.length-1){
1286
+ batriggered = true;
1287
+ }
1288
+ get_save_billing_function(url_save_billing, url_set_methods, update_payments, batriggered)();
1289
+ }
1290
+
1291
+
1292
+ <?php if($this->isCustomerLoggedIn()):?>
1293
+ var bselect = $('billing-address-select');
1294
+ var sselect = $('shipping-address-select');
1295
+ if(bselect){
1296
+ bselect.observe('change', get_save_billing_function(url_save_billing, url_set_methods, update_payments, true));
1297
+ }
1298
+ if(sselect){
1299
+ sselect.observe('change', get_save_billing_function(url_save_billing, url_set_methods, update_payments, true));
1300
+ }
1301
+ <?php endif;?>
1302
+
1303
+ <?php endif; ?>
1304
+
1305
+ });
1306
+
1307
+ if($('payment-tool-tip-close')){
1308
+ Event.observe($('payment-tool-tip-close'), 'click', toggleToolTip);
1309
+ }
1310
+
1311
+ </script>
1312
+
1313
+
1314
+ <?php endif; ?>
1315
+
1316
+ <div id="onestepcheckout_popup_overlay" style="display: none;">&nbsp;</div>
1317
+
1318
+
1319
+ <div id="loading-process" style="display: none;"></div>
app/design/frontend/default/adyen/template/onestepcheckout/payment_method.phtml ADDED
@@ -0,0 +1,217 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design_default
22
+ * @package Mage
23
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * One page checkout payment methods
30
+ *
31
+ * @see Mage_Checkout_Block_Onepage_Payment_Methods
32
+ */
33
+ ?>
34
+
35
+
36
+ <?php
37
+ $methods = $this->getMethods();
38
+ $oneMethod = count($methods) <= 1;
39
+
40
+
41
+ $helper = Mage::helper('onestepcheckout/checkout');
42
+ $hide_nonfree_methods = false;
43
+ if($helper->settings['hide_nonfree_payment_methods']) {
44
+ foreach($this->getMethods() as $_method) {
45
+ if($_method->getCode() == 'free') {
46
+ $hide_nonfree_methods = true;
47
+ }
48
+ }
49
+ }
50
+
51
+
52
+ ?>
53
+
54
+ <div class="payment-methods">
55
+ <script type="text/javascript">
56
+ //<![CDATA[
57
+ <?php echo $this->getChildHtml('reward.scripts'); ?>
58
+ <?php echo $this->getChildHtml('customerbalance_scripts'); ?>
59
+ var payment = new Payment('checkout-payment-method-load', '<?php echo $this->getUrl('checkout/onepage/savePayment') ?>');
60
+ payment.currentMethod = "<?php echo $this->getQuote()->getPayment()->getMethod() ?>";
61
+ //]]>
62
+ </script>
63
+ <?php if(Mage::helper('onestepcheckout')->isEnterprise()):?>
64
+ <?php echo $this->getChildHtml('customerbalance'); ?>
65
+ <?php echo $this->getChildHtml('reward.points'); ?>
66
+ <?php endif;?>
67
+
68
+ <?php if (count($this->getMethods())=='1' && Mage::getStoreConfig('onestepcheckout/general/hide_payment_method')):?>
69
+ <dl id="checkout-payment-method-load" style="display: none">
70
+ <?php foreach ($this->getMethods() as $_method): $_code = $_method->getCode() ?>
71
+
72
+ <dt>
73
+ <input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="hidden" name="payment[method]" title="<?php echo $this->escapeHtml($_method->getTitle()) ?>" class="radio" <?php if($this->getSelectedMethodCode()==$_code || ($hide_nonfree_methods && $_code == 'free')): ?> checked="checked"<?php endif; ?> />
74
+ <label for="p_method_<?php echo $_code ?>"><?php echo $_method->getTitle() ?></label></dt>
75
+ <?php endforeach; ?>
76
+ </dl>
77
+ <?php else:?>
78
+
79
+ <dl id="checkout-payment-method-load">
80
+ <?php foreach ($this->getMethods() as $_method): $_code = $_method->getCode() ?>
81
+ <?php if($hide_nonfree_methods && $_code != 'free') continue;
82
+
83
+ $_style = "";
84
+ if($_code == "adyen_hpp") {
85
+ // get method and check if config payment/adyen_hpp/disable_hpptypes is set
86
+ $disabled = $_method->getHppOptionsDisabled();
87
+ if(!$disabled) {
88
+ $_style = ($_code == "adyen_hpp" && !$oneMethod) ? "display:none" : "";
89
+ }
90
+ } else if ($_code == "adyen_oneclick" && !$oneMethod) {
91
+ $_style = "display:none";
92
+ }
93
+ ?>
94
+
95
+ <dt style="<?php echo $_style; ?>">
96
+ <?php if( sizeof($this->getMethods()) > 1 ): ?>
97
+ <input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" title="<?php echo $this->escapeHtml($_method->getTitle()) ?>" class="radio validate-one-required-by-name" <?php if($this->getSelectedMethodCode()==$_code || ($hide_nonfree_methods && $_code == 'free')): ?> checked="checked"<?php endif; ?> />
98
+ <?php else: ?>
99
+ <span class="no-display"><input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" checked="checked" /></span>
100
+ <?php endif; ?>
101
+ <label for="p_method_<?php echo $_code ?>"><?php echo $_method->getTitle() ?></label>
102
+ </dt>
103
+ <?php if($html = $this->getChildHtml('payment.method.'.$_code)): ?>
104
+ <?php $class = ($_code == "adyen_hpp" || $_code == "adyen_oneclick") ? "" : "payment-method"; ?>
105
+ <dd id="container_payment_method_<?php echo $_code; ?>" class="<?php echo $class; ?>">
106
+ <?php echo $html; ?>
107
+ </dd>
108
+ <?php endif; ?>
109
+ <script type="text/javascript">
110
+ //<![CDATA[
111
+
112
+ var SwitchMethod= function() {
113
+ var method = $('p_method_<?php echo $_code?>').value;
114
+
115
+ if(method != "adyen_hpp") {
116
+ // check if hpp is enabled if so clear the selected option because you select different payment method
117
+ if($('hpp_payment_form_adyen_hpp'))
118
+ {
119
+ var form = $('hpp_payment_form_adyen_hpp');
120
+ var elements = form.getElementsByTagName('input');
121
+ for (var i=0; i<elements.length; i++) elements[i].checked = false;
122
+ }
123
+ }
124
+
125
+ // check if oneclick is enabled if so clear the selected option because you select different payment method
126
+ if(method != "adyen_oneclick") {
127
+ // always enable the oneclick payments options if this payment method is on
128
+ if($('oneclick_payment_form_adyen_oneclick'))
129
+ {
130
+ var form = $('oneclick_payment_form_adyen_oneclick');
131
+ var elements = form.getElementsByTagName('input');
132
+ for (var i=0; i<elements.length; i++) elements[i].checked = false;
133
+ }
134
+ }
135
+
136
+ payment.switchMethod(method);
137
+ };
138
+ Event.observe($('p_method_<?php echo $_code ?>'), 'change', SwitchMethod);
139
+
140
+ //]]>
141
+ </script>
142
+ <?php endforeach; ?>
143
+ </dl>
144
+ <?php endif;?>
145
+ </div>
146
+ <script type="text/javascript">
147
+ //<![CDATA[
148
+
149
+ $$('.cvv-what-is-this').each(function(element){
150
+ Event.observe(element, 'click', toggleToolTip);
151
+ });
152
+
153
+ function toggleToolTip(event){
154
+ if($('payment-tool-tip')){
155
+ $('payment-tool-tip').setStyle({
156
+ left: (Event.pointerX(event)-100)+'px',
157
+ top: (Event.pointerY(event)-300)+'px'
158
+ });
159
+ $('payment-tool-tip').toggle();
160
+ }
161
+ Event.stop(event);
162
+ }
163
+
164
+ var checkout = new Checkout();
165
+ $$('#checkout-payment-method-load dt input').invoke('observe', 'click', function(e) {
166
+
167
+ var element = e.element();
168
+ var name = 'payment_form_' + element.getValue();
169
+ payment.currentMethod = element.getValue();
170
+ /* Hide all other forms */
171
+ $$('dd.payment-method').invoke('hide');
172
+
173
+ if(element.checked) {
174
+ payment.switchMethod(payment.currentMethod);
175
+ var form = $(name);
176
+ var container = $('container_payment_method_' + element.getValue());
177
+
178
+ if(element !== null && container !== null) {
179
+ container.show();
180
+ $(name).show();
181
+ }
182
+ }
183
+ });
184
+
185
+ // ADYEN: set current method as well if you click on hpp and oneclick
186
+ $$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', function(e) {
187
+ payment.currentMethod = "adyen_hpp";
188
+ });
189
+
190
+ $$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', function(e) {
191
+ payment.currentMethod = "adyen_oneclick";
192
+ });
193
+
194
+ <?php if(Mage::helper('onestepcheckout')->isEnterprise() && Mage::helper('customer')->isLoggedIn()):?>
195
+ //if we have a enterprise version we should include this
196
+
197
+ rPoints = $('use_reward_points');
198
+ if(rPoints){
199
+ if(rPoints.checked){
200
+ payment.switchRewardPointsCheckbox();
201
+ }
202
+ }
203
+ cBalance = $('use_customer_balance');
204
+ if(cBalance){
205
+ if(cBalance.checked){
206
+ payment.switchCustomerBalanceCheckbox();
207
+ }
208
+ }
209
+ //if we have a enterprise version we should include this end
210
+ <?php endif;?>
211
+
212
+ payment.switchMethod(payment.currentMethod);
213
+
214
+
215
+ <?php echo $this->getChildHtml('giftcardaccount_scripts');?>
216
+ //]]>
217
+ </script>
app/design/frontend/enterprise/adyen/template/checkout/onepage/payment/methods.phtml ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento Enterprise Edition
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Magento Enterprise Edition License
8
+ * that is bundled with this package in the file LICENSE_EE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.magentocommerce.com/license/enterprise-edition
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://www.magentocommerce.com/license/enterprise-edition
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * One page checkout payment methods
30
+ *
31
+ * @see Mage_Checkout_Block_Onepage_Payment_Methods
32
+ */
33
+ $methods = $this->getMethods();
34
+ $oneMethod = count($methods) <= 1;
35
+ ?>
36
+ <dl class="sp-methods" id="checkout-payment-method-load">
37
+ <?php foreach ($methods as $_method):
38
+ $_code = $_method->getCode();
39
+
40
+ $_style = "";
41
+ if($_code == "adyen_hpp") {
42
+
43
+ // get method and check if config payment/adyen_hpp/disable_hpptypes is set
44
+ $disabled = $_method->getHppOptionsDisabled();
45
+ if(!$disabled) {
46
+ $_style = ($_code == "adyen_hpp" && !$oneMethod) ? "display:none" : "";
47
+ }
48
+ } else if ($_code == "adyen_oneclick" && !$oneMethod) {
49
+ $_style = "display:none";
50
+ }
51
+ ?>
52
+ <dt style="<?php echo $_style; ?>">
53
+ <?php if( sizeof($this->getMethods()) > 1 ): ?>
54
+ <input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" title="<?php echo $this->htmlEscape($_method->getTitle()) ?>" onclick="payment.switchMethod('<?php echo $_code ?>')"<?php if($this->getSelectedMethodCode()==$_code): ?> checked="checked"<?php endif; ?> class="radio" />
55
+ <?php else: ?>
56
+ <span class="no-display"><input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" checked="checked" class="radio" /></span>
57
+ <?php endif; ?>
58
+
59
+ <?php if(($_code == "adyen_hpp" && $disabled) || ($_code != "adyen_hpp")): ?>
60
+ <label for="p_method_<?php echo $_code ?>"><?php echo $this->getMethodTitle($_method) ?> <?php echo $this->getMethodLabelAfterHtml($_method) ?></label>
61
+ <?php endif; ?>
62
+
63
+ </dt>
64
+ <?php if ($html = $this->getPaymentMethodFormHtml($_method)): ?>
65
+ <dd>
66
+ <?php echo $html; ?>
67
+ </dd>
68
+ <?php endif; ?>
69
+ <script type="text/javascript">
70
+ //<![CDATA[
71
+
72
+ var SwitchMethod= function() {
73
+ var method = $('p_method_<?php echo $_code?>').value;
74
+
75
+ if(method != "adyen_hpp") {
76
+ // check if hpp is enabled if so clear the selected option because you select different payment method
77
+ if($('hpp_payment_form_adyen_hpp'))
78
+ {
79
+ var form = $('hpp_payment_form_adyen_hpp');
80
+ var elements = form.getElementsByTagName('input');
81
+ for (var i=0; i<elements.length; i++) elements[i].checked = false;
82
+ }
83
+ }
84
+
85
+ // check if adyen_oneclick is enabled
86
+ if(method != "adyen_oneclick") {
87
+ if($('oneclick_payment_form_adyen_oneclick'))
88
+ {
89
+ // if so clear the selected option because you select different payment method
90
+ var form = $('oneclick_payment_form_adyen_oneclick');
91
+ var elements = form.getElementsByTagName('input');
92
+ for (var i=0; i<elements.length; i++) elements[i].checked = false;
93
+
94
+ // don't show the cvc field
95
+ $$('.cvc_block').each(
96
+ function (e) {
97
+ e.setStyle({display:'none'});
98
+ }
99
+ );
100
+ }
101
+ }
102
+ payment.switchMethod(method);
103
+ };
104
+ Event.observe($('p_method_<?php echo $_code ?>'), 'change', SwitchMethod);
105
+
106
+ //]]>
107
+ </script>
108
+ <?php endforeach; ?>
109
+ </dl>
110
+ <?php echo $this->getChildChildHtml('additional'); ?>
111
+ <script type="text/javascript">
112
+ //<![CDATA[
113
+ <?php echo $this->getChildChildHtml('scripts'); ?>
114
+ payment.init();
115
+ <?php if (is_string($oneMethod)): ?>
116
+ payment.switchMethod('<?php echo $oneMethod ?>');
117
+ <?php endif; ?>
118
+
119
+ // always enable the hpp payment options if this payment method is on
120
+ if($('hpp_payment_form_adyen_hpp'))
121
+ {
122
+ var form = $('hpp_payment_form_adyen_hpp');
123
+ var elements = form.getElementsByTagName('input');
124
+ for (var i=0; i<elements.length; i++) elements[i].disabled = false;
125
+ }
126
+
127
+ // always enable the oneclick payments options if this payment method is on
128
+ if($('oneclick_payment_form_adyen_oneclick'))
129
+ {
130
+ var form = $('oneclick_payment_form_adyen_oneclick');
131
+ var elements = form.getElementsByTagName('input');
132
+ for (var i=0; i<elements.length; i++) elements[i].disabled = false;
133
+
134
+ // always enable the selectboxes for the oneclick creditcards
135
+ var elements = form.getElementsByTagName('select');
136
+ for (var i=0; i<elements.length; i++) elements[i].disabled = false;
137
+ }
138
+ //]]>
139
+ </script>
app/design/frontend/enterprise/adyen/template/onestepcheckout/checkout.phtml ADDED
@@ -0,0 +1,1319 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $step_counter = 1;
4
+ $helper = Mage::helper('onestepcheckout/checkout');
5
+
6
+ ?>
7
+ <?php if(!$this->canCheckout() || !$this->validateMinimumAmount()): ?>
8
+ <?php if($this->settings['checkout_title']): ?>
9
+ <h1 class="onestepcheckout-title"><?php echo $this->settings['checkout_title']; ?></h1>
10
+ <?php endif; ?>
11
+
12
+ <?php if($this->canCheckout() && !$this->validateMinimumAmount()): ?>
13
+ <p><?php echo Mage::getStoreConfig('sales/minimum_order/description'); ?></p>
14
+ <p><a href="<?php echo $this->getUrl(''); ?>"><?php echo $this->__('Back to homepage'); ?></a></p>
15
+ <?php else: ?>
16
+ <p><?php echo $this->__('You need to have products in your cart to checkout, and your cart is empty.'); ?></p>
17
+ <p><a href="<?php echo $this->getUrl(''); ?>"><?php echo $this->__('Back to homepage'); ?></a></p>
18
+ <?php endif; ?>
19
+ <?php else: ?>
20
+
21
+ <form id="onestepcheckout-form" method="post" action="<?php echo $this->getUrl('onestepcheckout', array('_secure'=>true)); ?>">
22
+ <fieldset class="group-select" style="margin: 0;">
23
+
24
+ <?php if($this->settings['checkout_title']): ?>
25
+ <h1 class="onestepcheckout-title"><?php echo $this->settings['checkout_title']; ?></h1>
26
+ <?php endif; ?>
27
+
28
+ <?php if($this->settings['checkout_description']): ?>
29
+ <p class="onestepcheckout-description"><?php echo $this->settings['checkout_description']; ?></p>
30
+ <?php endif; ?>
31
+
32
+ <?php if(!$this->isCustomerLoggedIn() && $helper->showLoginLink()): ?>
33
+ <p class="onestepcheckout-login-link">
34
+ <a id="onestepcheckout-login-link" href="javascript:void(0); return: false;"><?php echo $this->__('Already registered? Click here to login.'); ?></a>
35
+ </p>
36
+ <?php endif; ?>
37
+
38
+ <?php if(isset($this->formErrors['unknown_source_error'])): ?>
39
+ <div class="onestepcheckout-error">
40
+ <?php echo $this->formErrors['unknown_source_error']; ?>
41
+ </div>
42
+ <?php endif; ?>
43
+ <div class="onestepcheckout-threecolumns checkoutcontainer onestepcheckout-skin-<?php echo $this->settings['skin']; ?> <?php if(Mage::helper('onestepcheckout')->isEnterprise()): ?>onestepcheckout-enterprise<?php endif; ?>">
44
+ <div class="onestepcheckout-column-left">
45
+ <div id="billing_address">
46
+ <script type="text/javascript">
47
+ var billing = new Billing();
48
+
49
+ </script>
50
+ <ul>
51
+ <li>
52
+ <p class="onestepcheckout-numbers onestepcheckout-numbers-<?php echo $step_counter++; ?>"><?php echo $this->__('Billing address'); ?></p>
53
+ <?php if(isset($this->formErrors['billing_error']) && count($this->formErrors['billing_errors']) > 0): ?>
54
+ <div class="onestepcheckout-error">
55
+ <?php echo $this->__('Please check red fields below and try again.'); ?>
56
+ </div>
57
+ <?php endif; ?>
58
+ </li>
59
+ <?php if ($this->customerHasAddresses()): ?>
60
+ <li>
61
+ <label for="billing-address-select"><?php echo $this->__('Select a billing address from your address book or enter a new address.') ?></label>
62
+ <div class="input-box">
63
+ <?php echo $this->getAddressesHtmlSelect('billing') ?>
64
+ </div>
65
+ </li>
66
+ <?php endif; ?>
67
+ <li>
68
+ <div>
69
+ <ul id="billing_address_list" <?php echo (($this->customerHasAddresses() && !$this->getNewAddressSelectValueOnError('billing')) ? 'style = "display:none"' : false ); ?>>
70
+ <?php echo $this->getChildHtml('billing_address');?>
71
+ <?php $addressAttributes = $this->getChild('customer_form_billing_address_user_defined_attributes');?>
72
+ <?php if ($addressAttributes): ?>
73
+ <?php $addressAttributes->setEntity($this->getQuote()->getBillingAddress())->setEntityType('customer_address');?>
74
+ <?php $addressAttributes->setFieldIdFormat('billing:%1$s')->setFieldNameFormat('billing[%1$s]');?>
75
+ <?php echo $addressAttributes->setExcludeFileAttributes(true)->setShowContainer(false)->toHtml()?>
76
+ <?php endif;?>
77
+ <?php $customerAttributes = $this->getChild('customer_form_customer_user_defined_attributes');?>
78
+ <?php if ($customerAttributes): ?>
79
+ <?php $customerAttributes->setEntityModelClass('customer/customer')->setFieldIdFormat('billing:%1$s');?>
80
+ <?php $customerAttributes->setFieldNameFormat('billing[%1$s]')->setShowContainer(false);?>
81
+ <?php echo $customerAttributes->setExcludeFileAttributes(true)->toHtml()?>
82
+ <?php endif;?>
83
+ </ul>
84
+ </div>
85
+ </li>
86
+ <li>
87
+ <?php $uncheck = (!empty($_POST['billing']) && empty($_POST['billing']['use_for_shipping']));?>
88
+ <?php if($this->differentShippingAvailable()): ?>
89
+ <div class="input-box input-different-shipping">
90
+ <input type="checkbox" name="billing[use_for_shipping]" id="billing:use_for_shipping_yes" value="1" <?php echo (($this->sameAsBilling() && !$uncheck) ? 'checked="checked" ':'')?>/>
91
+ <label for="billing:use_for_shipping_yes"><?php echo $this->__('Ship to the same address')?></label>
92
+ </div>
93
+ <?php else: ?>
94
+ <input type="hidden" name="billing[use_for_shipping]" id="billing:use_for_shipping_yes" value="1" />
95
+ <?php endif; ?>
96
+ </li>
97
+ </ul>
98
+ </div>
99
+ <?php if($this->differentShippingAvailable()): ?>
100
+ <div id="shipping_address" <?php echo (($this->sameAsBilling() && !$uncheck) ? 'style="display: none"': false);?>>
101
+ <script type="text/javascript">
102
+ var shipping = new Shipping();
103
+ </script>
104
+ <ul>
105
+ <li class="shipping-address-title">
106
+ <?php echo $this->__('Shipping address'); ?>
107
+ </li>
108
+ <?php if ($this->customerHasAddresses()): ?>
109
+ <li class="form-alt">
110
+ <label for="shipping-address-select"><?php echo $this->__('Select a shipping address from your address book or enter a new address.') ?></label>
111
+ <div class="input-box"><?php echo $this->getAddressesHtmlSelect('shipping') ?></div>
112
+ </li>
113
+ <?php endif ?>
114
+ <li id="shipping_address_list" <?php if($this->customerHasAddresses() && !$this->getNewAddressSelectValueOnError('shipping')) { echo ' style="display: none;" '; } ?>>
115
+ <div id="">
116
+ <ul>
117
+ <?php echo $this->getChildHtml('shipping_address');?>
118
+ <?php $addressAttributes = $this->getChild('customer_form_shipping_address_user_defined_attributes');?>
119
+ <?php if ($addressAttributes): ?>
120
+ <?php $addressAttributes->setEntity($this->getQuote()->getShippingAddress())->setEntityType('customer_address');?>
121
+ <?php $addressAttributes->setFieldIdFormat('shipping:%1$s')->setFieldNameFormat('shipping[%1$s]');?>
122
+ <?php echo $addressAttributes->setExcludeFileAttributes(true)->setShowContainer(false)->toHtml()?>
123
+ <?php endif;?>
124
+ </ul>
125
+ <input type="hidden" name="shipping[address_id]" value="<?php echo $this->getQuote()->getShippingAddress()->getId() ?>" id="shipping:address_id" />
126
+ <!-- END LIST OF SHIPPIING FIELDS -->
127
+ </div>
128
+ </li>
129
+ </ul>
130
+ </div>
131
+ <?php endif; ?>
132
+ </div>
133
+
134
+ <div class="onestepcheckout-column-middle">
135
+
136
+
137
+ <?php if(!$this->isVirtual()): ?>
138
+ <?php if(Mage::getStoreConfig('onestepcheckout/general/hide_shipping_method')):?>
139
+ <?php if(isset($this->formErrors['shipping_method']) && $this->formErrors['shipping_method']): ?>
140
+ <div class="onestepcheckout-error onestepcheckout-shipment-method-error">
141
+ <?php echo $this->__('Please choose a shipping method.'); ?>
142
+ </div>
143
+ <?php endif; ?>
144
+ <?php echo $this->getChildHtml('choose-shipping-method'); ?>
145
+ <?php else:?>
146
+ <div class="onestepcheckout-shipping-method">
147
+ <p class="onestepcheckout-numbers onestepcheckout-numbers-<?php echo $step_counter++; ?>"><?php echo $this->__('Shipping method'); ?></p>
148
+
149
+ <?php if(isset($this->formErrors['shipping_method']) && $this->formErrors['shipping_method']): ?>
150
+ <div class="onestepcheckout-error onestepcheckout-shipment-method-error">
151
+ <?php echo $this->__('Please choose a shipping method.'); ?>
152
+ </div>
153
+ <?php endif; ?>
154
+
155
+ <div class="onestepcheckout-shipping-method-block">
156
+ <?php echo $this->getChildHtml('choose-shipping-method'); ?>
157
+ </div>
158
+ </div>
159
+ <?php endif; ?>
160
+ <?php endif; ?>
161
+
162
+ <?php if(Mage::getStoreConfig('onestepcheckout/general/hide_payment_method')):?>
163
+ <?php if(!empty($this->formErrors['payment_method'])): ?>
164
+ <div class="onestepcheckout-error onestepcheckout-payment-method-error">
165
+ <?php echo $this->__('Please choose a payment method.'); ?>
166
+ </div>
167
+ <?php endif; ?>
168
+ <?php if(!empty($this->formErrors['payment_method_error'])): ?>
169
+ <div class="onestepcheckout-error onestepcheckout-payment-method-error">
170
+ <?php echo $this->__('Please enter valid details below.'); ?>
171
+ </div>
172
+ <?php endif; ?>
173
+ <?php echo $this->getChildHtml('choose-payment-method'); ?>
174
+ <?php else: ?>
175
+ <p class="onestepcheckout-numbers onestepcheckout-numbers-<?php echo $step_counter++; ?>"><?php echo $this->__('Payment method'); ?></p>
176
+ <?php if(isset($this->formErrors['payment_method']) && $this->formErrors['payment_method']): ?>
177
+ <div class="onestepcheckout-error onestepcheckout-payment-method-error">
178
+ <?php echo $this->__('Please choose a payment method.'); ?>
179
+ </div>
180
+ <?php else: ?>
181
+ <?php if(isset($this->formErrors['payment_method_error'])): ?>
182
+ <div class="onestepcheckout-error onestepcheckout-payment-method-error">
183
+ <?php echo $this->__('Please enter valid details below.'); ?>
184
+ </div>
185
+ <?php endif; ?>
186
+ <?php endif; ?>
187
+
188
+ <?php echo $this->getChildHtml('choose-payment-method'); ?>
189
+
190
+ <div class="tool-tip" id="payment-tool-tip" style="display:none;">
191
+ <div class="btn-close">
192
+ <a href="javascript:void(0);" id="payment-tool-tip-close"><img src="<?php echo $this->getSkinUrl('images/btn_window_close.gif') ?>" alt="<?php echo $this->__('Close') ?>" /></a>
193
+ </div>
194
+ <div class="block-content">
195
+ <img src="<?php echo $this->getSkinUrl('images/cvv.gif') ?>" alt="<?php echo $this->__('Card Verification Number Visual Reference') ?>" />
196
+ </div>
197
+ </div>
198
+ <?php endif; ?>
199
+ </div>
200
+
201
+ <div class="onestepcheckout-column-right">
202
+
203
+ <p class="onestepcheckout-numbers onestepcheckout-numbers-4"><?php echo $this->__('Review your order'); ?></p>
204
+
205
+ <div class="onestepcheckout-summary">
206
+ <?php echo $this->getChildHtml('summary'); ?>
207
+ </div>
208
+
209
+ <?php if($this->settings['enable_discount']): ?>
210
+ <div class="onestepcheckout-coupons">
211
+ <div id="coupon-notice" style="display: none;"></div>
212
+ <?php $_couponcode = $this->getQuote()->getCouponCode(); ?>
213
+ <label for="id_couponcode"><?php echo $this->__('Coupon code:'); ?></label><br/>
214
+ <input class="input-text" type="text" name="onestepcheckout-couponcode" id="id_couponcode" value="<?php echo Mage::helper('core')->escapeHtml($_couponcode); ?>" />
215
+ <br/>
216
+ <button id="onestepcheckout-coupon-add" class="form-button-alt button" type="button"><span><span><?php echo $this->__('Apply Coupon'); ?></span></span></button>
217
+ <button id="onestepcheckout-coupon-remove" class="form-button-alt button" type="button" style="<?php if($_couponcode == '') { echo 'display: none;'; } ?>"><span><span><?php echo $this->__('Cancel Coupon'); ?></span></span></button>
218
+ <script>
219
+ Event.observe(window, 'load', function() {
220
+ $('onestepcheckout-coupon-add').observe('click', function(e) {
221
+
222
+ var coupon = $('id_couponcode').getValue();
223
+ var couponNotice = $('coupon-notice');
224
+
225
+ couponNotice.hide();
226
+
227
+ if(coupon == '') {
228
+ alert('<?php echo $this->__('Please enter a valid coupon code.'); ?>');
229
+ return;
230
+ }
231
+
232
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/add_coupon', array('_secure'=>true)); ?>';
233
+ var parameters = {code: coupon};
234
+ var shipping_methods = $$('dl.shipment-methods').first();
235
+
236
+ var form = $('onestepcheckout-form');
237
+ var payment_hpp_ideal_type = $RF(form, 'payment[hpp_ideal_type]');
238
+ var payment_hpp_type = $RF(form, 'payment[hpp_type]');
239
+ var payment_recurring_type = $RF(form, 'payment[recurring]');
240
+ var payment_recurring_type_cvc = $('adyen_oneclick_oneclick_cid_'+payment_recurring_type);
241
+ var payment_methods = $$('div.payment-methods').first();
242
+
243
+ var summary = $$('div.onestepcheckout-summary').first();
244
+
245
+ if(shipping_methods){
246
+ shipping_methods.update('<div class="loading-ajax">&nbsp;</div>');
247
+ }
248
+
249
+ if(payment_methods){
250
+ payment_methods.update('<div class="loading-ajax">&nbsp;</div>');
251
+ }
252
+
253
+ summary.update('<div class="loading-ajax">&nbsp;</div>');
254
+
255
+ new Ajax.Request(url, {
256
+ method: 'post',
257
+ parameters: parameters,
258
+ onSuccess: function(transport) {
259
+ if(transport.status == 200) {
260
+
261
+ var response = transport.responseText.evalJSON();
262
+
263
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/set_methods_separate', array('_secure'=>true)); ?>';
264
+ var update_payments = <?php echo $this->settings['enable_update_payment_on_shipping'] ? 'true' : 'false'; ?>;
265
+
266
+ if(shipping_methods){
267
+ shipping_methods.hide();
268
+ shipping_methods.update(response.shipping_method);
269
+ shipping_methods.show();
270
+ $$('dl.shipment-methods input').invoke('observe', 'click', get_separate_save_methods_function(url, update_payments));
271
+ $$('dl.shipment-methods input').invoke('observe', 'click', function() {
272
+ $$('div.onestepcheckout-shipment-method-error').each(function(item) {
273
+ new Effect.Fade(item);
274
+ });
275
+ });
276
+ }
277
+
278
+ if(payment_methods){
279
+ payment_methods.hide();
280
+ payment_methods.replace(response.payment_method);
281
+ payment_methods.show();
282
+
283
+ paymentContainer = $('container_payment_method_' + payment.currentMethod)
284
+ paymentForm = $('payment_form_' + payment.currentMethod)
285
+ var payment_method = $RF(form, 'payment[method]');
286
+
287
+ if(paymentContainer != null){
288
+ paymentContainer.show();
289
+ }
290
+ if(paymentForm != null){
291
+ paymentForm.show();
292
+ } else if(payment_method == "adyen_hpp") { // check if payment type is hpp (this has other id so should come in else )
293
+ // set sub payment method back
294
+ $('hpp_type_'+payment_hpp_type).checked = true;
295
+
296
+ // check if ideal payment bank is chosen
297
+ if(payment_hpp_type == "ideal") {
298
+ if(payment_hpp_ideal_type) {
299
+ // get issue_id this is before the slash
300
+ var issue_id = payment_hpp_ideal_type.substr(0, payment_hpp_ideal_type.indexOf('/'));
301
+ $('hpp_ideal_type_'+issue_id).checked = true;
302
+ }
303
+ $('payment_form_ideal').show();
304
+ }
305
+ } else if(payment_method == "adyen_oneclick") { // check if payment type is hpp
306
+ // set sub payment method back
307
+ $('recurring_type_'+payment_recurring_type).checked = true;
308
+ // set back the cvc code
309
+ $('adyen_oneclick_oneclick_cid_'+payment_recurring_type).value = payment_recurring_type_cvc.value;
310
+ // show the cvc code block
311
+ var cvc_block = "cvc_block_" + payment_recurring_type;
312
+ $(cvc_block).show();
313
+ }
314
+
315
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
316
+ $$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
317
+ $$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
318
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
319
+ $$('div.onestepcheckout-payment-method-error').each(function(item) {
320
+ new Effect.Fade(item);
321
+ });
322
+ });
323
+ }
324
+
325
+ summary.hide();
326
+ summary.update(response.summary);
327
+ summary.show();
328
+
329
+ if(response.success) {
330
+
331
+ couponNotice.update(response.message);
332
+ couponNotice.removeClassName('error-msg');
333
+ couponNotice.addClassName('success-msg');
334
+ couponNotice.show();
335
+ /* Show remove button */
336
+ $('onestepcheckout-coupon-remove').show();
337
+ }
338
+ else {
339
+
340
+ couponNotice.update(response.message);
341
+ couponNotice.removeClassName('success-msg');
342
+ couponNotice.addClassName('error-msg');
343
+ couponNotice.show();
344
+ /* Hide remove button */
345
+ $('onestepcheckout-coupon-remove').hide();
346
+ }
347
+ }
348
+ }
349
+ });
350
+ });
351
+
352
+ $('onestepcheckout-coupon-remove').observe('click', function(e) {
353
+
354
+ var coupon = $('id_couponcode').getValue();
355
+ var couponNotice = $('coupon-notice');
356
+
357
+ couponNotice.hide();
358
+
359
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/add_coupon', array('_secure'=>true)); ?>';
360
+ var parameters = {code: coupon, remove: '1'};
361
+ var shipping_methods = $$('dl.shipment-methods').first();
362
+ var payment_methods = $$('div.payment-methods').first();
363
+ var summary = $$('div.onestepcheckout-summary').first();
364
+
365
+ if(shipping_methods){
366
+ shipping_methods.update('<div class="loading-ajax">&nbsp;</div>');
367
+ }
368
+
369
+ if(payment_methods){
370
+ payment_methods.update('<div class="loading-ajax">&nbsp;</div>');
371
+ }
372
+ summary.update('<div class="loading-ajax">&nbsp;</div>');
373
+
374
+ new Ajax.Request(url, {
375
+ method: 'post',
376
+ parameters: parameters,
377
+ onSuccess: function(transport) {
378
+ if(transport.status == 200) {
379
+ var response = transport.responseText.evalJSON();
380
+
381
+ if(response.success){
382
+ $('id_couponcode').setValue('')
383
+ $('onestepcheckout-coupon-remove').hide();
384
+ }
385
+
386
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/set_methods_separate', array('_secure'=>true)); ?>';
387
+ var update_payments = <?php echo $this->settings['enable_update_payment_on_shipping'] ? 'true' : 'false'; ?>;
388
+
389
+ if(shipping_methods){
390
+ shipping_methods.hide();
391
+ shipping_methods.update(response.shipping_method);
392
+ shipping_methods.show();
393
+ $$('dl.shipment-methods input').invoke('observe', 'click', get_separate_save_methods_function(url, update_payments));
394
+ $$('dl.shipment-methods input').invoke('observe', 'click', function() {
395
+ $$('div.onestepcheckout-shipment-method-error').each(function(item) {
396
+ new Effect.Fade(item);
397
+ });
398
+ });
399
+ }
400
+
401
+ if(payment_methods){
402
+ payment_methods.hide();
403
+ payment_methods.replace(response.payment_method);
404
+ payment_methods.show();
405
+
406
+ paymentContainer = $('container_payment_method_' + payment.currentMethod)
407
+ paymentForm = $('payment_form_' + payment.currentMethod)
408
+
409
+ if(paymentContainer != null){
410
+ paymentContainer.show();
411
+ }
412
+
413
+ if(paymentForm != null){
414
+ paymentForm.show();
415
+ }
416
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
417
+ $$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
418
+ $$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
419
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
420
+ $$('div.onestepcheckout-payment-method-error').each(function(item) {
421
+ new Effect.Fade(item);
422
+ });
423
+ });
424
+ }
425
+
426
+ summary.hide();
427
+ summary.update(response.summary);
428
+ summary.show();
429
+
430
+ couponNotice.hide();
431
+ couponNotice.update(response.message);
432
+ couponNotice.removeClassName('error-msg');
433
+ couponNotice.addClassName('success-msg');
434
+ couponNotice.show();
435
+ }
436
+ }
437
+ });
438
+ });
439
+ });
440
+ </script>
441
+ </div>
442
+ <?php endif; ?>
443
+
444
+ <?php if($this->settings['enable_giftcard']): ?>
445
+ <div class="onestepcheckout-giftcards">
446
+ <div id="giftcard-notice" style="display: none;"></div>
447
+ <?php
448
+ $_hasGiftCards = unserialize($this->getQuote()->getGiftCards());
449
+ $_giftcardcode = $this->getQuote()->getgiftcardCode(); ?>
450
+ <label for="id_giftcardcode"><?php echo $this->__('giftcard code:'); ?></label><br/>
451
+ <input class="input-text" type="text" name="onestepcheckout-giftcardcode" id="id_giftcardcode" value="<?php echo Mage::helper('core')->escapeHtml($_giftcardcode); ?>" />
452
+ <br/>
453
+ <button id="onestepcheckout-giftcard-add" class="form-button-alt button" type="button"><span><span><?php echo $this->__('Apply gift card'); ?></span></span></button>
454
+ <button id="onestepcheckout-giftcard-remove" class="form-button-alt button" type="button" style="<?php if(empty($_hasGiftCards)) { echo 'display: none;'; } ?>"><span><span><?php echo $this->__('Cancel gift card'); ?></span></span></button>
455
+ <script>
456
+ document.observe('dom:loaded', function() {
457
+ $('onestepcheckout-giftcard-add').observe('click', function(e) {
458
+ var giftcard = $('id_giftcardcode').getValue();
459
+ var giftcardNotice = $('giftcard-notice');
460
+ giftcardNotice.hide();
461
+ if(giftcard == '') {
462
+ alert('<?php echo $this->__('Please enter a valid giftcard code.'); ?>');
463
+ return;
464
+ }
465
+
466
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/add_giftcard', array('_secure'=>true)); ?>';
467
+ var parameters = {code: giftcard};
468
+ var shipping_methods = $$('dl.shipment-methods').first();
469
+ var payment_methods = $$('div.payment-methods').first();
470
+ var summary = $$('div.onestepcheckout-summary').first();
471
+
472
+ if(shipping_methods){
473
+ shipping_methods.update('<div class="loading-ajax">&nbsp;</div>');
474
+ }
475
+
476
+ if(payment_methods){
477
+ payment_methods.update('<div class="loading-ajax">&nbsp;</div>');
478
+ }
479
+ summary.update('<div class="loading-ajax">&nbsp;</div>');
480
+
481
+ new Ajax.Request(url+Math.random(1000), {
482
+ method: 'post',
483
+ parameters: parameters,
484
+ onSuccess: function(transport) {
485
+ if(transport.status == 200) {
486
+
487
+ var response = transport.responseText.evalJSON();
488
+
489
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/set_methods_separate', array('_secure'=>true)); ?>';
490
+ var update_payments = <?php echo $this->settings['enable_update_payment_on_shipping'] ? 'true' : 'false'; ?>;
491
+
492
+ if(shipping_methods){
493
+ shipping_methods.hide();
494
+ shipping_methods.update(response.shipping_method);
495
+ shipping_methods.show();
496
+ $$('dl.shipment-methods input').invoke('observe', 'click', get_separate_save_methods_function(url, update_payments));
497
+ $$('dl.shipment-methods input').invoke('observe', 'click', function() {
498
+ $$('div.onestepcheckout-shipment-method-error').each(function(item) {
499
+ new Effect.Fade(item);
500
+ });
501
+ });
502
+ }
503
+
504
+ if(payment_methods){
505
+ //payment_methods.hide();
506
+ payment_methods.replace(response.payment_method);
507
+ //payment_methods.show();
508
+
509
+ paymentContainer = $('container_payment_method_' + payment.currentMethod)
510
+ paymentForm = $('payment_form_' + payment.currentMethod)
511
+
512
+ if(paymentContainer != null){
513
+ paymentContainer.show();
514
+ }
515
+ if(paymentForm != null){
516
+ paymentForm.show();
517
+ }
518
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
519
+ $$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
520
+ $$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
521
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
522
+ $$('div.onestepcheckout-payment-method-error').each(function(item) {
523
+ new Effect.Fade(item);
524
+ });
525
+ });
526
+ }
527
+
528
+ if(response.success) {
529
+ summary.update(response.summary);
530
+ giftcardNotice.update(response.message);
531
+ giftcardNotice.removeClassName('error-msg');
532
+ giftcardNotice.addClassName('success-msg');
533
+ giftcardNotice.show();
534
+ /* Show remove button */
535
+ $('onestepcheckout-giftcard-remove').show();
536
+ }
537
+ else {
538
+ summary.update(response.summary);
539
+ giftcardNotice.update(response.message);
540
+ giftcardNotice.removeClassName('success-msg');
541
+ giftcardNotice.addClassName('error-msg');
542
+ giftcardNotice.show();
543
+ /* Hide remove button */
544
+ //$('onestepcheckout-giftcard-remove').hide();
545
+ }
546
+ }
547
+ }
548
+ });
549
+ });
550
+
551
+ $('onestepcheckout-giftcard-remove').observe('click', function(e) {
552
+ var giftcard = $('id_giftcardcode').getValue();
553
+ var giftcardNotice = $('giftcard-notice');
554
+ giftcardNotice.hide();
555
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/add_giftcard', array('_secure'=>true)); ?>';
556
+ var parameters = {code: giftcard, remove: '1'};
557
+ var shipping_methods = $$('dl.shipment-methods').first();
558
+ var payment_methods = $$('div.payment-methods').first();
559
+ var summary = $$('div.onestepcheckout-summary').first();
560
+
561
+ if(shipping_methods){
562
+ shipping_methods.update('<div class="loading-ajax">&nbsp;</div>');
563
+ }
564
+
565
+ if(payment_methods){
566
+ payment_methods.update('<div class="loading-ajax">&nbsp;</div>');
567
+ }
568
+ summary.update('<div class="loading-ajax">&nbsp;</div>');
569
+
570
+ new Ajax.Request(url, {
571
+ method: 'post',
572
+ parameters: parameters,
573
+ onSuccess: function(transport) {
574
+ if(transport.status == 200) {
575
+ var response = transport.responseText.evalJSON();
576
+
577
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/set_methods_separate', array('_secure'=>true)); ?>';
578
+ var update_payments = <?php echo $this->settings['enable_update_payment_on_shipping'] ? 'true' : 'false'; ?>;
579
+
580
+ if(shipping_methods){
581
+ shipping_methods.hide();
582
+ shipping_methods.update(response.shipping_method);
583
+ shipping_methods.show();
584
+ $$('dl.shipment-methods input').invoke('observe', 'click', get_separate_save_methods_function(url, update_payments));
585
+ $$('dl.shipment-methods input').invoke('observe', 'click', function() {
586
+ $$('div.onestepcheckout-shipment-method-error').each(function(item) {
587
+ new Effect.Fade(item);
588
+ });
589
+ });
590
+ }
591
+
592
+ if(payment_methods){
593
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
594
+ $$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
595
+ $$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
596
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
597
+ $$('div.onestepcheckout-payment-method-error').each(function(item) {
598
+ new Effect.Fade(item);
599
+ });
600
+ });
601
+ payment_methods.hide();
602
+ payment_methods.replace(response.payment_method);
603
+ payment_methods.show();
604
+
605
+ paymentContainer = $('container_payment_method_' + payment.currentMethod)
606
+ paymentForm = $('payment_form_' + payment.currentMethod)
607
+
608
+ if(paymentContainer != null){
609
+ paymentContainer.show();
610
+ }
611
+ if(paymentForm != null){
612
+ paymentForm.show();
613
+ }
614
+ }
615
+
616
+ if(response.success){
617
+ $('id_giftcardcode').setValue('')
618
+ $('onestepcheckout-giftcard-remove').hide();
619
+ }
620
+ var summary = $$('div.onestepcheckout-summary').first();
621
+
622
+ summary.hide();
623
+ summary.update(response.summary);
624
+ summary.show();
625
+
626
+ giftcardNotice.hide();
627
+ giftcardNotice.update(response.message);
628
+ giftcardNotice.removeClassName('error-msg');
629
+ giftcardNotice.addClassName('success-msg');
630
+ giftcardNotice.show();
631
+ }
632
+ }
633
+ });
634
+ });
635
+ });
636
+ </script>
637
+ </div>
638
+ <?php endif; ?>
639
+
640
+ <?php if($this->settings['enable_comments']): ?>
641
+ <div class="onestepcheckout-comments">
642
+ <label for="id_comments"><?php echo $this->__('Comments'); ?></label><br/>
643
+ <textarea id="id_comments" name="onestepcheckout_comments"><?php if(isset($_POST['onestepcheckout_comments'])) { echo Mage::helper('core')->escapeHtml($_POST['onestepcheckout_comments']); } ?></textarea>
644
+ </div>
645
+ <?php endif; ?>
646
+
647
+ <?php if($this->settings['enable_gift_messages']): ?>
648
+ <div id="onestepcheckout-giftmessages">
649
+ <div class="onestepcheckout-giftmessagecontainer">
650
+ <?php echo $this->helper('onestepcheckout/message')->getInline('onepage_checkout', $this->getQuote(), $this->getDontDisplayContainer()) ?>
651
+ </div>
652
+ </div>
653
+ <?php endif; ?>
654
+
655
+ <?php $customerEmail = (($this->isCustomerLoggedIn())) ? $this->getQuote()->getCustomer()->getEmail() : false ;?>
656
+ <?php if($this->settings['enable_newsletter'] && !$this->isSubScribed($customerEmail)): ?>
657
+ <div class="onestepcheckout-enable-newsletter">
658
+ <input type="checkbox" id="id_subscribe_newsletter" name="subscribe_newsletter" value="1" <?php if($this->settings['newsletter_default_checked']): ?>checked="checked"<?php endif; ?> />
659
+ <label for="id_subscribe_newsletter"><?php echo $this->__('Subscribe to our newsletter'); ?></label>
660
+ </div>
661
+ <?php endif; ?>
662
+
663
+ <?php $_extraProductsHelper = Mage::helper('onestepcheckout/extraproducts'); ?>
664
+ <?php if($_extraProductsHelper->hasExtraProducts()): ?>
665
+ <div class="onestepcheckout-extraproducts">
666
+ <ul>
667
+ <?php foreach($_extraProductsHelper->getExtraProducts() as $product): ?>
668
+ <li><input type="checkbox" class="onestepcheckout-extra-product"
669
+ <?php if($_extraProductsHelper->productInCart($product->getId())): ?>
670
+ checked="checked" <?php endif; ?>
671
+ name="extra_products_<?php echo $product->getId(); ?>"
672
+ id="id_extra_product_<?php echo $product->getId(); ?>" /> &nbsp;
673
+ <label for="id_extra_product_<?php echo $product->getId(); ?>"> <?php echo $product->getName(); ?>
674
+ <span><?php echo Mage::helper('checkout')->formatPrice($product->getPrice()); ?></span>
675
+ </label></li>
676
+ <?php endforeach; ?>
677
+ </ul>
678
+ </div>
679
+
680
+ <script>
681
+ Event.observe(window, 'load', function() {
682
+ $$('input.onestepcheckout-extra-product').invoke('observe', 'click', function(e) {
683
+ var id_temp = e.element().id.split('id_extra_product_');
684
+ if(id_temp.length == 2) {
685
+ var product_id = id_temp[1];
686
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/add_extra_product'); ?>';
687
+ var parameters = {
688
+ product_id: product_id
689
+ }
690
+
691
+ if(!e.element().checked) {
692
+ parameters['remove'] = 1;
693
+ }
694
+
695
+ var summary = $$('div.onestepcheckout-summary').first();
696
+ summary.update('<div class="loading-ajax">&nbsp;</div>');
697
+
698
+ new Ajax.Request(url, {
699
+ method: 'post',
700
+ parameters: parameters,
701
+ onSuccess: function(transport) {
702
+ summary.update(transport.responseText);
703
+ }
704
+ });
705
+ };
706
+ });
707
+ });
708
+ </script>
709
+ <?php endif; ?>
710
+
711
+ <?php
712
+ /**
713
+ * Feedbackdropdown start
714
+ */
715
+ ?>
716
+ <?php if(!empty($this->settings['feedback']['enable_feedback']) && !empty($this->settings['feedback']['feedback_values'])):?>
717
+ <?php
718
+ $selectedFeedBackFields = $this->getRequest()->getPost('onestepcheckout-feedback', false);
719
+ $feedbackValues = unserialize($this->settings['feedback']['feedback_values']);
720
+ ?>
721
+ <div class="onestepcheckout-feedback" id="">
722
+ <label for="id_feedback"><?php echo $this->__('How did you hear about us?'); ?></label><br>
723
+ <select style="" name="onestepcheckout-feedback" id="id_feedback" defaultvalue="">
724
+ <option value=""><?php echo $this->__('Please choose'); ?></option>
725
+ <?php foreach($feedbackValues as $value => $label):
726
+ $selected= (!empty($selectedFeedBackFields) && $selectedFeedBackFields == $value) ? ' selected' : '';
727
+ ?>
728
+ <option value="<?php echo $value?>" <?php echo $selected;?>><?php echo $label['value']?></option>
729
+ <?php endforeach;?>
730
+ <?php if(!empty($this->settings['feedback']['enable_feedback_freetext'])):
731
+ $selected= (empty($feedbackValues[$selectedFeedBackFields]) && $selectedFeedBackFields != '') ? ' selected' : '';
732
+ ?>
733
+ <option value="freetext" <?php echo $selected;?>><?php echo $this->__('Other'); ?></option>
734
+ <?php endif;?>
735
+ </select>
736
+ </div>
737
+ <?php if(!empty($this->settings['feedback']['enable_feedback_freetext'])):?>
738
+ <script type="text/javascript">
739
+ $('id_feedback').observe('change', function (event){
740
+ if(this.getValue() == 'freetext'){
741
+ $('id_feedback_freetext_div').show();
742
+ } else {
743
+ $('id_feedback_freetext_div').hide();
744
+ }
745
+ });
746
+ </script>
747
+ <div id='id_feedback_freetext_div' class="onestepcheckout-feedback-freetext"<?php echo ((!empty($selectedFeedBackFields) && $selectedFeedBackFields == 'freetext') ? '' : ' style="display: none;"'); ?>>
748
+ <label for="id_feedback_freetext"><?php echo $this->__('Please specify:'); ?></label><br/>
749
+ <textarea id="id_feedback_freetext" name="onestepcheckout-feedback-freetext"><?php echo Mage::helper('core')->escapeHtml($this->getRequest()->getPost('onestepcheckout-feedback-freetext', false));?></textarea>
750
+ </div>
751
+ <?php endif; ?>
752
+ <?php endif; ?>
753
+ <?php
754
+ /**
755
+ * Feedbackdropdown end
756
+ */
757
+ ?>
758
+
759
+ <?php if($this->settings['enable_terms']): //deprecated?>
760
+ <div class="onestepcheckout-enable-terms">
761
+ <?php
762
+
763
+ if(isset($this->formErrors['terms_error']) && $this->formErrors['terms_error']) {
764
+ $terms_error = true;
765
+ }
766
+ else {
767
+ if($_SERVER['REQUEST_METHOD'] == 'POST') {
768
+ $terms_error = false;
769
+ }
770
+ else {
771
+ $terms_error = true;
772
+ }
773
+ }
774
+ ?>
775
+
776
+ <input class="required-entry" type="checkbox" id="id_accept_terms" name="accept_terms" value="1" <?php if(!$terms_error) echo "checked=\"checked\""; ?> />
777
+ <label for="id_accept_terms"><?php echo $this->__('I accept the <a id="onestepcheckout-toc-link" target="_blank" href="javascript:void(0);">Terms and Conditions</a>'); ?></label>
778
+
779
+ <?php if(isset($this->formErrors['terms_error']) && $this->formErrors['terms_error']): ?>
780
+ <div class="onestepcheckout-error onestepcheckout-terms-error">
781
+ <?php echo $this->__('You must accept our terms to continue.'); ?>
782
+ </div>
783
+ <?php endif; ?>
784
+
785
+ </div>
786
+ <?php endif; ?>
787
+
788
+ <?php
789
+ /**
790
+ * Default magento agreements
791
+ */
792
+ ?>
793
+ <?php if($this->settings['enable_default_terms']): ?>
794
+ <?php if(!empty($this->formErrors['agreements_error'])):?>
795
+ <div class="onestepcheckout-error onestepcheckout-terms-error">
796
+ <?php echo $this->__('Please agree to all the terms and conditions before placing the order.'); ?>
797
+ </div>
798
+ <?php endif;?>
799
+ <?php echo $this->getChildHtml('agreements') ?>
800
+ <script type="text/javascript">
801
+
802
+ var termsmodals = new Object;
803
+
804
+ document.observe('dom:loaded', function() {
805
+ $$('.checkout-agreements li p input').each(
806
+ function(elem){
807
+ elem.addClassName('required-entry');
808
+ }
809
+ );
810
+ });
811
+
812
+ <?php if($this->settings['enable_textarea']):?>
813
+ document.observe('dom:loaded', function() {
814
+ $$('.checkout-agreements li p label').each(
815
+ function(elem){
816
+ elem.up().insert('<a href="javascript:void(0);" onclick="termsmodals[\'' + elem.htmlFor + '\'].open();">' + elem.innerHTML + '</a>');
817
+ elem.hide();
818
+ }
819
+ );
820
+ $$('div.agreement-content').each(
821
+ function(element){
822
+ element.id = 'agreement-div-' + element.up('li').down('input').id;
823
+ $$('body')[0].insert(element);
824
+ }
825
+ );
826
+ $$('.checkout-agreements li p input').each(
827
+ function(elem){
828
+ window.termsmodals[elem.id] = new Control.Modal($('agreement-div-' + elem.id),{
829
+ overlayOpacity: 0.75,
830
+ className: 'oscmodal',
831
+ fade: true,
832
+ closeOnClick: true,
833
+ height: 400,
834
+ width: 700
835
+ });
836
+ }
837
+ );
838
+ });
839
+ <?php endif;?>
840
+
841
+ </script>
842
+ <?php endif;?>
843
+ <?php
844
+ /**
845
+ * Default magento agreements end
846
+ */
847
+ ?>
848
+
849
+ <div class="onestepcheckout-place-order-wrapper">
850
+ <button type="button" title="<?php echo $this->__('Place order now'); ?>" id="onestepcheckout-place-order" class="large orange onestepcheckout-button onestepcheckout-place-order" onclick="javascript:void(0);"><span><span><?php echo $this->__('Place order now'); ?></span></span></button>
851
+ </div>
852
+ </div>
853
+ <div style="clear: both;">&nbsp;</div>
854
+ </div>
855
+ </fieldset>
856
+ </form>
857
+
858
+ <?php if(!$this->isCustomerLoggedIn() && $helper->showLoginLink()): ?>
859
+ <?php echo $this->getChildHtml('login-popup'); ?>
860
+ <?php endif; ?>
861
+
862
+ <?php if($helper->isValidateEmail()): ?>
863
+ <script>
864
+ $('billing:email').observe('blur', function(e) {
865
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/check_email', array('_secure'=>true)); ?>';
866
+ var email = e.element().getValue();
867
+ var parameters = { email: email };
868
+
869
+ new Ajax.Request(url, {
870
+ parameters: parameters,
871
+ onComplete: function(response) {
872
+ if(response.status == 200) {
873
+ var result = response.responseText.evalJSON().result;
874
+ if(result == 'invalid') {
875
+ $('onestepcheckout-email-error-message').update('<?php echo $this->__('Invalid email address.'); ?>');
876
+ $('onestepcheckout-email-error').show();
877
+ }
878
+ else if(result == 'exists') {
879
+ <?php if($this->settings['registration_order_without_password']): ?>
880
+ // Remove the password fields if the email exists in database
881
+ $('onestepcheckout-li-password').hide();
882
+ <?php endif; ?>
883
+ $('onestepcheckout-email-error-message').update('<?php echo $this->__('Email address already registered. Please <a href="javascript:void(0);" onclick="login_popup.show(); return false;">login now</a> or use a different email address.'); ?>');
884
+ $('onestepcheckout-email-error').show();
885
+ $('id_onestepcheckout_username').value = email;
886
+ }
887
+ else {
888
+ $('onestepcheckout-email-error').hide();
889
+ }
890
+ }
891
+ }
892
+ })
893
+
894
+ });
895
+ Validation.add('validate-email', '<?php echo $this->__('This is a required field.') ?>', function(v) {
896
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/check_email', array('_secure'=>true)); ?>';
897
+ var email = v;
898
+ var parameters = { email: email };
899
+ var value = Validation.get('IsEmpty').test(v) || /^([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*@([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*\.(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]){2,})$/i.test(v)
900
+
901
+ new Ajax.Request(url, {
902
+ parameters: parameters,
903
+ asynchronous: false,
904
+ onComplete: function(response) {
905
+ if(response.status == 200) {
906
+ var result = response.responseText.evalJSON().result;
907
+ if(result == 'invalid') {
908
+ value = false;
909
+ } else if(result == 'exists') {
910
+ <?php if($this->settings['registration_order_without_password']): ?>
911
+ $('onestepcheckout-li-password').hide();
912
+ <?php endif; ?>
913
+ $('onestepcheckout-email-error-message').update('<?php echo $this->__('Email address already registered. Please <a href="javascript:void(0);" onclick="login_popup.show(); return false;">login now</a> or use a different email address.'); ?>');
914
+ $('onestepcheckout-email-error').show();
915
+ $('id_onestepcheckout_username').value = email;
916
+ value = false;
917
+ }
918
+ }
919
+ }
920
+ })
921
+ return value;
922
+ });
923
+ </script>
924
+ <?php endif; ?>
925
+
926
+ <?php if($this->settings['enable_terms']): ?>
927
+ <div id="onestepcheckout-toc-popup" style="display: none;">
928
+
929
+ <div class="onestepcheckout-popup-wrapper">
930
+ <div class="onestepcheckout-popup-wrapper-inner">
931
+ <h1><?php echo $this->settings['terms_title']; ?></h1>
932
+
933
+ <div class="onestepcheckout-toc-terms">
934
+ <?php echo $this->settings['terms_contents']; ?>
935
+ </div>
936
+
937
+ <p class="close"><a href="javascript:void(0);"><?php echo $this->__('Close'); ?></a></p>
938
+ </div>
939
+ </div>
940
+ <div class="onestepcheckout-popup-footer">&nbsp;</div>
941
+ </div>
942
+ <script>
943
+ Event.observe(window, 'load', function() {
944
+
945
+ var termsPopup = new Control.Modal($('onestepcheckout-toc-popup'), {
946
+ overlayOpacity: 0.65,
947
+ fade: true,
948
+ fadeDuration: 0.3
949
+ });
950
+
951
+ $('onestepcheckout-toc-link').observe('click', function(e) {
952
+ e.preventDefault();
953
+ termsPopup.open();
954
+ });
955
+
956
+ $$('div#onestepcheckout-toc-popup p.close a').invoke('observe', 'click', function(e) {
957
+ e.preventDefault();
958
+ termsPopup.close();
959
+ });
960
+
961
+ });
962
+
963
+ /*
964
+ var popup;
965
+ Event.observe(window, 'load', function() {
966
+ popup = new OneStepCheckout_Popup('onestepcheckout-toc-popup','onestepcheckout-toc-link', 'div#onestepcheckout-toc-popup p.close a');
967
+ });
968
+ */
969
+ </script>
970
+ <?php endif; ?>
971
+
972
+
973
+
974
+
975
+
976
+ <script>
977
+ <?php if($this->hasFormErrors()): ?>
978
+ if($$('div.input-error').length > 0) {
979
+ var input = $$('div.input-error')[0].select('input');
980
+ if(input.length == 1) {
981
+ input[0].focus();
982
+ }
983
+ }
984
+ <?php endif; ?>
985
+ </script>
986
+
987
+ <?php if(!$this->settings['exclude_region']): ?>
988
+ <script type="text/javascript">countryRegions = <?php echo $this->helper('directory')->getRegionJson() ?></script>
989
+ <script type="text/javascript">
990
+ //<![CDATA[
991
+ var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', countryRegions, undefined, 'billing:postcode');
992
+
993
+ <?php if($this->settings['enable_different_shipping'] && !$this->isVirtual()): ?>
994
+ var shippingRegionUpdater = new RegionUpdater('shipping:country_id', 'shipping:region', 'shipping:region_id', countryRegions, undefined, 'shipping:postcode');
995
+ <?php endif; ?>
996
+ //]]>
997
+ </script>
998
+ <?php endif; ?>
999
+
1000
+
1001
+ <script type="text/javascript">
1002
+
1003
+ Event.observe(window, 'load', function() {
1004
+ if ($$('div.shopping-cart-totals').length == 1) {
1005
+ }
1006
+ else {
1007
+
1008
+ already_placing_order = false;
1009
+ review = false;
1010
+ reviewmodal = false;
1011
+
1012
+ /* Handle place order click event */
1013
+ $$('.onestepcheckout-place-order').each(function(elem){
1014
+ elem.observe('click', function(e) {
1015
+ Event.stop(e);
1016
+
1017
+ // First validate the form
1018
+ var form = new VarienForm('onestepcheckout-form');
1019
+
1020
+ if(!form.validator.validate()) {
1021
+ Event.stop(e);
1022
+ } else {
1023
+
1024
+ if(!already_placing_order && $$('.loading-ajax').length <= 0 ) {
1025
+ <?php if(!empty($helper->settings['addressreview']['enable_addressreview'])):?>
1026
+ var addressTemplates = {
1027
+ shipping: '<?php echo str_replace("\r", '', str_replace("\n", '', $helper->settings['addressreview']['shipping_template']));?>',
1028
+ billing: '<?php echo str_replace("\r", '', str_replace("\n", '', $helper->settings['addressreview']['billing_template']));?>'
1029
+ };
1030
+ addressPreview(addressTemplates, 'addressreview');
1031
+ if(!review){
1032
+ review = true;
1033
+ if(!reviewmodal){
1034
+ reviewmodal = new Control.Modal($('addressreview'),{
1035
+ overlayOpacity: 0.75,
1036
+ className: 'oscmodal',
1037
+ fade: true,
1038
+ closeOnClick: false
1039
+ });
1040
+ }
1041
+ reviewmodal.open();
1042
+ reviewmodal.observe('beforeClose',function(){
1043
+ review = false;
1044
+ });
1045
+ return true;
1046
+ Event.stop(e);
1047
+ } else {
1048
+ reviewmodal.close();
1049
+ }
1050
+ <?php endif;?>
1051
+ already_placing_order = true;
1052
+
1053
+ var submitelement = $('onestepcheckout-place-order');
1054
+ /* Disable button to avoid multiple clicks */
1055
+ submitelement.removeClassName('orange').addClassName('grey');
1056
+ submitelement.disabled = true;
1057
+
1058
+ var loaderelement = new Element('span').
1059
+ addClassName('onestepcheckout-place-order-loading').
1060
+ update('<?php echo $this->__('Please wait, processing your order...'); ?>');
1061
+
1062
+ submitelement.parentNode.appendChild(loaderelement);
1063
+
1064
+ /* Submit the form */
1065
+ $('onestepcheckout-form').submit();
1066
+ }
1067
+ }
1068
+ });
1069
+ });
1070
+
1071
+
1072
+ // This is a separate page
1073
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/set_methods_separate', array('_secure'=>true)); ?>';
1074
+ var update_payments = <?php echo $this->settings['enable_update_payment_on_shipping'] ? 'true' : 'false'; ?>;
1075
+
1076
+ $$('dl.shipment-methods input').invoke('observe', 'click', get_separate_save_methods_function(url, update_payments));
1077
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
1078
+ $$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
1079
+ $$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
1080
+
1081
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
1082
+ $$('div.onestepcheckout-payment-method-error').each(function(item) {
1083
+ new Effect.Fade(item);
1084
+ });
1085
+ });
1086
+
1087
+ $$('dl.shipment-methods input').invoke('observe', 'click', function() {
1088
+ $$('div.onestepcheckout-shipment-method-error').each(function(item) {
1089
+ new Effect.Fade(item);
1090
+ });
1091
+ });
1092
+
1093
+ var has_hidden_terms = false;
1094
+
1095
+ if($('id_accept_terms') != null) {
1096
+
1097
+ $('id_accept_terms').observe('click', function(e) {
1098
+ var element = e.element();
1099
+
1100
+ if(element.checked) {
1101
+ $$('div.onestepcheckout-terms-error').each(function(item) {
1102
+ new Effect.Fade(item);
1103
+ has_hidden_terms = true;
1104
+ });
1105
+ }
1106
+ else {
1107
+ if(has_hidden_terms) {
1108
+ $$('div.onestepcheckout-terms-error').each(function(item) {
1109
+ new Effect.Appear(item);
1110
+ has_hidden_terms = false;
1111
+ });
1112
+ }
1113
+ }
1114
+ });
1115
+ }
1116
+ }
1117
+
1118
+ var form = $('onestepcheckout-form');
1119
+
1120
+ /* Highlight selected payment method if one set */
1121
+ if($RF(form, 'payment[method]') != null) {
1122
+ try {
1123
+ var payment_method = $RF(form, 'payment[method]');
1124
+ $('container_payment_method_' + payment_method).show();
1125
+ $('payment_form_' + payment_method).show();
1126
+ } catch(err) {
1127
+
1128
+ }
1129
+ }
1130
+
1131
+ /* Set default shipping method if not set */
1132
+ if($RF(form, 'shipping_method') == null) {
1133
+ try {
1134
+ var method = '<?php echo $this->_getDefaultShippingMethod(); ?>';
1135
+ if(method != '') {
1136
+ $('s_method_' + method).checked = true;
1137
+ get_separate_save_methods_function(url);
1138
+ }
1139
+ } catch(err) {
1140
+
1141
+ }
1142
+ }
1143
+ //submit what's available on load
1144
+ get_separate_save_methods_function(url)();
1145
+
1146
+ <?php if($this->differentShippingAvailable()): ?>
1147
+ $('billing:use_for_shipping_yes').observe('click', function(e) {
1148
+ var element = e.element();
1149
+ if(element.checked){
1150
+ $('shipping_address').hide();
1151
+ } else {
1152
+ if($('shipping-address-select') && $('shipping-address-select').value == ''){
1153
+ $('shipping_address_list').show()
1154
+ }
1155
+ $('shipping_address').show();
1156
+ <?php if(!$this->isCustomerLoggedIn()):?>
1157
+ $('shipping_address_list').show()
1158
+ <?php endif;?>
1159
+ <?php if($this->isCustomerLoggedIn()):?>
1160
+ if(!$('shipping-address-select') && $('shipping_address_list').getStyle('display')=='none'){
1161
+ $('shipping_address_list').show()
1162
+ }
1163
+ <?php endif;?>
1164
+ }
1165
+
1166
+ <?php if($this->settings['enable_ajax_save_billing']): ?>
1167
+ get_save_billing_function('<?php echo $this->getUrl('onestepcheckout/ajax/save_billing', array('_secure'=>true)); ?>', '<?php echo $this->getUrl('onestepcheckout/ajax/set_methods_separate', array('_secure'=>true)); ?>', <?php echo $this->settings['enable_update_payment_on_shipping'] ? 'true' : 'false'; ?>, true)();
1168
+ <?php endif; ?>
1169
+
1170
+ });
1171
+ <?php endif; ?>
1172
+ <?php
1173
+ $triggers = Mage::getStoreConfig('onestepcheckout/ajax_update/ajax_save_billing_fields');
1174
+ if(!empty($triggers)){
1175
+ $triggers = str_replace('country', 'country_id', $triggers);
1176
+ $triggers = str_replace('state/region', 'region_id', $triggers);
1177
+ $triggers = explode(',',$triggers);
1178
+ if(in_array('region_id',$triggers)){
1179
+ $triggers[] = 'region';
1180
+ }
1181
+ }
1182
+ ?>
1183
+
1184
+ <?php if(Mage::getStoreConfig('onestepcheckout/ajax_update/enable_ajax_save_billing') && !empty($triggers)):?>
1185
+
1186
+ var url_save_billing = '<?php echo $this->getUrl('onestepcheckout/ajax/save_billing', array('_secure'=>true)); ?>';
1187
+ var url_set_methods = '<?php echo $this->getUrl('onestepcheckout/ajax/set_methods_separate', array('_secure'=>true)); ?>';
1188
+ var update_payments = <?php echo $this->settings['enable_update_payment_on_shipping'] ? 'true' : 'false'; ?>;
1189
+ var update_on_initial = false;
1190
+
1191
+ var euvat = $('euvat_action_validate_taxvat');
1192
+
1193
+ if(euvat !== null){
1194
+ euvat.observe('change', get_save_billing_function(url_save_billing, url_set_methods, update_payments, true));
1195
+ }
1196
+
1197
+ var euvatid = $('billing:vat_id');
1198
+
1199
+ if(euvatid !== null){
1200
+ euvatid.observe('change', get_save_billing_function(url_save_billing, url_set_methods, update_payments, true));
1201
+ }
1202
+
1203
+ triggers = ['<?php echo implode ('\',\'',$triggers)?>'];
1204
+ btriggered = [];
1205
+ striggered = [];
1206
+
1207
+ <?php
1208
+ foreach($triggers as $value){
1209
+ echo (($this->getQuote()->getBillingAddress()->getData($value)) ? 'btriggered.push(\'billing:'.$value.'\');' : '');
1210
+ echo (($this->getQuote()->getShippingAddress()->getData($value)) ? 'striggered.push(\'shipping:'.$value.'\');' : '');
1211
+ }
1212
+ ?>
1213
+
1214
+
1215
+ bcountry_id = $('billing:country_id');
1216
+ if(bcountry_id){
1217
+ if(bcountry_id.getValue()){
1218
+ if(!btriggered.include('billing:country_id')){
1219
+ btriggered.push('billing:country_id');
1220
+ }
1221
+ }
1222
+ }
1223
+ scountry_id = $('shipping:country_id');
1224
+ if(scountry_id){
1225
+ if(scountry_id.getValue()){
1226
+ if(!striggered.include('shipping:country_id')){
1227
+ striggered.push('shipping:country_id');
1228
+ }
1229
+ }
1230
+ }
1231
+
1232
+ batriggered = false;
1233
+ satriggered = false;
1234
+
1235
+ changeTimer = false;
1236
+ changeInterval = 1000;
1237
+
1238
+ triggers.each(function(item){
1239
+ var belement = $('billing:'+item);
1240
+ if(belement){
1241
+ belement.observe('change', function(e){
1242
+ var element = e.element();
1243
+ var id = element.id;
1244
+ var tagname = element.tagName;
1245
+ if(tagname === 'SELECT'){
1246
+ clearTimeout(changeTimer);
1247
+ changeTimer = setTimeout(bcallbackEvent, changeInterval, id);
1248
+ } else {
1249
+ bcallbackEvent(id);
1250
+ }
1251
+ });
1252
+ }
1253
+
1254
+ var selement = $('shipping:'+item);
1255
+ if(selement){
1256
+ selement.observe('change', function(e){
1257
+ var element = e.element();
1258
+ var id = element.id;
1259
+ var tagname = element.tagName;
1260
+ if(tagname === 'SELECT'){
1261
+ clearTimeout(changeTimer);
1262
+ changeTimer = setTimeout(scallbackEvent, changeInterval, id);
1263
+ } else {
1264
+ scallbackEvent(id);
1265
+ }
1266
+ });
1267
+ }
1268
+ });
1269
+
1270
+ function scallbackEvent (id){
1271
+ if(!striggered.include(id)){
1272
+ striggered.push(id);
1273
+ }
1274
+ if(striggered.length >= triggers.length-1){
1275
+ satriggered = true;
1276
+ }
1277
+ get_save_billing_function(url_save_billing, url_set_methods, update_payments, satriggered)();
1278
+ }
1279
+
1280
+
1281
+ function bcallbackEvent (id){
1282
+ if(!btriggered.include(id)){
1283
+ btriggered.push(id);
1284
+ }
1285
+ if(btriggered.length >= triggers.length-1){
1286
+ batriggered = true;
1287
+ }
1288
+ get_save_billing_function(url_save_billing, url_set_methods, update_payments, batriggered)();
1289
+ }
1290
+
1291
+
1292
+ <?php if($this->isCustomerLoggedIn()):?>
1293
+ var bselect = $('billing-address-select');
1294
+ var sselect = $('shipping-address-select');
1295
+ if(bselect){
1296
+ bselect.observe('change', get_save_billing_function(url_save_billing, url_set_methods, update_payments, true));
1297
+ }
1298
+ if(sselect){
1299
+ sselect.observe('change', get_save_billing_function(url_save_billing, url_set_methods, update_payments, true));
1300
+ }
1301
+ <?php endif;?>
1302
+
1303
+ <?php endif; ?>
1304
+
1305
+ });
1306
+
1307
+ if($('payment-tool-tip-close')){
1308
+ Event.observe($('payment-tool-tip-close'), 'click', toggleToolTip);
1309
+ }
1310
+
1311
+ </script>
1312
+
1313
+
1314
+ <?php endif; ?>
1315
+
1316
+ <div id="onestepcheckout_popup_overlay" style="display: none;">&nbsp;</div>
1317
+
1318
+
1319
+ <div id="loading-process" style="display: none;"></div>
app/design/frontend/enterprise/adyen/template/onestepcheckout/payment_method.phtml ADDED
@@ -0,0 +1,217 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design_default
22
+ * @package Mage
23
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * One page checkout payment methods
30
+ *
31
+ * @see Mage_Checkout_Block_Onepage_Payment_Methods
32
+ */
33
+ ?>
34
+
35
+
36
+ <?php
37
+ $methods = $this->getMethods();
38
+ $oneMethod = count($methods) <= 1;
39
+
40
+
41
+ $helper = Mage::helper('onestepcheckout/checkout');
42
+ $hide_nonfree_methods = false;
43
+ if($helper->settings['hide_nonfree_payment_methods']) {
44
+ foreach($this->getMethods() as $_method) {
45
+ if($_method->getCode() == 'free') {
46
+ $hide_nonfree_methods = true;
47
+ }
48
+ }
49
+ }
50
+
51
+
52
+ ?>
53
+
54
+ <div class="payment-methods">
55
+ <script type="text/javascript">
56
+ //<![CDATA[
57
+ <?php echo $this->getChildHtml('reward.scripts'); ?>
58
+ <?php echo $this->getChildHtml('customerbalance_scripts'); ?>
59
+ var payment = new Payment('checkout-payment-method-load', '<?php echo $this->getUrl('checkout/onepage/savePayment') ?>');
60
+ payment.currentMethod = "<?php echo $this->getQuote()->getPayment()->getMethod() ?>";
61
+ //]]>
62
+ </script>
63
+ <?php if(Mage::helper('onestepcheckout')->isEnterprise()):?>
64
+ <?php echo $this->getChildHtml('customerbalance'); ?>
65
+ <?php echo $this->getChildHtml('reward.points'); ?>
66
+ <?php endif;?>
67
+
68
+ <?php if (count($this->getMethods())=='1' && Mage::getStoreConfig('onestepcheckout/general/hide_payment_method')):?>
69
+ <dl id="checkout-payment-method-load" style="display: none">
70
+ <?php foreach ($this->getMethods() as $_method): $_code = $_method->getCode() ?>
71
+
72
+ <dt>
73
+ <input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="hidden" name="payment[method]" title="<?php echo $this->escapeHtml($_method->getTitle()) ?>" class="radio" <?php if($this->getSelectedMethodCode()==$_code || ($hide_nonfree_methods && $_code == 'free')): ?> checked="checked"<?php endif; ?> />
74
+ <label for="p_method_<?php echo $_code ?>"><?php echo $_method->getTitle() ?></label></dt>
75
+ <?php endforeach; ?>
76
+ </dl>
77
+ <?php else:?>
78
+
79
+ <dl id="checkout-payment-method-load">
80
+ <?php foreach ($this->getMethods() as $_method): $_code = $_method->getCode() ?>
81
+ <?php if($hide_nonfree_methods && $_code != 'free') continue;
82
+
83
+ $_style = "";
84
+ if($_code == "adyen_hpp") {
85
+ // get method and check if config payment/adyen_hpp/disable_hpptypes is set
86
+ $disabled = $_method->getHppOptionsDisabled();
87
+ if(!$disabled) {
88
+ $_style = ($_code == "adyen_hpp" && !$oneMethod) ? "display:none" : "";
89
+ }
90
+ } else if ($_code == "adyen_oneclick" && !$oneMethod) {
91
+ $_style = "display:none";
92
+ }
93
+ ?>
94
+
95
+ <dt style="<?php echo $_style; ?>">
96
+ <?php if( sizeof($this->getMethods()) > 1 ): ?>
97
+ <input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" title="<?php echo $this->escapeHtml($_method->getTitle()) ?>" class="radio validate-one-required-by-name" <?php if($this->getSelectedMethodCode()==$_code || ($hide_nonfree_methods && $_code == 'free')): ?> checked="checked"<?php endif; ?> />
98
+ <?php else: ?>
99
+ <span class="no-display"><input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" checked="checked" /></span>
100
+ <?php endif; ?>
101
+ <label for="p_method_<?php echo $_code ?>"><?php echo $_method->getTitle() ?></label>
102
+ </dt>
103
+ <?php if($html = $this->getChildHtml('payment.method.'.$_code)): ?>
104
+ <?php $class = ($_code == "adyen_hpp" || $_code == "adyen_oneclick") ? "" : "payment-method"; ?>
105
+ <dd id="container_payment_method_<?php echo $_code; ?>" class="<?php echo $class; ?>">
106
+ <?php echo $html; ?>
107
+ </dd>
108
+ <?php endif; ?>
109
+ <script type="text/javascript">
110
+ //<![CDATA[
111
+
112
+ var SwitchMethod= function() {
113
+ var method = $('p_method_<?php echo $_code?>').value;
114
+
115
+ if(method != "adyen_hpp") {
116
+ // check if hpp is enabled if so clear the selected option because you select different payment method
117
+ if($('hpp_payment_form_adyen_hpp'))
118
+ {
119
+ var form = $('hpp_payment_form_adyen_hpp');
120
+ var elements = form.getElementsByTagName('input');
121
+ for (var i=0; i<elements.length; i++) elements[i].checked = false;
122
+ }
123
+ }
124
+
125
+ // check if oneclick is enabled if so clear the selected option because you select different payment method
126
+ if(method != "adyen_oneclick") {
127
+ // always enable the oneclick payments options if this payment method is on
128
+ if($('oneclick_payment_form_adyen_oneclick'))
129
+ {
130
+ var form = $('oneclick_payment_form_adyen_oneclick');
131
+ var elements = form.getElementsByTagName('input');
132
+ for (var i=0; i<elements.length; i++) elements[i].checked = false;
133
+ }
134
+ }
135
+
136
+ payment.switchMethod(method);
137
+ };
138
+ Event.observe($('p_method_<?php echo $_code ?>'), 'change', SwitchMethod);
139
+
140
+ //]]>
141
+ </script>
142
+ <?php endforeach; ?>
143
+ </dl>
144
+ <?php endif;?>
145
+ </div>
146
+ <script type="text/javascript">
147
+ //<![CDATA[
148
+
149
+ $$('.cvv-what-is-this').each(function(element){
150
+ Event.observe(element, 'click', toggleToolTip);
151
+ });
152
+
153
+ function toggleToolTip(event){
154
+ if($('payment-tool-tip')){
155
+ $('payment-tool-tip').setStyle({
156
+ left: (Event.pointerX(event)-100)+'px',
157
+ top: (Event.pointerY(event)-300)+'px'
158
+ });
159
+ $('payment-tool-tip').toggle();
160
+ }
161
+ Event.stop(event);
162
+ }
163
+
164
+ var checkout = new Checkout();
165
+ $$('#checkout-payment-method-load dt input').invoke('observe', 'click', function(e) {
166
+
167
+ var element = e.element();
168
+ var name = 'payment_form_' + element.getValue();
169
+ payment.currentMethod = element.getValue();
170
+ /* Hide all other forms */
171
+ $$('dd.payment-method').invoke('hide');
172
+
173
+ if(element.checked) {
174
+ payment.switchMethod(payment.currentMethod);
175
+ var form = $(name);
176
+ var container = $('container_payment_method_' + element.getValue());
177
+
178
+ if(element !== null && container !== null) {
179
+ container.show();
180
+ $(name).show();
181
+ }
182
+ }
183
+ });
184
+
185
+ // ADYEN: set current method as well if you click on hpp and oneclick
186
+ $$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', function(e) {
187
+ payment.currentMethod = "adyen_hpp";
188
+ });
189
+
190
+ $$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', function(e) {
191
+ payment.currentMethod = "adyen_oneclick";
192
+ });
193
+
194
+ <?php if(Mage::helper('onestepcheckout')->isEnterprise() && Mage::helper('customer')->isLoggedIn()):?>
195
+ //if we have a enterprise version we should include this
196
+
197
+ rPoints = $('use_reward_points');
198
+ if(rPoints){
199
+ if(rPoints.checked){
200
+ payment.switchRewardPointsCheckbox();
201
+ }
202
+ }
203
+ cBalance = $('use_customer_balance');
204
+ if(cBalance){
205
+ if(cBalance.checked){
206
+ payment.switchCustomerBalanceCheckbox();
207
+ }
208
+ }
209
+ //if we have a enterprise version we should include this end
210
+ <?php endif;?>
211
+
212
+ payment.switchMethod(payment.currentMethod);
213
+
214
+
215
+ <?php echo $this->getChildHtml('giftcardaccount_scripts');?>
216
+ //]]>
217
+ </script>
app/design/frontend/rwd/adyen/template/checkout/onepage/payment/methods.phtml ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * One page checkout payment methods
30
+ *
31
+ * @var $this Mage_Checkout_Block_Onepage_Payment_Methods
32
+ */
33
+ ?>
34
+
35
+ <?php
36
+ $methods = $this->getMethods();
37
+ $oneMethod = count($methods) <= 1;
38
+ ?>
39
+ <?php if (empty($methods)): ?>
40
+ <dt>
41
+ <?php echo $this->__('No Payment Methods') ?>
42
+ </dt>
43
+ <?php else:
44
+ foreach ($methods as $_method):
45
+ $_code = $_method->getCode();
46
+
47
+ $_style = "";
48
+ if($_code == "adyen_hpp") {
49
+
50
+ // get method and check if config payment/adyen_hpp/disable_hpptypes is set
51
+ $disabled = $_method->getHppOptionsDisabled();
52
+ if(!$disabled) {
53
+ $_style = ($_code == "adyen_hpp" && !$oneMethod) ? "display:none" : "";
54
+ }
55
+ } else if ($_code == "adyen_oneclick" && !$oneMethod) {
56
+ $_style = "display:none";
57
+ }
58
+
59
+ ?>
60
+ <dt style="<?php echo $_style; ?>">
61
+ <?php if(!$oneMethod): ?>
62
+ <input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" title="<?php echo $this->escapeHtml($_method->getTitle()) ?>" <?php if($this->getSelectedMethodCode()==$_code): ?> checked="checked"<?php endif; ?> class="radio" />
63
+ <?php else: ?>
64
+ <span class="no-display"><input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" checked="checked" class="radio" /></span>
65
+ <?php $oneMethod = $_code; ?>
66
+ <?php endif; ?>
67
+
68
+ <?php if(($_code == "adyen_hpp" && $disabled) || ($_code != "adyen_hpp")): ?>
69
+ <label for="p_method_<?php echo $_code ?>"><?php echo $this->escapeHtml($this->getMethodTitle($_method)) ?> <?php echo $this->getMethodLabelAfterHtml($_method) ?></label>
70
+ <?php endif; ?>
71
+ </dt>
72
+
73
+ <?php if ($html = $this->getPaymentMethodFormHtml($_method)): ?>
74
+ <dd>
75
+ <?php echo $html; ?>
76
+ </dd>
77
+ <?php endif; ?>
78
+ <script type="text/javascript">
79
+ //<![CDATA[
80
+
81
+ var SwitchMethod= function() {
82
+ var method = $('p_method_<?php echo $_code?>').value;
83
+
84
+ if(method != "adyen_hpp") {
85
+ // check if hpp is enabled if so clear the selected option because you select different payment method
86
+ if($('hpp_payment_form_adyen_hpp'))
87
+ {
88
+ var form = $('hpp_payment_form_adyen_hpp');
89
+ var elements = form.getElementsByTagName('input');
90
+ for (var i=0; i<elements.length; i++) elements[i].checked = false;
91
+ }
92
+ }
93
+
94
+ // check if adyen_oneclick is enabled
95
+ if(method != "adyen_oneclick") {
96
+ if($('oneclick_payment_form_adyen_oneclick'))
97
+ {
98
+ // if so clear the selected option because you select different payment method
99
+ var form = $('oneclick_payment_form_adyen_oneclick');
100
+ var elements = form.getElementsByTagName('input');
101
+ for (var i=0; i<elements.length; i++) elements[i].checked = false;
102
+
103
+ // don't show the cvc field
104
+ $$('.cvc_block').each(
105
+ function (e) {
106
+ e.setStyle({display:'none'});
107
+ }
108
+ );
109
+ }
110
+ }
111
+ payment.switchMethod(method);
112
+ };
113
+ Event.observe($('p_method_<?php echo $_code ?>'), 'change', SwitchMethod);
114
+
115
+ //]]>
116
+ </script>
117
+ <?php endforeach;
118
+ endif;
119
+ ?>
120
+ <?php echo $this->getChildChildHtml('additional'); ?>
121
+ <script type="text/javascript">
122
+ //<![CDATA[
123
+ <?php echo $this->getChildChildHtml('scripts'); ?>
124
+ payment.init();
125
+ <?php if (is_string($oneMethod)): ?>
126
+ payment.switchMethod('<?php echo $oneMethod ?>');
127
+ <?php endif; ?>
128
+
129
+ // always enable the hpp payment options if this payment method is on
130
+ if($('hpp_payment_form_adyen_hpp'))
131
+ {
132
+ var form = $('hpp_payment_form_adyen_hpp');
133
+ var elements = form.getElementsByTagName('input');
134
+ for (var i=0; i<elements.length; i++) elements[i].disabled = false;
135
+ }
136
+
137
+ // always enable the oneclick payments options if this payment method is on
138
+ if($('oneclick_payment_form_adyen_oneclick'))
139
+ {
140
+ var form = $('oneclick_payment_form_adyen_oneclick');
141
+ var elements = form.getElementsByTagName('input');
142
+ for (var i=0; i<elements.length; i++) elements[i].disabled = false;
143
+
144
+ // always enable the selectboxes for the oneclick creditcards
145
+ var elements = form.getElementsByTagName('select');
146
+ for (var i=0; i<elements.length; i++) elements[i].disabled = false;
147
+ }
148
+ //]]>
149
+ </script>
app/design/frontend/rwd/adyen/template/onestepcheckout/checkout.phtml ADDED
@@ -0,0 +1,1319 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $step_counter = 1;
4
+ $helper = Mage::helper('onestepcheckout/checkout');
5
+
6
+ ?>
7
+ <?php if(!$this->canCheckout() || !$this->validateMinimumAmount()): ?>
8
+ <?php if($this->settings['checkout_title']): ?>
9
+ <h1 class="onestepcheckout-title"><?php echo $this->settings['checkout_title']; ?></h1>
10
+ <?php endif; ?>
11
+
12
+ <?php if($this->canCheckout() && !$this->validateMinimumAmount()): ?>
13
+ <p><?php echo Mage::getStoreConfig('sales/minimum_order/description'); ?></p>
14
+ <p><a href="<?php echo $this->getUrl(''); ?>"><?php echo $this->__('Back to homepage'); ?></a></p>
15
+ <?php else: ?>
16
+ <p><?php echo $this->__('You need to have products in your cart to checkout, and your cart is empty.'); ?></p>
17
+ <p><a href="<?php echo $this->getUrl(''); ?>"><?php echo $this->__('Back to homepage'); ?></a></p>
18
+ <?php endif; ?>
19
+ <?php else: ?>
20
+
21
+ <form id="onestepcheckout-form" method="post" action="<?php echo $this->getUrl('onestepcheckout', array('_secure'=>true)); ?>">
22
+ <fieldset class="group-select" style="margin: 0;">
23
+
24
+ <?php if($this->settings['checkout_title']): ?>
25
+ <h1 class="onestepcheckout-title"><?php echo $this->settings['checkout_title']; ?></h1>
26
+ <?php endif; ?>
27
+
28
+ <?php if($this->settings['checkout_description']): ?>
29
+ <p class="onestepcheckout-description"><?php echo $this->settings['checkout_description']; ?></p>
30
+ <?php endif; ?>
31
+
32
+ <?php if(!$this->isCustomerLoggedIn() && $helper->showLoginLink()): ?>
33
+ <p class="onestepcheckout-login-link">
34
+ <a id="onestepcheckout-login-link" href="javascript:void(0); return: false;"><?php echo $this->__('Already registered? Click here to login.'); ?></a>
35
+ </p>
36
+ <?php endif; ?>
37
+
38
+ <?php if(isset($this->formErrors['unknown_source_error'])): ?>
39
+ <div class="onestepcheckout-error">
40
+ <?php echo $this->formErrors['unknown_source_error']; ?>
41
+ </div>
42
+ <?php endif; ?>
43
+ <div class="onestepcheckout-threecolumns checkoutcontainer onestepcheckout-skin-<?php echo $this->settings['skin']; ?> <?php if(Mage::helper('onestepcheckout')->isEnterprise()): ?>onestepcheckout-enterprise<?php endif; ?>">
44
+ <div class="onestepcheckout-column-left">
45
+ <div id="billing_address">
46
+ <script type="text/javascript">
47
+ var billing = new Billing();
48
+
49
+ </script>
50
+ <ul>
51
+ <li>
52
+ <p class="onestepcheckout-numbers onestepcheckout-numbers-<?php echo $step_counter++; ?>"><?php echo $this->__('Billing address'); ?></p>
53
+ <?php if(isset($this->formErrors['billing_error']) && count($this->formErrors['billing_errors']) > 0): ?>
54
+ <div class="onestepcheckout-error">
55
+ <?php echo $this->__('Please check red fields below and try again.'); ?>
56
+ </div>
57
+ <?php endif; ?>
58
+ </li>
59
+ <?php if ($this->customerHasAddresses()): ?>
60
+ <li>
61
+ <label for="billing-address-select"><?php echo $this->__('Select a billing address from your address book or enter a new address.') ?></label>
62
+ <div class="input-box">
63
+ <?php echo $this->getAddressesHtmlSelect('billing') ?>
64
+ </div>
65
+ </li>
66
+ <?php endif; ?>
67
+ <li>
68
+ <div>
69
+ <ul id="billing_address_list" <?php echo (($this->customerHasAddresses() && !$this->getNewAddressSelectValueOnError('billing')) ? 'style = "display:none"' : false ); ?>>
70
+ <?php echo $this->getChildHtml('billing_address');?>
71
+ <?php $addressAttributes = $this->getChild('customer_form_billing_address_user_defined_attributes');?>
72
+ <?php if ($addressAttributes): ?>
73
+ <?php $addressAttributes->setEntity($this->getQuote()->getBillingAddress())->setEntityType('customer_address');?>
74
+ <?php $addressAttributes->setFieldIdFormat('billing:%1$s')->setFieldNameFormat('billing[%1$s]');?>
75
+ <?php echo $addressAttributes->setExcludeFileAttributes(true)->setShowContainer(false)->toHtml()?>
76
+ <?php endif;?>
77
+ <?php $customerAttributes = $this->getChild('customer_form_customer_user_defined_attributes');?>
78
+ <?php if ($customerAttributes): ?>
79
+ <?php $customerAttributes->setEntityModelClass('customer/customer')->setFieldIdFormat('billing:%1$s');?>
80
+ <?php $customerAttributes->setFieldNameFormat('billing[%1$s]')->setShowContainer(false);?>
81
+ <?php echo $customerAttributes->setExcludeFileAttributes(true)->toHtml()?>
82
+ <?php endif;?>
83
+ </ul>
84
+ </div>
85
+ </li>
86
+ <li>
87
+ <?php $uncheck = (!empty($_POST['billing']) && empty($_POST['billing']['use_for_shipping']));?>
88
+ <?php if($this->differentShippingAvailable()): ?>
89
+ <div class="input-box input-different-shipping">
90
+ <input type="checkbox" name="billing[use_for_shipping]" id="billing:use_for_shipping_yes" value="1" <?php echo (($this->sameAsBilling() && !$uncheck) ? 'checked="checked" ':'')?>/>
91
+ <label for="billing:use_for_shipping_yes"><?php echo $this->__('Ship to the same address')?></label>
92
+ </div>
93
+ <?php else: ?>
94
+ <input type="hidden" name="billing[use_for_shipping]" id="billing:use_for_shipping_yes" value="1" />
95
+ <?php endif; ?>
96
+ </li>
97
+ </ul>
98
+ </div>
99
+ <?php if($this->differentShippingAvailable()): ?>
100
+ <div id="shipping_address" <?php echo (($this->sameAsBilling() && !$uncheck) ? 'style="display: none"': false);?>>
101
+ <script type="text/javascript">
102
+ var shipping = new Shipping();
103
+ </script>
104
+ <ul>
105
+ <li class="shipping-address-title">
106
+ <?php echo $this->__('Shipping address'); ?>
107
+ </li>
108
+ <?php if ($this->customerHasAddresses()): ?>
109
+ <li class="form-alt">
110
+ <label for="shipping-address-select"><?php echo $this->__('Select a shipping address from your address book or enter a new address.') ?></label>
111
+ <div class="input-box"><?php echo $this->getAddressesHtmlSelect('shipping') ?></div>
112
+ </li>
113
+ <?php endif ?>
114
+ <li id="shipping_address_list" <?php if($this->customerHasAddresses() && !$this->getNewAddressSelectValueOnError('shipping')) { echo ' style="display: none;" '; } ?>>
115
+ <div id="">
116
+ <ul>
117
+ <?php echo $this->getChildHtml('shipping_address');?>
118
+ <?php $addressAttributes = $this->getChild('customer_form_shipping_address_user_defined_attributes');?>
119
+ <?php if ($addressAttributes): ?>
120
+ <?php $addressAttributes->setEntity($this->getQuote()->getShippingAddress())->setEntityType('customer_address');?>
121
+ <?php $addressAttributes->setFieldIdFormat('shipping:%1$s')->setFieldNameFormat('shipping[%1$s]');?>
122
+ <?php echo $addressAttributes->setExcludeFileAttributes(true)->setShowContainer(false)->toHtml()?>
123
+ <?php endif;?>
124
+ </ul>
125
+ <input type="hidden" name="shipping[address_id]" value="<?php echo $this->getQuote()->getShippingAddress()->getId() ?>" id="shipping:address_id" />
126
+ <!-- END LIST OF SHIPPIING FIELDS -->
127
+ </div>
128
+ </li>
129
+ </ul>
130
+ </div>
131
+ <?php endif; ?>
132
+ </div>
133
+
134
+ <div class="onestepcheckout-column-middle">
135
+
136
+
137
+ <?php if(!$this->isVirtual()): ?>
138
+ <?php if(Mage::getStoreConfig('onestepcheckout/general/hide_shipping_method')):?>
139
+ <?php if(isset($this->formErrors['shipping_method']) && $this->formErrors['shipping_method']): ?>
140
+ <div class="onestepcheckout-error onestepcheckout-shipment-method-error">
141
+ <?php echo $this->__('Please choose a shipping method.'); ?>
142
+ </div>
143
+ <?php endif; ?>
144
+ <?php echo $this->getChildHtml('choose-shipping-method'); ?>
145
+ <?php else:?>
146
+ <div class="onestepcheckout-shipping-method">
147
+ <p class="onestepcheckout-numbers onestepcheckout-numbers-<?php echo $step_counter++; ?>"><?php echo $this->__('Shipping method'); ?></p>
148
+
149
+ <?php if(isset($this->formErrors['shipping_method']) && $this->formErrors['shipping_method']): ?>
150
+ <div class="onestepcheckout-error onestepcheckout-shipment-method-error">
151
+ <?php echo $this->__('Please choose a shipping method.'); ?>
152
+ </div>
153
+ <?php endif; ?>
154
+
155
+ <div class="onestepcheckout-shipping-method-block">
156
+ <?php echo $this->getChildHtml('choose-shipping-method'); ?>
157
+ </div>
158
+ </div>
159
+ <?php endif; ?>
160
+ <?php endif; ?>
161
+
162
+ <?php if(Mage::getStoreConfig('onestepcheckout/general/hide_payment_method')):?>
163
+ <?php if(!empty($this->formErrors['payment_method'])): ?>
164
+ <div class="onestepcheckout-error onestepcheckout-payment-method-error">
165
+ <?php echo $this->__('Please choose a payment method.'); ?>
166
+ </div>
167
+ <?php endif; ?>
168
+ <?php if(!empty($this->formErrors['payment_method_error'])): ?>
169
+ <div class="onestepcheckout-error onestepcheckout-payment-method-error">
170
+ <?php echo $this->__('Please enter valid details below.'); ?>
171
+ </div>
172
+ <?php endif; ?>
173
+ <?php echo $this->getChildHtml('choose-payment-method'); ?>
174
+ <?php else: ?>
175
+ <p class="onestepcheckout-numbers onestepcheckout-numbers-<?php echo $step_counter++; ?>"><?php echo $this->__('Payment method'); ?></p>
176
+ <?php if(isset($this->formErrors['payment_method']) && $this->formErrors['payment_method']): ?>
177
+ <div class="onestepcheckout-error onestepcheckout-payment-method-error">
178
+ <?php echo $this->__('Please choose a payment method.'); ?>
179
+ </div>
180
+ <?php else: ?>
181
+ <?php if(isset($this->formErrors['payment_method_error'])): ?>
182
+ <div class="onestepcheckout-error onestepcheckout-payment-method-error">
183
+ <?php echo $this->__('Please enter valid details below.'); ?>
184
+ </div>
185
+ <?php endif; ?>
186
+ <?php endif; ?>
187
+
188
+ <?php echo $this->getChildHtml('choose-payment-method'); ?>
189
+
190
+ <div class="tool-tip" id="payment-tool-tip" style="display:none;">
191
+ <div class="btn-close">
192
+ <a href="javascript:void(0);" id="payment-tool-tip-close"><img src="<?php echo $this->getSkinUrl('images/btn_window_close.gif') ?>" alt="<?php echo $this->__('Close') ?>" /></a>
193
+ </div>
194
+ <div class="block-content">
195
+ <img src="<?php echo $this->getSkinUrl('images/cvv.gif') ?>" alt="<?php echo $this->__('Card Verification Number Visual Reference') ?>" />
196
+ </div>
197
+ </div>
198
+ <?php endif; ?>
199
+ </div>
200
+
201
+ <div class="onestepcheckout-column-right">
202
+
203
+ <p class="onestepcheckout-numbers onestepcheckout-numbers-4"><?php echo $this->__('Review your order'); ?></p>
204
+
205
+ <div class="onestepcheckout-summary">
206
+ <?php echo $this->getChildHtml('summary'); ?>
207
+ </div>
208
+
209
+ <?php if($this->settings['enable_discount']): ?>
210
+ <div class="onestepcheckout-coupons">
211
+ <div id="coupon-notice" style="display: none;"></div>
212
+ <?php $_couponcode = $this->getQuote()->getCouponCode(); ?>
213
+ <label for="id_couponcode"><?php echo $this->__('Coupon code:'); ?></label><br/>
214
+ <input class="input-text" type="text" name="onestepcheckout-couponcode" id="id_couponcode" value="<?php echo Mage::helper('core')->escapeHtml($_couponcode); ?>" />
215
+ <br/>
216
+ <button id="onestepcheckout-coupon-add" class="form-button-alt button" type="button"><span><span><?php echo $this->__('Apply Coupon'); ?></span></span></button>
217
+ <button id="onestepcheckout-coupon-remove" class="form-button-alt button" type="button" style="<?php if($_couponcode == '') { echo 'display: none;'; } ?>"><span><span><?php echo $this->__('Cancel Coupon'); ?></span></span></button>
218
+ <script>
219
+ Event.observe(window, 'load', function() {
220
+ $('onestepcheckout-coupon-add').observe('click', function(e) {
221
+
222
+ var coupon = $('id_couponcode').getValue();
223
+ var couponNotice = $('coupon-notice');
224
+
225
+ couponNotice.hide();
226
+
227
+ if(coupon == '') {
228
+ alert('<?php echo $this->__('Please enter a valid coupon code.'); ?>');
229
+ return;
230
+ }
231
+
232
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/add_coupon', array('_secure'=>true)); ?>';
233
+ var parameters = {code: coupon};
234
+ var shipping_methods = $$('dl.shipment-methods').first();
235
+
236
+ var form = $('onestepcheckout-form');
237
+ var payment_hpp_ideal_type = $RF(form, 'payment[hpp_ideal_type]');
238
+ var payment_hpp_type = $RF(form, 'payment[hpp_type]');
239
+ var payment_recurring_type = $RF(form, 'payment[recurring]');
240
+ var payment_recurring_type_cvc = $('adyen_oneclick_oneclick_cid_'+payment_recurring_type);
241
+ var payment_methods = $$('div.payment-methods').first();
242
+
243
+ var summary = $$('div.onestepcheckout-summary').first();
244
+
245
+ if(shipping_methods){
246
+ shipping_methods.update('<div class="loading-ajax">&nbsp;</div>');
247
+ }
248
+
249
+ if(payment_methods){
250
+ payment_methods.update('<div class="loading-ajax">&nbsp;</div>');
251
+ }
252
+
253
+ summary.update('<div class="loading-ajax">&nbsp;</div>');
254
+
255
+ new Ajax.Request(url, {
256
+ method: 'post',
257
+ parameters: parameters,
258
+ onSuccess: function(transport) {
259
+ if(transport.status == 200) {
260
+
261
+ var response = transport.responseText.evalJSON();
262
+
263
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/set_methods_separate', array('_secure'=>true)); ?>';
264
+ var update_payments = <?php echo $this->settings['enable_update_payment_on_shipping'] ? 'true' : 'false'; ?>;
265
+
266
+ if(shipping_methods){
267
+ shipping_methods.hide();
268
+ shipping_methods.update(response.shipping_method);
269
+ shipping_methods.show();
270
+ $$('dl.shipment-methods input').invoke('observe', 'click', get_separate_save_methods_function(url, update_payments));
271
+ $$('dl.shipment-methods input').invoke('observe', 'click', function() {
272
+ $$('div.onestepcheckout-shipment-method-error').each(function(item) {
273
+ new Effect.Fade(item);
274
+ });
275
+ });
276
+ }
277
+
278
+ if(payment_methods){
279
+ payment_methods.hide();
280
+ payment_methods.replace(response.payment_method);
281
+ payment_methods.show();
282
+
283
+ paymentContainer = $('container_payment_method_' + payment.currentMethod)
284
+ paymentForm = $('payment_form_' + payment.currentMethod)
285
+ var payment_method = $RF(form, 'payment[method]');
286
+
287
+ if(paymentContainer != null){
288
+ paymentContainer.show();
289
+ }
290
+ if(paymentForm != null){
291
+ paymentForm.show();
292
+ } else if(payment_method == "adyen_hpp") { // check if payment type is hpp (this has other id so should come in else )
293
+ // set sub payment method back
294
+ $('hpp_type_'+payment_hpp_type).checked = true;
295
+
296
+ // check if ideal payment bank is chosen
297
+ if(payment_hpp_type == "ideal") {
298
+ if(payment_hpp_ideal_type) {
299
+ // get issue_id this is before the slash
300
+ var issue_id = payment_hpp_ideal_type.substr(0, payment_hpp_ideal_type.indexOf('/'));
301
+ $('hpp_ideal_type_'+issue_id).checked = true;
302
+ }
303
+ $('payment_form_ideal').show();
304
+ }
305
+ } else if(payment_method == "adyen_oneclick") { // check if payment type is hpp
306
+ // set sub payment method back
307
+ $('recurring_type_'+payment_recurring_type).checked = true;
308
+ // set back the cvc code
309
+ $('adyen_oneclick_oneclick_cid_'+payment_recurring_type).value = payment_recurring_type_cvc.value;
310
+ // show the cvc code block
311
+ var cvc_block = "cvc_block_" + payment_recurring_type;
312
+ $(cvc_block).show();
313
+ }
314
+
315
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
316
+ $$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
317
+ $$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
318
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
319
+ $$('div.onestepcheckout-payment-method-error').each(function(item) {
320
+ new Effect.Fade(item);
321
+ });
322
+ });
323
+ }
324
+
325
+ summary.hide();
326
+ summary.update(response.summary);
327
+ summary.show();
328
+
329
+ if(response.success) {
330
+
331
+ couponNotice.update(response.message);
332
+ couponNotice.removeClassName('error-msg');
333
+ couponNotice.addClassName('success-msg');
334
+ couponNotice.show();
335
+ /* Show remove button */
336
+ $('onestepcheckout-coupon-remove').show();
337
+ }
338
+ else {
339
+
340
+ couponNotice.update(response.message);
341
+ couponNotice.removeClassName('success-msg');
342
+ couponNotice.addClassName('error-msg');
343
+ couponNotice.show();
344
+ /* Hide remove button */
345
+ $('onestepcheckout-coupon-remove').hide();
346
+ }
347
+ }
348
+ }
349
+ });
350
+ });
351
+
352
+ $('onestepcheckout-coupon-remove').observe('click', function(e) {
353
+
354
+ var coupon = $('id_couponcode').getValue();
355
+ var couponNotice = $('coupon-notice');
356
+
357
+ couponNotice.hide();
358
+
359
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/add_coupon', array('_secure'=>true)); ?>';
360
+ var parameters = {code: coupon, remove: '1'};
361
+ var shipping_methods = $$('dl.shipment-methods').first();
362
+ var payment_methods = $$('div.payment-methods').first();
363
+ var summary = $$('div.onestepcheckout-summary').first();
364
+
365
+ if(shipping_methods){
366
+ shipping_methods.update('<div class="loading-ajax">&nbsp;</div>');
367
+ }
368
+
369
+ if(payment_methods){
370
+ payment_methods.update('<div class="loading-ajax">&nbsp;</div>');
371
+ }
372
+ summary.update('<div class="loading-ajax">&nbsp;</div>');
373
+
374
+ new Ajax.Request(url, {
375
+ method: 'post',
376
+ parameters: parameters,
377
+ onSuccess: function(transport) {
378
+ if(transport.status == 200) {
379
+ var response = transport.responseText.evalJSON();
380
+
381
+ if(response.success){
382
+ $('id_couponcode').setValue('')
383
+ $('onestepcheckout-coupon-remove').hide();
384
+ }
385
+
386
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/set_methods_separate', array('_secure'=>true)); ?>';
387
+ var update_payments = <?php echo $this->settings['enable_update_payment_on_shipping'] ? 'true' : 'false'; ?>;
388
+
389
+ if(shipping_methods){
390
+ shipping_methods.hide();
391
+ shipping_methods.update(response.shipping_method);
392
+ shipping_methods.show();
393
+ $$('dl.shipment-methods input').invoke('observe', 'click', get_separate_save_methods_function(url, update_payments));
394
+ $$('dl.shipment-methods input').invoke('observe', 'click', function() {
395
+ $$('div.onestepcheckout-shipment-method-error').each(function(item) {
396
+ new Effect.Fade(item);
397
+ });
398
+ });
399
+ }
400
+
401
+ if(payment_methods){
402
+ payment_methods.hide();
403
+ payment_methods.replace(response.payment_method);
404
+ payment_methods.show();
405
+
406
+ paymentContainer = $('container_payment_method_' + payment.currentMethod)
407
+ paymentForm = $('payment_form_' + payment.currentMethod)
408
+
409
+ if(paymentContainer != null){
410
+ paymentContainer.show();
411
+ }
412
+
413
+ if(paymentForm != null){
414
+ paymentForm.show();
415
+ }
416
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
417
+ $$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
418
+ $$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
419
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
420
+ $$('div.onestepcheckout-payment-method-error').each(function(item) {
421
+ new Effect.Fade(item);
422
+ });
423
+ });
424
+ }
425
+
426
+ summary.hide();
427
+ summary.update(response.summary);
428
+ summary.show();
429
+
430
+ couponNotice.hide();
431
+ couponNotice.update(response.message);
432
+ couponNotice.removeClassName('error-msg');
433
+ couponNotice.addClassName('success-msg');
434
+ couponNotice.show();
435
+ }
436
+ }
437
+ });
438
+ });
439
+ });
440
+ </script>
441
+ </div>
442
+ <?php endif; ?>
443
+
444
+ <?php if($this->settings['enable_giftcard']): ?>
445
+ <div class="onestepcheckout-giftcards">
446
+ <div id="giftcard-notice" style="display: none;"></div>
447
+ <?php
448
+ $_hasGiftCards = unserialize($this->getQuote()->getGiftCards());
449
+ $_giftcardcode = $this->getQuote()->getgiftcardCode(); ?>
450
+ <label for="id_giftcardcode"><?php echo $this->__('giftcard code:'); ?></label><br/>
451
+ <input class="input-text" type="text" name="onestepcheckout-giftcardcode" id="id_giftcardcode" value="<?php echo Mage::helper('core')->escapeHtml($_giftcardcode); ?>" />
452
+ <br/>
453
+ <button id="onestepcheckout-giftcard-add" class="form-button-alt button" type="button"><span><span><?php echo $this->__('Apply gift card'); ?></span></span></button>
454
+ <button id="onestepcheckout-giftcard-remove" class="form-button-alt button" type="button" style="<?php if(empty($_hasGiftCards)) { echo 'display: none;'; } ?>"><span><span><?php echo $this->__('Cancel gift card'); ?></span></span></button>
455
+ <script>
456
+ document.observe('dom:loaded', function() {
457
+ $('onestepcheckout-giftcard-add').observe('click', function(e) {
458
+ var giftcard = $('id_giftcardcode').getValue();
459
+ var giftcardNotice = $('giftcard-notice');
460
+ giftcardNotice.hide();
461
+ if(giftcard == '') {
462
+ alert('<?php echo $this->__('Please enter a valid giftcard code.'); ?>');
463
+ return;
464
+ }
465
+
466
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/add_giftcard', array('_secure'=>true)); ?>';
467
+ var parameters = {code: giftcard};
468
+ var shipping_methods = $$('dl.shipment-methods').first();
469
+ var payment_methods = $$('div.payment-methods').first();
470
+ var summary = $$('div.onestepcheckout-summary').first();
471
+
472
+ if(shipping_methods){
473
+ shipping_methods.update('<div class="loading-ajax">&nbsp;</div>');
474
+ }
475
+
476
+ if(payment_methods){
477
+ payment_methods.update('<div class="loading-ajax">&nbsp;</div>');
478
+ }
479
+ summary.update('<div class="loading-ajax">&nbsp;</div>');
480
+
481
+ new Ajax.Request(url+Math.random(1000), {
482
+ method: 'post',
483
+ parameters: parameters,
484
+ onSuccess: function(transport) {
485
+ if(transport.status == 200) {
486
+
487
+ var response = transport.responseText.evalJSON();
488
+
489
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/set_methods_separate', array('_secure'=>true)); ?>';
490
+ var update_payments = <?php echo $this->settings['enable_update_payment_on_shipping'] ? 'true' : 'false'; ?>;
491
+
492
+ if(shipping_methods){
493
+ shipping_methods.hide();
494
+ shipping_methods.update(response.shipping_method);
495
+ shipping_methods.show();
496
+ $$('dl.shipment-methods input').invoke('observe', 'click', get_separate_save_methods_function(url, update_payments));
497
+ $$('dl.shipment-methods input').invoke('observe', 'click', function() {
498
+ $$('div.onestepcheckout-shipment-method-error').each(function(item) {
499
+ new Effect.Fade(item);
500
+ });
501
+ });
502
+ }
503
+
504
+ if(payment_methods){
505
+ //payment_methods.hide();
506
+ payment_methods.replace(response.payment_method);
507
+ //payment_methods.show();
508
+
509
+ paymentContainer = $('container_payment_method_' + payment.currentMethod)
510
+ paymentForm = $('payment_form_' + payment.currentMethod)
511
+
512
+ if(paymentContainer != null){
513
+ paymentContainer.show();
514
+ }
515
+ if(paymentForm != null){
516
+ paymentForm.show();
517
+ }
518
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
519
+ $$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
520
+ $$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
521
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
522
+ $$('div.onestepcheckout-payment-method-error').each(function(item) {
523
+ new Effect.Fade(item);
524
+ });
525
+ });
526
+ }
527
+
528
+ if(response.success) {
529
+ summary.update(response.summary);
530
+ giftcardNotice.update(response.message);
531
+ giftcardNotice.removeClassName('error-msg');
532
+ giftcardNotice.addClassName('success-msg');
533
+ giftcardNotice.show();
534
+ /* Show remove button */
535
+ $('onestepcheckout-giftcard-remove').show();
536
+ }
537
+ else {
538
+ summary.update(response.summary);
539
+ giftcardNotice.update(response.message);
540
+ giftcardNotice.removeClassName('success-msg');
541
+ giftcardNotice.addClassName('error-msg');
542
+ giftcardNotice.show();
543
+ /* Hide remove button */
544
+ //$('onestepcheckout-giftcard-remove').hide();
545
+ }
546
+ }
547
+ }
548
+ });
549
+ });
550
+
551
+ $('onestepcheckout-giftcard-remove').observe('click', function(e) {
552
+ var giftcard = $('id_giftcardcode').getValue();
553
+ var giftcardNotice = $('giftcard-notice');
554
+ giftcardNotice.hide();
555
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/add_giftcard', array('_secure'=>true)); ?>';
556
+ var parameters = {code: giftcard, remove: '1'};
557
+ var shipping_methods = $$('dl.shipment-methods').first();
558
+ var payment_methods = $$('div.payment-methods').first();
559
+ var summary = $$('div.onestepcheckout-summary').first();
560
+
561
+ if(shipping_methods){
562
+ shipping_methods.update('<div class="loading-ajax">&nbsp;</div>');
563
+ }
564
+
565
+ if(payment_methods){
566
+ payment_methods.update('<div class="loading-ajax">&nbsp;</div>');
567
+ }
568
+ summary.update('<div class="loading-ajax">&nbsp;</div>');
569
+
570
+ new Ajax.Request(url, {
571
+ method: 'post',
572
+ parameters: parameters,
573
+ onSuccess: function(transport) {
574
+ if(transport.status == 200) {
575
+ var response = transport.responseText.evalJSON();
576
+
577
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/set_methods_separate', array('_secure'=>true)); ?>';
578
+ var update_payments = <?php echo $this->settings['enable_update_payment_on_shipping'] ? 'true' : 'false'; ?>;
579
+
580
+ if(shipping_methods){
581
+ shipping_methods.hide();
582
+ shipping_methods.update(response.shipping_method);
583
+ shipping_methods.show();
584
+ $$('dl.shipment-methods input').invoke('observe', 'click', get_separate_save_methods_function(url, update_payments));
585
+ $$('dl.shipment-methods input').invoke('observe', 'click', function() {
586
+ $$('div.onestepcheckout-shipment-method-error').each(function(item) {
587
+ new Effect.Fade(item);
588
+ });
589
+ });
590
+ }
591
+
592
+ if(payment_methods){
593
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
594
+ $$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
595
+ $$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
596
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
597
+ $$('div.onestepcheckout-payment-method-error').each(function(item) {
598
+ new Effect.Fade(item);
599
+ });
600
+ });
601
+ payment_methods.hide();
602
+ payment_methods.replace(response.payment_method);
603
+ payment_methods.show();
604
+
605
+ paymentContainer = $('container_payment_method_' + payment.currentMethod)
606
+ paymentForm = $('payment_form_' + payment.currentMethod)
607
+
608
+ if(paymentContainer != null){
609
+ paymentContainer.show();
610
+ }
611
+ if(paymentForm != null){
612
+ paymentForm.show();
613
+ }
614
+ }
615
+
616
+ if(response.success){
617
+ $('id_giftcardcode').setValue('')
618
+ $('onestepcheckout-giftcard-remove').hide();
619
+ }
620
+ var summary = $$('div.onestepcheckout-summary').first();
621
+
622
+ summary.hide();
623
+ summary.update(response.summary);
624
+ summary.show();
625
+
626
+ giftcardNotice.hide();
627
+ giftcardNotice.update(response.message);
628
+ giftcardNotice.removeClassName('error-msg');
629
+ giftcardNotice.addClassName('success-msg');
630
+ giftcardNotice.show();
631
+ }
632
+ }
633
+ });
634
+ });
635
+ });
636
+ </script>
637
+ </div>
638
+ <?php endif; ?>
639
+
640
+ <?php if($this->settings['enable_comments']): ?>
641
+ <div class="onestepcheckout-comments">
642
+ <label for="id_comments"><?php echo $this->__('Comments'); ?></label><br/>
643
+ <textarea id="id_comments" name="onestepcheckout_comments"><?php if(isset($_POST['onestepcheckout_comments'])) { echo Mage::helper('core')->escapeHtml($_POST['onestepcheckout_comments']); } ?></textarea>
644
+ </div>
645
+ <?php endif; ?>
646
+
647
+ <?php if($this->settings['enable_gift_messages']): ?>
648
+ <div id="onestepcheckout-giftmessages">
649
+ <div class="onestepcheckout-giftmessagecontainer">
650
+ <?php echo $this->helper('onestepcheckout/message')->getInline('onepage_checkout', $this->getQuote(), $this->getDontDisplayContainer()) ?>
651
+ </div>
652
+ </div>
653
+ <?php endif; ?>
654
+
655
+ <?php $customerEmail = (($this->isCustomerLoggedIn())) ? $this->getQuote()->getCustomer()->getEmail() : false ;?>
656
+ <?php if($this->settings['enable_newsletter'] && !$this->isSubScribed($customerEmail)): ?>
657
+ <div class="onestepcheckout-enable-newsletter">
658
+ <input type="checkbox" id="id_subscribe_newsletter" name="subscribe_newsletter" value="1" <?php if($this->settings['newsletter_default_checked']): ?>checked="checked"<?php endif; ?> />
659
+ <label for="id_subscribe_newsletter"><?php echo $this->__('Subscribe to our newsletter'); ?></label>
660
+ </div>
661
+ <?php endif; ?>
662
+
663
+ <?php $_extraProductsHelper = Mage::helper('onestepcheckout/extraproducts'); ?>
664
+ <?php if($_extraProductsHelper->hasExtraProducts()): ?>
665
+ <div class="onestepcheckout-extraproducts">
666
+ <ul>
667
+ <?php foreach($_extraProductsHelper->getExtraProducts() as $product): ?>
668
+ <li><input type="checkbox" class="onestepcheckout-extra-product"
669
+ <?php if($_extraProductsHelper->productInCart($product->getId())): ?>
670
+ checked="checked" <?php endif; ?>
671
+ name="extra_products_<?php echo $product->getId(); ?>"
672
+ id="id_extra_product_<?php echo $product->getId(); ?>" /> &nbsp;
673
+ <label for="id_extra_product_<?php echo $product->getId(); ?>"> <?php echo $product->getName(); ?>
674
+ <span><?php echo Mage::helper('checkout')->formatPrice($product->getPrice()); ?></span>
675
+ </label></li>
676
+ <?php endforeach; ?>
677
+ </ul>
678
+ </div>
679
+
680
+ <script>
681
+ Event.observe(window, 'load', function() {
682
+ $$('input.onestepcheckout-extra-product').invoke('observe', 'click', function(e) {
683
+ var id_temp = e.element().id.split('id_extra_product_');
684
+ if(id_temp.length == 2) {
685
+ var product_id = id_temp[1];
686
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/add_extra_product'); ?>';
687
+ var parameters = {
688
+ product_id: product_id
689
+ }
690
+
691
+ if(!e.element().checked) {
692
+ parameters['remove'] = 1;
693
+ }
694
+
695
+ var summary = $$('div.onestepcheckout-summary').first();
696
+ summary.update('<div class="loading-ajax">&nbsp;</div>');
697
+
698
+ new Ajax.Request(url, {
699
+ method: 'post',
700
+ parameters: parameters,
701
+ onSuccess: function(transport) {
702
+ summary.update(transport.responseText);
703
+ }
704
+ });
705
+ };
706
+ });
707
+ });
708
+ </script>
709
+ <?php endif; ?>
710
+
711
+ <?php
712
+ /**
713
+ * Feedbackdropdown start
714
+ */
715
+ ?>
716
+ <?php if(!empty($this->settings['feedback']['enable_feedback']) && !empty($this->settings['feedback']['feedback_values'])):?>
717
+ <?php
718
+ $selectedFeedBackFields = $this->getRequest()->getPost('onestepcheckout-feedback', false);
719
+ $feedbackValues = unserialize($this->settings['feedback']['feedback_values']);
720
+ ?>
721
+ <div class="onestepcheckout-feedback" id="">
722
+ <label for="id_feedback"><?php echo $this->__('How did you hear about us?'); ?></label><br>
723
+ <select style="" name="onestepcheckout-feedback" id="id_feedback" defaultvalue="">
724
+ <option value=""><?php echo $this->__('Please choose'); ?></option>
725
+ <?php foreach($feedbackValues as $value => $label):
726
+ $selected= (!empty($selectedFeedBackFields) && $selectedFeedBackFields == $value) ? ' selected' : '';
727
+ ?>
728
+ <option value="<?php echo $value?>" <?php echo $selected;?>><?php echo $label['value']?></option>
729
+ <?php endforeach;?>
730
+ <?php if(!empty($this->settings['feedback']['enable_feedback_freetext'])):
731
+ $selected= (empty($feedbackValues[$selectedFeedBackFields]) && $selectedFeedBackFields != '') ? ' selected' : '';
732
+ ?>
733
+ <option value="freetext" <?php echo $selected;?>><?php echo $this->__('Other'); ?></option>
734
+ <?php endif;?>
735
+ </select>
736
+ </div>
737
+ <?php if(!empty($this->settings['feedback']['enable_feedback_freetext'])):?>
738
+ <script type="text/javascript">
739
+ $('id_feedback').observe('change', function (event){
740
+ if(this.getValue() == 'freetext'){
741
+ $('id_feedback_freetext_div').show();
742
+ } else {
743
+ $('id_feedback_freetext_div').hide();
744
+ }
745
+ });
746
+ </script>
747
+ <div id='id_feedback_freetext_div' class="onestepcheckout-feedback-freetext"<?php echo ((!empty($selectedFeedBackFields) && $selectedFeedBackFields == 'freetext') ? '' : ' style="display: none;"'); ?>>
748
+ <label for="id_feedback_freetext"><?php echo $this->__('Please specify:'); ?></label><br/>
749
+ <textarea id="id_feedback_freetext" name="onestepcheckout-feedback-freetext"><?php echo Mage::helper('core')->escapeHtml($this->getRequest()->getPost('onestepcheckout-feedback-freetext', false));?></textarea>
750
+ </div>
751
+ <?php endif; ?>
752
+ <?php endif; ?>
753
+ <?php
754
+ /**
755
+ * Feedbackdropdown end
756
+ */
757
+ ?>
758
+
759
+ <?php if($this->settings['enable_terms']): //deprecated?>
760
+ <div class="onestepcheckout-enable-terms">
761
+ <?php
762
+
763
+ if(isset($this->formErrors['terms_error']) && $this->formErrors['terms_error']) {
764
+ $terms_error = true;
765
+ }
766
+ else {
767
+ if($_SERVER['REQUEST_METHOD'] == 'POST') {
768
+ $terms_error = false;
769
+ }
770
+ else {
771
+ $terms_error = true;
772
+ }
773
+ }
774
+ ?>
775
+
776
+ <input class="required-entry" type="checkbox" id="id_accept_terms" name="accept_terms" value="1" <?php if(!$terms_error) echo "checked=\"checked\""; ?> />
777
+ <label for="id_accept_terms"><?php echo $this->__('I accept the <a id="onestepcheckout-toc-link" target="_blank" href="javascript:void(0);">Terms and Conditions</a>'); ?></label>
778
+
779
+ <?php if(isset($this->formErrors['terms_error']) && $this->formErrors['terms_error']): ?>
780
+ <div class="onestepcheckout-error onestepcheckout-terms-error">
781
+ <?php echo $this->__('You must accept our terms to continue.'); ?>
782
+ </div>
783
+ <?php endif; ?>
784
+
785
+ </div>
786
+ <?php endif; ?>
787
+
788
+ <?php
789
+ /**
790
+ * Default magento agreements
791
+ */
792
+ ?>
793
+ <?php if($this->settings['enable_default_terms']): ?>
794
+ <?php if(!empty($this->formErrors['agreements_error'])):?>
795
+ <div class="onestepcheckout-error onestepcheckout-terms-error">
796
+ <?php echo $this->__('Please agree to all the terms and conditions before placing the order.'); ?>
797
+ </div>
798
+ <?php endif;?>
799
+ <?php echo $this->getChildHtml('agreements') ?>
800
+ <script type="text/javascript">
801
+
802
+ var termsmodals = new Object;
803
+
804
+ document.observe('dom:loaded', function() {
805
+ $$('.checkout-agreements li p input').each(
806
+ function(elem){
807
+ elem.addClassName('required-entry');
808
+ }
809
+ );
810
+ });
811
+
812
+ <?php if($this->settings['enable_textarea']):?>
813
+ document.observe('dom:loaded', function() {
814
+ $$('.checkout-agreements li p label').each(
815
+ function(elem){
816
+ elem.up().insert('<a href="javascript:void(0);" onclick="termsmodals[\'' + elem.htmlFor + '\'].open();">' + elem.innerHTML + '</a>');
817
+ elem.hide();
818
+ }
819
+ );
820
+ $$('div.agreement-content').each(
821
+ function(element){
822
+ element.id = 'agreement-div-' + element.up('li').down('input').id;
823
+ $$('body')[0].insert(element);
824
+ }
825
+ );
826
+ $$('.checkout-agreements li p input').each(
827
+ function(elem){
828
+ window.termsmodals[elem.id] = new Control.Modal($('agreement-div-' + elem.id),{
829
+ overlayOpacity: 0.75,
830
+ className: 'oscmodal',
831
+ fade: true,
832
+ closeOnClick: true,
833
+ height: 400,
834
+ width: 700
835
+ });
836
+ }
837
+ );
838
+ });
839
+ <?php endif;?>
840
+
841
+ </script>
842
+ <?php endif;?>
843
+ <?php
844
+ /**
845
+ * Default magento agreements end
846
+ */
847
+ ?>
848
+
849
+ <div class="onestepcheckout-place-order-wrapper">
850
+ <button type="button" title="<?php echo $this->__('Place order now'); ?>" id="onestepcheckout-place-order" class="large orange onestepcheckout-button onestepcheckout-place-order" onclick="javascript:void(0);"><span><span><?php echo $this->__('Place order now'); ?></span></span></button>
851
+ </div>
852
+ </div>
853
+ <div style="clear: both;">&nbsp;</div>
854
+ </div>
855
+ </fieldset>
856
+ </form>
857
+
858
+ <?php if(!$this->isCustomerLoggedIn() && $helper->showLoginLink()): ?>
859
+ <?php echo $this->getChildHtml('login-popup'); ?>
860
+ <?php endif; ?>
861
+
862
+ <?php if($helper->isValidateEmail()): ?>
863
+ <script>
864
+ $('billing:email').observe('blur', function(e) {
865
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/check_email', array('_secure'=>true)); ?>';
866
+ var email = e.element().getValue();
867
+ var parameters = { email: email };
868
+
869
+ new Ajax.Request(url, {
870
+ parameters: parameters,
871
+ onComplete: function(response) {
872
+ if(response.status == 200) {
873
+ var result = response.responseText.evalJSON().result;
874
+ if(result == 'invalid') {
875
+ $('onestepcheckout-email-error-message').update('<?php echo $this->__('Invalid email address.'); ?>');
876
+ $('onestepcheckout-email-error').show();
877
+ }
878
+ else if(result == 'exists') {
879
+ <?php if($this->settings['registration_order_without_password']): ?>
880
+ // Remove the password fields if the email exists in database
881
+ $('onestepcheckout-li-password').hide();
882
+ <?php endif; ?>
883
+ $('onestepcheckout-email-error-message').update('<?php echo $this->__('Email address already registered. Please <a href="javascript:void(0);" onclick="login_popup.show(); return false;">login now</a> or use a different email address.'); ?>');
884
+ $('onestepcheckout-email-error').show();
885
+ $('id_onestepcheckout_username').value = email;
886
+ }
887
+ else {
888
+ $('onestepcheckout-email-error').hide();
889
+ }
890
+ }
891
+ }
892
+ })
893
+
894
+ });
895
+ Validation.add('validate-email', '<?php echo $this->__('This is a required field.') ?>', function(v) {
896
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/check_email', array('_secure'=>true)); ?>';
897
+ var email = v;
898
+ var parameters = { email: email };
899
+ var value = Validation.get('IsEmpty').test(v) || /^([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*@([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*\.(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]){2,})$/i.test(v)
900
+
901
+ new Ajax.Request(url, {
902
+ parameters: parameters,
903
+ asynchronous: false,
904
+ onComplete: function(response) {
905
+ if(response.status == 200) {
906
+ var result = response.responseText.evalJSON().result;
907
+ if(result == 'invalid') {
908
+ value = false;
909
+ } else if(result == 'exists') {
910
+ <?php if($this->settings['registration_order_without_password']): ?>
911
+ $('onestepcheckout-li-password').hide();
912
+ <?php endif; ?>
913
+ $('onestepcheckout-email-error-message').update('<?php echo $this->__('Email address already registered. Please <a href="javascript:void(0);" onclick="login_popup.show(); return false;">login now</a> or use a different email address.'); ?>');
914
+ $('onestepcheckout-email-error').show();
915
+ $('id_onestepcheckout_username').value = email;
916
+ value = false;
917
+ }
918
+ }
919
+ }
920
+ })
921
+ return value;
922
+ });
923
+ </script>
924
+ <?php endif; ?>
925
+
926
+ <?php if($this->settings['enable_terms']): ?>
927
+ <div id="onestepcheckout-toc-popup" style="display: none;">
928
+
929
+ <div class="onestepcheckout-popup-wrapper">
930
+ <div class="onestepcheckout-popup-wrapper-inner">
931
+ <h1><?php echo $this->settings['terms_title']; ?></h1>
932
+
933
+ <div class="onestepcheckout-toc-terms">
934
+ <?php echo $this->settings['terms_contents']; ?>
935
+ </div>
936
+
937
+ <p class="close"><a href="javascript:void(0);"><?php echo $this->__('Close'); ?></a></p>
938
+ </div>
939
+ </div>
940
+ <div class="onestepcheckout-popup-footer">&nbsp;</div>
941
+ </div>
942
+ <script>
943
+ Event.observe(window, 'load', function() {
944
+
945
+ var termsPopup = new Control.Modal($('onestepcheckout-toc-popup'), {
946
+ overlayOpacity: 0.65,
947
+ fade: true,
948
+ fadeDuration: 0.3
949
+ });
950
+
951
+ $('onestepcheckout-toc-link').observe('click', function(e) {
952
+ e.preventDefault();
953
+ termsPopup.open();
954
+ });
955
+
956
+ $$('div#onestepcheckout-toc-popup p.close a').invoke('observe', 'click', function(e) {
957
+ e.preventDefault();
958
+ termsPopup.close();
959
+ });
960
+
961
+ });
962
+
963
+ /*
964
+ var popup;
965
+ Event.observe(window, 'load', function() {
966
+ popup = new OneStepCheckout_Popup('onestepcheckout-toc-popup','onestepcheckout-toc-link', 'div#onestepcheckout-toc-popup p.close a');
967
+ });
968
+ */
969
+ </script>
970
+ <?php endif; ?>
971
+
972
+
973
+
974
+
975
+
976
+ <script>
977
+ <?php if($this->hasFormErrors()): ?>
978
+ if($$('div.input-error').length > 0) {
979
+ var input = $$('div.input-error')[0].select('input');
980
+ if(input.length == 1) {
981
+ input[0].focus();
982
+ }
983
+ }
984
+ <?php endif; ?>
985
+ </script>
986
+
987
+ <?php if(!$this->settings['exclude_region']): ?>
988
+ <script type="text/javascript">countryRegions = <?php echo $this->helper('directory')->getRegionJson() ?></script>
989
+ <script type="text/javascript">
990
+ //<![CDATA[
991
+ var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', countryRegions, undefined, 'billing:postcode');
992
+
993
+ <?php if($this->settings['enable_different_shipping'] && !$this->isVirtual()): ?>
994
+ var shippingRegionUpdater = new RegionUpdater('shipping:country_id', 'shipping:region', 'shipping:region_id', countryRegions, undefined, 'shipping:postcode');
995
+ <?php endif; ?>
996
+ //]]>
997
+ </script>
998
+ <?php endif; ?>
999
+
1000
+
1001
+ <script type="text/javascript">
1002
+
1003
+ Event.observe(window, 'load', function() {
1004
+ if ($$('div.shopping-cart-totals').length == 1) {
1005
+ }
1006
+ else {
1007
+
1008
+ already_placing_order = false;
1009
+ review = false;
1010
+ reviewmodal = false;
1011
+
1012
+ /* Handle place order click event */
1013
+ $$('.onestepcheckout-place-order').each(function(elem){
1014
+ elem.observe('click', function(e) {
1015
+ Event.stop(e);
1016
+
1017
+ // First validate the form
1018
+ var form = new VarienForm('onestepcheckout-form');
1019
+
1020
+ if(!form.validator.validate()) {
1021
+ Event.stop(e);
1022
+ } else {
1023
+
1024
+ if(!already_placing_order && $$('.loading-ajax').length <= 0 ) {
1025
+ <?php if(!empty($helper->settings['addressreview']['enable_addressreview'])):?>
1026
+ var addressTemplates = {
1027
+ shipping: '<?php echo str_replace("\r", '', str_replace("\n", '', $helper->settings['addressreview']['shipping_template']));?>',
1028
+ billing: '<?php echo str_replace("\r", '', str_replace("\n", '', $helper->settings['addressreview']['billing_template']));?>'
1029
+ };
1030
+ addressPreview(addressTemplates, 'addressreview');
1031
+ if(!review){
1032
+ review = true;
1033
+ if(!reviewmodal){
1034
+ reviewmodal = new Control.Modal($('addressreview'),{
1035
+ overlayOpacity: 0.75,
1036
+ className: 'oscmodal',
1037
+ fade: true,
1038
+ closeOnClick: false
1039
+ });
1040
+ }
1041
+ reviewmodal.open();
1042
+ reviewmodal.observe('beforeClose',function(){
1043
+ review = false;
1044
+ });
1045
+ return true;
1046
+ Event.stop(e);
1047
+ } else {
1048
+ reviewmodal.close();
1049
+ }
1050
+ <?php endif;?>
1051
+ already_placing_order = true;
1052
+
1053
+ var submitelement = $('onestepcheckout-place-order');
1054
+ /* Disable button to avoid multiple clicks */
1055
+ submitelement.removeClassName('orange').addClassName('grey');
1056
+ submitelement.disabled = true;
1057
+
1058
+ var loaderelement = new Element('span').
1059
+ addClassName('onestepcheckout-place-order-loading').
1060
+ update('<?php echo $this->__('Please wait, processing your order...'); ?>');
1061
+
1062
+ submitelement.parentNode.appendChild(loaderelement);
1063
+
1064
+ /* Submit the form */
1065
+ $('onestepcheckout-form').submit();
1066
+ }
1067
+ }
1068
+ });
1069
+ });
1070
+
1071
+
1072
+ // This is a separate page
1073
+ var url = '<?php echo $this->getUrl('onestepcheckout/ajax/set_methods_separate', array('_secure'=>true)); ?>';
1074
+ var update_payments = <?php echo $this->settings['enable_update_payment_on_shipping'] ? 'true' : 'false'; ?>;
1075
+
1076
+ $$('dl.shipment-methods input').invoke('observe', 'click', get_separate_save_methods_function(url, update_payments));
1077
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
1078
+ $$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
1079
+ $$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
1080
+
1081
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
1082
+ $$('div.onestepcheckout-payment-method-error').each(function(item) {
1083
+ new Effect.Fade(item);
1084
+ });
1085
+ });
1086
+
1087
+ $$('dl.shipment-methods input').invoke('observe', 'click', function() {
1088
+ $$('div.onestepcheckout-shipment-method-error').each(function(item) {
1089
+ new Effect.Fade(item);
1090
+ });
1091
+ });
1092
+
1093
+ var has_hidden_terms = false;
1094
+
1095
+ if($('id_accept_terms') != null) {
1096
+
1097
+ $('id_accept_terms').observe('click', function(e) {
1098
+ var element = e.element();
1099
+
1100
+ if(element.checked) {
1101
+ $$('div.onestepcheckout-terms-error').each(function(item) {
1102
+ new Effect.Fade(item);
1103
+ has_hidden_terms = true;
1104
+ });
1105
+ }
1106
+ else {
1107
+ if(has_hidden_terms) {
1108
+ $$('div.onestepcheckout-terms-error').each(function(item) {
1109
+ new Effect.Appear(item);
1110
+ has_hidden_terms = false;
1111
+ });
1112
+ }
1113
+ }
1114
+ });
1115
+ }
1116
+ }
1117
+
1118
+ var form = $('onestepcheckout-form');
1119
+
1120
+ /* Highlight selected payment method if one set */
1121
+ if($RF(form, 'payment[method]') != null) {
1122
+ try {
1123
+ var payment_method = $RF(form, 'payment[method]');
1124
+ $('container_payment_method_' + payment_method).show();
1125
+ $('payment_form_' + payment_method).show();
1126
+ } catch(err) {
1127
+
1128
+ }
1129
+ }
1130
+
1131
+ /* Set default shipping method if not set */
1132
+ if($RF(form, 'shipping_method') == null) {
1133
+ try {
1134
+ var method = '<?php echo $this->_getDefaultShippingMethod(); ?>';
1135
+ if(method != '') {
1136
+ $('s_method_' + method).checked = true;
1137
+ get_separate_save_methods_function(url);
1138
+ }
1139
+ } catch(err) {
1140
+
1141
+ }
1142
+ }
1143
+ //submit what's available on load
1144
+ get_separate_save_methods_function(url)();
1145
+
1146
+ <?php if($this->differentShippingAvailable()): ?>
1147
+ $('billing:use_for_shipping_yes').observe('click', function(e) {
1148
+ var element = e.element();
1149
+ if(element.checked){
1150
+ $('shipping_address').hide();
1151
+ } else {
1152
+ if($('shipping-address-select') && $('shipping-address-select').value == ''){
1153
+ $('shipping_address_list').show()
1154
+ }
1155
+ $('shipping_address').show();
1156
+ <?php if(!$this->isCustomerLoggedIn()):?>
1157
+ $('shipping_address_list').show()
1158
+ <?php endif;?>
1159
+ <?php if($this->isCustomerLoggedIn()):?>
1160
+ if(!$('shipping-address-select') && $('shipping_address_list').getStyle('display')=='none'){
1161
+ $('shipping_address_list').show()
1162
+ }
1163
+ <?php endif;?>
1164
+ }
1165
+
1166
+ <?php if($this->settings['enable_ajax_save_billing']): ?>
1167
+ get_save_billing_function('<?php echo $this->getUrl('onestepcheckout/ajax/save_billing', array('_secure'=>true)); ?>', '<?php echo $this->getUrl('onestepcheckout/ajax/set_methods_separate', array('_secure'=>true)); ?>', <?php echo $this->settings['enable_update_payment_on_shipping'] ? 'true' : 'false'; ?>, true)();
1168
+ <?php endif; ?>
1169
+
1170
+ });
1171
+ <?php endif; ?>
1172
+ <?php
1173
+ $triggers = Mage::getStoreConfig('onestepcheckout/ajax_update/ajax_save_billing_fields');
1174
+ if(!empty($triggers)){
1175
+ $triggers = str_replace('country', 'country_id', $triggers);
1176
+ $triggers = str_replace('state/region', 'region_id', $triggers);
1177
+ $triggers = explode(',',$triggers);
1178
+ if(in_array('region_id',$triggers)){
1179
+ $triggers[] = 'region';
1180
+ }
1181
+ }
1182
+ ?>
1183
+
1184
+ <?php if(Mage::getStoreConfig('onestepcheckout/ajax_update/enable_ajax_save_billing') && !empty($triggers)):?>
1185
+
1186
+ var url_save_billing = '<?php echo $this->getUrl('onestepcheckout/ajax/save_billing', array('_secure'=>true)); ?>';
1187
+ var url_set_methods = '<?php echo $this->getUrl('onestepcheckout/ajax/set_methods_separate', array('_secure'=>true)); ?>';
1188
+ var update_payments = <?php echo $this->settings['enable_update_payment_on_shipping'] ? 'true' : 'false'; ?>;
1189
+ var update_on_initial = false;
1190
+
1191
+ var euvat = $('euvat_action_validate_taxvat');
1192
+
1193
+ if(euvat !== null){
1194
+ euvat.observe('change', get_save_billing_function(url_save_billing, url_set_methods, update_payments, true));
1195
+ }
1196
+
1197
+ var euvatid = $('billing:vat_id');
1198
+
1199
+ if(euvatid !== null){
1200
+ euvatid.observe('change', get_save_billing_function(url_save_billing, url_set_methods, update_payments, true));
1201
+ }
1202
+
1203
+ triggers = ['<?php echo implode ('\',\'',$triggers)?>'];
1204
+ btriggered = [];
1205
+ striggered = [];
1206
+
1207
+ <?php
1208
+ foreach($triggers as $value){
1209
+ echo (($this->getQuote()->getBillingAddress()->getData($value)) ? 'btriggered.push(\'billing:'.$value.'\');' : '');
1210
+ echo (($this->getQuote()->getShippingAddress()->getData($value)) ? 'striggered.push(\'shipping:'.$value.'\');' : '');
1211
+ }
1212
+ ?>
1213
+
1214
+
1215
+ bcountry_id = $('billing:country_id');
1216
+ if(bcountry_id){
1217
+ if(bcountry_id.getValue()){
1218
+ if(!btriggered.include('billing:country_id')){
1219
+ btriggered.push('billing:country_id');
1220
+ }
1221
+ }
1222
+ }
1223
+ scountry_id = $('shipping:country_id');
1224
+ if(scountry_id){
1225
+ if(scountry_id.getValue()){
1226
+ if(!striggered.include('shipping:country_id')){
1227
+ striggered.push('shipping:country_id');
1228
+ }
1229
+ }
1230
+ }
1231
+
1232
+ batriggered = false;
1233
+ satriggered = false;
1234
+
1235
+ changeTimer = false;
1236
+ changeInterval = 1000;
1237
+
1238
+ triggers.each(function(item){
1239
+ var belement = $('billing:'+item);
1240
+ if(belement){
1241
+ belement.observe('change', function(e){
1242
+ var element = e.element();
1243
+ var id = element.id;
1244
+ var tagname = element.tagName;
1245
+ if(tagname === 'SELECT'){
1246
+ clearTimeout(changeTimer);
1247
+ changeTimer = setTimeout(bcallbackEvent, changeInterval, id);
1248
+ } else {
1249
+ bcallbackEvent(id);
1250
+ }
1251
+ });
1252
+ }
1253
+
1254
+ var selement = $('shipping:'+item);
1255
+ if(selement){
1256
+ selement.observe('change', function(e){
1257
+ var element = e.element();
1258
+ var id = element.id;
1259
+ var tagname = element.tagName;
1260
+ if(tagname === 'SELECT'){
1261
+ clearTimeout(changeTimer);
1262
+ changeTimer = setTimeout(scallbackEvent, changeInterval, id);
1263
+ } else {
1264
+ scallbackEvent(id);
1265
+ }
1266
+ });
1267
+ }
1268
+ });
1269
+
1270
+ function scallbackEvent (id){
1271
+ if(!striggered.include(id)){
1272
+ striggered.push(id);
1273
+ }
1274
+ if(striggered.length >= triggers.length-1){
1275
+ satriggered = true;
1276
+ }
1277
+ get_save_billing_function(url_save_billing, url_set_methods, update_payments, satriggered)();
1278
+ }
1279
+
1280
+
1281
+ function bcallbackEvent (id){
1282
+ if(!btriggered.include(id)){
1283
+ btriggered.push(id);
1284
+ }
1285
+ if(btriggered.length >= triggers.length-1){
1286
+ batriggered = true;
1287
+ }
1288
+ get_save_billing_function(url_save_billing, url_set_methods, update_payments, batriggered)();
1289
+ }
1290
+
1291
+
1292
+ <?php if($this->isCustomerLoggedIn()):?>
1293
+ var bselect = $('billing-address-select');
1294
+ var sselect = $('shipping-address-select');
1295
+ if(bselect){
1296
+ bselect.observe('change', get_save_billing_function(url_save_billing, url_set_methods, update_payments, true));
1297
+ }
1298
+ if(sselect){
1299
+ sselect.observe('change', get_save_billing_function(url_save_billing, url_set_methods, update_payments, true));
1300
+ }
1301
+ <?php endif;?>
1302
+
1303
+ <?php endif; ?>
1304
+
1305
+ });
1306
+
1307
+ if($('payment-tool-tip-close')){
1308
+ Event.observe($('payment-tool-tip-close'), 'click', toggleToolTip);
1309
+ }
1310
+
1311
+ </script>
1312
+
1313
+
1314
+ <?php endif; ?>
1315
+
1316
+ <div id="onestepcheckout_popup_overlay" style="display: none;">&nbsp;</div>
1317
+
1318
+
1319
+ <div id="loading-process" style="display: none;"></div>
app/design/frontend/rwd/adyen/template/onestepcheckout/payment_method.phtml ADDED
@@ -0,0 +1,217 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design_default
22
+ * @package Mage
23
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * One page checkout payment methods
30
+ *
31
+ * @see Mage_Checkout_Block_Onepage_Payment_Methods
32
+ */
33
+ ?>
34
+
35
+
36
+ <?php
37
+ $methods = $this->getMethods();
38
+ $oneMethod = count($methods) <= 1;
39
+
40
+
41
+ $helper = Mage::helper('onestepcheckout/checkout');
42
+ $hide_nonfree_methods = false;
43
+ if($helper->settings['hide_nonfree_payment_methods']) {
44
+ foreach($this->getMethods() as $_method) {
45
+ if($_method->getCode() == 'free') {
46
+ $hide_nonfree_methods = true;
47
+ }
48
+ }
49
+ }
50
+
51
+
52
+ ?>
53
+
54
+ <div class="payment-methods">
55
+ <script type="text/javascript">
56
+ //<![CDATA[
57
+ <?php echo $this->getChildHtml('reward.scripts'); ?>
58
+ <?php echo $this->getChildHtml('customerbalance_scripts'); ?>
59
+ var payment = new Payment('checkout-payment-method-load', '<?php echo $this->getUrl('checkout/onepage/savePayment') ?>');
60
+ payment.currentMethod = "<?php echo $this->getQuote()->getPayment()->getMethod() ?>";
61
+ //]]>
62
+ </script>
63
+ <?php if(Mage::helper('onestepcheckout')->isEnterprise()):?>
64
+ <?php echo $this->getChildHtml('customerbalance'); ?>
65
+ <?php echo $this->getChildHtml('reward.points'); ?>
66
+ <?php endif;?>
67
+
68
+ <?php if (count($this->getMethods())=='1' && Mage::getStoreConfig('onestepcheckout/general/hide_payment_method')):?>
69
+ <dl id="checkout-payment-method-load" style="display: none">
70
+ <?php foreach ($this->getMethods() as $_method): $_code = $_method->getCode() ?>
71
+
72
+ <dt>
73
+ <input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="hidden" name="payment[method]" title="<?php echo $this->escapeHtml($_method->getTitle()) ?>" class="radio" <?php if($this->getSelectedMethodCode()==$_code || ($hide_nonfree_methods && $_code == 'free')): ?> checked="checked"<?php endif; ?> />
74
+ <label for="p_method_<?php echo $_code ?>"><?php echo $_method->getTitle() ?></label></dt>
75
+ <?php endforeach; ?>
76
+ </dl>
77
+ <?php else:?>
78
+
79
+ <dl id="checkout-payment-method-load">
80
+ <?php foreach ($this->getMethods() as $_method): $_code = $_method->getCode() ?>
81
+ <?php if($hide_nonfree_methods && $_code != 'free') continue;
82
+
83
+ $_style = "";
84
+ if($_code == "adyen_hpp") {
85
+ // get method and check if config payment/adyen_hpp/disable_hpptypes is set
86
+ $disabled = $_method->getHppOptionsDisabled();
87
+ if(!$disabled) {
88
+ $_style = ($_code == "adyen_hpp" && !$oneMethod) ? "display:none" : "";
89
+ }
90
+ } else if ($_code == "adyen_oneclick" && !$oneMethod) {
91
+ $_style = "display:none";
92
+ }
93
+ ?>
94
+
95
+ <dt style="<?php echo $_style; ?>">
96
+ <?php if( sizeof($this->getMethods()) > 1 ): ?>
97
+ <input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" title="<?php echo $this->escapeHtml($_method->getTitle()) ?>" class="radio validate-one-required-by-name" <?php if($this->getSelectedMethodCode()==$_code || ($hide_nonfree_methods && $_code == 'free')): ?> checked="checked"<?php endif; ?> />
98
+ <?php else: ?>
99
+ <span class="no-display"><input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" checked="checked" /></span>
100
+ <?php endif; ?>
101
+ <label for="p_method_<?php echo $_code ?>"><?php echo $_method->getTitle() ?></label>
102
+ </dt>
103
+ <?php if($html = $this->getChildHtml('payment.method.'.$_code)): ?>
104
+ <?php $class = ($_code == "adyen_hpp" || $_code == "adyen_oneclick") ? "" : "payment-method"; ?>
105
+ <dd id="container_payment_method_<?php echo $_code; ?>" class="<?php echo $class; ?>">
106
+ <?php echo $html; ?>
107
+ </dd>
108
+ <?php endif; ?>
109
+ <script type="text/javascript">
110
+ //<![CDATA[
111
+
112
+ var SwitchMethod= function() {
113
+ var method = $('p_method_<?php echo $_code?>').value;
114
+
115
+ if(method != "adyen_hpp") {
116
+ // check if hpp is enabled if so clear the selected option because you select different payment method
117
+ if($('hpp_payment_form_adyen_hpp'))
118
+ {
119
+ var form = $('hpp_payment_form_adyen_hpp');
120
+ var elements = form.getElementsByTagName('input');
121
+ for (var i=0; i<elements.length; i++) elements[i].checked = false;
122
+ }
123
+ }
124
+
125
+ // check if oneclick is enabled if so clear the selected option because you select different payment method
126
+ if(method != "adyen_oneclick") {
127
+ // always enable the oneclick payments options if this payment method is on
128
+ if($('oneclick_payment_form_adyen_oneclick'))
129
+ {
130
+ var form = $('oneclick_payment_form_adyen_oneclick');
131
+ var elements = form.getElementsByTagName('input');
132
+ for (var i=0; i<elements.length; i++) elements[i].checked = false;
133
+ }
134
+ }
135
+
136
+ payment.switchMethod(method);
137
+ };
138
+ Event.observe($('p_method_<?php echo $_code ?>'), 'change', SwitchMethod);
139
+
140
+ //]]>
141
+ </script>
142
+ <?php endforeach; ?>
143
+ </dl>
144
+ <?php endif;?>
145
+ </div>
146
+ <script type="text/javascript">
147
+ //<![CDATA[
148
+
149
+ $$('.cvv-what-is-this').each(function(element){
150
+ Event.observe(element, 'click', toggleToolTip);
151
+ });
152
+
153
+ function toggleToolTip(event){
154
+ if($('payment-tool-tip')){
155
+ $('payment-tool-tip').setStyle({
156
+ left: (Event.pointerX(event)-100)+'px',
157
+ top: (Event.pointerY(event)-300)+'px'
158
+ });
159
+ $('payment-tool-tip').toggle();
160
+ }
161
+ Event.stop(event);
162
+ }
163
+
164
+ var checkout = new Checkout();
165
+ $$('#checkout-payment-method-load dt input').invoke('observe', 'click', function(e) {
166
+
167
+ var element = e.element();
168
+ var name = 'payment_form_' + element.getValue();
169
+ payment.currentMethod = element.getValue();
170
+ /* Hide all other forms */
171
+ $$('dd.payment-method').invoke('hide');
172
+
173
+ if(element.checked) {
174
+ payment.switchMethod(payment.currentMethod);
175
+ var form = $(name);
176
+ var container = $('container_payment_method_' + element.getValue());
177
+
178
+ if(element !== null && container !== null) {
179
+ container.show();
180
+ $(name).show();
181
+ }
182
+ }
183
+ });
184
+
185
+ // ADYEN: set current method as well if you click on hpp and oneclick
186
+ $$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', function(e) {
187
+ payment.currentMethod = "adyen_hpp";
188
+ });
189
+
190
+ $$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', function(e) {
191
+ payment.currentMethod = "adyen_oneclick";
192
+ });
193
+
194
+ <?php if(Mage::helper('onestepcheckout')->isEnterprise() && Mage::helper('customer')->isLoggedIn()):?>
195
+ //if we have a enterprise version we should include this
196
+
197
+ rPoints = $('use_reward_points');
198
+ if(rPoints){
199
+ if(rPoints.checked){
200
+ payment.switchRewardPointsCheckbox();
201
+ }
202
+ }
203
+ cBalance = $('use_customer_balance');
204
+ if(cBalance){
205
+ if(cBalance.checked){
206
+ payment.switchCustomerBalanceCheckbox();
207
+ }
208
+ }
209
+ //if we have a enterprise version we should include this end
210
+ <?php endif;?>
211
+
212
+ payment.switchMethod(payment.currentMethod);
213
+
214
+
215
+ <?php echo $this->getChildHtml('giftcardaccount_scripts');?>
216
+ //]]>
217
+ </script>
js/adyen/payment/adyen.encrypt.js CHANGED
@@ -2,12 +2,12 @@
2
  *
3
  * Client Encryption of Forms.
4
  *
5
- * Includes:
6
  * * RSA and ECC in JavaScript | http://www-cs-students.stanford.edu/~tjw/jsbn/
7
  * * Stanford Javascript Crypto Library | http://crypto.stanford.edu/sjcl/
8
  * * JSON in JavaScript | http://www.JSON.org/
9
- *
10
- * Version: 0_1_1
11
  * Author: ADYEN (c) 2013
12
 
13
  <!DOCTYPE html>
@@ -40,7 +40,7 @@
40
 
41
  <div class="field">
42
  <label for="adyen-encrypted-form-expiry-month">Expiration Month (MM)
43
- <input type="text" value="06" id="adyen-encrypted-form-expiry-month" size="2" autocomplete="off" data-encrypted-name="expiryMonth" /> /
44
  </label>
45
  <label for="adyen-encrypted-form-expiry-year">Expiration Year (YYYY)
46
  <input type="text" value="2016" id="adyen-encrypted-form-expiry-year" size="4" autocomplete="off" data-encrypted-name="expiryYear" />
@@ -59,10 +59,10 @@
59
  <script>
60
  // generate time client side for testing... Don't deploy on a real integration!!!
61
  document.getElementById('adyen-encrypted-form-expiry-generationtime').value = new Date().toISOString();
62
-
63
  // the form element to encrypt
64
  var form = document.getElementById('adyen-encrypted-form');
65
-
66
  // the public key
67
  var key = "10001|80C7821C961865FB4AD23F172E220F819A5CC7B9956BC3458E2788"
68
  + "F9D725B07536E297B89243081916AAF29E26B7624453FC84CB10FC7DF386"
@@ -72,10 +72,10 @@
72
  + "ECFC59B90B928F31715A7034E7B674E221F1EB1D696CC8B734DF7DE2E309"
73
  + "E6E8CF94156686558522629E8AF59620CBDE58327E9D84F29965E4CD0FAF"
74
  + "A38C632B244287EA1F7F70DAA445D81C216D3286B09205F6650262CAB415"
75
- + "5F024B3294A933F4DC514DE0B5686F6C2A6A2D";
76
-
77
- var options = {};
78
-
79
  // the form will be encrypted before it is submitted
80
  adyen.encrypt.createEncryptedForm( form, key, options);
81
  </script>
@@ -86,19 +86,19 @@
86
  */
87
 
88
  (function() {
89
-
90
  /* json2.js */
91
  if(typeof JSON!=="object"){JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){if(typeof rep[i]==="string"){k=rep[i];v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());
92
 
93
  /* base64.js */
94
  function hex2b64(e){var t;var n;var r="";for(t=0;t+3<=e.length;t+=3){n=parseInt(e.substring(t,t+3),16);r+=b64map.charAt(n>>6)+b64map.charAt(n&63)}if(t+1==e.length){n=parseInt(e.substring(t,t+1),16);r+=b64map.charAt(n<<2)}else if(t+2==e.length){n=parseInt(e.substring(t,t+2),16);r+=b64map.charAt(n>>2)+b64map.charAt((n&3)<<4)}while((r.length&3)>0)r+=b64pad;return r}function b64tohex(e){var t="";var n;var r=0;var i;for(n=0;n<e.length;++n){if(e.charAt(n)==b64pad)break;v=b64map.indexOf(e.charAt(n));if(v<0)continue;if(r==0){t+=int2char(v>>2);i=v&3;r=1}else if(r==1){t+=int2char(i<<2|v>>4);i=v&15;r=2}else if(r==2){t+=int2char(i);t+=int2char(v>>2);i=v&3;r=3}else{t+=int2char(i<<2|v>>4);t+=int2char(v&15);r=0}}if(r==1)t+=int2char(i<<2);return t}function b64toBA(e){var t=b64tohex(e);var n;var r=new Array;for(n=0;2*n<t.length;++n){r[n]=parseInt(t.substring(2*n,2*n+2),16)}return r}var b64map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var b64pad="="
95
-
96
  /* jsbn.js */
97
  function BigInteger(e,t,n){if(e!=null)if("number"==typeof e)this.fromNumber(e,t,n);else if(t==null&&"string"!=typeof e)this.fromString(e,256);else this.fromString(e,t)}function nbi(){return new BigInteger(null)}function am1(e,t,n,r,i,s){while(--s>=0){var o=t*this[e++]+n[r]+i;i=Math.floor(o/67108864);n[r++]=o&67108863}return i}function am2(e,t,n,r,i,s){var o=t&32767,u=t>>15;while(--s>=0){var a=this[e]&32767;var f=this[e++]>>15;var l=u*a+f*o;a=o*a+((l&32767)<<15)+n[r]+(i&1073741823);i=(a>>>30)+(l>>>15)+u*f+(i>>>30);n[r++]=a&1073741823}return i}function am3(e,t,n,r,i,s){var o=t&16383,u=t>>14;while(--s>=0){var a=this[e]&16383;var f=this[e++]>>14;var l=u*a+f*o;a=o*a+((l&16383)<<14)+n[r]+i;i=(a>>28)+(l>>14)+u*f;n[r++]=a&268435455}return i}function int2char(e){return BI_RM.charAt(e)}function intAt(e,t){var n=BI_RC[e.charCodeAt(t)];return n==null?-1:n}function bnpCopyTo(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t;e.s=this.s}function bnpFromInt(e){this.t=1;this.s=e<0?-1:0;if(e>0)this[0]=e;else if(e<-1)this[0]=e+DV;else this.t=0}function nbv(e){var t=nbi();t.fromInt(e);return t}function bnpFromString(e,t){var n;if(t==16)n=4;else if(t==8)n=3;else if(t==256)n=8;else if(t==2)n=1;else if(t==32)n=5;else if(t==4)n=2;else{this.fromRadix(e,t);return}this.t=0;this.s=0;var r=e.length,i=false,s=0;while(--r>=0){var o=n==8?e[r]&255:intAt(e,r);if(o<0){if(e.charAt(r)=="-")i=true;continue}i=false;if(s==0)this[this.t++]=o;else if(s+n>this.DB){this[this.t-1]|=(o&(1<<this.DB-s)-1)<<s;this[this.t++]=o>>this.DB-s}else this[this.t-1]|=o<<s;s+=n;if(s>=this.DB)s-=this.DB}if(n==8&&(e[0]&128)!=0){this.s=-1;if(s>0)this[this.t-1]|=(1<<this.DB-s)-1<<s}this.clamp();if(i)BigInteger.ZERO.subTo(this,this)}function bnpClamp(){var e=this.s&this.DM;while(this.t>0&&this[this.t-1]==e)--this.t}function bnToString(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(e==16)t=4;else if(e==8)t=3;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else return this.toRadix(e);var n=(1<<t)-1,r,i=false,s="",o=this.t;var u=this.DB-o*this.DB%t;if(o-->0){if(u<this.DB&&(r=this[o]>>u)>0){i=true;s=int2char(r)}while(o>=0){if(u<t){r=(this[o]&(1<<u)-1)<<t-u;r|=this[--o]>>(u+=this.DB-t)}else{r=this[o]>>(u-=t)&n;if(u<=0){u+=this.DB;--o}}if(r>0)i=true;if(i)s+=int2char(r)}}return i?s:"0"}function bnNegate(){var e=nbi();BigInteger.ZERO.subTo(this,e);return e}function bnAbs(){return this.s<0?this.negate():this}function bnCompareTo(e){var t=this.s-e.s;if(t!=0)return t;var n=this.t;t=n-e.t;if(t!=0)return this.s<0?-t:t;while(--n>=0)if((t=this[n]-e[n])!=0)return t;return 0}function nbits(e){var t=1,n;if((n=e>>>16)!=0){e=n;t+=16}if((n=e>>8)!=0){e=n;t+=8}if((n=e>>4)!=0){e=n;t+=4}if((n=e>>2)!=0){e=n;t+=2}if((n=e>>1)!=0){e=n;t+=1}return t}function bnBitLength(){if(this.t<=0)return 0;return this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)}function bnpDLShiftTo(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e;t.s=this.s}function bnpDRShiftTo(e,t){for(var n=e;n<this.t;++n)t[n-e]=this[n];t.t=Math.max(this.t-e,0);t.s=this.s}function bnpLShiftTo(e,t){var n=e%this.DB;var r=this.DB-n;var i=(1<<r)-1;var s=Math.floor(e/this.DB),o=this.s<<n&this.DM,u;for(u=this.t-1;u>=0;--u){t[u+s+1]=this[u]>>r|o;o=(this[u]&i)<<n}for(u=s-1;u>=0;--u)t[u]=0;t[s]=o;t.t=this.t+s+1;t.s=this.s;t.clamp()}function bnpRShiftTo(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t){t.t=0;return}var r=e%this.DB;var i=this.DB-r;var s=(1<<r)-1;t[0]=this[n]>>r;for(var o=n+1;o<this.t;++o){t[o-n-1]|=(this[o]&s)<<i;t[o-n]=this[o]>>r}if(r>0)t[this.t-n-1]|=(this.s&s)<<i;t.t=this.t-n;t.clamp()}function bnpSubTo(e,t){var n=0,r=0,i=Math.min(e.t,this.t);while(n<i){r+=this[n]-e[n];t[n++]=r&this.DM;r>>=this.DB}if(e.t<this.t){r-=e.s;while(n<this.t){r+=this[n];t[n++]=r&this.DM;r>>=this.DB}r+=this.s}else{r+=this.s;while(n<e.t){r-=e[n];t[n++]=r&this.DM;r>>=this.DB}r-=e.s}t.s=r<0?-1:0;if(r<-1)t[n++]=this.DV+r;else if(r>0)t[n++]=r;t.t=n;t.clamp()}function bnpMultiplyTo(e,t){var n=this.abs(),r=e.abs();var i=n.t;t.t=i+r.t;while(--i>=0)t[i]=0;for(i=0;i<r.t;++i)t[i+n.t]=n.am(0,r[i],t,i,0,n.t);t.s=0;t.clamp();if(this.s!=e.s)BigInteger.ZERO.subTo(t,t)}function bnpSquareTo(e){var t=this.abs();var n=e.t=2*t.t;while(--n>=0)e[n]=0;for(n=0;n<t.t-1;++n){var r=t.am(n,t[n],e,2*n,0,1);if((e[n+t.t]+=t.am(n+1,2*t[n],e,2*n+1,r,t.t-n-1))>=t.DV){e[n+t.t]-=t.DV;e[n+t.t+1]=1}}if(e.t>0)e[e.t-1]+=t.am(n,t[n],e,2*n,0,1);e.s=0;e.clamp()}function bnpDivRemTo(e,t,n){var r=e.abs();if(r.t<=0)return;var i=this.abs();if(i.t<r.t){if(t!=null)t.fromInt(0);if(n!=null)this.copyTo(n);return}if(n==null)n=nbi();var s=nbi(),o=this.s,u=e.s;var a=this.DB-nbits(r[r.t-1]);if(a>0){r.lShiftTo(a,s);i.lShiftTo(a,n)}else{r.copyTo(s);i.copyTo(n)}var f=s.t;var l=s[f-1];if(l==0)return;var c=l*(1<<this.F1)+(f>1?s[f-2]>>this.F2:0);var h=this.FV/c,p=(1<<this.F1)/c,d=1<<this.F2;var v=n.t,m=v-f,g=t==null?nbi():t;s.dlShiftTo(m,g);if(n.compareTo(g)>=0){n[n.t++]=1;n.subTo(g,n)}BigInteger.ONE.dlShiftTo(f,g);g.subTo(s,s);while(s.t<f)s[s.t++]=0;while(--m>=0){var y=n[--v]==l?this.DM:Math.floor(n[v]*h+(n[v-1]+d)*p);if((n[v]+=s.am(0,y,n,m,0,f))<y){s.dlShiftTo(m,g);n.subTo(g,n);while(n[v]<--y)n.subTo(g,n)}}if(t!=null){n.drShiftTo(f,t);if(o!=u)BigInteger.ZERO.subTo(t,t)}n.t=f;n.clamp();if(a>0)n.rShiftTo(a,n);if(o<0)BigInteger.ZERO.subTo(n,n)}function bnMod(e){var t=nbi();this.abs().divRemTo(e,null,t);if(this.s<0&&t.compareTo(BigInteger.ZERO)>0)e.subTo(t,t);return t}function Classic(e){this.m=e}function cConvert(e){if(e.s<0||e.compareTo(this.m)>=0)return e.mod(this.m);else return e}function cRevert(e){return e}function cReduce(e){e.divRemTo(this.m,null,e)}function cMulTo(e,t,n){e.multiplyTo(t,n);this.reduce(n)}function cSqrTo(e,t){e.squareTo(t);this.reduce(t)}function bnpInvDigit(){if(this.t<1)return 0;var e=this[0];if((e&1)==0)return 0;var t=e&3;t=t*(2-(e&15)*t)&15;t=t*(2-(e&255)*t)&255;t=t*(2-((e&65535)*t&65535))&65535;t=t*(2-e*t%this.DV)%this.DV;return t>0?this.DV-t:-t}function Montgomery(e){this.m=e;this.mp=e.invDigit();this.mpl=this.mp&32767;this.mph=this.mp>>15;this.um=(1<<e.DB-15)-1;this.mt2=2*e.t}function montConvert(e){var t=nbi();e.abs().dlShiftTo(this.m.t,t);t.divRemTo(this.m,null,t);if(e.s<0&&t.compareTo(BigInteger.ZERO)>0)this.m.subTo(t,t);return t}function montRevert(e){var t=nbi();e.copyTo(t);this.reduce(t);return t}function montReduce(e){while(e.t<=this.mt2)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var n=e[t]&32767;var r=n*this.mpl+((n*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;n=t+this.m.t;e[n]+=this.m.am(0,r,e,t,0,this.m.t);while(e[n]>=e.DV){e[n]-=e.DV;e[++n]++}}e.clamp();e.drShiftTo(this.m.t,e);if(e.compareTo(this.m)>=0)e.subTo(this.m,e)}function montSqrTo(e,t){e.squareTo(t);this.reduce(t)}function montMulTo(e,t,n){e.multiplyTo(t,n);this.reduce(n)}function bnpIsEven(){return(this.t>0?this[0]&1:this.s)==0}function bnpExp(e,t){if(e>4294967295||e<1)return BigInteger.ONE;var n=nbi(),r=nbi(),i=t.convert(this),s=nbits(e)-1;i.copyTo(n);while(--s>=0){t.sqrTo(n,r);if((e&1<<s)>0)t.mulTo(r,i,n);else{var o=n;n=r;r=o}}return t.revert(n)}function bnModPowInt(e,t){var n;if(e<256||t.isEven())n=new Classic(t);else n=new Montgomery(t);return this.exp(e,n)}var dbits;var canary=0xdeadbeefcafe;var j_lm=(canary&16777215)==15715070;if(j_lm&&navigator.appName=="Microsoft Internet Explorer"){BigInteger.prototype.am=am2;dbits=30}else if(j_lm&&navigator.appName!="Netscape"){BigInteger.prototype.am=am1;dbits=26}else{BigInteger.prototype.am=am3;dbits=28}BigInteger.prototype.DB=dbits;BigInteger.prototype.DM=(1<<dbits)-1;BigInteger.prototype.DV=1<<dbits;var BI_FP=52;BigInteger.prototype.FV=Math.pow(2,BI_FP);BigInteger.prototype.F1=BI_FP-dbits;BigInteger.prototype.F2=2*dbits-BI_FP;var BI_RM="0123456789abcdefghijklmnopqrstuvwxyz";var BI_RC=new Array;var rr,vv;rr="0".charCodeAt(0);for(vv=0;vv<=9;++vv)BI_RC[rr++]=vv;rr="a".charCodeAt(0);for(vv=10;vv<36;++vv)BI_RC[rr++]=vv;rr="A".charCodeAt(0);for(vv=10;vv<36;++vv)BI_RC[rr++]=vv;Classic.prototype.convert=cConvert;Classic.prototype.revert=cRevert;Classic.prototype.reduce=cReduce;Classic.prototype.mulTo=cMulTo;Classic.prototype.sqrTo=cSqrTo;Montgomery.prototype.convert=montConvert;Montgomery.prototype.revert=montRevert;Montgomery.prototype.reduce=montReduce;Montgomery.prototype.mulTo=montMulTo;Montgomery.prototype.sqrTo=montSqrTo;BigInteger.prototype.copyTo=bnpCopyTo;BigInteger.prototype.fromInt=bnpFromInt;BigInteger.prototype.fromString=bnpFromString;BigInteger.prototype.clamp=bnpClamp;BigInteger.prototype.dlShiftTo=bnpDLShiftTo;BigInteger.prototype.drShiftTo=bnpDRShiftTo;BigInteger.prototype.lShiftTo=bnpLShiftTo;BigInteger.prototype.rShiftTo=bnpRShiftTo;BigInteger.prototype.subTo=bnpSubTo;BigInteger.prototype.multiplyTo=bnpMultiplyTo;BigInteger.prototype.squareTo=bnpSquareTo;BigInteger.prototype.divRemTo=bnpDivRemTo;BigInteger.prototype.invDigit=bnpInvDigit;BigInteger.prototype.isEven=bnpIsEven;BigInteger.prototype.exp=bnpExp;BigInteger.prototype.toString=bnToString;BigInteger.prototype.negate=bnNegate;BigInteger.prototype.abs=bnAbs;BigInteger.prototype.compareTo=bnCompareTo;BigInteger.prototype.bitLength=bnBitLength;BigInteger.prototype.mod=bnMod;BigInteger.prototype.modPowInt=bnModPowInt;BigInteger.ZERO=nbv(0);BigInteger.ONE=nbv(1)
98
-
99
  /* prng4.js */
100
  function Arcfour(){this.i=0;this.j=0;this.S=new Array}function ARC4init(e){var t,n,r;for(t=0;t<256;++t)this.S[t]=t;n=0;for(t=0;t<256;++t){n=n+this.S[t]+e[t%e.length]&255;r=this.S[t];this.S[t]=this.S[n];this.S[n]=r}this.i=0;this.j=0}function ARC4next(){var e;this.i=this.i+1&255;this.j=this.j+this.S[this.i]&255;e=this.S[this.i];this.S[this.i]=this.S[this.j];this.S[this.j]=e;return this.S[e+this.S[this.i]&255]}function prng_newstate(){return new Arcfour}Arcfour.prototype.init=ARC4init;Arcfour.prototype.next=ARC4next;var rng_psize=256
101
-
102
  /* rng.js */
103
  function rng_seed_int(e){rng_pool[rng_pptr++]^=e&255;rng_pool[rng_pptr++]^=e>>8&255;rng_pool[rng_pptr++]^=e>>16&255;rng_pool[rng_pptr++]^=e>>24&255;if(rng_pptr>=rng_psize)rng_pptr-=rng_psize}function rng_seed_time(){rng_seed_int((new Date).getTime())}function rng_get_byte(){if(rng_state==null){rng_seed_time();rng_state=prng_newstate();rng_state.init(rng_pool);for(rng_pptr=0;rng_pptr<rng_pool.length;++rng_pptr)rng_pool[rng_pptr]=0;rng_pptr=0}return rng_state.next()}function rng_get_bytes(e){var t;for(t=0;t<e.length;++t)e[t]=rng_get_byte()}function SecureRandom(){}var rng_state;var rng_pool;var rng_pptr;if(rng_pool==null){rng_pool=new Array;rng_pptr=0;var t;if(navigator.appName=="Netscape"&&navigator.appVersion<"5"&&window.crypto){var z=window.crypto.random(32);for(t=0;t<z.length;++t)rng_pool[rng_pptr++]=z.charCodeAt(t)&255}while(rng_pptr<rng_psize){t=Math.floor(65536*Math.random());rng_pool[rng_pptr++]=t>>>8;rng_pool[rng_pptr++]=t&255}rng_pptr=0;rng_seed_time()}SecureRandom.prototype.nextBytes=rng_get_bytes
104
 
@@ -106,24 +106,24 @@
106
  function parseBigInt(str,r){return new BigInteger(str,r)}function pkcs1pad2(b,n){if(n<b.length+11){alert("Message too long for RSA");return null}var ba=new Array();var i=b.length-1;while(i>=0&&n>0){ba[--n]=b[i--]}ba[--n]=0;var rng=new SecureRandom();var x=new Array();while(n>2){x[0]=0;while(x[0]==0){rng.nextBytes(x)}ba[--n]=x[0]}ba[--n]=2;ba[--n]=0;return new BigInteger(ba)}function RSAKey(){this.n=null;this.e=0;this.d=null;this.p=null;this.q=null;this.dmp1=null;this.dmq1=null;this.coeff=null}function RSASetPublic(N,E){if(N!=null&&E!=null&&N.length>0&&E.length>0){this.n=parseBigInt(N,16);this.e=parseInt(E,16)}else{alert("Invalid RSA public key")}}function RSADoPublic(x){return x.modPowInt(this.e,this.n)}function RSAEncrypt(bytes){var m=pkcs1pad2(bytes,(this.n.bitLength()+7)>>3);if(m==null){return null}var c=this.doPublic(m);if(c==null){return null}var h=c.toString(16);if((h.length&1)==0){return h}else{return"0"+h}}function RSAEncryptB64(bytes){var h=this.encrypt(bytes);if(h){return hex2b64(h)}else{return null}}RSAKey.prototype.doPublic=RSADoPublic;RSAKey.prototype.setPublic=RSASetPublic;RSAKey.prototype.encrypt=RSAEncrypt;RSAKey.prototype.encrypt_b64=RSAEncryptB64;
107
 
108
  /* sjcl.js */
109
-
110
  "use strict";var sjcl={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(a){this.toString=function(){return"CORRUPT: "+this.message};this.message=a},invalid:function(a){this.toString=function(){return"INVALID: "+this.message};this.message=a},bug:function(a){this.toString=function(){return"BUG: "+this.message};this.message=a},notReady:function(a){this.toString=function(){return"NOT READY: "+this.message};this.message=a}}};if(typeof module!="undefined"&&module.exports){module.exports=sjcl}sjcl.cipher.aes=function(a){this.g[0][0][0]||this.u();var b,c,d,e,f=this.g[0][4],g=this.g[1];b=a.length;var h=1;if(b!==4&&b!==6&&b!==8){throw new sjcl.exception.invalid("invalid aes key size")}this.a=[d=a.slice(0),e=[]];for(a=b;a<4*b+28;a++){c=d[a-1];if(a%b===0||b===8&&a%b===4){c=f[c>>>24]<<24^f[c>>16&255]<<16^f[c>>8&255]<<8^f[c&255];if(a%b===0){c=c<<8^c>>>24^h<<24;h=h<<1^(h>>7)*283}}d[a]=d[a-b]^c}for(b=0;a;b++,a--){c=d[b&3?a:a-4];e[b]=a<=4||b<4?c:g[0][f[c>>>24]]^g[1][f[c>>16&255]]^g[2][f[c>>8&255]]^g[3][f[c&255]]}};sjcl.cipher.aes.prototype={encrypt:function(a){return this.D(a,0)},decrypt:function(a){return this.D(a,1)},g:[[[],[],[],[],[]],[[],[],[],[],[]]],u:function(){var a=this.g[0],b=this.g[1],c=a[4],d=b[4],e,f,g,h=[],i=[],k,j,l,m;for(e=0;e<256;e++){i[(h[e]=e<<1^(e>>7)*283)^e]=e}for(f=g=0;!c[f];f^=k||1,g=i[g]||1){l=g^g<<1^g<<2^g<<3^g<<4;l=l>>8^l&255^99;c[f]=l;d[l]=f;j=h[e=h[k=h[f]]];m=j*16843009^e*65537^k*257^f*16843008;j=h[l]*257^l*16843008;for(e=0;e<4;e++){a[e][f]=j=j<<24^j>>>8;b[e][l]=m=m<<24^m>>>8}}for(e=0;e<5;e++){a[e]=a[e].slice(0);b[e]=b[e].slice(0)}},D:function(a,b){if(a.length!==4){throw new sjcl.exception.invalid("invalid aes block size")}var c=this.a[b],d=a[0]^c[0],e=a[b?3:1]^c[1],f=a[2]^c[2];a=a[b?1:3]^c[3];var g,h,i,k=c.length/4-2,j,l=4,m=[0,0,0,0];g=this.g[b];var n=g[0],o=g[1],p=g[2],q=g[3],r=g[4];for(j=0;j<k;j++){g=n[d>>>24]^o[e>>16&255]^p[f>>8&255]^q[a&255]^c[l];h=n[e>>>24]^o[f>>16&255]^p[a>>8&255]^q[d&255]^c[l+1];i=n[f>>>24]^o[a>>16&255]^p[d>>8&255]^q[e&255]^c[l+2];a=n[a>>>24]^o[d>>16&255]^p[e>>8&255]^q[f&255]^c[l+3];l+=4;d=g;e=h;f=i}for(j=0;j<4;j++){m[b?3&-j:j]=r[d>>>24]<<24^r[e>>16&255]<<16^r[f>>8&255]<<8^r[a&255]^c[l++];g=d;d=e;e=f;f=a;a=g}return m}};sjcl.bitArray={bitSlice:function(a,b,c){a=sjcl.bitArray.L(a.slice(b/32),32-(b&31)).slice(1);return c===undefined?a:sjcl.bitArray.clamp(a,c-b)},extract:function(a,b,c){var d=Math.floor(-b-c&31);return((b+c-1^b)&-32?a[b/32|0]<<32-d^a[b/32+1|0]>>>d:a[b/32|0]>>>d)&(1<<c)-1},concat:function(a,b){if(a.length===0||b.length===0){return a.concat(b)}var c=a[a.length-1],d=sjcl.bitArray.getPartial(c);return d===32?a.concat(b):sjcl.bitArray.L(b,d,c|0,a.slice(0,a.length-1))},bitLength:function(a){var b=a.length;if(b===0){return 0}return(b-1)*32+sjcl.bitArray.getPartial(a[b-1])},clamp:function(a,b){if(a.length*32<b){return a}a=a.slice(0,Math.ceil(b/32));var c=a.length;b&=31;if(c>0&&b){a[c-1]=sjcl.bitArray.partial(b,a[c-1]&2147483648>>b-1,1)}return a},partial:function(a,b,c){if(a===32){return b}return(c?b|0:b<<32-a)+a*1099511627776},getPartial:function(a){return Math.round(a/1099511627776)||32},equal:function(a,b){if(sjcl.bitArray.bitLength(a)!==sjcl.bitArray.bitLength(b)){return false}var c=0,d;for(d=0;d<a.length;d++){c|=a[d]^b[d]}return c===0},L:function(a,b,c,d){var e;e=0;if(d===undefined){d=[]}for(;b>=32;b-=32){d.push(c);c=0}if(b===0){return d.concat(a)}for(e=0;e<a.length;e++){d.push(c|a[e]>>>b);c=a[e]<<32-b}e=a.length?a[a.length-1]:0;a=sjcl.bitArray.getPartial(e);d.push(sjcl.bitArray.partial(b+a&31,b+a>32?c:d.pop(),1));return d},M:function(a,b){return[a[0]^b[0],a[1]^b[1],a[2]^b[2],a[3]^b[3]]}};sjcl.codec.utf8String={fromBits:function(a){var b="",c=sjcl.bitArray.bitLength(a),d,e;for(d=0;d<c/8;d++){if((d&3)===0){e=a[d/4]}b+=String.fromCharCode(e>>>24);e<<=8}return decodeURIComponent(escape(b))},toBits:function(a){a=unescape(encodeURIComponent(a));var b=[],c,d=0;for(c=0;c<a.length;c++){d=d<<8|a.charCodeAt(c);if((c&3)===3){b.push(d);d=0}}c&3&&b.push(sjcl.bitArray.partial(8*(c&3),d));return b}};sjcl.codec.base64={A:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fromBits:function(a,b,c){var d="",e=0,f=sjcl.codec.base64.A,g=0,h=sjcl.bitArray.bitLength(a);if(c){f=f.substr(0,62)+"-_"}for(c=0;d.length*6<h;){d+=f.charAt((g^a[c]>>>e)>>>26);if(e<6){g=a[c]<<6-e;e+=26;c++}else{g<<=6;e-=6}}for(;d.length&3&&!b;){d+="="}return d},toBits:function(a,b){a=a.replace(/\s|=/g,"");var c=[],d=0,e=sjcl.codec.base64.A,f=0,g;if(b){e=e.substr(0,62)+"-_"}for(b=0;b<a.length;b++){g=e.indexOf(a.charAt(b));if(g<0){throw new sjcl.exception.invalid("this isn't base64!")}if(d>26){d-=26;c.push(f^g>>>d);f=g<<32-d}else{d+=6;f^=g<<32-d}}d&56&&c.push(sjcl.bitArray.partial(d&56,f,1));return c}};sjcl.codec.base64url={fromBits:function(a){return sjcl.codec.base64.fromBits(a,1,1)},toBits:function(a){return sjcl.codec.base64.toBits(a,1)}};sjcl.codec.bytes={fromBits:function(a){var b=[],c=sjcl.bitArray.bitLength(a),d,e;for(d=0;d<c/8;d++){if((d&3)===0){e=a[d/4]}b.push(e>>>24);e<<=8}return b},toBits:function(a){var b=[],c,d=0;for(c=0;c<a.length;c++){d=d<<8|a[c];if((c&3)===3){b.push(d);d=0}}c&3&&b.push(sjcl.bitArray.partial(8*(c&3),d));return b}};sjcl.hash.sha256=function(a){this.a[0]||this.u();if(a){this.l=a.l.slice(0);this.h=a.h.slice(0);this.d=a.d}else{this.reset()}};sjcl.hash.sha256.hash=function(a){return(new sjcl.hash.sha256).update(a).finalize()};sjcl.hash.sha256.prototype={blockSize:512,reset:function(){this.l=this.J.slice(0);this.h=[];this.d=0;return this},update:function(a){if(typeof a==="string"){a=sjcl.codec.utf8String.toBits(a)}var b,c=this.h=sjcl.bitArray.concat(this.h,a);b=this.d;a=this.d=b+sjcl.bitArray.bitLength(a);for(b=512+b&-512;b<=a;b+=512){this.z(c.splice(0,16))}return this},finalize:function(){var a,b=this.h,c=this.l;b=sjcl.bitArray.concat(b,[sjcl.bitArray.partial(1,1)]);for(a=b.length+2;a&15;a++){b.push(0)}b.push(Math.floor(this.d/4294967296));for(b.push(this.d|0);b.length;){this.z(b.splice(0,16))}this.reset();return c},J:[],a:[],u:function(){function a(e){return(e-Math.floor(e))*4294967296|0}var b=0,c=2,d;a:for(;b<64;c++){for(d=2;d*d<=c;d++){if(c%d===0){continue a}}if(b<8){this.J[b]=a(Math.pow(c,0.5))}this.a[b]=a(Math.pow(c,1/3));b++}},z:function(a){var b,c,d=a.slice(0),e=this.l,f=this.a,g=e[0],h=e[1],i=e[2],k=e[3],j=e[4],l=e[5],m=e[6],n=e[7];for(a=0;a<64;a++){if(a<16){b=d[a]}else{b=d[a+1&15];c=d[a+14&15];b=d[a&15]=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(c>>>17^c>>>19^c>>>10^c<<15^c<<13)+d[a&15]+d[a+9&15]|0}b=b+n+(j>>>6^j>>>11^j>>>25^j<<26^j<<21^j<<7)+(m^j&(l^m))+f[a];n=m;m=l;l=j;j=k+b|0;k=i;i=h;h=g;g=b+(h&i^k&(h^i))+(h>>>2^h>>>13^h>>>22^h<<30^h<<19^h<<10)|0}e[0]=e[0]+g|0;e[1]=e[1]+h|0;e[2]=e[2]+i|0;e[3]=e[3]+k|0;e[4]=e[4]+j|0;e[5]=e[5]+l|0;e[6]=e[6]+m|0;e[7]=e[7]+n|0}};sjcl.mode.ccm={name:"ccm",encrypt:function(a,b,c,d,e){var f,g=b.slice(0),h=sjcl.bitArray,i=h.bitLength(c)/8,k=h.bitLength(g)/8;e=e||64;d=d||[];if(i<7){throw new sjcl.exception.invalid("ccm: iv must be at least 7 bytes")}for(f=2;f<4&&k>>>8*f;f++){}if(f<15-i){f=15-i}c=h.clamp(c,8*(15-f));b=sjcl.mode.ccm.C(a,b,c,d,e,f);g=sjcl.mode.ccm.F(a,g,c,b,e,f);return h.concat(g.data,g.tag)},decrypt:function(a,b,c,d,e){e=e||64;d=d||[];var f=sjcl.bitArray,g=f.bitLength(c)/8,h=f.bitLength(b),i=f.clamp(b,h-e),k=f.bitSlice(b,h-e);h=(h-e)/8;if(g<7){throw new sjcl.exception.invalid("ccm: iv must be at least 7 bytes")}for(b=2;b<4&&h>>>8*b;b++){}if(b<15-g){b=15-g}c=f.clamp(c,8*(15-b));i=sjcl.mode.ccm.F(a,i,c,k,e,b);a=sjcl.mode.ccm.C(a,i.data,c,d,e,b);if(!f.equal(i.tag,a)){throw new sjcl.exception.corrupt("ccm: tag doesn't match")}return i.data},C:function(a,b,c,d,e,f){var g=[],h=sjcl.bitArray,i=h.M;e/=8;if(e%2||e<4||e>16){throw new sjcl.exception.invalid("ccm: invalid tag length")}if(d.length>4294967295||b.length>4294967295){throw new sjcl.exception.bug("ccm: can't deal with 4GiB or more data")}f=[h.partial(8,(d.length?64:0)|e-2<<2|f-1)];f=h.concat(f,c);f[3]|=h.bitLength(b)/8;f=a.encrypt(f);if(d.length){c=h.bitLength(d)/8;if(c<=65279){g=[h.partial(16,c)]}else{if(c<=4294967295){g=h.concat([h.partial(16,65534)],[c])}}g=h.concat(g,d);for(d=0;d<g.length;d+=4){f=a.encrypt(i(f,g.slice(d,d+4).concat([0,0,0])))}}for(d=0;d<b.length;d+=4){f=a.encrypt(i(f,b.slice(d,d+4).concat([0,0,0])))}return h.clamp(f,e*8)},F:function(a,b,c,d,e,f){var g,h=sjcl.bitArray;g=h.M;var i=b.length,k=h.bitLength(b);c=h.concat([h.partial(8,f-1)],c).concat([0,0,0]).slice(0,4);d=h.bitSlice(g(d,a.encrypt(c)),0,e);if(!i){return{tag:d,data:[]}}for(g=0;g<i;g+=4){c[3]++;e=a.encrypt(c);b[g]^=e[0];b[g+1]^=e[1];b[g+2]^=e[2];b[g+3]^=e[3]}return{tag:d,data:h.clamp(b,k)}}};sjcl.misc.hmac=function(a,b){this.I=b=b||sjcl.hash.sha256;var c=[[],[]],d=b.prototype.blockSize/32;this.j=[new b,new b];if(a.length>d){a=b.hash(a)}for(b=0;b<d;b++){c[0][b]=a[b]^909522486;c[1][b]=a[b]^1549556828}this.j[0].update(c[0]);this.j[1].update(c[1])};sjcl.misc.hmac.prototype.encrypt=sjcl.misc.hmac.prototype.mac=function(a){a=(new this.I(this.j[0])).update(a).finalize();return(new this.I(this.j[1])).update(a).finalize()};sjcl.misc.pbkdf2=function(a,b,c,d,e){c=c||1000;if(d<0||c<0){throw sjcl.exception.invalid("invalid params to pbkdf2")}if(typeof a==="string"){a=sjcl.codec.utf8String.toBits(a)}e=e||sjcl.misc.hmac;a=new e(a);var f,g,h,i,k=[],j=sjcl.bitArray;for(i=1;32*k.length<(d||1);i++){e=f=a.encrypt(j.concat(b,[i]));for(g=1;g<c;g++){f=a.encrypt(f);for(h=0;h<f.length;h++){e[h]^=f[h]}}k=k.concat(e)}if(d){k=j.clamp(k,d)}return k};sjcl.random={randomWords:function(a,b){var c=[];b=this.isReady(b);var d;if(b===0){throw new sjcl.exception.notReady("generator isn't seeded")}else{b&2&&this.Q(!(b&1))}for(b=0;b<a;b+=4){(b+1)%65536===0&&this.H();d=this.t();c.push(d[0],d[1],d[2],d[3])}this.H();return c.slice(0,a)},setDefaultParanoia:function(a){this.r=a},addEntropy:function(a,b,c){c=c||"user";var d,e,f=(new Date).valueOf(),g=this.o[c],h=this.isReady(),i=0;d=this.B[c];if(d===undefined){d=this.B[c]=this.O++}if(g===undefined){g=this.o[c]=0}this.o[c]=(this.o[c]+1)%this.b.length;switch(typeof a){case"number":if(b===undefined){b=1}this.b[g].update([d,this.s++,1,b,f,1,a|0]);break;case"object":c=Object.prototype.toString.call(a);if(c==="[object Uint32Array]"){e=[];for(c=0;c<a.length;c++){e.push(a[c])}a=e}else{if(c!=="[object Array]"){i=1}for(c=0;c<a.length&&!i;c++){if(typeof a[c]!="number"){i=1}}}if(!i){if(b===undefined){for(c=b=0;c<a.length;c++){for(e=a[c];e>0;){b++;e>>>=1}}}this.b[g].update([d,this.s++,2,b,f,a.length].concat(a))}break;case"string":if(b===undefined){b=a.length}this.b[g].update([d,this.s++,3,b,f,a.length]);this.b[g].update(a);break;default:i=1}if(i){throw new sjcl.exception.bug("random: addEntropy only supports number, array of numbers or string")}this.i[g]+=b;this.e+=b;if(h===0){this.isReady()!==0&&this.G("seeded",Math.max(this.f,this.e));this.G("progress",this.getProgress())}},isReady:function(a){a=this.w[a!==undefined?a:this.r];return this.f&&this.f>=a?this.i[0]>80&&(new Date).valueOf()>this.K?3:1:this.e>=a?2:0},getProgress:function(a){a=this.w[a?a:this.r];return this.f>=a?1:this.e>a?1:this.e/a},startCollectors:function(){if(!this.k){if(window.addEventListener){window.addEventListener("load",this.m,false);window.addEventListener("mousemove",this.n,false)}else{if(document.attachEvent){document.attachEvent("onload",this.m);document.attachEvent("onmousemove",this.n)}else{throw new sjcl.exception.bug("can't attach event")}}this.k=true}},stopCollectors:function(){if(this.k){if(window.removeEventListener){window.removeEventListener("load",this.m,false);window.removeEventListener("mousemove",this.n,false)}else{if(window.detachEvent){window.detachEvent("onload",this.m);window.detachEvent("onmousemove",this.n)}}this.k=false}},addEventListener:function(a,b){this.p[a][this.N++]=b},removeEventListener:function(a,b){var c;a=this.p[a];var d=[];for(c in a){a.hasOwnProperty(c)&&a[c]===b&&d.push(c)}for(b=0;b<d.length;b++){c=d[b];delete a[c]}},b:[new sjcl.hash.sha256],i:[0],v:0,o:{},s:0,B:{},O:0,f:0,e:0,K:0,a:[0,0,0,0,0,0,0,0],c:[0,0,0,0],q:undefined,r:6,k:false,p:{progress:{},seeded:{}},N:0,w:[0,48,64,96,128,192,256,384,512,768,1024],t:function(){for(var a=0;a<4;a++){this.c[a]=this.c[a]+1|0;if(this.c[a]){break}}return this.q.encrypt(this.c)},H:function(){this.a=this.t().concat(this.t());this.q=new sjcl.cipher.aes(this.a)},P:function(a){this.a=sjcl.hash.sha256.hash(this.a.concat(a));this.q=new sjcl.cipher.aes(this.a);for(a=0;a<4;a++){this.c[a]=this.c[a]+1|0;if(this.c[a]){break}}},Q:function(a){var b=[],c=0,d;this.K=b[0]=(new Date).valueOf()+30000;for(d=0;d<16;d++){b.push(Math.random()*4294967296|0)}for(d=0;d<this.b.length;d++){b=b.concat(this.b[d].finalize());c+=this.i[d];this.i[d]=0;if(!a&&this.v&1<<d){break}}if(this.v>=1<<this.b.length){this.b.push(new sjcl.hash.sha256);this.i.push(0)}this.e-=c;if(c>this.f){this.f=c}this.v++;this.P(b)},n:function(a){sjcl.random.addEntropy([a.x||a.clientX||a.offsetX||0,a.y||a.clientY||a.offsetY||0],2,"mouse")},m:function(){sjcl.random.addEntropy((new Date).valueOf(),2,"loadtime")},G:function(a,b){var c;a=sjcl.random.p[a];var d=[];for(c in a){a.hasOwnProperty(c)&&d.push(a[c])}for(c=0;c<d.length;c++){d[c](b)}}};try{var s=new Uint32Array(32);crypto.getRandomValues(s);sjcl.random.addEntropy(s,1024,"crypto['getRandomValues']")}catch(t){};
111
 
112
  /* adyen */
113
  var adyen = window.adyen = window.adyen || {};
114
-
115
  var encrypt = adyen.encrypt = adyen.encrypt || {
116
  createEncryptedForm: function( form, key, name ) {
117
  return new EncryptedForm( form, key, name );
118
  }
119
  };
120
-
121
  encrypt.version = '0_1_1';
122
-
123
 
124
  /*
125
  *
126
- *
127
  *
128
  * @constructor EncryptedForm
129
  *
@@ -148,6 +148,7 @@
148
  this.force = options.force || false;
149
  this.id = options.id || this.name;
150
  this.onsubmit = options.onsubmit || function() {};
 
151
 
152
  if ( this.force !== false ) {
153
  this.createEncryptedField( this.encrypt() );
@@ -158,36 +159,36 @@
158
  this.element.attachEvent( 'onsubmit', this.handleSubmit.bind( this ) );
159
  }
160
  }
161
-
162
  };
163
 
164
  EncryptedForm.prototype = {
165
 
166
  constructor: EncryptedForm,
167
-
168
  /*
169
  *
170
  * Handles a submit of the form.
171
  * It creates a hidden input with the form data as serialized, encrypted JSON.
172
  *
173
  * @param e {Event} The submit event to handle.
174
- *
175
  */
176
-
177
  handleSubmit: function( e ) {
178
  this.createEncryptedField( this.encrypt() );
179
  this.onsubmit(e);
180
  },
181
-
182
  /*
183
  * Creates an RSA key based on the public key.
184
  *
185
  * @returns rsa {RSAKey} An RSAKey based on the public key provided.
186
  *
187
  */
188
-
189
  createRSAKey: function() {
190
-
191
  var k = this.key.split('|');
192
 
193
  if ( k.length != 2 ) {
@@ -202,21 +203,21 @@
202
  rsa.setPublic( mod, exp );
203
 
204
  return rsa;
205
-
206
  },
207
-
208
  /*
209
  * Creates an AES key.
210
  *
211
  * @returns aes {Object} An AESKey with encryption methods.
212
  *
213
  */
214
-
215
  createAESKey: function() {
216
  return new AESKey();
217
  },
218
-
219
- /*
220
  * Gets all encrypted fields from a root node ( usually the form element ).
221
  *
222
  * @param node {DOMNode} The root of the form to get encrypted fields from ( i.e. querySelectorAll( '[data-encrypeted-name]' ) ).
@@ -229,8 +230,8 @@
229
  getEncryptedFields: function( node, fields ) {
230
 
231
  if ( node.querySelectorAll ) {
232
- return node.querySelectorAll( '[data-encrypted-name]' );
233
- }
234
 
235
  fields = fields || [];
236
 
@@ -240,7 +241,7 @@
240
  for ( var i = 0; i < children.length; i++ ) {
241
  child = children[i];
242
 
243
- if ( child.hasAttribute('data-encrypted-name') ) {
244
  fields.push( child )
245
  } else {
246
  this.getEncryptedFields( child, fields );
@@ -251,7 +252,7 @@
251
  return fields;
252
 
253
  },
254
-
255
  /*
256
  * Creates JSON object
257
  *
@@ -269,21 +270,18 @@
269
  var key, value;
270
 
271
  for ( var i = fields.length - 1; i >= 0; i-- ) {
272
-
273
  field = fields[i];
274
-
275
  field.removeAttribute('name');
276
- key = field.getAttribute( 'data-encrypted-name' );
277
  value = field.value;
278
-
279
  data[ key ] = value;
280
-
281
  };
282
-
283
  return data;
284
 
285
  },
286
-
287
  /*
288
  * Encrypts data
289
  *
@@ -292,23 +290,23 @@
292
  */
293
 
294
  encrypt: function() {
295
-
296
  var data = this.toJSON( this.getEncryptedFields( this.element ) );
297
-
298
  var rsa, aes, cipher, encoded, encrypted, prefix;
299
 
300
  rsa = this.createRSAKey();
301
  aes = this.createAESKey();
302
-
303
  cipher = aes.encrypt( JSON.stringify( data ) );
304
  keybytes = sjcl.codec.bytes.fromBits( aes.key );
305
  encrypted = rsa.encrypt_b64( keybytes );
306
  prefix = 'adyenjs_' + encrypt.version + '$';
307
-
308
  return [ prefix, encrypted, '$', cipher ].join('');
309
-
310
  },
311
-
312
  /*
313
  *
314
  * Creates an encrypted field.
@@ -316,11 +314,11 @@
316
  * @param data {String} The data in the form as encrypted and serialized JSON.
317
  *
318
  */
319
-
320
  createEncryptedField: function( data ) {
321
-
322
  var element = document.getElementById( this.name );
323
-
324
  if ( !element ) {
325
  element = document.createElement( 'input' );
326
  element.type = 'hidden';
@@ -328,14 +326,12 @@
328
  element.id = this.id;
329
  this.element.appendChild( element );
330
  }
331
-
332
  element.setAttribute( 'value', data );
333
-
334
  }
335
 
336
  };
337
-
338
-
339
  /*
340
  *
341
  * @constructor AESKey
@@ -343,15 +339,15 @@
343
  * @return aes {AESKey} An AESKey with encryption methods.
344
  *
345
  */
346
-
347
  var AESKey = function() {
348
  // empty constructor
349
  };
350
-
351
  AESKey.prototype = {
352
-
353
  constructor: AESKey,
354
-
355
  key: sjcl.random.randomWords( 8, 0 ),
356
 
357
  encrypt: function ( text ) {
@@ -372,7 +368,7 @@
372
  return sjcl.codec.base64.fromBits( cipherIV );
373
 
374
  }
375
-
376
  };
377
 
378
  })();
2
  *
3
  * Client Encryption of Forms.
4
  *
5
+ * Includes:
6
  * * RSA and ECC in JavaScript | http://www-cs-students.stanford.edu/~tjw/jsbn/
7
  * * Stanford Javascript Crypto Library | http://crypto.stanford.edu/sjcl/
8
  * * JSON in JavaScript | http://www.JSON.org/
9
+ *
10
+ * Version: 0_1_1
11
  * Author: ADYEN (c) 2013
12
 
13
  <!DOCTYPE html>
40
 
41
  <div class="field">
42
  <label for="adyen-encrypted-form-expiry-month">Expiration Month (MM)
43
+ <input type="text" value="06" id="adyen-encrypted-form-expiry-month" size="2" autocomplete="off" data-encrypted-name="expiryMonth" /> /
44
  </label>
45
  <label for="adyen-encrypted-form-expiry-year">Expiration Year (YYYY)
46
  <input type="text" value="2016" id="adyen-encrypted-form-expiry-year" size="4" autocomplete="off" data-encrypted-name="expiryYear" />
59
  <script>
60
  // generate time client side for testing... Don't deploy on a real integration!!!
61
  document.getElementById('adyen-encrypted-form-expiry-generationtime').value = new Date().toISOString();
62
+
63
  // the form element to encrypt
64
  var form = document.getElementById('adyen-encrypted-form');
65
+
66
  // the public key
67
  var key = "10001|80C7821C961865FB4AD23F172E220F819A5CC7B9956BC3458E2788"
68
  + "F9D725B07536E297B89243081916AAF29E26B7624453FC84CB10FC7DF386"
72
  + "ECFC59B90B928F31715A7034E7B674E221F1EB1D696CC8B734DF7DE2E309"
73
  + "E6E8CF94156686558522629E8AF59620CBDE58327E9D84F29965E4CD0FAF"
74
  + "A38C632B244287EA1F7F70DAA445D81C216D3286B09205F6650262CAB415"
75
+ + "5F024B3294A933F4DC514DE0B5686F6C2A6A2D";
76
+
77
+ var options = {};
78
+
79
  // the form will be encrypted before it is submitted
80
  adyen.encrypt.createEncryptedForm( form, key, options);
81
  </script>
86
  */
87
 
88
  (function() {
89
+
90
  /* json2.js */
91
  if(typeof JSON!=="object"){JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){if(typeof rep[i]==="string"){k=rep[i];v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());
92
 
93
  /* base64.js */
94
  function hex2b64(e){var t;var n;var r="";for(t=0;t+3<=e.length;t+=3){n=parseInt(e.substring(t,t+3),16);r+=b64map.charAt(n>>6)+b64map.charAt(n&63)}if(t+1==e.length){n=parseInt(e.substring(t,t+1),16);r+=b64map.charAt(n<<2)}else if(t+2==e.length){n=parseInt(e.substring(t,t+2),16);r+=b64map.charAt(n>>2)+b64map.charAt((n&3)<<4)}while((r.length&3)>0)r+=b64pad;return r}function b64tohex(e){var t="";var n;var r=0;var i;for(n=0;n<e.length;++n){if(e.charAt(n)==b64pad)break;v=b64map.indexOf(e.charAt(n));if(v<0)continue;if(r==0){t+=int2char(v>>2);i=v&3;r=1}else if(r==1){t+=int2char(i<<2|v>>4);i=v&15;r=2}else if(r==2){t+=int2char(i);t+=int2char(v>>2);i=v&3;r=3}else{t+=int2char(i<<2|v>>4);t+=int2char(v&15);r=0}}if(r==1)t+=int2char(i<<2);return t}function b64toBA(e){var t=b64tohex(e);var n;var r=new Array;for(n=0;2*n<t.length;++n){r[n]=parseInt(t.substring(2*n,2*n+2),16)}return r}var b64map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var b64pad="="
95
+
96
  /* jsbn.js */
97
  function BigInteger(e,t,n){if(e!=null)if("number"==typeof e)this.fromNumber(e,t,n);else if(t==null&&"string"!=typeof e)this.fromString(e,256);else this.fromString(e,t)}function nbi(){return new BigInteger(null)}function am1(e,t,n,r,i,s){while(--s>=0){var o=t*this[e++]+n[r]+i;i=Math.floor(o/67108864);n[r++]=o&67108863}return i}function am2(e,t,n,r,i,s){var o=t&32767,u=t>>15;while(--s>=0){var a=this[e]&32767;var f=this[e++]>>15;var l=u*a+f*o;a=o*a+((l&32767)<<15)+n[r]+(i&1073741823);i=(a>>>30)+(l>>>15)+u*f+(i>>>30);n[r++]=a&1073741823}return i}function am3(e,t,n,r,i,s){var o=t&16383,u=t>>14;while(--s>=0){var a=this[e]&16383;var f=this[e++]>>14;var l=u*a+f*o;a=o*a+((l&16383)<<14)+n[r]+i;i=(a>>28)+(l>>14)+u*f;n[r++]=a&268435455}return i}function int2char(e){return BI_RM.charAt(e)}function intAt(e,t){var n=BI_RC[e.charCodeAt(t)];return n==null?-1:n}function bnpCopyTo(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t;e.s=this.s}function bnpFromInt(e){this.t=1;this.s=e<0?-1:0;if(e>0)this[0]=e;else if(e<-1)this[0]=e+DV;else this.t=0}function nbv(e){var t=nbi();t.fromInt(e);return t}function bnpFromString(e,t){var n;if(t==16)n=4;else if(t==8)n=3;else if(t==256)n=8;else if(t==2)n=1;else if(t==32)n=5;else if(t==4)n=2;else{this.fromRadix(e,t);return}this.t=0;this.s=0;var r=e.length,i=false,s=0;while(--r>=0){var o=n==8?e[r]&255:intAt(e,r);if(o<0){if(e.charAt(r)=="-")i=true;continue}i=false;if(s==0)this[this.t++]=o;else if(s+n>this.DB){this[this.t-1]|=(o&(1<<this.DB-s)-1)<<s;this[this.t++]=o>>this.DB-s}else this[this.t-1]|=o<<s;s+=n;if(s>=this.DB)s-=this.DB}if(n==8&&(e[0]&128)!=0){this.s=-1;if(s>0)this[this.t-1]|=(1<<this.DB-s)-1<<s}this.clamp();if(i)BigInteger.ZERO.subTo(this,this)}function bnpClamp(){var e=this.s&this.DM;while(this.t>0&&this[this.t-1]==e)--this.t}function bnToString(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(e==16)t=4;else if(e==8)t=3;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else return this.toRadix(e);var n=(1<<t)-1,r,i=false,s="",o=this.t;var u=this.DB-o*this.DB%t;if(o-->0){if(u<this.DB&&(r=this[o]>>u)>0){i=true;s=int2char(r)}while(o>=0){if(u<t){r=(this[o]&(1<<u)-1)<<t-u;r|=this[--o]>>(u+=this.DB-t)}else{r=this[o]>>(u-=t)&n;if(u<=0){u+=this.DB;--o}}if(r>0)i=true;if(i)s+=int2char(r)}}return i?s:"0"}function bnNegate(){var e=nbi();BigInteger.ZERO.subTo(this,e);return e}function bnAbs(){return this.s<0?this.negate():this}function bnCompareTo(e){var t=this.s-e.s;if(t!=0)return t;var n=this.t;t=n-e.t;if(t!=0)return this.s<0?-t:t;while(--n>=0)if((t=this[n]-e[n])!=0)return t;return 0}function nbits(e){var t=1,n;if((n=e>>>16)!=0){e=n;t+=16}if((n=e>>8)!=0){e=n;t+=8}if((n=e>>4)!=0){e=n;t+=4}if((n=e>>2)!=0){e=n;t+=2}if((n=e>>1)!=0){e=n;t+=1}return t}function bnBitLength(){if(this.t<=0)return 0;return this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)}function bnpDLShiftTo(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e;t.s=this.s}function bnpDRShiftTo(e,t){for(var n=e;n<this.t;++n)t[n-e]=this[n];t.t=Math.max(this.t-e,0);t.s=this.s}function bnpLShiftTo(e,t){var n=e%this.DB;var r=this.DB-n;var i=(1<<r)-1;var s=Math.floor(e/this.DB),o=this.s<<n&this.DM,u;for(u=this.t-1;u>=0;--u){t[u+s+1]=this[u]>>r|o;o=(this[u]&i)<<n}for(u=s-1;u>=0;--u)t[u]=0;t[s]=o;t.t=this.t+s+1;t.s=this.s;t.clamp()}function bnpRShiftTo(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t){t.t=0;return}var r=e%this.DB;var i=this.DB-r;var s=(1<<r)-1;t[0]=this[n]>>r;for(var o=n+1;o<this.t;++o){t[o-n-1]|=(this[o]&s)<<i;t[o-n]=this[o]>>r}if(r>0)t[this.t-n-1]|=(this.s&s)<<i;t.t=this.t-n;t.clamp()}function bnpSubTo(e,t){var n=0,r=0,i=Math.min(e.t,this.t);while(n<i){r+=this[n]-e[n];t[n++]=r&this.DM;r>>=this.DB}if(e.t<this.t){r-=e.s;while(n<this.t){r+=this[n];t[n++]=r&this.DM;r>>=this.DB}r+=this.s}else{r+=this.s;while(n<e.t){r-=e[n];t[n++]=r&this.DM;r>>=this.DB}r-=e.s}t.s=r<0?-1:0;if(r<-1)t[n++]=this.DV+r;else if(r>0)t[n++]=r;t.t=n;t.clamp()}function bnpMultiplyTo(e,t){var n=this.abs(),r=e.abs();var i=n.t;t.t=i+r.t;while(--i>=0)t[i]=0;for(i=0;i<r.t;++i)t[i+n.t]=n.am(0,r[i],t,i,0,n.t);t.s=0;t.clamp();if(this.s!=e.s)BigInteger.ZERO.subTo(t,t)}function bnpSquareTo(e){var t=this.abs();var n=e.t=2*t.t;while(--n>=0)e[n]=0;for(n=0;n<t.t-1;++n){var r=t.am(n,t[n],e,2*n,0,1);if((e[n+t.t]+=t.am(n+1,2*t[n],e,2*n+1,r,t.t-n-1))>=t.DV){e[n+t.t]-=t.DV;e[n+t.t+1]=1}}if(e.t>0)e[e.t-1]+=t.am(n,t[n],e,2*n,0,1);e.s=0;e.clamp()}function bnpDivRemTo(e,t,n){var r=e.abs();if(r.t<=0)return;var i=this.abs();if(i.t<r.t){if(t!=null)t.fromInt(0);if(n!=null)this.copyTo(n);return}if(n==null)n=nbi();var s=nbi(),o=this.s,u=e.s;var a=this.DB-nbits(r[r.t-1]);if(a>0){r.lShiftTo(a,s);i.lShiftTo(a,n)}else{r.copyTo(s);i.copyTo(n)}var f=s.t;var l=s[f-1];if(l==0)return;var c=l*(1<<this.F1)+(f>1?s[f-2]>>this.F2:0);var h=this.FV/c,p=(1<<this.F1)/c,d=1<<this.F2;var v=n.t,m=v-f,g=t==null?nbi():t;s.dlShiftTo(m,g);if(n.compareTo(g)>=0){n[n.t++]=1;n.subTo(g,n)}BigInteger.ONE.dlShiftTo(f,g);g.subTo(s,s);while(s.t<f)s[s.t++]=0;while(--m>=0){var y=n[--v]==l?this.DM:Math.floor(n[v]*h+(n[v-1]+d)*p);if((n[v]+=s.am(0,y,n,m,0,f))<y){s.dlShiftTo(m,g);n.subTo(g,n);while(n[v]<--y)n.subTo(g,n)}}if(t!=null){n.drShiftTo(f,t);if(o!=u)BigInteger.ZERO.subTo(t,t)}n.t=f;n.clamp();if(a>0)n.rShiftTo(a,n);if(o<0)BigInteger.ZERO.subTo(n,n)}function bnMod(e){var t=nbi();this.abs().divRemTo(e,null,t);if(this.s<0&&t.compareTo(BigInteger.ZERO)>0)e.subTo(t,t);return t}function Classic(e){this.m=e}function cConvert(e){if(e.s<0||e.compareTo(this.m)>=0)return e.mod(this.m);else return e}function cRevert(e){return e}function cReduce(e){e.divRemTo(this.m,null,e)}function cMulTo(e,t,n){e.multiplyTo(t,n);this.reduce(n)}function cSqrTo(e,t){e.squareTo(t);this.reduce(t)}function bnpInvDigit(){if(this.t<1)return 0;var e=this[0];if((e&1)==0)return 0;var t=e&3;t=t*(2-(e&15)*t)&15;t=t*(2-(e&255)*t)&255;t=t*(2-((e&65535)*t&65535))&65535;t=t*(2-e*t%this.DV)%this.DV;return t>0?this.DV-t:-t}function Montgomery(e){this.m=e;this.mp=e.invDigit();this.mpl=this.mp&32767;this.mph=this.mp>>15;this.um=(1<<e.DB-15)-1;this.mt2=2*e.t}function montConvert(e){var t=nbi();e.abs().dlShiftTo(this.m.t,t);t.divRemTo(this.m,null,t);if(e.s<0&&t.compareTo(BigInteger.ZERO)>0)this.m.subTo(t,t);return t}function montRevert(e){var t=nbi();e.copyTo(t);this.reduce(t);return t}function montReduce(e){while(e.t<=this.mt2)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var n=e[t]&32767;var r=n*this.mpl+((n*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;n=t+this.m.t;e[n]+=this.m.am(0,r,e,t,0,this.m.t);while(e[n]>=e.DV){e[n]-=e.DV;e[++n]++}}e.clamp();e.drShiftTo(this.m.t,e);if(e.compareTo(this.m)>=0)e.subTo(this.m,e)}function montSqrTo(e,t){e.squareTo(t);this.reduce(t)}function montMulTo(e,t,n){e.multiplyTo(t,n);this.reduce(n)}function bnpIsEven(){return(this.t>0?this[0]&1:this.s)==0}function bnpExp(e,t){if(e>4294967295||e<1)return BigInteger.ONE;var n=nbi(),r=nbi(),i=t.convert(this),s=nbits(e)-1;i.copyTo(n);while(--s>=0){t.sqrTo(n,r);if((e&1<<s)>0)t.mulTo(r,i,n);else{var o=n;n=r;r=o}}return t.revert(n)}function bnModPowInt(e,t){var n;if(e<256||t.isEven())n=new Classic(t);else n=new Montgomery(t);return this.exp(e,n)}var dbits;var canary=0xdeadbeefcafe;var j_lm=(canary&16777215)==15715070;if(j_lm&&navigator.appName=="Microsoft Internet Explorer"){BigInteger.prototype.am=am2;dbits=30}else if(j_lm&&navigator.appName!="Netscape"){BigInteger.prototype.am=am1;dbits=26}else{BigInteger.prototype.am=am3;dbits=28}BigInteger.prototype.DB=dbits;BigInteger.prototype.DM=(1<<dbits)-1;BigInteger.prototype.DV=1<<dbits;var BI_FP=52;BigInteger.prototype.FV=Math.pow(2,BI_FP);BigInteger.prototype.F1=BI_FP-dbits;BigInteger.prototype.F2=2*dbits-BI_FP;var BI_RM="0123456789abcdefghijklmnopqrstuvwxyz";var BI_RC=new Array;var rr,vv;rr="0".charCodeAt(0);for(vv=0;vv<=9;++vv)BI_RC[rr++]=vv;rr="a".charCodeAt(0);for(vv=10;vv<36;++vv)BI_RC[rr++]=vv;rr="A".charCodeAt(0);for(vv=10;vv<36;++vv)BI_RC[rr++]=vv;Classic.prototype.convert=cConvert;Classic.prototype.revert=cRevert;Classic.prototype.reduce=cReduce;Classic.prototype.mulTo=cMulTo;Classic.prototype.sqrTo=cSqrTo;Montgomery.prototype.convert=montConvert;Montgomery.prototype.revert=montRevert;Montgomery.prototype.reduce=montReduce;Montgomery.prototype.mulTo=montMulTo;Montgomery.prototype.sqrTo=montSqrTo;BigInteger.prototype.copyTo=bnpCopyTo;BigInteger.prototype.fromInt=bnpFromInt;BigInteger.prototype.fromString=bnpFromString;BigInteger.prototype.clamp=bnpClamp;BigInteger.prototype.dlShiftTo=bnpDLShiftTo;BigInteger.prototype.drShiftTo=bnpDRShiftTo;BigInteger.prototype.lShiftTo=bnpLShiftTo;BigInteger.prototype.rShiftTo=bnpRShiftTo;BigInteger.prototype.subTo=bnpSubTo;BigInteger.prototype.multiplyTo=bnpMultiplyTo;BigInteger.prototype.squareTo=bnpSquareTo;BigInteger.prototype.divRemTo=bnpDivRemTo;BigInteger.prototype.invDigit=bnpInvDigit;BigInteger.prototype.isEven=bnpIsEven;BigInteger.prototype.exp=bnpExp;BigInteger.prototype.toString=bnToString;BigInteger.prototype.negate=bnNegate;BigInteger.prototype.abs=bnAbs;BigInteger.prototype.compareTo=bnCompareTo;BigInteger.prototype.bitLength=bnBitLength;BigInteger.prototype.mod=bnMod;BigInteger.prototype.modPowInt=bnModPowInt;BigInteger.ZERO=nbv(0);BigInteger.ONE=nbv(1)
98
+
99
  /* prng4.js */
100
  function Arcfour(){this.i=0;this.j=0;this.S=new Array}function ARC4init(e){var t,n,r;for(t=0;t<256;++t)this.S[t]=t;n=0;for(t=0;t<256;++t){n=n+this.S[t]+e[t%e.length]&255;r=this.S[t];this.S[t]=this.S[n];this.S[n]=r}this.i=0;this.j=0}function ARC4next(){var e;this.i=this.i+1&255;this.j=this.j+this.S[this.i]&255;e=this.S[this.i];this.S[this.i]=this.S[this.j];this.S[this.j]=e;return this.S[e+this.S[this.i]&255]}function prng_newstate(){return new Arcfour}Arcfour.prototype.init=ARC4init;Arcfour.prototype.next=ARC4next;var rng_psize=256
101
+
102
  /* rng.js */
103
  function rng_seed_int(e){rng_pool[rng_pptr++]^=e&255;rng_pool[rng_pptr++]^=e>>8&255;rng_pool[rng_pptr++]^=e>>16&255;rng_pool[rng_pptr++]^=e>>24&255;if(rng_pptr>=rng_psize)rng_pptr-=rng_psize}function rng_seed_time(){rng_seed_int((new Date).getTime())}function rng_get_byte(){if(rng_state==null){rng_seed_time();rng_state=prng_newstate();rng_state.init(rng_pool);for(rng_pptr=0;rng_pptr<rng_pool.length;++rng_pptr)rng_pool[rng_pptr]=0;rng_pptr=0}return rng_state.next()}function rng_get_bytes(e){var t;for(t=0;t<e.length;++t)e[t]=rng_get_byte()}function SecureRandom(){}var rng_state;var rng_pool;var rng_pptr;if(rng_pool==null){rng_pool=new Array;rng_pptr=0;var t;if(navigator.appName=="Netscape"&&navigator.appVersion<"5"&&window.crypto){var z=window.crypto.random(32);for(t=0;t<z.length;++t)rng_pool[rng_pptr++]=z.charCodeAt(t)&255}while(rng_pptr<rng_psize){t=Math.floor(65536*Math.random());rng_pool[rng_pptr++]=t>>>8;rng_pool[rng_pptr++]=t&255}rng_pptr=0;rng_seed_time()}SecureRandom.prototype.nextBytes=rng_get_bytes
104
 
106
  function parseBigInt(str,r){return new BigInteger(str,r)}function pkcs1pad2(b,n){if(n<b.length+11){alert("Message too long for RSA");return null}var ba=new Array();var i=b.length-1;while(i>=0&&n>0){ba[--n]=b[i--]}ba[--n]=0;var rng=new SecureRandom();var x=new Array();while(n>2){x[0]=0;while(x[0]==0){rng.nextBytes(x)}ba[--n]=x[0]}ba[--n]=2;ba[--n]=0;return new BigInteger(ba)}function RSAKey(){this.n=null;this.e=0;this.d=null;this.p=null;this.q=null;this.dmp1=null;this.dmq1=null;this.coeff=null}function RSASetPublic(N,E){if(N!=null&&E!=null&&N.length>0&&E.length>0){this.n=parseBigInt(N,16);this.e=parseInt(E,16)}else{alert("Invalid RSA public key")}}function RSADoPublic(x){return x.modPowInt(this.e,this.n)}function RSAEncrypt(bytes){var m=pkcs1pad2(bytes,(this.n.bitLength()+7)>>3);if(m==null){return null}var c=this.doPublic(m);if(c==null){return null}var h=c.toString(16);if((h.length&1)==0){return h}else{return"0"+h}}function RSAEncryptB64(bytes){var h=this.encrypt(bytes);if(h){return hex2b64(h)}else{return null}}RSAKey.prototype.doPublic=RSADoPublic;RSAKey.prototype.setPublic=RSASetPublic;RSAKey.prototype.encrypt=RSAEncrypt;RSAKey.prototype.encrypt_b64=RSAEncryptB64;
107
 
108
  /* sjcl.js */
109
+
110
  "use strict";var sjcl={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(a){this.toString=function(){return"CORRUPT: "+this.message};this.message=a},invalid:function(a){this.toString=function(){return"INVALID: "+this.message};this.message=a},bug:function(a){this.toString=function(){return"BUG: "+this.message};this.message=a},notReady:function(a){this.toString=function(){return"NOT READY: "+this.message};this.message=a}}};if(typeof module!="undefined"&&module.exports){module.exports=sjcl}sjcl.cipher.aes=function(a){this.g[0][0][0]||this.u();var b,c,d,e,f=this.g[0][4],g=this.g[1];b=a.length;var h=1;if(b!==4&&b!==6&&b!==8){throw new sjcl.exception.invalid("invalid aes key size")}this.a=[d=a.slice(0),e=[]];for(a=b;a<4*b+28;a++){c=d[a-1];if(a%b===0||b===8&&a%b===4){c=f[c>>>24]<<24^f[c>>16&255]<<16^f[c>>8&255]<<8^f[c&255];if(a%b===0){c=c<<8^c>>>24^h<<24;h=h<<1^(h>>7)*283}}d[a]=d[a-b]^c}for(b=0;a;b++,a--){c=d[b&3?a:a-4];e[b]=a<=4||b<4?c:g[0][f[c>>>24]]^g[1][f[c>>16&255]]^g[2][f[c>>8&255]]^g[3][f[c&255]]}};sjcl.cipher.aes.prototype={encrypt:function(a){return this.D(a,0)},decrypt:function(a){return this.D(a,1)},g:[[[],[],[],[],[]],[[],[],[],[],[]]],u:function(){var a=this.g[0],b=this.g[1],c=a[4],d=b[4],e,f,g,h=[],i=[],k,j,l,m;for(e=0;e<256;e++){i[(h[e]=e<<1^(e>>7)*283)^e]=e}for(f=g=0;!c[f];f^=k||1,g=i[g]||1){l=g^g<<1^g<<2^g<<3^g<<4;l=l>>8^l&255^99;c[f]=l;d[l]=f;j=h[e=h[k=h[f]]];m=j*16843009^e*65537^k*257^f*16843008;j=h[l]*257^l*16843008;for(e=0;e<4;e++){a[e][f]=j=j<<24^j>>>8;b[e][l]=m=m<<24^m>>>8}}for(e=0;e<5;e++){a[e]=a[e].slice(0);b[e]=b[e].slice(0)}},D:function(a,b){if(a.length!==4){throw new sjcl.exception.invalid("invalid aes block size")}var c=this.a[b],d=a[0]^c[0],e=a[b?3:1]^c[1],f=a[2]^c[2];a=a[b?1:3]^c[3];var g,h,i,k=c.length/4-2,j,l=4,m=[0,0,0,0];g=this.g[b];var n=g[0],o=g[1],p=g[2],q=g[3],r=g[4];for(j=0;j<k;j++){g=n[d>>>24]^o[e>>16&255]^p[f>>8&255]^q[a&255]^c[l];h=n[e>>>24]^o[f>>16&255]^p[a>>8&255]^q[d&255]^c[l+1];i=n[f>>>24]^o[a>>16&255]^p[d>>8&255]^q[e&255]^c[l+2];a=n[a>>>24]^o[d>>16&255]^p[e>>8&255]^q[f&255]^c[l+3];l+=4;d=g;e=h;f=i}for(j=0;j<4;j++){m[b?3&-j:j]=r[d>>>24]<<24^r[e>>16&255]<<16^r[f>>8&255]<<8^r[a&255]^c[l++];g=d;d=e;e=f;f=a;a=g}return m}};sjcl.bitArray={bitSlice:function(a,b,c){a=sjcl.bitArray.L(a.slice(b/32),32-(b&31)).slice(1);return c===undefined?a:sjcl.bitArray.clamp(a,c-b)},extract:function(a,b,c){var d=Math.floor(-b-c&31);return((b+c-1^b)&-32?a[b/32|0]<<32-d^a[b/32+1|0]>>>d:a[b/32|0]>>>d)&(1<<c)-1},concat:function(a,b){if(a.length===0||b.length===0){return a.concat(b)}var c=a[a.length-1],d=sjcl.bitArray.getPartial(c);return d===32?a.concat(b):sjcl.bitArray.L(b,d,c|0,a.slice(0,a.length-1))},bitLength:function(a){var b=a.length;if(b===0){return 0}return(b-1)*32+sjcl.bitArray.getPartial(a[b-1])},clamp:function(a,b){if(a.length*32<b){return a}a=a.slice(0,Math.ceil(b/32));var c=a.length;b&=31;if(c>0&&b){a[c-1]=sjcl.bitArray.partial(b,a[c-1]&2147483648>>b-1,1)}return a},partial:function(a,b,c){if(a===32){return b}return(c?b|0:b<<32-a)+a*1099511627776},getPartial:function(a){return Math.round(a/1099511627776)||32},equal:function(a,b){if(sjcl.bitArray.bitLength(a)!==sjcl.bitArray.bitLength(b)){return false}var c=0,d;for(d=0;d<a.length;d++){c|=a[d]^b[d]}return c===0},L:function(a,b,c,d){var e;e=0;if(d===undefined){d=[]}for(;b>=32;b-=32){d.push(c);c=0}if(b===0){return d.concat(a)}for(e=0;e<a.length;e++){d.push(c|a[e]>>>b);c=a[e]<<32-b}e=a.length?a[a.length-1]:0;a=sjcl.bitArray.getPartial(e);d.push(sjcl.bitArray.partial(b+a&31,b+a>32?c:d.pop(),1));return d},M:function(a,b){return[a[0]^b[0],a[1]^b[1],a[2]^b[2],a[3]^b[3]]}};sjcl.codec.utf8String={fromBits:function(a){var b="",c=sjcl.bitArray.bitLength(a),d,e;for(d=0;d<c/8;d++){if((d&3)===0){e=a[d/4]}b+=String.fromCharCode(e>>>24);e<<=8}return decodeURIComponent(escape(b))},toBits:function(a){a=unescape(encodeURIComponent(a));var b=[],c,d=0;for(c=0;c<a.length;c++){d=d<<8|a.charCodeAt(c);if((c&3)===3){b.push(d);d=0}}c&3&&b.push(sjcl.bitArray.partial(8*(c&3),d));return b}};sjcl.codec.base64={A:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fromBits:function(a,b,c){var d="",e=0,f=sjcl.codec.base64.A,g=0,h=sjcl.bitArray.bitLength(a);if(c){f=f.substr(0,62)+"-_"}for(c=0;d.length*6<h;){d+=f.charAt((g^a[c]>>>e)>>>26);if(e<6){g=a[c]<<6-e;e+=26;c++}else{g<<=6;e-=6}}for(;d.length&3&&!b;){d+="="}return d},toBits:function(a,b){a=a.replace(/\s|=/g,"");var c=[],d=0,e=sjcl.codec.base64.A,f=0,g;if(b){e=e.substr(0,62)+"-_"}for(b=0;b<a.length;b++){g=e.indexOf(a.charAt(b));if(g<0){throw new sjcl.exception.invalid("this isn't base64!")}if(d>26){d-=26;c.push(f^g>>>d);f=g<<32-d}else{d+=6;f^=g<<32-d}}d&56&&c.push(sjcl.bitArray.partial(d&56,f,1));return c}};sjcl.codec.base64url={fromBits:function(a){return sjcl.codec.base64.fromBits(a,1,1)},toBits:function(a){return sjcl.codec.base64.toBits(a,1)}};sjcl.codec.bytes={fromBits:function(a){var b=[],c=sjcl.bitArray.bitLength(a),d,e;for(d=0;d<c/8;d++){if((d&3)===0){e=a[d/4]}b.push(e>>>24);e<<=8}return b},toBits:function(a){var b=[],c,d=0;for(c=0;c<a.length;c++){d=d<<8|a[c];if((c&3)===3){b.push(d);d=0}}c&3&&b.push(sjcl.bitArray.partial(8*(c&3),d));return b}};sjcl.hash.sha256=function(a){this.a[0]||this.u();if(a){this.l=a.l.slice(0);this.h=a.h.slice(0);this.d=a.d}else{this.reset()}};sjcl.hash.sha256.hash=function(a){return(new sjcl.hash.sha256).update(a).finalize()};sjcl.hash.sha256.prototype={blockSize:512,reset:function(){this.l=this.J.slice(0);this.h=[];this.d=0;return this},update:function(a){if(typeof a==="string"){a=sjcl.codec.utf8String.toBits(a)}var b,c=this.h=sjcl.bitArray.concat(this.h,a);b=this.d;a=this.d=b+sjcl.bitArray.bitLength(a);for(b=512+b&-512;b<=a;b+=512){this.z(c.splice(0,16))}return this},finalize:function(){var a,b=this.h,c=this.l;b=sjcl.bitArray.concat(b,[sjcl.bitArray.partial(1,1)]);for(a=b.length+2;a&15;a++){b.push(0)}b.push(Math.floor(this.d/4294967296));for(b.push(this.d|0);b.length;){this.z(b.splice(0,16))}this.reset();return c},J:[],a:[],u:function(){function a(e){return(e-Math.floor(e))*4294967296|0}var b=0,c=2,d;a:for(;b<64;c++){for(d=2;d*d<=c;d++){if(c%d===0){continue a}}if(b<8){this.J[b]=a(Math.pow(c,0.5))}this.a[b]=a(Math.pow(c,1/3));b++}},z:function(a){var b,c,d=a.slice(0),e=this.l,f=this.a,g=e[0],h=e[1],i=e[2],k=e[3],j=e[4],l=e[5],m=e[6],n=e[7];for(a=0;a<64;a++){if(a<16){b=d[a]}else{b=d[a+1&15];c=d[a+14&15];b=d[a&15]=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(c>>>17^c>>>19^c>>>10^c<<15^c<<13)+d[a&15]+d[a+9&15]|0}b=b+n+(j>>>6^j>>>11^j>>>25^j<<26^j<<21^j<<7)+(m^j&(l^m))+f[a];n=m;m=l;l=j;j=k+b|0;k=i;i=h;h=g;g=b+(h&i^k&(h^i))+(h>>>2^h>>>13^h>>>22^h<<30^h<<19^h<<10)|0}e[0]=e[0]+g|0;e[1]=e[1]+h|0;e[2]=e[2]+i|0;e[3]=e[3]+k|0;e[4]=e[4]+j|0;e[5]=e[5]+l|0;e[6]=e[6]+m|0;e[7]=e[7]+n|0}};sjcl.mode.ccm={name:"ccm",encrypt:function(a,b,c,d,e){var f,g=b.slice(0),h=sjcl.bitArray,i=h.bitLength(c)/8,k=h.bitLength(g)/8;e=e||64;d=d||[];if(i<7){throw new sjcl.exception.invalid("ccm: iv must be at least 7 bytes")}for(f=2;f<4&&k>>>8*f;f++){}if(f<15-i){f=15-i}c=h.clamp(c,8*(15-f));b=sjcl.mode.ccm.C(a,b,c,d,e,f);g=sjcl.mode.ccm.F(a,g,c,b,e,f);return h.concat(g.data,g.tag)},decrypt:function(a,b,c,d,e){e=e||64;d=d||[];var f=sjcl.bitArray,g=f.bitLength(c)/8,h=f.bitLength(b),i=f.clamp(b,h-e),k=f.bitSlice(b,h-e);h=(h-e)/8;if(g<7){throw new sjcl.exception.invalid("ccm: iv must be at least 7 bytes")}for(b=2;b<4&&h>>>8*b;b++){}if(b<15-g){b=15-g}c=f.clamp(c,8*(15-b));i=sjcl.mode.ccm.F(a,i,c,k,e,b);a=sjcl.mode.ccm.C(a,i.data,c,d,e,b);if(!f.equal(i.tag,a)){throw new sjcl.exception.corrupt("ccm: tag doesn't match")}return i.data},C:function(a,b,c,d,e,f){var g=[],h=sjcl.bitArray,i=h.M;e/=8;if(e%2||e<4||e>16){throw new sjcl.exception.invalid("ccm: invalid tag length")}if(d.length>4294967295||b.length>4294967295){throw new sjcl.exception.bug("ccm: can't deal with 4GiB or more data")}f=[h.partial(8,(d.length?64:0)|e-2<<2|f-1)];f=h.concat(f,c);f[3]|=h.bitLength(b)/8;f=a.encrypt(f);if(d.length){c=h.bitLength(d)/8;if(c<=65279){g=[h.partial(16,c)]}else{if(c<=4294967295){g=h.concat([h.partial(16,65534)],[c])}}g=h.concat(g,d);for(d=0;d<g.length;d+=4){f=a.encrypt(i(f,g.slice(d,d+4).concat([0,0,0])))}}for(d=0;d<b.length;d+=4){f=a.encrypt(i(f,b.slice(d,d+4).concat([0,0,0])))}return h.clamp(f,e*8)},F:function(a,b,c,d,e,f){var g,h=sjcl.bitArray;g=h.M;var i=b.length,k=h.bitLength(b);c=h.concat([h.partial(8,f-1)],c).concat([0,0,0]).slice(0,4);d=h.bitSlice(g(d,a.encrypt(c)),0,e);if(!i){return{tag:d,data:[]}}for(g=0;g<i;g+=4){c[3]++;e=a.encrypt(c);b[g]^=e[0];b[g+1]^=e[1];b[g+2]^=e[2];b[g+3]^=e[3]}return{tag:d,data:h.clamp(b,k)}}};sjcl.misc.hmac=function(a,b){this.I=b=b||sjcl.hash.sha256;var c=[[],[]],d=b.prototype.blockSize/32;this.j=[new b,new b];if(a.length>d){a=b.hash(a)}for(b=0;b<d;b++){c[0][b]=a[b]^909522486;c[1][b]=a[b]^1549556828}this.j[0].update(c[0]);this.j[1].update(c[1])};sjcl.misc.hmac.prototype.encrypt=sjcl.misc.hmac.prototype.mac=function(a){a=(new this.I(this.j[0])).update(a).finalize();return(new this.I(this.j[1])).update(a).finalize()};sjcl.misc.pbkdf2=function(a,b,c,d,e){c=c||1000;if(d<0||c<0){throw sjcl.exception.invalid("invalid params to pbkdf2")}if(typeof a==="string"){a=sjcl.codec.utf8String.toBits(a)}e=e||sjcl.misc.hmac;a=new e(a);var f,g,h,i,k=[],j=sjcl.bitArray;for(i=1;32*k.length<(d||1);i++){e=f=a.encrypt(j.concat(b,[i]));for(g=1;g<c;g++){f=a.encrypt(f);for(h=0;h<f.length;h++){e[h]^=f[h]}}k=k.concat(e)}if(d){k=j.clamp(k,d)}return k};sjcl.random={randomWords:function(a,b){var c=[];b=this.isReady(b);var d;if(b===0){throw new sjcl.exception.notReady("generator isn't seeded")}else{b&2&&this.Q(!(b&1))}for(b=0;b<a;b+=4){(b+1)%65536===0&&this.H();d=this.t();c.push(d[0],d[1],d[2],d[3])}this.H();return c.slice(0,a)},setDefaultParanoia:function(a){this.r=a},addEntropy:function(a,b,c){c=c||"user";var d,e,f=(new Date).valueOf(),g=this.o[c],h=this.isReady(),i=0;d=this.B[c];if(d===undefined){d=this.B[c]=this.O++}if(g===undefined){g=this.o[c]=0}this.o[c]=(this.o[c]+1)%this.b.length;switch(typeof a){case"number":if(b===undefined){b=1}this.b[g].update([d,this.s++,1,b,f,1,a|0]);break;case"object":c=Object.prototype.toString.call(a);if(c==="[object Uint32Array]"){e=[];for(c=0;c<a.length;c++){e.push(a[c])}a=e}else{if(c!=="[object Array]"){i=1}for(c=0;c<a.length&&!i;c++){if(typeof a[c]!="number"){i=1}}}if(!i){if(b===undefined){for(c=b=0;c<a.length;c++){for(e=a[c];e>0;){b++;e>>>=1}}}this.b[g].update([d,this.s++,2,b,f,a.length].concat(a))}break;case"string":if(b===undefined){b=a.length}this.b[g].update([d,this.s++,3,b,f,a.length]);this.b[g].update(a);break;default:i=1}if(i){throw new sjcl.exception.bug("random: addEntropy only supports number, array of numbers or string")}this.i[g]+=b;this.e+=b;if(h===0){this.isReady()!==0&&this.G("seeded",Math.max(this.f,this.e));this.G("progress",this.getProgress())}},isReady:function(a){a=this.w[a!==undefined?a:this.r];return this.f&&this.f>=a?this.i[0]>80&&(new Date).valueOf()>this.K?3:1:this.e>=a?2:0},getProgress:function(a){a=this.w[a?a:this.r];return this.f>=a?1:this.e>a?1:this.e/a},startCollectors:function(){if(!this.k){if(window.addEventListener){window.addEventListener("load",this.m,false);window.addEventListener("mousemove",this.n,false)}else{if(document.attachEvent){document.attachEvent("onload",this.m);document.attachEvent("onmousemove",this.n)}else{throw new sjcl.exception.bug("can't attach event")}}this.k=true}},stopCollectors:function(){if(this.k){if(window.removeEventListener){window.removeEventListener("load",this.m,false);window.removeEventListener("mousemove",this.n,false)}else{if(window.detachEvent){window.detachEvent("onload",this.m);window.detachEvent("onmousemove",this.n)}}this.k=false}},addEventListener:function(a,b){this.p[a][this.N++]=b},removeEventListener:function(a,b){var c;a=this.p[a];var d=[];for(c in a){a.hasOwnProperty(c)&&a[c]===b&&d.push(c)}for(b=0;b<d.length;b++){c=d[b];delete a[c]}},b:[new sjcl.hash.sha256],i:[0],v:0,o:{},s:0,B:{},O:0,f:0,e:0,K:0,a:[0,0,0,0,0,0,0,0],c:[0,0,0,0],q:undefined,r:6,k:false,p:{progress:{},seeded:{}},N:0,w:[0,48,64,96,128,192,256,384,512,768,1024],t:function(){for(var a=0;a<4;a++){this.c[a]=this.c[a]+1|0;if(this.c[a]){break}}return this.q.encrypt(this.c)},H:function(){this.a=this.t().concat(this.t());this.q=new sjcl.cipher.aes(this.a)},P:function(a){this.a=sjcl.hash.sha256.hash(this.a.concat(a));this.q=new sjcl.cipher.aes(this.a);for(a=0;a<4;a++){this.c[a]=this.c[a]+1|0;if(this.c[a]){break}}},Q:function(a){var b=[],c=0,d;this.K=b[0]=(new Date).valueOf()+30000;for(d=0;d<16;d++){b.push(Math.random()*4294967296|0)}for(d=0;d<this.b.length;d++){b=b.concat(this.b[d].finalize());c+=this.i[d];this.i[d]=0;if(!a&&this.v&1<<d){break}}if(this.v>=1<<this.b.length){this.b.push(new sjcl.hash.sha256);this.i.push(0)}this.e-=c;if(c>this.f){this.f=c}this.v++;this.P(b)},n:function(a){sjcl.random.addEntropy([a.x||a.clientX||a.offsetX||0,a.y||a.clientY||a.offsetY||0],2,"mouse")},m:function(){sjcl.random.addEntropy((new Date).valueOf(),2,"loadtime")},G:function(a,b){var c;a=sjcl.random.p[a];var d=[];for(c in a){a.hasOwnProperty(c)&&d.push(a[c])}for(c=0;c<d.length;c++){d[c](b)}}};try{var s=new Uint32Array(32);crypto.getRandomValues(s);sjcl.random.addEntropy(s,1024,"crypto['getRandomValues']")}catch(t){};
111
 
112
  /* adyen */
113
  var adyen = window.adyen = window.adyen || {};
114
+
115
  var encrypt = adyen.encrypt = adyen.encrypt || {
116
  createEncryptedForm: function( form, key, name ) {
117
  return new EncryptedForm( form, key, name );
118
  }
119
  };
120
+
121
  encrypt.version = '0_1_1';
122
+
123
 
124
  /*
125
  *
126
+ *
127
  *
128
  * @constructor EncryptedForm
129
  *
148
  this.force = options.force || false;
149
  this.id = options.id || this.name;
150
  this.onsubmit = options.onsubmit || function() {};
151
+ this.dataEncryptedName = options.dataEncryptedName || "data-encrypted-name";
152
 
153
  if ( this.force !== false ) {
154
  this.createEncryptedField( this.encrypt() );
159
  this.element.attachEvent( 'onsubmit', this.handleSubmit.bind( this ) );
160
  }
161
  }
162
+
163
  };
164
 
165
  EncryptedForm.prototype = {
166
 
167
  constructor: EncryptedForm,
168
+
169
  /*
170
  *
171
  * Handles a submit of the form.
172
  * It creates a hidden input with the form data as serialized, encrypted JSON.
173
  *
174
  * @param e {Event} The submit event to handle.
175
+ *
176
  */
177
+
178
  handleSubmit: function( e ) {
179
  this.createEncryptedField( this.encrypt() );
180
  this.onsubmit(e);
181
  },
182
+
183
  /*
184
  * Creates an RSA key based on the public key.
185
  *
186
  * @returns rsa {RSAKey} An RSAKey based on the public key provided.
187
  *
188
  */
189
+
190
  createRSAKey: function() {
191
+
192
  var k = this.key.split('|');
193
 
194
  if ( k.length != 2 ) {
203
  rsa.setPublic( mod, exp );
204
 
205
  return rsa;
206
+
207
  },
208
+
209
  /*
210
  * Creates an AES key.
211
  *
212
  * @returns aes {Object} An AESKey with encryption methods.
213
  *
214
  */
215
+
216
  createAESKey: function() {
217
  return new AESKey();
218
  },
219
+
220
+ /*
221
  * Gets all encrypted fields from a root node ( usually the form element ).
222
  *
223
  * @param node {DOMNode} The root of the form to get encrypted fields from ( i.e. querySelectorAll( '[data-encrypeted-name]' ) ).
230
  getEncryptedFields: function( node, fields ) {
231
 
232
  if ( node.querySelectorAll ) {
233
+ return node.querySelectorAll( '['+ this.dataEncryptedName + ']' );
234
+ }
235
 
236
  fields = fields || [];
237
 
241
  for ( var i = 0; i < children.length; i++ ) {
242
  child = children[i];
243
 
244
+ if ( child.hasAttribute(this.dataEncryptedName) ) {
245
  fields.push( child )
246
  } else {
247
  this.getEncryptedFields( child, fields );
252
  return fields;
253
 
254
  },
255
+
256
  /*
257
  * Creates JSON object
258
  *
270
  var key, value;
271
 
272
  for ( var i = fields.length - 1; i >= 0; i-- ) {
273
+
274
  field = fields[i];
275
+
276
  field.removeAttribute('name');
277
+ key = field.getAttribute(this.dataEncryptedName);
278
  value = field.value;
 
279
  data[ key ] = value;
 
280
  };
 
281
  return data;
282
 
283
  },
284
+
285
  /*
286
  * Encrypts data
287
  *
290
  */
291
 
292
  encrypt: function() {
293
+
294
  var data = this.toJSON( this.getEncryptedFields( this.element ) );
295
+
296
  var rsa, aes, cipher, encoded, encrypted, prefix;
297
 
298
  rsa = this.createRSAKey();
299
  aes = this.createAESKey();
300
+
301
  cipher = aes.encrypt( JSON.stringify( data ) );
302
  keybytes = sjcl.codec.bytes.fromBits( aes.key );
303
  encrypted = rsa.encrypt_b64( keybytes );
304
  prefix = 'adyenjs_' + encrypt.version + '$';
305
+
306
  return [ prefix, encrypted, '$', cipher ].join('');
307
+
308
  },
309
+
310
  /*
311
  *
312
  * Creates an encrypted field.
314
  * @param data {String} The data in the form as encrypted and serialized JSON.
315
  *
316
  */
317
+
318
  createEncryptedField: function( data ) {
319
+
320
  var element = document.getElementById( this.name );
321
+
322
  if ( !element ) {
323
  element = document.createElement( 'input' );
324
  element.type = 'hidden';
326
  element.id = this.id;
327
  this.element.appendChild( element );
328
  }
 
329
  element.setAttribute( 'value', data );
 
330
  }
331
 
332
  };
333
+
334
+
335
  /*
336
  *
337
  * @constructor AESKey
339
  * @return aes {AESKey} An AESKey with encryption methods.
340
  *
341
  */
342
+
343
  var AESKey = function() {
344
  // empty constructor
345
  };
346
+
347
  AESKey.prototype = {
348
+
349
  constructor: AESKey,
350
+
351
  key: sjcl.random.randomWords( 8, 0 ),
352
 
353
  encrypt: function ( text ) {
368
  return sjcl.codec.base64.fromBits( cipherIV );
369
 
370
  }
371
+
372
  };
373
 
374
  })();
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Adyen_Payment</name>
4
- <version>2.0.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/OSL-3.0">Open Software License (OSL-3.0)</license>
7
  <channel>community</channel>
@@ -10,13 +10,33 @@
10
  <description>Magento Plugin for Payment Service Provider Adyen. The integration guide for this Plugin is available on the Adyen Support website: support.adyen.com, type in 'Magento'&#xD;
11
  &#xD;
12
  support@adyen.com</description>
13
- <notes>Hotfix disable fields on HPP for Klarna&#xD;
14
- Hotfix delete unused ifelse statement&#xD;
15
- Hotfix only add lines for discount costs and shipping cost for openinvoice\klarna if this is the case. Removed the overall tax costs line because all product already have tax costs defined</notes>
16
- <authors><author><name>Adyen</name><user>adyen</user><email>support@adyen.com</email></author></authors>
17
- <date>2014-06-17</date>
18
- <time>09:05:03</time>
19
- <contents><target name="magecommunity"><dir name="Adyen"><dir name="Payment"><dir name="Block"><dir name="Adminhtml"><dir name="Form"><dir name="Field"><file name="Installments.php" hash="f316d311c9e1c876fb18896d85734cf8"/></dir></dir><dir name="Sales"><dir name="Order"><dir name="Filter"><file name="Adyen.php" hash="d5e828a9621eda18cf3404c6d294cf18"/></dir><dir name="Renderer"><file name="Adyen.php" hash="44bc7f403e35ce4711101f8b93192190"/></dir></dir></dir></dir><dir name="Checkout"><file name="Success.php" hash="8edb224af51fb76d111807168268f67c"/></dir><file name="Failure.php" hash="ead96fee55fba2cbb5044f09566e85e4"/><dir name="Form"><file name="Boleto.php" hash="29aa8c90287d37979fc5eb35554fc630"/><file name="Cc.php" hash="9e9f2b2fb861e39133635ce7adc40bb1"/><file name="Elv.php" hash="c3de45c9161b1564209b79a80140fec3"/><file name="Hpp.php" hash="1ad9ac1b1f4f847101edd37341d03ec6"/><file name="Openinvoice.php" hash="86994b120bfdff14854194be5cb530bf"/><file name="Pos.php" hash="7a93f39cd4c30d5be1b56218a4e04a7f"/></dir><file name="Form.php" hash="77d0589a32cb816dcdc6df16c98f2cd6"/><dir name="Info"><file name="Boleto.php" hash="720913657cb3aad5706aaff9e73ff65c"/><file name="Cc.php" hash="fda6af2c2c9a6988095b5f4eee3b6711"/><file name="Elv.php" hash="d35cfabffa923a7c0345a1dacde38a52"/><file name="Hpp.php" hash="bce3945267dac13f4fd9c9fd1400d11c"/><file name="Openinvoice.php" hash="1e99e4ab3ef75a9fa27626bd946b0407"/><file name="Pos.php" hash="8a6be4f35d43dc7791b9741cfb05b8a5"/></dir><file name="Redirect.php" hash="66f82378a6c73c349098a8c5b35341ab"/></dir><dir name="Helper"><file name="Data.php" hash="cd50d08a820784ba7f5bf2d6784ad732"/><file name="Installments.php" hash="a2e3baac6ab0af239d048a0f7a9e5368"/></dir><dir name="Model"><dir name="Adyen"><file name="Abstract.php" hash="ff2e0015cba8cf06c5e2a50760ab5c24"/><file name="Boleto.php" hash="e92f38062af2dcc766161ce2e92d9fac"/><file name="Cc.php" hash="fc6ba72e489362de7ccfd734830677b4"/><dir name="Data"><file name="Abstract.php" hash="dcdd899bd0595af98886ff752a67e21a"/><file name="AdditionalData.php" hash="e4d038a60ac548e0938f75a0452d5717"/><file name="AdditionalDataKVPair.php" hash="cc2e0ba6733ef5139f44ba7c9af303dc"/><file name="Amount.php" hash="73540706cac2c2eef0252615d6200511"/><file name="BrowserInfo.php" hash="bd1cca3cc27aea7fad85661c7132e2cd"/><file name="Card.php" hash="ea384e9c2032ba7ad5925edfb434625f"/><file name="Classmap.php" hash="38ab9bfbfb1585852380c0551a35b9ec"/><file name="Elv.php" hash="6608688d03b047387a2b28be10c47b87"/><file name="IdealPaymentRequest.php" hash="8281d9276cdf4fa65a4a451a4096a979"/><file name="InvoiceLine.php" hash="2013af2bbae2b07df4db34b4d8565796"/><file name="InvoiceRow.php" hash="a3f423014bd18a35d4e7e65a1a12fa79"/><file name="ModificationRequest.php" hash="81ea8b3a849f8fccba2c55c4832b0cc8"/><file name="ModificationResult.php" hash="eec37eba3849baa4ad52b194e31ac362"/><file name="NotificationClassmap.php" hash="31166e4ef9ea728c107f5ee501d67fc5"/><file name="NotificationRequest.php" hash="4647bfc558308e8f7795ae97fbf2c066"/><file name="NotificationRequestItem.php" hash="ef0794de69076f4accc5035b3f659808"/><file name="OpenInvoiceDetailResult.php" hash="cfdb5c3b03944556bc3931428339347e"/><file name="PaymentRequest.php" hash="d105a1c9445ef810083ac5d04e6d825f"/><file name="PaymentRequest3d.php" hash="505731df1bb63d6426a11e5d3036552f"/><file name="Recurring.php" hash="bad9acc8370eff0008ebbc0a6a32a75b"/><file name="RecurringRequest.php" hash="aed77050f296df4f48c88038ef3ac547"/><dir name="Server"><file name="Notification.php" hash="51ed88aa2c2035e4cb7b4e992e7c8e4a"/><file name="Openinvoice.php" hash="d94166e3c8337e213061655ab7e48e68"/></dir><file name="ShopperName.php" hash="91bfea9ade01d29fa9053de87ce01560"/></dir><file name="Debug.php" hash="8044ccae24d83db38d9430cf125ada83"/><file name="Dummy.php" hash="a72ccc6e8c5268cf6786db289de4e3d9"/><file name="Elv.php" hash="f3e6067e8bb235d037c7cd78aaa703b6"/><file name="Hpp.php" hash="354ece4d6ddfea544a0067a649093877"/><file name="Ideal.php" hash="8359f4eb5c28363680c08ecbc88a28a5"/><file name="Openinvoice.php" hash="53a3cb1ab35a7a8a539a10cd9928e925"/><file name="Pos.php" hash="b471260f8bfa2f8cd67ead83500095ae"/><file name="Shared.php" hash="7f3fe961a7107b6fb5625a9efe7854fd"/></dir><file name="Authenticate.php" hash="9de42d073756d2f1dfaa09a3af83cea9"/><file name="Event.php" hash="52184be6de80f9835a93de826ca1b65f"/><dir name="Mysql4"><dir name="Adyen"><dir name="Debug"><file name="Collection.php" hash="dee84aa1c2b370a72d79031a09b9bba4"/></dir><file name="Debug.php" hash="123808b460f70ad416ed9bb92e6a1d60"/><file name="Event.php" hash="0cb65021f52c84f0f567098bd90db4e6"/></dir><file name="Order.php" hash="05c5ce3b68f877b23d1396d13db18517"/><file name="Setup.php" hash="45997ed47c197cb302d6fbb684489201"/></dir><file name="Observer.php" hash="7494dc549d07127865a8557c9b06f59a"/><file name="Process.php" hash="d9039c5c3189abf5f4363a31eeb47d6a"/><dir name="Source"><file name="BoletoType.php" hash="1a31476c4ebfdb6b16a1dd3a26015fb1"/><file name="CancelModes.php" hash="b18c30b103cdce97af41e63ef0a25a92"/><file name="CaptureModes.php" hash="d2d138f0a59e1e448531f1fd8f908439"/><file name="CcType.php" hash="97d4e2549bec42b8282636f1e98e853a"/><file name="DemoModes.php" hash="0ce4142166b9f7dc96ee8e1e3bd03286"/><file name="OpeninvoiceType.php" hash="c39389388338dfe0b85b10a1e9b828cb"/><file name="PaymentAction.php" hash="23224178cf58e55c308234036f629bf7"/><file name="PaymentRoutines.php" hash="7aa5525e67554ad35226cf1aaa802c49"/><file name="RecurringType.php" hash="2a3c60c4546d9c02c842a9ea0a5ade26"/><dir name="Status"><file name="Refund.php" hash="bb700fa537f3a7c27c43691846777ef4"/></dir></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Installments.php" hash="6c3b60719edb83eaaad1515514dab620"/></dir></dir></dir></dir><dir name="controllers"><file name="ProcessController.php" hash="f13bf04ac2e5ddb6ede00eeced522860"/></dir><dir name="docs"><dir name="httpauthentication"><file name="cgihtaccess.patch" hash="b1ca6c18002d1c22f53c8dd55aee1845"/><file name="howto" hash="31677f6b34fca607f8751c9eb5bdcac2"/></dir><file name="readme" hash="aae2884b18ed35ab74c7e73f4baec6e3"/><file name="test-cards" hash="d7a4a41bc2bb17f74dcbcfbc41156675"/><dir name="translation"><file name="Adyen_Payment.csv" hash="0094e6a70aca120e94cc395f139f1687"/><file name="Mage_Checkout.csv" hash="7d3bcce1ce01d189d113d02b949b73ca"/><file name="howto" hash="00a8a321b06b7235c6e6ca39cfcef80f"/></dir></dir><dir name="etc"><file name="Notification.wsdl" hash="cbba67067d372790e91225b4049c7e0d"/><file name="Payment.wsdl" hash="f7166d125a3f8ba355b8b9fc923abc88"/><file name="config.xml" hash="c276d5a3460770e08f08a389012d1174"/><file name="system.xml" hash="402e1b494490f786940d3744d840aee3"/></dir><dir name="sql"><dir name="adyen_setup"><file name="mysql4-install-0.0.1.php" hash="3c304ff04d461bc0bfa6205c03dceea0"/><file name="mysql4-upgrade-0.0.1-0.0.2.php" hash="3d687c555ed52be5eeb4eaba126abb2b"/><file name="mysql4-upgrade-0.0.7-0.0.8.php" hash="27b202258c2bd16ee64902df7985862e"/><file name="mysql4-upgrade-0.0.8-0.0.9.php" hash="85d3de753b99b541a4547c39b7713905"/><file name="mysql4-upgrade-0.1.0.3-0.1.0.4.php" hash="8b43e357cf7a365b1e099b130db51b20"/><file name="mysql4-upgrade-0.1.0.8-0.1.0.9.php" hash="0ba22acbe3f48fc1ae1e76212a11dc2a"/><file name="mysql4-upgrade-0.1.0.9-0.1.0.10.php" hash="2b029ba94cea8dd9b6d82a0de265234f"/><file name="mysql4-upgrade-1.0.0.3-1.0.0.7.php" hash="c087b4bbc48cf47e954b6cfbd1f2c5bb"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="adyen.xml" hash="a963acf4938f60fde0672bb6177399f1"/></dir><dir name="template"><dir name="adyen"><dir name="form"><file name="boleto.phtml" hash="83c7bc35d037f426aa75c0719e8adb86"/><file name="cc.phtml" hash="054ab1e3fa2b3901973a76e4f7547c10"/><file name="elv.phtml" hash="4d370d2d737f0a42ebcb33e7151ecee6"/><file name="hpp.phtml" hash="4a91ca20deb8e5dd083d8f4d68102812"/><file name="openinvoice.phtml" hash="33127af4713430e153cccbe8684fab13"/><file name="pos.phtml" hash="c07c11d348fced7d889ded4fc77e3363"/></dir><dir name="info"><file name="boleto.phtml" hash="fd3d6d83a26d1584b9c7912011465f26"/><file name="cc.phtml" hash="232556a362df5d3a88cd7975f7434b1e"/><file name="elv.phtml" hash="7a6b627e0c6acd04497d52f5047e930a"/><file name="hpp.phtml" hash="55005919f39ca07650aca6039d423081"/><file name="openinvoice.phtml" hash="14f889a7cc056538629ca9963e4052f0"/><file name="pos.phtml" hash="a5b175023f0670409122876074d6f050"/></dir><dir name="pdf"><file name="boleto.phtml" hash="50853749a944124f076d129fd5e6cfa9"/><file name="cc.phtml" hash="50853749a944124f076d129fd5e6cfa9"/><file name="elv.phtml" hash="50853749a944124f076d129fd5e6cfa9"/><file name="hpp.phtml" hash="4cdb4f7c88b6556fc847c21d5d4b7ffb"/><file name="openinvoice.phtml" hash="742b87babbb612032d68a8e79d31e89c"/><file name="pos.phtml" hash="a3dc27a6607b4978c93b21d945661e5c"/></dir><file name="pdf.tar.bz2" hash="d4b4edd908e7784efc8ac45fe1ce73cb"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="adyen"><file name="blank.phtml" hash="03d788d9ec2aa70de7eb66015b2c4da1"/><dir name="checkout"><file name="success.phtml" hash="56c5bdd54f9cbed22be7afe0deedead4"/></dir><dir name="form"><file name="boleto.phtml" hash="3598286ebd678277681160eaa1c842e3"/><file name="cc.phtml" hash="02f7b3cdd935db88b560af4fccace63b"/><file name="elv.phtml" hash="789610e3d1f8973f6aecb4ef119a59c9"/><file name="hpp.phtml" hash="86fe103d87159f5cd18065f5d0b673c8"/><file name="openinvoice.phtml" hash="7e749cb508d84e1c065a0048f6cf616b"/><file name="pos.phtml" hash="674097ccf62f13c969d39c2f6a6824b8"/></dir><dir name="info"><file name="boleto.phtml" hash="c526f9c4badab3afaa771872bb4687f1"/><file name="cc.phtml" hash="cda685b7c94fc401158bf5901e66c8b6"/><file name="elv.phtml" hash="8b850e97ea84e1de5ead4ec487c4356f"/><file name="hpp.phtml" hash="4d91b5d0729eafc220268d204b514cae"/><file name="openinvoice.phtml" hash="2bcd711e1255923d53f353819e19529e"/><file name="pos.phtml" hash="9b917920aa1cc77c9e8c3a26943b1335"/></dir></dir></dir><dir name="layout"><file name="adyen.xml" hash="93a4b160747bcc918d09944cc7328fab"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Adyen_Payment.xml" hash="e4d297a9b401c4548acb47aea1ae41d9"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="adyen"><file name="ABNAMRO.png" hash="a621e7f4cf1c3340ac5147fef5544bfe"/><file name="ABNAMRO.xcf" hash="eac24c953dcf05d40ce928ccab2af90f"/><file name="ASNBANK.png" hash="13034bc0836590cfb0ec7b6c3076e435"/><file name="FORTIS.png" hash="3b68fa26a90f8cd44e2f8dfcb5f72fe8"/><file name="FRIESLANDBANK.png" hash="c1388a9b8a170260b0b72da9b2cd2dbf"/><file name="ING.png" hash="b08f829cf67322875ca12d5fc36ac191"/><file name="KNAB.png" hash="4df678f84bdf11db9b75d1e539a0367c"/><file name="POSTBANK.png" hash="ea0ffd9d3e9717fe0bdc160d8cd92482"/><file name="RABOBANK.png" hash="f09418ebbd0d6daf21786d5bde93e856"/><file name="REGIOBANK.png" hash="0c3a984ce817e4d3ec98549be7704712"/><file name="SNSBANK.png" hash="75f988e3ab935d6d509a86f82422f474"/><file name="SNSREGIOBANK.png" hash="34a70ac0e1e0a8cfb56c77a5b1da3c80"/><file name="TESTISSUER.png" hash="0110aadd0f619b39f357b98b63e3ff69"/><file name="TESTISSUER10.png" hash="b2462fe98e69d211e92771ae75f48552"/><file name="TESTISSUER2.png" hash="471cc38e61077fdaba8fd868fea22dfe"/><file name="TESTISSUER3.png" hash="4ca46be0b7607dc95caccb5ec974e0a8"/><file name="TESTISSUER4.png" hash="6e31a3d3e73390432a84e394a1937c5d"/><file name="TESTISSUER5.png" hash="78b758fef66f220e79b1b9ecda8851d2"/><file name="TESTISSUER6.png" hash="4aefac8baaa06592c8a80f085c0ade08"/><file name="TESTISSUER7.png" hash="0474b1a3264ef45068013747a27158d2"/><file name="TESTISSUER8.png" hash="5e655c4af04b417acecac6fd66623662"/><file name="TESTISSUER9.png" hash="6e378c3b7c75febd0be361ec39c55e45"/><file name="TESTISSUERCANCELLED.png" hash="c794eeb78ef618c3e9dcd8b444b7b23f"/><file name="TESTISSUERPENDING.png" hash="04ee87a5c35a491e624719a3c885d492"/><file name="TESTISSUERREFUSED.png" hash="2f7e2bad6857f39f32afd09eb846e55a"/><file name="TRIODOSBANK.png" hash="922b1fcd51306e0d0da6b15ebe640d8c"/><file name="VANLANSCHOTBANKIERS.png" hash="0a5d713a5c73c54e90507743456c5657"/><file name="achcolombia.png" hash="1f1339c682440cfd7584f9ba00f59722"/><file name="achcolombia_small.png" hash="d6b2899a0039de82788c831b00dd1533"/><file name="achcolombia_small_grey.png" hash="bcae575368bdcdb582423e28ac7a56e9"/><file name="achcolombia_tiny.png" hash="a287c57b8bcc821371758da895db6437"/><file name="advance_payment.png" hash="5aba603621b4b21cc05b7eae1f7455da"/><file name="adyen_logo_large.png" hash="70726ef290d0eee3ed163eb751091813"/><file name="alipay.png" hash="e3773ada96577e575c9e1300a89a5875"/><file name="alipay_small.png" hash="f9848d15fc7ee22b6687ccdbe7f36a16"/><file name="alipay_small_grey.png" hash="e5ffe7ff272ce2814b7808fd047a9c6b"/><file name="alipay_tiny.png" hash="1a7867dd958ddcdd90ad2400e5be23de"/><file name="amex.png" hash="8e3b962f9ef18e08cf16b77934607d28"/><file name="amex_small.png" hash="6ce7c9a2b330c9c46f0213c40db55683"/><file name="amex_small_grey.png" hash="0f6aabd8dfcbf48dbb555b9191d7795e"/><file name="amex_tiny.png" hash="b7016f4efb163c985d6f1d99a8433d2a"/><file name="asiapay.png" hash="44626dc317e547fb40010498c1096407"/><file name="asiapay_small.png" hash="cca4d86b5abc510f20ca9563d7215c3d"/><file name="asiapay_small_grey.png" hash="00e20b2b2eb0d2ad51c15d8ccc558dc5"/><file name="asiapay_tiny.png" hash="ba0d613d94a64918c0338504fed20ee7"/><file name="autopay.png" hash="4251763c71239e7b1b421e4bc7f5b70a"/><file name="autopay_small.png" hash="ca6941b80b6157bae2411b5620149d2d"/><file name="autopay_small_grey.png" hash="f69d143b4f1fc16a9138ccfacec808a4"/><file name="autopay_tiny.png" hash="4c0c91402daafc63bdb5979dbbd963db"/><file name="babygiftcard.png" hash="91bcbb6604b26565b89898c9a8e1e117"/><file name="babygiftcard_small.png" hash="2558bbdd4d9528b37ba93a8c4af536a4"/><file name="babygiftcard_tiny.png" hash="393a192fab9874e3b167c3bc5d568db7"/><file name="baloto.png" hash="1c172c628f79837c83196b243c636ff5"/><file name="baloto_small.png" hash="c66db84ac7fed6f81010e8058fa39a74"/><file name="baloto_small_grey.png" hash="bdc5eac76e02a658b348a0722fca9ba9"/><file name="baloto_tiny.png" hash="5e10ee14c8a44c3b4c28571664fa045f"/><file name="bancnet.png" hash="a2b687ef27244e448b85635cc1d3ec60"/><file name="bancnet_small.png" hash="4473bc16badc29200ffd09021778b1e3"/><file name="bancnet_small_grey.png" hash="6b108ea906b6d6a5ad51e4de6db732eb"/><file name="bancnet_tiny.png" hash="0ac28b35fd4e09954debcd2eb42e89ce"/><file name="bank24.png" hash="9a921572d6bae73604e1122ec3e5bf7e"/><file name="bankTransfer_AE.png" hash="a6f29729723fa65c732ffc9267b3f8be"/><file name="bankTransfer_AE_small.png" hash="a3322805ab1c40c4e6237943185284ab"/><file name="bankTransfer_AE_tiny.png" hash="dfcf50c97c3b832fd3c17efb2864335c"/><file name="bankTransfer_AT.png" hash="7fa4204d1426a64a4cd26af06af44d41"/><file name="bankTransfer_AT_small.png" hash="31037dcf034d1e9d28254d1962b2ca16"/><file name="bankTransfer_AT_tiny.png" hash="4ee9964118e05d2a81335f3033ec5bf1"/><file name="bankTransfer_AU.png" hash="05716c67579fcf3574037ce69c9e4229"/><file name="bankTransfer_AU_small.png" hash="acd23b8e3ccf3c9d28960fde63c22e85"/><file name="bankTransfer_AU_tiny.png" hash="4a3ee62afdac23a00a0675c763e93470"/><file name="bankTransfer_BE.png" hash="5547426f07e0562ba9b605f1f04a9ad7"/><file name="bankTransfer_BE_small.png" hash="007dbd9f27115b601eb94db09a10b8f3"/><file name="bankTransfer_BE_tiny.png" hash="cf0285a691339efad52d82d40c7aa9f1"/><file name="bankTransfer_BG.png" hash="be209415f5bec0a45bd2bd9cd3c41d0a"/><file name="bankTransfer_BG_small.png" hash="6249144aa579c494988b5bbecb22eb69"/><file name="bankTransfer_BG_tiny.png" hash="7c11956844dbf7cc76db038b32fc7ab1"/><file name="bankTransfer_CH.png" hash="9b20d62386085ac2c9da1227abec5d58"/><file name="bankTransfer_CH_small.png" hash="2887bcf97901ed7ed6bc4fb5d8a00876"/><file name="bankTransfer_CH_tiny.png" hash="c0218d075bbb503689f40007a331ba85"/><file name="bankTransfer_CZ.png" hash="78f7aac275e10af77b3bbab28ba1aa23"/><file name="bankTransfer_CZ_small.png" hash="7bf17799b64aa618945981eb7fa00cce"/><file name="bankTransfer_CZ_tiny.png" hash="7f2a7e2fde701bff21fa388776e73632"/><file name="bankTransfer_DE.png" hash="989d5e1cc2547504b0fbc7aa88e08713"/><file name="bankTransfer_DE_small.png" hash="fb50048c4acfdebf85c4c8f90d8b08d9"/><file name="bankTransfer_DE_small.xcf" hash="cfbc9a47bc116e97a121771c0aa6fe83"/><file name="bankTransfer_DE_tiny.png" hash="d4d68f1068df68f61cb828005c9c0ac9"/><file name="bankTransfer_DK.png" hash="a2e9a409144a8ef18747faafa2937609"/><file name="bankTransfer_DK_small.png" hash="71e75c357b475fe236b633ac8a2a76cd"/><file name="bankTransfer_DK_tiny.png" hash="0103bbe5b8a803aad990bd4ad53c88c0"/><file name="bankTransfer_EE.png" hash="9caa3e1ac3558e9ec372c45df045bae6"/><file name="bankTransfer_EE_small.png" hash="91ffe550444bac13ac29ac1696ffdfac"/><file name="bankTransfer_EE_tiny.png" hash="59ea293d7ba58cd6dd9a9a2b43088093"/><file name="bankTransfer_ES.png" hash="7d0051c7ee32eddca94b89368bb5afbe"/><file name="bankTransfer_ES_small.png" hash="2dc1519510ef7bea726e0bca70859c06"/><file name="bankTransfer_ES_tiny.png" hash="a2338a0d60b2585ac34269daf794d189"/><file name="bankTransfer_FI.png" hash="ffbe8dfa936a4628e3c029bd957f367d"/><file name="bankTransfer_FI_small.png" hash="1db5d45d947502483a2e8c40aab3734d"/><file name="bankTransfer_FI_tiny.png" hash="b9f26cef0fc7f051b6d79ada14c902ba"/><file name="bankTransfer_FR.png" hash="572f77cf0f22103300682c5f89e9d9e9"/><file name="bankTransfer_FR_small.png" hash="58a268c927e4d19858ed3241ceac05f8"/><file name="bankTransfer_FR_tiny.png" hash="dee4c0c47d94fb0e2ab032264c4d1543"/><file name="bankTransfer_GB.png" hash="5a7eee2f31bec7bf422425f31aea2d5a"/><file name="bankTransfer_GB_small.png" hash="17d3c0ca20cee2250e3b6d0f5f080ba9"/><file name="bankTransfer_GB_tiny.png" hash="24d7d3ce5dc62ef776f3f36f24ff78b1"/><file name="bankTransfer_GI.png" hash="e9035b335bd8dc809c7e4afc7d775cc0"/><file name="bankTransfer_GI_small.png" hash="e51bd2f8333a8d8b2163c777c5b12b48"/><file name="bankTransfer_GI_tiny.png" hash="d158401d4dd73a057adac68f3f23ad89"/><file name="bankTransfer_GR.png" hash="aefe60c85d74d77d1c1327538617f297"/><file name="bankTransfer_GR_small.png" hash="b9a0a5d6ec52c80d72d8e8cf903f37f3"/><file name="bankTransfer_GR_tiny.png" hash="1dc0912afd646785eade5d8785baa12c"/><file name="bankTransfer_IBAN.png" hash="f636fcae0c128e08baaef26dacaa078d"/><file name="bankTransfer_IBAN_small.png" hash="ffc0073f2fe405de05206cdfc1565daa"/><file name="bankTransfer_IBAN_tiny.png" hash="4a4f64cb62ca9cfec99d117d0169bb83"/><file name="bankTransfer_IE.png" hash="eb6efba5502d54571022feaef9a9ded3"/><file name="bankTransfer_IE_small.png" hash="d9359e8a2bf8c04d4d43acdcc8b30a5e"/><file name="bankTransfer_IE_tiny.png" hash="b3a0f75656b535960c362baaabc45ce3"/><file name="bankTransfer_IT.png" hash="cd56062b943e4ec6716bc72ebe4b62a9"/><file name="bankTransfer_IT_small.png" hash="29ac58a26ae12dc26dd2d501262ed361"/><file name="bankTransfer_IT_tiny.png" hash="c45892a3e2ae81bb9b4508d79164e556"/><file name="bankTransfer_JP.png" hash="20023e2e93afc881740ea74e89251d86"/><file name="bankTransfer_LU.png" hash="b3dbdeea3429de5280c3a6d911930e9a"/><file name="bankTransfer_LU_small.png" hash="ebb919c647653075be4d9bfaeec8c00c"/><file name="bankTransfer_LU_tiny.png" hash="ec058289aef35f481077c56cdf758032"/><file name="bankTransfer_MT.png" hash="8955bc706cf66307ba69e58d8006af2d"/><file name="bankTransfer_MT_small.png" hash="13ce68bbda83c39b8719d356705da6d2"/><file name="bankTransfer_MT_tiny.png" hash="b05aa11e844f09fa797a3540534e5155"/><file name="bankTransfer_NL.png" hash="ccffd7131f791f7eb44e21b42fd66cc4"/><file name="bankTransfer_NL_small.png" hash="90f18f3784ec4c4733891aafd2e83958"/><file name="bankTransfer_NL_small.xcf" hash="ac17edd9804089820e9d73c76441abfc"/><file name="bankTransfer_NL_tiny.png" hash="61e9d461381aa1fb7e9dbcc8012686e0"/><file name="bankTransfer_NO.png" hash="ffcb1204470ff94a7cf2025e000e4978"/><file name="bankTransfer_NO_small.png" hash="daab5aceaf8e4dd59dfcf29fa69cdc24"/><file name="bankTransfer_NO_tiny.png" hash="3fbbf9e381d8d0d9ada61a54778655cb"/><file name="bankTransfer_PL.png" hash="cd25fefef6bce86a97ab7242138360e2"/><file name="bankTransfer_PL_small.png" hash="880b17d7d090c7bd21965e9b78894851"/><file name="bankTransfer_PL_tiny.png" hash="9579393e3dbb3c2aeb7ebf35e54ef4e7"/><file name="bankTransfer_PT.png" hash="c3c652523d77b5d085da97111c96ef9e"/><file name="bankTransfer_PT_small.png" hash="9d3a979ef52298bcc1545b131bd4a3db"/><file name="bankTransfer_PT_tiny.png" hash="cf2be093140773d75d8993fab7aa347c"/><file name="bankTransfer_SE.png" hash="e5608461fa8bdbac771449f30cde91ec"/><file name="bankTransfer_SE_small.png" hash="0f57f6092f8bef25c9973a140a2d85ad"/><file name="bankTransfer_SE_tiny.png" hash="79f3a00608bf18d686d89562af80a72f"/><file name="bankTransfer_SK.png" hash="2390a923affb1640b1b8bb801ce04705"/><file name="bankTransfer_SK_small.png" hash="50adde906c3a965992bbfb04554a5371"/><file name="bankTransfer_SK_tiny.png" hash="d4866f13969214fd774ea1c427a048e6"/><file name="bankTransfer_US.png" hash="9013561099b618aa954f5a3e1352a6ce"/><file name="bankTransfer_US_small.png" hash="191e204c1216a199229da9d75ed1a2a5"/><file name="bankTransfer_US_tiny.png" hash="9d9e942b93d13a18e38aac0ee932fe15"/><file name="bank_ru.png" hash="2390a923affb1640b1b8bb801ce04705"/><file name="bank_ru_small.png" hash="01c263789dd7e38ac4078f55161ec19b"/><file name="bank_ru_tiny.png" hash="d4866f13969214fd774ea1c427a048e6"/><file name="barras.png" hash="389f5242e23cc5b386392d5d21459f21"/><file name="barras_small.png" hash="9e657657b963a1434e88d4289acf9448"/><file name="barras_small_grey.png" hash="d14dbd53e9a52706bf736525a90d8f63"/><file name="barras_tiny.png" hash="e46d37c7e69ef3722876a0205431f1c8"/><file name="bcmc.png" hash="28dca1b34022f2c653c13556c452fce3"/><file name="bcmc_small.png" hash="49698208e5b73f80773260c3fdb3e5a3"/><file name="bcmc_small_grey.png" hash="5069f14bff23c074af6fe2092a2e482a"/><file name="bcmc_tiny.png" hash="3b4221516dc0d1ace3432a473903991e"/><file name="beelinesms.png" hash="a559096cb240aaf7696be7563498b18b"/><file name="bijcard.png" hash="c93da8e22fac6869d729e961df24b593"/><file name="bijcard_small.png" hash="f188b92b77af1613a91c00450d3eb168"/><file name="bijcard_small_grey.png" hash="08eb4420ac9f7a7f691d688e9550f651"/><file name="bijcard_tiny.png" hash="b88eeed8f7318514f849e3ed3a9a2ce8"/><file name="bill99.png" hash="461213bcf10fb394ef524d3a0ad92ee0"/><file name="bill99_small.png" hash="d6e30f7d3da5ce34af3aa7e2353b4809"/><file name="bill99_small_grey.png" hash="a66c49f3556fa99301f4288341eaa014"/><file name="bill99_tiny.png" hash="d10dbbf6512e15252ad6d1337670a7fd"/><file name="boleto.png" hash="3968115c3576a14f7cdc8ebd98c8092e"/><file name="boletobancario_hsbc.png" hash="3968115c3576a14f7cdc8ebd98c8092e"/><file name="boletobancario_itau.png" hash="3968115c3576a14f7cdc8ebd98c8092e"/><file name="boletobancario_santander.png" hash="3968115c3576a14f7cdc8ebd98c8092e"/><file name="bradesco.png" hash="d5ae6f8cb39883cce8c97c0d11257a4c"/><file name="c_cash.png" hash="1b9d5b0c9ece2eaff0be71b4082e0655"/><file name="c_factuur.png" hash="cd46b7d11c9dd79b1cc9c073c0696aff"/><file name="c_factuur_small.png" hash="63d4c6fd1e5b214d018f3e00ca687cd5"/><file name="c_factuur_tiny.png" hash="153791c1eb5bae6095e1210787ffe4fa"/><file name="c_invoice.png" hash="cd46b7d11c9dd79b1cc9c073c0696aff"/><file name="c_invoice_small.png" hash="63d4c6fd1e5b214d018f3e00ca687cd5"/><file name="c_invoice_tiny.png" hash="153791c1eb5bae6095e1210787ffe4fa"/><file name="c_oprekening.png" hash="cd46b7d11c9dd79b1cc9c073c0696aff"/><file name="c_oprekening_small.png" hash="63d4c6fd1e5b214d018f3e00ca687cd5"/><file name="c_oprekening_tiny.png" hash="153791c1eb5bae6095e1210787ffe4fa"/><file name="c_paypal.png" hash="fe5fd0065e4a84e967095f082b329d7f"/><file name="c_paypal_small.png" hash="294698dab8f5aa31f2ad62702bd9d379"/><file name="c_rembours.png" hash="fb2da23375ce5ba67380dc0fb60e7669"/><file name="c_rembours_small.png" hash="0d0f244c1820921db3a6635552cf8129"/><file name="c_rembours_tiny.png" hash="c15d78de45389d475f2786fed3e81c4b"/><file name="card.png" hash="adfe3d9fe45c3f94b9edca852e2cb38c"/><file name="cashticket.png" hash="0dba12beffb7c5ebf47ae1e5701426f3"/><file name="cashticket_small.png" hash="ade5518971a871dd48b0628af6f6cf89"/><file name="cashticket_small_grey.png" hash="348c3721fbedfb2a7121f57db435f43e"/><file name="cashticket_tiny.png" hash="95248971eb69c150748b9acf27f68fb5"/><file name="cashticket_tiny2.png" hash="16ab15f5263fe81ab5233d02ce2cd715"/><file name="cashu.png" hash="1b6d79438ad686cdff44866a66445dca"/><file name="ccavenue.png" hash="aee563b4c9c77d8a881db1e79ad8758d"/><file name="ccavenue_small.png" hash="ffa7390808c679e8d6c580fcf14054fb"/><file name="ccavenue_small_grey.png" hash="9a6c58e88230fb6a167e597752a533ab"/><file name="ccavenue_tiny.png" hash="994d56725d095d107fb33c6f3abf7653"/><file name="cellpaypoint.png" hash="c676483390c0c7e932a320b6326593da"/><file name="cellpaypoint_small.png" hash="f720447e73325b922568a00d0effe75c"/><file name="cellpaypoint_small_grey.png" hash="c6deea99f2099ade43b2b75dcb62f273"/><file name="cellpaypoint_tiny.png" hash="5c00501360e94b3020ff54bccbc2e531"/><file name="ciberpay.png" hash="625d300997f331918e912dc266e1a3a4"/><file name="contact_ru.png" hash="5f70b79ee4232a81a9f7eb0224b0ba3c"/><file name="creditcards.png" hash="cd1a83b970a38307c2899f9949495a00"/><file name="dineromail.png" hash="9058ea237d278d5fd238c2d180807c57"/><file name="dineromail_ar_amex.gif" hash="4a94da8ec02c565e8cfcb66fbfffe362"/><file name="dineromail_ar_argencard.gif" hash="422ea3362cc44616f72a887f5cba66c6"/><file name="dineromail_ar_banktransfer.gif" hash="758e12e370a5b213996ea1f39259721a"/><file name="dineromail_ar_bapropago.gif" hash="df51325a4fae890a5a6673f92bb64f5d"/><file name="dineromail_ar_cabal.gif" hash="98f6cc5d54df43b4c4a17d9fc2dfb9bd"/><file name="dineromail_ar_cobroexpress.gif" hash="910960360ea1cd632a69ab500cd627ee"/><file name="dineromail_ar_dm.gif" hash="b458246e266ecb059865ab17b7673882"/><file name="dineromail_ar_italcred.gif" hash="aa4376df77748d39c670001794e7991f"/><file name="dineromail_ar_master.gif" hash="126cdc5db597363e5934cf19205f8f45"/><file name="dineromail_ar_pagofacil.gif" hash="2c85235d6dff444b1b914488d035eb7b"/><file name="dineromail_ar_rapipago.gif" hash="c745eb4d456f03c6643f40e77f9ad6ac"/><file name="dineromail_ar_tshopping.gif" hash="552daaa4621397aaed5cea3ad5fc89ec"/><file name="dineromail_ar_visa.gif" hash="61c86fd2afade160736b1c318a8280a6"/><file name="dineromail_ar_visa_hipotecario.gif" hash="bbdb3933302107611678bd7a87779a6c"/><file name="dineromail_br_amex.gif" hash="4a94da8ec02c565e8cfcb66fbfffe362"/><file name="dineromail_br_aura.gif" hash="b4a8dea00ceebb3d1d64660a997ac22d"/><file name="dineromail_br_bbancario.gif" hash="d9adffbdf626846cfe11b874c5bc0715"/><file name="dineromail_br_diners.gif" hash="b4f437b40f747842cb32becf8af28eb4"/><file name="dineromail_br_dm.gif" hash="65fa3eb604d2d5cd64b76ea0419788a6"/><file name="dineromail_br_hipercard.gif" hash="329dd978884c554fc8c0a37bd6c1ded9"/><file name="dineromail_br_master.gif" hash="126cdc5db597363e5934cf19205f8f45"/><file name="dineromail_br_oipaggo.gif" hash="9cad6e46ea39ec1d6af77ce9322835c1"/><file name="dineromail_br_visa.gif" hash="61c86fd2afade160736b1c318a8280a6"/><file name="dineromail_cl_amex.gif" hash="d4942bf6dab3c072e701e709adaecf78"/><file name="dineromail_cl_diners.gif" hash="9f5bccfc0ab73993405821859dab56b0"/><file name="dineromail_cl_dm.gif" hash="0b886856a701eff48c710a4812f999d0"/><file name="dineromail_cl_magna.gif" hash="bbbbed0d123e619dbf9ffc3308cb4f6e"/><file name="dineromail_cl_master.gif" hash="38b5c034caa6249caf49256f7df4894c"/><file name="dineromail_cl_presto.gif" hash="fa18e40e599f4216d0efea05d9329b5b"/><file name="dineromail_cl_ripley.gif" hash="8a0fe5295feeb9959f2dedf17b304215"/><file name="dineromail_cl_servipag.gif" hash="51cc675b605ce7dd88016743fc324e09"/><file name="dineromail_cl_visa.gif" hash="87fa159904723d830b30d9a0f2f2ff00"/><file name="dineromail_mx_7eleven.gif" hash="7595248bd6c735fc9cd28a0afe9e035c"/><file name="dineromail_mx_amex.gif" hash="4a94da8ec02c565e8cfcb66fbfffe362"/><file name="dineromail_mx_bancomer_tc.gif" hash="b2854f409126920b1c9cf8ed3792a349"/><file name="dineromail_mx_dm.gif" hash="9eede7e49ebcb145494952f6edb749b2"/><file name="dineromail_mx_hsbc_tb.gif" hash="1fb60730a0dfe9d0a0ebef45af1d8fdd"/><file name="dineromail_mx_ixe_tc.gif" hash="6e19e5be52b5bfce749f16b26e933c2e"/><file name="dineromail_mx_otherbank_tc.gif" hash="df05af375e248dcc04324aa92b6163b0"/><file name="dineromail_mx_oxxo.gif" hash="ee69da5b06d9c52ef76dd1a20bab5ebb"/><file name="dineromail_mx_santander_tc.gif" hash="5bb0f9600b1b8ad67d0a418c2412a506"/><file name="dineromail_mx_scotiabank_tc.gif" hash="dbe7bdd2d9327086cae42ee6a842d00c"/><file name="dineromail_small.png" hash="356e06d5a2fd5f98f3da4dfc192e389c"/><file name="dineromail_tiny.png" hash="98f6b908f7025a8babaffafcc1336428"/><file name="diners.png" hash="6310bb53fe7921cf016309d6a75b8c22"/><file name="diners_small.png" hash="ecf5d635a74460ca9575bb7d6d8550dd"/><file name="diners_small_grey.png" hash="77ff46143b8a4aab54eb35c345806a83"/><file name="diners_tiny.png" hash="881b5998d35cc373d294ca21689015d5"/><file name="directEbanking.png" hash="6d7ce2ff213c33743d80ab83fb24e8de"/><file name="directEbanking_axa.png" hash="3d90797ef39a0db23dd6373bdfef9ee8"/><file name="directEbanking_cbc.png" hash="f23617618a9e2ce7863a931947b49adb"/><file name="directEbanking_de.png" hash="9fa16b098e744e94553952c5a28c7dd2"/><file name="directEbanking_de_grey.png" hash="109b1237e5d69d7ae82dc9a64d6ab4fd"/><file name="directEbanking_de_small.png" hash="5f65ee79ae22c4ba52e6a8485cf155cd"/><file name="directEbanking_de_tiny.png" hash="15983a607b8151f0be3b5ecfb067ea7a"/><file name="directEbanking_dexia.png" hash="37ebcc9a12bc9c88d540f78adf9bd679"/><file name="directEbanking_fintro.png" hash="389b1a7b14e5466b7b0dd4721aee0433"/><file name="directEbanking_fortis.png" hash="511cc06fefa644cc7575a0efb227bd64"/><file name="directEbanking_grey.png" hash="109b1237e5d69d7ae82dc9a64d6ab4fd"/><file name="directEbanking_ing.png" hash="ac4f224d0fe9aee23d143acc5198dd72"/><file name="directEbanking_kbc.png" hash="eae3c85e332e4289841bd27a46031db3"/><file name="directEbanking_small.png" hash="db84d47793f8e375d48dc8b17f8a0ddf"/><file name="directEbanking_small_grey.png" hash="7f4fbbcfe647cf8d280238754061d042"/><file name="directEbanking_tiny.png" hash="7d804d09c7df931eb9cafc2d3a4984b1"/><file name="directdebit_BR_bancodobrasil.png" hash="784271e1bf909c95e79ff7de4d92ed5b"/><file name="directdebit_BR_bradesco.png" hash="d5ae6f8cb39883cce8c97c0d11257a4c"/><file name="directdebit_BR_caixa.png" hash="a0d69bc8a40bf120fc2138a694c31186"/><file name="directdebit_BR_hsbc.png" hash="4943f73d211b8111fd81ca8d4e06160d"/><file name="directdebit_BR_itau.png" hash="b24ed466c1d694dca7dc26ee42dbf330"/><file name="directdebit_BR_santander.png" hash="bd73ea7f9f46b0ed583e764f01e9a8d0"/><file name="directdebit_NL.png" hash="cf1246761401ad866b72d7b520506b22"/><file name="directdebit_NL_small.png" hash="2e6a7444f509232818458312f28f8c50"/><file name="directdebit_NL_tiny.png" hash="99ea09a985cf0221ce87d3696211704e"/><file name="discover.png" hash="491378a0e2ae6223ab41fc925b67575d"/><file name="discover_small.png" hash="8573aebe4938afb288749badb22aa091"/><file name="discover_small_grey.png" hash="e60b18fcd2f0509c02a08fa0bf7024b2"/><file name="discover_tiny.png" hash="78a2cb6ccedb121d3138b280e1778f84"/><file name="dotpay.png" hash="a09962a7357374482444accf6b066037"/><file name="dotpay_inteligo.png" hash="25492f3d9eaabae7aa1441fdf24947b3"/><file name="dotpay_moje.png" hash="1c948c8e2db27f09e44e4c6f3591e39c"/><file name="dotpay_mtransfer.png" hash="e9ef4a420639f227e650c9e456235059"/><file name="dotpay_multitransfer.png" hash="b604e3e946b41437bc485b0a95a76b2a"/><file name="dotpay_nordea.png" hash="cfda5216a9ae9b829e5121bbfaaf887b"/><file name="dotpay_potzta.png" hash="88670102fd0e7f532357d06ec66a8ec6"/><file name="dotpay_przelewz.png" hash="06cbe8767f3b1810e2a72b19a1bcc9c7"/><file name="dotpay_przelewz24.png" hash="64143c67feac20a193fd459ba0a6e8b4"/><file name="dotpay_small.png" hash="aabbcc9e2471e044c38ab63d8aa6d48f"/><file name="dotpay_tiny.png" hash="5c746221e7ec781c18bb4d7e6f0a66a0"/><file name="dotpay_zabka.png" hash="a6edae22b53cdd3b997f8c9b50840b2c"/><file name="ebanking_FI.png" hash="7d717c71a9174624d8e30a314c4f091e"/><file name="ebanking_FI_aktia.gif" hash="092c03a2319bd7c5d8fc9dc98516be46"/><file name="ebanking_FI_alandsbanken.png" hash="d64698c6c6dc9b6c8e1d2179dfb61d8d"/><file name="ebanking_FI_handelsbanken.png" hash="06f99903ea285bc5cf392ea6c642a267"/><file name="ebanking_FI_nordea.png" hash="c68ecd7c03b5d6a0819110c56df501e8"/><file name="ebanking_FI_osuuspankki.png" hash="cf9f495363970b9da3dbbaffe1031225"/><file name="ebanking_FI_sampo.png" hash="e5b4bd2ac745258b22ab832be253654a"/><file name="ebanking_FI_small.png" hash="57635f01d33e65d40af90d3ab4088ad7"/><file name="ebanking_FI_spankki.png" hash="e88599e1318b54be1990363607819811"/><file name="ebanking_FI_tapiola.png" hash="27ad56685d2e0e641a8d3e95942630ef"/><file name="ebanking_FI_tiny.png" hash="b0e3de2e531c362daaac6063c7a59d9e"/><file name="ebetalning.png" hash="0bc7c8cc01264df81ad06b0b75ce7c0a"/><file name="ebucks.png" hash="33d683c3a6f4f61df3c36e09d867936e"/><file name="ebucks_small.png" hash="c2afb7964e668ba7ba0416682fdd831b"/><file name="ebucks_small_tiny.png" hash="dd79fc153f0a7fcc79e628383e76ee26"/><file name="ebucks_tiny.png" hash="6085ef04ad96289d6a98e429c6d061ba"/><file name="elba.png" hash="8d2bfd3e8c0953b5d1ba80e201d25069"/><file name="elecsnet.png" hash="4a27849dfd5a8bc6771a962aff3908f4"/><file name="elv.png" hash="8e47d6ce919e1be80328665798d387ec"/><file name="elv_small.png" hash="a565fd570c28204b7ed0e92ebf667012"/><file name="elv_tiny.png" hash="3c9d929660d6279f255c7be9bf02ee8f"/><file name="empty.png" hash="65d7e6c42582ea986cb66ad78768b2ae"/><file name="enets.png" hash="5eae578677220e7085374936ffc2ec6a"/><file name="entertainmentcard.png" hash="df44b82c45f98790ea0e8866ecb5fee7"/><file name="entertainmentcard_small.png" hash="0466be6962e63c80c766ca4b092cded6"/><file name="entertainmentcard_small_grey.png" hash="32b0a15b2467decf84db199cd6db3bcf"/><file name="entertainmentcard_tiny.png" hash="2a7610575298bf7029bbbfad2bb86596"/><file name="forwardmobile.png" hash="023348014c3838963e48bdc8b397c387"/><file name="frame.png" hash="5e2226d7539f5d95dabe5988f4446282"/><file name="gallgall.png" hash="2e6b9f6aafaebe09112e089c05aa64ea"/><file name="gallgall_small.png" hash="24fabea2d5af04bedf9dd69e2368b943"/><file name="gallgall_small_tiny.png" hash="671cb1ce378d811cddaf77af7545d365"/><file name="gallgall_tiny.png" hash="769bf04c15a3b81f06940c237c3b3706"/><file name="giropay.png" hash="469cb654fe84b923b86b06723455ef9d"/><file name="giropay_small.png" hash="444f3a6307bb83a1d20d19e1cb8237f9"/><file name="giropay_small_grey.png" hash="565dd52d036a87d5c515c8bec4cef4f3"/><file name="giropay_tiny.png" hash="3a677e8d71ce59332e012db5bc343106"/><file name="globegcash.png" hash="580003d47ef03a6d1c7203bfc250b6d3"/><file name="globegcash_small.png" hash="cd18f17b46acb7ca15370b000f9bfa95"/><file name="globegcash_small_grey.png" hash="36e88a7a7170eb0c5ca7d3a8f2b08f13"/><file name="globegcash_tiny.png" hash="006794f78d9a43a56543a6e6b5a7ebd8"/><file name="hansabank.png" hash="b4dad91137678e09a650e1c6693e98d3"/><file name="hdfc.png" hash="b6e57b76ee8920607a2a0a809ee40d48"/><file name="hdfc_small.png" hash="1b9e555bfab7c0f11631dfecacffa637"/><file name="hdfc_small_grey.png" hash="cadac6a01cdab50cff177a1c0feb6156"/><file name="hdfc_tiny.png" hash="584260909cebec2286b6d1cd9489c7d4"/><file name="hppPos.png" hash="4780e785c785e93aed6ad13df323d6ef"/><file name="hyvesafrekenen.png" hash="5c8068c5b31a55f043cee6dff3246bb7"/><file name="hyvesafrekenen_small.png" hash="5a4c5747c030ac74cea799032ada3b26"/><file name="hyvesafrekenen_tiny.png" hash="2215dc356edeb426da65f43536960afe"/><file name="ideal.png" hash="6a851bfc5bac2835fd31c18c1224e8c9"/><file name="ideal_small.png" hash="8b115bda559a24a3564e02f7a90caae9"/><file name="ideal_tiny.png" hash="140c2e52427e074f95627a44db1f9f88"/><file name="interac.png" hash="c63021e21273e83423d8af2b4c7c1728"/><file name="interac_small.png" hash="0c74bd42750252eda57b054651afca18"/><file name="interac_tiny.png" hash="1a42ba184555605ab8e2ea1a4956f21a"/><file name="ipay88.png" hash="116aa967091843ee6e8e911ff4c34b22"/><file name="ipay88_small.png" hash="1dfb38797a43657d72b0701c446a841e"/><file name="ipay88_small_grey.png" hash="418f051bc03571334cec46e122fa698f"/><file name="ipay88_tiny.png" hash="0009e8c253c57564c3688010c5192ad4"/><file name="ivr.png" hash="0ebef34ac806802b0d29c1d74f84fdbf"/><file name="ivrLandline.png" hash="0ebef34ac806802b0d29c1d74f84fdbf"/><file name="ivrLandline_small.png" hash="155f9a61db970885782db7cbe997dab4"/><file name="ivrLandline_tiny.png" hash="ecf7994d1e627023dbd47615a8ebb848"/><file name="ivrMobile.png" hash="6a16e39d5deffb8fa3234108ca97b7de"/><file name="ivrMobile_small.png" hash="a9756b756b3ea56dea07a16edcdf39a9"/><file name="ivrMobile_tiny.png" hash="8c35341f8a8f6ca16b752ff7e1bb51bf"/><file name="ivr_small.png" hash="155f9a61db970885782db7cbe997dab4"/><file name="ivr_tiny.png" hash="ecf7994d1e627023dbd47615a8ebb848"/><file name="jcb.png" hash="68303da687ac6e8615196a66f40bb6fb"/><file name="jcb_small.png" hash="f469481ddecb206cfc74478c6b58266e"/><file name="jcb_small_grey.png" hash="ddb4587396f2e7c7ad83d2aa6561cf7a"/><file name="jcb_tiny.png" hash="5d89108481655ee9dc2dbf6476bbcc14"/><file name="kadowereld.png" hash="c2eea3806e2f55ffa2f7eb3154450be5"/><file name="kadowereld_small.png" hash="203f4584e34c3f059025f3d4329b4898"/><file name="kadowereld_small_grey.png" hash="3afa5e33cd29e5c3ce1723ea10607463"/><file name="kadowereld_tiny.png" hash="b2ca2f7f504670555d332f4c5e8d3074"/><file name="klarna.png" hash="51bc6b70472fe29b728192222b88c709"/><file name="klarna_small.png" hash="57a98dc539dd5c329aac8540a3204d1e"/><file name="klarna_tiny.png" hash="fe0295e2cba0b79136e86180d7db5963"/><file name="laser.png" hash="c64699ddd372b4a48e72b8066fd2aa78"/><file name="laser_small.png" hash="abda432193ffcd5388037fa34b9e0737"/><file name="laser_small_grey.png" hash="ef7193af17ae93fa9bb5215a0ec73195"/><file name="laser_tiny.png" hash="2f87b8e37582541355e9b77008cf3853"/><file name="maestro.png" hash="e91fa85475ae74b16b92b7ac05e562c2"/><file name="maestro_small.png" hash="7814fbfff53e57643137fd68889ec807"/><file name="maestro_small_grey.png" hash="31ab5c8168e8a5b075fe1136b221d453"/><file name="maestro_tiny.png" hash="87ff6ebe1ef2e4cbae340881169065c4"/><file name="maestrouk.png" hash="cf0fcc0e1f41ad2301d5814e4a9c88c4"/><file name="maestrouk_small.png" hash="7814fbfff53e57643137fd68889ec807"/><file name="maestrouk_small_grey.png" hash="31ab5c8168e8a5b075fe1136b221d453"/><file name="maestrouk_tiny.png" hash="87ff6ebe1ef2e4cbae340881169065c4"/><file name="mc.png" hash="0d108b48ed7f8e1f0020da611e223800"/><file name="mc_small.png" hash="51ca51c64a8f0277961effeb0a0dedbb"/><file name="mc_small_grey.png" hash="0762490e5dc86277d0e411468b01a269"/><file name="mc_tiny.png" hash="814af4ec011f2f33edb7d38763dea2ea"/><file name="mercadopago.png" hash="e8cdc9cab0494fbaec13ffa7a008f0d6"/><file name="mimoney.png" hash="0f6d07a6156c6dc931636c8c618384ac"/><file name="mimoney_small.png" hash="4a8b0586fd04690de902120a463ca5b2"/><file name="mimoney_small_grey.png" hash="c85a2d63e583a8fd231713d30d484ecb"/><file name="mimoney_tiny.png" hash="0c562f6e53a95ebe2ff12747f9271a56"/><file name="moneta.png" hash="c208f24cbe664e0c9df753d1dd6b8d43"/><file name="moneybookers.png" hash="7bfc54c2a787b53f699f124d7449a169"/><file name="moneybookers_small.png" hash="1290894e479fafda67291355ea65defe"/><file name="moneybookers_tiny.png" hash="4ed8a8052e9b394e174889de6d621604"/><file name="moneymail.png" hash="73d044eac9d9f1679a653dd2e62935f3"/><file name="moneymoney.png" hash="7204b9579b665085d00b1ea2184b678f"/><file name="multibanco.png" hash="178a9292a9743e3b8904f105e7d6715b"/><file name="nedbank.png" hash="a8a2dc3af1e76262b75270a24a041331"/><file name="nedbank_small.png" hash="d386a8672bd21e53580ae32ae529ca3a"/><file name="nedbank_small_grey.png" hash="7085229e1217e47b07663764f8bb1e6e"/><file name="nedbank_tiny.png" hash="af3694515dd8b68ca71324ca20089c58"/><file name="onebip.png" hash="ca289a3c9fd8d72bce90165db98a88b9"/><file name="online_RU.png" hash="afcc9ad6292e2e21feff4af23e2fa46e"/><file name="online_RU_small.png" hash="712fa0be37857b024e3118d96da61bab"/><file name="online_RU_tiny.png" hash="0e3ac8d1ca10dff95657aa9b9ebdc13b"/><file name="online_transfer_de.png" hash="43324fb914cdbf8eff66f3668a353f1e"/><file name="openinvoice.png" hash="cd46b7d11c9dd79b1cc9c073c0696aff"/><file name="openinvoice.xcf" hash="d5f41ec9c48415f65a519c33999a1229"/><file name="openinvoice_small.png" hash="63d4c6fd1e5b214d018f3e00ca687cd5"/><file name="openinvoice_tiny.png" hash="153791c1eb5bae6095e1210787ffe4fa"/><file name="pagosonline.png" hash="04a1d0c0bb46ed7f931b3d4e248f8c0a"/><file name="pagosonline_small.png" hash="9768e52502eb299716268a212a044812"/><file name="pagosonline_small_grey.png" hash="e9f7365e885652200fdb08201e1b13cf"/><file name="pagosonline_tiny.png" hash="70d51512b8bf5215f5865b21a3ca7731"/><file name="paypal.png" hash="02362803ca1d3ab9c9e8dc3176100d66"/><file name="paypal_small.png" hash="294698dab8f5aa31f2ad62702bd9d379"/><file name="paypal_tiny.png" hash="709c47f06297455d8d55d6937245e016"/><file name="paysafecard.png" hash="20861199bb6e8781c0b10e995f1490de"/><file name="paysafecard_small.png" hash="e7452ca00265fdc91dd28a2b326355d3"/><file name="paysafecard_small_grey.png" hash="06377beb14a2666f153b273e89053419"/><file name="paysafecard_tiny.png" hash="92b3df13741ef6f71d2c12206ab3f412"/><file name="payu.png" hash="bc671fff056fd108fe24ba52053111b0"/><file name="payu_small.png" hash="ca3eb82cb24dd1f1bfc34436287dc9d0"/><file name="payu_small_grey.png" hash="6097711eeb2ea309d407c03a467e1653"/><file name="payu_tiny.png" hash="2b89f57174338ba3d3192eb8519ece3f"/><file name="plastix.png" hash="82d3202239d01c6bf49d8dc2399900e2"/><file name="plastix_small.png" hash="447240736bdba2d15a34986395c3fb1f"/><file name="plastix_small_grey.png" hash="7e039f412a96a0e884f86598ebfccfb1"/><file name="plastix_tiny.png" hash="aaff5ff8c33af35fe4ae64e627c0964c"/><file name="platezhru.png" hash="2f36e088146ab75470c7a55177db8c07"/><file name="platika.png" hash="03e93ab41b0d330706e2c4f85cae966a"/><file name="postoffice_ru.png" hash="8ade3cd1711071ab73248d4ba62eae64"/><file name="pps.png" hash="29f4efc8d08cfd5ba90920b1fcef6bde"/><file name="pps_small.png" hash="7bf1fa7c4adcd8dfc2b2f56eb172fcaa"/><file name="pps_small_grey.png" hash="08d6188b7f5c13ec9c5f3488b4cbf19e"/><file name="pps_tiny.png" hash="4ed68db4ca98ac69f0557319a8284c8d"/><file name="pse.png" hash="6af65a4a18af66d103473fece5536e1c"/><file name="pse_small.png" hash="1f6695131dca61647b07f7180e695c46"/><file name="pse_small_grey.png" hash="7adf2fdfc48d8b078f7c0aeaa4f50e1c"/><file name="pse_tiny.png" hash="128b2749a126cfade0300f27c6919308"/><file name="qiwi.png" hash="b5e092af3394bc333fe83d073e8a6dfd"/><file name="qiwiwallet.png" hash="623b4c7fec53864fdee6d567da5f61cc"/><file name="refresh.png" hash="69ddc65b628d15a4375e66792c07484f"/><file name="safetypay.png" hash="af4e58d22f816f148faae179d0867b3f"/><file name="safetypay_small.png" hash="26749f1a95011897c8aaf568425df3dc"/><file name="safetypay_small_grey.png" hash="e5f3e5287e3fee2d77c065063b43e17d"/><file name="safetypay_tiny.png" hash="f3700f2d3cda7834cd178ac0f70d6352"/><file name="sendEmail.png" hash="cdddfa5e77d565a0ed23b6c26e0dee09"/><file name="sendEmail_small.png" hash="b5d63cc1613f08a08194442647ee451d"/><file name="sepadirectdebit.png" hash="e565455436d808fa07499131296490de"/><file name="sms.png" hash="7c6c0fddee039be4d879808b374f06f5"/><file name="sms_small.png" hash="fd1d52278d2446c7fe1c34d4fc70d556"/><file name="sms_tiny.png" hash="ed22de378fdbc717f987f8d4199e0452"/><file name="solo.png" hash="13f13c36cff7835d4a46df140fe432a3"/><file name="solo_small.png" hash="96de4f5f750a415fef573ce28092bf68"/><file name="solo_small_grey.png" hash="75c9b0b2daae0d6d80a5f5ff4f14e8d6"/><file name="solo_tiny.png" hash="3e2d7a21d19b12ed84aabdb26304fae6"/><file name="switch.png" hash="8cf19bb8c744a3f852511e781c176c07"/><file name="template.xcf" hash="e5035cd9e4e96859e50c1a9773098e89"/><file name="tenpay.png" hash="ddd0b5b8e3ff63cf1bfc555fbede0242"/><file name="tenpay_small.png" hash="2aa6c5919108eec42ed5c47ad4155a8f"/><file name="tenpay_small_grey.png" hash="6a21283b21295eefb4db553f877ea4c1"/><file name="tenpay_tiny.png" hash="736275eeec39e56c3c1d29fcb9d8ebb7"/><file name="terminal_RU.png" hash="711ab27d1cbbf6771e0ee133f75c7c46"/><file name="terminal_RU_small.png" hash="9bafe5dd035f73757f553250382764c6"/><file name="terminal_RU_tiny.png" hash="1b4dce2e901d90185933420cd80648cb"/><file name="tnt_rembours.png" hash="a8abb6f51d7893da39fcc2477d7bd2bb"/><file name="tnt_rembours_small.png" hash="72ee2b0ae6742cd325bda44a14093f4c"/><file name="trustly.png" hash="2a82872cc0ada644b0442e05423a2db8"/><file name="trustpay.png" hash="88a3680bf1007661ab4fc63106aa1ff4"/><file name="uhisbank.png" hash="8c0967455a15aefe3cdfb47240a18850"/><file name="ukash.png" hash="b95eb9f2658923c38a6252f5ff9ca9c7"/><file name="ukash_small.png" hash="2210a65cd1fb85bc883d112b12c79e6e"/><file name="ukash_small_grey.png" hash="65e6cc21082ebd3c93e96bbf96499df4"/><file name="ukash_tiny.png" hash="543ab39e6dcbc094188b4f473ac4b998"/><file name="unionpay.png" hash="068dee300e2c12e58e9a47d3556e977c"/><file name="unionpay_small.png" hash="55a00c9d7bbcbe1c448b449974d85af1"/><file name="unionpay_small_grey.png" hash="5c69e46ee4663f2d0e47c7f503bbd1e4"/><file name="unionpay_tiny.png" hash="45d3b4e758237412b524a5c52418da67"/><file name="unknown.png" hash="b2d137147db4d6eb7dacb5414a4f7a30"/><file name="unknown_small.png" hash="a5234e9eb2e4485acb19b196876d762b"/><file name="vias.png" hash="aca848fa54b173225fe17637699d87c4"/><file name="vias_small.png" hash="37bee85c36b52a07a4529735a194a41e"/><file name="vias_small_grey.png" hash="4da77d558ae9488ee2a85191e9db8748"/><file name="vias_tiny.png" hash="1a45f0a2696b5539195c2fcb69be49b6"/><file name="visa-electron.png" hash="308132b89febd4979bac61594919057f"/><file name="visa-electron_small.png" hash="5ab129027f4f4acbc7a9aa2b5d0e84d3"/><file name="visa-electron_small_grey.png" hash="712b876d4f060613f54f2ec04516e512"/><file name="visa.png" hash="30f9fde31aa41197e71ccd9a63a1fe75"/><file name="visa_fr.png" hash="abd117879295333ac54497e15f81ea18"/><file name="visa_fr_small.png" hash="837db98a87141717dcd1b90bcb5ff5b1"/><file name="visa_fr_small_grey.png" hash="e8cef14608278ab71ef2ffd58e65dc9e"/><file name="visa_small.png" hash="cdab39efaf22fcd2ab88f3dc42c32de1"/><file name="visa_small_grey.png" hash="9411565a7e81c5c3cc484863dc53031a"/><file name="visa_tiny.png" hash="e374bec64dcc345848b43f0a8a3490c2"/><file name="wallet_RU.png" hash="29213300b3cf644c64d915418f259d87"/><file name="wallet_RU_small.png" hash="3308a16ce0f5b474af32505f587079b5"/><file name="wallet_RU_tiny.png" hash="c46cdb588d7a9a21a909e5af842414b5"/><file name="wallie.png" hash="fc97552b8249c3e96aa6f3cf8e3577bd"/><file name="wallie_small.png" hash="c0b60fe348b16e157eb0c64043f410c2"/><file name="wallie_tiny.png" hash="df61209a0e0517bbb3d65119d5ebfcbd"/><file name="webmoney.png" hash="3cca800e0962e0078b64361de11b935f"/><file name="webshopgiftcard.png" hash="09990fe325b20c2fcdaaa855457d5348"/><file name="wiwallet.png" hash="5db11152a23a72b2f4676841261c5db0"/><file name="wiwallet_small.png" hash="a4c5567f59ca4575a316e1bf3eb066c1"/><file name="wiwallet_small_grey.png" hash="b75b2af0b5c6129e8c1d7bc9087222b4"/><file name="wiwallet_tiny.png" hash="8b53e98458e15bc19b242d05ad678f2d"/><file name="yandexmoney.png" hash="e6a38c66b08ba78a68096f8ff1b2a41d"/><file name="yourgift.png" hash="87bd1ef190d75ec64fb66b77aaeb7b8c"/><file name="yourgift_small.png" hash="17300795f7fd31d5cb730685c2eb0098"/><file name="yourgift_small_grey.png" hash="69b235ccb6b7ef0dfb3a2645be60dbc6"/><file name="yourgift_tiny.png" hash="a3bc0b90775458ff9ef8499f7a5437ca"/></dir></dir><dir name="css"><file name="adyenstyle.css" hash="77d39df20e43da4dc5ff1e749ed60afa"/></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="adyen"><dir name="payment"><file name="adyen.encrypt.js" hash="c2b680f6077b829b0129e2bfd53cf22f"/><file name="elv.js" hash="db612a634c95727ec9db82c50e9aec8e"/></dir></dir></dir></target></contents>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  <compatible/>
21
  <dependencies><required><php><min>5.3.3</min><max>6.0.0</max></php></required></dependencies>
22
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Adyen_Payment</name>
4
+ <version>2.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/OSL-3.0">Open Software License (OSL-3.0)</license>
7
  <channel>community</channel>
10
  <description>Magento Plugin for Payment Service Provider Adyen. The integration guide for this Plugin is available on the Adyen Support website: support.adyen.com, type in 'Magento'&#xD;
11
  &#xD;
12
  support@adyen.com</description>
13
+ <notes>Features &amp; Fixes&#xD;
14
+ * Show OneClick payments in Magento checkout&#xD;
15
+ * New API payment method SEPA&#xD;
16
+ * Add discount for the payment method open invoice (karna/Afterpay)&#xD;
17
+ * Optimized UI in the payment step (for the default OnePage checkout and the OneStepCheckout module)&#xD;
18
+ * Build in scan functionality for using Magento as cash register solution&#xD;
19
+ * express checkout button for payments through the Adyen Shuttle&#xD;
20
+ * Creditcard installments can now be setup foreach creditcard type&#xD;
21
+ * Installment rate (in %) is now added to the installment setup&#xD;
22
+ * For Klarna it is now possible to show date of birth and gender only when you select payment method open invoice&#xD;
23
+ * Multicurrency problem with Api Payments solved&#xD;
24
+ * Show reservationNumber for Klarna and AfterPay in the payment information of the order&#xD;
25
+ * Directory lookup call to retrieve the payment methods shown in the payment step can now be cached for better performance&#xD;
26
+ * Payment methods can now be sorted in the front-end&#xD;
27
+ * Boleto firstname and lastname automatically filled in based on billing information&#xD;
28
+ * For Boleto payments the paid amount is now shown in the payment information of the order detail page&#xD;
29
+ * Possible to select different status for Boleto if the payment is overpaid or underpaid&#xD;
30
+ * Full refund will send in Cancel\Refund request to Adyen if payment is not yet captured the order will be cancelled&#xD;
31
+ * For payment method Klarna and after pay the fields are disabled on the Adyen HPP&#xD;
32
+ * Payment methods in the checkout give back the language specific payment method text&#xD;
33
+ * Add after pay logo in magento checkout&#xD;
34
+ * Plugin version number and links for setting up now visible in the Adyen General settings sections&#xD;
35
+ </notes>
36
+ <authors><author><name>Adyen</name><user>adyen</user><email>magento@adyen.com</email></author></authors>
37
+ <date>2014-09-24</date>
38
+ <time>06:51:05</time>
39
+ <contents><target name="magecommunity"><dir name="Adyen"><dir name="Payment"><dir name="Block"><dir name="Adminhtml"><dir name="Form"><dir name="Field"><file name="Installments.php" hash="e73b36349ac2ac5f9687cd5ce5958e53"/></dir></dir><dir name="Sales"><dir name="Order"><dir name="Creditmemo"><file name="Totals.php" hash="1460f2048e15c0d08405c00e68653a47"/></dir><dir name="Filter"><file name="Adyen.php" hash="e928bb38a944adc399d6a43321084667"/></dir><dir name="Invoice"><file name="Totals.php" hash="40f4258c2e79e25bd38abb8ed7a0a778"/></dir><dir name="Renderer"><file name="Adyen.php" hash="44bc7f403e35ce4711101f8b93192190"/></dir><file name="Totals.php" hash="3d6dfca8bcd137c85828a4d9a39507c5"/></dir></dir><file name="Version.php" hash="9e527d0424b878cba5160462c69c1cba"/></dir><dir name="Checkout"><file name="Success.php" hash="8edb224af51fb76d111807168268f67c"/></dir><file name="Failure.php" hash="ead96fee55fba2cbb5044f09566e85e4"/><dir name="Form"><file name="Boleto.php" hash="a787217b71dfeab643073cfed4ec20a9"/><file name="Cc.php" hash="9e9f2b2fb861e39133635ce7adc40bb1"/><file name="Elv.php" hash="c3de45c9161b1564209b79a80140fec3"/><file name="Hpp.php" hash="afe655b84cfbdddde988725c4cee2740"/><file name="Oneclick.php" hash="ee048e190bf8c0723cba4fce18ca2b5f"/><file name="Openinvoice.php" hash="03f441912f177fb5af9f9aaef27e92d5"/><file name="Pos.php" hash="7a93f39cd4c30d5be1b56218a4e04a7f"/><file name="Sepa.php" hash="91b145e97db61846febaae1c5ac0b9d6"/></dir><file name="Form.php" hash="77d0589a32cb816dcdc6df16c98f2cd6"/><dir name="Info"><file name="Boleto.php" hash="720913657cb3aad5706aaff9e73ff65c"/><file name="Cc.php" hash="fda6af2c2c9a6988095b5f4eee3b6711"/><file name="Elv.php" hash="d35cfabffa923a7c0345a1dacde38a52"/><file name="Hpp.php" hash="bce3945267dac13f4fd9c9fd1400d11c"/><file name="Oneclick.php" hash="b0fb295f9a0572f92f0a1dc7108b9e8a"/><file name="Openinvoice.php" hash="1e99e4ab3ef75a9fa27626bd946b0407"/><file name="Pos.php" hash="8a6be4f35d43dc7791b9741cfb05b8a5"/><file name="Sepa.php" hash="9b1b5acbeb78dc774a6c13ff8db1bcb1"/></dir><file name="PosExpressCheckout.php" hash="52ead923b25324e31507c173caf95045"/><file name="Redirect.php" hash="065d1f3ba3ee85ac1826cc87df64bbb1"/><dir name="Sales"><dir name="Order"><file name="Totals.php" hash="1110ea3b2faedc600767aac41a9c634b"/></dir></dir><file name="ScanProduct.php" hash="541b0d9473ef2256dafe31a47bf0ac88"/></dir><dir name="Helper"><file name="Data.php" hash="de6afc16fd7b3c05c7a8fbc2be0b2dd1"/><file name="Installments.php" hash="6e37f0cbc7acb860fec12ca68d734a2b"/></dir><dir name="Model"><dir name="Adyen"><file name="Abstract.php" hash="9bda31a6e44bc86a53d43ae44d13bf0d"/><file name="Boleto.php" hash="e92f38062af2dcc766161ce2e92d9fac"/><file name="Cc.php" hash="044558f75f84bcdd34ae682aee80ec19"/><dir name="Data"><file name="Abstract.php" hash="cdda2d90654bff01f372a817d6e94e1a"/><file name="AdditionalData.php" hash="e4d038a60ac548e0938f75a0452d5717"/><file name="AdditionalDataKVPair.php" hash="cc2e0ba6733ef5139f44ba7c9af303dc"/><file name="Amount.php" hash="73540706cac2c2eef0252615d6200511"/><file name="BankAccount.php" hash="89124b1a311269d878e88acd56391afc"/><file name="BrowserInfo.php" hash="bd1cca3cc27aea7fad85661c7132e2cd"/><file name="Card.php" hash="ea384e9c2032ba7ad5925edfb434625f"/><file name="Classmap.php" hash="38ab9bfbfb1585852380c0551a35b9ec"/><file name="Elv.php" hash="6608688d03b047387a2b28be10c47b87"/><file name="IdealPaymentRequest.php" hash="4c3e7b5e1d98765524d022e8950c0ce6"/><file name="Installments.php" hash="ab285677d94614d631b927b427268eff"/><file name="InvoiceLine.php" hash="2013af2bbae2b07df4db34b4d8565796"/><file name="InvoiceRow.php" hash="6c6e4bfe2c2ec51d14ac99d747879bec"/><file name="ModificationRequest.php" hash="0cfe14752a16a579c3a29a6d4e66ba6e"/><file name="ModificationResult.php" hash="eec37eba3849baa4ad52b194e31ac362"/><file name="NotificationClassmap.php" hash="31166e4ef9ea728c107f5ee501d67fc5"/><file name="NotificationRequest.php" hash="4647bfc558308e8f7795ae97fbf2c066"/><file name="NotificationRequestItem.php" hash="ef0794de69076f4accc5035b3f659808"/><file name="OpenInvoiceDetailResult.php" hash="68391a7b4b2a460967ec0018a2300396"/><file name="PaymentRequest.php" hash="c302d22b311a4d8c9fec6b46d683b52d"/><file name="PaymentRequest3d.php" hash="505731df1bb63d6426a11e5d3036552f"/><file name="Recurring.php" hash="ae069455222f0315c2eaee6cdf84f461"/><file name="RecurringRequest.php" hash="aed77050f296df4f48c88038ef3ac547"/><dir name="Server"><file name="Notification.php" hash="51ed88aa2c2035e4cb7b4e992e7c8e4a"/><file name="Openinvoice.php" hash="d94166e3c8337e213061655ab7e48e68"/></dir><file name="ShopperName.php" hash="91bfea9ade01d29fa9053de87ce01560"/></dir><file name="Debug.php" hash="8044ccae24d83db38d9430cf125ada83"/><file name="Dummy.php" hash="a72ccc6e8c5268cf6786db289de4e3d9"/><file name="Elv.php" hash="f3e6067e8bb235d037c7cd78aaa703b6"/><file name="Hpp.php" hash="d5217d5df4a5c49ba4b4105fc7b8e29c"/><file name="Ideal.php" hash="8359f4eb5c28363680c08ecbc88a28a5"/><file name="Oneclick.php" hash="7196d95d7f71fc33be4df29b1ad7596e"/><file name="Openinvoice.php" hash="61d7122f706c318883c3e78ff07ce3f2"/><file name="Pos.php" hash="1769416ab285000a3fcd169466ff257d"/><file name="Sepa.php" hash="81aef386a6fa7e868cc9f22c7db008ff"/><file name="Shared.php" hash="7f3fe961a7107b6fb5625a9efe7854fd"/><file name=".DS_Store" hash="d179556f904a5601ccd01a54743c155f"/></dir><file name="Authenticate.php" hash="9de42d073756d2f1dfaa09a3af83cea9"/><file name="Event.php" hash="73452fac034ce72918bd5560a06ca347"/><dir name="Mysql4"><dir name="Adyen"><dir name="Debug"><file name="Collection.php" hash="dee84aa1c2b370a72d79031a09b9bba4"/></dir><file name="Debug.php" hash="123808b460f70ad416ed9bb92e6a1d60"/><file name="Event.php" hash="affce8ec81a3471647cc6e0612eb0568"/></dir><file name="Order.php" hash="05c5ce3b68f877b23d1396d13db18517"/><file name="Setup.php" hash="45997ed47c197cb302d6fbb684489201"/></dir><file name="Observer.php" hash="8a18198083aaecb636a3f2a0a989f18c"/><file name="Process.php" hash="1155b418cc2b4ecc4e9b874b1f40f62d"/><dir name="Sales"><dir name="Quote"><dir name="Address"><dir name="Total"><file name="PaymentFee.php" hash="f14a964cb2cba6b7f6fcf6162b8a91fd"/><file name="PaymentInstallmentFee.php" hash="5cb9a44b7f1006e8e471d1dbc7b8ba08"/></dir></dir></dir></dir><dir name="Source"><file name="BoletoType.php" hash="1a31476c4ebfdb6b16a1dd3a26015fb1"/><file name="CancelModes.php" hash="b18c30b103cdce97af41e63ef0a25a92"/><file name="CaptureModes.php" hash="d2d138f0a59e1e448531f1fd8f908439"/><file name="CcType.php" hash="97d4e2549bec42b8282636f1e98e853a"/><file name="DemoModes.php" hash="0ce4142166b9f7dc96ee8e1e3bd03286"/><file name="OpeninvoiceType.php" hash="c39389388338dfe0b85b10a1e9b828cb"/><file name="PaymentAction.php" hash="23224178cf58e55c308234036f629bf7"/><file name="PaymentRoutines.php" hash="7aa5525e67554ad35226cf1aaa802c49"/><file name="RecurringType.php" hash="2a3c60c4546d9c02c842a9ea0a5ade26"/><dir name="Status"><file name="Refund.php" hash="bb700fa537f3a7c27c43691846777ef4"/></dir></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Installments.php" hash="6c3b60719edb83eaaad1515514dab620"/></dir></dir></dir><dir name="Total"><dir name="PaymentFee"><file name="Creditmemo.php" hash="738f7b84586d51cd875011d6b31dfd3e"/><file name="Invoice.php" hash="8aa607b99f709a5eee9b76675e2d5ada"/></dir><dir name="PaymentInstallmentFee"><file name="Creditmemo.php" hash="b40551c179c19ccea7be11a5edf6be4c"/><file name="Invoice.php" hash="5f4563813511aff2eafb98cf4943d817"/></dir></dir><file name=".DS_Store" hash="286b9ee8ade7883fb60d91c7d0c64900"/></dir><dir name="controllers"><file name="CheckoutPosController.php" hash="c7efe60bb75c06fb279fc051597a37b8"/><file name="GetInstallmentsController.php" hash="175bdd2692050f0118bcb90d354b60f1"/><file name="ProcessController.php" hash="f13bf04ac2e5ddb6ede00eeced522860"/><file name="UpdateCartController.php" hash="c7280eb6b5b5f87e2dd9f06cc4370e97"/></dir><dir name="docs"><dir name="httpauthentication"><file name="cgihtaccess.patch" hash="b1ca6c18002d1c22f53c8dd55aee1845"/><file name="howto" hash="31677f6b34fca607f8751c9eb5bdcac2"/></dir><file name="readme" hash="aae2884b18ed35ab74c7e73f4baec6e3"/><file name="test-cards" hash="d7a4a41bc2bb17f74dcbcfbc41156675"/><dir name="translation"><file name="Adyen_Payment.csv" hash="0094e6a70aca120e94cc395f139f1687"/><file name="Mage_Checkout.csv" hash="7d3bcce1ce01d189d113d02b949b73ca"/><file name="howto" hash="00a8a321b06b7235c6e6ca39cfcef80f"/></dir><file name=".DS_Store" hash="cbdf8e79d5e282650b9b7136c3b9ad33"/></dir><dir name="etc"><file name="Notification.wsdl" hash="cbba67067d372790e91225b4049c7e0d"/><file name="Payment.wsdl" hash="a4bcff4f854a5efda30b7678eee2040f"/><file name="config.xml" hash="04c91aeb65ce9b4a70711bf137fec297"/><file name="system.xml" hash="5027279dc270cbf022c85ea74a89f3c8"/></dir><dir name="sql"><dir name="adyen_setup"><file name="mysql4-install-0.0.1.php" hash="3c304ff04d461bc0bfa6205c03dceea0"/><file name="mysql4-upgrade-0.0.1-0.0.2.php" hash="3d687c555ed52be5eeb4eaba126abb2b"/><file name="mysql4-upgrade-0.0.7-0.0.8.php" hash="27b202258c2bd16ee64902df7985862e"/><file name="mysql4-upgrade-0.0.8-0.0.9.php" hash="85d3de753b99b541a4547c39b7713905"/><file name="mysql4-upgrade-0.1.0.3-0.1.0.4.php" hash="8b43e357cf7a365b1e099b130db51b20"/><file name="mysql4-upgrade-0.1.0.8-0.1.0.9.php" hash="0ba22acbe3f48fc1ae1e76212a11dc2a"/><file name="mysql4-upgrade-0.1.0.9-0.1.0.10.php" hash="2b029ba94cea8dd9b6d82a0de265234f"/><file name="mysql4-upgrade-1.0.0.3-1.0.0.7.php" hash="c087b4bbc48cf47e954b6cfbd1f2c5bb"/><file name="mysql4-upgrade-2.0.3-2.1.0.php" hash="09d7c123a6270e4ee029f187d92c1c31"/></dir></dir><file name=".DS_Store" hash="327f3b98fa44a731152378b2757ed144"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="adyen.xml" hash="a963acf4938f60fde0672bb6177399f1"/></dir><dir name="template"><dir name="adyen"><dir name="form"><file name="boleto.phtml" hash="83c7bc35d037f426aa75c0719e8adb86"/><file name="cc.phtml" hash="054ab1e3fa2b3901973a76e4f7547c10"/><file name="elv.phtml" hash="4d370d2d737f0a42ebcb33e7151ecee6"/><file name="hpp.phtml" hash="dcb1987da78dc78d45437de3bc0a10f9"/><file name="openinvoice.phtml" hash="33127af4713430e153cccbe8684fab13"/><file name="pos.phtml" hash="c07c11d348fced7d889ded4fc77e3363"/><file name="sepa.phtml" hash="aad80786900ccbe1b211ddbc0c00febd"/></dir><dir name="info"><file name="boleto.phtml" hash="d7fbc6f480f75d07a52a79ea7cf8457a"/><file name="cc.phtml" hash="be7d0e812e4c8eed5de08f2c37cf3875"/><file name="elv.phtml" hash="7a6b627e0c6acd04497d52f5047e930a"/><file name="hpp.phtml" hash="c6cccc2520a32a42f509b2ca9bf5a4c1"/><file name="openinvoice.phtml" hash="46550d1d3dbe0a92c89dd6272f5d9104"/><file name="pos.phtml" hash="a5b175023f0670409122876074d6f050"/><file name="sepa.phtml" hash="49f960b088e563135860774517fbcdfe"/></dir><dir name="order"><dir name="view"><file name="history.phtml" hash="9a6d80c534d935c63eb900d7d892e9ff"/></dir></dir><dir name="pdf"><file name="boleto.phtml" hash="50853749a944124f076d129fd5e6cfa9"/><file name="cc.phtml" hash="50853749a944124f076d129fd5e6cfa9"/><file name="elv.phtml" hash="50853749a944124f076d129fd5e6cfa9"/><file name="hpp.phtml" hash="4cdb4f7c88b6556fc847c21d5d4b7ffb"/><file name="openinvoice.phtml" hash="742b87babbb612032d68a8e79d31e89c"/><file name="pos.phtml" hash="a3dc27a6607b4978c93b21d945661e5c"/></dir><file name="pdf.tar.bz2" hash="d4b4edd908e7784efc8ac45fe1ce73cb"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="adyen"><file name="blank.phtml" hash="03d788d9ec2aa70de7eb66015b2c4da1"/><dir name="checkout"><file name="success.phtml" hash="56c5bdd54f9cbed22be7afe0deedead4"/></dir><dir name="form"><file name="boleto.phtml" hash="21b6c7d06dfef2bb9f8de8205bc2c6a9"/><file name="cc.phtml" hash="e504c4b3b0f78ece12d20b3631264a45"/><file name="elv.phtml" hash="789610e3d1f8973f6aecb4ef119a59c9"/><file name="hpp.phtml" hash="8d2c341ec0970e9bc81e481d437826cc"/><file name="oneclick.phtml" hash="08c71d3c3bf62fa736ac3dbf65d1c907"/><file name="openinvoice.phtml" hash="4dbda9d80bd82328ec8b33c775f44599"/><file name="pos.phtml" hash="674097ccf62f13c969d39c2f6a6824b8"/><file name="sepa.phtml" hash="a536c0245cc8a5e0762a5e9fb567d325"/></dir><dir name="info"><file name="boleto.phtml" hash="c526f9c4badab3afaa771872bb4687f1"/><file name="cc.phtml" hash="cda685b7c94fc401158bf5901e66c8b6"/><file name="elv.phtml" hash="8b850e97ea84e1de5ead4ec487c4356f"/><file name="hpp.phtml" hash="4d91b5d0729eafc220268d204b514cae"/><file name="openinvoice.phtml" hash="2bcd711e1255923d53f353819e19529e"/><file name="pos.phtml" hash="9b917920aa1cc77c9e8c3a26943b1335"/><file name="sepa.phtml" hash="c886a3d9923c3ade6ca5056f18c1b856"/></dir><file name="posExpressCheckout.phtml" hash="0db835c5f5998f660d03ce4ba88bdb05"/><file name="scanProduct.phtml" hash="792b3dbc6f10b4b9f8aff824d09f4f7a"/></dir></dir><dir name="layout"><file name="adyen.xml" hash="09dd483ce555ef83bd87d86b8f8f3165"/></dir></dir></dir><dir name="default"><dir name="adyen"><dir name="template"><dir name="checkout"><dir name="onepage"><dir name="payment"><file name="methods.phtml" hash="bda669695d2150eaccdcaeeb6b419949"/></dir></dir></dir><dir name="onestepcheckout"><file name="checkout.phtml" hash="520e231832277d5d09bb3be8134c56f8"/><file name="payment_method.phtml" hash="f2852a921420340ef82a5d2f4f799fee"/></dir></dir></dir></dir><dir name="rwd"><dir name="adyen"><dir name="template"><dir name="checkout"><dir name="onepage"><dir name="payment"><file name="methods.phtml" hash="bda669695d2150eaccdcaeeb6b419949"/></dir></dir></dir><dir name="onestepcheckout"><file name="checkout.phtml" hash="c315e54e6ba093bcc737df1bb1f8f0b9"/><file name="payment_method.phtml" hash="f2852a921420340ef82a5d2f4f799fee"/></dir></dir></dir></dir><dir name="enterprise"><dir name="adyen"><dir name="template"><dir name="checkout"><dir name="onepage"><dir name="payment"><file name="methods.phtml" hash="413a7bc55d51d278e743a33f35df8f88"/></dir></dir></dir><dir name="onestepcheckout"><file name="checkout.phtml" hash="c315e54e6ba093bcc737df1bb1f8f0b9"/><file name="payment_method.phtml" hash="f2852a921420340ef82a5d2f4f799fee"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Adyen_Payment.xml" hash="e4d297a9b401c4548acb47aea1ae41d9"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="adyen"><file name="ABNAMRO.png" hash="a621e7f4cf1c3340ac5147fef5544bfe"/><file name="ABNAMRO.xcf" hash="eac24c953dcf05d40ce928ccab2af90f"/><file name="ASNBANK.png" hash="13034bc0836590cfb0ec7b6c3076e435"/><file name="FORTIS.png" hash="3b68fa26a90f8cd44e2f8dfcb5f72fe8"/><file name="FRIESLANDBANK.png" hash="c1388a9b8a170260b0b72da9b2cd2dbf"/><file name="ING.png" hash="b08f829cf67322875ca12d5fc36ac191"/><file name="KNAB.png" hash="4df678f84bdf11db9b75d1e539a0367c"/><file name="POSTBANK.png" hash="ea0ffd9d3e9717fe0bdc160d8cd92482"/><file name="RABOBANK.png" hash="f09418ebbd0d6daf21786d5bde93e856"/><file name="REGIOBANK.png" hash="0c3a984ce817e4d3ec98549be7704712"/><file name="SNSBANK.png" hash="75f988e3ab935d6d509a86f82422f474"/><file name="SNSREGIOBANK.png" hash="34a70ac0e1e0a8cfb56c77a5b1da3c80"/><file name="TESTISSUER.png" hash="0110aadd0f619b39f357b98b63e3ff69"/><file name="TESTISSUER10.png" hash="b2462fe98e69d211e92771ae75f48552"/><file name="TESTISSUER2.png" hash="471cc38e61077fdaba8fd868fea22dfe"/><file name="TESTISSUER3.png" hash="4ca46be0b7607dc95caccb5ec974e0a8"/><file name="TESTISSUER4.png" hash="6e31a3d3e73390432a84e394a1937c5d"/><file name="TESTISSUER5.png" hash="78b758fef66f220e79b1b9ecda8851d2"/><file name="TESTISSUER6.png" hash="4aefac8baaa06592c8a80f085c0ade08"/><file name="TESTISSUER7.png" hash="0474b1a3264ef45068013747a27158d2"/><file name="TESTISSUER8.png" hash="5e655c4af04b417acecac6fd66623662"/><file name="TESTISSUER9.png" hash="6e378c3b7c75febd0be361ec39c55e45"/><file name="TESTISSUERCANCELLED.png" hash="c794eeb78ef618c3e9dcd8b444b7b23f"/><file name="TESTISSUERPENDING.png" hash="04ee87a5c35a491e624719a3c885d492"/><file name="TESTISSUERREFUSED.png" hash="2f7e2bad6857f39f32afd09eb846e55a"/><file name="TRIODOSBANK.png" hash="922b1fcd51306e0d0da6b15ebe640d8c"/><file name="VANLANSCHOTBANKIERS.png" hash="0a5d713a5c73c54e90507743456c5657"/><file name="achcolombia.png" hash="1f1339c682440cfd7584f9ba00f59722"/><file name="achcolombia_small.png" hash="d6b2899a0039de82788c831b00dd1533"/><file name="achcolombia_small_grey.png" hash="bcae575368bdcdb582423e28ac7a56e9"/><file name="achcolombia_tiny.png" hash="a287c57b8bcc821371758da895db6437"/><file name="advance_payment.png" hash="5aba603621b4b21cc05b7eae1f7455da"/><file name="adyen_logo_large.png" hash="70726ef290d0eee3ed163eb751091813"/><file name="afterpay_default.png" hash="a62e3982d50612522be071d4e86eaa6a"/><file name="alipay.png" hash="e3773ada96577e575c9e1300a89a5875"/><file name="alipay_small.png" hash="f9848d15fc7ee22b6687ccdbe7f36a16"/><file name="alipay_small_grey.png" hash="e5ffe7ff272ce2814b7808fd047a9c6b"/><file name="alipay_tiny.png" hash="1a7867dd958ddcdd90ad2400e5be23de"/><file name="amex.png" hash="8e3b962f9ef18e08cf16b77934607d28"/><file name="amex_small.png" hash="6ce7c9a2b330c9c46f0213c40db55683"/><file name="amex_small_grey.png" hash="0f6aabd8dfcbf48dbb555b9191d7795e"/><file name="amex_tiny.png" hash="b7016f4efb163c985d6f1d99a8433d2a"/><file name="asiapay.png" hash="44626dc317e547fb40010498c1096407"/><file name="asiapay_small.png" hash="cca4d86b5abc510f20ca9563d7215c3d"/><file name="asiapay_small_grey.png" hash="00e20b2b2eb0d2ad51c15d8ccc558dc5"/><file name="asiapay_tiny.png" hash="ba0d613d94a64918c0338504fed20ee7"/><file name="autopay.png" hash="4251763c71239e7b1b421e4bc7f5b70a"/><file name="autopay_small.png" hash="ca6941b80b6157bae2411b5620149d2d"/><file name="autopay_small_grey.png" hash="f69d143b4f1fc16a9138ccfacec808a4"/><file name="autopay_tiny.png" hash="4c0c91402daafc63bdb5979dbbd963db"/><file name="babygiftcard.png" hash="91bcbb6604b26565b89898c9a8e1e117"/><file name="babygiftcard_small.png" hash="2558bbdd4d9528b37ba93a8c4af536a4"/><file name="babygiftcard_tiny.png" hash="393a192fab9874e3b167c3bc5d568db7"/><file name="baloto.png" hash="1c172c628f79837c83196b243c636ff5"/><file name="baloto_small.png" hash="c66db84ac7fed6f81010e8058fa39a74"/><file name="baloto_small_grey.png" hash="bdc5eac76e02a658b348a0722fca9ba9"/><file name="baloto_tiny.png" hash="5e10ee14c8a44c3b4c28571664fa045f"/><file name="bancnet.png" hash="a2b687ef27244e448b85635cc1d3ec60"/><file name="bancnet_small.png" hash="4473bc16badc29200ffd09021778b1e3"/><file name="bancnet_small_grey.png" hash="6b108ea906b6d6a5ad51e4de6db732eb"/><file name="bancnet_tiny.png" hash="0ac28b35fd4e09954debcd2eb42e89ce"/><file name="bank24.png" hash="9a921572d6bae73604e1122ec3e5bf7e"/><file name="bankTransfer_AE.png" hash="a6f29729723fa65c732ffc9267b3f8be"/><file name="bankTransfer_AE_small.png" hash="a3322805ab1c40c4e6237943185284ab"/><file name="bankTransfer_AE_tiny.png" hash="dfcf50c97c3b832fd3c17efb2864335c"/><file name="bankTransfer_AT.png" hash="7fa4204d1426a64a4cd26af06af44d41"/><file name="bankTransfer_AT_small.png" hash="31037dcf034d1e9d28254d1962b2ca16"/><file name="bankTransfer_AT_tiny.png" hash="4ee9964118e05d2a81335f3033ec5bf1"/><file name="bankTransfer_AU.png" hash="05716c67579fcf3574037ce69c9e4229"/><file name="bankTransfer_AU_small.png" hash="acd23b8e3ccf3c9d28960fde63c22e85"/><file name="bankTransfer_AU_tiny.png" hash="4a3ee62afdac23a00a0675c763e93470"/><file name="bankTransfer_BE.png" hash="5547426f07e0562ba9b605f1f04a9ad7"/><file name="bankTransfer_BE_small.png" hash="007dbd9f27115b601eb94db09a10b8f3"/><file name="bankTransfer_BE_tiny.png" hash="cf0285a691339efad52d82d40c7aa9f1"/><file name="bankTransfer_BG.png" hash="be209415f5bec0a45bd2bd9cd3c41d0a"/><file name="bankTransfer_BG_small.png" hash="6249144aa579c494988b5bbecb22eb69"/><file name="bankTransfer_BG_tiny.png" hash="7c11956844dbf7cc76db038b32fc7ab1"/><file name="bankTransfer_CH.png" hash="9b20d62386085ac2c9da1227abec5d58"/><file name="bankTransfer_CH_small.png" hash="2887bcf97901ed7ed6bc4fb5d8a00876"/><file name="bankTransfer_CH_tiny.png" hash="c0218d075bbb503689f40007a331ba85"/><file name="bankTransfer_CZ.png" hash="78f7aac275e10af77b3bbab28ba1aa23"/><file name="bankTransfer_CZ_small.png" hash="7bf17799b64aa618945981eb7fa00cce"/><file name="bankTransfer_CZ_tiny.png" hash="7f2a7e2fde701bff21fa388776e73632"/><file name="bankTransfer_DE.png" hash="989d5e1cc2547504b0fbc7aa88e08713"/><file name="bankTransfer_DE_small.png" hash="fb50048c4acfdebf85c4c8f90d8b08d9"/><file name="bankTransfer_DE_small.xcf" hash="cfbc9a47bc116e97a121771c0aa6fe83"/><file name="bankTransfer_DE_tiny.png" hash="d4d68f1068df68f61cb828005c9c0ac9"/><file name="bankTransfer_DK.png" hash="a2e9a409144a8ef18747faafa2937609"/><file name="bankTransfer_DK_small.png" hash="71e75c357b475fe236b633ac8a2a76cd"/><file name="bankTransfer_DK_tiny.png" hash="0103bbe5b8a803aad990bd4ad53c88c0"/><file name="bankTransfer_EE.png" hash="9caa3e1ac3558e9ec372c45df045bae6"/><file name="bankTransfer_EE_small.png" hash="91ffe550444bac13ac29ac1696ffdfac"/><file name="bankTransfer_EE_tiny.png" hash="59ea293d7ba58cd6dd9a9a2b43088093"/><file name="bankTransfer_ES.png" hash="7d0051c7ee32eddca94b89368bb5afbe"/><file name="bankTransfer_ES_small.png" hash="2dc1519510ef7bea726e0bca70859c06"/><file name="bankTransfer_ES_tiny.png" hash="a2338a0d60b2585ac34269daf794d189"/><file name="bankTransfer_FI.png" hash="ffbe8dfa936a4628e3c029bd957f367d"/><file name="bankTransfer_FI_small.png" hash="1db5d45d947502483a2e8c40aab3734d"/><file name="bankTransfer_FI_tiny.png" hash="b9f26cef0fc7f051b6d79ada14c902ba"/><file name="bankTransfer_FR.png" hash="572f77cf0f22103300682c5f89e9d9e9"/><file name="bankTransfer_FR_small.png" hash="58a268c927e4d19858ed3241ceac05f8"/><file name="bankTransfer_FR_tiny.png" hash="dee4c0c47d94fb0e2ab032264c4d1543"/><file name="bankTransfer_GB.png" hash="5a7eee2f31bec7bf422425f31aea2d5a"/><file name="bankTransfer_GB_small.png" hash="17d3c0ca20cee2250e3b6d0f5f080ba9"/><file name="bankTransfer_GB_tiny.png" hash="24d7d3ce5dc62ef776f3f36f24ff78b1"/><file name="bankTransfer_GI.png" hash="e9035b335bd8dc809c7e4afc7d775cc0"/><file name="bankTransfer_GI_small.png" hash="e51bd2f8333a8d8b2163c777c5b12b48"/><file name="bankTransfer_GI_tiny.png" hash="d158401d4dd73a057adac68f3f23ad89"/><file name="bankTransfer_GR.png" hash="aefe60c85d74d77d1c1327538617f297"/><file name="bankTransfer_GR_small.png" hash="b9a0a5d6ec52c80d72d8e8cf903f37f3"/><file name="bankTransfer_GR_tiny.png" hash="1dc0912afd646785eade5d8785baa12c"/><file name="bankTransfer_IBAN.png" hash="f636fcae0c128e08baaef26dacaa078d"/><file name="bankTransfer_IBAN_small.png" hash="ffc0073f2fe405de05206cdfc1565daa"/><file name="bankTransfer_IBAN_tiny.png" hash="4a4f64cb62ca9cfec99d117d0169bb83"/><file name="bankTransfer_IE.png" hash="eb6efba5502d54571022feaef9a9ded3"/><file name="bankTransfer_IE_small.png" hash="d9359e8a2bf8c04d4d43acdcc8b30a5e"/><file name="bankTransfer_IE_tiny.png" hash="b3a0f75656b535960c362baaabc45ce3"/><file name="bankTransfer_IT.png" hash="cd56062b943e4ec6716bc72ebe4b62a9"/><file name="bankTransfer_IT_small.png" hash="29ac58a26ae12dc26dd2d501262ed361"/><file name="bankTransfer_IT_tiny.png" hash="c45892a3e2ae81bb9b4508d79164e556"/><file name="bankTransfer_JP.png" hash="20023e2e93afc881740ea74e89251d86"/><file name="bankTransfer_LU.png" hash="b3dbdeea3429de5280c3a6d911930e9a"/><file name="bankTransfer_LU_small.png" hash="ebb919c647653075be4d9bfaeec8c00c"/><file name="bankTransfer_LU_tiny.png" hash="ec058289aef35f481077c56cdf758032"/><file name="bankTransfer_MT.png" hash="8955bc706cf66307ba69e58d8006af2d"/><file name="bankTransfer_MT_small.png" hash="13ce68bbda83c39b8719d356705da6d2"/><file name="bankTransfer_MT_tiny.png" hash="b05aa11e844f09fa797a3540534e5155"/><file name="bankTransfer_NL.png" hash="ccffd7131f791f7eb44e21b42fd66cc4"/><file name="bankTransfer_NL_small.png" hash="90f18f3784ec4c4733891aafd2e83958"/><file name="bankTransfer_NL_small.xcf" hash="ac17edd9804089820e9d73c76441abfc"/><file name="bankTransfer_NL_tiny.png" hash="61e9d461381aa1fb7e9dbcc8012686e0"/><file name="bankTransfer_NO.png" hash="ffcb1204470ff94a7cf2025e000e4978"/><file name="bankTransfer_NO_small.png" hash="daab5aceaf8e4dd59dfcf29fa69cdc24"/><file name="bankTransfer_NO_tiny.png" hash="3fbbf9e381d8d0d9ada61a54778655cb"/><file name="bankTransfer_PL.png" hash="cd25fefef6bce86a97ab7242138360e2"/><file name="bankTransfer_PL_small.png" hash="880b17d7d090c7bd21965e9b78894851"/><file name="bankTransfer_PL_tiny.png" hash="9579393e3dbb3c2aeb7ebf35e54ef4e7"/><file name="bankTransfer_PT.png" hash="c3c652523d77b5d085da97111c96ef9e"/><file name="bankTransfer_PT_small.png" hash="9d3a979ef52298bcc1545b131bd4a3db"/><file name="bankTransfer_PT_tiny.png" hash="cf2be093140773d75d8993fab7aa347c"/><file name="bankTransfer_SE.png" hash="e5608461fa8bdbac771449f30cde91ec"/><file name="bankTransfer_SE_small.png" hash="0f57f6092f8bef25c9973a140a2d85ad"/><file name="bankTransfer_SE_tiny.png" hash="79f3a00608bf18d686d89562af80a72f"/><file name="bankTransfer_SK.png" hash="2390a923affb1640b1b8bb801ce04705"/><file name="bankTransfer_SK_small.png" hash="50adde906c3a965992bbfb04554a5371"/><file name="bankTransfer_SK_tiny.png" hash="d4866f13969214fd774ea1c427a048e6"/><file name="bankTransfer_US.png" hash="9013561099b618aa954f5a3e1352a6ce"/><file name="bankTransfer_US_small.png" hash="191e204c1216a199229da9d75ed1a2a5"/><file name="bankTransfer_US_tiny.png" hash="9d9e942b93d13a18e38aac0ee932fe15"/><file name="bank_ru.png" hash="2390a923affb1640b1b8bb801ce04705"/><file name="bank_ru_small.png" hash="01c263789dd7e38ac4078f55161ec19b"/><file name="bank_ru_tiny.png" hash="d4866f13969214fd774ea1c427a048e6"/><file name="barras.png" hash="389f5242e23cc5b386392d5d21459f21"/><file name="barras_small.png" hash="9e657657b963a1434e88d4289acf9448"/><file name="barras_small_grey.png" hash="d14dbd53e9a52706bf736525a90d8f63"/><file name="barras_tiny.png" hash="e46d37c7e69ef3722876a0205431f1c8"/><file name="bcmc.png" hash="28dca1b34022f2c653c13556c452fce3"/><file name="bcmc_small.png" hash="49698208e5b73f80773260c3fdb3e5a3"/><file name="bcmc_small_grey.png" hash="5069f14bff23c074af6fe2092a2e482a"/><file name="bcmc_tiny.png" hash="3b4221516dc0d1ace3432a473903991e"/><file name="beelinesms.png" hash="a559096cb240aaf7696be7563498b18b"/><file name="bijcard.png" hash="c93da8e22fac6869d729e961df24b593"/><file name="bijcard_small.png" hash="f188b92b77af1613a91c00450d3eb168"/><file name="bijcard_small_grey.png" hash="08eb4420ac9f7a7f691d688e9550f651"/><file name="bijcard_tiny.png" hash="b88eeed8f7318514f849e3ed3a9a2ce8"/><file name="bill99.png" hash="461213bcf10fb394ef524d3a0ad92ee0"/><file name="bill99_small.png" hash="d6e30f7d3da5ce34af3aa7e2353b4809"/><file name="bill99_small_grey.png" hash="a66c49f3556fa99301f4288341eaa014"/><file name="bill99_tiny.png" hash="d10dbbf6512e15252ad6d1337670a7fd"/><file name="boleto.png" hash="3968115c3576a14f7cdc8ebd98c8092e"/><file name="boletobancario_hsbc.png" hash="3968115c3576a14f7cdc8ebd98c8092e"/><file name="boletobancario_itau.png" hash="3968115c3576a14f7cdc8ebd98c8092e"/><file name="boletobancario_santander.png" hash="3968115c3576a14f7cdc8ebd98c8092e"/><file name="bradesco.png" hash="d5ae6f8cb39883cce8c97c0d11257a4c"/><file name="c_cash.png" hash="1b9d5b0c9ece2eaff0be71b4082e0655"/><file name="c_factuur.png" hash="cd46b7d11c9dd79b1cc9c073c0696aff"/><file name="c_factuur_small.png" hash="63d4c6fd1e5b214d018f3e00ca687cd5"/><file name="c_factuur_tiny.png" hash="153791c1eb5bae6095e1210787ffe4fa"/><file name="c_invoice.png" hash="cd46b7d11c9dd79b1cc9c073c0696aff"/><file name="c_invoice_small.png" hash="63d4c6fd1e5b214d018f3e00ca687cd5"/><file name="c_invoice_tiny.png" hash="153791c1eb5bae6095e1210787ffe4fa"/><file name="c_oprekening.png" hash="cd46b7d11c9dd79b1cc9c073c0696aff"/><file name="c_oprekening_small.png" hash="63d4c6fd1e5b214d018f3e00ca687cd5"/><file name="c_oprekening_tiny.png" hash="153791c1eb5bae6095e1210787ffe4fa"/><file name="c_paypal.png" hash="fe5fd0065e4a84e967095f082b329d7f"/><file name="c_paypal_small.png" hash="294698dab8f5aa31f2ad62702bd9d379"/><file name="c_rembours.png" hash="fb2da23375ce5ba67380dc0fb60e7669"/><file name="c_rembours_small.png" hash="0d0f244c1820921db3a6635552cf8129"/><file name="c_rembours_tiny.png" hash="c15d78de45389d475f2786fed3e81c4b"/><file name="card.png" hash="adfe3d9fe45c3f94b9edca852e2cb38c"/><file name="cashticket.png" hash="0dba12beffb7c5ebf47ae1e5701426f3"/><file name="cashticket_small.png" hash="ade5518971a871dd48b0628af6f6cf89"/><file name="cashticket_small_grey.png" hash="348c3721fbedfb2a7121f57db435f43e"/><file name="cashticket_tiny.png" hash="95248971eb69c150748b9acf27f68fb5"/><file name="cashticket_tiny2.png" hash="16ab15f5263fe81ab5233d02ce2cd715"/><file name="cashu.png" hash="1b6d79438ad686cdff44866a66445dca"/><file name="ccavenue.png" hash="aee563b4c9c77d8a881db1e79ad8758d"/><file name="ccavenue_small.png" hash="ffa7390808c679e8d6c580fcf14054fb"/><file name="ccavenue_small_grey.png" hash="9a6c58e88230fb6a167e597752a533ab"/><file name="ccavenue_tiny.png" hash="994d56725d095d107fb33c6f3abf7653"/><file name="cellpaypoint.png" hash="c676483390c0c7e932a320b6326593da"/><file name="cellpaypoint_small.png" hash="f720447e73325b922568a00d0effe75c"/><file name="cellpaypoint_small_grey.png" hash="c6deea99f2099ade43b2b75dcb62f273"/><file name="cellpaypoint_tiny.png" hash="5c00501360e94b3020ff54bccbc2e531"/><file name="ciberpay.png" hash="625d300997f331918e912dc266e1a3a4"/><file name="contact_ru.png" hash="5f70b79ee4232a81a9f7eb0224b0ba3c"/><file name="creditcards.png" hash="cd1a83b970a38307c2899f9949495a00"/><file name="dineromail.png" hash="9058ea237d278d5fd238c2d180807c57"/><file name="dineromail_ar_amex.gif" hash="4a94da8ec02c565e8cfcb66fbfffe362"/><file name="dineromail_ar_argencard.gif" hash="422ea3362cc44616f72a887f5cba66c6"/><file name="dineromail_ar_banktransfer.gif" hash="758e12e370a5b213996ea1f39259721a"/><file name="dineromail_ar_bapropago.gif" hash="df51325a4fae890a5a6673f92bb64f5d"/><file name="dineromail_ar_cabal.gif" hash="98f6cc5d54df43b4c4a17d9fc2dfb9bd"/><file name="dineromail_ar_cobroexpress.gif" hash="910960360ea1cd632a69ab500cd627ee"/><file name="dineromail_ar_dm.gif" hash="b458246e266ecb059865ab17b7673882"/><file name="dineromail_ar_italcred.gif" hash="aa4376df77748d39c670001794e7991f"/><file name="dineromail_ar_master.gif" hash="126cdc5db597363e5934cf19205f8f45"/><file name="dineromail_ar_pagofacil.gif" hash="2c85235d6dff444b1b914488d035eb7b"/><file name="dineromail_ar_rapipago.gif" hash="c745eb4d456f03c6643f40e77f9ad6ac"/><file name="dineromail_ar_tshopping.gif" hash="552daaa4621397aaed5cea3ad5fc89ec"/><file name="dineromail_ar_visa.gif" hash="61c86fd2afade160736b1c318a8280a6"/><file name="dineromail_ar_visa_hipotecario.gif" hash="bbdb3933302107611678bd7a87779a6c"/><file name="dineromail_br_amex.gif" hash="4a94da8ec02c565e8cfcb66fbfffe362"/><file name="dineromail_br_aura.gif" hash="b4a8dea00ceebb3d1d64660a997ac22d"/><file name="dineromail_br_bbancario.gif" hash="d9adffbdf626846cfe11b874c5bc0715"/><file name="dineromail_br_diners.gif" hash="b4f437b40f747842cb32becf8af28eb4"/><file name="dineromail_br_dm.gif" hash="65fa3eb604d2d5cd64b76ea0419788a6"/><file name="dineromail_br_hipercard.gif" hash="329dd978884c554fc8c0a37bd6c1ded9"/><file name="dineromail_br_master.gif" hash="126cdc5db597363e5934cf19205f8f45"/><file name="dineromail_br_oipaggo.gif" hash="9cad6e46ea39ec1d6af77ce9322835c1"/><file name="dineromail_br_visa.gif" hash="61c86fd2afade160736b1c318a8280a6"/><file name="dineromail_cl_amex.gif" hash="d4942bf6dab3c072e701e709adaecf78"/><file name="dineromail_cl_diners.gif" hash="9f5bccfc0ab73993405821859dab56b0"/><file name="dineromail_cl_dm.gif" hash="0b886856a701eff48c710a4812f999d0"/><file name="dineromail_cl_magna.gif" hash="bbbbed0d123e619dbf9ffc3308cb4f6e"/><file name="dineromail_cl_master.gif" hash="38b5c034caa6249caf49256f7df4894c"/><file name="dineromail_cl_presto.gif" hash="fa18e40e599f4216d0efea05d9329b5b"/><file name="dineromail_cl_ripley.gif" hash="8a0fe5295feeb9959f2dedf17b304215"/><file name="dineromail_cl_servipag.gif" hash="51cc675b605ce7dd88016743fc324e09"/><file name="dineromail_cl_visa.gif" hash="87fa159904723d830b30d9a0f2f2ff00"/><file name="dineromail_mx_7eleven.gif" hash="7595248bd6c735fc9cd28a0afe9e035c"/><file name="dineromail_mx_amex.gif" hash="4a94da8ec02c565e8cfcb66fbfffe362"/><file name="dineromail_mx_bancomer_tc.gif" hash="b2854f409126920b1c9cf8ed3792a349"/><file name="dineromail_mx_dm.gif" hash="9eede7e49ebcb145494952f6edb749b2"/><file name="dineromail_mx_hsbc_tb.gif" hash="1fb60730a0dfe9d0a0ebef45af1d8fdd"/><file name="dineromail_mx_ixe_tc.gif" hash="6e19e5be52b5bfce749f16b26e933c2e"/><file name="dineromail_mx_otherbank_tc.gif" hash="df05af375e248dcc04324aa92b6163b0"/><file name="dineromail_mx_oxxo.gif" hash="ee69da5b06d9c52ef76dd1a20bab5ebb"/><file name="dineromail_mx_santander_tc.gif" hash="5bb0f9600b1b8ad67d0a418c2412a506"/><file name="dineromail_mx_scotiabank_tc.gif" hash="dbe7bdd2d9327086cae42ee6a842d00c"/><file name="dineromail_small.png" hash="356e06d5a2fd5f98f3da4dfc192e389c"/><file name="dineromail_tiny.png" hash="98f6b908f7025a8babaffafcc1336428"/><file name="diners.png" hash="6310bb53fe7921cf016309d6a75b8c22"/><file name="diners_small.png" hash="ecf5d635a74460ca9575bb7d6d8550dd"/><file name="diners_small_grey.png" hash="77ff46143b8a4aab54eb35c345806a83"/><file name="diners_tiny.png" hash="881b5998d35cc373d294ca21689015d5"/><file name="directEbanking.png" hash="6d7ce2ff213c33743d80ab83fb24e8de"/><file name="directEbanking_axa.png" hash="3d90797ef39a0db23dd6373bdfef9ee8"/><file name="directEbanking_cbc.png" hash="f23617618a9e2ce7863a931947b49adb"/><file name="directEbanking_de.png" hash="9fa16b098e744e94553952c5a28c7dd2"/><file name="directEbanking_de_grey.png" hash="109b1237e5d69d7ae82dc9a64d6ab4fd"/><file name="directEbanking_de_small.png" hash="5f65ee79ae22c4ba52e6a8485cf155cd"/><file name="directEbanking_de_tiny.png" hash="15983a607b8151f0be3b5ecfb067ea7a"/><file name="directEbanking_dexia.png" hash="37ebcc9a12bc9c88d540f78adf9bd679"/><file name="directEbanking_fintro.png" hash="389b1a7b14e5466b7b0dd4721aee0433"/><file name="directEbanking_fortis.png" hash="511cc06fefa644cc7575a0efb227bd64"/><file name="directEbanking_grey.png" hash="109b1237e5d69d7ae82dc9a64d6ab4fd"/><file name="directEbanking_ing.png" hash="ac4f224d0fe9aee23d143acc5198dd72"/><file name="directEbanking_kbc.png" hash="eae3c85e332e4289841bd27a46031db3"/><file name="directEbanking_small.png" hash="db84d47793f8e375d48dc8b17f8a0ddf"/><file name="directEbanking_small_grey.png" hash="7f4fbbcfe647cf8d280238754061d042"/><file name="directEbanking_tiny.png" hash="7d804d09c7df931eb9cafc2d3a4984b1"/><file name="directdebit_BR_bancodobrasil.png" hash="784271e1bf909c95e79ff7de4d92ed5b"/><file name="directdebit_BR_bradesco.png" hash="d5ae6f8cb39883cce8c97c0d11257a4c"/><file name="directdebit_BR_caixa.png" hash="a0d69bc8a40bf120fc2138a694c31186"/><file name="directdebit_BR_hsbc.png" hash="4943f73d211b8111fd81ca8d4e06160d"/><file name="directdebit_BR_itau.png" hash="b24ed466c1d694dca7dc26ee42dbf330"/><file name="directdebit_BR_santander.png" hash="bd73ea7f9f46b0ed583e764f01e9a8d0"/><file name="directdebit_NL.png" hash="cf1246761401ad866b72d7b520506b22"/><file name="directdebit_NL_small.png" hash="2e6a7444f509232818458312f28f8c50"/><file name="directdebit_NL_tiny.png" hash="99ea09a985cf0221ce87d3696211704e"/><file name="discover.png" hash="491378a0e2ae6223ab41fc925b67575d"/><file name="discover_small.png" hash="8573aebe4938afb288749badb22aa091"/><file name="discover_small_grey.png" hash="e60b18fcd2f0509c02a08fa0bf7024b2"/><file name="discover_tiny.png" hash="78a2cb6ccedb121d3138b280e1778f84"/><file name="dotpay.png" hash="a09962a7357374482444accf6b066037"/><file name="dotpay_inteligo.png" hash="25492f3d9eaabae7aa1441fdf24947b3"/><file name="dotpay_moje.png" hash="1c948c8e2db27f09e44e4c6f3591e39c"/><file name="dotpay_mtransfer.png" hash="e9ef4a420639f227e650c9e456235059"/><file name="dotpay_multitransfer.png" hash="b604e3e946b41437bc485b0a95a76b2a"/><file name="dotpay_nordea.png" hash="cfda5216a9ae9b829e5121bbfaaf887b"/><file name="dotpay_potzta.png" hash="88670102fd0e7f532357d06ec66a8ec6"/><file name="dotpay_przelewz.png" hash="06cbe8767f3b1810e2a72b19a1bcc9c7"/><file name="dotpay_przelewz24.png" hash="64143c67feac20a193fd459ba0a6e8b4"/><file name="dotpay_small.png" hash="aabbcc9e2471e044c38ab63d8aa6d48f"/><file name="dotpay_tiny.png" hash="5c746221e7ec781c18bb4d7e6f0a66a0"/><file name="dotpay_zabka.png" hash="a6edae22b53cdd3b997f8c9b50840b2c"/><file name="ebanking_FI.png" hash="7d717c71a9174624d8e30a314c4f091e"/><file name="ebanking_FI_aktia.gif" hash="092c03a2319bd7c5d8fc9dc98516be46"/><file name="ebanking_FI_alandsbanken.png" hash="d64698c6c6dc9b6c8e1d2179dfb61d8d"/><file name="ebanking_FI_handelsbanken.png" hash="06f99903ea285bc5cf392ea6c642a267"/><file name="ebanking_FI_nordea.png" hash="c68ecd7c03b5d6a0819110c56df501e8"/><file name="ebanking_FI_osuuspankki.png" hash="cf9f495363970b9da3dbbaffe1031225"/><file name="ebanking_FI_sampo.png" hash="e5b4bd2ac745258b22ab832be253654a"/><file name="ebanking_FI_small.png" hash="57635f01d33e65d40af90d3ab4088ad7"/><file name="ebanking_FI_spankki.png" hash="e88599e1318b54be1990363607819811"/><file name="ebanking_FI_tapiola.png" hash="27ad56685d2e0e641a8d3e95942630ef"/><file name="ebanking_FI_tiny.png" hash="b0e3de2e531c362daaac6063c7a59d9e"/><file name="ebetalning.png" hash="0bc7c8cc01264df81ad06b0b75ce7c0a"/><file name="ebucks.png" hash="33d683c3a6f4f61df3c36e09d867936e"/><file name="ebucks_small.png" hash="c2afb7964e668ba7ba0416682fdd831b"/><file name="ebucks_small_tiny.png" hash="dd79fc153f0a7fcc79e628383e76ee26"/><file name="ebucks_tiny.png" hash="6085ef04ad96289d6a98e429c6d061ba"/><file name="elba.png" hash="8d2bfd3e8c0953b5d1ba80e201d25069"/><file name="elecsnet.png" hash="4a27849dfd5a8bc6771a962aff3908f4"/><file name="elv.png" hash="8e47d6ce919e1be80328665798d387ec"/><file name="elv_small.png" hash="a565fd570c28204b7ed0e92ebf667012"/><file name="elv_tiny.png" hash="3c9d929660d6279f255c7be9bf02ee8f"/><file name="empty.png" hash="65d7e6c42582ea986cb66ad78768b2ae"/><file name="enets.png" hash="5eae578677220e7085374936ffc2ec6a"/><file name="entertainmentcard.png" hash="df44b82c45f98790ea0e8866ecb5fee7"/><file name="entertainmentcard_small.png" hash="0466be6962e63c80c766ca4b092cded6"/><file name="entertainmentcard_small_grey.png" hash="32b0a15b2467decf84db199cd6db3bcf"/><file name="entertainmentcard_tiny.png" hash="2a7610575298bf7029bbbfad2bb86596"/><file name="forwardmobile.png" hash="023348014c3838963e48bdc8b397c387"/><file name="frame.png" hash="5e2226d7539f5d95dabe5988f4446282"/><file name="gallgall.png" hash="2e6b9f6aafaebe09112e089c05aa64ea"/><file name="gallgall_small.png" hash="24fabea2d5af04bedf9dd69e2368b943"/><file name="gallgall_small_tiny.png" hash="671cb1ce378d811cddaf77af7545d365"/><file name="gallgall_tiny.png" hash="769bf04c15a3b81f06940c237c3b3706"/><file name="giropay.png" hash="469cb654fe84b923b86b06723455ef9d"/><file name="giropay_small.png" hash="444f3a6307bb83a1d20d19e1cb8237f9"/><file name="giropay_small_grey.png" hash="565dd52d036a87d5c515c8bec4cef4f3"/><file name="giropay_tiny.png" hash="3a677e8d71ce59332e012db5bc343106"/><file name="globegcash.png" hash="580003d47ef03a6d1c7203bfc250b6d3"/><file name="globegcash_small.png" hash="cd18f17b46acb7ca15370b000f9bfa95"/><file name="globegcash_small_grey.png" hash="36e88a7a7170eb0c5ca7d3a8f2b08f13"/><file name="globegcash_tiny.png" hash="006794f78d9a43a56543a6e6b5a7ebd8"/><file name="hansabank.png" hash="b4dad91137678e09a650e1c6693e98d3"/><file name="hdfc.png" hash="b6e57b76ee8920607a2a0a809ee40d48"/><file name="hdfc_small.png" hash="1b9e555bfab7c0f11631dfecacffa637"/><file name="hdfc_small_grey.png" hash="cadac6a01cdab50cff177a1c0feb6156"/><file name="hdfc_tiny.png" hash="584260909cebec2286b6d1cd9489c7d4"/><file name="hppPos.png" hash="4780e785c785e93aed6ad13df323d6ef"/><file name="hyvesafrekenen.png" hash="5c8068c5b31a55f043cee6dff3246bb7"/><file name="hyvesafrekenen_small.png" hash="5a4c5747c030ac74cea799032ada3b26"/><file name="hyvesafrekenen_tiny.png" hash="2215dc356edeb426da65f43536960afe"/><file name="ideal.png" hash="6a851bfc5bac2835fd31c18c1224e8c9"/><file name="ideal_small.png" hash="8b115bda559a24a3564e02f7a90caae9"/><file name="ideal_tiny.png" hash="140c2e52427e074f95627a44db1f9f88"/><file name="interac.png" hash="c63021e21273e83423d8af2b4c7c1728"/><file name="interac_small.png" hash="0c74bd42750252eda57b054651afca18"/><file name="interac_tiny.png" hash="1a42ba184555605ab8e2ea1a4956f21a"/><file name="ipay88.png" hash="116aa967091843ee6e8e911ff4c34b22"/><file name="ipay88_small.png" hash="1dfb38797a43657d72b0701c446a841e"/><file name="ipay88_small_grey.png" hash="418f051bc03571334cec46e122fa698f"/><file name="ipay88_tiny.png" hash="0009e8c253c57564c3688010c5192ad4"/><file name="ivr.png" hash="0ebef34ac806802b0d29c1d74f84fdbf"/><file name="ivrLandline.png" hash="0ebef34ac806802b0d29c1d74f84fdbf"/><file name="ivrLandline_small.png" hash="155f9a61db970885782db7cbe997dab4"/><file name="ivrLandline_tiny.png" hash="ecf7994d1e627023dbd47615a8ebb848"/><file name="ivrMobile.png" hash="6a16e39d5deffb8fa3234108ca97b7de"/><file name="ivrMobile_small.png" hash="a9756b756b3ea56dea07a16edcdf39a9"/><file name="ivrMobile_tiny.png" hash="8c35341f8a8f6ca16b752ff7e1bb51bf"/><file name="ivr_small.png" hash="155f9a61db970885782db7cbe997dab4"/><file name="ivr_tiny.png" hash="ecf7994d1e627023dbd47615a8ebb848"/><file name="jcb.png" hash="68303da687ac6e8615196a66f40bb6fb"/><file name="jcb_small.png" hash="f469481ddecb206cfc74478c6b58266e"/><file name="jcb_small_grey.png" hash="ddb4587396f2e7c7ad83d2aa6561cf7a"/><file name="jcb_tiny.png" hash="5d89108481655ee9dc2dbf6476bbcc14"/><file name="kadowereld.png" hash="c2eea3806e2f55ffa2f7eb3154450be5"/><file name="kadowereld_small.png" hash="203f4584e34c3f059025f3d4329b4898"/><file name="kadowereld_small_grey.png" hash="3afa5e33cd29e5c3ce1723ea10607463"/><file name="kadowereld_tiny.png" hash="b2ca2f7f504670555d332f4c5e8d3074"/><file name="klarna.png" hash="51bc6b70472fe29b728192222b88c709"/><file name="klarna_small.png" hash="57a98dc539dd5c329aac8540a3204d1e"/><file name="klarna_tiny.png" hash="fe0295e2cba0b79136e86180d7db5963"/><file name="laser.png" hash="c64699ddd372b4a48e72b8066fd2aa78"/><file name="laser_small.png" hash="abda432193ffcd5388037fa34b9e0737"/><file name="laser_small_grey.png" hash="ef7193af17ae93fa9bb5215a0ec73195"/><file name="laser_tiny.png" hash="2f87b8e37582541355e9b77008cf3853"/><file name="maestro.png" hash="e91fa85475ae74b16b92b7ac05e562c2"/><file name="maestro_small.png" hash="7814fbfff53e57643137fd68889ec807"/><file name="maestro_small_grey.png" hash="31ab5c8168e8a5b075fe1136b221d453"/><file name="maestro_tiny.png" hash="87ff6ebe1ef2e4cbae340881169065c4"/><file name="maestrouk.png" hash="cf0fcc0e1f41ad2301d5814e4a9c88c4"/><file name="maestrouk_small.png" hash="7814fbfff53e57643137fd68889ec807"/><file name="maestrouk_small_grey.png" hash="31ab5c8168e8a5b075fe1136b221d453"/><file name="maestrouk_tiny.png" hash="87ff6ebe1ef2e4cbae340881169065c4"/><file name="mc.png" hash="0d108b48ed7f8e1f0020da611e223800"/><file name="mc_small.png" hash="51ca51c64a8f0277961effeb0a0dedbb"/><file name="mc_small_grey.png" hash="0762490e5dc86277d0e411468b01a269"/><file name="mc_tiny.png" hash="814af4ec011f2f33edb7d38763dea2ea"/><file name="mercadopago.png" hash="e8cdc9cab0494fbaec13ffa7a008f0d6"/><file name="mimoney.png" hash="0f6d07a6156c6dc931636c8c618384ac"/><file name="mimoney_small.png" hash="4a8b0586fd04690de902120a463ca5b2"/><file name="mimoney_small_grey.png" hash="c85a2d63e583a8fd231713d30d484ecb"/><file name="mimoney_tiny.png" hash="0c562f6e53a95ebe2ff12747f9271a56"/><file name="moneta.png" hash="c208f24cbe664e0c9df753d1dd6b8d43"/><file name="moneybookers.png" hash="7bfc54c2a787b53f699f124d7449a169"/><file name="moneybookers_small.png" hash="1290894e479fafda67291355ea65defe"/><file name="moneybookers_tiny.png" hash="4ed8a8052e9b394e174889de6d621604"/><file name="moneymail.png" hash="73d044eac9d9f1679a653dd2e62935f3"/><file name="moneymoney.png" hash="7204b9579b665085d00b1ea2184b678f"/><file name="multibanco.png" hash="178a9292a9743e3b8904f105e7d6715b"/><file name="nedbank.png" hash="a8a2dc3af1e76262b75270a24a041331"/><file name="nedbank_small.png" hash="d386a8672bd21e53580ae32ae529ca3a"/><file name="nedbank_small_grey.png" hash="7085229e1217e47b07663764f8bb1e6e"/><file name="nedbank_tiny.png" hash="af3694515dd8b68ca71324ca20089c58"/><file name="onebip.png" hash="ca289a3c9fd8d72bce90165db98a88b9"/><file name="online_RU.png" hash="afcc9ad6292e2e21feff4af23e2fa46e"/><file name="online_RU_small.png" hash="712fa0be37857b024e3118d96da61bab"/><file name="online_RU_tiny.png" hash="0e3ac8d1ca10dff95657aa9b9ebdc13b"/><file name="online_transfer_de.png" hash="43324fb914cdbf8eff66f3668a353f1e"/><file name="openinvoice.png" hash="cd46b7d11c9dd79b1cc9c073c0696aff"/><file name="openinvoice.xcf" hash="d5f41ec9c48415f65a519c33999a1229"/><file name="openinvoice_small.png" hash="63d4c6fd1e5b214d018f3e00ca687cd5"/><file name="openinvoice_tiny.png" hash="153791c1eb5bae6095e1210787ffe4fa"/><file name="pagosonline.png" hash="04a1d0c0bb46ed7f931b3d4e248f8c0a"/><file name="pagosonline_small.png" hash="9768e52502eb299716268a212a044812"/><file name="pagosonline_small_grey.png" hash="e9f7365e885652200fdb08201e1b13cf"/><file name="pagosonline_tiny.png" hash="70d51512b8bf5215f5865b21a3ca7731"/><file name="paypal.png" hash="02362803ca1d3ab9c9e8dc3176100d66"/><file name="paypal_small.png" hash="294698dab8f5aa31f2ad62702bd9d379"/><file name="paypal_tiny.png" hash="709c47f06297455d8d55d6937245e016"/><file name="paysafecard.png" hash="20861199bb6e8781c0b10e995f1490de"/><file name="paysafecard_small.png" hash="e7452ca00265fdc91dd28a2b326355d3"/><file name="paysafecard_small_grey.png" hash="06377beb14a2666f153b273e89053419"/><file name="paysafecard_tiny.png" hash="92b3df13741ef6f71d2c12206ab3f412"/><file name="payu.png" hash="bc671fff056fd108fe24ba52053111b0"/><file name="payu_small.png" hash="ca3eb82cb24dd1f1bfc34436287dc9d0"/><file name="payu_small_grey.png" hash="6097711eeb2ea309d407c03a467e1653"/><file name="payu_tiny.png" hash="2b89f57174338ba3d3192eb8519ece3f"/><file name="plastix.png" hash="82d3202239d01c6bf49d8dc2399900e2"/><file name="plastix_small.png" hash="447240736bdba2d15a34986395c3fb1f"/><file name="plastix_small_grey.png" hash="7e039f412a96a0e884f86598ebfccfb1"/><file name="plastix_tiny.png" hash="aaff5ff8c33af35fe4ae64e627c0964c"/><file name="platezhru.png" hash="2f36e088146ab75470c7a55177db8c07"/><file name="platika.png" hash="03e93ab41b0d330706e2c4f85cae966a"/><file name="postoffice_ru.png" hash="8ade3cd1711071ab73248d4ba62eae64"/><file name="pps.png" hash="29f4efc8d08cfd5ba90920b1fcef6bde"/><file name="pps_small.png" hash="7bf1fa7c4adcd8dfc2b2f56eb172fcaa"/><file name="pps_small_grey.png" hash="08d6188b7f5c13ec9c5f3488b4cbf19e"/><file name="pps_tiny.png" hash="4ed68db4ca98ac69f0557319a8284c8d"/><file name="pse.png" hash="6af65a4a18af66d103473fece5536e1c"/><file name="pse_small.png" hash="1f6695131dca61647b07f7180e695c46"/><file name="pse_small_grey.png" hash="7adf2fdfc48d8b078f7c0aeaa4f50e1c"/><file name="pse_tiny.png" hash="128b2749a126cfade0300f27c6919308"/><file name="qiwi.png" hash="b5e092af3394bc333fe83d073e8a6dfd"/><file name="qiwiwallet.png" hash="623b4c7fec53864fdee6d567da5f61cc"/><file name="refresh.png" hash="69ddc65b628d15a4375e66792c07484f"/><file name="safetypay.png" hash="af4e58d22f816f148faae179d0867b3f"/><file name="safetypay_small.png" hash="26749f1a95011897c8aaf568425df3dc"/><file name="safetypay_small_grey.png" hash="e5f3e5287e3fee2d77c065063b43e17d"/><file name="safetypay_tiny.png" hash="f3700f2d3cda7834cd178ac0f70d6352"/><file name="sendEmail.png" hash="cdddfa5e77d565a0ed23b6c26e0dee09"/><file name="sendEmail_small.png" hash="b5d63cc1613f08a08194442647ee451d"/><file name="sepadirectdebit.png" hash="e565455436d808fa07499131296490de"/><file name="sms.png" hash="7c6c0fddee039be4d879808b374f06f5"/><file name="sms_small.png" hash="fd1d52278d2446c7fe1c34d4fc70d556"/><file name="sms_tiny.png" hash="ed22de378fdbc717f987f8d4199e0452"/><file name="solo.png" hash="13f13c36cff7835d4a46df140fe432a3"/><file name="solo_small.png" hash="96de4f5f750a415fef573ce28092bf68"/><file name="solo_small_grey.png" hash="75c9b0b2daae0d6d80a5f5ff4f14e8d6"/><file name="solo_tiny.png" hash="3e2d7a21d19b12ed84aabdb26304fae6"/><file name="switch.png" hash="8cf19bb8c744a3f852511e781c176c07"/><file name="template.xcf" hash="e5035cd9e4e96859e50c1a9773098e89"/><file name="tenpay.png" hash="ddd0b5b8e3ff63cf1bfc555fbede0242"/><file name="tenpay_small.png" hash="2aa6c5919108eec42ed5c47ad4155a8f"/><file name="tenpay_small_grey.png" hash="6a21283b21295eefb4db553f877ea4c1"/><file name="tenpay_tiny.png" hash="736275eeec39e56c3c1d29fcb9d8ebb7"/><file name="terminal_RU.png" hash="711ab27d1cbbf6771e0ee133f75c7c46"/><file name="terminal_RU_small.png" hash="9bafe5dd035f73757f553250382764c6"/><file name="terminal_RU_tiny.png" hash="1b4dce2e901d90185933420cd80648cb"/><file name="tnt_rembours.png" hash="a8abb6f51d7893da39fcc2477d7bd2bb"/><file name="tnt_rembours_small.png" hash="72ee2b0ae6742cd325bda44a14093f4c"/><file name="trustly.png" hash="2a82872cc0ada644b0442e05423a2db8"/><file name="trustpay.png" hash="88a3680bf1007661ab4fc63106aa1ff4"/><file name="uhisbank.png" hash="8c0967455a15aefe3cdfb47240a18850"/><file name="ukash.png" hash="b95eb9f2658923c38a6252f5ff9ca9c7"/><file name="ukash_small.png" hash="2210a65cd1fb85bc883d112b12c79e6e"/><file name="ukash_small_grey.png" hash="65e6cc21082ebd3c93e96bbf96499df4"/><file name="ukash_tiny.png" hash="543ab39e6dcbc094188b4f473ac4b998"/><file name="unionpay.png" hash="068dee300e2c12e58e9a47d3556e977c"/><file name="unionpay_small.png" hash="55a00c9d7bbcbe1c448b449974d85af1"/><file name="unionpay_small_grey.png" hash="5c69e46ee4663f2d0e47c7f503bbd1e4"/><file name="unionpay_tiny.png" hash="45d3b4e758237412b524a5c52418da67"/><file name="unknown.png" hash="b2d137147db4d6eb7dacb5414a4f7a30"/><file name="unknown_small.png" hash="a5234e9eb2e4485acb19b196876d762b"/><file name="vias.png" hash="aca848fa54b173225fe17637699d87c4"/><file name="vias_small.png" hash="37bee85c36b52a07a4529735a194a41e"/><file name="vias_small_grey.png" hash="4da77d558ae9488ee2a85191e9db8748"/><file name="vias_tiny.png" hash="1a45f0a2696b5539195c2fcb69be49b6"/><file name="visa-electron.png" hash="308132b89febd4979bac61594919057f"/><file name="visa-electron_small.png" hash="5ab129027f4f4acbc7a9aa2b5d0e84d3"/><file name="visa-electron_small_grey.png" hash="712b876d4f060613f54f2ec04516e512"/><file name="visa.png" hash="30f9fde31aa41197e71ccd9a63a1fe75"/><file name="visa_fr.png" hash="abd117879295333ac54497e15f81ea18"/><file name="visa_fr_small.png" hash="837db98a87141717dcd1b90bcb5ff5b1"/><file name="visa_fr_small_grey.png" hash="e8cef14608278ab71ef2ffd58e65dc9e"/><file name="visa_small.png" hash="cdab39efaf22fcd2ab88f3dc42c32de1"/><file name="visa_small_grey.png" hash="9411565a7e81c5c3cc484863dc53031a"/><file name="visa_tiny.png" hash="e374bec64dcc345848b43f0a8a3490c2"/><file name="wallet_RU.png" hash="29213300b3cf644c64d915418f259d87"/><file name="wallet_RU_small.png" hash="3308a16ce0f5b474af32505f587079b5"/><file name="wallet_RU_tiny.png" hash="c46cdb588d7a9a21a909e5af842414b5"/><file name="wallie.png" hash="fc97552b8249c3e96aa6f3cf8e3577bd"/><file name="wallie_small.png" hash="c0b60fe348b16e157eb0c64043f410c2"/><file name="wallie_tiny.png" hash="df61209a0e0517bbb3d65119d5ebfcbd"/><file name="webmoney.png" hash="3cca800e0962e0078b64361de11b935f"/><file name="webshopgiftcard.png" hash="09990fe325b20c2fcdaaa855457d5348"/><file name="wiwallet.png" hash="5db11152a23a72b2f4676841261c5db0"/><file name="wiwallet_small.png" hash="a4c5567f59ca4575a316e1bf3eb066c1"/><file name="wiwallet_small_grey.png" hash="b75b2af0b5c6129e8c1d7bc9087222b4"/><file name="wiwallet_tiny.png" hash="8b53e98458e15bc19b242d05ad678f2d"/><file name="yandexmoney.png" hash="e6a38c66b08ba78a68096f8ff1b2a41d"/><file name="yourgift.png" hash="87bd1ef190d75ec64fb66b77aaeb7b8c"/><file name="yourgift_small.png" hash="17300795f7fd31d5cb730685c2eb0098"/><file name="yourgift_small_grey.png" hash="69b235ccb6b7ef0dfb3a2645be60dbc6"/><file name="yourgift_tiny.png" hash="a3bc0b90775458ff9ef8499f7a5437ca"/></dir></dir><dir name="css"><file name="adyenstyle.css" hash="c4f2cb9f27c1b6282d133245499f9128"/></dir></dir></dir><dir name="default"><dir name="adyen"><dir><dir name="onestepcheckout"><dir name="js"><file name="onestepcheckout.js" hash="a3f69ca218c08e6de153aac7120dc3c7"/></dir></dir></dir></dir></dir><dir name="rwd"><dir name="adyen"><dir><dir name="onestepcheckout"><dir name="js"><file name="onestepcheckout.js" hash="a3f69ca218c08e6de153aac7120dc3c7"/></dir></dir></dir></dir></dir><dir name="enterprise"><dir name="adyen"><dir><dir name="onestepcheckout"><dir name="js"><file name="onestepcheckout.js" hash="a3f69ca218c08e6de153aac7120dc3c7"/></dir></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="adyen"><dir name="payment"><file name="adyen.encrypt.js" hash="6e6d006f2ac96f33a4531d3115f2d852"/><file name="elv.js" hash="db612a634c95727ec9db82c50e9aec8e"/></dir></dir></dir></target></contents>
40
  <compatible/>
41
  <dependencies><required><php><min>5.3.3</min><max>6.0.0</max></php></required></dependencies>
42
  </package>
skin/frontend/base/default/css/adyenstyle.css CHANGED
@@ -40,6 +40,23 @@
40
  .sp-methods #payment_form_adyen_hpp #payment_form_ideal table td input { margin-top: 15px; margin-left: 4px; /*margin-top: -38px; margin-left: 2px; position: relative; z-index: 1;*/ }
41
  .sp-methods #payment_form_adyen_hpp #payment_form_ideal table td img { /*margin-left: -25px;*/ }
42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  /* pos redirect page */
44
  .redirect-body-adyen { margin:0; padding:0;}
45
  #pos-redirect-page .logo { margin:10px 0 0 10px; width:336px; height:111px; background:url(../images/adyen/adyen_logo_large.png) left top no-repeat; }
@@ -47,4 +64,3 @@
47
  #pos-redirect-page .grey-header h1 { padding: 16px 10px; font-family: 'Open Sans', sans-serif; font-size:24px;color:white; }
48
  #pos-redirect-page .amount-box { width:300px; height:150px; padding-top:75px; margin:50px auto; border:1px solid #797c83; color:#797c83; text-align:center; font-weight:bold; font-size:34px; background-color: #f5f5f5; box-shadow: 0 0 2px 2px #888;}
49
  #pos-redirect-page #launchlink { margin-top:10px; clear:both; display:block; color:#797C83; text-decoration:none; }
50
-
40
  .sp-methods #payment_form_adyen_hpp #payment_form_ideal table td input { margin-top: 15px; margin-left: 4px; /*margin-top: -38px; margin-left: 2px; position: relative; z-index: 1;*/ }
41
  .sp-methods #payment_form_adyen_hpp #payment_form_ideal table td img { /*margin-left: -25px;*/ }
42
 
43
+ /* for onepagecheckout */
44
+ .payment-methods dd#container_payment_method_adyen_hpp { margin:0; padding:0;}
45
+ /* end for onepagecheckout */
46
+
47
+ .sp-methods h3.other-payment { margin-top:15px; }
48
+ .sp-methods #oneclick_payment_form_adyen_oneclick { padding-top:10px; }
49
+ .sp-methods #oneclick_payment_form_adyen_oneclick .recurring-creditcards .recurring_type { float:left; vertical-align: middle; height:120px;}
50
+ .sp-methods #oneclick_payment_form_adyen_oneclick .creditcard-block { display:inline-block; border: 1px solid #999; padding:10px; margin-left:10px; min-width: 568px; }
51
+ .sp-methods #oneclick_payment_form_adyen_oneclick .creditcard-block img { margin-bottom:10px;}
52
+ .sp-methods #oneclick_payment_form_adyen_oneclick .creditcard-block .columns { float:left; margin-right:10px; height:30px;}
53
+ .sp-methods #oneclick_payment_form_adyen_oneclick .creditcard-block .columns .update-expiration-date { display:inline; float:none; }
54
+ .sp-methods #oneclick_payment_form_adyen_oneclick .creditcard-block label { display:block; }
55
+ .sp-methods #oneclick_payment_form_adyen_oneclick .creditcard-block .columns.three.b label { width:175px;}
56
+ .sp-methods #oneclick_payment_form_adyen_oneclick .creditcard-block .creditcard-holder-name { margin-top:20px;}
57
+
58
+
59
+
60
  /* pos redirect page */
61
  .redirect-body-adyen { margin:0; padding:0;}
62
  #pos-redirect-page .logo { margin:10px 0 0 10px; width:336px; height:111px; background:url(../images/adyen/adyen_logo_large.png) left top no-repeat; }
64
  #pos-redirect-page .grey-header h1 { padding: 16px 10px; font-family: 'Open Sans', sans-serif; font-size:24px;color:white; }
65
  #pos-redirect-page .amount-box { width:300px; height:150px; padding-top:75px; margin:50px auto; border:1px solid #797c83; color:#797c83; text-align:center; font-weight:bold; font-size:34px; background-color: #f5f5f5; box-shadow: 0 0 2px 2px #888;}
66
  #pos-redirect-page #launchlink { margin-top:10px; clear:both; display:block; color:#797C83; text-decoration:none; }
 
skin/frontend/base/default/images/adyen/afterpay_default.png ADDED
Binary file
skin/frontend/default/adyen/onestepcheckout/js/onestepcheckout.js ADDED
@@ -0,0 +1,1051 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ /* Login popup class */
4
+ var OneStepCheckoutLoginPopup = Class.create({
5
+ initialize: function(options) {
6
+ this.options = options;
7
+ this.popup_container = $('onestepcheckout-login-popup');
8
+ this.popup_link = $('onestepcheckout-login-link');
9
+ this.popup = null;
10
+ this.createPopup();
11
+ this.mode = 'login';
12
+
13
+ this.forgot_password_link = $('onestepcheckout-forgot-password-link');
14
+ this.forgot_password_container = $('onestepcheckout-login-popup-contents-forgot');
15
+ this.forgot_password_loading = $('onestepcheckout-forgot-loading');
16
+ this.forgot_password_error = $('onestepcheckout-forgot-error');
17
+ this.forgot_password_success = $('onestepcheckout-forgot-success');
18
+ this.forgot_password_button = $('onestepcheckout-forgot-button');
19
+ this.forgot_password_table = $('onestepcheckout-forgot-table');
20
+
21
+ this.login_link = $('onestepcheckout-return-login-link');
22
+ this.login_container = $('onestepcheckout-login-popup-contents-login');
23
+ this.login_table = $('onestepcheckout-login-table');
24
+ this.login_error = $('onestepcheckout-login-error');
25
+ this.login_loading = $('onestepcheckout-login-loading');
26
+ this.login_button = $('onestepcheckout-login-button');
27
+ this.login_form = $('onestepcheckout-login-form');
28
+ this.login_username = $('id_onestepcheckout_username');
29
+
30
+ /* Bindings for the enter button */
31
+ this.keypress_handler = function(e) {
32
+ if(e.keyCode == Event.KEY_RETURN) {
33
+ e.preventDefault();
34
+
35
+ if(this.mode == 'login') {
36
+ this.login_handler();
37
+ } else if(this.mode == 'forgot') {
38
+ this.forgot_password_handler();
39
+ }
40
+ }
41
+ }.bind(this);
42
+
43
+ this.login_handler = function(e) {
44
+
45
+ var parameters = this.login_form.serialize(true);
46
+ var url = this.options.login_url;
47
+ this.showLoginLoading();
48
+
49
+ new Ajax.Request(url, {
50
+ method: 'post',
51
+ parameters: parameters,
52
+ onSuccess: function(transport) {
53
+ var result = transport.responseText.evalJSON();
54
+ if(result.success) {
55
+ window.location = window.location;
56
+ } else {
57
+ this.showLoginError(result.error);
58
+ }
59
+ }.bind(this)
60
+ });
61
+ };
62
+
63
+ this.forgot_password_handler = function(e) {
64
+ var email = $('id_onestepcheckout_email').getValue();
65
+
66
+ if(email == '') {
67
+ alert(this.options.translations.invalid_email);
68
+ return;
69
+ }
70
+
71
+ this.showForgotPasswordLoading();
72
+
73
+ /* Prepare AJAX call */
74
+ var url = this.options.forgot_password_url;
75
+
76
+ new Ajax.Request(url, {
77
+ method: 'post',
78
+ parameters: { email: email },
79
+ onSuccess: function(transport) {
80
+ var result = transport.responseText.evalJSON();
81
+
82
+ if(result.success) {
83
+ /* Show success message */
84
+ this.showForgotPasswordSuccess();
85
+
86
+ /* Pre-set username to simplify login */
87
+ this.login_username.setValue(email);
88
+ } else {
89
+ /* Show error message */
90
+ this.showForgotPasswordError();
91
+ }
92
+
93
+ }.bind(this)
94
+ });
95
+ };
96
+
97
+ this.bindEventHandlers();
98
+ },
99
+
100
+ bindEventHandlers: function() {
101
+ /* First bind the link for opening the popup */
102
+ if(this.popup_link){
103
+ this.popup_link.observe('click', function(e) {
104
+ e.preventDefault();
105
+ this.popup.open();
106
+ }.bind(this));
107
+ }
108
+
109
+ /* Link for closing the popup */
110
+ if(this.popup_container){
111
+ this.popup_container.select('p.close a').invoke(
112
+ 'observe', 'click', function(e) {
113
+ this.popup.close();
114
+ }.bind(this));
115
+ }
116
+
117
+ /* Link to switch between states */
118
+ if(this.login_link){
119
+ this.login_link.observe('click', function(e) {
120
+ e.preventDefault();
121
+ this.forgot_password_container.hide();
122
+ this.login_container.show();
123
+ this.mode = 'login';
124
+ }.bind(this));
125
+ }
126
+
127
+ /* Link to switch between states */
128
+ if(this.forgot_password_link){
129
+ this.forgot_password_link.observe('click', function(e) {
130
+ e.preventDefault();
131
+ this.login_container.hide();
132
+ this.forgot_password_container.show();
133
+ this.mode = 'forgot';
134
+ }.bind(this));
135
+ }
136
+
137
+ /* Now bind the submit button for logging in */
138
+ if(this.login_button){
139
+ this.login_button.observe(
140
+ 'click', this.login_handler.bind(this));
141
+ }
142
+
143
+ /* Now bind the submit button for forgotten password */
144
+ if(this.forgot_password_button){
145
+ this.forgot_password_button.observe('click',
146
+ this.forgot_password_handler.bind(this));
147
+ }
148
+
149
+ /* Handle return keypress when open */
150
+ if(this.popup){
151
+ this.popup.observe('afterOpen', function(e) {
152
+ document.observe('keypress', this.keypress_handler);
153
+ }.bind(this));
154
+
155
+ this.popup.observe('afterClose', function(e) {
156
+ this.resetPopup();
157
+ document.stopObserving('keypress', this.keypress_handler);
158
+ }.bind(this));
159
+ }
160
+
161
+ },
162
+
163
+ resetPopup: function() {
164
+ this.login_table.show();
165
+ this.forgot_password_table.show();
166
+
167
+ this.login_loading.hide();
168
+ this.forgot_password_loading.hide();
169
+
170
+ this.login_error.hide();
171
+ this.forgot_password_error.hide();
172
+
173
+ this.login_container.show();
174
+ this.forgot_password_container.hide();
175
+ },
176
+
177
+ showLoginError: function(error) {
178
+ this.login_table.show();
179
+ this.login_error.show();
180
+ this.login_loading.hide();
181
+
182
+ if(error) {
183
+ this.login_error.update(error);
184
+ }
185
+ },
186
+
187
+ showLoginLoading: function() {
188
+ this.login_table.hide();
189
+ this.login_loading.show();
190
+ this.login_error.hide();
191
+ },
192
+
193
+ showForgotPasswordSuccess: function() {
194
+ this.forgot_password_error.hide();
195
+ this.forgot_password_loading.hide();
196
+ this.forgot_password_table.hide();
197
+ this.forgot_password_success.show();
198
+ },
199
+
200
+ showForgotPasswordError: function() {
201
+ this.forgot_password_error.show();
202
+ this.forgot_password_error.update(
203
+ this.options.translations.email_not_found),
204
+
205
+ this.forgot_password_table.show();
206
+ this.forgot_password_loading.hide();
207
+ },
208
+
209
+ showForgotPasswordLoading: function() {
210
+ this.forgot_password_loading.show();
211
+ this.forgot_password_error.hide();
212
+ this.forgot_password_table.hide();
213
+ },
214
+
215
+ show: function(){
216
+ this.popup.open();
217
+ },
218
+
219
+ createPopup: function() {
220
+ this.popup = new Control.Modal(this.popup_container, {
221
+ overlayOpacity: 0.65,
222
+ fade: true,
223
+ fadeDuration: 0.3,
224
+ position: 'center_once'
225
+ });
226
+ }
227
+ });
228
+
229
+ function $RF(el, radioGroup) {
230
+ if($(el).type && $(el).type.toLowerCase() == 'radio') {
231
+ var radioGroup = $(el).name;
232
+ var el = $(el).form;
233
+ } else if ($(el).tagName.toLowerCase() != 'form') {
234
+ return false;
235
+ }
236
+
237
+ var checked = $(el).getInputs('radio', radioGroup).find(
238
+ function(re) {return re.checked;}
239
+ );
240
+ return (checked) ? $F(checked) : null;
241
+ }
242
+
243
+ function $RFF(el, radioGroup) {
244
+ if($(el).type && $(el).type.toLowerCase() == 'radio') {
245
+ var radioGroup = $(el).name;
246
+ var el = $(el).form;
247
+ } else if ($(el).tagName.toLowerCase() != 'form') {
248
+ return false;
249
+ }
250
+ return $(el).getInputs('radio', radioGroup).first();
251
+ }
252
+
253
+ function get_totals_element()
254
+ {
255
+ // Search for OSC summary element
256
+ var search_osc = $$('div.onestepcheckout-summary');
257
+
258
+ if(search_osc.length > 0) {
259
+ return search_osc[0];
260
+ }
261
+
262
+ var search_cart = $$('div.shopping-cart-totals');
263
+
264
+ if(search_cart.length > 0) {
265
+ return search_cart[0];
266
+ }
267
+
268
+ if($('shopping-cart-totals-table')) {
269
+ return $('shopping-cart-totals-table');
270
+ }
271
+
272
+ }
273
+
274
+ function get_save_methods_function(url, update_payments)
275
+ {
276
+
277
+ if(typeof update_payments == 'undefined') {
278
+ var update_payments = false;
279
+ }
280
+ return function(e) {
281
+
282
+ if(typeof e != 'undefined') {
283
+ var element = e.element();
284
+
285
+ if(element.name != 'shipping_method') {
286
+ update_payments = false;
287
+ }
288
+ }
289
+
290
+ var form = $('onestepcheckout-form');
291
+ var shipping_method = $RF(form, 'shipping_method');
292
+ var payment_method = $RF(form, 'payment[method]');
293
+
294
+ var totals = get_totals_element();
295
+ totals.update('<div class="loading-ajax">&nbsp;</div>');
296
+
297
+ if(update_payments) {
298
+ var payment_methods = $$('div.payment-methods')[0];
299
+ payment_methods.update('<div class="loading-ajax">&nbsp;</div>');
300
+ }
301
+
302
+ var parameters = {
303
+ shipping_method: shipping_method,
304
+ payment_method: payment_method
305
+ }
306
+
307
+ /* Find payment parameters and include */
308
+ var items = $$('input[name^=payment]').concat($$('select[name^=payment]'));
309
+ var names = items.pluck('name');
310
+ var values = items.pluck('value');
311
+
312
+ for(var x=0; x < names.length; x++) {
313
+ if(names[x] != 'payment[method]') {
314
+ parameters[names[x]] = values[x];
315
+ }
316
+ }
317
+
318
+ new Ajax.Request(url, {
319
+ method: 'post',
320
+ onSuccess: function(transport) {
321
+ if(transport.status == 200) {
322
+ var data = transport.responseText.evalJSON();
323
+
324
+ totals.update(data.summary);
325
+
326
+ if(update_payments) {
327
+
328
+ payment_methods.replace(data.payment_method);
329
+
330
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
331
+ $$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
332
+ $$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
333
+
334
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
335
+ $$('div.onestepcheckout-payment-method-error').each(function(item) {
336
+ new Effect.Fade(item);
337
+ });
338
+ });
339
+
340
+ if($RF(form, 'payment[method]') != null) {
341
+ try {
342
+ var payment_method = $RF(form, 'payment[method]');
343
+ $('container_payment_method_' + payment_method).show();
344
+ $('payment_form_' + payment_method).show();
345
+ } catch(err) {
346
+
347
+ }
348
+ }
349
+
350
+ }
351
+ }
352
+ },
353
+ parameters: parameters
354
+ });
355
+ }
356
+ }
357
+
358
+ function exclude_unchecked_checkboxes(data)
359
+ {
360
+ var items = [];
361
+ for(var x=0; x < data.length; x++) {
362
+ var item = data[x];
363
+ if(item.type == 'checkbox') {
364
+ if(item.checked) {
365
+ items.push(item);
366
+ }
367
+ }
368
+ else {
369
+ items.push(item);
370
+ }
371
+ }
372
+
373
+ return items;
374
+ }
375
+
376
+ function get_save_billing_function(url, set_methods_url, update_payments, triggered)
377
+ {
378
+ if(typeof update_payments == 'undefined') {
379
+ var update_payments = false;
380
+ }
381
+
382
+ if(typeof triggered == 'undefined') {
383
+ var triggered = true;
384
+ }
385
+
386
+ if(!triggered){
387
+ return function(){return;};
388
+ }
389
+
390
+ return function() {
391
+ var form = $('onestepcheckout-form');
392
+ var items = exclude_unchecked_checkboxes($$('input[name^=billing]').concat($$('select[name^=billing]')));
393
+ var names = items.pluck('name');
394
+ var values = items.pluck('value');
395
+ var parameters = {
396
+ shipping_method: $RF(form, 'shipping_method')
397
+ };
398
+
399
+
400
+ var street_count = 0;
401
+ for(var x=0; x < names.length; x++) {
402
+ if(names[x] != 'payment[method]') {
403
+
404
+ var current_name = names[x];
405
+
406
+ if(names[x] == 'billing[street][]') {
407
+ current_name = 'billing[street][' + street_count + ']';
408
+ street_count = street_count + 1;
409
+ }
410
+
411
+ parameters[current_name] = values[x];
412
+ }
413
+ }
414
+
415
+ var use_for_shipping = $('billing:use_for_shipping_yes');
416
+
417
+
418
+
419
+
420
+ if(use_for_shipping && use_for_shipping.getValue() != '1') {
421
+ var items = $$('input[name^=shipping]').concat($$('select[name^=shipping]'));
422
+ var shipping_names = items.pluck('name');
423
+ var shipping_values = items.pluck('value');
424
+ var shipping_parameters = {};
425
+ var street_count = 0;
426
+
427
+ for(var x=0; x < shipping_names.length; x++) {
428
+ if(shipping_names[x] != 'shipping_method') {
429
+ var current_name = shipping_names[x];
430
+ if(shipping_names[x] == 'shipping[street][]') {
431
+ current_name = 'shipping[street][' + street_count + ']';
432
+ street_count = street_count + 1;
433
+ }
434
+
435
+ parameters[current_name] = shipping_values[x];
436
+ }
437
+ }
438
+ }
439
+
440
+ var shipment_methods = $$('div.onestepcheckout-shipping-method-block')[0];
441
+ var shipment_methods_found = false;
442
+
443
+ if(typeof shipment_methods != 'undefined') {
444
+ shipment_methods_found = true;
445
+ }
446
+
447
+ if(shipment_methods_found) {
448
+ shipment_methods.update('<div class="loading-ajax">&nbsp;</div>');
449
+ }
450
+
451
+ var payment_hpp_ideal_type = $RF(form, 'payment[hpp_ideal_type]');
452
+ var payment_hpp_type = $RF(form, 'payment[hpp_type]');
453
+ var payment_recurring_type = $RF(form, 'payment[recurring]');
454
+ var payment_recurring_type_cvc = $('adyen_oneclick_oneclick_cid_'+payment_recurring_type);
455
+ var payment_method = $RF(form, 'payment[method]');
456
+ parameters['payment_method'] = payment_method;
457
+ parameters['payment[method]'] = payment_method;
458
+
459
+ if(update_payments){
460
+ var payment_methods = $$('div.payment-methods')[0];
461
+ payment_methods.update('<div class="loading-ajax">&nbsp;</div>');
462
+ }
463
+
464
+ var totals = get_totals_element();
465
+ totals.update('<div class="loading-ajax">&nbsp;</div>');
466
+
467
+
468
+ new Ajax.Request(url, {
469
+ method: 'post',
470
+ onSuccess: function(transport) {
471
+ if(transport.status == 200) {
472
+
473
+ var data = transport.responseText.evalJSON();
474
+
475
+ // Update shipment methods
476
+ if(shipment_methods_found) {
477
+ shipment_methods.update(data.shipping_method);
478
+ }
479
+
480
+ if(update_payments){
481
+ payment_methods.replace(data.payment_method);
482
+ }
483
+
484
+ totals.update(data.summary);
485
+
486
+
487
+ }
488
+ },
489
+ onComplete: function(transport){
490
+ if(transport.status == 200) {
491
+ if(shipment_methods_found) {
492
+ $$('dl.shipment-methods input').invoke('observe', 'click', get_separate_save_methods_function(set_methods_url, update_payments));
493
+ $$('dl.shipment-methods input').invoke('observe', 'click', function() {
494
+ $$('div.onestepcheckout-shipment-method-error').each(function(item) {
495
+ new Effect.Fade(item);
496
+ });
497
+ });
498
+ }
499
+
500
+ if(update_payments){
501
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(set_methods_url));
502
+ $$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
503
+ $$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
504
+
505
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
506
+ $$('div.onestepcheckout-payment-method-error').each(function(item) {
507
+ new Effect.Fade(item);
508
+ });
509
+ });
510
+
511
+ if($RF(form, 'payment[method]') != null) {
512
+ try {
513
+ var payment_method = $RF(form, 'payment[method]');
514
+ $('container_payment_method_' + payment_method).show();
515
+ var payment_form = $('payment_form_' + payment_method);
516
+ if(payment_form)
517
+ $(payment_form).show();
518
+ else if(payment_method == "adyen_hpp") { // check if payment type is hpp (this has other id so should come in else )
519
+ // set sub payment method back
520
+ $('hpp_type_'+payment_hpp_type).checked = true;
521
+
522
+ // check if ideal payment bank is chosen
523
+ if(payment_hpp_type == "ideal") {
524
+ if(payment_hpp_ideal_type) {
525
+ // get issue_id this is before the slash
526
+ var issue_id = payment_hpp_ideal_type.substr(0, payment_hpp_ideal_type.indexOf('/'));
527
+ $('hpp_ideal_type_'+issue_id).checked = true;
528
+ }
529
+ $('payment_form_ideal').show();
530
+ }
531
+ } else if(payment_method == "adyen_oneclick") { // check if payment type is hpp
532
+ // set sub payment method back
533
+ $('recurring_type_'+payment_recurring_type).checked = true;
534
+ // set back the cvc code
535
+ $('adyen_oneclick_oneclick_cid_'+payment_recurring_type).value = payment_recurring_type_cvc.value;
536
+ // show the cvc code block
537
+ var cvc_block = "cvc_block_" + payment_recurring_type;
538
+ $(cvc_block).show();
539
+ }
540
+ } catch(err) {
541
+
542
+ }
543
+ }
544
+ }
545
+ }
546
+ },
547
+ parameters: parameters
548
+ });
549
+
550
+ }
551
+ }
552
+
553
+ function get_separate_save_methods_function(url, update_payments)
554
+ {
555
+ if(typeof update_payments == 'undefined') {
556
+ var update_payments = false;
557
+ }
558
+
559
+ return function(e) {
560
+ if(typeof e != 'undefined') {
561
+ var element = e.element();
562
+
563
+ if(element.name != 'shipping_method') {
564
+ update_payments = false;
565
+ }
566
+ }
567
+
568
+ var form = $('onestepcheckout-form');
569
+ var shipping_method = $RF(form, 'shipping_method');
570
+ var payment_method = $RF(form, 'payment[method]');
571
+ var payment_hpp_type = $RF(form, 'payment[hpp_type]');
572
+ var payment_hpp_ideal_type = $RF(form, 'payment[hpp_ideal_type]');
573
+ var payment_recurring_type = $RF(form, 'payment[recurring]');
574
+ var payment_recurring_type_cvc = $('adyen_oneclick_oneclick_cid_'+payment_recurring_type);
575
+
576
+ var totals = get_totals_element();
577
+
578
+ var freeMethod = $('p_method_free');
579
+ if(freeMethod){
580
+ payment.reloadcallback = true;
581
+ payment.countreload = 1;
582
+ }
583
+
584
+ totals.update('<div class="loading-ajax">&nbsp;</div>');
585
+
586
+ if(update_payments) {
587
+ var payment_methods = $$('div.payment-methods')[0];
588
+ payment_methods.update('<div class="loading-ajax">&nbsp;</div>');
589
+ }
590
+
591
+ var parameters = {
592
+ shipping_method: shipping_method,
593
+ payment_method: payment_method
594
+ }
595
+
596
+ /* Find payment parameters and include */
597
+ var items = $$('input[name^=payment]').concat($$('select[name^=payment]'));
598
+ var names = items.pluck('name');
599
+ var values = items.pluck('value');
600
+
601
+ for(var x=0; x < names.length; x++) {
602
+ if(names[x] != 'payment[method]') {
603
+ parameters[names[x]] = values[x];
604
+ }
605
+ }
606
+
607
+ new Ajax.Request(url, {
608
+ method: 'post',
609
+ onSuccess: function(transport) {
610
+ if(transport.status == 200) {
611
+ var data = transport.responseText.evalJSON();
612
+ var form = $('onestepcheckout-form');
613
+
614
+ totals.update(data.summary);
615
+
616
+ if(update_payments) {
617
+
618
+ payment_methods.replace(data.payment_method);
619
+
620
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
621
+ $$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
622
+ $$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
623
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
624
+ $$('div.onestepcheckout-payment-method-error').each(function(item) {
625
+ new Effect.Fade(item);
626
+ });
627
+ });
628
+
629
+ if($RF($('onestepcheckout-form'), 'payment[method]') != null) {
630
+ try {
631
+ var payment_method = $RF(form, 'payment[method]');
632
+ $('container_payment_method_' + payment_method).show();
633
+ var payment_form = $('payment_form_' + payment_method);
634
+ if(payment_form)
635
+ $(payment_form).show();
636
+ else if(payment_method == "adyen_hpp") { // check if payment type is hpp (this has other id so should come in else )
637
+ // set sub payment method back
638
+ $('hpp_type_'+payment_hpp_type).checked = true;
639
+
640
+ // check if ideal payment bank is chosen
641
+ if(payment_hpp_type == "ideal") {
642
+ if(payment_hpp_ideal_type) {
643
+ // get issue_id this is before the slash
644
+ var issue_id = payment_hpp_ideal_type.substr(0, payment_hpp_ideal_type.indexOf('/'));
645
+ $('hpp_ideal_type_'+issue_id).checked = true;
646
+ }
647
+ $('payment_form_ideal').show();
648
+ }
649
+ } else if(payment_method == "adyen_oneclick") { // check if payment type is hpp
650
+ // set sub payment method back
651
+ $('recurring_type_'+payment_recurring_type).checked = true;
652
+ // set back the cvc code
653
+ $('adyen_oneclick_oneclick_cid_'+payment_recurring_type).value = payment_recurring_type_cvc.value;
654
+ // show the cvc code block
655
+ var cvc_block = "cvc_block_" + payment_recurring_type;
656
+ $(cvc_block).show();
657
+ // show update link url
658
+ var update_link = "update-expiration-date-" + payment_recurring_type;
659
+ $(update_link).show();
660
+ }
661
+ } catch(err) {
662
+
663
+ }
664
+ }
665
+ }
666
+ }
667
+ },
668
+ parameters: parameters
669
+ });
670
+ }
671
+ }
672
+
673
+ function paymentrefresh(url) {
674
+ var payment_methods = $$('div.payment-methods')[0];
675
+ payment_methods.update('<div class="loading-ajax">&nbsp;</div>');
676
+ new Ajax.Request(url, {
677
+ method: 'get',
678
+ onSuccess: function(transport){
679
+ if(transport.status == 200) {
680
+ var data = transport.responseText.evalJSON();
681
+ payment_methods.replace(data.payment_method);
682
+
683
+ $$('div.payment-methods input[name="payment\[method\]"]', 'div.payment-methods input[name="payment\[useProfile\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
684
+ $$('div.payment-methods input[name="payment\[method\]"]', 'div.payment-methods input[name="payment\[useProfile\]"]').invoke('observe', 'click', function() {
685
+ $$('div.onestepcheckout-payment-method-error').each(function(item) {
686
+ new Effect.Fade(item);
687
+ });
688
+ });
689
+
690
+ if($RF(form, 'payment[method]') != null) {
691
+ try {
692
+ var payment_method = $RF(form, 'payment[method]');
693
+ $('container_payment_method_' + payment_method).show();
694
+ $('payment_form_' + payment_method).show();
695
+ } catch(err){}
696
+ }
697
+
698
+ }
699
+ }
700
+ });
701
+ }
702
+
703
+ function addressPreview(templates, target) {
704
+ var bparams = {};
705
+ var sparams = {};
706
+ var savedBillingItems = $('billing-address-select');
707
+ if(savedBillingItems && savedBillingItems.getValue()){
708
+ index = savedBillingItems.selectedIndex;
709
+ bparams = customerBAddresses[index];
710
+ } else {
711
+ var items = $$('input[name^=billing]').concat($$('select[name^=billing]'));
712
+ items.each(function(s) {
713
+ if(s.getStyle('display') != 'none'){
714
+ selectText = s.options
715
+ if(selectText){
716
+ value = selectText[s.selectedIndex].text;
717
+ } else {
718
+ value = s.getValue();
719
+ }
720
+ if(value){
721
+ value = '<span class="' + s.id.replace(':','-') + '">' + value.escapeHTML() + '</span>';
722
+ }
723
+ if(s.id == 'billing:region_id'){
724
+ bparams['billing:region'] = value;
725
+ } else {
726
+ bparams[s.id] = value;
727
+ }
728
+ }
729
+ });
730
+ }
731
+
732
+
733
+
734
+ var savedShippingItems = $('shipping-address-select');
735
+ if(savedShippingItems && savedShippingItems.getValue()){
736
+ index = savedShippingItems.selectedIndex;
737
+ sparams = customerSAddresses[index];
738
+ } else {
739
+ var items = $$('input[name^=shipping]').concat($$('select[name^=shipping]'));
740
+ items.each(function(s) {
741
+ if(s.getStyle('display') != 'none'){
742
+ selectText = s.options
743
+ if(selectText){
744
+ value = selectText[s.selectedIndex].text;
745
+ } else {
746
+ value = s.getValue();
747
+ }
748
+ if(value){
749
+ value = '<span class="' + s.id.replace(':','-') + '">' + value.escapeHTML() + '</span>';
750
+ }
751
+ if(s.id == 'shipping:region_id'){
752
+ sparams['shipping:region'] = value;
753
+ } else {
754
+ sparams[s.id] = value;
755
+ }
756
+ }
757
+ });
758
+ }
759
+
760
+
761
+ var form = $('onestepcheckout-form');
762
+
763
+ var shipping_method = $RF(form, 'shipping_method');
764
+ if(shipping_method){
765
+ var shipping_label = $('s_method_' + shipping_method).up('dt').down('label').innerHTML.stripScripts();
766
+ var shipping_title = $('s_method_' + shipping_method).up('dt').previous('dd').innerHTML.stripScripts();
767
+ var shipping_row = shipping_title + ' - ' + shipping_label
768
+ }
769
+
770
+ var useOnlyBilling = $('billing:use_for_shipping_yes').getValue();
771
+ billinga_template = new Template(templates.billing);
772
+
773
+ if(useOnlyBilling){
774
+ shippinga_template = new Template(templates.billing);
775
+ }else{
776
+ shippinga_template = new Template(templates.shipping);
777
+ }
778
+
779
+ var payment_method = payment.currentMethod;
780
+
781
+ if(payment_method){
782
+ var payment_label = $('p_method_'+payment_method).up('dt').down('label').innerHTML.stripScripts();
783
+ }
784
+
785
+ var targetelem = $(target + '_billinga').childElements()[1];
786
+ if(targetelem){
787
+ targetelem.update(billinga_template.evaluate(bparams));
788
+ }
789
+
790
+ var targetelem = $(target + '_shippinga').childElements()[1];
791
+ if(targetelem){
792
+ if(useOnlyBilling){
793
+ targetelem.update(shippinga_template.evaluate(bparams));
794
+ }else{
795
+ targetelem.update(shippinga_template.evaluate(sparams));
796
+ }
797
+ }
798
+
799
+ var targetelem = $(target + '_shipping').childElements()[1];
800
+ if(targetelem){
801
+ targetelem.update(shipping_row);
802
+ }
803
+
804
+ var targetelem = $(target + '_payment').childElements()[1];
805
+ if(targetelem){
806
+ targetelem.update(payment_label);
807
+ }
808
+
809
+ var targetelem = $(target + '_summary').childElements()[1];
810
+ if(targetelem){
811
+ targetelem.update('');
812
+ targetelem.insert($$('table.onestepcheckout-summary')[0].cloneNode(true));
813
+ targetelem.insert($$('table.onestepcheckout-totals')[0].cloneNode(true));
814
+ }
815
+ }
816
+
817
+
818
+ var Checkout = Class.create();
819
+ Checkout.prototype = {
820
+ initialize: function(){
821
+ this.accordion = '';
822
+ this.progressUrl = '';
823
+ this.reviewUrl = '';
824
+ this.saveMethodUrl = '';
825
+ this.failureUrl = '';
826
+ this.billingForm = false;
827
+ this.shippingForm= false;
828
+ this.syncBillingShipping = false;
829
+ this.method = '';
830
+ this.payment = '';
831
+ this.loadWaiting = false;
832
+ },
833
+
834
+ ajaxFailure: function(){
835
+ location.href = this.failureUrl;
836
+ },
837
+
838
+ setLoadWaiting: function(step, keepDisabled) {
839
+ return true
840
+ }
841
+ };
842
+
843
+ //billing
844
+ var Billing = Class.create();
845
+ Billing.prototype = {
846
+ initialize: function(form, addressUrl, saveUrl){
847
+ this.form = form;
848
+ },
849
+
850
+ setAddress: function(addressId){
851
+
852
+ },
853
+
854
+ newAddress: function(isNew){
855
+ if (isNew) {
856
+ //this.resetSelectedAddress();
857
+ Element.show('billing_address_list');
858
+ if($('billing:use_for_shipping_yes').getValue() != "1" && $('shipping-address-select').getValue() == ''){
859
+ Element.show('shipping_address_list');
860
+ }
861
+
862
+ } else {
863
+ Element.hide('billing_address_list');
864
+ }
865
+ $$('input[name^=billing]', 'select[id=billing:region_id]').each(function(e){
866
+ if(e.name=='billing[use_for_shipping]' || e.name=='billing[save_in_address_book]'){
867
+
868
+ } else {
869
+ e.value = '';
870
+ }
871
+ });
872
+ },
873
+
874
+ resetSelectedAddress: function(){
875
+ var selectElement = $('shipping-address-select')
876
+ if (selectElement) {
877
+ selectElement.value='';
878
+ }
879
+ },
880
+
881
+ fillForm: function(transport){
882
+
883
+ },
884
+
885
+ setUseForShipping: function(flag) {
886
+
887
+ },
888
+
889
+ save: function(){
890
+
891
+ },
892
+
893
+ resetLoadWaiting: function(transport){
894
+
895
+ },
896
+
897
+ nextStep: function(transport){
898
+
899
+ }
900
+ };
901
+
902
+ //shipping
903
+ var Shipping = Class.create();
904
+ Shipping.prototype = {
905
+ initialize: function(form){
906
+ this.form = form;
907
+ },
908
+
909
+ setAddress: function(addressId){
910
+
911
+ },
912
+
913
+ newAddress: function(isNew){
914
+ if (isNew) {
915
+ this.resetSelectedAddress();
916
+ Element.show('shipping_address_list');
917
+ } else {
918
+ Element.hide('shipping_address_list');
919
+ }
920
+
921
+ $$('#shipping_address input[name^=shipping],#shipping_address select[id=shipping:region_id]').each(function(e){
922
+ if(e.name=='shipping[save_in_address_book]'){
923
+
924
+ } else {
925
+ e.value = '';
926
+ }
927
+ })
928
+
929
+ },
930
+
931
+ resetSelectedAddress: function(){
932
+ var selectElement = $('shipping-address-select')
933
+ if (selectElement) {
934
+ selectElement.value='';
935
+ }
936
+ },
937
+
938
+ fillForm: function(transport){
939
+
940
+ },
941
+
942
+ setSameAsBilling: function(flag) {
943
+
944
+ },
945
+
946
+ syncWithBilling: function () {
947
+
948
+ },
949
+
950
+ setRegionValue: function(){
951
+ //$('shipping:region').value = $('billing:region').value;
952
+ },
953
+
954
+ save: function(){
955
+
956
+ }
957
+ };
958
+
959
+ //payment object
960
+ var Payment = Class.create();
961
+ Payment.prototype = {
962
+ beforeInitFunc:$H({}),
963
+ afterInitFunc:$H({}),
964
+ beforeValidateFunc:$H({}),
965
+ afterValidateFunc:$H({}),
966
+ initialize: function(form, saveUrl){
967
+ this.form = form;
968
+ this.saveUrl = saveUrl;
969
+ },
970
+
971
+ init : function () {
972
+ var elements = Form.getElements(this.form);
973
+ if ($(this.form)) {
974
+ //$(this.form).observe('submit', function(event){this.save();Event.stop(event);}.bind(this));
975
+ }
976
+ var method = null;
977
+ for (var i=0; i<elements.length; i++) {
978
+ if (elements[i].name=='payment[method]') {
979
+ if (elements[i].checked) {
980
+ method = elements[i].value;
981
+ }
982
+ } else {
983
+ elements[i].disabled = true;
984
+ }
985
+ }
986
+ if (method) this.switchMethod(method);
987
+ },
988
+
989
+ switchMethod: function(method){
990
+ if (this.currentMethod && $('payment_form_'+this.currentMethod)) {
991
+ var form = $('payment_form_'+this.currentMethod);
992
+ form.style.display = 'none';
993
+ var elements = form.select('input').concat(form.select('select')).concat(form.select('textarea'));
994
+ for (var i=0; i<elements.length; i++) elements[i].disabled = true;
995
+ }
996
+
997
+ if ($('payment_form_'+method)){
998
+ var form = $('payment_form_'+method);
999
+ form.style.display = '';
1000
+ var elements = form.select('input').concat(form.select('select')).concat(form.select('textarea'));
1001
+ for (var i=0; i<elements.length; i++) elements[i].disabled = false;
1002
+ this.currentMethod = method;
1003
+ }
1004
+ },
1005
+
1006
+ addBeforeValidateFunction : function(code, func) {
1007
+ this.beforeValidateFunc.set(code, func);
1008
+ },
1009
+
1010
+ beforeValidate : function() {
1011
+ var validateResult = true;
1012
+ var hasValidation = false;
1013
+ (this.beforeValidateFunc).each(function(validate){
1014
+ hasValidation = true;
1015
+ if ((validate.value)() == false) {
1016
+ validateResult = false;
1017
+ }
1018
+ }.bind(this));
1019
+ if (!hasValidation) {
1020
+ validateResult = false;
1021
+ }
1022
+ return validateResult;
1023
+ },
1024
+
1025
+ validate: function() {
1026
+ var methods = document.getElementsByName('payment[method]');
1027
+ if (methods.length==0) {
1028
+ alert(Translator.translate('Your order can not be completed at this time as there is no payment methods available for it.'));
1029
+ return false;
1030
+ }
1031
+ for (var i=0; i<methods.length; i++) {
1032
+ if (methods[i].checked) {
1033
+ return true;
1034
+ }
1035
+ }
1036
+ alert(Translator.translate('Please specify payment method.'));
1037
+ return false;
1038
+ },
1039
+
1040
+ save: function(){
1041
+ },
1042
+ addAfterInitFunction : function(code, func) {
1043
+ this.afterInitFunc.set(code, func);
1044
+ },
1045
+
1046
+ afterInit : function() {
1047
+ (this.afterInitFunc).each(function(init){
1048
+ (init.value)();
1049
+ });
1050
+ }
1051
+ };
skin/frontend/enterprise/adyen/onestepcheckout/js/onestepcheckout.js ADDED
@@ -0,0 +1,1051 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ /* Login popup class */
4
+ var OneStepCheckoutLoginPopup = Class.create({
5
+ initialize: function(options) {
6
+ this.options = options;
7
+ this.popup_container = $('onestepcheckout-login-popup');
8
+ this.popup_link = $('onestepcheckout-login-link');
9
+ this.popup = null;
10
+ this.createPopup();
11
+ this.mode = 'login';
12
+
13
+ this.forgot_password_link = $('onestepcheckout-forgot-password-link');
14
+ this.forgot_password_container = $('onestepcheckout-login-popup-contents-forgot');
15
+ this.forgot_password_loading = $('onestepcheckout-forgot-loading');
16
+ this.forgot_password_error = $('onestepcheckout-forgot-error');
17
+ this.forgot_password_success = $('onestepcheckout-forgot-success');
18
+ this.forgot_password_button = $('onestepcheckout-forgot-button');
19
+ this.forgot_password_table = $('onestepcheckout-forgot-table');
20
+
21
+ this.login_link = $('onestepcheckout-return-login-link');
22
+ this.login_container = $('onestepcheckout-login-popup-contents-login');
23
+ this.login_table = $('onestepcheckout-login-table');
24
+ this.login_error = $('onestepcheckout-login-error');
25
+ this.login_loading = $('onestepcheckout-login-loading');
26
+ this.login_button = $('onestepcheckout-login-button');
27
+ this.login_form = $('onestepcheckout-login-form');
28
+ this.login_username = $('id_onestepcheckout_username');
29
+
30
+ /* Bindings for the enter button */
31
+ this.keypress_handler = function(e) {
32
+ if(e.keyCode == Event.KEY_RETURN) {
33
+ e.preventDefault();
34
+
35
+ if(this.mode == 'login') {
36
+ this.login_handler();
37
+ } else if(this.mode == 'forgot') {
38
+ this.forgot_password_handler();
39
+ }
40
+ }
41
+ }.bind(this);
42
+
43
+ this.login_handler = function(e) {
44
+
45
+ var parameters = this.login_form.serialize(true);
46
+ var url = this.options.login_url;
47
+ this.showLoginLoading();
48
+
49
+ new Ajax.Request(url, {
50
+ method: 'post',
51
+ parameters: parameters,
52
+ onSuccess: function(transport) {
53
+ var result = transport.responseText.evalJSON();
54
+ if(result.success) {
55
+ window.location = window.location;
56
+ } else {
57
+ this.showLoginError(result.error);
58
+ }
59
+ }.bind(this)
60
+ });
61
+ };
62
+
63
+ this.forgot_password_handler = function(e) {
64
+ var email = $('id_onestepcheckout_email').getValue();
65
+
66
+ if(email == '') {
67
+ alert(this.options.translations.invalid_email);
68
+ return;
69
+ }
70
+
71
+ this.showForgotPasswordLoading();
72
+
73
+ /* Prepare AJAX call */
74
+ var url = this.options.forgot_password_url;
75
+
76
+ new Ajax.Request(url, {
77
+ method: 'post',
78
+ parameters: { email: email },
79
+ onSuccess: function(transport) {
80
+ var result = transport.responseText.evalJSON();
81
+
82
+ if(result.success) {
83
+ /* Show success message */
84
+ this.showForgotPasswordSuccess();
85
+
86
+ /* Pre-set username to simplify login */
87
+ this.login_username.setValue(email);
88
+ } else {
89
+ /* Show error message */
90
+ this.showForgotPasswordError();
91
+ }
92
+
93
+ }.bind(this)
94
+ });
95
+ };
96
+
97
+ this.bindEventHandlers();
98
+ },
99
+
100
+ bindEventHandlers: function() {
101
+ /* First bind the link for opening the popup */
102
+ if(this.popup_link){
103
+ this.popup_link.observe('click', function(e) {
104
+ e.preventDefault();
105
+ this.popup.open();
106
+ }.bind(this));
107
+ }
108
+
109
+ /* Link for closing the popup */
110
+ if(this.popup_container){
111
+ this.popup_container.select('p.close a').invoke(
112
+ 'observe', 'click', function(e) {
113
+ this.popup.close();
114
+ }.bind(this));
115
+ }
116
+
117
+ /* Link to switch between states */
118
+ if(this.login_link){
119
+ this.login_link.observe('click', function(e) {
120
+ e.preventDefault();
121
+ this.forgot_password_container.hide();
122
+ this.login_container.show();
123
+ this.mode = 'login';
124
+ }.bind(this));
125
+ }
126
+
127
+ /* Link to switch between states */
128
+ if(this.forgot_password_link){
129
+ this.forgot_password_link.observe('click', function(e) {
130
+ e.preventDefault();
131
+ this.login_container.hide();
132
+ this.forgot_password_container.show();
133
+ this.mode = 'forgot';
134
+ }.bind(this));
135
+ }
136
+
137
+ /* Now bind the submit button for logging in */
138
+ if(this.login_button){
139
+ this.login_button.observe(
140
+ 'click', this.login_handler.bind(this));
141
+ }
142
+
143
+ /* Now bind the submit button for forgotten password */
144
+ if(this.forgot_password_button){
145
+ this.forgot_password_button.observe('click',
146
+ this.forgot_password_handler.bind(this));
147
+ }
148
+
149
+ /* Handle return keypress when open */
150
+ if(this.popup){
151
+ this.popup.observe('afterOpen', function(e) {
152
+ document.observe('keypress', this.keypress_handler);
153
+ }.bind(this));
154
+
155
+ this.popup.observe('afterClose', function(e) {
156
+ this.resetPopup();
157
+ document.stopObserving('keypress', this.keypress_handler);
158
+ }.bind(this));
159
+ }
160
+
161
+ },
162
+
163
+ resetPopup: function() {
164
+ this.login_table.show();
165
+ this.forgot_password_table.show();
166
+
167
+ this.login_loading.hide();
168
+ this.forgot_password_loading.hide();
169
+
170
+ this.login_error.hide();
171
+ this.forgot_password_error.hide();
172
+
173
+ this.login_container.show();
174
+ this.forgot_password_container.hide();
175
+ },
176
+
177
+ showLoginError: function(error) {
178
+ this.login_table.show();
179
+ this.login_error.show();
180
+ this.login_loading.hide();
181
+
182
+ if(error) {
183
+ this.login_error.update(error);
184
+ }
185
+ },
186
+
187
+ showLoginLoading: function() {
188
+ this.login_table.hide();
189
+ this.login_loading.show();
190
+ this.login_error.hide();
191
+ },
192
+
193
+ showForgotPasswordSuccess: function() {
194
+ this.forgot_password_error.hide();
195
+ this.forgot_password_loading.hide();
196
+ this.forgot_password_table.hide();
197
+ this.forgot_password_success.show();
198
+ },
199
+
200
+ showForgotPasswordError: function() {
201
+ this.forgot_password_error.show();
202
+ this.forgot_password_error.update(
203
+ this.options.translations.email_not_found),
204
+
205
+ this.forgot_password_table.show();
206
+ this.forgot_password_loading.hide();
207
+ },
208
+
209
+ showForgotPasswordLoading: function() {
210
+ this.forgot_password_loading.show();
211
+ this.forgot_password_error.hide();
212
+ this.forgot_password_table.hide();
213
+ },
214
+
215
+ show: function(){
216
+ this.popup.open();
217
+ },
218
+
219
+ createPopup: function() {
220
+ this.popup = new Control.Modal(this.popup_container, {
221
+ overlayOpacity: 0.65,
222
+ fade: true,
223
+ fadeDuration: 0.3,
224
+ position: 'center_once'
225
+ });
226
+ }
227
+ });
228
+
229
+ function $RF(el, radioGroup) {
230
+ if($(el).type && $(el).type.toLowerCase() == 'radio') {
231
+ var radioGroup = $(el).name;
232
+ var el = $(el).form;
233
+ } else if ($(el).tagName.toLowerCase() != 'form') {
234
+ return false;
235
+ }
236
+
237
+ var checked = $(el).getInputs('radio', radioGroup).find(
238
+ function(re) {return re.checked;}
239
+ );
240
+ return (checked) ? $F(checked) : null;
241
+ }
242
+
243
+ function $RFF(el, radioGroup) {
244
+ if($(el).type && $(el).type.toLowerCase() == 'radio') {
245
+ var radioGroup = $(el).name;
246
+ var el = $(el).form;
247
+ } else if ($(el).tagName.toLowerCase() != 'form') {
248
+ return false;
249
+ }
250
+ return $(el).getInputs('radio', radioGroup).first();
251
+ }
252
+
253
+ function get_totals_element()
254
+ {
255
+ // Search for OSC summary element
256
+ var search_osc = $$('div.onestepcheckout-summary');
257
+
258
+ if(search_osc.length > 0) {
259
+ return search_osc[0];
260
+ }
261
+
262
+ var search_cart = $$('div.shopping-cart-totals');
263
+
264
+ if(search_cart.length > 0) {
265
+ return search_cart[0];
266
+ }
267
+
268
+ if($('shopping-cart-totals-table')) {
269
+ return $('shopping-cart-totals-table');
270
+ }
271
+
272
+ }
273
+
274
+ function get_save_methods_function(url, update_payments)
275
+ {
276
+
277
+ if(typeof update_payments == 'undefined') {
278
+ var update_payments = false;
279
+ }
280
+ return function(e) {
281
+
282
+ if(typeof e != 'undefined') {
283
+ var element = e.element();
284
+
285
+ if(element.name != 'shipping_method') {
286
+ update_payments = false;
287
+ }
288
+ }
289
+
290
+ var form = $('onestepcheckout-form');
291
+ var shipping_method = $RF(form, 'shipping_method');
292
+ var payment_method = $RF(form, 'payment[method]');
293
+
294
+ var totals = get_totals_element();
295
+ totals.update('<div class="loading-ajax">&nbsp;</div>');
296
+
297
+ if(update_payments) {
298
+ var payment_methods = $$('div.payment-methods')[0];
299
+ payment_methods.update('<div class="loading-ajax">&nbsp;</div>');
300
+ }
301
+
302
+ var parameters = {
303
+ shipping_method: shipping_method,
304
+ payment_method: payment_method
305
+ }
306
+
307
+ /* Find payment parameters and include */
308
+ var items = $$('input[name^=payment]').concat($$('select[name^=payment]'));
309
+ var names = items.pluck('name');
310
+ var values = items.pluck('value');
311
+
312
+ for(var x=0; x < names.length; x++) {
313
+ if(names[x] != 'payment[method]') {
314
+ parameters[names[x]] = values[x];
315
+ }
316
+ }
317
+
318
+ new Ajax.Request(url, {
319
+ method: 'post',
320
+ onSuccess: function(transport) {
321
+ if(transport.status == 200) {
322
+ var data = transport.responseText.evalJSON();
323
+
324
+ totals.update(data.summary);
325
+
326
+ if(update_payments) {
327
+
328
+ payment_methods.replace(data.payment_method);
329
+
330
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
331
+ $$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
332
+ $$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
333
+
334
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
335
+ $$('div.onestepcheckout-payment-method-error').each(function(item) {
336
+ new Effect.Fade(item);
337
+ });
338
+ });
339
+
340
+ if($RF(form, 'payment[method]') != null) {
341
+ try {
342
+ var payment_method = $RF(form, 'payment[method]');
343
+ $('container_payment_method_' + payment_method).show();
344
+ $('payment_form_' + payment_method).show();
345
+ } catch(err) {
346
+
347
+ }
348
+ }
349
+
350
+ }
351
+ }
352
+ },
353
+ parameters: parameters
354
+ });
355
+ }
356
+ }
357
+
358
+ function exclude_unchecked_checkboxes(data)
359
+ {
360
+ var items = [];
361
+ for(var x=0; x < data.length; x++) {
362
+ var item = data[x];
363
+ if(item.type == 'checkbox') {
364
+ if(item.checked) {
365
+ items.push(item);
366
+ }
367
+ }
368
+ else {
369
+ items.push(item);
370
+ }
371
+ }
372
+
373
+ return items;
374
+ }
375
+
376
+ function get_save_billing_function(url, set_methods_url, update_payments, triggered)
377
+ {
378
+ if(typeof update_payments == 'undefined') {
379
+ var update_payments = false;
380
+ }
381
+
382
+ if(typeof triggered == 'undefined') {
383
+ var triggered = true;
384
+ }
385
+
386
+ if(!triggered){
387
+ return function(){return;};
388
+ }
389
+
390
+ return function() {
391
+ var form = $('onestepcheckout-form');
392
+ var items = exclude_unchecked_checkboxes($$('input[name^=billing]').concat($$('select[name^=billing]')));
393
+ var names = items.pluck('name');
394
+ var values = items.pluck('value');
395
+ var parameters = {
396
+ shipping_method: $RF(form, 'shipping_method')
397
+ };
398
+
399
+
400
+ var street_count = 0;
401
+ for(var x=0; x < names.length; x++) {
402
+ if(names[x] != 'payment[method]') {
403
+
404
+ var current_name = names[x];
405
+
406
+ if(names[x] == 'billing[street][]') {
407
+ current_name = 'billing[street][' + street_count + ']';
408
+ street_count = street_count + 1;
409
+ }
410
+
411
+ parameters[current_name] = values[x];
412
+ }
413
+ }
414
+
415
+ var use_for_shipping = $('billing:use_for_shipping_yes');
416
+
417
+
418
+
419
+
420
+ if(use_for_shipping && use_for_shipping.getValue() != '1') {
421
+ var items = $$('input[name^=shipping]').concat($$('select[name^=shipping]'));
422
+ var shipping_names = items.pluck('name');
423
+ var shipping_values = items.pluck('value');
424
+ var shipping_parameters = {};
425
+ var street_count = 0;
426
+
427
+ for(var x=0; x < shipping_names.length; x++) {
428
+ if(shipping_names[x] != 'shipping_method') {
429
+ var current_name = shipping_names[x];
430
+ if(shipping_names[x] == 'shipping[street][]') {
431
+ current_name = 'shipping[street][' + street_count + ']';
432
+ street_count = street_count + 1;
433
+ }
434
+
435
+ parameters[current_name] = shipping_values[x];
436
+ }
437
+ }
438
+ }
439
+
440
+ var shipment_methods = $$('div.onestepcheckout-shipping-method-block')[0];
441
+ var shipment_methods_found = false;
442
+
443
+ if(typeof shipment_methods != 'undefined') {
444
+ shipment_methods_found = true;
445
+ }
446
+
447
+ if(shipment_methods_found) {
448
+ shipment_methods.update('<div class="loading-ajax">&nbsp;</div>');
449
+ }
450
+
451
+ var payment_hpp_ideal_type = $RF(form, 'payment[hpp_ideal_type]');
452
+ var payment_hpp_type = $RF(form, 'payment[hpp_type]');
453
+ var payment_recurring_type = $RF(form, 'payment[recurring]');
454
+ var payment_recurring_type_cvc = $('adyen_oneclick_oneclick_cid_'+payment_recurring_type);
455
+ var payment_method = $RF(form, 'payment[method]');
456
+ parameters['payment_method'] = payment_method;
457
+ parameters['payment[method]'] = payment_method;
458
+
459
+ if(update_payments){
460
+ var payment_methods = $$('div.payment-methods')[0];
461
+ payment_methods.update('<div class="loading-ajax">&nbsp;</div>');
462
+ }
463
+
464
+ var totals = get_totals_element();
465
+ totals.update('<div class="loading-ajax">&nbsp;</div>');
466
+
467
+
468
+ new Ajax.Request(url, {
469
+ method: 'post',
470
+ onSuccess: function(transport) {
471
+ if(transport.status == 200) {
472
+
473
+ var data = transport.responseText.evalJSON();
474
+
475
+ // Update shipment methods
476
+ if(shipment_methods_found) {
477
+ shipment_methods.update(data.shipping_method);
478
+ }
479
+
480
+ if(update_payments){
481
+ payment_methods.replace(data.payment_method);
482
+ }
483
+
484
+ totals.update(data.summary);
485
+
486
+
487
+ }
488
+ },
489
+ onComplete: function(transport){
490
+ if(transport.status == 200) {
491
+ if(shipment_methods_found) {
492
+ $$('dl.shipment-methods input').invoke('observe', 'click', get_separate_save_methods_function(set_methods_url, update_payments));
493
+ $$('dl.shipment-methods input').invoke('observe', 'click', function() {
494
+ $$('div.onestepcheckout-shipment-method-error').each(function(item) {
495
+ new Effect.Fade(item);
496
+ });
497
+ });
498
+ }
499
+
500
+ if(update_payments){
501
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(set_methods_url));
502
+ $$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
503
+ $$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
504
+
505
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
506
+ $$('div.onestepcheckout-payment-method-error').each(function(item) {
507
+ new Effect.Fade(item);
508
+ });
509
+ });
510
+
511
+ if($RF(form, 'payment[method]') != null) {
512
+ try {
513
+ var payment_method = $RF(form, 'payment[method]');
514
+ $('container_payment_method_' + payment_method).show();
515
+ var payment_form = $('payment_form_' + payment_method);
516
+ if(payment_form)
517
+ $(payment_form).show();
518
+ else if(payment_method == "adyen_hpp") { // check if payment type is hpp (this has other id so should come in else )
519
+ // set sub payment method back
520
+ $('hpp_type_'+payment_hpp_type).checked = true;
521
+
522
+ // check if ideal payment bank is chosen
523
+ if(payment_hpp_type == "ideal") {
524
+ if(payment_hpp_ideal_type) {
525
+ // get issue_id this is before the slash
526
+ var issue_id = payment_hpp_ideal_type.substr(0, payment_hpp_ideal_type.indexOf('/'));
527
+ $('hpp_ideal_type_'+issue_id).checked = true;
528
+ }
529
+ $('payment_form_ideal').show();
530
+ }
531
+ } else if(payment_method == "adyen_oneclick") { // check if payment type is hpp
532
+ // set sub payment method back
533
+ $('recurring_type_'+payment_recurring_type).checked = true;
534
+ // set back the cvc code
535
+ $('adyen_oneclick_oneclick_cid_'+payment_recurring_type).value = payment_recurring_type_cvc.value;
536
+ // show the cvc code block
537
+ var cvc_block = "cvc_block_" + payment_recurring_type;
538
+ $(cvc_block).show();
539
+ }
540
+ } catch(err) {
541
+
542
+ }
543
+ }
544
+ }
545
+ }
546
+ },
547
+ parameters: parameters
548
+ });
549
+
550
+ }
551
+ }
552
+
553
+ function get_separate_save_methods_function(url, update_payments)
554
+ {
555
+ if(typeof update_payments == 'undefined') {
556
+ var update_payments = false;
557
+ }
558
+
559
+ return function(e) {
560
+ if(typeof e != 'undefined') {
561
+ var element = e.element();
562
+
563
+ if(element.name != 'shipping_method') {
564
+ update_payments = false;
565
+ }
566
+ }
567
+
568
+ var form = $('onestepcheckout-form');
569
+ var shipping_method = $RF(form, 'shipping_method');
570
+ var payment_method = $RF(form, 'payment[method]');
571
+ var payment_hpp_type = $RF(form, 'payment[hpp_type]');
572
+ var payment_hpp_ideal_type = $RF(form, 'payment[hpp_ideal_type]');
573
+ var payment_recurring_type = $RF(form, 'payment[recurring]');
574
+ var payment_recurring_type_cvc = $('adyen_oneclick_oneclick_cid_'+payment_recurring_type);
575
+
576
+ var totals = get_totals_element();
577
+
578
+ var freeMethod = $('p_method_free');
579
+ if(freeMethod){
580
+ payment.reloadcallback = true;
581
+ payment.countreload = 1;
582
+ }
583
+
584
+ totals.update('<div class="loading-ajax">&nbsp;</div>');
585
+
586
+ if(update_payments) {
587
+ var payment_methods = $$('div.payment-methods')[0];
588
+ payment_methods.update('<div class="loading-ajax">&nbsp;</div>');
589
+ }
590
+
591
+ var parameters = {
592
+ shipping_method: shipping_method,
593
+ payment_method: payment_method
594
+ }
595
+
596
+ /* Find payment parameters and include */
597
+ var items = $$('input[name^=payment]').concat($$('select[name^=payment]'));
598
+ var names = items.pluck('name');
599
+ var values = items.pluck('value');
600
+
601
+ for(var x=0; x < names.length; x++) {
602
+ if(names[x] != 'payment[method]') {
603
+ parameters[names[x]] = values[x];
604
+ }
605
+ }
606
+
607
+ new Ajax.Request(url, {
608
+ method: 'post',
609
+ onSuccess: function(transport) {
610
+ if(transport.status == 200) {
611
+ var data = transport.responseText.evalJSON();
612
+ var form = $('onestepcheckout-form');
613
+
614
+ totals.update(data.summary);
615
+
616
+ if(update_payments) {
617
+
618
+ payment_methods.replace(data.payment_method);
619
+
620
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
621
+ $$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
622
+ $$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
623
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
624
+ $$('div.onestepcheckout-payment-method-error').each(function(item) {
625
+ new Effect.Fade(item);
626
+ });
627
+ });
628
+
629
+ if($RF($('onestepcheckout-form'), 'payment[method]') != null) {
630
+ try {
631
+ var payment_method = $RF(form, 'payment[method]');
632
+ $('container_payment_method_' + payment_method).show();
633
+ var payment_form = $('payment_form_' + payment_method);
634
+ if(payment_form)
635
+ $(payment_form).show();
636
+ else if(payment_method == "adyen_hpp") { // check if payment type is hpp (this has other id so should come in else )
637
+ // set sub payment method back
638
+ $('hpp_type_'+payment_hpp_type).checked = true;
639
+
640
+ // check if ideal payment bank is chosen
641
+ if(payment_hpp_type == "ideal") {
642
+ if(payment_hpp_ideal_type) {
643
+ // get issue_id this is before the slash
644
+ var issue_id = payment_hpp_ideal_type.substr(0, payment_hpp_ideal_type.indexOf('/'));
645
+ $('hpp_ideal_type_'+issue_id).checked = true;
646
+ }
647
+ $('payment_form_ideal').show();
648
+ }
649
+ } else if(payment_method == "adyen_oneclick") { // check if payment type is hpp
650
+ // set sub payment method back
651
+ $('recurring_type_'+payment_recurring_type).checked = true;
652
+ // set back the cvc code
653
+ $('adyen_oneclick_oneclick_cid_'+payment_recurring_type).value = payment_recurring_type_cvc.value;
654
+ // show the cvc code block
655
+ var cvc_block = "cvc_block_" + payment_recurring_type;
656
+ $(cvc_block).show();
657
+ // show update link url
658
+ var update_link = "update-expiration-date-" + payment_recurring_type;
659
+ $(update_link).show();
660
+ }
661
+ } catch(err) {
662
+
663
+ }
664
+ }
665
+ }
666
+ }
667
+ },
668
+ parameters: parameters
669
+ });
670
+ }
671
+ }
672
+
673
+ function paymentrefresh(url) {
674
+ var payment_methods = $$('div.payment-methods')[0];
675
+ payment_methods.update('<div class="loading-ajax">&nbsp;</div>');
676
+ new Ajax.Request(url, {
677
+ method: 'get',
678
+ onSuccess: function(transport){
679
+ if(transport.status == 200) {
680
+ var data = transport.responseText.evalJSON();
681
+ payment_methods.replace(data.payment_method);
682
+
683
+ $$('div.payment-methods input[name="payment\[method\]"]', 'div.payment-methods input[name="payment\[useProfile\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
684
+ $$('div.payment-methods input[name="payment\[method\]"]', 'div.payment-methods input[name="payment\[useProfile\]"]').invoke('observe', 'click', function() {
685
+ $$('div.onestepcheckout-payment-method-error').each(function(item) {
686
+ new Effect.Fade(item);
687
+ });
688
+ });
689
+
690
+ if($RF(form, 'payment[method]') != null) {
691
+ try {
692
+ var payment_method = $RF(form, 'payment[method]');
693
+ $('container_payment_method_' + payment_method).show();
694
+ $('payment_form_' + payment_method).show();
695
+ } catch(err){}
696
+ }
697
+
698
+ }
699
+ }
700
+ });
701
+ }
702
+
703
+ function addressPreview(templates, target) {
704
+ var bparams = {};
705
+ var sparams = {};
706
+ var savedBillingItems = $('billing-address-select');
707
+ if(savedBillingItems && savedBillingItems.getValue()){
708
+ index = savedBillingItems.selectedIndex;
709
+ bparams = customerBAddresses[index];
710
+ } else {
711
+ var items = $$('input[name^=billing]').concat($$('select[name^=billing]'));
712
+ items.each(function(s) {
713
+ if(s.getStyle('display') != 'none'){
714
+ selectText = s.options
715
+ if(selectText){
716
+ value = selectText[s.selectedIndex].text;
717
+ } else {
718
+ value = s.getValue();
719
+ }
720
+ if(value){
721
+ value = '<span class="' + s.id.replace(':','-') + '">' + value.escapeHTML() + '</span>';
722
+ }
723
+ if(s.id == 'billing:region_id'){
724
+ bparams['billing:region'] = value;
725
+ } else {
726
+ bparams[s.id] = value;
727
+ }
728
+ }
729
+ });
730
+ }
731
+
732
+
733
+
734
+ var savedShippingItems = $('shipping-address-select');
735
+ if(savedShippingItems && savedShippingItems.getValue()){
736
+ index = savedShippingItems.selectedIndex;
737
+ sparams = customerSAddresses[index];
738
+ } else {
739
+ var items = $$('input[name^=shipping]').concat($$('select[name^=shipping]'));
740
+ items.each(function(s) {
741
+ if(s.getStyle('display') != 'none'){
742
+ selectText = s.options
743
+ if(selectText){
744
+ value = selectText[s.selectedIndex].text;
745
+ } else {
746
+ value = s.getValue();
747
+ }
748
+ if(value){
749
+ value = '<span class="' + s.id.replace(':','-') + '">' + value.escapeHTML() + '</span>';
750
+ }
751
+ if(s.id == 'shipping:region_id'){
752
+ sparams['shipping:region'] = value;
753
+ } else {
754
+ sparams[s.id] = value;
755
+ }
756
+ }
757
+ });
758
+ }
759
+
760
+
761
+ var form = $('onestepcheckout-form');
762
+
763
+ var shipping_method = $RF(form, 'shipping_method');
764
+ if(shipping_method){
765
+ var shipping_label = $('s_method_' + shipping_method).up('dt').down('label').innerHTML.stripScripts();
766
+ var shipping_title = $('s_method_' + shipping_method).up('dt').previous('dd').innerHTML.stripScripts();
767
+ var shipping_row = shipping_title + ' - ' + shipping_label
768
+ }
769
+
770
+ var useOnlyBilling = $('billing:use_for_shipping_yes').getValue();
771
+ billinga_template = new Template(templates.billing);
772
+
773
+ if(useOnlyBilling){
774
+ shippinga_template = new Template(templates.billing);
775
+ }else{
776
+ shippinga_template = new Template(templates.shipping);
777
+ }
778
+
779
+ var payment_method = payment.currentMethod;
780
+
781
+ if(payment_method){
782
+ var payment_label = $('p_method_'+payment_method).up('dt').down('label').innerHTML.stripScripts();
783
+ }
784
+
785
+ var targetelem = $(target + '_billinga').childElements()[1];
786
+ if(targetelem){
787
+ targetelem.update(billinga_template.evaluate(bparams));
788
+ }
789
+
790
+ var targetelem = $(target + '_shippinga').childElements()[1];
791
+ if(targetelem){
792
+ if(useOnlyBilling){
793
+ targetelem.update(shippinga_template.evaluate(bparams));
794
+ }else{
795
+ targetelem.update(shippinga_template.evaluate(sparams));
796
+ }
797
+ }
798
+
799
+ var targetelem = $(target + '_shipping').childElements()[1];
800
+ if(targetelem){
801
+ targetelem.update(shipping_row);
802
+ }
803
+
804
+ var targetelem = $(target + '_payment').childElements()[1];
805
+ if(targetelem){
806
+ targetelem.update(payment_label);
807
+ }
808
+
809
+ var targetelem = $(target + '_summary').childElements()[1];
810
+ if(targetelem){
811
+ targetelem.update('');
812
+ targetelem.insert($$('table.onestepcheckout-summary')[0].cloneNode(true));
813
+ targetelem.insert($$('table.onestepcheckout-totals')[0].cloneNode(true));
814
+ }
815
+ }
816
+
817
+
818
+ var Checkout = Class.create();
819
+ Checkout.prototype = {
820
+ initialize: function(){
821
+ this.accordion = '';
822
+ this.progressUrl = '';
823
+ this.reviewUrl = '';
824
+ this.saveMethodUrl = '';
825
+ this.failureUrl = '';
826
+ this.billingForm = false;
827
+ this.shippingForm= false;
828
+ this.syncBillingShipping = false;
829
+ this.method = '';
830
+ this.payment = '';
831
+ this.loadWaiting = false;
832
+ },
833
+
834
+ ajaxFailure: function(){
835
+ location.href = this.failureUrl;
836
+ },
837
+
838
+ setLoadWaiting: function(step, keepDisabled) {
839
+ return true
840
+ }
841
+ };
842
+
843
+ //billing
844
+ var Billing = Class.create();
845
+ Billing.prototype = {
846
+ initialize: function(form, addressUrl, saveUrl){
847
+ this.form = form;
848
+ },
849
+
850
+ setAddress: function(addressId){
851
+
852
+ },
853
+
854
+ newAddress: function(isNew){
855
+ if (isNew) {
856
+ //this.resetSelectedAddress();
857
+ Element.show('billing_address_list');
858
+ if($('billing:use_for_shipping_yes').getValue() != "1" && $('shipping-address-select').getValue() == ''){
859
+ Element.show('shipping_address_list');
860
+ }
861
+
862
+ } else {
863
+ Element.hide('billing_address_list');
864
+ }
865
+ $$('input[name^=billing]', 'select[id=billing:region_id]').each(function(e){
866
+ if(e.name=='billing[use_for_shipping]' || e.name=='billing[save_in_address_book]'){
867
+
868
+ } else {
869
+ e.value = '';
870
+ }
871
+ });
872
+ },
873
+
874
+ resetSelectedAddress: function(){
875
+ var selectElement = $('shipping-address-select')
876
+ if (selectElement) {
877
+ selectElement.value='';
878
+ }
879
+ },
880
+
881
+ fillForm: function(transport){
882
+
883
+ },
884
+
885
+ setUseForShipping: function(flag) {
886
+
887
+ },
888
+
889
+ save: function(){
890
+
891
+ },
892
+
893
+ resetLoadWaiting: function(transport){
894
+
895
+ },
896
+
897
+ nextStep: function(transport){
898
+
899
+ }
900
+ };
901
+
902
+ //shipping
903
+ var Shipping = Class.create();
904
+ Shipping.prototype = {
905
+ initialize: function(form){
906
+ this.form = form;
907
+ },
908
+
909
+ setAddress: function(addressId){
910
+
911
+ },
912
+
913
+ newAddress: function(isNew){
914
+ if (isNew) {
915
+ this.resetSelectedAddress();
916
+ Element.show('shipping_address_list');
917
+ } else {
918
+ Element.hide('shipping_address_list');
919
+ }
920
+
921
+ $$('#shipping_address input[name^=shipping],#shipping_address select[id=shipping:region_id]').each(function(e){
922
+ if(e.name=='shipping[save_in_address_book]'){
923
+
924
+ } else {
925
+ e.value = '';
926
+ }
927
+ })
928
+
929
+ },
930
+
931
+ resetSelectedAddress: function(){
932
+ var selectElement = $('shipping-address-select')
933
+ if (selectElement) {
934
+ selectElement.value='';
935
+ }
936
+ },
937
+
938
+ fillForm: function(transport){
939
+
940
+ },
941
+
942
+ setSameAsBilling: function(flag) {
943
+
944
+ },
945
+
946
+ syncWithBilling: function () {
947
+
948
+ },
949
+
950
+ setRegionValue: function(){
951
+ //$('shipping:region').value = $('billing:region').value;
952
+ },
953
+
954
+ save: function(){
955
+
956
+ }
957
+ };
958
+
959
+ //payment object
960
+ var Payment = Class.create();
961
+ Payment.prototype = {
962
+ beforeInitFunc:$H({}),
963
+ afterInitFunc:$H({}),
964
+ beforeValidateFunc:$H({}),
965
+ afterValidateFunc:$H({}),
966
+ initialize: function(form, saveUrl){
967
+ this.form = form;
968
+ this.saveUrl = saveUrl;
969
+ },
970
+
971
+ init : function () {
972
+ var elements = Form.getElements(this.form);
973
+ if ($(this.form)) {
974
+ //$(this.form).observe('submit', function(event){this.save();Event.stop(event);}.bind(this));
975
+ }
976
+ var method = null;
977
+ for (var i=0; i<elements.length; i++) {
978
+ if (elements[i].name=='payment[method]') {
979
+ if (elements[i].checked) {
980
+ method = elements[i].value;
981
+ }
982
+ } else {
983
+ elements[i].disabled = true;
984
+ }
985
+ }
986
+ if (method) this.switchMethod(method);
987
+ },
988
+
989
+ switchMethod: function(method){
990
+ if (this.currentMethod && $('payment_form_'+this.currentMethod)) {
991
+ var form = $('payment_form_'+this.currentMethod);
992
+ form.style.display = 'none';
993
+ var elements = form.select('input').concat(form.select('select')).concat(form.select('textarea'));
994
+ for (var i=0; i<elements.length; i++) elements[i].disabled = true;
995
+ }
996
+
997
+ if ($('payment_form_'+method)){
998
+ var form = $('payment_form_'+method);
999
+ form.style.display = '';
1000
+ var elements = form.select('input').concat(form.select('select')).concat(form.select('textarea'));
1001
+ for (var i=0; i<elements.length; i++) elements[i].disabled = false;
1002
+ this.currentMethod = method;
1003
+ }
1004
+ },
1005
+
1006
+ addBeforeValidateFunction : function(code, func) {
1007
+ this.beforeValidateFunc.set(code, func);
1008
+ },
1009
+
1010
+ beforeValidate : function() {
1011
+ var validateResult = true;
1012
+ var hasValidation = false;
1013
+ (this.beforeValidateFunc).each(function(validate){
1014
+ hasValidation = true;
1015
+ if ((validate.value)() == false) {
1016
+ validateResult = false;
1017
+ }
1018
+ }.bind(this));
1019
+ if (!hasValidation) {
1020
+ validateResult = false;
1021
+ }
1022
+ return validateResult;
1023
+ },
1024
+
1025
+ validate: function() {
1026
+ var methods = document.getElementsByName('payment[method]');
1027
+ if (methods.length==0) {
1028
+ alert(Translator.translate('Your order can not be completed at this time as there is no payment methods available for it.'));
1029
+ return false;
1030
+ }
1031
+ for (var i=0; i<methods.length; i++) {
1032
+ if (methods[i].checked) {
1033
+ return true;
1034
+ }
1035
+ }
1036
+ alert(Translator.translate('Please specify payment method.'));
1037
+ return false;
1038
+ },
1039
+
1040
+ save: function(){
1041
+ },
1042
+ addAfterInitFunction : function(code, func) {
1043
+ this.afterInitFunc.set(code, func);
1044
+ },
1045
+
1046
+ afterInit : function() {
1047
+ (this.afterInitFunc).each(function(init){
1048
+ (init.value)();
1049
+ });
1050
+ }
1051
+ };
skin/frontend/rwd/adyen/onestepcheckout/js/onestepcheckout.js ADDED
@@ -0,0 +1,1051 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ /* Login popup class */
4
+ var OneStepCheckoutLoginPopup = Class.create({
5
+ initialize: function(options) {
6
+ this.options = options;
7
+ this.popup_container = $('onestepcheckout-login-popup');
8
+ this.popup_link = $('onestepcheckout-login-link');
9
+ this.popup = null;
10
+ this.createPopup();
11
+ this.mode = 'login';
12
+
13
+ this.forgot_password_link = $('onestepcheckout-forgot-password-link');
14
+ this.forgot_password_container = $('onestepcheckout-login-popup-contents-forgot');
15
+ this.forgot_password_loading = $('onestepcheckout-forgot-loading');
16
+ this.forgot_password_error = $('onestepcheckout-forgot-error');
17
+ this.forgot_password_success = $('onestepcheckout-forgot-success');
18
+ this.forgot_password_button = $('onestepcheckout-forgot-button');
19
+ this.forgot_password_table = $('onestepcheckout-forgot-table');
20
+
21
+ this.login_link = $('onestepcheckout-return-login-link');
22
+ this.login_container = $('onestepcheckout-login-popup-contents-login');
23
+ this.login_table = $('onestepcheckout-login-table');
24
+ this.login_error = $('onestepcheckout-login-error');
25
+ this.login_loading = $('onestepcheckout-login-loading');
26
+ this.login_button = $('onestepcheckout-login-button');
27
+ this.login_form = $('onestepcheckout-login-form');
28
+ this.login_username = $('id_onestepcheckout_username');
29
+
30
+ /* Bindings for the enter button */
31
+ this.keypress_handler = function(e) {
32
+ if(e.keyCode == Event.KEY_RETURN) {
33
+ e.preventDefault();
34
+
35
+ if(this.mode == 'login') {
36
+ this.login_handler();
37
+ } else if(this.mode == 'forgot') {
38
+ this.forgot_password_handler();
39
+ }
40
+ }
41
+ }.bind(this);
42
+
43
+ this.login_handler = function(e) {
44
+
45
+ var parameters = this.login_form.serialize(true);
46
+ var url = this.options.login_url;
47
+ this.showLoginLoading();
48
+
49
+ new Ajax.Request(url, {
50
+ method: 'post',
51
+ parameters: parameters,
52
+ onSuccess: function(transport) {
53
+ var result = transport.responseText.evalJSON();
54
+ if(result.success) {
55
+ window.location = window.location;
56
+ } else {
57
+ this.showLoginError(result.error);
58
+ }
59
+ }.bind(this)
60
+ });
61
+ };
62
+
63
+ this.forgot_password_handler = function(e) {
64
+ var email = $('id_onestepcheckout_email').getValue();
65
+
66
+ if(email == '') {
67
+ alert(this.options.translations.invalid_email);
68
+ return;
69
+ }
70
+
71
+ this.showForgotPasswordLoading();
72
+
73
+ /* Prepare AJAX call */
74
+ var url = this.options.forgot_password_url;
75
+
76
+ new Ajax.Request(url, {
77
+ method: 'post',
78
+ parameters: { email: email },
79
+ onSuccess: function(transport) {
80
+ var result = transport.responseText.evalJSON();
81
+
82
+ if(result.success) {
83
+ /* Show success message */
84
+ this.showForgotPasswordSuccess();
85
+
86
+ /* Pre-set username to simplify login */
87
+ this.login_username.setValue(email);
88
+ } else {
89
+ /* Show error message */
90
+ this.showForgotPasswordError();
91
+ }
92
+
93
+ }.bind(this)
94
+ });
95
+ };
96
+
97
+ this.bindEventHandlers();
98
+ },
99
+
100
+ bindEventHandlers: function() {
101
+ /* First bind the link for opening the popup */
102
+ if(this.popup_link){
103
+ this.popup_link.observe('click', function(e) {
104
+ e.preventDefault();
105
+ this.popup.open();
106
+ }.bind(this));
107
+ }
108
+
109
+ /* Link for closing the popup */
110
+ if(this.popup_container){
111
+ this.popup_container.select('p.close a').invoke(
112
+ 'observe', 'click', function(e) {
113
+ this.popup.close();
114
+ }.bind(this));
115
+ }
116
+
117
+ /* Link to switch between states */
118
+ if(this.login_link){
119
+ this.login_link.observe('click', function(e) {
120
+ e.preventDefault();
121
+ this.forgot_password_container.hide();
122
+ this.login_container.show();
123
+ this.mode = 'login';
124
+ }.bind(this));
125
+ }
126
+
127
+ /* Link to switch between states */
128
+ if(this.forgot_password_link){
129
+ this.forgot_password_link.observe('click', function(e) {
130
+ e.preventDefault();
131
+ this.login_container.hide();
132
+ this.forgot_password_container.show();
133
+ this.mode = 'forgot';
134
+ }.bind(this));
135
+ }
136
+
137
+ /* Now bind the submit button for logging in */
138
+ if(this.login_button){
139
+ this.login_button.observe(
140
+ 'click', this.login_handler.bind(this));
141
+ }
142
+
143
+ /* Now bind the submit button for forgotten password */
144
+ if(this.forgot_password_button){
145
+ this.forgot_password_button.observe('click',
146
+ this.forgot_password_handler.bind(this));
147
+ }
148
+
149
+ /* Handle return keypress when open */
150
+ if(this.popup){
151
+ this.popup.observe('afterOpen', function(e) {
152
+ document.observe('keypress', this.keypress_handler);
153
+ }.bind(this));
154
+
155
+ this.popup.observe('afterClose', function(e) {
156
+ this.resetPopup();
157
+ document.stopObserving('keypress', this.keypress_handler);
158
+ }.bind(this));
159
+ }
160
+
161
+ },
162
+
163
+ resetPopup: function() {
164
+ this.login_table.show();
165
+ this.forgot_password_table.show();
166
+
167
+ this.login_loading.hide();
168
+ this.forgot_password_loading.hide();
169
+
170
+ this.login_error.hide();
171
+ this.forgot_password_error.hide();
172
+
173
+ this.login_container.show();
174
+ this.forgot_password_container.hide();
175
+ },
176
+
177
+ showLoginError: function(error) {
178
+ this.login_table.show();
179
+ this.login_error.show();
180
+ this.login_loading.hide();
181
+
182
+ if(error) {
183
+ this.login_error.update(error);
184
+ }
185
+ },
186
+
187
+ showLoginLoading: function() {
188
+ this.login_table.hide();
189
+ this.login_loading.show();
190
+ this.login_error.hide();
191
+ },
192
+
193
+ showForgotPasswordSuccess: function() {
194
+ this.forgot_password_error.hide();
195
+ this.forgot_password_loading.hide();
196
+ this.forgot_password_table.hide();
197
+ this.forgot_password_success.show();
198
+ },
199
+
200
+ showForgotPasswordError: function() {
201
+ this.forgot_password_error.show();
202
+ this.forgot_password_error.update(
203
+ this.options.translations.email_not_found),
204
+
205
+ this.forgot_password_table.show();
206
+ this.forgot_password_loading.hide();
207
+ },
208
+
209
+ showForgotPasswordLoading: function() {
210
+ this.forgot_password_loading.show();
211
+ this.forgot_password_error.hide();
212
+ this.forgot_password_table.hide();
213
+ },
214
+
215
+ show: function(){
216
+ this.popup.open();
217
+ },
218
+
219
+ createPopup: function() {
220
+ this.popup = new Control.Modal(this.popup_container, {
221
+ overlayOpacity: 0.65,
222
+ fade: true,
223
+ fadeDuration: 0.3,
224
+ position: 'center_once'
225
+ });
226
+ }
227
+ });
228
+
229
+ function $RF(el, radioGroup) {
230
+ if($(el).type && $(el).type.toLowerCase() == 'radio') {
231
+ var radioGroup = $(el).name;
232
+ var el = $(el).form;
233
+ } else if ($(el).tagName.toLowerCase() != 'form') {
234
+ return false;
235
+ }
236
+
237
+ var checked = $(el).getInputs('radio', radioGroup).find(
238
+ function(re) {return re.checked;}
239
+ );
240
+ return (checked) ? $F(checked) : null;
241
+ }
242
+
243
+ function $RFF(el, radioGroup) {
244
+ if($(el).type && $(el).type.toLowerCase() == 'radio') {
245
+ var radioGroup = $(el).name;
246
+ var el = $(el).form;
247
+ } else if ($(el).tagName.toLowerCase() != 'form') {
248
+ return false;
249
+ }
250
+ return $(el).getInputs('radio', radioGroup).first();
251
+ }
252
+
253
+ function get_totals_element()
254
+ {
255
+ // Search for OSC summary element
256
+ var search_osc = $$('div.onestepcheckout-summary');
257
+
258
+ if(search_osc.length > 0) {
259
+ return search_osc[0];
260
+ }
261
+
262
+ var search_cart = $$('div.shopping-cart-totals');
263
+
264
+ if(search_cart.length > 0) {
265
+ return search_cart[0];
266
+ }
267
+
268
+ if($('shopping-cart-totals-table')) {
269
+ return $('shopping-cart-totals-table');
270
+ }
271
+
272
+ }
273
+
274
+ function get_save_methods_function(url, update_payments)
275
+ {
276
+
277
+ if(typeof update_payments == 'undefined') {
278
+ var update_payments = false;
279
+ }
280
+ return function(e) {
281
+
282
+ if(typeof e != 'undefined') {
283
+ var element = e.element();
284
+
285
+ if(element.name != 'shipping_method') {
286
+ update_payments = false;
287
+ }
288
+ }
289
+
290
+ var form = $('onestepcheckout-form');
291
+ var shipping_method = $RF(form, 'shipping_method');
292
+ var payment_method = $RF(form, 'payment[method]');
293
+
294
+ var totals = get_totals_element();
295
+ totals.update('<div class="loading-ajax">&nbsp;</div>');
296
+
297
+ if(update_payments) {
298
+ var payment_methods = $$('div.payment-methods')[0];
299
+ payment_methods.update('<div class="loading-ajax">&nbsp;</div>');
300
+ }
301
+
302
+ var parameters = {
303
+ shipping_method: shipping_method,
304
+ payment_method: payment_method
305
+ }
306
+
307
+ /* Find payment parameters and include */
308
+ var items = $$('input[name^=payment]').concat($$('select[name^=payment]'));
309
+ var names = items.pluck('name');
310
+ var values = items.pluck('value');
311
+
312
+ for(var x=0; x < names.length; x++) {
313
+ if(names[x] != 'payment[method]') {
314
+ parameters[names[x]] = values[x];
315
+ }
316
+ }
317
+
318
+ new Ajax.Request(url, {
319
+ method: 'post',
320
+ onSuccess: function(transport) {
321
+ if(transport.status == 200) {
322
+ var data = transport.responseText.evalJSON();
323
+
324
+ totals.update(data.summary);
325
+
326
+ if(update_payments) {
327
+
328
+ payment_methods.replace(data.payment_method);
329
+
330
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
331
+ $$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
332
+ $$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
333
+
334
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
335
+ $$('div.onestepcheckout-payment-method-error').each(function(item) {
336
+ new Effect.Fade(item);
337
+ });
338
+ });
339
+
340
+ if($RF(form, 'payment[method]') != null) {
341
+ try {
342
+ var payment_method = $RF(form, 'payment[method]');
343
+ $('container_payment_method_' + payment_method).show();
344
+ $('payment_form_' + payment_method).show();
345
+ } catch(err) {
346
+
347
+ }
348
+ }
349
+
350
+ }
351
+ }
352
+ },
353
+ parameters: parameters
354
+ });
355
+ }
356
+ }
357
+
358
+ function exclude_unchecked_checkboxes(data)
359
+ {
360
+ var items = [];
361
+ for(var x=0; x < data.length; x++) {
362
+ var item = data[x];
363
+ if(item.type == 'checkbox') {
364
+ if(item.checked) {
365
+ items.push(item);
366
+ }
367
+ }
368
+ else {
369
+ items.push(item);
370
+ }
371
+ }
372
+
373
+ return items;
374
+ }
375
+
376
+ function get_save_billing_function(url, set_methods_url, update_payments, triggered)
377
+ {
378
+ if(typeof update_payments == 'undefined') {
379
+ var update_payments = false;
380
+ }
381
+
382
+ if(typeof triggered == 'undefined') {
383
+ var triggered = true;
384
+ }
385
+
386
+ if(!triggered){
387
+ return function(){return;};
388
+ }
389
+
390
+ return function() {
391
+ var form = $('onestepcheckout-form');
392
+ var items = exclude_unchecked_checkboxes($$('input[name^=billing]').concat($$('select[name^=billing]')));
393
+ var names = items.pluck('name');
394
+ var values = items.pluck('value');
395
+ var parameters = {
396
+ shipping_method: $RF(form, 'shipping_method')
397
+ };
398
+
399
+
400
+ var street_count = 0;
401
+ for(var x=0; x < names.length; x++) {
402
+ if(names[x] != 'payment[method]') {
403
+
404
+ var current_name = names[x];
405
+
406
+ if(names[x] == 'billing[street][]') {
407
+ current_name = 'billing[street][' + street_count + ']';
408
+ street_count = street_count + 1;
409
+ }
410
+
411
+ parameters[current_name] = values[x];
412
+ }
413
+ }
414
+
415
+ var use_for_shipping = $('billing:use_for_shipping_yes');
416
+
417
+
418
+
419
+
420
+ if(use_for_shipping && use_for_shipping.getValue() != '1') {
421
+ var items = $$('input[name^=shipping]').concat($$('select[name^=shipping]'));
422
+ var shipping_names = items.pluck('name');
423
+ var shipping_values = items.pluck('value');
424
+ var shipping_parameters = {};
425
+ var street_count = 0;
426
+
427
+ for(var x=0; x < shipping_names.length; x++) {
428
+ if(shipping_names[x] != 'shipping_method') {
429
+ var current_name = shipping_names[x];
430
+ if(shipping_names[x] == 'shipping[street][]') {
431
+ current_name = 'shipping[street][' + street_count + ']';
432
+ street_count = street_count + 1;
433
+ }
434
+
435
+ parameters[current_name] = shipping_values[x];
436
+ }
437
+ }
438
+ }
439
+
440
+ var shipment_methods = $$('div.onestepcheckout-shipping-method-block')[0];
441
+ var shipment_methods_found = false;
442
+
443
+ if(typeof shipment_methods != 'undefined') {
444
+ shipment_methods_found = true;
445
+ }
446
+
447
+ if(shipment_methods_found) {
448
+ shipment_methods.update('<div class="loading-ajax">&nbsp;</div>');
449
+ }
450
+
451
+ var payment_hpp_ideal_type = $RF(form, 'payment[hpp_ideal_type]');
452
+ var payment_hpp_type = $RF(form, 'payment[hpp_type]');
453
+ var payment_recurring_type = $RF(form, 'payment[recurring]');
454
+ var payment_recurring_type_cvc = $('adyen_oneclick_oneclick_cid_'+payment_recurring_type);
455
+ var payment_method = $RF(form, 'payment[method]');
456
+ parameters['payment_method'] = payment_method;
457
+ parameters['payment[method]'] = payment_method;
458
+
459
+ if(update_payments){
460
+ var payment_methods = $$('div.payment-methods')[0];
461
+ payment_methods.update('<div class="loading-ajax">&nbsp;</div>');
462
+ }
463
+
464
+ var totals = get_totals_element();
465
+ totals.update('<div class="loading-ajax">&nbsp;</div>');
466
+
467
+
468
+ new Ajax.Request(url, {
469
+ method: 'post',
470
+ onSuccess: function(transport) {
471
+ if(transport.status == 200) {
472
+
473
+ var data = transport.responseText.evalJSON();
474
+
475
+ // Update shipment methods
476
+ if(shipment_methods_found) {
477
+ shipment_methods.update(data.shipping_method);
478
+ }
479
+
480
+ if(update_payments){
481
+ payment_methods.replace(data.payment_method);
482
+ }
483
+
484
+ totals.update(data.summary);
485
+
486
+
487
+ }
488
+ },
489
+ onComplete: function(transport){
490
+ if(transport.status == 200) {
491
+ if(shipment_methods_found) {
492
+ $$('dl.shipment-methods input').invoke('observe', 'click', get_separate_save_methods_function(set_methods_url, update_payments));
493
+ $$('dl.shipment-methods input').invoke('observe', 'click', function() {
494
+ $$('div.onestepcheckout-shipment-method-error').each(function(item) {
495
+ new Effect.Fade(item);
496
+ });
497
+ });
498
+ }
499
+
500
+ if(update_payments){
501
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(set_methods_url));
502
+ $$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
503
+ $$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
504
+
505
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
506
+ $$('div.onestepcheckout-payment-method-error').each(function(item) {
507
+ new Effect.Fade(item);
508
+ });
509
+ });
510
+
511
+ if($RF(form, 'payment[method]') != null) {
512
+ try {
513
+ var payment_method = $RF(form, 'payment[method]');
514
+ $('container_payment_method_' + payment_method).show();
515
+ var payment_form = $('payment_form_' + payment_method);
516
+ if(payment_form)
517
+ $(payment_form).show();
518
+ else if(payment_method == "adyen_hpp") { // check if payment type is hpp (this has other id so should come in else )
519
+ // set sub payment method back
520
+ $('hpp_type_'+payment_hpp_type).checked = true;
521
+
522
+ // check if ideal payment bank is chosen
523
+ if(payment_hpp_type == "ideal") {
524
+ if(payment_hpp_ideal_type) {
525
+ // get issue_id this is before the slash
526
+ var issue_id = payment_hpp_ideal_type.substr(0, payment_hpp_ideal_type.indexOf('/'));
527
+ $('hpp_ideal_type_'+issue_id).checked = true;
528
+ }
529
+ $('payment_form_ideal').show();
530
+ }
531
+ } else if(payment_method == "adyen_oneclick") { // check if payment type is hpp
532
+ // set sub payment method back
533
+ $('recurring_type_'+payment_recurring_type).checked = true;
534
+ // set back the cvc code
535
+ $('adyen_oneclick_oneclick_cid_'+payment_recurring_type).value = payment_recurring_type_cvc.value;
536
+ // show the cvc code block
537
+ var cvc_block = "cvc_block_" + payment_recurring_type;
538
+ $(cvc_block).show();
539
+ }
540
+ } catch(err) {
541
+
542
+ }
543
+ }
544
+ }
545
+ }
546
+ },
547
+ parameters: parameters
548
+ });
549
+
550
+ }
551
+ }
552
+
553
+ function get_separate_save_methods_function(url, update_payments)
554
+ {
555
+ if(typeof update_payments == 'undefined') {
556
+ var update_payments = false;
557
+ }
558
+
559
+ return function(e) {
560
+ if(typeof e != 'undefined') {
561
+ var element = e.element();
562
+
563
+ if(element.name != 'shipping_method') {
564
+ update_payments = false;
565
+ }
566
+ }
567
+
568
+ var form = $('onestepcheckout-form');
569
+ var shipping_method = $RF(form, 'shipping_method');
570
+ var payment_method = $RF(form, 'payment[method]');
571
+ var payment_hpp_type = $RF(form, 'payment[hpp_type]');
572
+ var payment_hpp_ideal_type = $RF(form, 'payment[hpp_ideal_type]');
573
+ var payment_recurring_type = $RF(form, 'payment[recurring]');
574
+ var payment_recurring_type_cvc = $('adyen_oneclick_oneclick_cid_'+payment_recurring_type);
575
+
576
+ var totals = get_totals_element();
577
+
578
+ var freeMethod = $('p_method_free');
579
+ if(freeMethod){
580
+ payment.reloadcallback = true;
581
+ payment.countreload = 1;
582
+ }
583
+
584
+ totals.update('<div class="loading-ajax">&nbsp;</div>');
585
+
586
+ if(update_payments) {
587
+ var payment_methods = $$('div.payment-methods')[0];
588
+ payment_methods.update('<div class="loading-ajax">&nbsp;</div>');
589
+ }
590
+
591
+ var parameters = {
592
+ shipping_method: shipping_method,
593
+ payment_method: payment_method
594
+ }
595
+
596
+ /* Find payment parameters and include */
597
+ var items = $$('input[name^=payment]').concat($$('select[name^=payment]'));
598
+ var names = items.pluck('name');
599
+ var values = items.pluck('value');
600
+
601
+ for(var x=0; x < names.length; x++) {
602
+ if(names[x] != 'payment[method]') {
603
+ parameters[names[x]] = values[x];
604
+ }
605
+ }
606
+
607
+ new Ajax.Request(url, {
608
+ method: 'post',
609
+ onSuccess: function(transport) {
610
+ if(transport.status == 200) {
611
+ var data = transport.responseText.evalJSON();
612
+ var form = $('onestepcheckout-form');
613
+
614
+ totals.update(data.summary);
615
+
616
+ if(update_payments) {
617
+
618
+ payment_methods.replace(data.payment_method);
619
+
620
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
621
+ $$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
622
+ $$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
623
+ $$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
624
+ $$('div.onestepcheckout-payment-method-error').each(function(item) {
625
+ new Effect.Fade(item);
626
+ });
627
+ });
628
+
629
+ if($RF($('onestepcheckout-form'), 'payment[method]') != null) {
630
+ try {
631
+ var payment_method = $RF(form, 'payment[method]');
632
+ $('container_payment_method_' + payment_method).show();
633
+ var payment_form = $('payment_form_' + payment_method);
634
+ if(payment_form)
635
+ $(payment_form).show();
636
+ else if(payment_method == "adyen_hpp") { // check if payment type is hpp (this has other id so should come in else )
637
+ // set sub payment method back
638
+ $('hpp_type_'+payment_hpp_type).checked = true;
639
+
640
+ // check if ideal payment bank is chosen
641
+ if(payment_hpp_type == "ideal") {
642
+ if(payment_hpp_ideal_type) {
643
+ // get issue_id this is before the slash
644
+ var issue_id = payment_hpp_ideal_type.substr(0, payment_hpp_ideal_type.indexOf('/'));
645
+ $('hpp_ideal_type_'+issue_id).checked = true;
646
+ }
647
+ $('payment_form_ideal').show();
648
+ }
649
+ } else if(payment_method == "adyen_oneclick") { // check if payment type is hpp
650
+ // set sub payment method back
651
+ $('recurring_type_'+payment_recurring_type).checked = true;
652
+ // set back the cvc code
653
+ $('adyen_oneclick_oneclick_cid_'+payment_recurring_type).value = payment_recurring_type_cvc.value;
654
+ // show the cvc code block
655
+ var cvc_block = "cvc_block_" + payment_recurring_type;
656
+ $(cvc_block).show();
657
+ // show update link url
658
+ var update_link = "update-expiration-date-" + payment_recurring_type;
659
+ $(update_link).show();
660
+ }
661
+ } catch(err) {
662
+
663
+ }
664
+ }
665
+ }
666
+ }
667
+ },
668
+ parameters: parameters
669
+ });
670
+ }
671
+ }
672
+
673
+ function paymentrefresh(url) {
674
+ var payment_methods = $$('div.payment-methods')[0];
675
+ payment_methods.update('<div class="loading-ajax">&nbsp;</div>');
676
+ new Ajax.Request(url, {
677
+ method: 'get',
678
+ onSuccess: function(transport){
679
+ if(transport.status == 200) {
680
+ var data = transport.responseText.evalJSON();
681
+ payment_methods.replace(data.payment_method);
682
+
683
+ $$('div.payment-methods input[name="payment\[method\]"]', 'div.payment-methods input[name="payment\[useProfile\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
684
+ $$('div.payment-methods input[name="payment\[method\]"]', 'div.payment-methods input[name="payment\[useProfile\]"]').invoke('observe', 'click', function() {
685
+ $$('div.onestepcheckout-payment-method-error').each(function(item) {
686
+ new Effect.Fade(item);
687
+ });
688
+ });
689
+
690
+ if($RF(form, 'payment[method]') != null) {
691
+ try {
692
+ var payment_method = $RF(form, 'payment[method]');
693
+ $('container_payment_method_' + payment_method).show();
694
+ $('payment_form_' + payment_method).show();
695
+ } catch(err){}
696
+ }
697
+
698
+ }
699
+ }
700
+ });
701
+ }
702
+
703
+ function addressPreview(templates, target) {
704
+ var bparams = {};
705
+ var sparams = {};
706
+ var savedBillingItems = $('billing-address-select');
707
+ if(savedBillingItems && savedBillingItems.getValue()){
708
+ index = savedBillingItems.selectedIndex;
709
+ bparams = customerBAddresses[index];
710
+ } else {
711
+ var items = $$('input[name^=billing]').concat($$('select[name^=billing]'));
712
+ items.each(function(s) {
713
+ if(s.getStyle('display') != 'none'){
714
+ selectText = s.options
715
+ if(selectText){
716
+ value = selectText[s.selectedIndex].text;
717
+ } else {
718
+ value = s.getValue();
719
+ }
720
+ if(value){
721
+ value = '<span class="' + s.id.replace(':','-') + '">' + value.escapeHTML() + '</span>';
722
+ }
723
+ if(s.id == 'billing:region_id'){
724
+ bparams['billing:region'] = value;
725
+ } else {
726
+ bparams[s.id] = value;
727
+ }
728
+ }
729
+ });
730
+ }
731
+
732
+
733
+
734
+ var savedShippingItems = $('shipping-address-select');
735
+ if(savedShippingItems && savedShippingItems.getValue()){
736
+ index = savedShippingItems.selectedIndex;
737
+ sparams = customerSAddresses[index];
738
+ } else {
739
+ var items = $$('input[name^=shipping]').concat($$('select[name^=shipping]'));
740
+ items.each(function(s) {
741
+ if(s.getStyle('display') != 'none'){
742
+ selectText = s.options
743
+ if(selectText){
744
+ value = selectText[s.selectedIndex].text;
745
+ } else {
746
+ value = s.getValue();
747
+ }
748
+ if(value){
749
+ value = '<span class="' + s.id.replace(':','-') + '">' + value.escapeHTML() + '</span>';
750
+ }
751
+ if(s.id == 'shipping:region_id'){
752
+ sparams['shipping:region'] = value;
753
+ } else {
754
+ sparams[s.id] = value;
755
+ }
756
+ }
757
+ });
758
+ }
759
+
760
+
761
+ var form = $('onestepcheckout-form');
762
+
763
+ var shipping_method = $RF(form, 'shipping_method');
764
+ if(shipping_method){
765
+ var shipping_label = $('s_method_' + shipping_method).up('dt').down('label').innerHTML.stripScripts();
766
+ var shipping_title = $('s_method_' + shipping_method).up('dt').previous('dd').innerHTML.stripScripts();
767
+ var shipping_row = shipping_title + ' - ' + shipping_label
768
+ }
769
+
770
+ var useOnlyBilling = $('billing:use_for_shipping_yes').getValue();
771
+ billinga_template = new Template(templates.billing);
772
+
773
+ if(useOnlyBilling){
774
+ shippinga_template = new Template(templates.billing);
775
+ }else{
776
+ shippinga_template = new Template(templates.shipping);
777
+ }
778
+
779
+ var payment_method = payment.currentMethod;
780
+
781
+ if(payment_method){
782
+ var payment_label = $('p_method_'+payment_method).up('dt').down('label').innerHTML.stripScripts();
783
+ }
784
+
785
+ var targetelem = $(target + '_billinga').childElements()[1];
786
+ if(targetelem){
787
+ targetelem.update(billinga_template.evaluate(bparams));
788
+ }
789
+
790
+ var targetelem = $(target + '_shippinga').childElements()[1];
791
+ if(targetelem){
792
+ if(useOnlyBilling){
793
+ targetelem.update(shippinga_template.evaluate(bparams));
794
+ }else{
795
+ targetelem.update(shippinga_template.evaluate(sparams));
796
+ }
797
+ }
798
+
799
+ var targetelem = $(target + '_shipping').childElements()[1];
800
+ if(targetelem){
801
+ targetelem.update(shipping_row);
802
+ }
803
+
804
+ var targetelem = $(target + '_payment').childElements()[1];
805
+ if(targetelem){
806
+ targetelem.update(payment_label);
807
+ }
808
+
809
+ var targetelem = $(target + '_summary').childElements()[1];
810
+ if(targetelem){
811
+ targetelem.update('');
812
+ targetelem.insert($$('table.onestepcheckout-summary')[0].cloneNode(true));
813
+ targetelem.insert($$('table.onestepcheckout-totals')[0].cloneNode(true));
814
+ }
815
+ }
816
+
817
+
818
+ var Checkout = Class.create();
819
+ Checkout.prototype = {
820
+ initialize: function(){
821
+ this.accordion = '';
822
+ this.progressUrl = '';
823
+ this.reviewUrl = '';
824
+ this.saveMethodUrl = '';
825
+ this.failureUrl = '';
826
+ this.billingForm = false;
827
+ this.shippingForm= false;
828
+ this.syncBillingShipping = false;
829
+ this.method = '';
830
+ this.payment = '';
831
+ this.loadWaiting = false;
832
+ },
833
+
834
+ ajaxFailure: function(){
835
+ location.href = this.failureUrl;
836
+ },
837
+
838
+ setLoadWaiting: function(step, keepDisabled) {
839
+ return true
840
+ }
841
+ };
842
+
843
+ //billing
844
+ var Billing = Class.create();
845
+ Billing.prototype = {
846
+ initialize: function(form, addressUrl, saveUrl){
847
+ this.form = form;
848
+ },
849
+
850
+ setAddress: function(addressId){
851
+
852
+ },
853
+
854
+ newAddress: function(isNew){
855
+ if (isNew) {
856
+ //this.resetSelectedAddress();
857
+ Element.show('billing_address_list');
858
+ if($('billing:use_for_shipping_yes').getValue() != "1" && $('shipping-address-select').getValue() == ''){
859
+ Element.show('shipping_address_list');
860
+ }
861
+
862
+ } else {
863
+ Element.hide('billing_address_list');
864
+ }
865
+ $$('input[name^=billing]', 'select[id=billing:region_id]').each(function(e){
866
+ if(e.name=='billing[use_for_shipping]' || e.name=='billing[save_in_address_book]'){
867
+
868
+ } else {
869
+ e.value = '';
870
+ }
871
+ });
872
+ },
873
+
874
+ resetSelectedAddress: function(){
875
+ var selectElement = $('shipping-address-select')
876
+ if (selectElement) {
877
+ selectElement.value='';
878
+ }
879
+ },
880
+
881
+ fillForm: function(transport){
882
+
883
+ },
884
+
885
+ setUseForShipping: function(flag) {
886
+
887
+ },
888
+
889
+ save: function(){
890
+
891
+ },
892
+
893
+ resetLoadWaiting: function(transport){
894
+
895
+ },
896
+
897
+ nextStep: function(transport){
898
+
899
+ }
900
+ };
901
+
902
+ //shipping
903
+ var Shipping = Class.create();
904
+ Shipping.prototype = {
905
+ initialize: function(form){
906
+ this.form = form;
907
+ },
908
+
909
+ setAddress: function(addressId){
910
+
911
+ },
912
+
913
+ newAddress: function(isNew){
914
+ if (isNew) {
915
+ this.resetSelectedAddress();
916
+ Element.show('shipping_address_list');
917
+ } else {
918
+ Element.hide('shipping_address_list');
919
+ }
920
+
921
+ $$('#shipping_address input[name^=shipping],#shipping_address select[id=shipping:region_id]').each(function(e){
922
+ if(e.name=='shipping[save_in_address_book]'){
923
+
924
+ } else {
925
+ e.value = '';
926
+ }
927
+ })
928
+
929
+ },
930
+
931
+ resetSelectedAddress: function(){
932
+ var selectElement = $('shipping-address-select')
933
+ if (selectElement) {
934
+ selectElement.value='';
935
+ }
936
+ },
937
+
938
+ fillForm: function(transport){
939
+
940
+ },
941
+
942
+ setSameAsBilling: function(flag) {
943
+
944
+ },
945
+
946
+ syncWithBilling: function () {
947
+
948
+ },
949
+
950
+ setRegionValue: function(){
951
+ //$('shipping:region').value = $('billing:region').value;
952
+ },
953
+
954
+ save: function(){
955
+
956
+ }
957
+ };
958
+
959
+ //payment object
960
+ var Payment = Class.create();
961
+ Payment.prototype = {
962
+ beforeInitFunc:$H({}),
963
+ afterInitFunc:$H({}),
964
+ beforeValidateFunc:$H({}),
965
+ afterValidateFunc:$H({}),
966
+ initialize: function(form, saveUrl){
967
+ this.form = form;
968
+ this.saveUrl = saveUrl;
969
+ },
970
+
971
+ init : function () {
972
+ var elements = Form.getElements(this.form);
973
+ if ($(this.form)) {
974
+ //$(this.form).observe('submit', function(event){this.save();Event.stop(event);}.bind(this));
975
+ }
976
+ var method = null;
977
+ for (var i=0; i<elements.length; i++) {
978
+ if (elements[i].name=='payment[method]') {
979
+ if (elements[i].checked) {
980
+ method = elements[i].value;
981
+ }
982
+ } else {
983
+ elements[i].disabled = true;
984
+ }
985
+ }
986
+ if (method) this.switchMethod(method);
987
+ },
988
+
989
+ switchMethod: function(method){
990
+ if (this.currentMethod && $('payment_form_'+this.currentMethod)) {
991
+ var form = $('payment_form_'+this.currentMethod);
992
+ form.style.display = 'none';
993
+ var elements = form.select('input').concat(form.select('select')).concat(form.select('textarea'));
994
+ for (var i=0; i<elements.length; i++) elements[i].disabled = true;
995
+ }
996
+
997
+ if ($('payment_form_'+method)){
998
+ var form = $('payment_form_'+method);
999
+ form.style.display = '';
1000
+ var elements = form.select('input').concat(form.select('select')).concat(form.select('textarea'));
1001
+ for (var i=0; i<elements.length; i++) elements[i].disabled = false;
1002
+ this.currentMethod = method;
1003
+ }
1004
+ },
1005
+
1006
+ addBeforeValidateFunction : function(code, func) {
1007
+ this.beforeValidateFunc.set(code, func);
1008
+ },
1009
+
1010
+ beforeValidate : function() {
1011
+ var validateResult = true;
1012
+ var hasValidation = false;
1013
+ (this.beforeValidateFunc).each(function(validate){
1014
+ hasValidation = true;
1015
+ if ((validate.value)() == false) {
1016
+ validateResult = false;
1017
+ }
1018
+ }.bind(this));
1019
+ if (!hasValidation) {
1020
+ validateResult = false;
1021
+ }
1022
+ return validateResult;
1023
+ },
1024
+
1025
+ validate: function() {
1026
+ var methods = document.getElementsByName('payment[method]');
1027
+ if (methods.length==0) {
1028
+ alert(Translator.translate('Your order can not be completed at this time as there is no payment methods available for it.'));
1029
+ return false;
1030
+ }
1031
+ for (var i=0; i<methods.length; i++) {
1032
+ if (methods[i].checked) {
1033
+ return true;
1034
+ }
1035
+ }
1036
+ alert(Translator.translate('Please specify payment method.'));
1037
+ return false;
1038
+ },
1039
+
1040
+ save: function(){
1041
+ },
1042
+ addAfterInitFunction : function(code, func) {
1043
+ this.afterInitFunc.set(code, func);
1044
+ },
1045
+
1046
+ afterInit : function() {
1047
+ (this.afterInitFunc).each(function(init){
1048
+ (init.value)();
1049
+ });
1050
+ }
1051
+ };