Version Notes
Features:
#156 CreditCard logos are shown and automatically detected instead of selecting your cart type
#174 Added Elo and Hipercard to CreditCard types
#175 Show number of installments in payment details of the order
#170 Encrypt password fields in configuration settings
#168 Option to add phonenumber field only for the OpenInvoice payment method
#113 Show fraudscore in Magento (if you have this setup for your account or if you have Adyen CC payment method enabled)
#144 Show by default Ideal payment method as a list instead of logos (can be changed in the configurations)
#140 Added payment logos for all payment methods
#149 Pre fill country for Payment Method SEPA based on billing information
#157 Added option to use IPFilter for the payment method Adyen POS
#150 Create a new configuration field for Client-Side Encryption Public Key for test
#114 Added extra setting so you can can define a different status for Downloadable products
#165 Option to send out confirmation mail for Banktransfer/SEPA before payment is received
#176 Added CSE support for IWD One Page Checkout
#154 Added Filter on N.A in Adyen Status column of sales order grid
#127 #180 Added translation for Dutch,German,Spanish and French
#181 Cash Drawer support for epson ePOS-Device
Fixes:
#152 IOS CheckSum Fix For POS payments
#172 Update scripts now support tables that have prefixes
#169 Admin Order is now showing Total Due and Total Refunded
#126 Change logic for Capture so it will shoot in an api call to Adyen when you use the magento API capture
#158 Orders not using Adyen Payments can now be cancelled without errors
#151 #155 Database Optimization for better performance
#130 Adyen PSP Reference link in order details goes directly to the payment instead of the list with filtering on this PSP Reference.
#121 Don’t throw exception when there are no payment methods available for the Adyen HPP payment method
#117 Use for Afterpay afterpay_default payment method instead of old open invoice integration
#115 Fix validation for Diners cards
#183 Openinvoice (Afterpay/Klarna) are always manual captured
#116 Removed specific OneStepCheckout changes from the module, this will be added on GitHub as an external asset
Release Info
Developer | Adyen |
Extension | Adyen_Payment |
Version | 2.2.0 |
Comparing to | |
See all releases |
Code changes from version 2.1.1 to 2.2.0
- app/code/community/Adyen/Payment/Block/Adminhtml/Sales/Order/Filter/Adyen.php +10 -6
- app/code/community/Adyen/Payment/Block/Adminhtml/Sales/Order/Totals.php +1 -1
- app/code/community/Adyen/Payment/Block/Adminhtml/Version.php +25 -0
- app/code/community/Adyen/Payment/Block/Checkout/Success.php +26 -1
- app/code/community/Adyen/Payment/Block/Form/Boleto.php +34 -1
- app/code/community/Adyen/Payment/Block/Form/Cc.php +14 -1
- app/code/community/Adyen/Payment/Block/Form/Elv.php +14 -1
- app/code/community/Adyen/Payment/Block/Form/Hpp.php +4 -0
- app/code/community/Adyen/Payment/Block/Form/Openinvoice.php +40 -1
- app/code/community/Adyen/Payment/Block/Form/Pos.php +14 -1
- app/code/community/Adyen/Payment/Block/Form/Sepa.php +55 -1
- app/code/community/Adyen/Payment/Block/Redirect.php +96 -46
- app/code/community/Adyen/Payment/Helper/Data.php +56 -14
- app/code/community/Adyen/Payment/Helper/Installments.php +14 -12
- app/code/community/Adyen/Payment/Model/Adyen/Abstract.php +10 -32
- app/code/community/Adyen/Payment/Model/Adyen/Boleto.php +21 -0
- app/code/community/Adyen/Payment/Model/Adyen/Cc.php +33 -1
- app/code/community/Adyen/Payment/Model/Adyen/Data/IdealPaymentRequest.php +0 -64
- app/code/community/Adyen/Payment/Model/Adyen/Elv.php +18 -0
- app/code/community/Adyen/Payment/Model/Adyen/Hpp.php +34 -39
- app/code/community/Adyen/Payment/Model/Adyen/Ideal.php +0 -93
- app/code/community/Adyen/Payment/Model/Adyen/Openinvoice.php +104 -83
- app/code/community/Adyen/Payment/Model/Adyen/Pos.php +19 -8
- app/code/community/Adyen/Payment/Model/Adyen/Sepa.php +18 -0
- app/code/community/Adyen/Payment/Model/Authenticate.php +19 -21
- app/code/community/Adyen/Payment/Model/Event.php +3 -0
- app/code/community/Adyen/Payment/Model/Mysql4/Adyen/Event.php +3 -4
- app/code/community/Adyen/Payment/Model/Mysql4/Adyen/Event/Collection.php +25 -0
- app/code/community/Adyen/Payment/Model/Observer.php +5 -27
- app/code/community/Adyen/Payment/Model/Process.php +70 -17
- app/code/community/Adyen/Payment/Model/Sales/Quote/Address/Total/PaymentFee.php +16 -1
- app/code/community/Adyen/Payment/Model/Source/DefaultPaymentMethods.php +42 -0
- app/code/community/Adyen/Payment/Model/Source/Status/Complete.php +31 -0
- app/code/community/Adyen/Payment/Model/Source/Status/Refund.php +25 -0
- app/code/community/Adyen/Payment/Model/Source/VisibleType.php +38 -0
- app/code/community/Adyen/Payment/controllers/ProcessController.php +3 -4
- app/code/community/Adyen/Payment/controllers/SavedCardController.php +25 -0
- app/code/community/Adyen/Payment/data/adyen_setup/data-upgrade-2.1.2.3-2.1.2.4.php +61 -0
- app/code/community/Adyen/Payment/etc/config.xml +31 -19
- app/code/community/Adyen/Payment/etc/system.xml +180 -32
- app/code/community/Adyen/Payment/sql/adyen_setup/mysql4-upgrade-0.1.0.3-0.1.0.4.php +1 -1
- app/code/community/Adyen/Payment/sql/adyen_setup/mysql4-upgrade-1.0.0.3-1.0.0.7.php +26 -2
- app/code/community/Adyen/Payment/sql/adyen_setup/mysql4-upgrade-2.0.3-2.1.0.php +25 -0
- app/code/community/Adyen/Payment/sql/adyen_setup/mysql4-upgrade-2.1.1-2.1.2.1.php +39 -0
- app/code/community/Adyen/Payment/sql/adyen_setup/mysql4-upgrade-2.1.2.1-2.1.2.2.php +33 -0
- app/code/community/Adyen/Payment/sql/adyen_setup/mysql4-upgrade-2.1.2.2-2.1.2.3.php +32 -0
- app/design/adminhtml/default/default/template/adyen/form/cc.phtml +3 -4
- app/design/adminhtml/default/default/template/adyen/form/hpp.phtml +42 -44
- app/design/adminhtml/default/default/template/adyen/form/sepa.phtml +4 -41
- app/design/adminhtml/default/default/template/adyen/info/boleto.phtml +2 -2
- app/design/adminhtml/default/default/template/adyen/info/cc.phtml +8 -3
- app/design/adminhtml/default/default/template/adyen/info/elv.phtml +2 -2
- app/design/adminhtml/default/default/template/adyen/info/hpp.phtml +2 -2
- app/design/adminhtml/default/default/template/adyen/info/openinvoice.phtml +2 -2
- app/design/adminhtml/default/default/template/adyen/info/pos.phtml +2 -2
- app/design/adminhtml/default/default/template/adyen/info/sepa.phtml +2 -2
- app/design/frontend/base/default/layout/adyen.xml +22 -5
- app/design/frontend/base/default/template/adyen/.DS_Store +0 -0
- app/design/frontend/base/default/template/adyen/checkout/.DS_Store +0 -0
- app/design/frontend/base/default/template/adyen/checkout/onepage/payment/methods.phtml +30 -20
- app/design/frontend/base/default/template/adyen/checkout/success.phtml +32 -5
- app/design/frontend/base/default/template/adyen/form/boleto.phtml +1 -1
- app/design/frontend/base/default/template/adyen/form/cc.phtml +223 -110
- app/design/frontend/base/default/template/adyen/form/hpp.phtml +52 -49
- app/design/frontend/base/default/template/adyen/form/oneclick.phtml +29 -3
- app/design/frontend/base/default/template/adyen/form/openinvoice.phtml +10 -0
- app/design/frontend/base/default/template/adyen/form/sepa.phtml +3 -38
- app/design/frontend/base/default/template/adyen/{blank.phtml → payment/payment_method_label.phtml} +4 -9
- app/design/frontend/base/default/template/adyen/{posExpressCheckout.phtml → pos_express_checkout.phtml} +27 -0
- app/design/frontend/base/default/template/adyen/{savedCards.phtml → saved_cards.phtml} +28 -1
- app/design/frontend/base/default/template/adyen/{scanProduct.phtml → scan_product.phtml} +28 -1
- app/design/frontend/default/adyen/template/onestepcheckout/checkout.phtml +0 -1319
- app/design/frontend/default/adyen/template/onestepcheckout/payment_method.phtml +0 -217
- app/design/frontend/enterprise/adyen/template/onestepcheckout/checkout.phtml +0 -1319
- app/design/frontend/enterprise/adyen/template/onestepcheckout/payment_method.phtml +0 -217
- app/design/frontend/rwd/adyen/template/onestepcheckout/checkout.phtml +0 -1319
- app/design/frontend/rwd/adyen/template/onestepcheckout/payment_method.phtml +0 -217
- app/locale/de_DE/Adyen_Payment.csv +56 -0
- app/locale/es_ES/Adyen_Payment.csv +56 -0
- app/locale/fr_FR/Adyen_Payment.csv +56 -0
- app/locale/nl_NL/Adyen_Payment.csv +56 -0
- js/adyen/payment/cc.js +479 -0
- js/adyen/payment/epos-device-2.6.0.js +5 -0
- package.xml +34 -32
- skin/frontend/base/default/css/adyenstyle.css +35 -2
- skin/frontend/base/default/images/adyen/ae_small.png +0 -0
- skin/frontend/base/default/images/adyen/dc_small.png +0 -0
- skin/frontend/base/default/images/adyen/di_small.png +0 -0
- skin/frontend/base/default/images/adyen/elo.png +0 -0
- skin/frontend/base/default/images/adyen/elo_small.png +0 -0
- skin/frontend/base/default/images/adyen/hipercard.png +0 -0
- skin/frontend/base/default/images/adyen/hipercard_small.png +0 -0
- skin/frontend/base/default/images/adyen/img_trans.gif +0 -0
- skin/frontend/base/default/images/adyen/pm_gloss.png +0 -0
- skin/frontend/base/default/images/adyen/sm_small.png +0 -0
- skin/frontend/base/default/images/adyen/vi_small.png +0 -0
- skin/frontend/default/adyen/onestepcheckout/js/onestepcheckout.js +0 -1107
- skin/frontend/enterprise/adyen/onestepcheckout/js/onestepcheckout.js +0 -1107
- skin/frontend/rwd/adyen/onestepcheckout/js/onestepcheckout.js +0 -1107
@@ -30,7 +30,8 @@ class Adyen_Payment_Block_Adminhtml_Sales_Order_Filter_Adyen extends Mage_Adminh
|
|
30 |
protected function _getOptions() {
|
31 |
$events = Mage::getResourceModel('adyen/adyen_event')->getAllDistinctEvents();
|
32 |
$select = array(
|
33 |
-
array('label' => '', 'value' =>
|
|
|
34 |
);
|
35 |
foreach ($events as $event) {
|
36 |
|
@@ -61,14 +62,17 @@ class Adyen_Payment_Block_Adminhtml_Sales_Order_Filter_Adyen extends Mage_Adminh
|
|
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 $
|
72 |
}
|
73 |
|
74 |
}
|
30 |
protected function _getOptions() {
|
31 |
$events = Mage::getResourceModel('adyen/adyen_event')->getAllDistinctEvents();
|
32 |
$select = array(
|
33 |
+
array('label' => '', 'value' => ''),
|
34 |
+
array('label' => 'N.A', 'value' => 'N.A'),
|
35 |
);
|
36 |
foreach ($events as $event) {
|
37 |
|
62 |
$select[] = array('label' => $event['adyen_event_result'], 'value' => $event['adyen_event_result']);
|
63 |
break;
|
64 |
}
|
65 |
+
}
|
66 |
+
return $select;
|
67 |
+
}
|
68 |
|
69 |
|
70 |
+
public function getCondition()
|
71 |
+
{
|
72 |
+
if($this->getValue() == "N.A") {
|
73 |
+
return array('null' => "");
|
74 |
}
|
75 |
+
return $this->getValue();
|
76 |
}
|
77 |
|
78 |
}
|
@@ -25,7 +25,7 @@
|
|
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
|
29 |
|
30 |
protected function _initTotals()
|
31 |
{
|
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_Adminhtml_Block_Sales_Order_Totals {
|
29 |
|
30 |
protected function _initTotals()
|
31 |
{
|
@@ -1,5 +1,30 @@
|
|
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)
|
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_Version extends Mage_Adminhtml_Block_System_Config_Form_Field
|
29 |
{
|
30 |
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
@@ -1,5 +1,30 @@
|
|
1 |
-
<?php
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Adyen_Payment_Block_Checkout_Success extends Mage_Checkout_Block_Onepage_Success
|
4 |
{
|
5 |
private $order;
|
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_Checkout_Success extends Mage_Checkout_Block_Onepage_Success
|
29 |
{
|
30 |
private $order;
|
@@ -28,8 +28,21 @@
|
|
28 |
class Adyen_Payment_Block_Form_Boleto extends Mage_Payment_Block_Form {
|
29 |
|
30 |
protected function _construct() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
parent::_construct();
|
32 |
-
$this->setTemplate('adyen/form/boleto.phtml');
|
33 |
}
|
34 |
|
35 |
/**
|
@@ -72,4 +85,24 @@ class Adyen_Payment_Block_Form_Boleto extends Mage_Payment_Block_Form {
|
|
72 |
return $lastname;
|
73 |
}
|
74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
}
|
28 |
class Adyen_Payment_Block_Form_Boleto extends Mage_Payment_Block_Form {
|
29 |
|
30 |
protected function _construct() {
|
31 |
+
$paymentMethodIcon = $this->getSkinUrl('images'.DS.'adyen'.DS."img_trans.gif");
|
32 |
+
$label = Mage::helper('adyen')->_getConfigData("title", "adyen_boleto");
|
33 |
+
|
34 |
+
$mark = Mage::getConfig()->getBlockClassName('core/template');
|
35 |
+
$mark = new $mark;
|
36 |
+
$mark->setTemplate('adyen/payment/payment_method_label.phtml')
|
37 |
+
->setPaymentMethodIcon($paymentMethodIcon)
|
38 |
+
->setPaymentMethodLabel($label)
|
39 |
+
->setPaymentMethodClass("adyen_boleto");
|
40 |
+
|
41 |
+
$this->setTemplate('adyen/form/boleto.phtml')
|
42 |
+
->setMethodTitle('')
|
43 |
+
->setMethodLabelAfterHtml($mark->toHtml());
|
44 |
+
|
45 |
parent::_construct();
|
|
|
46 |
}
|
47 |
|
48 |
/**
|
85 |
return $lastname;
|
86 |
}
|
87 |
|
88 |
+
public function getUseTaxvat() {
|
89 |
+
return $this->getMethod()->getUseTaxvat();
|
90 |
+
}
|
91 |
+
|
92 |
+
public function getTaxvat() {
|
93 |
+
$taxvat = "";
|
94 |
+
|
95 |
+
// check if user is logged in
|
96 |
+
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
97 |
+
/* Get the customer data */
|
98 |
+
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
99 |
+
$taxvat = $customer->getTaxvat();
|
100 |
+
|
101 |
+
} else {
|
102 |
+
//getCustomerTaxvat
|
103 |
+
$taxvat = Mage::getSingleton('checkout/session')->getQuote()->getCustomerTaxvat();
|
104 |
+
}
|
105 |
+
return $taxvat;
|
106 |
+
}
|
107 |
+
|
108 |
}
|
@@ -29,7 +29,20 @@ class Adyen_Payment_Block_Form_Cc extends Mage_Payment_Block_Form_Cc {
|
|
29 |
|
30 |
protected function _construct() {
|
31 |
parent::_construct();
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
}
|
34 |
|
35 |
/**
|
29 |
|
30 |
protected function _construct() {
|
31 |
parent::_construct();
|
32 |
+
|
33 |
+
$paymentMethodIcon = $this->getSkinUrl('images'.DS.'adyen'.DS."img_trans.gif");
|
34 |
+
$label = Mage::helper('adyen')->_getConfigData("title", "adyen_cc");
|
35 |
+
|
36 |
+
$mark = Mage::getConfig()->getBlockClassName('core/template');
|
37 |
+
$mark = new $mark;
|
38 |
+
$mark->setTemplate('adyen/payment/payment_method_label.phtml')
|
39 |
+
->setPaymentMethodIcon($paymentMethodIcon)
|
40 |
+
->setPaymentMethodLabel($label)
|
41 |
+
->setPaymentMethodClass("adyen_cc");
|
42 |
+
|
43 |
+
$this->setTemplate('adyen/form/cc.phtml')
|
44 |
+
->setMethodTitle('')
|
45 |
+
->setMethodLabelAfterHtml($mark->toHtml());
|
46 |
}
|
47 |
|
48 |
/**
|
@@ -28,8 +28,21 @@
|
|
28 |
class Adyen_Payment_Block_Form_Elv extends Mage_Payment_Block_Form {
|
29 |
|
30 |
protected function _construct() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
parent::_construct();
|
32 |
-
$this->setTemplate('adyen/form/elv.phtml');
|
33 |
}
|
34 |
|
35 |
}
|
28 |
class Adyen_Payment_Block_Form_Elv extends Mage_Payment_Block_Form {
|
29 |
|
30 |
protected function _construct() {
|
31 |
+
$paymentMethodIcon = $this->getSkinUrl('images'.DS.'adyen'.DS."img_trans.gif");
|
32 |
+
$label = Mage::helper('adyen')->_getConfigData("title", "adyen_elv");
|
33 |
+
|
34 |
+
$mark = Mage::getConfig()->getBlockClassName('core/template');
|
35 |
+
$mark = new $mark;
|
36 |
+
$mark->setTemplate('adyen/payment/payment_method_label.phtml')
|
37 |
+
->setPaymentMethodIcon($paymentMethodIcon)
|
38 |
+
->setPaymentMethodLabel($label)
|
39 |
+
->setPaymentMethodClass("adyen_elv");
|
40 |
+
|
41 |
+
$this->setTemplate('adyen/form/elv.phtml')
|
42 |
+
->setMethodTitle('')
|
43 |
+
->setMethodLabelAfterHtml($mark->toHtml());
|
44 |
+
|
45 |
parent::_construct();
|
|
|
46 |
}
|
47 |
|
48 |
}
|
@@ -48,4 +48,8 @@ class Adyen_Payment_Block_Form_Hpp extends Mage_Payment_Block_Form {
|
|
48 |
public function getHppOptionsDisabled() {
|
49 |
return $this->getMethod()->getHppOptionsDisabled();
|
50 |
}
|
|
|
|
|
|
|
|
|
51 |
}
|
48 |
public function getHppOptionsDisabled() {
|
49 |
return $this->getMethod()->getHppOptionsDisabled();
|
50 |
}
|
51 |
+
|
52 |
+
public function getShowIdealLogos() {
|
53 |
+
return $this->getMethod()->getShowIdealLogos();
|
54 |
+
}
|
55 |
}
|
@@ -29,8 +29,29 @@ class Adyen_Payment_Block_Form_Openinvoice extends Mage_Payment_Block_Form {
|
|
29 |
|
30 |
protected $_dateInputs = array();
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
protected function _construct() {
|
33 |
-
$this->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
/* Check if the customer is logged in or not */
|
36 |
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
@@ -121,4 +142,22 @@ class Adyen_Payment_Block_Form_Openinvoice extends Mage_Payment_Block_Form {
|
|
121 |
return $this->getMethod()->dobShow();
|
122 |
}
|
123 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
}
|
29 |
|
30 |
protected $_dateInputs = array();
|
31 |
|
32 |
+
/**
|
33 |
+
* Sales Qoute Billing Address instance
|
34 |
+
*
|
35 |
+
* @var Mage_Sales_Model_Quote_Address
|
36 |
+
*/
|
37 |
+
protected $_address;
|
38 |
+
|
39 |
protected function _construct() {
|
40 |
+
$paymentMethodIcon = $this->getSkinUrl('images'.DS.'adyen'.DS."img_trans.gif");
|
41 |
+
$label = Mage::helper('adyen')->_getConfigData("title", "adyen_openinvoice");
|
42 |
+
// check if klarna or afterpay is selected for showing correct logo
|
43 |
+
$openinvoiceType = Mage::helper('adyen')->_getConfigData("openinvoicetypes", "adyen_openinvoice");
|
44 |
+
|
45 |
+
$mark = Mage::getConfig()->getBlockClassName('core/template');
|
46 |
+
$mark = new $mark;
|
47 |
+
$mark->setTemplate('adyen/payment/payment_method_label.phtml')
|
48 |
+
->setPaymentMethodIcon($paymentMethodIcon)
|
49 |
+
->setPaymentMethodLabel($label)
|
50 |
+
->setPaymentMethodClass("adyen_openinvoice_" . $openinvoiceType);
|
51 |
+
|
52 |
+
$this->setTemplate('adyen/form/openinvoice.phtml')
|
53 |
+
->setMethodTitle('')
|
54 |
+
->setMethodLabelAfterHtml($mark->toHtml());
|
55 |
|
56 |
/* Check if the customer is logged in or not */
|
57 |
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
142 |
return $this->getMethod()->dobShow();
|
143 |
}
|
144 |
|
145 |
+
public function telephoneShow() {
|
146 |
+
return $this->getMethod()->telephoneShow();
|
147 |
+
}
|
148 |
+
|
149 |
+
public function getAddress()
|
150 |
+
{
|
151 |
+
if (is_null($this->_address)) {
|
152 |
+
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
153 |
+
$quote = Mage::helper('checkout/cart')->getQuote();
|
154 |
+
$this->_address = $quote->getBillingAddress();
|
155 |
+
} else {
|
156 |
+
$this->_address = Mage::getModel('sales/quote_address');
|
157 |
+
}
|
158 |
+
}
|
159 |
+
|
160 |
+
return $this->_address;
|
161 |
+
}
|
162 |
+
|
163 |
}
|
@@ -28,7 +28,20 @@
|
|
28 |
class Adyen_Payment_Block_Form_Pos extends Mage_Payment_Block_Form {
|
29 |
|
30 |
protected function _construct() {
|
31 |
-
$this->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
parent::_construct();
|
33 |
}
|
34 |
}
|
28 |
class Adyen_Payment_Block_Form_Pos extends Mage_Payment_Block_Form {
|
29 |
|
30 |
protected function _construct() {
|
31 |
+
$paymentMethodIcon = $this->getSkinUrl('images'.DS.'adyen'.DS."img_trans.gif");
|
32 |
+
$label = Mage::helper('adyen')->_getConfigData("title", "adyen_pos");
|
33 |
+
|
34 |
+
$mark = Mage::getConfig()->getBlockClassName('core/template');
|
35 |
+
$mark = new $mark;
|
36 |
+
$mark->setTemplate('adyen/payment/payment_method_label.phtml')
|
37 |
+
->setPaymentMethodIcon($paymentMethodIcon)
|
38 |
+
->setPaymentMethodLabel($label)
|
39 |
+
->setPaymentMethodClass("adyen_pos");
|
40 |
+
|
41 |
+
$this->setTemplate('adyen/form/pos.phtml')
|
42 |
+
->setMethodTitle('')
|
43 |
+
->setMethodLabelAfterHtml($mark->toHtml());
|
44 |
+
|
45 |
parent::_construct();
|
46 |
}
|
47 |
}
|
@@ -28,8 +28,62 @@
|
|
28 |
class Adyen_Payment_Block_Form_Sepa extends Mage_Payment_Block_Form {
|
29 |
|
30 |
protected function _construct() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
parent::_construct();
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
}
|
34 |
|
35 |
}
|
28 |
class Adyen_Payment_Block_Form_Sepa extends Mage_Payment_Block_Form {
|
29 |
|
30 |
protected function _construct() {
|
31 |
+
$paymentMethodIcon = $this->getSkinUrl('images'.DS.'adyen'.DS."img_trans.gif");
|
32 |
+
$label = Mage::helper('adyen')->_getConfigData("title", "adyen_sepa");
|
33 |
+
|
34 |
+
$mark = Mage::getConfig()->getBlockClassName('core/template');
|
35 |
+
$mark = new $mark;
|
36 |
+
$mark->setTemplate('adyen/payment/payment_method_label.phtml')
|
37 |
+
->setPaymentMethodIcon($paymentMethodIcon)
|
38 |
+
->setPaymentMethodLabel($label)
|
39 |
+
->setPaymentMethodClass("adyen_sepa");
|
40 |
+
|
41 |
+
$this->setTemplate('adyen/form/sepa.phtml')
|
42 |
+
->setMethodTitle('')
|
43 |
+
->setMethodLabelAfterHtml($mark->toHtml());
|
44 |
+
|
45 |
parent::_construct();
|
46 |
+
}
|
47 |
+
|
48 |
+
|
49 |
+
public function getCountries() {
|
50 |
+
|
51 |
+
$sepaCountriesAllowed = array("AT", "BE", "BG", "CH", "CY","CZ","DE","DK","EE","ES","FI","FR",
|
52 |
+
"GB","GF","GI","GP","GR","HR","HU","IE","IS","IT","LI","LT","LU",
|
53 |
+
"LV","MC","MQ","MT","NL","NO","PL","PT","RE","RO","SE","SI","SK");
|
54 |
+
|
55 |
+
$countryList = Mage::getResourceModel('directory/country_collection')
|
56 |
+
->loadData()
|
57 |
+
->toOptionArray(false);
|
58 |
+
|
59 |
+
$sepaCountries = array();
|
60 |
+
|
61 |
+
foreach($countryList as $key => $country) {
|
62 |
+
|
63 |
+
$value = $country['value'];
|
64 |
+
if(!in_array($value, $sepaCountriesAllowed)) {
|
65 |
+
unset($countryList[$key]);
|
66 |
+
}
|
67 |
+
}
|
68 |
+
return $countryList;
|
69 |
+
}
|
70 |
+
|
71 |
+
public function getShopperCountryId() {
|
72 |
+
$country = "";
|
73 |
+
if(Mage::app()->getStore()->isAdmin())
|
74 |
+
{
|
75 |
+
$quote = Mage::getSingleton('adminhtml/session_quote')->getQuote();
|
76 |
+
} else {
|
77 |
+
$quote = Mage::helper('checkout/cart')->getQuote();
|
78 |
+
}
|
79 |
+
|
80 |
+
if($quote) {
|
81 |
+
$billingAddress = $quote->getBillingAddress();
|
82 |
+
if($billingAddress) {
|
83 |
+
$country = $billingAddress->getCountryId();
|
84 |
+
}
|
85 |
+
}
|
86 |
+
return $country;
|
87 |
}
|
88 |
|
89 |
}
|
@@ -25,7 +25,7 @@
|
|
25 |
* @property Adyen B.V
|
26 |
* @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
|
27 |
*/
|
28 |
-
|
29 |
|
30 |
protected function _getCheckout() {
|
31 |
return Mage::getSingleton('checkout/session');
|
@@ -42,20 +42,31 @@
|
|
42 |
}
|
43 |
|
44 |
protected function _toHtml() {
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
|
60 |
// extra parameters so that you alway's return these paramters from the application
|
61 |
$extra_paramaters = urlencode("/?originalCustomCurrency=".$adyFields['currencyCode']."&originalCustomAmount=".$adyFields['paymentAmount']. "&originalCustomMerchantReference=".$adyFields['merchantReference'] . "&originalCustomSessionId=".session_id());
|
@@ -79,18 +90,18 @@
|
|
79 |
// log the launchlink
|
80 |
Mage::log("Launchlink:".$launchlink, Zend_Log::DEBUG, "adyen_notification.log", true);
|
81 |
|
82 |
-
|
83 |
-
|
84 |
<div class=\"logo\"></div>
|
85 |
<div class=\"grey-header\">
|
86 |
<h1>POS Payment</h1>
|
87 |
</div>
|
88 |
<div class=\"amount-box\">".
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
|
93 |
-
|
94 |
|
95 |
function checkStatus() {
|
96 |
$.ajax({
|
@@ -107,32 +118,71 @@
|
|
107 |
}
|
108 |
});
|
109 |
}';
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
$html .= 'setTimeout("checkStatus()", 5000);';
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
return $html;
|
137 |
}
|
138 |
|
25 |
* @property Adyen B.V
|
26 |
* @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
|
27 |
*/
|
28 |
+
class Adyen_Payment_Block_Redirect extends Mage_Core_Block_Abstract {
|
29 |
|
30 |
protected function _getCheckout() {
|
31 |
return Mage::getSingleton('checkout/session');
|
42 |
}
|
43 |
|
44 |
protected function _toHtml() {
|
45 |
+
|
46 |
+
$paymentObject = $this->_getOrder()->getPayment();
|
47 |
+
$payment = $this->_getOrder()->getPayment()->getMethodInstance();
|
48 |
+
|
49 |
+
$html = '<html><head><link rel="stylesheet" type="text/css" href="'.Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'/frontend/base/default/css/adyenstyle.css"><script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" ></script>';
|
50 |
+
|
51 |
+
// for cash add epson libary to open the cash drawer
|
52 |
+
$cashDrawer = Mage::helper('adyen')->_getConfigData("cash_drawer", "adyen_pos", null);
|
53 |
+
if($payment->getCode() == "adyen_hpp" && $paymentObject->getCcType() == "c_cash" && $cashDrawer) {
|
54 |
+
$jsPath = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);
|
55 |
+
$html .= '<script src="'.$jsPath.'adyen/payment/epos-device-2.6.0.js"></script>';
|
56 |
+
}
|
57 |
+
$html .= '</head><body class="redirect-body-adyen">';
|
58 |
+
|
59 |
+
|
60 |
+
// if pos payment redirect to app
|
61 |
+
if($payment->getCode() == "adyen_pos") {
|
62 |
+
|
63 |
+
$adyFields = $payment->getFormFields();
|
64 |
+
// use the secure url (if not secure this will be filled in with http://
|
65 |
+
$url = urlencode(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK, true)."adyen/process/successPos");
|
66 |
+
|
67 |
+
// detect ios or android
|
68 |
+
$ua = strtolower($_SERVER['HTTP_USER_AGENT']);
|
69 |
+
$android = stripos($ua,'android');
|
70 |
|
71 |
// extra parameters so that you alway's return these paramters from the application
|
72 |
$extra_paramaters = urlencode("/?originalCustomCurrency=".$adyFields['currencyCode']."&originalCustomAmount=".$adyFields['paymentAmount']. "&originalCustomMerchantReference=".$adyFields['merchantReference'] . "&originalCustomSessionId=".session_id());
|
90 |
// log the launchlink
|
91 |
Mage::log("Launchlink:".$launchlink, Zend_Log::DEBUG, "adyen_notification.log", true);
|
92 |
|
93 |
+
// call app directly without HPP
|
94 |
+
$html .= "<div id=\"pos-redirect-page\">
|
95 |
<div class=\"logo\"></div>
|
96 |
<div class=\"grey-header\">
|
97 |
<h1>POS Payment</h1>
|
98 |
</div>
|
99 |
<div class=\"amount-box\">".
|
100 |
+
$adyFields['paymentAmountGrandTotal'] .
|
101 |
+
"<a id=\"launchlink\" href=\"".$launchlink ."\" >Payment</a> ".
|
102 |
+
"</div>";
|
103 |
|
104 |
+
$html .= '<script type="text/javascript">
|
105 |
|
106 |
function checkStatus() {
|
107 |
$.ajax({
|
118 |
}
|
119 |
});
|
120 |
}';
|
121 |
+
|
122 |
+
if($android !== false) {
|
123 |
+
$html .= 'url = document.getElementById(\'launchlink\').href;';
|
124 |
+
$html .= 'window.location.assign(url);';
|
125 |
+
$html .= 'window.onfocus = function(){setTimeout("checkStatus()", 500);};';
|
126 |
+
} else {
|
127 |
+
$html .= 'document.getElementById(\'launchlink\').click();';
|
128 |
$html .= 'setTimeout("checkStatus()", 5000);';
|
129 |
+
}
|
130 |
+
$html .= '</script></div>';
|
131 |
+
} else {
|
132 |
+
$form = new Varien_Data_Form();
|
133 |
+
$form->setAction($payment->getFormUrl())
|
134 |
+
->setId($payment->getCode())
|
135 |
+
->setName($payment->getFormName())
|
136 |
+
->setMethod('POST')
|
137 |
+
->setUseContainer(true);
|
138 |
+
foreach ($payment->getFormFields() as $field => $value) {
|
139 |
+
$form->addField($field, 'hidden', array('name' => $field, 'value' => $value));
|
140 |
+
}
|
141 |
+
|
142 |
+
$html.= $this->__(' ');
|
143 |
+
$html.= $form->toHtml();
|
144 |
+
|
145 |
+
if($payment->getCode() == "adyen_hpp" && $paymentObject->getCcType() == "c_cash" && $cashDrawer) {
|
146 |
+
$cashDrawerIp = Mage::helper('adyen')->_getConfigData("cash_drawer_printer_ip", "adyen_pos", null);
|
147 |
+
$cashDrawerPort = Mage::helper('adyen')->_getConfigData("cash_drawer_printer_port", "adyen_pos", null);
|
148 |
+
$cashDrawerDeviceId = Mage::helper('adyen')->_getConfigData("cash_drawer_printer_device_id", "adyen_pos", null);
|
149 |
+
|
150 |
+
if($cashDrawerIp != '' && $cashDrawerPort != '' && $cashDrawerDeviceId != '') {
|
151 |
+
$html.= '
|
152 |
+
<script type="text/javascript">
|
153 |
+
var ipAddress = "'.$cashDrawerIp.'";
|
154 |
+
var port = "'.$cashDrawerPort.'";
|
155 |
+
var deviceID = "'.$cashDrawerDeviceId.'";
|
156 |
+
var ePosDev = new epson.ePOSDevice();
|
157 |
+
ePosDev.connect(ipAddress, port, Callback_connect);
|
158 |
+
|
159 |
+
function Callback_connect(data) {
|
160 |
+
if (data == "OK" || data == "SSL_CONNECT_OK") {
|
161 |
+
var options = "{}";
|
162 |
+
ePosDev.createDevice(deviceID, ePosDev.DEVICE_TYPE_PRINTER, options, callbackCreateDevice_printer);
|
163 |
+
} else {
|
164 |
+
alert("connected to ePOS Device Service Interface is failed. [" + data + "]");
|
165 |
+
}
|
166 |
+
}
|
167 |
+
|
168 |
+
function callbackCreateDevice_printer(data, code) {
|
169 |
+
var print = data;
|
170 |
+
var drawer = "{}";
|
171 |
+
var time = print.PULSE_100
|
172 |
+
print.addPulse();
|
173 |
+
print.send();
|
174 |
+
document.getElementById("'.$payment->getCode().'").submit();
|
175 |
+
}
|
176 |
+
</script>
|
177 |
+
';
|
178 |
+
} else {
|
179 |
+
Mage::log("You did not fill in all the fields (ip,port,device id) to use Cash Drawer support:", Zend_Log::DEBUG, "adyen_notification.log", true);
|
180 |
+
}
|
181 |
+
} else {
|
182 |
+
$html.= '<script type="text/javascript">document.getElementById("'.$payment->getCode().'").submit();</script>';
|
183 |
+
}
|
184 |
+
}
|
185 |
+
$html.= '</body></html>';
|
186 |
return $html;
|
187 |
}
|
188 |
|
@@ -75,7 +75,10 @@ class Adyen_Payment_Helper_Data extends Mage_Payment_Helper_Data {
|
|
75 |
}
|
76 |
|
77 |
public function hasEnableScanner() {
|
78 |
-
|
|
|
|
|
|
|
79 |
}
|
80 |
|
81 |
public function hasAutoSubmitScanner() {
|
@@ -83,11 +86,17 @@ class Adyen_Payment_Helper_Data extends Mage_Payment_Helper_Data {
|
|
83 |
}
|
84 |
|
85 |
public function hasExpressCheckout() {
|
86 |
-
|
|
|
|
|
|
|
87 |
}
|
88 |
|
89 |
public function hasCashExpressCheckout() {
|
90 |
-
|
|
|
|
|
|
|
91 |
}
|
92 |
|
93 |
public function getOrderStatus() {
|
@@ -165,13 +174,14 @@ class Adyen_Payment_Helper_Data extends Mage_Payment_Helper_Data {
|
|
165 |
public function getMagentoCreditCartType($ccType) {
|
166 |
|
167 |
$ccTypesMapper = array("amex" => "AE",
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
|
|
175 |
);
|
176 |
|
177 |
if(isset($ccTypesMapper[$ccType])) {
|
@@ -236,8 +246,6 @@ class Adyen_Payment_Helper_Data extends Mage_Payment_Helper_Data {
|
|
236 |
// convert to array
|
237 |
parse_str($result,$result);
|
238 |
|
239 |
-
Mage::log("List recurring result is: " . curl_error($ch), self::DEBUG_LEVEL, 'http-request.log',true);
|
240 |
-
|
241 |
foreach($result as $key => $value) {
|
242 |
// strip the key
|
243 |
$key = str_replace("recurringDetailsResult_details_", "", $key);
|
@@ -331,9 +339,9 @@ class Adyen_Payment_Helper_Data extends Mage_Payment_Helper_Data {
|
|
331 |
|
332 |
public function getConfigDataWsPassword($storeId = null) {
|
333 |
if ($this->getConfigDataDemoMode($storeId)) {
|
334 |
-
return $this->_getConfigData('ws_password_test', null, $storeId);
|
335 |
}
|
336 |
-
return $this->_getConfigData('ws_password_live', null, $storeId);
|
337 |
}
|
338 |
|
339 |
/**
|
@@ -352,4 +360,38 @@ class Adyen_Payment_Helper_Data extends Mage_Payment_Helper_Data {
|
|
352 |
return Mage::getStoreConfig("payment/$paymentMethodCode/$code", $storeId);
|
353 |
}
|
354 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
355 |
}
|
75 |
}
|
76 |
|
77 |
public function hasEnableScanner() {
|
78 |
+
if(Mage::getStoreConfig('payment/adyen_pos/active')) {
|
79 |
+
return (int) Mage::getStoreConfig('payment/adyen_pos/enable_scanner');
|
80 |
+
}
|
81 |
+
return false;
|
82 |
}
|
83 |
|
84 |
public function hasAutoSubmitScanner() {
|
86 |
}
|
87 |
|
88 |
public function hasExpressCheckout() {
|
89 |
+
if(Mage::getStoreConfig('payment/adyen_pos/active')) {
|
90 |
+
return (int) Mage::getStoreConfig('payment/adyen_pos/express_checkout');
|
91 |
+
}
|
92 |
+
return false;
|
93 |
}
|
94 |
|
95 |
public function hasCashExpressCheckout() {
|
96 |
+
if(Mage::getStoreConfig('payment/adyen_pos/active')) {
|
97 |
+
return (int) Mage::getStoreConfig('payment/adyen_pos/cash_express_checkout');
|
98 |
+
}
|
99 |
+
return false;
|
100 |
}
|
101 |
|
102 |
public function getOrderStatus() {
|
174 |
public function getMagentoCreditCartType($ccType) {
|
175 |
|
176 |
$ccTypesMapper = array("amex" => "AE",
|
177 |
+
"visa" => "VI",
|
178 |
+
"mastercard" => "MC",
|
179 |
+
"discover" => "DI",
|
180 |
+
"diners" => "DC",
|
181 |
+
"maestro" => "SM",
|
182 |
+
"jcb" => "JCB",
|
183 |
+
"elo" => "ELO",
|
184 |
+
"hipercard" => "hipercard"
|
185 |
);
|
186 |
|
187 |
if(isset($ccTypesMapper[$ccType])) {
|
246 |
// convert to array
|
247 |
parse_str($result,$result);
|
248 |
|
|
|
|
|
249 |
foreach($result as $key => $value) {
|
250 |
// strip the key
|
251 |
$key = str_replace("recurringDetailsResult_details_", "", $key);
|
339 |
|
340 |
public function getConfigDataWsPassword($storeId = null) {
|
341 |
if ($this->getConfigDataDemoMode($storeId)) {
|
342 |
+
return Mage::helper('core')->decrypt($this->_getConfigData('ws_password_test', null, $storeId));
|
343 |
}
|
344 |
+
return Mage::helper('core')->decrypt($this->_getConfigData('ws_password_live', null, $storeId));
|
345 |
}
|
346 |
|
347 |
/**
|
360 |
return Mage::getStoreConfig("payment/$paymentMethodCode/$code", $storeId);
|
361 |
}
|
362 |
|
363 |
+
// Function to get the client ip address
|
364 |
+
public function getClientIp() {
|
365 |
+
$ipaddress = '';
|
366 |
+
|
367 |
+
if (isset($_SERVER['HTTP_CLIENT_IP'])) {
|
368 |
+
$ipaddress = $_SERVER['HTTP_CLIENT_IP'];
|
369 |
+
} else if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
370 |
+
$ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
371 |
+
} else if(isset($_SERVER['HTTP_X_FORWARDED'])) {
|
372 |
+
$ipaddress = $_SERVER['HTTP_X_FORWARDED'];
|
373 |
+
}else if(isset($_SERVER['HTTP_FORWARDED_FOR'])) {
|
374 |
+
$ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];
|
375 |
+
} else if(isset($_SERVER['HTTP_FORWARDED'])) {
|
376 |
+
$ipaddress = $_SERVER['HTTP_FORWARDED'];
|
377 |
+
} else if(isset($_SERVER['REMOTE_ADDR'])) {
|
378 |
+
$ipaddress = $_SERVER['REMOTE_ADDR'];
|
379 |
+
} else {
|
380 |
+
$ipaddress = '';
|
381 |
+
}
|
382 |
+
|
383 |
+
return $ipaddress;
|
384 |
+
}
|
385 |
+
|
386 |
+
public function ipInRange($ip, $from, $to) {
|
387 |
+
$ip = ip2long($ip);
|
388 |
+
$lowIp = ip2long($from);
|
389 |
+
$highIp = ip2long($to);
|
390 |
+
|
391 |
+
if ($ip <= $highIp && $lowIp <= $ip) {
|
392 |
+
return true;
|
393 |
+
}
|
394 |
+
return false;
|
395 |
+
}
|
396 |
+
|
397 |
}
|
@@ -1,6 +1,7 @@
|
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
-
*
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
@@ -12,16 +13,17 @@
|
|
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 |
-
*
|
16 |
-
*
|
17 |
-
*
|
18 |
-
*
|
19 |
-
|
20 |
-
|
21 |
-
* @category
|
22 |
-
* @package
|
23 |
-
* @
|
24 |
-
* @
|
|
|
25 |
*/
|
26 |
|
27 |
/**
|
@@ -189,7 +191,7 @@ class Adyen_Payment_Helper_Installments
|
|
189 |
$currency = $quote->getQuoteCurrencyCode();
|
190 |
|
191 |
if($quote->isVirtual()) {
|
192 |
-
$address = $
|
193 |
} else {
|
194 |
$address = $quote->getShippingAddress();
|
195 |
}
|
1 |
<?php
|
2 |
+
|
3 |
/**
|
4 |
+
* Adyen Payment Module
|
5 |
*
|
6 |
* NOTICE OF LICENSE
|
7 |
*
|
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 |
/**
|
191 |
$currency = $quote->getQuoteCurrencyCode();
|
192 |
|
193 |
if($quote->isVirtual()) {
|
194 |
+
$address = $quote->getBillingAddress();
|
195 |
} else {
|
196 |
$address = $quote->getShippingAddress();
|
197 |
}
|
@@ -92,7 +92,7 @@ abstract class Adyen_Payment_Model_Adyen_Abstract extends Mage_Payment_Model_Met
|
|
92 |
$grandTotal = $order->getGrandTotal();
|
93 |
|
94 |
if($grandTotal == $amount) {
|
95 |
-
$order->getPayment()->getMethodInstance()->SendCancelOrRefund($payment,
|
96 |
} else {
|
97 |
$order->getPayment()->getMethodInstance()->sendRefundRequest($payment, $amount, $pspReference);
|
98 |
}
|
@@ -124,6 +124,12 @@ abstract class Adyen_Payment_Model_Adyen_Abstract extends Mage_Payment_Model_Met
|
|
124 |
$payment->setStatus(self::STATUS_APPROVED)
|
125 |
->setTransactionId($this->getTransactionId())
|
126 |
->setIsTransactionClosed(0);
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
return $this;
|
128 |
}
|
129 |
|
@@ -151,7 +157,7 @@ abstract class Adyen_Payment_Model_Adyen_Abstract extends Mage_Payment_Model_Met
|
|
151 |
return $this->_processRequest($payment, $amount, "refund", $pspReference);
|
152 |
}
|
153 |
|
154 |
-
public function SendCancelOrRefund(Varien_Object $payment, $
|
155 |
if (empty($pspReference)) {
|
156 |
$this->writeLog('oops empty pspReference');
|
157 |
return $this;
|
@@ -255,6 +261,8 @@ abstract class Adyen_Payment_Model_Adyen_Abstract extends Mage_Payment_Model_Met
|
|
255 |
switch ($request) {
|
256 |
case "authorise":
|
257 |
case "authorise3d":
|
|
|
|
|
258 |
$responseCode = $response->paymentResult->resultCode;
|
259 |
$pspReference = $response->paymentResult->pspReference;
|
260 |
break;
|
@@ -612,34 +620,4 @@ abstract class Adyen_Payment_Model_Adyen_Abstract extends Mage_Payment_Model_Met
|
|
612 |
return Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE;
|
613 |
}
|
614 |
|
615 |
-
/**
|
616 |
-
* @todo deprecates these use $this->_getConfigData($code,'paymentCode')
|
617 |
-
* @desc No reason of doing this!!!
|
618 |
-
*/
|
619 |
-
public function getConfigDataMerchantAccount() {
|
620 |
-
return $this->_getConfigData('merchantAccount');
|
621 |
-
}
|
622 |
-
|
623 |
-
public function getConfigDataPaymentAuthorizedStatus() {
|
624 |
-
return $this->_getConfigData('payment_authorized');
|
625 |
-
}
|
626 |
-
|
627 |
-
public function getConfigDataMailAuthorizedUpdate() {
|
628 |
-
return $this->_getConfigData('mail_authorized');
|
629 |
-
}
|
630 |
-
|
631 |
-
public function getConfigDataCancelPendingCron() {
|
632 |
-
return $this->_getConfigData('cancel_pending_cron');
|
633 |
-
}
|
634 |
-
|
635 |
-
public function getConfigDataHppSecretTest() {
|
636 |
-
die("getConfigDataHppSecretTest in Adyen_Payment_Model_Adyen_Abstract");
|
637 |
-
return $this->_getConfigData('secret_wordt');
|
638 |
-
}
|
639 |
-
|
640 |
-
public function getConfigDataHppSecretLive() {
|
641 |
-
die("getConfigDataHppSecretLive in Adyen_Payment_Model_Adyen_Abstract");
|
642 |
-
return $this->_getConfigData('secret_wordp');
|
643 |
-
}
|
644 |
-
|
645 |
}
|
92 |
$grandTotal = $order->getGrandTotal();
|
93 |
|
94 |
if($grandTotal == $amount) {
|
95 |
+
$order->getPayment()->getMethodInstance()->SendCancelOrRefund($payment, $pspReference);
|
96 |
} else {
|
97 |
$order->getPayment()->getMethodInstance()->sendRefundRequest($payment, $amount, $pspReference);
|
98 |
}
|
124 |
$payment->setStatus(self::STATUS_APPROVED)
|
125 |
->setTransactionId($this->getTransactionId())
|
126 |
->setIsTransactionClosed(0);
|
127 |
+
|
128 |
+
// do capture request to adyen
|
129 |
+
$order = $payment->getOrder();
|
130 |
+
$pspReference = Mage::getModel('adyen/event')->getOriginalPspReference($order->getIncrementId());
|
131 |
+
$order->getPayment()->getMethodInstance()->sendCaptureRequest($payment, $amount, $pspReference);
|
132 |
+
|
133 |
return $this;
|
134 |
}
|
135 |
|
157 |
return $this->_processRequest($payment, $amount, "refund", $pspReference);
|
158 |
}
|
159 |
|
160 |
+
public function SendCancelOrRefund(Varien_Object $payment, $pspReference) {
|
161 |
if (empty($pspReference)) {
|
162 |
$this->writeLog('oops empty pspReference');
|
163 |
return $this;
|
261 |
switch ($request) {
|
262 |
case "authorise":
|
263 |
case "authorise3d":
|
264 |
+
$fraudResult = $response->paymentResult->fraudResult->accountScore;
|
265 |
+
$payment->setAdyenTotalFraudScore($fraudResult);
|
266 |
$responseCode = $response->paymentResult->resultCode;
|
267 |
$pspReference = $response->paymentResult->pspReference;
|
268 |
break;
|
620 |
return Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE;
|
621 |
}
|
622 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
623 |
}
|
@@ -31,6 +31,24 @@ class Adyen_Payment_Model_Adyen_Boleto extends Adyen_Payment_Model_Adyen_Abstrac
|
|
31 |
protected $_formBlockType = 'adyen/form_boleto';
|
32 |
protected $_infoBlockType = 'adyen/info_boleto';
|
33 |
protected $_paymentMethod = 'boleto';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
/**
|
36 |
* 1)Called everytime the adyen_boleto is called or used in checkout
|
@@ -75,4 +93,7 @@ class Adyen_Payment_Model_Adyen_Boleto extends Adyen_Payment_Model_Adyen_Abstrac
|
|
75 |
parent::prepareSave();
|
76 |
}
|
77 |
|
|
|
|
|
|
|
78 |
}
|
31 |
protected $_formBlockType = 'adyen/form_boleto';
|
32 |
protected $_infoBlockType = 'adyen/info_boleto';
|
33 |
protected $_paymentMethod = 'boleto';
|
34 |
+
protected $_canUseCheckout = true;
|
35 |
+
protected $_canUseInternal = true;
|
36 |
+
|
37 |
+
public function __construct()
|
38 |
+
{
|
39 |
+
$visible = Mage::getStoreConfig("payment/adyen_boleto/visible_type");
|
40 |
+
if($visible == "backend") {
|
41 |
+
$this->_canUseCheckout = false;
|
42 |
+
$this->_canUseInternal = true;
|
43 |
+
} else if($visible == "frontend") {
|
44 |
+
$this->_canUseCheckout = true;
|
45 |
+
$this->_canUseInternal = false;
|
46 |
+
} else {
|
47 |
+
$this->_canUseCheckout = true;
|
48 |
+
$this->_canUseInternal = true;
|
49 |
+
}
|
50 |
+
parent::__construct();
|
51 |
+
}
|
52 |
|
53 |
/**
|
54 |
* 1)Called everytime the adyen_boleto is called or used in checkout
|
93 |
parent::prepareSave();
|
94 |
}
|
95 |
|
96 |
+
public function getUseTaxvat() {
|
97 |
+
return $this->_getConfigData('use_taxvat', 'adyen_boleto');
|
98 |
+
}
|
99 |
}
|
@@ -31,6 +31,27 @@ 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
|
@@ -115,6 +136,17 @@ class Adyen_Payment_Model_Adyen_Cc extends Adyen_Payment_Model_Adyen_Abstract {
|
|
115 |
}
|
116 |
|
117 |
public function getCsePublicKey() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
return trim(Mage::getStoreConfig("payment/adyen_cc/cse_publickey"));
|
119 |
}
|
120 |
|
@@ -161,5 +193,5 @@ class Adyen_Payment_Model_Adyen_Cc extends Adyen_Payment_Model_Adyen_Abstract {
|
|
161 |
|
162 |
return $adyFields;
|
163 |
}
|
164 |
-
|
165 |
}
|
31 |
protected $_formBlockType = 'adyen/form_cc';
|
32 |
protected $_infoBlockType = 'adyen/info_cc';
|
33 |
protected $_paymentMethod = 'cc';
|
34 |
+
protected $_canUseCheckout = true;
|
35 |
+
protected $_canUseInternal = true;
|
36 |
+
|
37 |
+
public function __construct()
|
38 |
+
{
|
39 |
+
// check if this is adyen_cc payment method because this function is as well used for oneclick payments
|
40 |
+
if($this->getCode() == "adyen_cc") {
|
41 |
+
$visible = Mage::getStoreConfig("payment/adyen_cc/visible_type");
|
42 |
+
if($visible == "backend") {
|
43 |
+
$this->_canUseCheckout = false;
|
44 |
+
$this->_canUseInternal = true;
|
45 |
+
} else if($visible == "frontend") {
|
46 |
+
$this->_canUseCheckout = true;
|
47 |
+
$this->_canUseInternal = false;
|
48 |
+
} else {
|
49 |
+
$this->_canUseCheckout = true;
|
50 |
+
$this->_canUseInternal = true;
|
51 |
+
}
|
52 |
+
}
|
53 |
+
parent::__construct();
|
54 |
+
}
|
55 |
|
56 |
/**
|
57 |
* 1)Called everytime the adyen_cc is called or used in checkout
|
136 |
}
|
137 |
|
138 |
public function getCsePublicKey() {
|
139 |
+
|
140 |
+
if (Mage::app()->getStore()->isAdmin()) {
|
141 |
+
$quote = Mage::getSingleton('adminhtml/session_quote')->getQuote();
|
142 |
+
$storeId = $quote->getStoreId();
|
143 |
+
} else {
|
144 |
+
$storeId = null;
|
145 |
+
}
|
146 |
+
|
147 |
+
if (Mage::helper('adyen')->getConfigDataDemoMode($storeId)) {
|
148 |
+
return trim(Mage::getStoreConfig("payment/adyen_cc/cse_publickey_test"));
|
149 |
+
}
|
150 |
return trim(Mage::getStoreConfig("payment/adyen_cc/cse_publickey"));
|
151 |
}
|
152 |
|
193 |
|
194 |
return $adyFields;
|
195 |
}
|
196 |
+
|
197 |
}
|
@@ -1,64 +0,0 @@
|
|
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_IdealPaymentRequest extends Adyen_Payment_Model_Adyen_Data_Abstract {
|
29 |
-
public $entranceCode;
|
30 |
-
public $issuerId;
|
31 |
-
public $language;
|
32 |
-
public $merchantReturnUrl;
|
33 |
-
|
34 |
-
public function __construct() {
|
35 |
-
$this->amount = new Adyen_Payment_Model_Adyen_Data_Amount();
|
36 |
-
}
|
37 |
-
|
38 |
-
public function create(Varien_Object $payment, $amount, $order, $paymentMethod = null, $merchantAccount = null) {
|
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();
|
51 |
-
$this->shopperEmail = $customerEmail;
|
52 |
-
$this->shopperIP = $order->getRemoteIp();
|
53 |
-
$this->shopperReference = $customerId;
|
54 |
-
|
55 |
-
//IDEAL
|
56 |
-
$this->entranceCode = $order->getQuoteId();
|
57 |
-
$id = explode(DS, $payment->getInfoInstance()->getPoNumber());
|
58 |
-
$this->issuerId = $id[0];
|
59 |
-
$this->language = 'nl';
|
60 |
-
$this->merchantReturnUrl = Mage::app()->getStore()->getBaseUrl().'checkout/onepage/success';
|
61 |
-
|
62 |
-
return $this;
|
63 |
-
}
|
64 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -31,6 +31,24 @@ class Adyen_Payment_Model_Adyen_Elv extends Adyen_Payment_Model_Adyen_Abstract {
|
|
31 |
protected $_formBlockType = 'adyen/form_elv';
|
32 |
protected $_infoBlockType = 'adyen/info_elv';
|
33 |
protected $_paymentMethod = 'elv';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
/**
|
36 |
* 1)Called everytime the adyen_elv is called or used in checkout
|
31 |
protected $_formBlockType = 'adyen/form_elv';
|
32 |
protected $_infoBlockType = 'adyen/info_elv';
|
33 |
protected $_paymentMethod = 'elv';
|
34 |
+
protected $_canUseCheckout = true;
|
35 |
+
protected $_canUseInternal = true;
|
36 |
+
|
37 |
+
public function __construct()
|
38 |
+
{
|
39 |
+
$visible = Mage::getStoreConfig("payment/adyen_elv/visible_type");
|
40 |
+
if($visible == "backend") {
|
41 |
+
$this->_canUseCheckout = false;
|
42 |
+
$this->_canUseInternal = true;
|
43 |
+
} else if($visible == "frontend") {
|
44 |
+
$this->_canUseCheckout = true;
|
45 |
+
$this->_canUseInternal = false;
|
46 |
+
} else {
|
47 |
+
$this->_canUseCheckout = true;
|
48 |
+
$this->_canUseInternal = true;
|
49 |
+
}
|
50 |
+
parent::__construct();
|
51 |
+
}
|
52 |
|
53 |
/**
|
54 |
* 1)Called everytime the adyen_elv is called or used in checkout
|
@@ -42,7 +42,7 @@ class Adyen_Payment_Model_Adyen_Hpp extends Adyen_Payment_Model_Adyen_Abstract {
|
|
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 |
*
|
@@ -73,6 +73,22 @@ class Adyen_Payment_Model_Adyen_Hpp extends Adyen_Payment_Model_Adyen_Abstract {
|
|
73 |
return $this;
|
74 |
}
|
75 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
/**
|
77 |
* @desc Called just after asssign data
|
78 |
*/
|
@@ -125,7 +141,7 @@ class Adyen_Payment_Model_Adyen_Hpp extends Adyen_Payment_Model_Adyen_Abstract {
|
|
125 |
|
126 |
$adyFields = array();
|
127 |
$deliveryDays = (int) $this->_getConfigData('delivery_days', 'adyen_hpp');
|
128 |
-
$deliveryDays = (!empty($deliveryDays)) ? $deliveryDays :
|
129 |
$adyFields['merchantAccount'] = $merchantAccount;
|
130 |
$adyFields['merchantReference'] = $realOrderId;
|
131 |
$adyFields['paymentAmount'] = (int)$amount;
|
@@ -155,7 +171,7 @@ class Adyen_Payment_Model_Adyen_Hpp extends Adyen_Payment_Model_Adyen_Abstract {
|
|
155 |
$adyFields['sessionValidity'] = date(DATE_ATOM, mktime(date("H") + 1, date("i"), date("s"), date("m"), date("j"), date("Y")));
|
156 |
$adyFields['shopperEmail'] = $shopperEmail;
|
157 |
|
158 |
-
// recurring
|
159 |
$recurringType = trim($this->_getConfigData('recurringtypes', 'adyen_abstract'));
|
160 |
$adyFields['recurringContract'] = $recurringType;
|
161 |
$adyFields['shopperReference'] = (!empty($customerId)) ? $customerId : self::GUEST_ID . $realOrderId;
|
@@ -163,6 +179,13 @@ class Adyen_Payment_Model_Adyen_Hpp extends Adyen_Payment_Model_Adyen_Abstract {
|
|
163 |
//blocked methods
|
164 |
$adyFields['blockedMethods'] = "";
|
165 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
$openinvoiceType = $this->_getConfigData('openinvoicetypes', 'adyen_openinvoice');
|
167 |
|
168 |
if($this->_code == "adyen_openinvoice" || $this->getInfoInstance()->getCcType() == "klarna" || $this->getInfoInstance()->getCcType() == "afterpay_default") {
|
@@ -175,7 +198,7 @@ class Adyen_Payment_Model_Adyen_Hpp extends Adyen_Payment_Model_Adyen_Abstract {
|
|
175 |
$adyFields['shopperType'] = "";
|
176 |
}
|
177 |
|
178 |
-
//the data that needs to be signed is a concatenated string of the form data
|
179 |
$sign = $adyFields['paymentAmount'] .
|
180 |
$adyFields['currencyCode'] .
|
181 |
$adyFields['shipBeforeDate'] .
|
@@ -187,6 +210,7 @@ class Adyen_Payment_Model_Adyen_Hpp extends Adyen_Payment_Model_Adyen_Abstract {
|
|
187 |
$adyFields['shopperReference'] .
|
188 |
$adyFields['recurringContract'] .
|
189 |
$adyFields['blockedMethods'] .
|
|
|
190 |
$adyFields['billingAddressType'] .
|
191 |
$adyFields['deliveryAddressType'] .
|
192 |
$adyFields['shopperType'];
|
@@ -300,21 +324,12 @@ class Adyen_Payment_Model_Adyen_Hpp extends Adyen_Payment_Model_Adyen_Abstract {
|
|
300 |
return $this->_redirectBlockType;
|
301 |
}
|
302 |
|
303 |
-
public function isInitializeNeeded() {
|
304 |
-
return true;
|
305 |
-
}
|
306 |
-
|
307 |
public function initialize($paymentAction, $stateObject) {
|
308 |
$state = Mage_Sales_Model_Order::STATE_NEW;
|
309 |
$stateObject->setState($state);
|
310 |
$stateObject->setStatus($this->_getConfigData('order_status'));
|
311 |
}
|
312 |
|
313 |
-
public function getConfigPaymentAction() {
|
314 |
-
return true;
|
315 |
-
}
|
316 |
-
|
317 |
-
|
318 |
public function getAvailableHPPTypes() {
|
319 |
|
320 |
$orderCurrencyCode = Mage::helper('checkout/cart')->getQuote()->getQuoteCurrencyCode();
|
@@ -335,7 +350,7 @@ class Adyen_Payment_Model_Adyen_Hpp extends Adyen_Payment_Model_Adyen_Abstract {
|
|
335 |
} else {
|
336 |
$countryCode = ""; // don't set countryCode so you get all the payment methods
|
337 |
// You could do ip lookup but availability and performace is not guaranteed
|
338 |
-
// $ip =
|
339 |
// $countryCode = file_get_contents('http://api.hostip.info/country.php?ip='.$ip);
|
340 |
}
|
341 |
}
|
@@ -409,8 +424,9 @@ class Adyen_Payment_Model_Adyen_Hpp extends Adyen_Payment_Model_Adyen_Abstract {
|
|
409 |
|
410 |
if($results_json == null) {
|
411 |
// no valid json so show the error
|
412 |
-
Mage::log("Payment methods are empty on this merchantaccount
|
413 |
-
|
|
|
414 |
}
|
415 |
|
416 |
$payment_methods = $results_json->paymentMethods;
|
@@ -452,28 +468,7 @@ class Adyen_Payment_Model_Adyen_Hpp extends Adyen_Payment_Model_Adyen_Abstract {
|
|
452 |
return Mage::getStoreConfig("payment/adyen_hpp/disable_hpptypes");
|
453 |
}
|
454 |
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
$ipaddress = '';
|
459 |
-
|
460 |
-
if (isset($_SERVER['HTTP_CLIENT_IP']))
|
461 |
-
$ipaddress = $_SERVER['HTTP_CLIENT_IP'];
|
462 |
-
else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))
|
463 |
-
$ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
464 |
-
else if(isset($_SERVER['HTTP_X_FORWARDED']))
|
465 |
-
$ipaddress = $_SERVER['HTTP_X_FORWARDED'];
|
466 |
-
else if(isset($_SERVER['HTTP_FORWARDED_FOR']))
|
467 |
-
$ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];
|
468 |
-
else if(isset($_SERVER['HTTP_FORWARDED']))
|
469 |
-
$ipaddress = $_SERVER['HTTP_FORWARDED'];
|
470 |
-
else if(isset($_SERVER['REMOTE_ADDR']))
|
471 |
-
$ipaddress = $_SERVER['REMOTE_ADDR'];
|
472 |
-
else
|
473 |
-
$ipaddress = '';
|
474 |
-
|
475 |
-
return $ipaddress;
|
476 |
}
|
477 |
-
|
478 |
-
|
479 |
}
|
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 |
+
protected $_isInitializeNeeded = true;
|
46 |
/**
|
47 |
* @desc Get checkout session namespace
|
48 |
*
|
73 |
return $this;
|
74 |
}
|
75 |
|
76 |
+
public function validate()
|
77 |
+
{
|
78 |
+
parent::validate();
|
79 |
+
|
80 |
+
$info = $this->getInfoInstance();
|
81 |
+
$hppType = $info->getCcType();
|
82 |
+
|
83 |
+
// validate if the ideal bank is chosen
|
84 |
+
if($hppType == "ideal") {
|
85 |
+
if($info->getPoNumber() == "") {
|
86 |
+
// hpp type is empty throw error
|
87 |
+
Mage::throwException(Mage::helper('adyen')->__('You chose an invalid bank'));
|
88 |
+
}
|
89 |
+
}
|
90 |
+
}
|
91 |
+
|
92 |
/**
|
93 |
* @desc Called just after asssign data
|
94 |
*/
|
141 |
|
142 |
$adyFields = array();
|
143 |
$deliveryDays = (int) $this->_getConfigData('delivery_days', 'adyen_hpp');
|
144 |
+
$deliveryDays = (!empty($deliveryDays)) ? $deliveryDays : 5;
|
145 |
$adyFields['merchantAccount'] = $merchantAccount;
|
146 |
$adyFields['merchantReference'] = $realOrderId;
|
147 |
$adyFields['paymentAmount'] = (int)$amount;
|
171 |
$adyFields['sessionValidity'] = date(DATE_ATOM, mktime(date("H") + 1, date("i"), date("s"), date("m"), date("j"), date("Y")));
|
172 |
$adyFields['shopperEmail'] = $shopperEmail;
|
173 |
|
174 |
+
// recurring
|
175 |
$recurringType = trim($this->_getConfigData('recurringtypes', 'adyen_abstract'));
|
176 |
$adyFields['recurringContract'] = $recurringType;
|
177 |
$adyFields['shopperReference'] = (!empty($customerId)) ? $customerId : self::GUEST_ID . $realOrderId;
|
179 |
//blocked methods
|
180 |
$adyFields['blockedMethods'] = "";
|
181 |
|
182 |
+
/*
|
183 |
+
* This feld will be appended as-is to the return URL when the shopper completes, or abandons, the payment and
|
184 |
+
* returns to your shop; it is typically used to transmit a session ID. This feld has a maximum of 128 characters
|
185 |
+
* This is an optional field and not necessary by default
|
186 |
+
*/
|
187 |
+
$adyFields['merchantReturnData'] = "";
|
188 |
+
|
189 |
$openinvoiceType = $this->_getConfigData('openinvoicetypes', 'adyen_openinvoice');
|
190 |
|
191 |
if($this->_code == "adyen_openinvoice" || $this->getInfoInstance()->getCcType() == "klarna" || $this->getInfoInstance()->getCcType() == "afterpay_default") {
|
198 |
$adyFields['shopperType'] = "";
|
199 |
}
|
200 |
|
201 |
+
//the data that needs to be signed is a concatenated string of the form data
|
202 |
$sign = $adyFields['paymentAmount'] .
|
203 |
$adyFields['currencyCode'] .
|
204 |
$adyFields['shipBeforeDate'] .
|
210 |
$adyFields['shopperReference'] .
|
211 |
$adyFields['recurringContract'] .
|
212 |
$adyFields['blockedMethods'] .
|
213 |
+
$adyFields['merchantReturnData'] .
|
214 |
$adyFields['billingAddressType'] .
|
215 |
$adyFields['deliveryAddressType'] .
|
216 |
$adyFields['shopperType'];
|
324 |
return $this->_redirectBlockType;
|
325 |
}
|
326 |
|
|
|
|
|
|
|
|
|
327 |
public function initialize($paymentAction, $stateObject) {
|
328 |
$state = Mage_Sales_Model_Order::STATE_NEW;
|
329 |
$stateObject->setState($state);
|
330 |
$stateObject->setStatus($this->_getConfigData('order_status'));
|
331 |
}
|
332 |
|
|
|
|
|
|
|
|
|
|
|
333 |
public function getAvailableHPPTypes() {
|
334 |
|
335 |
$orderCurrencyCode = Mage::helper('checkout/cart')->getQuote()->getQuoteCurrencyCode();
|
350 |
} else {
|
351 |
$countryCode = ""; // don't set countryCode so you get all the payment methods
|
352 |
// You could do ip lookup but availability and performace is not guaranteed
|
353 |
+
// $ip = Mage::helper('adyen')->getClientIp();
|
354 |
// $countryCode = file_get_contents('http://api.hostip.info/country.php?ip='.$ip);
|
355 |
}
|
356 |
}
|
424 |
|
425 |
if($results_json == null) {
|
426 |
// no valid json so show the error
|
427 |
+
Mage::log("Payment methods are empty on this merchantaccount with the selected skin,hmac,amount,country check if these settings are correct results_json result is:" . $results, self::DEBUG_LEVEL, 'http-request.log',true);
|
428 |
+
// return empty array
|
429 |
+
return array();
|
430 |
}
|
431 |
|
432 |
$payment_methods = $results_json->paymentMethods;
|
468 |
return Mage::getStoreConfig("payment/adyen_hpp/disable_hpptypes");
|
469 |
}
|
470 |
|
471 |
+
public function getShowIdealLogos() {
|
472 |
+
return $this->_getConfigData('show_ideal_logos', 'adyen_hpp');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
473 |
}
|
|
|
|
|
474 |
}
|
@@ -1,93 +0,0 @@
|
|
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_Ideal extends Adyen_Payment_Model_Adyen_Abstract {
|
29 |
-
|
30 |
-
/**
|
31 |
-
* @desc soap urls
|
32 |
-
* @return string
|
33 |
-
*/
|
34 |
-
protected function _getAdyenUrls() {
|
35 |
-
$test = array(
|
36 |
-
'location' => "https://pal-test.adyen.com/pal/servlet/soap/Ideal",
|
37 |
-
'wsdl' => "https://pal-test.adyen.com/pal/servlet/soap/Ideal?wsdl",
|
38 |
-
);
|
39 |
-
$live = array(
|
40 |
-
'location' => "https://pal-live.adyen.com/pal/servlet/soap/Ideal",
|
41 |
-
'wsdl' => "https://pal-live.adyen.com/pal/servlet/soap/Ideal?wsdl"
|
42 |
-
);
|
43 |
-
if ($this->getConfigDataDemoMode()) {
|
44 |
-
return $test;
|
45 |
-
} else {
|
46 |
-
return $live;
|
47 |
-
}
|
48 |
-
}
|
49 |
-
|
50 |
-
public function retrieveIdealIssuerList() {
|
51 |
-
$this->_initService();
|
52 |
-
$response = $this->_service->retrieveIdealIssuerList();
|
53 |
-
//debug || log
|
54 |
-
Mage::getResourceModel('adyen/adyen_debug')->assignData($response);
|
55 |
-
$this->_debugAdyen();
|
56 |
-
Mage::log($response, self::DEBUG_LEVEL, "adyen_ideal.log", true);
|
57 |
-
|
58 |
-
return $response;
|
59 |
-
}
|
60 |
-
|
61 |
-
|
62 |
-
/**
|
63 |
-
* Process beginIdealPayment {initiate ideal session}.If fail fall back to normal hpp page
|
64 |
-
* @param type $payment
|
65 |
-
* @param type $order
|
66 |
-
* @return boolean
|
67 |
-
*/
|
68 |
-
public function beginIdealPayment($payment, $order) {
|
69 |
-
try {
|
70 |
-
$this->_initService();
|
71 |
-
$merchantAccount = trim($this->_getConfigData('merchantAccount'));
|
72 |
-
$requestData = Mage::getModel('adyen/adyen_data_idealPaymentRequest')
|
73 |
-
->create($payment, $order->getGrandTotal(), $order, $payment, $merchantAccount);
|
74 |
-
$response = $this->_service->beginIdealPayment(array('request' => $requestData));
|
75 |
-
|
76 |
-
//debug || log
|
77 |
-
Mage::getResourceModel('adyen/adyen_debug')->assignData($response);
|
78 |
-
$this->_debugAdyen();
|
79 |
-
Mage::log($requestData, self::DEBUG_LEVEL, "adyen_ideal.log", true);
|
80 |
-
Mage::log($response, self::DEBUG_LEVEL, "adyen_ideal.log", true);
|
81 |
-
|
82 |
-
if ($response) {
|
83 |
-
return (string) $response->beginIdealPaymentResponse->response->returnUrl;
|
84 |
-
}
|
85 |
-
} catch (SoapFault $fault) {
|
86 |
-
$this->writeLog("Adyen SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})");
|
87 |
-
Mage::logException($fault);
|
88 |
-
$this->_debugAdyen();
|
89 |
-
}
|
90 |
-
return false;
|
91 |
-
}
|
92 |
-
|
93 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -27,7 +27,7 @@
|
|
27 |
*/
|
28 |
class Adyen_Payment_Model_Adyen_Openinvoice extends Adyen_Payment_Model_Adyen_Hpp {
|
29 |
|
30 |
-
|
31 |
protected $_code = 'adyen_openinvoice';
|
32 |
protected $_formBlockType = 'adyen/form_openinvoice';
|
33 |
protected $_infoBlockType = 'adyen/info_openinvoice';
|
@@ -62,7 +62,7 @@ class Adyen_Payment_Model_Adyen_Openinvoice extends Adyen_Payment_Model_Adyen_Hp
|
|
62 |
return false;
|
63 |
}
|
64 |
}
|
65 |
-
return
|
66 |
}
|
67 |
|
68 |
public function assignData($data) {
|
@@ -76,8 +76,9 @@ class Adyen_Payment_Model_Adyen_Openinvoice extends Adyen_Payment_Model_Adyen_Hp
|
|
76 |
// check if option gender or date of birth is enabled
|
77 |
$genderShow = $this->genderShow();
|
78 |
$dobShow = $this->dobShow();
|
|
|
79 |
|
80 |
-
if($genderShow || $dobShow) {
|
81 |
|
82 |
// set gender and dob to the quote
|
83 |
$quote = $this->getQuote();
|
@@ -94,6 +95,11 @@ class Adyen_Payment_Model_Adyen_Openinvoice extends Adyen_Payment_Model_Adyen_Hp
|
|
94 |
$info->setAdditionalInformation('customerGender', $data->getGender());
|
95 |
}
|
96 |
|
|
|
|
|
|
|
|
|
|
|
97 |
/* Check if the customer is logged in or not */
|
98 |
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
99 |
|
@@ -101,11 +107,20 @@ class Adyen_Payment_Model_Adyen_Openinvoice extends Adyen_Payment_Model_Adyen_Hp
|
|
101 |
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
102 |
|
103 |
// set the email and/or gender
|
104 |
-
if($dobShow)
|
105 |
$customer->setDob($dob);
|
|
|
106 |
|
107 |
-
if($genderShow)
|
108 |
$customer->setGender($data->getGender());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
|
110 |
// save changes into customer
|
111 |
$customer->save();
|
@@ -117,23 +132,23 @@ class Adyen_Payment_Model_Adyen_Openinvoice extends Adyen_Payment_Model_Adyen_Hp
|
|
117 |
|
118 |
/**
|
119 |
* @desc Get url of Adyen payment
|
120 |
-
* @return string
|
121 |
* @todo add brandCode here
|
122 |
*/
|
123 |
public function getFormUrl() {
|
124 |
-
|
125 |
-
|
126 |
|
127 |
switch ($this->getConfigDataDemoMode()) {
|
128 |
case true:
|
129 |
-
|
130 |
$url = 'https://test.adyen.com/hpp/pay.shtml';
|
131 |
} else {
|
132 |
$url = "https://test.adyen.com/hpp/details.shtml?brandCode=".$openinvoiceType;
|
133 |
}
|
134 |
break;
|
135 |
default:
|
136 |
-
|
137 |
$url = 'https://live.adyen.com/hpp/pay.shtml';
|
138 |
} else {
|
139 |
$url = "https://live.adyen.com/hpp/details.shtml?brandCode=".$openinvoiceType;
|
@@ -142,9 +157,9 @@ class Adyen_Payment_Model_Adyen_Openinvoice extends Adyen_Payment_Model_Adyen_Hp
|
|
142 |
}
|
143 |
return $url;
|
144 |
}
|
145 |
-
|
146 |
public function getFormName() {
|
147 |
-
|
148 |
}
|
149 |
|
150 |
/**
|
@@ -157,12 +172,12 @@ class Adyen_Payment_Model_Adyen_Openinvoice extends Adyen_Payment_Model_Adyen_Hp
|
|
157 |
$adyFields = $this->getOptionalFormFields($adyFields,$this->_order);
|
158 |
return $adyFields;
|
159 |
}
|
160 |
-
|
161 |
public function getOptionalFormFields($adyFields,$order) {
|
162 |
if (empty($order)) return $adyFields;
|
163 |
-
|
164 |
$secretWord = $this->_getSecretWord();
|
165 |
-
|
166 |
$billingAddress = $order->getBillingAddress();
|
167 |
$adyFields['shopper.firstName'] = $billingAddress->getFirstname();
|
168 |
$adyFields['shopper.lastName'] = $billingAddress->getLastname();
|
@@ -173,38 +188,38 @@ class Adyen_Payment_Model_Adyen_Openinvoice extends Adyen_Payment_Model_Adyen_Hp
|
|
173 |
$adyFields['billingAddress.stateOrProvince'] = $billingAddress->getRegion();
|
174 |
$adyFields['billingAddress.country'] = $billingAddress->getCountryId();
|
175 |
$sign = $adyFields['billingAddress.street'] .
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
;
|
182 |
//Generate HMAC encrypted merchant signature
|
183 |
$signMac = Zend_Crypt_Hmac::compute($secretWord, 'sha1', $sign);
|
184 |
$adyFields['billingAddressSig'] = base64_encode(pack('H*', $signMac));
|
185 |
|
186 |
-
|
187 |
$deliveryAddress = $order->getShippingAddress();
|
188 |
if($deliveryAddress != null)
|
189 |
{
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
|
209 |
|
210 |
if ($adyFields['shopperReference'] != (self::GUEST_ID . $order->getRealOrderId())) {
|
@@ -258,41 +273,41 @@ class Adyen_Payment_Model_Adyen_Openinvoice extends Adyen_Payment_Model_Adyen_Hp
|
|
258 |
// $adyFields['shopper.socialSecurityNumber'] = "Result of your custom input field";
|
259 |
|
260 |
$adyFields['shopper.telephoneNumber'] = $billingAddress->getTelephone();
|
261 |
-
|
262 |
$openinvoiceType = $this->_getConfigData('openinvoicetypes', 'adyen_openinvoice');
|
263 |
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
|
|
|
|
|
|
|
|
|
|
271 |
|
272 |
-
$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'];
|
273 |
-
$shopperSignMac = Zend_Crypt_Hmac::compute($secretWord, 'sha1', $shoppperSign);
|
274 |
-
$adyFields['shopperSig'] = base64_encode(pack('H*', $shopperSignMac));
|
275 |
-
}
|
276 |
-
|
277 |
|
278 |
$count = 0;
|
279 |
$currency = $order->getOrderCurrencyCode();
|
280 |
$additional_data_sign = array();
|
281 |
|
282 |
foreach ($order->getItemsCollection() as $item) {
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
$additional_data_sign['openinvoicedata.' . $linename . '.itemVatAmount'] = ($item->getTaxAmount() > 0 && $item->getPriceInclTax() > 0) ? Mage::helper('adyen')->formatAmount($item->getPriceInclTax(), $currency) - Mage::helper('adyen')->formatAmount($item->getPrice(), $currency):Mage::helper('adyen')->formatAmount($item->getTaxAmount(), $currency);
|
292 |
$additional_data_sign['openinvoicedata.' . $linename . '.numberOfItems'] = (int) $item->getQtyOrdered();
|
293 |
-
|
294 |
}
|
295 |
-
|
296 |
//discount cost
|
297 |
if($order->getDiscountAmount() > 0 || $order->getDiscountAmount() < 0)
|
298 |
{
|
@@ -303,8 +318,8 @@ class Adyen_Payment_Model_Adyen_Openinvoice extends Adyen_Payment_Model_Adyen_Hp
|
|
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 |
-
|
308 |
//shipping cost
|
309 |
if($order->getShippingAmount() > 0 || $order->getShippingTaxAmount() > 0)
|
310 |
{
|
@@ -326,7 +341,7 @@ class Adyen_Payment_Model_Adyen_Openinvoice extends Adyen_Payment_Model_Adyen_Hp
|
|
326 |
$additional_data_sign['openinvoicedata.' . $linename . '.numberOfItems'] = 1;
|
327 |
$additional_data_sign['openinvoicedata.' . $linename . '.vatCategory'] = "None";
|
328 |
}
|
329 |
-
|
330 |
// Klarna wants tax cost provided in the lines of the products so overal tax cost is not needed anymore
|
331 |
// $linename = "line".++$count;
|
332 |
// $additional_data_sign['openinvoicedata.' . $linename . '.currencyCode'] = $currency;
|
@@ -335,21 +350,21 @@ class Adyen_Payment_Model_Adyen_Openinvoice extends Adyen_Payment_Model_Adyen_Hp
|
|
335 |
// $additional_data_sign['openinvoicedata.' . $linename . '.itemVatAmount'] = "0";
|
336 |
// $additional_data_sign['openinvoicedata.' . $linename . '.numberOfItems'] = 1;
|
337 |
// $additional_data_sign['openinvoicedata.' . $linename . '.vatCategory'] = "None";
|
338 |
-
|
339 |
// general for invoicelines
|
340 |
$additional_data_sign['openinvoicedata.refundDescription'] = "Refund / Correction for ".$adyFields['merchantReference'];
|
341 |
$additional_data_sign['openinvoicedata.numberOfLines'] = $count;
|
342 |
-
|
343 |
// add merchantsignature in additional signature
|
344 |
$additional_data_sign['merchantSig'] = $adyFields['merchantSig'];
|
345 |
-
|
346 |
// generate signature
|
347 |
ksort($additional_data_sign);
|
348 |
|
349 |
// signature is first alphabatical keys seperate by : and then | and then the values seperate by :
|
350 |
foreach($additional_data_sign as $key => $value) {
|
351 |
-
|
352 |
-
|
353 |
}
|
354 |
|
355 |
$keys = implode(':',array_keys($additional_data_sign));
|
@@ -359,15 +374,15 @@ class Adyen_Payment_Model_Adyen_Openinvoice extends Adyen_Payment_Model_Adyen_Hp
|
|
359 |
$adyFields['openinvoicedata.sig'] = base64_encode(pack('H*', $signMac));
|
360 |
|
361 |
Mage::log($adyFields, self::DEBUG_LEVEL, 'http-request.log');
|
362 |
-
|
363 |
return $adyFields;
|
364 |
-
}
|
365 |
|
366 |
/**
|
367 |
* Get Attribute label
|
368 |
* @param type $customer
|
369 |
* @param type $code
|
370 |
-
* @return type
|
371 |
*/
|
372 |
public function getCustomerAttributeText($customer, $code='gender') {
|
373 |
$helper = Mage::helper('adyen');
|
@@ -387,21 +402,23 @@ class Adyen_Payment_Model_Adyen_Openinvoice extends Adyen_Payment_Model_Adyen_Hp
|
|
387 |
$timeStamp = new DateTime($date);
|
388 |
return $timeStamp->format($format);
|
389 |
}
|
390 |
-
|
391 |
-
/**
|
392 |
* Street format
|
393 |
* @param type $address
|
394 |
-
* @return Varien_Object
|
395 |
*/
|
396 |
public function getStreet($address) {
|
397 |
if (empty($address)) return false;
|
398 |
$street = self::formatStreet($address->getStreet());
|
399 |
$streetName = $street['0'];
|
400 |
unset($street['0']);
|
401 |
-
$streetNr = implode('',$street);
|
|
|
|
|
402 |
return new Varien_Object(array('name' => $streetName, 'house_number' => $streetNr));
|
403 |
}
|
404 |
-
|
405 |
/**
|
406 |
* Fix this one string street + number
|
407 |
* @example street + number
|
@@ -411,13 +428,13 @@ class Adyen_Payment_Model_Adyen_Openinvoice extends Adyen_Payment_Model_Adyen_Hp
|
|
411 |
static public function formatStreet($street) {
|
412 |
if (count($street) != 1) {
|
413 |
return $street;
|
414 |
-
}
|
415 |
preg_match('/((\s\d{0,10})|(\s\d{0,10}\w{1,3}))$/i', $street['0'], $houseNumber, PREG_OFFSET_CAPTURE);
|
416 |
if(!empty($houseNumber['0'])) {
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
}
|
422 |
return $street;
|
423 |
}
|
@@ -429,4 +446,8 @@ class Adyen_Payment_Model_Adyen_Openinvoice extends Adyen_Payment_Model_Adyen_Hp
|
|
429 |
public function dobShow() {
|
430 |
return $this->_getConfigData('dob_show', 'adyen_openinvoice');
|
431 |
}
|
|
|
|
|
|
|
|
|
432 |
}
|
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';
|
62 |
return false;
|
63 |
}
|
64 |
}
|
65 |
+
return parent::isApplicableToQuote($quote, $checksBitMask);
|
66 |
}
|
67 |
|
68 |
public function assignData($data) {
|
76 |
// check if option gender or date of birth is enabled
|
77 |
$genderShow = $this->genderShow();
|
78 |
$dobShow = $this->dobShow();
|
79 |
+
$telephoneShow = $this->telephoneShow();
|
80 |
|
81 |
+
if($genderShow || $dobShow || $telephoneShow) {
|
82 |
|
83 |
// set gender and dob to the quote
|
84 |
$quote = $this->getQuote();
|
95 |
$info->setAdditionalInformation('customerGender', $data->getGender());
|
96 |
}
|
97 |
|
98 |
+
if($telephoneShow) {
|
99 |
+
$telephone = $data->getTelephone();
|
100 |
+
$quote->getBillingAddress()->setTelephone($data->getTelephone());
|
101 |
+
}
|
102 |
+
|
103 |
/* Check if the customer is logged in or not */
|
104 |
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
105 |
|
107 |
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
108 |
|
109 |
// set the email and/or gender
|
110 |
+
if($dobShow) {
|
111 |
$customer->setDob($dob);
|
112 |
+
}
|
113 |
|
114 |
+
if($genderShow) {
|
115 |
$customer->setGender($data->getGender());
|
116 |
+
}
|
117 |
+
|
118 |
+
if($telephoneShow) {
|
119 |
+
$billingAddress = $customer->getPrimaryBillingAddress();
|
120 |
+
if($billingAddress) {
|
121 |
+
$billingAddress->setTelephone($data->getTelephone());
|
122 |
+
}
|
123 |
+
}
|
124 |
|
125 |
// save changes into customer
|
126 |
$customer->save();
|
132 |
|
133 |
/**
|
134 |
* @desc Get url of Adyen payment
|
135 |
+
* @return string
|
136 |
* @todo add brandCode here
|
137 |
*/
|
138 |
public function getFormUrl() {
|
139 |
+
$paymentRoutine = $this->_getConfigData('payment_routines', 'adyen_hpp');
|
140 |
+
$openinvoiceType = $this->_getConfigData('openinvoicetypes', 'adyen_openinvoice');
|
141 |
|
142 |
switch ($this->getConfigDataDemoMode()) {
|
143 |
case true:
|
144 |
+
if ($paymentRoutine == 'single' && empty($openinvoiceType)) {
|
145 |
$url = 'https://test.adyen.com/hpp/pay.shtml';
|
146 |
} else {
|
147 |
$url = "https://test.adyen.com/hpp/details.shtml?brandCode=".$openinvoiceType;
|
148 |
}
|
149 |
break;
|
150 |
default:
|
151 |
+
if ($paymentRoutine == 'single' && empty($openinvoiceType)) {
|
152 |
$url = 'https://live.adyen.com/hpp/pay.shtml';
|
153 |
} else {
|
154 |
$url = "https://live.adyen.com/hpp/details.shtml?brandCode=".$openinvoiceType;
|
157 |
}
|
158 |
return $url;
|
159 |
}
|
160 |
+
|
161 |
public function getFormName() {
|
162 |
+
return "Adyen HPP";
|
163 |
}
|
164 |
|
165 |
/**
|
172 |
$adyFields = $this->getOptionalFormFields($adyFields,$this->_order);
|
173 |
return $adyFields;
|
174 |
}
|
175 |
+
|
176 |
public function getOptionalFormFields($adyFields,$order) {
|
177 |
if (empty($order)) return $adyFields;
|
178 |
+
|
179 |
$secretWord = $this->_getSecretWord();
|
180 |
+
|
181 |
$billingAddress = $order->getBillingAddress();
|
182 |
$adyFields['shopper.firstName'] = $billingAddress->getFirstname();
|
183 |
$adyFields['shopper.lastName'] = $billingAddress->getLastname();
|
188 |
$adyFields['billingAddress.stateOrProvince'] = $billingAddress->getRegion();
|
189 |
$adyFields['billingAddress.country'] = $billingAddress->getCountryId();
|
190 |
$sign = $adyFields['billingAddress.street'] .
|
191 |
+
$adyFields['billingAddress.houseNumberOrName'] .
|
192 |
+
$adyFields['billingAddress.city'] .
|
193 |
+
$adyFields['billingAddress.postalCode'] .
|
194 |
+
$adyFields['billingAddress.stateOrProvince'] .
|
195 |
+
$adyFields['billingAddress.country']
|
196 |
;
|
197 |
//Generate HMAC encrypted merchant signature
|
198 |
$signMac = Zend_Crypt_Hmac::compute($secretWord, 'sha1', $sign);
|
199 |
$adyFields['billingAddressSig'] = base64_encode(pack('H*', $signMac));
|
200 |
|
201 |
+
|
202 |
$deliveryAddress = $order->getShippingAddress();
|
203 |
if($deliveryAddress != null)
|
204 |
{
|
205 |
+
$adyFields['deliveryAddress.street'] = $this->getStreet($deliveryAddress)->getName();
|
206 |
+
$adyFields['deliveryAddress.houseNumberOrName'] = $this->getStreet($deliveryAddress)->getHouseNumber();
|
207 |
+
$adyFields['deliveryAddress.city'] = $deliveryAddress->getCity();
|
208 |
+
$adyFields['deliveryAddress.postalCode'] = $deliveryAddress->getPostcode();
|
209 |
+
$adyFields['deliveryAddress.stateOrProvince'] = $deliveryAddress->getRegion();
|
210 |
+
$adyFields['deliveryAddress.country'] = $deliveryAddress->getCountryId();
|
211 |
+
$sign = $adyFields['deliveryAddress.street'] .
|
212 |
+
$adyFields['deliveryAddress.houseNumberOrName'] .
|
213 |
+
$adyFields['deliveryAddress.city'] .
|
214 |
+
$adyFields['deliveryAddress.postalCode'] .
|
215 |
+
$adyFields['deliveryAddress.stateOrProvince'] .
|
216 |
+
$adyFields['deliveryAddress.country']
|
217 |
+
;
|
218 |
+
//Generate HMAC encrypted merchant signature
|
219 |
+
$secretWord = $this->_getSecretWord();
|
220 |
+
$signMac = Zend_Crypt_Hmac::compute($secretWord, 'sha1', $sign);
|
221 |
+
$adyFields['deliveryAddressSig'] = base64_encode(pack('H*', $signMac));
|
222 |
+
}
|
223 |
|
224 |
|
225 |
if ($adyFields['shopperReference'] != (self::GUEST_ID . $order->getRealOrderId())) {
|
273 |
// $adyFields['shopper.socialSecurityNumber'] = "Result of your custom input field";
|
274 |
|
275 |
$adyFields['shopper.telephoneNumber'] = $billingAddress->getTelephone();
|
276 |
+
|
277 |
$openinvoiceType = $this->_getConfigData('openinvoicetypes', 'adyen_openinvoice');
|
278 |
|
279 |
+
if($this->_code == "adyen_openinvoice" || $this->getInfoInstance()->getCcType() == "klarna" || $this->getInfoInstance()->getCcType() == "afterpay_default" ) {
|
280 |
+
// initialize values if they are empty
|
281 |
+
$adyFields['shopper.gender'] = (isset($adyFields['shopper.gender'])) ? $adyFields['shopper.gender'] : "";
|
282 |
+
$adyFields['shopper.infix'] = (isset($adyFields['shopper.infix'])) ? $adyFields['shopper.infix'] : "";
|
283 |
+
$adyFields['shopper.dateOfBirthDayOfMonth'] = (isset($adyFields['shopper.dateOfBirthDayOfMonth'])) ? $adyFields['shopper.dateOfBirthDayOfMonth'] : "";
|
284 |
+
$adyFields['shopper.dateOfBirthMonth'] = (isset($adyFields['shopper.dateOfBirthMonth'])) ? $adyFields['shopper.dateOfBirthMonth'] : "";
|
285 |
+
$adyFields['shopper.dateOfBirthYear'] = (isset($adyFields['shopper.dateOfBirthYear'])) ? $adyFields['shopper.dateOfBirthYear'] : "";
|
286 |
+
|
287 |
+
$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'];
|
288 |
+
$shopperSignMac = Zend_Crypt_Hmac::compute($secretWord, 'sha1', $shoppperSign);
|
289 |
+
$adyFields['shopperSig'] = base64_encode(pack('H*', $shopperSignMac));
|
290 |
+
}
|
291 |
|
|
|
|
|
|
|
|
|
|
|
292 |
|
293 |
$count = 0;
|
294 |
$currency = $order->getOrderCurrencyCode();
|
295 |
$additional_data_sign = array();
|
296 |
|
297 |
foreach ($order->getItemsCollection() as $item) {
|
298 |
+
//skip dummies
|
299 |
+
if ($item->isDummy()) continue;
|
300 |
+
|
301 |
+
++$count;
|
302 |
+
$linename = "line".$count;
|
303 |
+
$additional_data_sign['openinvoicedata.' . $linename . '.currencyCode'] = $currency;
|
304 |
+
$additional_data_sign['openinvoicedata.' . $linename . '.description'] = $item->getName();
|
305 |
+
$additional_data_sign['openinvoicedata.' . $linename . '.itemAmount'] = Mage::helper('adyen')->formatAmount($item->getPrice(), $currency);
|
306 |
$additional_data_sign['openinvoicedata.' . $linename . '.itemVatAmount'] = ($item->getTaxAmount() > 0 && $item->getPriceInclTax() > 0) ? Mage::helper('adyen')->formatAmount($item->getPriceInclTax(), $currency) - Mage::helper('adyen')->formatAmount($item->getPrice(), $currency):Mage::helper('adyen')->formatAmount($item->getTaxAmount(), $currency);
|
307 |
$additional_data_sign['openinvoicedata.' . $linename . '.numberOfItems'] = (int) $item->getQtyOrdered();
|
308 |
+
$additional_data_sign['openinvoicedata.' . $linename . '.vatCategory'] = "None";
|
309 |
}
|
310 |
+
|
311 |
//discount cost
|
312 |
if($order->getDiscountAmount() > 0 || $order->getDiscountAmount() < 0)
|
313 |
{
|
318 |
$additional_data_sign['openinvoicedata.' . $linename . '.itemVatAmount'] = "0";
|
319 |
$additional_data_sign['openinvoicedata.' . $linename . '.numberOfItems'] = 1;
|
320 |
$additional_data_sign['openinvoicedata.' . $linename . '.vatCategory'] = "None";
|
321 |
+
}
|
322 |
+
|
323 |
//shipping cost
|
324 |
if($order->getShippingAmount() > 0 || $order->getShippingTaxAmount() > 0)
|
325 |
{
|
341 |
$additional_data_sign['openinvoicedata.' . $linename . '.numberOfItems'] = 1;
|
342 |
$additional_data_sign['openinvoicedata.' . $linename . '.vatCategory'] = "None";
|
343 |
}
|
344 |
+
|
345 |
// Klarna wants tax cost provided in the lines of the products so overal tax cost is not needed anymore
|
346 |
// $linename = "line".++$count;
|
347 |
// $additional_data_sign['openinvoicedata.' . $linename . '.currencyCode'] = $currency;
|
350 |
// $additional_data_sign['openinvoicedata.' . $linename . '.itemVatAmount'] = "0";
|
351 |
// $additional_data_sign['openinvoicedata.' . $linename . '.numberOfItems'] = 1;
|
352 |
// $additional_data_sign['openinvoicedata.' . $linename . '.vatCategory'] = "None";
|
353 |
+
|
354 |
// general for invoicelines
|
355 |
$additional_data_sign['openinvoicedata.refundDescription'] = "Refund / Correction for ".$adyFields['merchantReference'];
|
356 |
$additional_data_sign['openinvoicedata.numberOfLines'] = $count;
|
357 |
+
|
358 |
// add merchantsignature in additional signature
|
359 |
$additional_data_sign['merchantSig'] = $adyFields['merchantSig'];
|
360 |
+
|
361 |
// generate signature
|
362 |
ksort($additional_data_sign);
|
363 |
|
364 |
// signature is first alphabatical keys seperate by : and then | and then the values seperate by :
|
365 |
foreach($additional_data_sign as $key => $value) {
|
366 |
+
// add to fields
|
367 |
+
$adyFields[$key] = $value;
|
368 |
}
|
369 |
|
370 |
$keys = implode(':',array_keys($additional_data_sign));
|
374 |
$adyFields['openinvoicedata.sig'] = base64_encode(pack('H*', $signMac));
|
375 |
|
376 |
Mage::log($adyFields, self::DEBUG_LEVEL, 'http-request.log');
|
377 |
+
|
378 |
return $adyFields;
|
379 |
+
}
|
380 |
|
381 |
/**
|
382 |
* Get Attribute label
|
383 |
* @param type $customer
|
384 |
* @param type $code
|
385 |
+
* @return type
|
386 |
*/
|
387 |
public function getCustomerAttributeText($customer, $code='gender') {
|
388 |
$helper = Mage::helper('adyen');
|
402 |
$timeStamp = new DateTime($date);
|
403 |
return $timeStamp->format($format);
|
404 |
}
|
405 |
+
|
406 |
+
/**
|
407 |
* Street format
|
408 |
* @param type $address
|
409 |
+
* @return Varien_Object
|
410 |
*/
|
411 |
public function getStreet($address) {
|
412 |
if (empty($address)) return false;
|
413 |
$street = self::formatStreet($address->getStreet());
|
414 |
$streetName = $street['0'];
|
415 |
unset($street['0']);
|
416 |
+
// $streetNr = implode('',$street);
|
417 |
+
$streetNr = implode(' ',$street); // webprint aanpassing lijkt niet goed
|
418 |
+
|
419 |
return new Varien_Object(array('name' => $streetName, 'house_number' => $streetNr));
|
420 |
}
|
421 |
+
|
422 |
/**
|
423 |
* Fix this one string street + number
|
424 |
* @example street + number
|
428 |
static public function formatStreet($street) {
|
429 |
if (count($street) != 1) {
|
430 |
return $street;
|
431 |
+
}
|
432 |
preg_match('/((\s\d{0,10})|(\s\d{0,10}\w{1,3}))$/i', $street['0'], $houseNumber, PREG_OFFSET_CAPTURE);
|
433 |
if(!empty($houseNumber['0'])) {
|
434 |
+
$_houseNumber = trim($houseNumber['0']['0']);
|
435 |
+
$position = $houseNumber['0']['1'];
|
436 |
+
$streeName = trim(substr($street['0'], 0, $position));
|
437 |
+
$street = array($streeName,$_houseNumber);
|
438 |
}
|
439 |
return $street;
|
440 |
}
|
446 |
public function dobShow() {
|
447 |
return $this->_getConfigData('dob_show', 'adyen_openinvoice');
|
448 |
}
|
449 |
+
|
450 |
+
public function telephoneShow() {
|
451 |
+
return $this->_getConfigData('telephone_show', 'adyen_openinvoice');
|
452 |
+
}
|
453 |
}
|
@@ -32,12 +32,31 @@ class Adyen_Payment_Model_Adyen_Pos extends Adyen_Payment_Model_Adyen_Abstract {
|
|
32 |
protected $_formBlockType = 'adyen/form_pos';
|
33 |
protected $_infoBlockType = 'adyen/info_pos';
|
34 |
protected $_paymentMethod = 'pos';
|
|
|
35 |
|
36 |
/**
|
37 |
* @var GUEST_ID , used when order is placed by guests
|
38 |
*/
|
39 |
const GUEST_ID = 'customer_';
|
40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
/**
|
42 |
* @desc Get checkout session namespace
|
43 |
*
|
@@ -119,17 +138,9 @@ class Adyen_Payment_Model_Adyen_Pos extends Adyen_Payment_Model_Adyen_Abstract {
|
|
119 |
return $this->_redirectBlockType;
|
120 |
}
|
121 |
|
122 |
-
public function isInitializeNeeded() {
|
123 |
-
return true;
|
124 |
-
}
|
125 |
-
|
126 |
public function initialize($paymentAction, $stateObject) {
|
127 |
$state = Mage_Sales_Model_Order::STATE_NEW;
|
128 |
$stateObject->setState($state);
|
129 |
$stateObject->setStatus($this->_getConfigData('order_status'));
|
130 |
}
|
131 |
-
|
132 |
-
public function getConfigPaymentAction() {
|
133 |
-
return true;
|
134 |
-
}
|
135 |
}
|
32 |
protected $_formBlockType = 'adyen/form_pos';
|
33 |
protected $_infoBlockType = 'adyen/info_pos';
|
34 |
protected $_paymentMethod = 'pos';
|
35 |
+
protected $_isInitializeNeeded = true;
|
36 |
|
37 |
/**
|
38 |
* @var GUEST_ID , used when order is placed by guests
|
39 |
*/
|
40 |
const GUEST_ID = 'customer_';
|
41 |
|
42 |
+
/*
|
43 |
+
* only enable if adyen_cc is enabled
|
44 |
+
*/
|
45 |
+
public function isAvailable($quote = null)
|
46 |
+
{
|
47 |
+
$isAvailable = parent::isAvailable($quote);
|
48 |
+
// check if ip range is enabled
|
49 |
+
$ipFilter = $this->_getConfigData('ip_filter', 'adyen_pos');
|
50 |
+
if($isAvailable && $ipFilter) {
|
51 |
+
// check if ip is in range
|
52 |
+
$ip = Mage::helper('adyen')->getClientIp();
|
53 |
+
$from = $this->_getConfigData('ip_filter_from', 'adyen_pos');
|
54 |
+
$to = $this->_getConfigData('ip_filter_to', 'adyen_pos');
|
55 |
+
$isAvailable = Mage::helper('adyen')->ipInRange($ip, $from, $to);
|
56 |
+
}
|
57 |
+
return $isAvailable;
|
58 |
+
}
|
59 |
+
|
60 |
/**
|
61 |
* @desc Get checkout session namespace
|
62 |
*
|
138 |
return $this->_redirectBlockType;
|
139 |
}
|
140 |
|
|
|
|
|
|
|
|
|
141 |
public function initialize($paymentAction, $stateObject) {
|
142 |
$state = Mage_Sales_Model_Order::STATE_NEW;
|
143 |
$stateObject->setState($state);
|
144 |
$stateObject->setStatus($this->_getConfigData('order_status'));
|
145 |
}
|
|
|
|
|
|
|
|
|
146 |
}
|
@@ -31,6 +31,24 @@ class Adyen_Payment_Model_Adyen_Sepa extends Adyen_Payment_Model_Adyen_Abstract
|
|
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
|
31 |
protected $_formBlockType = 'adyen/form_sepa';
|
32 |
protected $_infoBlockType = 'adyen/info_sepa';
|
33 |
protected $_paymentMethod = 'sepa';
|
34 |
+
protected $_canUseCheckout = true;
|
35 |
+
protected $_canUseInternal = true;
|
36 |
+
|
37 |
+
public function __construct()
|
38 |
+
{
|
39 |
+
$visible = Mage::getStoreConfig("payment/adyen_sepa/visible_type");
|
40 |
+
if($visible == "backend") {
|
41 |
+
$this->_canUseCheckout = false;
|
42 |
+
$this->_canUseInternal = true;
|
43 |
+
} else if($visible == "frontend") {
|
44 |
+
$this->_canUseCheckout = true;
|
45 |
+
$this->_canUseInternal = false;
|
46 |
+
} else {
|
47 |
+
$this->_canUseCheckout = true;
|
48 |
+
$this->_canUseInternal = true;
|
49 |
+
}
|
50 |
+
parent::__construct();
|
51 |
+
}
|
52 |
|
53 |
/**
|
54 |
* 1)Called everytime the adyen_sepa is called or used in checkout
|
@@ -70,7 +70,11 @@ class Adyen_Payment_Model_Authenticate extends Mage_Core_Model_Abstract {
|
|
70 |
}else{
|
71 |
$secretWord = $this->_getConfigData('secret_wordp', 'adyen_hpp');
|
72 |
}
|
73 |
-
|
|
|
|
|
|
|
|
|
74 |
$signMac = Zend_Crypt_Hmac::compute($secretWord, 'sha1', $sign);
|
75 |
$localStringToHash = base64_encode(pack('H*', $signMac));
|
76 |
if (strcmp($localStringToHash, $response->getData('merchantSig')) === 0) {
|
@@ -89,18 +93,20 @@ class Adyen_Payment_Model_Authenticate extends Mage_Core_Model_Abstract {
|
|
89 |
$this->fixCgiHttpAuthentication(); //add cgi support
|
90 |
$internalMerchantAccount = $this->_getConfigData('merchantAccount');
|
91 |
$username = $this->_getConfigData('notification_username');
|
92 |
-
$password = $this->_getConfigData('notification_password');
|
93 |
$submitedMerchantAccount = $response->getData('merchantAccountCode');
|
94 |
|
95 |
if (empty($submitedMerchantAccount) && empty($internalMerchantAccount)) {
|
96 |
-
if(strtolower(substr($response->getData('pspReference'),0,17)) == "testnotification_") {
|
97 |
-
|
|
|
98 |
}
|
99 |
return false;
|
100 |
}
|
101 |
if (!isset($_SERVER['PHP_AUTH_USER']) && !isset($_SERVER['PHP_AUTH_PW'])) {
|
102 |
-
if(strtolower(substr($response->getData('pspReference'),0,17)) == "testnotification_") {
|
103 |
-
|
|
|
104 |
}
|
105 |
return false;
|
106 |
}
|
@@ -112,11 +118,13 @@ class Adyen_Payment_Model_Authenticate extends Mage_Core_Model_Abstract {
|
|
112 |
}
|
113 |
|
114 |
// If notification is test check if fields are correct if not return error
|
115 |
-
if(strtolower(substr($response->getData('pspReference'),0,17)) == "testnotification_") {
|
116 |
if($accountCmp != 0) {
|
117 |
-
|
|
|
118 |
} elseif($usernameCmp != 0 || $passwordCmp != 0) {
|
119 |
-
|
|
|
120 |
}
|
121 |
}
|
122 |
|
@@ -127,14 +135,10 @@ class Adyen_Payment_Model_Authenticate extends Mage_Core_Model_Abstract {
|
|
127 |
* Fix these global variables for the CGI
|
128 |
*/
|
129 |
public function fixCgiHttpAuthentication() { // unsupported is $_SERVER['REMOTE_AUTHORIZATION']: as stated in manual :p
|
130 |
-
|
131 |
-
|
132 |
-
if (isset($_SERVER['REDIRECT_REMOTE_AUTHORIZATION']) && $_SERVER['REDIRECT_REMOTE_AUTHORIZATION'] != '') { //pcd note: no idea who sets this
|
133 |
list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', base64_decode($_SERVER['REDIRECT_REMOTE_AUTHORIZATION']));
|
134 |
-
/* TODO: added pcd */
|
135 |
} elseif(!empty($_SERVER['HTTP_AUTHORIZATION'])){ //pcd note: standard in magento?
|
136 |
list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6)));
|
137 |
-
/* end added pcd */
|
138 |
} elseif (!empty($_SERVER['REMOTE_USER'])) { //pcd note: when cgi and .htaccess modrewrite patch is executed
|
139 |
list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', base64_decode(substr($_SERVER['REMOTE_USER'], 6)));
|
140 |
} elseif (!empty($_SERVER['REDIRECT_REMOTE_USER'])) { //pcd note: no idea who sets this
|
@@ -149,13 +153,7 @@ class Adyen_Payment_Model_Authenticate extends Mage_Core_Model_Abstract {
|
|
149 |
* @param string $code
|
150 |
*/
|
151 |
protected function _getConfigData($code, $paymentMethodCode = null, $storeId = null) {
|
152 |
-
|
153 |
-
$storeId = Mage::app()->getStore()->getId();
|
154 |
-
}
|
155 |
-
if (empty($paymentMethodCode)) {
|
156 |
-
return Mage::getStoreConfig("payment/adyen_abstract/$code", $storeId);
|
157 |
-
}
|
158 |
-
return Mage::getStoreConfig("payment/$paymentMethodCode/$code", $storeId);
|
159 |
}
|
160 |
|
161 |
}
|
70 |
}else{
|
71 |
$secretWord = $this->_getConfigData('secret_wordp', 'adyen_hpp');
|
72 |
}
|
73 |
+
|
74 |
+
$sign = $response->getData('authResult') . $response->getData('pspReference') .
|
75 |
+
$response->getData('merchantReference') . $response->getData('skinCode') .
|
76 |
+
$response->getData('merchantReturnData');
|
77 |
+
|
78 |
$signMac = Zend_Crypt_Hmac::compute($secretWord, 'sha1', $sign);
|
79 |
$localStringToHash = base64_encode(pack('H*', $signMac));
|
80 |
if (strcmp($localStringToHash, $response->getData('merchantSig')) === 0) {
|
93 |
$this->fixCgiHttpAuthentication(); //add cgi support
|
94 |
$internalMerchantAccount = $this->_getConfigData('merchantAccount');
|
95 |
$username = $this->_getConfigData('notification_username');
|
96 |
+
$password = Mage::helper('core')->decrypt($this->_getConfigData('notification_password'));
|
97 |
$submitedMerchantAccount = $response->getData('merchantAccountCode');
|
98 |
|
99 |
if (empty($submitedMerchantAccount) && empty($internalMerchantAccount)) {
|
100 |
+
if(strtolower(substr($response->getData('pspReference'),0,17)) == "testnotification_" || strtolower(substr($response->getData('pspReference'),0,5)) == "test_") {
|
101 |
+
Mage::log('Notification test failed: merchantAccountCode is empty in magento settings', Zend_Log::DEBUG, "adyen_notification.log", true);
|
102 |
+
echo 'merchantAccountCode is empty in magento settings'; exit();
|
103 |
}
|
104 |
return false;
|
105 |
}
|
106 |
if (!isset($_SERVER['PHP_AUTH_USER']) && !isset($_SERVER['PHP_AUTH_PW'])) {
|
107 |
+
if(strtolower(substr($response->getData('pspReference'),0,17)) == "testnotification_" || strtolower(substr($response->getData('pspReference'),0,5)) == "test_") {
|
108 |
+
Mage::log('Authentication failed: PHP_AUTH_USER and PHP_AUTH_PW are empty. See Adyen Magento manual CGI mode', Zend_Log::DEBUG, "adyen_notification.log", true);
|
109 |
+
echo 'Authentication failed: PHP_AUTH_USER and PHP_AUTH_PW are empty. See Adyen Magento manual CGI mode'; exit();
|
110 |
}
|
111 |
return false;
|
112 |
}
|
118 |
}
|
119 |
|
120 |
// If notification is test check if fields are correct if not return error
|
121 |
+
if(strtolower(substr($response->getData('pspReference'),0,17)) == "testnotification_" || strtolower(substr($response->getData('pspReference'),0,5)) == "test_") {
|
122 |
if($accountCmp != 0) {
|
123 |
+
Mage::log('MerchantAccount in notification is not the same as in Magento settings', Zend_Log::DEBUG, "adyen_notification.log", true);
|
124 |
+
echo 'MerchantAccount in notification is not the same as in Magento settings'; exit();
|
125 |
} elseif($usernameCmp != 0 || $passwordCmp != 0) {
|
126 |
+
Mage::log('username (PHP_AUTH_USER) and\or password (PHP_AUTH_PW) are not the same as Magento settings', Zend_Log::DEBUG, "adyen_notification.log", true);
|
127 |
+
echo 'username (PHP_AUTH_USER) and\or password (PHP_AUTH_PW) are not the same as Magento settings'; exit();
|
128 |
}
|
129 |
}
|
130 |
|
135 |
* Fix these global variables for the CGI
|
136 |
*/
|
137 |
public function fixCgiHttpAuthentication() { // unsupported is $_SERVER['REMOTE_AUTHORIZATION']: as stated in manual :p
|
138 |
+
if (isset($_SERVER['REDIRECT_REMOTE_AUTHORIZATION']) && $_SERVER['REDIRECT_REMOTE_AUTHORIZATION'] != '') { //pcd note: no idea who sets this
|
|
|
|
|
139 |
list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', base64_decode($_SERVER['REDIRECT_REMOTE_AUTHORIZATION']));
|
|
|
140 |
} elseif(!empty($_SERVER['HTTP_AUTHORIZATION'])){ //pcd note: standard in magento?
|
141 |
list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6)));
|
|
|
142 |
} elseif (!empty($_SERVER['REMOTE_USER'])) { //pcd note: when cgi and .htaccess modrewrite patch is executed
|
143 |
list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', base64_decode(substr($_SERVER['REMOTE_USER'], 6)));
|
144 |
} elseif (!empty($_SERVER['REDIRECT_REMOTE_USER'])) { //pcd note: no idea who sets this
|
153 |
* @param string $code
|
154 |
*/
|
155 |
protected function _getConfigData($code, $paymentMethodCode = null, $storeId = null) {
|
156 |
+
return Mage::helper('adyen')->_getConfigData($code, $paymentMethodCode, $storeId);
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
}
|
158 |
|
159 |
}
|
@@ -34,12 +34,15 @@ 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_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_HANDLED_EXTERNALLY = 'HANDLED_EXTERNALLY';
|
|
|
|
|
43 |
|
44 |
/**
|
45 |
* Initialize resources
|
34 |
const ADYEN_EVENT_REFUSED = 'REFUSED';
|
35 |
const ADYEN_EVENT_ERROR = 'ERROR';
|
36 |
const ADYEN_EVENT_REFUND = 'REFUND';
|
37 |
+
const ADYEN_EVENT_REFUND_FAILED = 'REFUND_FAILED';
|
38 |
const ADYEN_EVENT_CANCEL_OR_REFUND = 'CANCEL_OR_REFUND';
|
39 |
const ADYEN_EVENT_CAPTURE = 'CAPTURE';
|
40 |
const ADYEN_EVENT_CAPTURE_FAILED = 'CAPTURE_FAILED';
|
41 |
const ADYEN_EVENT_CANCELLATION = 'CANCELLATION';
|
42 |
const ADYEN_EVENT_POSAPPROVED = 'POS_APPROVED';
|
43 |
const ADYEN_EVENT_HANDLED_EXTERNALLY = 'HANDLED_EXTERNALLY';
|
44 |
+
const ADYEN_EVENT_MANUAL_REVIEW_ACCEPT = 'MANUAL_REVIEW_ACCEPT';
|
45 |
+
const ADYEN_EVENT_MANUAL_REVIEW_REJECT = 'MANUAL_REVIEW_REJECT ';
|
46 |
|
47 |
/**
|
48 |
* Initialize resources
|
@@ -140,10 +140,9 @@ class Adyen_Payment_Model_Mysql4_Adyen_Event extends Mage_Core_Model_Mysql4_Abst
|
|
140 |
public function getAllDistinctEvents() {
|
141 |
$db = $this->_getReadAdapter();
|
142 |
$sql = $db->select()
|
143 |
-
|
144 |
-
|
145 |
-
;
|
146 |
-
return $db->fetchAll($sql);
|
147 |
}
|
148 |
|
149 |
}
|
140 |
public function getAllDistinctEvents() {
|
141 |
$db = $this->_getReadAdapter();
|
142 |
$sql = $db->select()
|
143 |
+
->from($this->getMainTable(), array('adyen_event_result'))
|
144 |
+
->group('adyen_event_result');
|
145 |
+
return $db->fetchAll($sql);
|
|
|
146 |
}
|
147 |
|
148 |
}
|
@@ -1,5 +1,30 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Adyen_Payment_Model_Mysql4_Adyen_Event_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
|
4 |
{
|
5 |
protected function _construct()
|
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_Mysql4_Adyen_Event_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
|
29 |
{
|
30 |
protected function _construct()
|
@@ -27,36 +27,15 @@
|
|
27 |
*/
|
28 |
class Adyen_Payment_Model_Observer {
|
29 |
|
30 |
-
/**
|
31 |
-
* @param Mage_Sales_Model_Order_Invoice $observer
|
32 |
-
* @desc online capture only
|
33 |
-
*/
|
34 |
-
public function capture(Varien_Event_Observer $observer) {
|
35 |
-
$event = $observer->getEvent();
|
36 |
-
$eventNameCmp = strcmp($event->getName(), 'sales_order_invoice_pay');
|
37 |
-
$onlineCmp = strcmp($event->getInvoice()->getData('requested_capture_case'), 'online');
|
38 |
-
if ($onlineCmp === 0 && $eventNameCmp === 0) {
|
39 |
-
$order = $event->getInvoice()->getOrder();
|
40 |
-
$isAdyen = $this->isPaymentMethodAdyen($order);
|
41 |
-
if (!$isAdyen)
|
42 |
-
return false;
|
43 |
-
$grandTotal = $event->getInvoice()->getGrandTotal();
|
44 |
-
$payment = $order->getPayment();
|
45 |
-
$pspReference = Mage::getModel('adyen/event')->getOriginalPspReference($order->getIncrementId());
|
46 |
-
$order->getPayment()->getMethodInstance()->sendCaptureRequest($payment, $grandTotal, $pspReference);
|
47 |
-
return true;
|
48 |
-
}
|
49 |
-
return false;
|
50 |
-
}
|
51 |
-
|
52 |
public function salesOrderPaymentCancel(Varien_Event_Observer $observer) {
|
53 |
// observer is payment object
|
54 |
$payment = $observer->getEvent()->getPayment();
|
55 |
-
|
56 |
$order = $payment->getOrder();
|
57 |
-
|
58 |
-
$
|
59 |
-
|
|
|
|
|
60 |
}
|
61 |
|
62 |
/**
|
@@ -67,5 +46,4 @@ class Adyen_Payment_Model_Observer {
|
|
67 |
public function isPaymentMethodAdyen($order) {
|
68 |
return ( strpos($order->getPayment()->getMethod(), 'adyen') !== false ) ? true : false;
|
69 |
}
|
70 |
-
|
71 |
}
|
27 |
*/
|
28 |
class Adyen_Payment_Model_Observer {
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
public function salesOrderPaymentCancel(Varien_Event_Observer $observer) {
|
31 |
// observer is payment object
|
32 |
$payment = $observer->getEvent()->getPayment();
|
|
|
33 |
$order = $payment->getOrder();
|
34 |
+
|
35 |
+
if($this->isPaymentMethodAdyen($order)) {
|
36 |
+
$pspReference = Mage::getModel('adyen/event')->getOriginalPspReference($order->getIncrementId());
|
37 |
+
$payment->getMethodInstance()->SendCancelOrRefund($payment, $pspReference);
|
38 |
+
}
|
39 |
}
|
40 |
|
41 |
/**
|
46 |
public function isPaymentMethodAdyen($order) {
|
47 |
return ( strpos($order->getPayment()->getMethod(), 'adyen') !== false ) ? true : false;
|
48 |
}
|
|
|
49 |
}
|
@@ -97,6 +97,10 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
|
|
97 |
}
|
98 |
}catch(Exception $e){
|
99 |
// do nothing
|
|
|
|
|
|
|
|
|
100 |
}
|
101 |
|
102 |
return $status;
|
@@ -108,6 +112,7 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
|
|
108 |
$helper = Mage::helper('adyen');
|
109 |
$response = $_REQUEST;
|
110 |
|
|
|
111 |
|
112 |
$varienObj = new Varien_Object();
|
113 |
foreach ($response as $code => $value) {
|
@@ -169,7 +174,7 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
|
|
169 |
$session_id_checksum = 0;
|
170 |
for($i=0;$i<strlen($session_id);$i++)
|
171 |
{
|
172 |
-
$checksum_calc =
|
173 |
$session_id_checksum += $checksum_calc;
|
174 |
}
|
175 |
|
@@ -226,6 +231,9 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
|
|
226 |
}
|
227 |
}
|
228 |
}
|
|
|
|
|
|
|
229 |
}
|
230 |
}
|
231 |
// close the window
|
@@ -242,6 +250,15 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
|
|
242 |
return $html;
|
243 |
}
|
244 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
245 |
public function processCashResponse()
|
246 |
{
|
247 |
$response = $_REQUEST;
|
@@ -394,10 +411,10 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
|
|
394 |
*/
|
395 |
protected function _addAdyenAttributes(Varien_Object $order, $response, $updateAdyenStatus = true) {
|
396 |
$klarnaReservationNumber = $response->getData('additionalData_additionalData_acquirerReference');
|
397 |
-
$ccLast4 = $response->getData('additionalData_cardSummary');
|
398 |
$avsResult = $response->getData('additionalData_avsResult');
|
399 |
$cvcResult = $response->getData('additionalData_cvcResult');
|
400 |
$boletoPaidAmount = $response->getData('additionalData_boletobancario_paidAmount');
|
|
|
401 |
$pspReference = $response->getData('pspReference');
|
402 |
$eventCode = $response->getData('eventCode');
|
403 |
$authResult = $response->getData('authResult');
|
@@ -408,6 +425,20 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
|
|
408 |
$paymentObj = $order->getPayment();
|
409 |
$_paymentCode = $this->_paymentMethodCode($order);
|
410 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
411 |
$paymentObj->setLastTransId($incrementId)
|
412 |
->setAdyenPaymentMethod($paymentMethod)
|
413 |
->setCcType($paymentMethod)
|
@@ -444,6 +475,9 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
|
|
444 |
if($boletoPaidAmount != "") {
|
445 |
$paymentObj->setAdyenBoletoPaidAmount($boletoPaidAmount);
|
446 |
}
|
|
|
|
|
|
|
447 |
}
|
448 |
|
449 |
try {
|
@@ -582,9 +616,12 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
|
|
582 |
$eventCode = trim($response->getData('eventCode'));
|
583 |
|
584 |
$success = (bool) trim($response->getData('success'));
|
585 |
-
$
|
586 |
$_paymentCode = $this->_paymentMethodCode($order);
|
587 |
switch ($eventCode) {
|
|
|
|
|
|
|
588 |
case Adyen_Payment_Model_Event::ADYEN_EVENT_REFUND:
|
589 |
|
590 |
$this->refundOrder($order, $response);
|
@@ -592,21 +629,33 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
|
|
592 |
$this->setRefundAuthorized($order, $success);
|
593 |
break;
|
594 |
case Adyen_Payment_Model_Event::ADYEN_EVENT_PENDING:
|
595 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
596 |
break;
|
597 |
case Adyen_Payment_Model_Event::ADYEN_EVENT_HANDLED_EXTERNALLY:
|
598 |
case Adyen_Payment_Model_Event::ADYEN_EVENT_AUTHORISATION:
|
599 |
// for POS don't do anything on the AUTHORIZATION
|
600 |
if($_paymentCode != "adyen_pos") {
|
601 |
-
$this->authorizePayment($order, $success, $
|
602 |
}
|
603 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
604 |
case Adyen_Payment_Model_Event::ADYEN_EVENT_CAPTURE:
|
605 |
if($_paymentCode != "adyen_pos") {
|
606 |
$this->setPaymentAuthorized($order, $success, $response);
|
607 |
} else {
|
608 |
// FOR POS authorize the payment on the CAPTURE notification
|
609 |
-
$this->authorizePayment($order, $success, $
|
610 |
}
|
611 |
break;
|
612 |
case Adyen_Payment_Model_Event::ADYEN_EVENT_CAPTURE_FAILED:
|
@@ -662,7 +711,7 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
|
|
662 |
$this->createInvoice($order, $response);
|
663 |
|
664 |
$_paymentCode = $this->_paymentMethodCode($order);
|
665 |
-
if($payment_method == "c_cash" || ($this->_getConfigData('
|
666 |
{
|
667 |
$this->createShipment($order);
|
668 |
}
|
@@ -677,6 +726,13 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
|
|
677 |
if ($success && !empty($order)) {
|
678 |
|
679 |
$status = $this->_getConfigData('payment_authorized');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
680 |
|
681 |
// check for boleto if payment is totally paid
|
682 |
if($order->getPayment()->getMethod() == "adyen_boleto") {
|
@@ -776,7 +832,7 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
|
|
776 |
return false;
|
777 |
}
|
778 |
//online capture after delivery, use Magento backend to online invoice
|
779 |
-
if (strcmp($paymentMethod, 'openinvoice') === 0) {
|
780 |
return false;
|
781 |
}
|
782 |
return true;
|
@@ -788,6 +844,7 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
|
|
788 |
} else {
|
789 |
$isBankTransfer = false;
|
790 |
}
|
|
|
791 |
}
|
792 |
|
793 |
/**
|
@@ -860,7 +917,6 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
|
|
860 |
$eventCode = trim($response->getData('eventCode'));
|
861 |
$reason = trim($response->getData('reason'));
|
862 |
$invoiceAutoMail = (bool) $this->_getConfigData('send_invoice_update_mail');
|
863 |
-
$_status = $this->_getConfigData('order_status');
|
864 |
$_mail = (bool) $this->_getConfigData('send_update_mail');
|
865 |
$value = trim($response->getData('value'));
|
866 |
|
@@ -883,7 +939,10 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
|
|
883 |
if ($order->canInvoice()) {
|
884 |
$invoice = $order->prepareInvoice();
|
885 |
$invoice->getOrder()->setIsInProcess(true);
|
886 |
-
|
|
|
|
|
|
|
887 |
try {
|
888 |
Mage::getModel('core/resource_transaction')
|
889 |
->addObject($invoice)
|
@@ -1103,13 +1162,7 @@ class Adyen_Payment_Model_Process extends Mage_Core_Model_Abstract {
|
|
1103 |
* @param string $code
|
1104 |
*/
|
1105 |
protected function _getConfigData($code, $paymentMethodCode = null, $storeId = null) {
|
1106 |
-
|
1107 |
-
$storeId = Mage::app()->getStore()->getId();
|
1108 |
-
}
|
1109 |
-
if (empty($paymentMethodCode)) {
|
1110 |
-
return Mage::getStoreConfig("payment/adyen_abstract/$code", $storeId);
|
1111 |
-
}
|
1112 |
-
return Mage::getStoreConfig("payment/$paymentMethodCode/$code", $storeId);
|
1113 |
}
|
1114 |
|
1115 |
public function getConfigData($code, $paymentMethodCode = null, $storeId = null) {
|
97 |
}
|
98 |
}catch(Exception $e){
|
99 |
// do nothing
|
100 |
+
// log error
|
101 |
+
Mage::logException($e);
|
102 |
+
Mage::log('NOTIFICATION RESPONSE failure!' . print_r($e, true), Zend_Log::DEBUG, "adyen_notification.log", true);
|
103 |
+
|
104 |
}
|
105 |
|
106 |
return $status;
|
112 |
$helper = Mage::helper('adyen');
|
113 |
$response = $_REQUEST;
|
114 |
|
115 |
+
Mage::log("PosResonse:".print_r($response, true), Zend_Log::DEBUG, "adyen_notification.log", true);
|
116 |
|
117 |
$varienObj = new Varien_Object();
|
118 |
foreach ($response as $code => $value) {
|
174 |
$session_id_checksum = 0;
|
175 |
for($i=0;$i<strlen($session_id);$i++)
|
176 |
{
|
177 |
+
$checksum_calc = $this->getAscii2Int($session_id[$i]);
|
178 |
$session_id_checksum += $checksum_calc;
|
179 |
}
|
180 |
|
231 |
}
|
232 |
}
|
233 |
}
|
234 |
+
} else {
|
235 |
+
$incrementId = $varienObj->getData('originalCustomMerchantReference');
|
236 |
+
Mage::log("Checksum failed for :".$incrementId, Zend_Log::DEBUG, "adyen_notification.log", true);
|
237 |
}
|
238 |
}
|
239 |
// close the window
|
250 |
return $html;
|
251 |
}
|
252 |
|
253 |
+
public function getAscii2Int($ascii){
|
254 |
+
if (is_numeric($ascii)){
|
255 |
+
$int = ord($ascii) - 48;
|
256 |
+
} else {
|
257 |
+
$int = ord($ascii) - 64;
|
258 |
+
}
|
259 |
+
return $int;
|
260 |
+
}
|
261 |
+
|
262 |
public function processCashResponse()
|
263 |
{
|
264 |
$response = $_REQUEST;
|
411 |
*/
|
412 |
protected function _addAdyenAttributes(Varien_Object $order, $response, $updateAdyenStatus = true) {
|
413 |
$klarnaReservationNumber = $response->getData('additionalData_additionalData_acquirerReference');
|
|
|
414 |
$avsResult = $response->getData('additionalData_avsResult');
|
415 |
$cvcResult = $response->getData('additionalData_cvcResult');
|
416 |
$boletoPaidAmount = $response->getData('additionalData_boletobancario_paidAmount');
|
417 |
+
$totalFraudScore = $response->getData('additionalData_totalFraudScore');
|
418 |
$pspReference = $response->getData('pspReference');
|
419 |
$eventCode = $response->getData('eventCode');
|
420 |
$authResult = $response->getData('authResult');
|
425 |
$paymentObj = $order->getPayment();
|
426 |
$_paymentCode = $this->_paymentMethodCode($order);
|
427 |
|
428 |
+
$ccLast4 = $response->getData('additionalData_cardSummary');
|
429 |
+
// if there is no server communication setup try to get last4 digits from reason field
|
430 |
+
if($ccLast4 == "") {
|
431 |
+
$reason = trim($response->getData('reason'));
|
432 |
+
if($reason != "") {
|
433 |
+
$reasonArray = explode(":", $reason);
|
434 |
+
if($reasonArray != null && is_array($reasonArray)) {
|
435 |
+
if(isset($reasonArray[1])) {
|
436 |
+
$ccLast4 = $reasonArray[1];
|
437 |
+
}
|
438 |
+
}
|
439 |
+
}
|
440 |
+
}
|
441 |
+
|
442 |
$paymentObj->setLastTransId($incrementId)
|
443 |
->setAdyenPaymentMethod($paymentMethod)
|
444 |
->setCcType($paymentMethod)
|
475 |
if($boletoPaidAmount != "") {
|
476 |
$paymentObj->setAdyenBoletoPaidAmount($boletoPaidAmount);
|
477 |
}
|
478 |
+
if($totalFraudScore != "") {
|
479 |
+
$paymentObj->setAdyenTotalFraudScore($totalFraudScore);
|
480 |
+
}
|
481 |
}
|
482 |
|
483 |
try {
|
616 |
$eventCode = trim($response->getData('eventCode'));
|
617 |
|
618 |
$success = (bool) trim($response->getData('success'));
|
619 |
+
$paymentMethod = trim($response->getData('paymentMethod'));
|
620 |
$_paymentCode = $this->_paymentMethodCode($order);
|
621 |
switch ($eventCode) {
|
622 |
+
case Adyen_Payment_Model_Event::ADYEN_EVENT_REFUND_FAILED:
|
623 |
+
// do nothing only inform the merchant with order comment history
|
624 |
+
break;
|
625 |
case Adyen_Payment_Model_Event::ADYEN_EVENT_REFUND:
|
626 |
|
627 |
$this->refundOrder($order, $response);
|
629 |
$this->setRefundAuthorized($order, $success);
|
630 |
break;
|
631 |
case Adyen_Payment_Model_Event::ADYEN_EVENT_PENDING:
|
632 |
+
if($this->_getConfigData('send_email_bank_sepa_on_pending', 'adyen_abstract')) {
|
633 |
+
// Check if payment is banktransfer or sepa if true then send out order confirmation email
|
634 |
+
$isBankTransfer = $this->isBankTransfer($paymentMethod);
|
635 |
+
if($isBankTransfer || $paymentMethod == 'sepadirectdebit') {
|
636 |
+
$order->sendNewOrderEmail(); // send order email
|
637 |
+
}
|
638 |
+
}
|
639 |
break;
|
640 |
case Adyen_Payment_Model_Event::ADYEN_EVENT_HANDLED_EXTERNALLY:
|
641 |
case Adyen_Payment_Model_Event::ADYEN_EVENT_AUTHORISATION:
|
642 |
// for POS don't do anything on the AUTHORIZATION
|
643 |
if($_paymentCode != "adyen_pos") {
|
644 |
+
$this->authorizePayment($order, $success, $paymentMethod, $response);
|
645 |
}
|
646 |
break;
|
647 |
+
case Adyen_Payment_Model_Event::ADYEN_EVENT_MANUAL_REVIEW_REJECT:
|
648 |
+
// don't do anything it will send a CANCEL_OR_REFUND notification when this payment is captured
|
649 |
+
break;
|
650 |
+
case Adyen_Payment_Model_Event::ADYEN_EVENT_MANUAL_REVIEW_ACCEPT:
|
651 |
+
// don't do anything it will send a CAPTURE notification when this payment is captured
|
652 |
+
break;
|
653 |
case Adyen_Payment_Model_Event::ADYEN_EVENT_CAPTURE:
|
654 |
if($_paymentCode != "adyen_pos") {
|
655 |
$this->setPaymentAuthorized($order, $success, $response);
|
656 |
} else {
|
657 |
// FOR POS authorize the payment on the CAPTURE notification
|
658 |
+
$this->authorizePayment($order, $success, $paymentMethod, $response);
|
659 |
}
|
660 |
break;
|
661 |
case Adyen_Payment_Model_Event::ADYEN_EVENT_CAPTURE_FAILED:
|
711 |
$this->createInvoice($order, $response);
|
712 |
|
713 |
$_paymentCode = $this->_paymentMethodCode($order);
|
714 |
+
if($payment_method == "c_cash" || ($this->_getConfigData('create_shipment', 'adyen_pos') && $_paymentCode == "adyen_pos"))
|
715 |
{
|
716 |
$this->createShipment($order);
|
717 |
}
|
726 |
if ($success && !empty($order)) {
|
727 |
|
728 |
$status = $this->_getConfigData('payment_authorized');
|
729 |
+
// virtual order can have different status
|
730 |
+
if($order->getIsVirtual()) {
|
731 |
+
$virtual_status = $this->_getConfigData('payment_authorized_virtual');
|
732 |
+
if($virtual_status != "") {
|
733 |
+
$status = $virtual_status;
|
734 |
+
}
|
735 |
+
}
|
736 |
|
737 |
// check for boleto if payment is totally paid
|
738 |
if($order->getPayment()->getMethod() == "adyen_boleto") {
|
832 |
return false;
|
833 |
}
|
834 |
//online capture after delivery, use Magento backend to online invoice
|
835 |
+
if (strcmp($paymentMethod, 'openinvoice') === 0 || strcmp($paymentMethod, 'afterpay_default') === 0 || strcmp($paymentMethod, 'klarna') === 0) {
|
836 |
return false;
|
837 |
}
|
838 |
return true;
|
844 |
} else {
|
845 |
$isBankTransfer = false;
|
846 |
}
|
847 |
+
return $isBankTransfer;
|
848 |
}
|
849 |
|
850 |
/**
|
917 |
$eventCode = trim($response->getData('eventCode'));
|
918 |
$reason = trim($response->getData('reason'));
|
919 |
$invoiceAutoMail = (bool) $this->_getConfigData('send_invoice_update_mail');
|
|
|
920 |
$_mail = (bool) $this->_getConfigData('send_update_mail');
|
921 |
$value = trim($response->getData('value'));
|
922 |
|
939 |
if ($order->canInvoice()) {
|
940 |
$invoice = $order->prepareInvoice();
|
941 |
$invoice->getOrder()->setIsInProcess(true);
|
942 |
+
// set transaction id so you can do a online refund this is used instead of online capture
|
943 |
+
// because it is already auto capture in Adyen Backoffice
|
944 |
+
$invoice->setTransactionId(1);
|
945 |
+
$invoice->register()->pay();
|
946 |
try {
|
947 |
Mage::getModel('core/resource_transaction')
|
948 |
->addObject($invoice)
|
1162 |
* @param string $code
|
1163 |
*/
|
1164 |
protected function _getConfigData($code, $paymentMethodCode = null, $storeId = null) {
|
1165 |
+
return Mage::helper('adyen')->_getConfigData($code, $paymentMethodCode, $storeId);
|
|
|
|
|
|
|
|
|
|
|
|
|
1166 |
}
|
1167 |
|
1168 |
public function getConfigData($code, $paymentMethodCode = null, $storeId = null) {
|
@@ -63,8 +63,23 @@ class Adyen_Payment_Model_Sales_Quote_Address_Total_PaymentFee extends Mage_Sale
|
|
63 |
'title'=> Mage::helper('adyen')->__('Payment Fee'),
|
64 |
'value'=> $amt
|
65 |
));
|
|
|
|
|
66 |
}
|
67 |
-
|
68 |
return $this;
|
69 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
}
|
63 |
'title'=> Mage::helper('adyen')->__('Payment Fee'),
|
64 |
'value'=> $amt
|
65 |
));
|
66 |
+
} else {
|
67 |
+
$this->removeTotal($address, $this->getCode());
|
68 |
}
|
|
|
69 |
return $this;
|
70 |
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* @param Mage_Sales_Model_Quote_Address $address
|
74 |
+
* @param string $code
|
75 |
+
*/
|
76 |
+
protected function removeTotal(Mage_Sales_Model_Quote_Address $address, $code)
|
77 |
+
{
|
78 |
+
$reflectedClass = new ReflectionClass($address);
|
79 |
+
$propertyTotals = $reflectedClass->getProperty('_totals');
|
80 |
+
$propertyTotals->setAccessible(true);
|
81 |
+
$totals = $propertyTotals->getValue($address);
|
82 |
+
unset($totals[$code]);
|
83 |
+
$propertyTotals->setValue($address, $totals);
|
84 |
+
}
|
85 |
}
|
@@ -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_Model_Source_DefaultPaymentMethods {
|
29 |
+
|
30 |
+
public function toOptionArray() {
|
31 |
+
return array(
|
32 |
+
array('value' => '', 'label' => 'None'),
|
33 |
+
array('value' => 'ideal', 'label' => 'Ideal'),
|
34 |
+
array('value' => 'mc', 'label' => 'Mastercard'),
|
35 |
+
array('value' => 'visa', 'label' => 'Visa'),
|
36 |
+
array('value' => 'amex', 'label' => 'American Express'),
|
37 |
+
array('value' => 'sepa', 'label' => 'SEPA'),
|
38 |
+
array('value' => 'c_cash', 'label' => 'Cash')
|
39 |
+
);
|
40 |
+
}
|
41 |
+
|
42 |
+
}
|
@@ -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 |
+
class Adyen_Payment_Model_Source_Status_Complete extends Mage_Adminhtml_Model_System_Config_Source_Order_Status
|
29 |
+
{
|
30 |
+
protected $_stateStatuses = Mage_Sales_Model_Order::STATE_COMPLETE;
|
31 |
+
}
|
@@ -1,5 +1,30 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Adyen_Payment_Model_Source_Status_Refund extends Mage_Adminhtml_Model_System_Config_Source_Order_Status
|
4 |
{
|
5 |
protected $_stateStatuses = null;
|
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_Source_Status_Refund extends Mage_Adminhtml_Model_System_Config_Source_Order_Status
|
29 |
{
|
30 |
protected $_stateStatuses = null;
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_Source_VisibleType {
|
29 |
+
|
30 |
+
public function toOptionArray() {
|
31 |
+
return array(
|
32 |
+
array('value' => 'both', 'label' => 'Backend and Frontend'),
|
33 |
+
array('value' => 'backend', 'label' => 'Backend Only'),
|
34 |
+
array('value' => 'frontend', 'label' => 'Frontend Only')
|
35 |
+
);
|
36 |
+
}
|
37 |
+
|
38 |
+
}
|
@@ -117,9 +117,6 @@ class Adyen_Payment_ProcessController extends Mage_Core_Controller_Front_Action
|
|
117 |
//redirect to adyen
|
118 |
if (strcmp($order->getState(), Mage_Sales_Model_Order::STATE_PENDING_PAYMENT) === 0 ||
|
119 |
(strcmp($order->getState(), Mage_Sales_Model_Order::STATE_NEW) === 0)) {
|
120 |
-
$_status = $this->_getConfigData('order_status');
|
121 |
-
// FIXME this status won't be added because order is not saved $order->save() missing
|
122 |
-
$order->addStatusHistoryComment(Mage::helper('adyen')->__('Customer was redirected to Adyen.'), $_status);
|
123 |
$this->getResponse()->setBody(
|
124 |
$this->getLayout()
|
125 |
->createBlock($this->_redirectBlockType)
|
@@ -313,8 +310,10 @@ class Adyen_Payment_ProcessController extends Mage_Core_Controller_Front_Action
|
|
313 |
// get the order
|
314 |
$order = Mage::getModel('sales/order')->loadByIncrementId($_POST['merchantReference']);
|
315 |
// if order is not cancelled then order is success
|
316 |
-
if($order->getStatus() == Mage_Sales_Model_Order::STATE_PROCESSING || $order->getAdyenEventCode() == Adyen_Payment_Model_Event::ADYEN_EVENT_POSAPPROVED) {
|
317 |
echo 'true';
|
|
|
|
|
318 |
}
|
319 |
}
|
320 |
return;
|
117 |
//redirect to adyen
|
118 |
if (strcmp($order->getState(), Mage_Sales_Model_Order::STATE_PENDING_PAYMENT) === 0 ||
|
119 |
(strcmp($order->getState(), Mage_Sales_Model_Order::STATE_NEW) === 0)) {
|
|
|
|
|
|
|
120 |
$this->getResponse()->setBody(
|
121 |
$this->getLayout()
|
122 |
->createBlock($this->_redirectBlockType)
|
310 |
// get the order
|
311 |
$order = Mage::getModel('sales/order')->loadByIncrementId($_POST['merchantReference']);
|
312 |
// if order is not cancelled then order is success
|
313 |
+
if($order->getStatus() == Mage_Sales_Model_Order::STATE_PROCESSING || $order->getAdyenEventCode() == Adyen_Payment_Model_Event::ADYEN_EVENT_POSAPPROVED || substr($order->getAdyenEventCode(), 0, 13) == Adyen_Payment_Model_Event::ADYEN_EVENT_AUTHORISATION) {
|
314 |
echo 'true';
|
315 |
+
} else {
|
316 |
+
Mage::log("NO MATCH! order is not matching with merchantReference:".$_POST['merchantReference'] . " status is:" . $order->getStatus() . " and adyen event status is:" . $order->getAdyenEventCode(), Zend_Log::DEBUG, "adyen_notification_pos.log", true);
|
317 |
}
|
318 |
}
|
319 |
return;
|
@@ -1,5 +1,30 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Adyen_Payment_SavedCardController extends Mage_Core_Controller_Front_Action
|
4 |
{
|
5 |
|
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_SavedCardController extends Mage_Core_Controller_Front_Action
|
29 |
{
|
30 |
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
29 |
+
/*
|
30 |
+
* update the notification_password, ws_password_test and ws_password_live to a secure password
|
31 |
+
*/
|
32 |
+
|
33 |
+
$notificationPath = "payment/adyen_abstract/notification_password";
|
34 |
+
updateConfigValue($notificationPath);
|
35 |
+
|
36 |
+
$wsPasswordTestPath = "payment/adyen_abstract/ws_password_test";
|
37 |
+
updateConfigValue($wsPasswordTestPath);
|
38 |
+
|
39 |
+
$wsPasswordLivePath = "payment/adyen_abstract/ws_password_live";
|
40 |
+
updateConfigValue($wsPasswordLivePath);
|
41 |
+
|
42 |
+
|
43 |
+
function updateConfigValue($path) {
|
44 |
+
try {
|
45 |
+
$collection = Mage::getModel('core/config_data')->getCollection()
|
46 |
+
->addFieldToFilter('path', array('like' => $path ));
|
47 |
+
|
48 |
+
if ($collection->count() > 0) {
|
49 |
+
foreach ($collection as $coreConfig) {
|
50 |
+
$oldValue = $coreConfig->getValue();
|
51 |
+
|
52 |
+
//encrypt the data and save this
|
53 |
+
$encryptedValue = Mage::helper('core')->encrypt($oldValue);
|
54 |
+
$coreConfig->setValue($encryptedValue)->save();
|
55 |
+
}
|
56 |
+
}
|
57 |
+
} catch (Exception $e) {
|
58 |
+
Mage::log($e->getMessage(), Zend_Log::ERR);
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
@@ -29,7 +29,7 @@
|
|
29 |
<config>
|
30 |
<modules>
|
31 |
<Adyen_Payment>
|
32 |
-
<version>2.
|
33 |
</Adyen_Payment>
|
34 |
</modules>
|
35 |
<global>
|
@@ -136,9 +136,12 @@
|
|
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>
|
@@ -146,9 +149,12 @@
|
|
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>
|
@@ -204,14 +210,6 @@
|
|
204 |
</modules>
|
205 |
</translate>
|
206 |
<events>
|
207 |
-
<sales_order_invoice_pay>
|
208 |
-
<observers>
|
209 |
-
<adyen_manual_online_capture>
|
210 |
-
<class>adyen/observer</class>
|
211 |
-
<method>capture</method>
|
212 |
-
</adyen_manual_online_capture>
|
213 |
-
</observers>
|
214 |
-
</sales_order_invoice_pay>
|
215 |
<sales_order_payment_cancel>
|
216 |
<observers>
|
217 |
<adyen_payment>
|
@@ -237,10 +235,11 @@
|
|
237 |
<ws_password_live></ws_password_live>
|
238 |
<demoMode>N</demoMode>
|
239 |
<order_status>processing</order_status>
|
240 |
-
<payment_pending>pending</payment_pending>
|
241 |
<payment_authorized>processing</payment_authorized>
|
|
|
242 |
<capture_mode>auto</capture_mode>
|
243 |
<recurringtypes>ONECLICK</recurringtypes>
|
|
|
244 |
</adyen_abstract>
|
245 |
<adyen_hpp translate="title" module="adyen">
|
246 |
<customer_id backend_model="adminhtml/system_config_backend_encrypted"/>
|
@@ -255,13 +254,12 @@
|
|
255 |
<ws_username_live></ws_username_live>
|
256 |
<ws_password_live></ws_password_live>
|
257 |
<order_status>processing</order_status>
|
258 |
-
<payment_pending>pending</payment_pending>
|
259 |
-
<payment_authorized>processing</payment_authorized>
|
260 |
<allowspecific>0</allowspecific>
|
261 |
<disable_hpptypes>0</disable_hpptypes>
|
262 |
<sort_order>30</sort_order>
|
263 |
<cache_directory_lookup>0</cache_directory_lookup>
|
264 |
<return_url_in_request>0</return_url_in_request>
|
|
|
265 |
</adyen_hpp>
|
266 |
<adyen_pos translate="title" module="adyen">
|
267 |
<active>0</active>
|
@@ -275,7 +273,9 @@
|
|
275 |
<cash_express_checkout>0</cash_express_checkout>
|
276 |
<cash_drawer>0</cash_drawer>
|
277 |
<cash_drawer_printer_ip></cash_drawer_printer_ip>
|
278 |
-
<
|
|
|
|
|
279 |
<allowspecific>0</allowspecific>
|
280 |
<sort_order>80</sort_order>
|
281 |
</adyen_pos>
|
@@ -288,6 +288,7 @@
|
|
288 |
<openinvoicetypes>openinvoice</openinvoicetypes>
|
289 |
<gender_show>0</gender_show>
|
290 |
<dob_show>0</dob_show>
|
|
|
291 |
<different_address_disable>0</different_address_disable>
|
292 |
<sort_order>40</sort_order>
|
293 |
</adyen_openinvoice>
|
@@ -301,6 +302,7 @@
|
|
301 |
<enable_installments>0</enable_installments>
|
302 |
<cse_enabled>0</cse_enabled>
|
303 |
<cse_public_key></cse_public_key>
|
|
|
304 |
<enable_moto>0</enable_moto>
|
305 |
<account_id>99999</account_id>
|
306 |
<trxuser_id>99999</trxuser_id>
|
@@ -322,6 +324,7 @@
|
|
322 |
<model>adyen/adyen_elv</model>
|
323 |
<group>adyen</group>
|
324 |
<order_status>processing</order_status>
|
|
|
325 |
<title>Adyen ELV</title>
|
326 |
<sort_order>50</sort_order>
|
327 |
</adyen_elv>
|
@@ -330,8 +333,10 @@
|
|
330 |
<model>adyen/adyen_boleto</model>
|
331 |
<group>adyen</group>
|
332 |
<order_status>processing</order_status>
|
|
|
333 |
<title>Adyen Boleto</title>
|
334 |
<delivery_days>5</delivery_days>
|
|
|
335 |
<sort_order>70</sort_order>
|
336 |
</adyen_boleto>
|
337 |
<adyen_sepa translate="title" module="adyen">
|
@@ -339,6 +344,7 @@
|
|
339 |
<model>adyen/adyen_sepa</model>
|
340 |
<group>adyen</group>
|
341 |
<order_status>processing</order_status>
|
|
|
342 |
<title>Adyen SEPA</title>
|
343 |
<sort_order>60</sort_order>
|
344 |
<validate_iban>0</validate_iban>
|
@@ -390,12 +396,18 @@
|
|
390 |
<order>70</order>
|
391 |
<is_cvv_required>0</is_cvv_required>
|
392 |
</JCB>
|
393 |
-
<
|
394 |
-
<code>
|
395 |
-
<name>
|
396 |
<order>80</order>
|
397 |
<is_cvv_required>0</is_cvv_required>
|
398 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
399 |
</cctypes>
|
400 |
<boletotypes>
|
401 |
<boletobancario_hsbc>
|
@@ -426,8 +438,8 @@
|
|
426 |
</boletotypes>
|
427 |
<openinvoicetypes>
|
428 |
<afterpay>
|
429 |
-
<code>
|
430 |
-
<name>AfterPay</name>
|
431 |
<order>10</order>
|
432 |
</afterpay>
|
433 |
<klarna>
|
29 |
<config>
|
30 |
<modules>
|
31 |
<Adyen_Payment>
|
32 |
+
<version>2.2.0</version>
|
33 |
</Adyen_Payment>
|
34 |
</modules>
|
35 |
<global>
|
136 |
<totals>
|
137 |
<payment_fee>
|
138 |
<class>adyen/total_paymentFee_invoice</class>
|
139 |
+
<after>subtotal,discount</after>
|
140 |
+
<before>grand_total,tax</before>
|
141 |
</payment_fee>
|
142 |
<payment_installment_fee>
|
143 |
<class>adyen/total_paymentInstallmentFee_invoice</class>
|
144 |
+
<after>grand_total</after>
|
145 |
</payment_installment_fee>
|
146 |
</totals>
|
147 |
</order_invoice>
|
149 |
<totals>
|
150 |
<payment_fee>
|
151 |
<class>adyen/total_paymentFee_creditmemo</class>
|
152 |
+
<after>subtotal,discount</after>
|
153 |
+
<before>grand_total,tax</before>
|
154 |
</payment_fee>
|
155 |
<payment_installment_fee>
|
156 |
<class>adyen/total_paymentInstallmentFee_creditmemo</class>
|
157 |
+
<after>grand_total</after>
|
158 |
</payment_installment_fee>
|
159 |
</totals>
|
160 |
</order_creditmemo>
|
210 |
</modules>
|
211 |
</translate>
|
212 |
<events>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
<sales_order_payment_cancel>
|
214 |
<observers>
|
215 |
<adyen_payment>
|
235 |
<ws_password_live></ws_password_live>
|
236 |
<demoMode>N</demoMode>
|
237 |
<order_status>processing</order_status>
|
|
|
238 |
<payment_authorized>processing</payment_authorized>
|
239 |
+
<payment_authorized_virtual>complete</payment_authorized_virtual>
|
240 |
<capture_mode>auto</capture_mode>
|
241 |
<recurringtypes>ONECLICK</recurringtypes>
|
242 |
+
<send_email_bank_sepa_on_pending>0</send_email_bank_sepa_on_pending>
|
243 |
</adyen_abstract>
|
244 |
<adyen_hpp translate="title" module="adyen">
|
245 |
<customer_id backend_model="adminhtml/system_config_backend_encrypted"/>
|
254 |
<ws_username_live></ws_username_live>
|
255 |
<ws_password_live></ws_password_live>
|
256 |
<order_status>processing</order_status>
|
|
|
|
|
257 |
<allowspecific>0</allowspecific>
|
258 |
<disable_hpptypes>0</disable_hpptypes>
|
259 |
<sort_order>30</sort_order>
|
260 |
<cache_directory_lookup>0</cache_directory_lookup>
|
261 |
<return_url_in_request>0</return_url_in_request>
|
262 |
+
<show_ideal_logos>0</show_ideal_logos>
|
263 |
</adyen_hpp>
|
264 |
<adyen_pos translate="title" module="adyen">
|
265 |
<active>0</active>
|
273 |
<cash_express_checkout>0</cash_express_checkout>
|
274 |
<cash_drawer>0</cash_drawer>
|
275 |
<cash_drawer_printer_ip></cash_drawer_printer_ip>
|
276 |
+
<cash_drawer_printer_port>8008</cash_drawer_printer_port>
|
277 |
+
<cash_drawer_printer_device_id>local_printer</cash_drawer_printer_device_id>
|
278 |
+
<ip_filter>0</ip_filter>
|
279 |
<allowspecific>0</allowspecific>
|
280 |
<sort_order>80</sort_order>
|
281 |
</adyen_pos>
|
288 |
<openinvoicetypes>openinvoice</openinvoicetypes>
|
289 |
<gender_show>0</gender_show>
|
290 |
<dob_show>0</dob_show>
|
291 |
+
<telephone_show>0</telephone_show>
|
292 |
<different_address_disable>0</different_address_disable>
|
293 |
<sort_order>40</sort_order>
|
294 |
</adyen_openinvoice>
|
302 |
<enable_installments>0</enable_installments>
|
303 |
<cse_enabled>0</cse_enabled>
|
304 |
<cse_public_key></cse_public_key>
|
305 |
+
<visible_type>both</visible_type>
|
306 |
<enable_moto>0</enable_moto>
|
307 |
<account_id>99999</account_id>
|
308 |
<trxuser_id>99999</trxuser_id>
|
324 |
<model>adyen/adyen_elv</model>
|
325 |
<group>adyen</group>
|
326 |
<order_status>processing</order_status>
|
327 |
+
<visible_type>both</visible_type>
|
328 |
<title>Adyen ELV</title>
|
329 |
<sort_order>50</sort_order>
|
330 |
</adyen_elv>
|
333 |
<model>adyen/adyen_boleto</model>
|
334 |
<group>adyen</group>
|
335 |
<order_status>processing</order_status>
|
336 |
+
<visible_type>both</visible_type>
|
337 |
<title>Adyen Boleto</title>
|
338 |
<delivery_days>5</delivery_days>
|
339 |
+
<use_taxvat>0</use_taxvat>
|
340 |
<sort_order>70</sort_order>
|
341 |
</adyen_boleto>
|
342 |
<adyen_sepa translate="title" module="adyen">
|
344 |
<model>adyen/adyen_sepa</model>
|
345 |
<group>adyen</group>
|
346 |
<order_status>processing</order_status>
|
347 |
+
<visible_type>both</visible_type>
|
348 |
<title>Adyen SEPA</title>
|
349 |
<sort_order>60</sort_order>
|
350 |
<validate_iban>0</validate_iban>
|
396 |
<order>70</order>
|
397 |
<is_cvv_required>0</is_cvv_required>
|
398 |
</JCB>
|
399 |
+
<ELO>
|
400 |
+
<code>ELO</code>
|
401 |
+
<name>Elo</name>
|
402 |
<order>80</order>
|
403 |
<is_cvv_required>0</is_cvv_required>
|
404 |
+
</ELO>
|
405 |
+
<hipercard>
|
406 |
+
<code>hipercard</code>
|
407 |
+
<name>Hipercard</name>
|
408 |
+
<order>90</order>
|
409 |
+
<is_cvv_required>0</is_cvv_required>
|
410 |
+
</hipercard>
|
411 |
</cctypes>
|
412 |
<boletotypes>
|
413 |
<boletobancario_hsbc>
|
438 |
</boletotypes>
|
439 |
<openinvoicetypes>
|
440 |
<afterpay>
|
441 |
+
<code>afterpay_default</code>
|
442 |
+
<name>AfterPay Netherlands</name>
|
443 |
<order>10</order>
|
444 |
</afterpay>
|
445 |
<klarna>
|
@@ -38,8 +38,7 @@
|
|
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 |
-
|
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>
|
@@ -55,7 +54,7 @@
|
|
55 |
</version>
|
56 |
<merchantAccount translate="label">
|
57 |
<label>Merchant Account</label>
|
58 |
-
<comment
|
59 |
<frontend_type>text</frontend_type>
|
60 |
<sort_order>10</sort_order>
|
61 |
<show_in_default>1</show_in_default>
|
@@ -92,6 +91,16 @@
|
|
92 |
<show_in_website>1</show_in_website>
|
93 |
<show_in_store>0</show_in_store>
|
94 |
</payment_authorized>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
<payment_pre_authorized>
|
96 |
<label>Order status pre-authorised payment</label>
|
97 |
<comment>(optional)Only affecting manual work flow.Leave empty if you are not sure</comment>
|
@@ -134,7 +143,8 @@
|
|
134 |
<notification_password translate="label">
|
135 |
<label>Notification Password</label>
|
136 |
<comment>Should match your "notifications settings" in your Adyen account.</comment>
|
137 |
-
<frontend_type>
|
|
|
138 |
<sort_order>76</sort_order>
|
139 |
<show_in_default>1</show_in_default>
|
140 |
<show_in_website>1</show_in_website>
|
@@ -171,7 +181,8 @@
|
|
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>
|
174 |
-
<frontend_type>
|
|
|
175 |
<sort_order>90</sort_order>
|
176 |
<show_in_default>1</show_in_default>
|
177 |
<show_in_website>1</show_in_website>
|
@@ -189,12 +200,23 @@
|
|
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>
|
192 |
-
<frontend_type>
|
|
|
193 |
<sort_order>110</sort_order>
|
194 |
<show_in_default>1</show_in_default>
|
195 |
<show_in_website>1</show_in_website>
|
196 |
<show_in_store>0</show_in_store>
|
197 |
</ws_password_live>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
<shopperlocale translate="label">
|
199 |
<label>Language locale (optional)</label>
|
200 |
<comment>Leave empty to let Magento decide (Ex: nl_NL)</comment>
|
@@ -296,16 +318,6 @@
|
|
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>
|
308 |
-
</payment_routines>
|
309 |
<delivery_days translate="label">
|
310 |
<label>Days for Delivery</label>
|
311 |
<validate>validate-digits</validate>
|
@@ -326,6 +338,17 @@
|
|
326 |
<show_in_website>0</show_in_website>
|
327 |
<show_in_store>0</show_in_store>
|
328 |
</disable_hpptypes>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
329 |
<cache_directory_lookup>
|
330 |
<label>Cache payment method call</label>
|
331 |
<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>
|
@@ -347,6 +370,16 @@
|
|
347 |
<show_in_website>1</show_in_website>
|
348 |
<show_in_store>1</show_in_store>
|
349 |
</return_url_in_request>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
350 |
<allowspecific translate="label">
|
351 |
<label>Payment to applicable countries</label>
|
352 |
<frontend_type>allowspecific</frontend_type>
|
@@ -465,7 +498,7 @@
|
|
465 |
</cash_express_checkout>
|
466 |
<cash_drawer>
|
467 |
<label>Open Cash Drawer</label>
|
468 |
-
<comment>Open the Cash drawer if you connect this to your printer</comment>
|
469 |
<frontend_type>select</frontend_type>
|
470 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
471 |
<sort_order>40</sort_order>
|
@@ -478,24 +511,62 @@
|
|
478 |
<label>IP address printer</label>
|
479 |
<comment>Enter here the IP address of the printer where the cash drawer is connected to</comment>
|
480 |
<frontend_type>text</frontend_type>
|
481 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
482 |
<sort_order>41</sort_order>
|
483 |
<show_in_default>1</show_in_default>
|
484 |
<show_in_website>1</show_in_website>
|
485 |
<show_in_store>1</show_in_store>
|
486 |
<depends><cash_drawer>1</cash_drawer></depends>
|
487 |
</cash_drawer_printer_ip>
|
488 |
-
<
|
489 |
-
<label>
|
490 |
-
<comment
|
491 |
<frontend_type>text</frontend_type>
|
492 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
493 |
<sort_order>42</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 |
<depends><cash_drawer>1</cash_drawer></depends>
|
498 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
499 |
<allowspecific translate="label">
|
500 |
<label>Payment to applicable countries</label>
|
501 |
<frontend_type>allowspecific</frontend_type>
|
@@ -578,12 +649,21 @@
|
|
578 |
<show_in_website>1</show_in_website>
|
579 |
<show_in_store>1</show_in_store>
|
580 |
</dob_show>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
581 |
<different_address_disable>
|
582 |
<label>Disable on Different Address</label>
|
583 |
<comment>If the delivery address and billing address in the checkout is not the same disable this payment method because Klarna will most likely reject it</comment>
|
584 |
<frontend_type>select</frontend_type>
|
585 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
586 |
-
<sort_order>
|
587 |
<show_in_default>1</show_in_default>
|
588 |
<show_in_website>1</show_in_website>
|
589 |
<show_in_store>1</show_in_store>
|
@@ -670,14 +750,23 @@
|
|
670 |
<show_in_website>1</show_in_website>
|
671 |
<show_in_store>1</show_in_store>
|
672 |
</cse_enabled>
|
673 |
-
<
|
674 |
-
<label>Client-Side Encryption Public Key</label>
|
675 |
<frontend_type>textarea</frontend_type>
|
676 |
<sort_order>70</sort_order>
|
677 |
<show_in_default>1</show_in_default>
|
678 |
<show_in_website>1</show_in_website>
|
679 |
<show_in_store>1</show_in_store>
|
680 |
<depends><cse_enabled>1</cse_enabled></depends>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
681 |
</cse_publickey>
|
682 |
<allowspecific translate="label">
|
683 |
<label>Payment to applicable countries</label>
|
@@ -698,6 +787,16 @@
|
|
698 |
<show_in_store>1</show_in_store>
|
699 |
<depends><allowspecific>1</allowspecific></depends>
|
700 |
</specificcountry>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
701 |
<enable_moto>
|
702 |
<label>Enable MOTO for backend orders</label>
|
703 |
<frontend_type>select</frontend_type>
|
@@ -781,7 +880,7 @@
|
|
781 |
<show_in_website>1</show_in_website>
|
782 |
<show_in_store>1</show_in_store>
|
783 |
</installments_MO>
|
784 |
-
<
|
785 |
<label>Installments For JCB</label>
|
786 |
<frontend_model>adyen/adminhtml_form_field_installments</frontend_model>
|
787 |
<backend_model>adyen/system_config_backend_installments</backend_model>
|
@@ -789,16 +888,25 @@
|
|
789 |
<show_in_default>1</show_in_default>
|
790 |
<show_in_website>1</show_in_website>
|
791 |
<show_in_store>1</show_in_store>
|
792 |
-
</
|
793 |
-
<
|
794 |
-
<label>Installments For
|
795 |
<frontend_model>adyen/adminhtml_form_field_installments</frontend_model>
|
796 |
<backend_model>adyen/system_config_backend_installments</backend_model>
|
797 |
<sort_order>200</sort_order>
|
798 |
<show_in_default>1</show_in_default>
|
799 |
<show_in_website>1</show_in_website>
|
800 |
<show_in_store>1</show_in_store>
|
801 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
802 |
</fields>
|
803 |
</adyen_cc>
|
804 |
<adyen_oneclick>
|
@@ -882,6 +990,16 @@
|
|
882 |
<show_in_store>1</show_in_store>
|
883 |
<depends><allowspecific>1</allowspecific></depends>
|
884 |
</specificcountry>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
885 |
</fields>
|
886 |
</adyen_elv>
|
887 |
<!-- @boleto only -->
|
@@ -936,6 +1054,16 @@
|
|
936 |
<show_in_website>1</show_in_website>
|
937 |
<show_in_store>1</show_in_store>
|
938 |
</boletotypes>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
939 |
<order_underpaid_status translate="label">
|
940 |
<label>Order status underpaid</label>
|
941 |
<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>
|
@@ -951,7 +1079,7 @@
|
|
951 |
<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>
|
952 |
<frontend_type>select</frontend_type>
|
953 |
<source_model>adminhtml/system_config_source_order_status_processing</source_model>
|
954 |
-
<sort_order>
|
955 |
<show_in_default>1</show_in_default>
|
956 |
<show_in_website>1</show_in_website>
|
957 |
<show_in_store>0</show_in_store>
|
@@ -975,6 +1103,16 @@
|
|
975 |
<show_in_store>1</show_in_store>
|
976 |
<depends><allowspecific>1</allowspecific></depends>
|
977 |
</specificcountry>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
978 |
</fields>
|
979 |
</adyen_boleto>
|
980 |
<!-- @SEPA only -->
|
@@ -1050,6 +1188,16 @@
|
|
1050 |
<show_in_store>1</show_in_store>
|
1051 |
<depends><allowspecific>1</allowspecific></depends>
|
1052 |
</specificcountry>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1053 |
</fields>
|
1054 |
</adyen_sepa>
|
1055 |
</groups>
|
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><![CDATA[<p>Click the following link for an <a target="_blank" href="http://vimeo.com/94005128">instructional video on how to set up the Adyen Magento plugin</a>, or <a target="_blank" href="https://www.adyen.com/dam/documentation/manuals/MagentoQuickIntegrationManual.pdf">here to download the Quick Quick Integration Guide</a> or <a target="_blank" href="https://www.adyen.com/dam/documentation/manuals/AdyenMagentoExtension.pdf">here to download the more advanced manual</a> and <a target="_blank" href="https://www.adyen.com/home/payment-services/plug-ins/magento#form">here to sign up for a test account</a>.
|
|
|
42 |
The latest version of the <a target="_blank" href="https://github.com/adyenpayments/magento/releases">Adyen Magento plugin is also available through GitHub</a>.
|
43 |
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>.
|
44 |
</p>]]></comment>
|
54 |
</version>
|
55 |
<merchantAccount translate="label">
|
56 |
<label>Merchant Account</label>
|
57 |
+
<comment><![CDATA[You can find this in the Adyen back-office. The Adyen back-office can be found on <a target="_blank" href="https://ca-test.adyen.com">https://ca-test.adyen.com</a> for test or <a target="_blank" href="https://ca-live.adyen.com">https://ca-live.adyen.com</a> for live.]]></comment>
|
58 |
<frontend_type>text</frontend_type>
|
59 |
<sort_order>10</sort_order>
|
60 |
<show_in_default>1</show_in_default>
|
91 |
<show_in_website>1</show_in_website>
|
92 |
<show_in_store>0</show_in_store>
|
93 |
</payment_authorized>
|
94 |
+
<payment_authorized_virtual>
|
95 |
+
<label>Order status authorised payment for virtual products</label>
|
96 |
+
<comment>(optional)Select only status assigned to state complete. Leave empty to use the same as normal products</comment>
|
97 |
+
<frontend_type>select</frontend_type>
|
98 |
+
<source_model>adyen/source_status_complete</source_model>
|
99 |
+
<sort_order>41</sort_order>
|
100 |
+
<show_in_default>1</show_in_default>
|
101 |
+
<show_in_website>1</show_in_website>
|
102 |
+
<show_in_store>0</show_in_store>
|
103 |
+
</payment_authorized_virtual>
|
104 |
<payment_pre_authorized>
|
105 |
<label>Order status pre-authorised payment</label>
|
106 |
<comment>(optional)Only affecting manual work flow.Leave empty if you are not sure</comment>
|
143 |
<notification_password translate="label">
|
144 |
<label>Notification Password</label>
|
145 |
<comment>Should match your "notifications settings" in your Adyen account.</comment>
|
146 |
+
<frontend_type>obscure</frontend_type>
|
147 |
+
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
148 |
<sort_order>76</sort_order>
|
149 |
<show_in_default>1</show_in_default>
|
150 |
<show_in_website>1</show_in_website>
|
181 |
<ws_password_test translate="label">
|
182 |
<label>Adyen ws password for Test</label>
|
183 |
<comment>The password of the ws user for Test</comment>
|
184 |
+
<frontend_type>obscure</frontend_type>
|
185 |
+
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
186 |
<sort_order>90</sort_order>
|
187 |
<show_in_default>1</show_in_default>
|
188 |
<show_in_website>1</show_in_website>
|
200 |
<ws_password_live translate="label">
|
201 |
<label>Adyen ws password for Live</label>
|
202 |
<comment>The password of the ws user for Live</comment>
|
203 |
+
<frontend_type>obscure</frontend_type>
|
204 |
+
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
205 |
<sort_order>110</sort_order>
|
206 |
<show_in_default>1</show_in_default>
|
207 |
<show_in_website>1</show_in_website>
|
208 |
<show_in_store>0</show_in_store>
|
209 |
</ws_password_live>
|
210 |
+
<send_email_bank_sepa_on_pending>
|
211 |
+
<label>Send confirmation email for Banktransfer/SEPA</label>
|
212 |
+
<comment>Send a confirmation mail after banktranfer/SEPA is placed (not yet paid). Make sure that you have BankTransfer Pending Notification enabled in Adyen backoffice to do this contact magento@adyen.com</comment>
|
213 |
+
<frontend_type>select</frontend_type>
|
214 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
215 |
+
<sort_order>120</sort_order>
|
216 |
+
<show_in_default>1</show_in_default>
|
217 |
+
<show_in_website>1</show_in_website>
|
218 |
+
<show_in_store>0</show_in_store>
|
219 |
+
</send_email_bank_sepa_on_pending>
|
220 |
<shopperlocale translate="label">
|
221 |
<label>Language locale (optional)</label>
|
222 |
<comment>Leave empty to let Magento decide (Ex: nl_NL)</comment>
|
318 |
<show_in_website>1</show_in_website>
|
319 |
<show_in_store>1</show_in_store>
|
320 |
</secret_wordp>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
321 |
<delivery_days translate="label">
|
322 |
<label>Days for Delivery</label>
|
323 |
<validate>validate-digits</validate>
|
338 |
<show_in_website>0</show_in_website>
|
339 |
<show_in_store>0</show_in_store>
|
340 |
</disable_hpptypes>
|
341 |
+
<payment_routines translate="label">
|
342 |
+
<label>Payment Flow Selection</label>
|
343 |
+
<comment>Adyen provide you with 2 types of payment routines. Multi-page and Single Page</comment>
|
344 |
+
<frontend_type>select</frontend_type>
|
345 |
+
<source_model>adyen/source_PaymentRoutines</source_model>
|
346 |
+
<sort_order>95</sort_order>
|
347 |
+
<show_in_default>1</show_in_default>
|
348 |
+
<show_in_website>1</show_in_website>
|
349 |
+
<show_in_store>0</show_in_store>
|
350 |
+
<depends><disable_hpptypes>1</disable_hpptypes></depends>
|
351 |
+
</payment_routines>
|
352 |
<cache_directory_lookup>
|
353 |
<label>Cache payment method call</label>
|
354 |
<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>
|
370 |
<show_in_website>1</show_in_website>
|
371 |
<show_in_store>1</show_in_store>
|
372 |
</return_url_in_request>
|
373 |
+
<show_ideal_logos>
|
374 |
+
<label>Show ideal bank logos</label>
|
375 |
+
<comment>Show ideal bank logos instead of dropdown</comment>
|
376 |
+
<frontend_type>select</frontend_type>
|
377 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
378 |
+
<sort_order>115</sort_order>
|
379 |
+
<show_in_default>1</show_in_default>
|
380 |
+
<show_in_website>1</show_in_website>
|
381 |
+
<show_in_store>1</show_in_store>
|
382 |
+
</show_ideal_logos>
|
383 |
<allowspecific translate="label">
|
384 |
<label>Payment to applicable countries</label>
|
385 |
<frontend_type>allowspecific</frontend_type>
|
498 |
</cash_express_checkout>
|
499 |
<cash_drawer>
|
500 |
<label>Open Cash Drawer</label>
|
501 |
+
<comment>Open the Cash drawer if you connect this to your printer this works for all Epson ePOS-Device printers</comment>
|
502 |
<frontend_type>select</frontend_type>
|
503 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
504 |
<sort_order>40</sort_order>
|
511 |
<label>IP address printer</label>
|
512 |
<comment>Enter here the IP address of the printer where the cash drawer is connected to</comment>
|
513 |
<frontend_type>text</frontend_type>
|
|
|
514 |
<sort_order>41</sort_order>
|
515 |
<show_in_default>1</show_in_default>
|
516 |
<show_in_website>1</show_in_website>
|
517 |
<show_in_store>1</show_in_store>
|
518 |
<depends><cash_drawer>1</cash_drawer></depends>
|
519 |
</cash_drawer_printer_ip>
|
520 |
+
<cash_drawer_printer_port>
|
521 |
+
<label>Printer port</label>
|
522 |
+
<comment>Enter here the port number of the printer where the cash drawer is connected to</comment>
|
523 |
<frontend_type>text</frontend_type>
|
|
|
524 |
<sort_order>42</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 |
<depends><cash_drawer>1</cash_drawer></depends>
|
529 |
+
</cash_drawer_printer_port>
|
530 |
+
<cash_drawer_printer_device_id>
|
531 |
+
<label>Printer Device ID</label>
|
532 |
+
<comment>Enter here the deviceID of the printer where the cash drawer is connected to</comment>
|
533 |
+
<frontend_type>text</frontend_type>
|
534 |
+
<sort_order>43</sort_order>
|
535 |
+
<show_in_default>1</show_in_default>
|
536 |
+
<show_in_website>1</show_in_website>
|
537 |
+
<show_in_store>1</show_in_store>
|
538 |
+
<depends><cash_drawer>1</cash_drawer></depends>
|
539 |
+
</cash_drawer_printer_device_id>
|
540 |
+
<ip_filter>
|
541 |
+
<label>IP filter</label>
|
542 |
+
<comment>Enable IP filter let's you define an IP range when this payment method is visable</comment>
|
543 |
+
<frontend_type>select</frontend_type>
|
544 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
545 |
+
<sort_order>45</sort_order>
|
546 |
+
<show_in_default>1</show_in_default>
|
547 |
+
<show_in_website>1</show_in_website>
|
548 |
+
<show_in_store>1</show_in_store>
|
549 |
+
</ip_filter>
|
550 |
+
<ip_filter_from>
|
551 |
+
<label>IP From</label>
|
552 |
+
<frontend_type>text</frontend_type>
|
553 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
554 |
+
<sort_order>46</sort_order>
|
555 |
+
<show_in_default>1</show_in_default>
|
556 |
+
<show_in_website>1</show_in_website>
|
557 |
+
<show_in_store>1</show_in_store>
|
558 |
+
<depends><ip_filter>1</ip_filter></depends>
|
559 |
+
</ip_filter_from>
|
560 |
+
<ip_filter_to>
|
561 |
+
<label>IP To</label>
|
562 |
+
<frontend_type>text</frontend_type>
|
563 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
564 |
+
<sort_order>47</sort_order>
|
565 |
+
<show_in_default>1</show_in_default>
|
566 |
+
<show_in_website>1</show_in_website>
|
567 |
+
<show_in_store>1</show_in_store>
|
568 |
+
<depends><ip_filter>1</ip_filter></depends>
|
569 |
+
</ip_filter_to>
|
570 |
<allowspecific translate="label">
|
571 |
<label>Payment to applicable countries</label>
|
572 |
<frontend_type>allowspecific</frontend_type>
|
649 |
<show_in_website>1</show_in_website>
|
650 |
<show_in_store>1</show_in_store>
|
651 |
</dob_show>
|
652 |
+
<telephone_show translate="label">
|
653 |
+
<label>Show Phonenumber</label>
|
654 |
+
<frontend_type>select</frontend_type>
|
655 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
656 |
+
<sort_order>37</sort_order>
|
657 |
+
<show_in_default>1</show_in_default>
|
658 |
+
<show_in_website>1</show_in_website>
|
659 |
+
<show_in_store>1</show_in_store>
|
660 |
+
</telephone_show>
|
661 |
<different_address_disable>
|
662 |
<label>Disable on Different Address</label>
|
663 |
<comment>If the delivery address and billing address in the checkout is not the same disable this payment method because Klarna will most likely reject it</comment>
|
664 |
<frontend_type>select</frontend_type>
|
665 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
666 |
+
<sort_order>38</sort_order>
|
667 |
<show_in_default>1</show_in_default>
|
668 |
<show_in_website>1</show_in_website>
|
669 |
<show_in_store>1</show_in_store>
|
750 |
<show_in_website>1</show_in_website>
|
751 |
<show_in_store>1</show_in_store>
|
752 |
</cse_enabled>
|
753 |
+
<cse_publickey_test translate="label">
|
754 |
+
<label>Client-Side Encryption Public Key For Test</label>
|
755 |
<frontend_type>textarea</frontend_type>
|
756 |
<sort_order>70</sort_order>
|
757 |
<show_in_default>1</show_in_default>
|
758 |
<show_in_website>1</show_in_website>
|
759 |
<show_in_store>1</show_in_store>
|
760 |
<depends><cse_enabled>1</cse_enabled></depends>
|
761 |
+
</cse_publickey_test>
|
762 |
+
<cse_publickey translate="label">
|
763 |
+
<label>Client-Side Encryption Public Key For Live</label>
|
764 |
+
<frontend_type>textarea</frontend_type>
|
765 |
+
<sort_order>71</sort_order>
|
766 |
+
<show_in_default>1</show_in_default>
|
767 |
+
<show_in_website>1</show_in_website>
|
768 |
+
<show_in_store>1</show_in_store>
|
769 |
+
<depends><cse_enabled>1</cse_enabled></depends>
|
770 |
</cse_publickey>
|
771 |
<allowspecific translate="label">
|
772 |
<label>Payment to applicable countries</label>
|
787 |
<show_in_store>1</show_in_store>
|
788 |
<depends><allowspecific>1</allowspecific></depends>
|
789 |
</specificcountry>
|
790 |
+
<visible_type>
|
791 |
+
<label>Visible in:</label>
|
792 |
+
<frontend_type>select</frontend_type>
|
793 |
+
<source_model>adyen/source_VisibleType</source_model>
|
794 |
+
<sort_order>101</sort_order>
|
795 |
+
<comment>Where do you want to show this payment method in the backend of magento or in the frontend for the shoppers</comment>
|
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 |
+
</visible_type>
|
800 |
<enable_moto>
|
801 |
<label>Enable MOTO for backend orders</label>
|
802 |
<frontend_type>select</frontend_type>
|
880 |
<show_in_website>1</show_in_website>
|
881 |
<show_in_store>1</show_in_store>
|
882 |
</installments_MO>
|
883 |
+
<installments_JCB translate="label">
|
884 |
<label>Installments For JCB</label>
|
885 |
<frontend_model>adyen/adminhtml_form_field_installments</frontend_model>
|
886 |
<backend_model>adyen/system_config_backend_installments</backend_model>
|
888 |
<show_in_default>1</show_in_default>
|
889 |
<show_in_website>1</show_in_website>
|
890 |
<show_in_store>1</show_in_store>
|
891 |
+
</installments_JCB>
|
892 |
+
<installments_ELO translate="label">
|
893 |
+
<label>Installments For Elo</label>
|
894 |
<frontend_model>adyen/adminhtml_form_field_installments</frontend_model>
|
895 |
<backend_model>adyen/system_config_backend_installments</backend_model>
|
896 |
<sort_order>200</sort_order>
|
897 |
<show_in_default>1</show_in_default>
|
898 |
<show_in_website>1</show_in_website>
|
899 |
<show_in_store>1</show_in_store>
|
900 |
+
</installments_ELO>
|
901 |
+
<installments_hipercard translate="label">
|
902 |
+
<label>Installments For Hipercard</label>
|
903 |
+
<frontend_model>adyen/adminhtml_form_field_installments</frontend_model>
|
904 |
+
<backend_model>adyen/system_config_backend_installments</backend_model>
|
905 |
+
<sort_order>210</sort_order>
|
906 |
+
<show_in_default>1</show_in_default>
|
907 |
+
<show_in_website>1</show_in_website>
|
908 |
+
<show_in_store>1</show_in_store>
|
909 |
+
</installments_hipercard>
|
910 |
</fields>
|
911 |
</adyen_cc>
|
912 |
<adyen_oneclick>
|
990 |
<show_in_store>1</show_in_store>
|
991 |
<depends><allowspecific>1</allowspecific></depends>
|
992 |
</specificcountry>
|
993 |
+
<visible_type>
|
994 |
+
<label>Visible in:</label>
|
995 |
+
<frontend_type>select</frontend_type>
|
996 |
+
<source_model>adyen/source_VisibleType</source_model>
|
997 |
+
<sort_order>70</sort_order>
|
998 |
+
<comment>Where do you want to show this payment method in the backend of magento or in the frontend for the shoppers</comment>
|
999 |
+
<show_in_default>1</show_in_default>
|
1000 |
+
<show_in_website>1</show_in_website>
|
1001 |
+
<show_in_store>1</show_in_store>
|
1002 |
+
</visible_type>
|
1003 |
</fields>
|
1004 |
</adyen_elv>
|
1005 |
<!-- @boleto only -->
|
1054 |
<show_in_website>1</show_in_website>
|
1055 |
<show_in_store>1</show_in_store>
|
1056 |
</boletotypes>
|
1057 |
+
<use_taxvat>
|
1058 |
+
<label>Use taxvat for CPF or CNPJ</label>
|
1059 |
+
<comment>If you use taxvat for the CPF/CNPJ field you can then enable this option to auto fill in the Social Security Number</comment>
|
1060 |
+
<frontend_type>select</frontend_type>
|
1061 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
1062 |
+
<sort_order>43</sort_order>
|
1063 |
+
<show_in_default>1</show_in_default>
|
1064 |
+
<show_in_website>1</show_in_website>
|
1065 |
+
<show_in_store>1</show_in_store>
|
1066 |
+
</use_taxvat>
|
1067 |
<order_underpaid_status translate="label">
|
1068 |
<label>Order status underpaid</label>
|
1069 |
<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>
|
1079 |
<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>
|
1080 |
<frontend_type>select</frontend_type>
|
1081 |
<source_model>adminhtml/system_config_source_order_status_processing</source_model>
|
1082 |
+
<sort_order>46</sort_order>
|
1083 |
<show_in_default>1</show_in_default>
|
1084 |
<show_in_website>1</show_in_website>
|
1085 |
<show_in_store>0</show_in_store>
|
1103 |
<show_in_store>1</show_in_store>
|
1104 |
<depends><allowspecific>1</allowspecific></depends>
|
1105 |
</specificcountry>
|
1106 |
+
<visible_type>
|
1107 |
+
<label>Visible in:</label>
|
1108 |
+
<frontend_type>select</frontend_type>
|
1109 |
+
<source_model>adyen/source_VisibleType</source_model>
|
1110 |
+
<sort_order>70</sort_order>
|
1111 |
+
<comment>Where do you want to show this payment method in the backend of magento or in the frontend for the shoppers</comment>
|
1112 |
+
<show_in_default>1</show_in_default>
|
1113 |
+
<show_in_website>1</show_in_website>
|
1114 |
+
<show_in_store>1</show_in_store>
|
1115 |
+
</visible_type>
|
1116 |
</fields>
|
1117 |
</adyen_boleto>
|
1118 |
<!-- @SEPA only -->
|
1188 |
<show_in_store>1</show_in_store>
|
1189 |
<depends><allowspecific>1</allowspecific></depends>
|
1190 |
</specificcountry>
|
1191 |
+
<visible_type>
|
1192 |
+
<label>Visible in:</label>
|
1193 |
+
<frontend_type>select</frontend_type>
|
1194 |
+
<source_model>adyen/source_VisibleType</source_model>
|
1195 |
+
<sort_order>70</sort_order>
|
1196 |
+
<comment>Where do you want to show this payment method in the backend of magento or in the frontend for the shoppers</comment>
|
1197 |
+
<show_in_default>1</show_in_default>
|
1198 |
+
<show_in_website>1</show_in_website>
|
1199 |
+
<show_in_store>1</show_in_store>
|
1200 |
+
</visible_type>
|
1201 |
</fields>
|
1202 |
</adyen_sepa>
|
1203 |
</groups>
|
@@ -41,7 +41,7 @@ CREATE TABLE `{$this->getTable('adyen/event')}` (
|
|
41 |
`created_at` datetime NULL DEFAULT NULL COMMENT 'Created At',
|
42 |
PRIMARY KEY (`event_id`)
|
43 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
44 |
-
|
45 |
");
|
46 |
|
47 |
$installer->endSetup();
|
41 |
`created_at` datetime NULL DEFAULT NULL COMMENT 'Created At',
|
42 |
PRIMARY KEY (`event_id`)
|
43 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
44 |
+
ALTER TABLE `{$this->getTable('adyen/event')}` ADD INDEX(adyen_event_code, psp_reference);
|
45 |
");
|
46 |
|
47 |
$installer->endSetup();
|
@@ -1,7 +1,31 @@
|
|
1 |
-
<?php
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
-
// TODO TEST THIS!!!
|
5 |
// ALTER TABLE `sales_flat_order` ADD `adyen_boleto_pdf` TEXT NOT NULL ;
|
6 |
$installer = $this;
|
7 |
|
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 |
// ALTER TABLE `sales_flat_order` ADD `adyen_boleto_pdf` TEXT NOT NULL ;
|
30 |
$installer = $this;
|
31 |
|
@@ -1,5 +1,30 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
$installer = $this;
|
4 |
|
5 |
/* @var $installer Adyen_Payment_Model_Entity_Setup */
|
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 |
$installer = $this;
|
29 |
|
30 |
/* @var $installer Adyen_Payment_Model_Entity_Setup */
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
$installer = $this;
|
28 |
+
/* @var $installer Adyen_Payment_Model_Mysql4_Setup */
|
29 |
+
|
30 |
+
$installer->startSetup();
|
31 |
+
$installer->run("ALTER TABLE `{$this->getTable('adyen/event')}` ADD INDEX `adyen_event_result`
|
32 |
+
(`increment_id`, `adyen_event_result`(32));");
|
33 |
+
|
34 |
+
$installer->run("ALTER TABLE `{$this->getTable('adyen/event')}` CHANGE `adyen_event_result` `adyen_event_result` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Adyen Event Result';");
|
35 |
+
|
36 |
+
$installer->endSetup();
|
37 |
+
|
38 |
+
|
39 |
+
|
@@ -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 |
+
$installer = $this;
|
28 |
+
/* @var $installer Adyen_Payment_Model_Mysql4_Setup */
|
29 |
+
|
30 |
+
$installer->startSetup();
|
31 |
+
$installer->run("ALTER TABLE `{$this->getTable('adyen/event')}` ADD INDEX (`adyen_event_result`);");
|
32 |
+
|
33 |
+
$installer->endSetup();
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
$installer = $this;
|
28 |
+
/* @var $installer Adyen_Payment_Model_Mysql4_Setup */
|
29 |
+
|
30 |
+
$installer->startSetup();
|
31 |
+
$installer->addAttribute('order_payment', 'adyen_total_fraud_score', array());
|
32 |
+
$installer->endSetup();
|
@@ -30,7 +30,7 @@
|
|
30 |
<li>
|
31 |
<div class="input-box">
|
32 |
<label for="<?php echo $_code ?>_cc_owner"><?php echo Mage::helper('payment')->__('Name on Card') ?> <span class="required">*</span></label><br/>
|
33 |
-
<input type="text" title="<?php echo $this->__('Name on Card') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_owner" <?php echo (!$this->isCseEnabled() ? "name=\"payment[cc_owner]\"" : "data-encrypted-name=\"holderName\""); ?> value="<?php echo $this->htmlEscape($this->getInfoData('cc_owner')) ?>" />
|
34 |
</div>
|
35 |
</li>
|
36 |
<li>
|
@@ -48,7 +48,7 @@
|
|
48 |
<li>
|
49 |
<div class="input-box">
|
50 |
<label for="<?php echo $_code ?>_cc_number"><?php echo Mage::helper('payment')->__('Credit Card Number') ?> <span class="required">*</span></label><br/>
|
51 |
-
<input type="text" id="<?php echo $_code ?>_cc_number" <?php echo (!$this->isCseEnabled() ? "name=\"payment[cc_number]\"" : " data-encrypted-name=\"number\""); ?> title="<?php echo $this->__('Credit Card Number') ?>" class="input-text validate-cc-number validate-cc-type" value="" />
|
52 |
</div>
|
53 |
</li>
|
54 |
<li>
|
@@ -80,9 +80,8 @@
|
|
80 |
<label for="<?php echo $_code ?>_cc_cid"><?php echo Mage::helper('payment')->__('Card Verification Number') ?> <span class="required">*</span></label><br/>
|
81 |
|
82 |
<div class="v-fix">
|
83 |
-
<input type="text" title="<?php echo $this->__('Card Verification Number') ?>" class="input-text cvv required-entry" id="<?php echo $_code ?>_cc_cid" <?php echo (!$this->isCseEnabled() ? "name=\"payment[cc_cid]\"" : "data-encrypted-name=\"cvc\""); ?> value="" />
|
84 |
</div>
|
85 |
-
<a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
|
86 |
</div>
|
87 |
</li>
|
88 |
<?php endif; ?>
|
30 |
<li>
|
31 |
<div class="input-box">
|
32 |
<label for="<?php echo $_code ?>_cc_owner"><?php echo Mage::helper('payment')->__('Name on Card') ?> <span class="required">*</span></label><br/>
|
33 |
+
<input type="text" title="<?php echo $this->__('Name on Card') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_owner" <?php echo (!$this->isCseEnabled() ? "name=\"payment[cc_owner]\"" : "data-encrypted-name=\"holderName\""); ?> value="<?php echo $this->htmlEscape($this->getInfoData('cc_owner')) ?>" maxlength="100" />
|
34 |
</div>
|
35 |
</li>
|
36 |
<li>
|
48 |
<li>
|
49 |
<div class="input-box">
|
50 |
<label for="<?php echo $_code ?>_cc_number"><?php echo Mage::helper('payment')->__('Credit Card Number') ?> <span class="required">*</span></label><br/>
|
51 |
+
<input type="text" id="<?php echo $_code ?>_cc_number" <?php echo (!$this->isCseEnabled() ? "name=\"payment[cc_number]\"" : " data-encrypted-name=\"number\""); ?> title="<?php echo $this->__('Credit Card Number') ?>" class="input-text validate-cc-number validate-cc-type" value="" maxlength="23"/>
|
52 |
</div>
|
53 |
</li>
|
54 |
<li>
|
80 |
<label for="<?php echo $_code ?>_cc_cid"><?php echo Mage::helper('payment')->__('Card Verification Number') ?> <span class="required">*</span></label><br/>
|
81 |
|
82 |
<div class="v-fix">
|
83 |
+
<input type="text" title="<?php echo $this->__('Card Verification Number') ?>" class="input-text cvv required-entry" id="<?php echo $_code ?>_cc_cid" <?php echo (!$this->isCseEnabled() ? "name=\"payment[cc_cid]\"" : "data-encrypted-name=\"cvc\""); ?> value="" maxlength="4" />
|
84 |
</div>
|
|
|
85 |
</div>
|
86 |
</li>
|
87 |
<?php endif; ?>
|
@@ -34,71 +34,69 @@
|
|
34 |
|
35 |
<ul id="payment_form_<?php echo $_code ?>" style="display:none">
|
36 |
<li>
|
37 |
-
<?php echo $this->__('You will be redirected to Adyen website when you place an order.') ?>
|
38 |
</li>
|
39 |
<?php if(empty($disabled) && !empty($enabledTypes)): ?>
|
40 |
<li>
|
41 |
<label for="<?php echo $_code ?>_hpp_type" class="required"><em>*</em><?php echo $this->__('Hosted Payment Type') ?></label>
|
42 |
<div class="input-box required-entry">
|
43 |
<?php foreach ($enabledTypes as $_typeCode=>$_typeName): ?>
|
44 |
-
<?php $filename = Mage::getBaseDir().DS.'skin'.DS.'frontend'.DS.'base'.DS.'default'.DS.'images'.DS.'adyen'.DS."$_typeCode.png" ?>
|
45 |
<table>
|
46 |
<tr>
|
47 |
<td width="20px">
|
48 |
-
<input type="radio" id="hpp_type_<?php echo $_typeCode ?>" name="payment[hpp_type]" value="<?php echo $_typeCode ?>" onclick="enableOptions('<?php echo $_typeCode ?>')"/>
|
49 |
</td>
|
50 |
<?php if (file_exists($filename)): ?>
|
51 |
-
<td width="80px"><img src="<?php echo $this->getSkinUrl('images'.DS.'adyen'.DS."$_typeCode.png") ?>" alt="<?php echo $_typeName ?>" /></td>
|
52 |
<?php endif ?>
|
53 |
|
54 |
-
<td><?php echo $this->__($_typeName) ?></td>
|
55 |
-
|
56 |
<?php if ($_typeCode == 'ideal' && !empty($idealList)): ?>
|
57 |
<td class="payment_form_ideal">
|
58 |
-
<fieldset class="form-list">
|
59 |
-
|
60 |
-
|
61 |
-
<
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
<?php
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
<
|
74 |
-
<
|
75 |
-
<
|
76 |
-
|
77 |
-
|
78 |
-
<?php
|
79 |
-
|
80 |
-
<?php
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
</ul>
|
87 |
-
</fieldset>
|
88 |
</td>
|
89 |
-
<?php endif; ?>
|
90 |
-
</tr>
|
91 |
-
</table>
|
92 |
<script type="text/javascript">
|
93 |
//<![CDATA[
|
94 |
-
function enableOptions(code) {
|
95 |
-
if (code == 'ideal') {
|
96 |
$('payment_form_ideal').show();
|
97 |
} else {
|
98 |
$('payment_form_ideal').hide();
|
99 |
}
|
100 |
-
}
|
101 |
-
<?php /*
|
102 |
var IdealChecked= function() {
|
103 |
var method = $('hpp_type_<?php echo $_typeCode?>');
|
104 |
if (method.value == 'ideal') {
|
@@ -115,4 +113,4 @@
|
|
115 |
</div>
|
116 |
</li>
|
117 |
<?php endif; ?>
|
118 |
-
</ul>
|
34 |
|
35 |
<ul id="payment_form_<?php echo $_code ?>" style="display:none">
|
36 |
<li>
|
37 |
+
<?php echo $this->__('You will be redirected to Adyen website when you place an order.') ?>
|
38 |
</li>
|
39 |
<?php if(empty($disabled) && !empty($enabledTypes)): ?>
|
40 |
<li>
|
41 |
<label for="<?php echo $_code ?>_hpp_type" class="required"><em>*</em><?php echo $this->__('Hosted Payment Type') ?></label>
|
42 |
<div class="input-box required-entry">
|
43 |
<?php foreach ($enabledTypes as $_typeCode=>$_typeName): ?>
|
44 |
+
<?php $filename = Mage::getBaseDir().DS.'skin'.DS.'frontend'.DS.'base'.DS.'default'.DS.'images'.DS.'adyen'.DS."$_typeCode.png" ?>
|
45 |
<table>
|
46 |
<tr>
|
47 |
<td width="20px">
|
48 |
+
<input type="radio" id="hpp_type_<?php echo $_typeCode ?>" name="payment[hpp_type]" value="<?php echo $_typeCode ?>" onclick="enableOptions('<?php echo $_typeCode ?>')"/>
|
49 |
</td>
|
50 |
<?php if (file_exists($filename)): ?>
|
51 |
+
<td width="80px"><label for="hpp_type_<?php echo $_typeCode ?>"><img src="<?php echo $this->getSkinUrl('images'.DS.'adyen'.DS."$_typeCode.png") ?>" alt="<?php echo $_typeName ?>" /></label></td>
|
52 |
<?php endif ?>
|
53 |
|
54 |
+
<td><label for="hpp_type_<?php echo $_typeCode ?>"><?php echo $this->__($_typeName) ?></label></td>
|
55 |
+
|
56 |
<?php if ($_typeCode == 'ideal' && !empty($idealList)): ?>
|
57 |
<td class="payment_form_ideal">
|
58 |
+
<fieldset class="form-list" id="payment_form_ideal" style="display:none">
|
59 |
+
<?php /* ?>
|
60 |
+
<li>
|
61 |
+
<label for="<?php echo $_code ?>_hpp_type_option" class="required"><?php echo $this->__('Select your bank') ?></label>
|
62 |
+
</li>
|
63 |
+
<?php */ ?>
|
64 |
+
<?php foreach ($idealList as $issuer): ?>
|
65 |
+
<?php $issuer = explode(DS, $issuer);
|
66 |
+
$_issueId = (isset($issuer[0])) ? $issuer[0] : false;
|
67 |
+
$_IssueLabel = (isset($issuer[1])) ? $issuer[1] : false;
|
68 |
+
$_bankFile = strtoupper(str_replace(" ", '', $_IssueLabel));
|
69 |
+
$_filename = Mage::getBaseDir().DS.'skin'.DS.'frontend'.DS.'base'.DS.'default'.DS.'images'.DS.'adyen'.DS."$_bankFile.png";
|
70 |
+
if (empty($_issueId) || empty($_IssueLabel)) continue;
|
71 |
+
?>
|
72 |
+
<table class="banks">
|
73 |
+
<tr>
|
74 |
+
<td width="20px">
|
75 |
+
<input type="radio" id="hpp_ideal_type_<?php echo $_issueId ?>" name="payment[hpp_ideal_type]" value="<?php echo $_issueId .DS. $_IssueLabel ?>"/>
|
76 |
+
</td>
|
77 |
+
<?php if (file_exists($_filename)): ?>
|
78 |
+
<td width="80px"><label for="hpp_ideal_type_<?php echo $_issueId ?>"><img src="<?php echo $this->getSkinUrl('images'.DS.'adyen'.DS."$_bankFile.png") ?>" alt="<?php echo $_IssueLabel ?>" label="<?php echo $_IssueLabel ?>" /></label></td>
|
79 |
+
<?php else: ?>
|
80 |
+
<td width="80px" class="label_hpp_ideal_type"><label width="80px" for="ideal_type_label_<?php echo $_issueId ?>"><?php echo $_IssueLabel ?></label></td>
|
81 |
+
<?php endif; ?>
|
82 |
+
</tr>
|
83 |
+
</table>
|
84 |
+
<?php endforeach ?>
|
85 |
+
</fieldset>
|
|
|
|
|
86 |
</td>
|
87 |
+
<?php endif; ?>
|
88 |
+
</tr>
|
89 |
+
</table>
|
90 |
<script type="text/javascript">
|
91 |
//<![CDATA[
|
92 |
+
function enableOptions(code) {
|
93 |
+
if (code == 'ideal') {
|
94 |
$('payment_form_ideal').show();
|
95 |
} else {
|
96 |
$('payment_form_ideal').hide();
|
97 |
}
|
98 |
+
}
|
99 |
+
<?php /*
|
100 |
var IdealChecked= function() {
|
101 |
var method = $('hpp_type_<?php echo $_typeCode?>');
|
102 |
if (method.value == 'ideal') {
|
113 |
</div>
|
114 |
</li>
|
115 |
<?php endif; ?>
|
116 |
+
</ul>
|
@@ -55,48 +55,11 @@ $_code=$this->getMethodCode();
|
|
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 |
-
|
63 |
-
|
64 |
-
|
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>
|
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 |
+
<?php foreach($this->getCountries() as $_country): ?>
|
61 |
+
<option value="<?php echo $_country['value'] ?>"<?php echo ($_country['value'] == $this->getShopperCountryId()) ? " selected" : ""; ?>><?php echo $_country['label'] ?></option>
|
62 |
+
<?php endforeach; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
</select>
|
64 |
</div>
|
65 |
</li>
|
@@ -31,9 +31,9 @@
|
|
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/
|
35 |
<?php else : ?>
|
36 |
-
<?php echo Mage::helper('adyen')->__('Adyen PSP Reference: <a href="https://ca-live.adyen.com/ca/ca/
|
37 |
<?php endif; ?>
|
38 |
<?php endif;?>
|
39 |
<?php $paymentMethod = $_info->getAdyenPaymentMethod() ?>
|
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/accounts/showTx.shtml?pspReference=%s&txType=Payment" 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/accounts/showTx.shtml?pspReference=%s&txType=Payment" target="__blank">%s</a>', $this->htmlEscape($_info->getAdyenPspReference()), $this->htmlEscape($_info->getAdyenPspReference())) ?> <br/>
|
37 |
<?php endif; ?>
|
38 |
<?php endif;?>
|
39 |
<?php $paymentMethod = $_info->getAdyenPaymentMethod() ?>
|
@@ -38,9 +38,9 @@ echo ($cseEnabled ? " (with Client-Side Encryption)" : "");
|
|
38 |
<?php
|
39 |
$storeId = $this->getMethod()->getInfoInstance()->getOrder()->getStoreId();
|
40 |
if($this->getMethod()->getConfigDataDemoMode($storeId)): ?>
|
41 |
-
<?php echo Mage::helper('adyen')->__('Adyen PSP Reference: <a href="https://ca-test.adyen.com/ca/ca/
|
42 |
<?php else : ?>
|
43 |
-
<?php echo Mage::helper('adyen')->__('Adyen PSP Reference: <a href="https://ca-live.adyen.com/ca/ca/
|
44 |
<?php endif; ?>
|
45 |
<?php endif;?>
|
46 |
<?php $paymentMethod = $_info->getAdyenPaymentMethod() ?>
|
@@ -67,5 +67,10 @@ echo ($cseEnabled ? " (with Client-Side Encryption)" : "");
|
|
67 |
<?php if($this->htmlEscape($this->getInfo()->getAdyenCvcResult()) != ""): ?>
|
68 |
<?php echo Mage::helper('adyen')->__('Cvc result: %s', $this->htmlEscape($this->getInfo()->getAdyenCvcResult())) ?><br/>
|
69 |
<?php endif; ?>
|
70 |
-
|
|
|
|
|
|
|
|
|
|
|
71 |
<?php endif;?>
|
38 |
<?php
|
39 |
$storeId = $this->getMethod()->getInfoInstance()->getOrder()->getStoreId();
|
40 |
if($this->getMethod()->getConfigDataDemoMode($storeId)): ?>
|
41 |
+
<?php echo Mage::helper('adyen')->__('Adyen PSP Reference: <a href="https://ca-test.adyen.com/ca/ca/accounts/showTx.shtml?pspReference=%s&txType=Payment" target="__blank">%s</a>', $this->htmlEscape($_info->getAdyenPspReference()), $this->htmlEscape($_info->getAdyenPspReference())) ?> <br/>
|
42 |
<?php else : ?>
|
43 |
+
<?php echo Mage::helper('adyen')->__('Adyen PSP Reference: <a href="https://ca-live.adyen.com/ca/ca/accounts/showTx.shtml?pspReference=%s&txType=Payment" target="__blank">%s</a>', $this->htmlEscape($_info->getAdyenPspReference()), $this->htmlEscape($_info->getAdyenPspReference())) ?> <br/>
|
44 |
<?php endif; ?>
|
45 |
<?php endif;?>
|
46 |
<?php $paymentMethod = $_info->getAdyenPaymentMethod() ?>
|
67 |
<?php if($this->htmlEscape($this->getInfo()->getAdyenCvcResult()) != ""): ?>
|
68 |
<?php echo Mage::helper('adyen')->__('Cvc result: %s', $this->htmlEscape($this->getInfo()->getAdyenCvcResult())) ?><br/>
|
69 |
<?php endif; ?>
|
70 |
+
<?php if($this->htmlEscape($this->getInfo()->getAdyenTotalFraudScore()) != ""): ?>
|
71 |
+
<?php echo Mage::helper('adyen')->__('Total fraud score: %s', $this->htmlEscape($this->getInfo()->getAdyenTotalFraudScore())) ?><br/>
|
72 |
+
<?php endif; ?>
|
73 |
+
<?php if($this->htmlEscape($this->getInfo()->getAdditionalInformation('number_of_installments')) != "" && $this->htmlEscape($this->getInfo()->getAdditionalInformation('number_of_installments')) > 1): ?>
|
74 |
+
<?php echo Mage::helper('adyen')->__('Number of installments: %s', $this->htmlEscape($this->getInfo()->getAdditionalInformation('number_of_installments'))) ?><br/>
|
75 |
+
<?php endif; ?>
|
76 |
<?php endif;?>
|
@@ -31,9 +31,9 @@
|
|
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/
|
35 |
<?php else : ?>
|
36 |
-
<?php echo Mage::helper('adyen')->__('Adyen PSP Reference: <a href="https://ca-live.adyen.com/ca/ca/
|
37 |
<?php endif; ?>
|
38 |
<?php endif;?>
|
39 |
<?php $paymentMethod = $_info->getAdyenPaymentMethod() ?>
|
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/accounts/showTx.shtml?pspReference=%s&txType=Payment" 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/accounts/showTx.shtml?pspReference=%s&txType=Payment" target="__blank">%s</a>', $this->htmlEscape($_info->getAdyenPspReference()), $this->htmlEscape($_info->getAdyenPspReference())) ?> <br/>
|
37 |
<?php endif; ?>
|
38 |
<?php endif;?>
|
39 |
<?php $paymentMethod = $_info->getAdyenPaymentMethod() ?>
|
@@ -31,9 +31,9 @@
|
|
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/
|
35 |
<?php else : ?>
|
36 |
-
<?php echo Mage::helper('adyen')->__('Adyen PSP Reference: <a href="https://ca-live.adyen.com/ca/ca/
|
37 |
<?php endif; ?>
|
38 |
<?php endif;?>
|
39 |
<?php $paymentMethod = $_info->getCcType() ?>
|
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/accounts/showTx.shtml?pspReference=%s&txType=Payment" 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/accounts/showTx.shtml?pspReference=%s&txType=Payment" target="__blank">%s</a>', $this->htmlEscape($_info->getAdyenPspReference()), $this->htmlEscape($_info->getAdyenPspReference())) ?> <br/>
|
37 |
<?php endif; ?>
|
38 |
<?php endif;?>
|
39 |
<?php $paymentMethod = $_info->getCcType() ?>
|
@@ -31,9 +31,9 @@
|
|
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/
|
35 |
<?php else : ?>
|
36 |
-
<?php echo Mage::helper('adyen')->__('Adyen PSP Reference: <a href="https://ca-live.adyen.com/ca/ca/
|
37 |
<?php endif; ?>
|
38 |
<?php endif;?>
|
39 |
|
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/accounts/showTx.shtml?pspReference=%s&txType=Payment" 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/accounts/showTx.shtml?pspReference=%s&txType=Payment" target="__blank">%s</a>', $this->htmlEscape($_info->getAdyenPspReference()), $this->htmlEscape($_info->getAdyenPspReference())) ?> <br/>
|
37 |
<?php endif; ?>
|
38 |
<?php endif;?>
|
39 |
|
@@ -31,9 +31,9 @@
|
|
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/
|
35 |
<?php else : ?>
|
36 |
-
<?php echo Mage::helper('adyen')->__('Adyen PSP Reference: <a href="https://ca-live.adyen.com/ca/ca/
|
37 |
<?php endif; ?>
|
38 |
<?php endif;?>
|
39 |
<?php $paymentMethod = $_info->getAdyenPaymentMethod() ?>
|
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/accounts/showTx.shtml?pspReference=%s&txType=Payment" 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/accounts/showTx.shtml?pspReference=%s&txType=Payment" target="__blank">%s</a>', $this->htmlEscape($_info->getAdyenPspReference()), $this->htmlEscape($_info->getAdyenPspReference())) ?> <br/>
|
37 |
<?php endif; ?>
|
38 |
<?php endif;?>
|
39 |
<?php $paymentMethod = $_info->getAdyenPaymentMethod() ?>
|
@@ -31,9 +31,9 @@
|
|
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/
|
35 |
<?php else : ?>
|
36 |
-
<?php echo Mage::helper('adyen')->__('Adyen PSP Reference: <a href="https://ca-live.adyen.com/ca/ca/
|
37 |
<?php endif; ?>
|
38 |
<?php endif;?>
|
39 |
<?php $paymentMethod = $_info->getAdyenPaymentMethod() ?>
|
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/accounts/showTx.shtml?pspReference=%s&txType=Payment" 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/accounts/showTx.shtml?pspReference=%s&txType=Payment" target="__blank">%s</a>', $this->htmlEscape($_info->getAdyenPspReference()), $this->htmlEscape($_info->getAdyenPspReference())) ?> <br/>
|
37 |
<?php endif; ?>
|
38 |
<?php endif;?>
|
39 |
<?php $paymentMethod = $_info->getAdyenPaymentMethod() ?>
|
@@ -43,7 +43,7 @@
|
|
43 |
<action method="setTemplate"><template>page/2columns-left.phtml</template></action>
|
44 |
</reference>
|
45 |
<reference name="my.account.wrapper">
|
46 |
-
<block type="adyen/savedCards" name="adyen.savedCards" template="adyen/
|
47 |
</reference>
|
48 |
</adyen_savedcard_index>
|
49 |
|
@@ -53,23 +53,26 @@
|
|
53 |
|
54 |
<checkout_cart_index>
|
55 |
<reference name="top.container">
|
56 |
-
<block type="adyen/scanProduct" name="adyen.scanProduct" template="adyen/
|
57 |
</reference>
|
58 |
<reference name="checkout.cart.methods">
|
59 |
-
<block type="adyen/posExpressCheckout" before="-" name="adyen.pos.express.checkout" template="adyen/
|
60 |
</reference>
|
61 |
</checkout_cart_index>
|
62 |
|
63 |
<checkout_onepage_index>
|
64 |
<reference name="head">
|
|
|
65 |
<action method="addJs"><script>adyen/payment/elv.js</script></action>
|
66 |
<action method="addCss"><stylesheet>css/adyenstyle.css</stylesheet></action>
|
67 |
-
<block type="core/text" name="
|
68 |
<action method="setText">
|
69 |
<text>
|
70 |
<![CDATA[<script type="text/javascript">
|
71 |
Validation.creditCartTypes.set('DC', [new RegExp('^3(?:0[0-5]|[68][0-9])[0-9]{11}$'), new RegExp('^[0-9]{3}$'), true]);
|
72 |
Validation.creditCartTypes.set('CB', [new RegExp('^4[0-9]{12}([0-9]{3})?$'), new RegExp('^[0-9]{3}$'), true]);
|
|
|
|
|
73 |
</script>]]>
|
74 |
</text>
|
75 |
</action>
|
@@ -85,19 +88,33 @@
|
|
85 |
|
86 |
<onestepcheckout_index_index>
|
87 |
<reference name="head">
|
|
|
88 |
<action method="addJs"><script>adyen/payment/elv.js</script></action>
|
89 |
<action method="addCss"><stylesheet>css/adyenstyle.css</stylesheet></action>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
</reference>
|
91 |
</onestepcheckout_index_index>
|
92 |
|
93 |
<checkout_multishipping_billing>
|
94 |
<reference name="head">
|
|
|
95 |
<action method="addJs"><script>adyen/payment/elv.js</script></action>
|
96 |
<action method="addCss"><stylesheet>css/adyenstyle.css</stylesheet></action>
|
97 |
</reference>
|
98 |
</checkout_multishipping_billing>
|
99 |
<checkout_onepage_success>
|
100 |
-
|
101 |
<block type="adyen/checkout_success" name="adyen.checkout.success" template="adyen/checkout/success.phtml"/>
|
102 |
</reference>
|
103 |
</checkout_onepage_success>
|
43 |
<action method="setTemplate"><template>page/2columns-left.phtml</template></action>
|
44 |
</reference>
|
45 |
<reference name="my.account.wrapper">
|
46 |
+
<block type="adyen/savedCards" name="adyen.savedCards" template="adyen/saved_cards.phtml"/>
|
47 |
</reference>
|
48 |
</adyen_savedcard_index>
|
49 |
|
53 |
|
54 |
<checkout_cart_index>
|
55 |
<reference name="top.container">
|
56 |
+
<block type="adyen/scanProduct" name="adyen.scanProduct" template="adyen/scan_product.phtml"/>
|
57 |
</reference>
|
58 |
<reference name="checkout.cart.methods">
|
59 |
+
<block type="adyen/posExpressCheckout" before="-" name="adyen.pos.express.checkout" template="adyen/pos_express_checkout.phtml"/>
|
60 |
</reference>
|
61 |
</checkout_cart_index>
|
62 |
|
63 |
<checkout_onepage_index>
|
64 |
<reference name="head">
|
65 |
+
<action method="addJs"><script>adyen/payment/cc.js</script></action>
|
66 |
<action method="addJs"><script>adyen/payment/elv.js</script></action>
|
67 |
<action method="addCss"><stylesheet>css/adyenstyle.css</stylesheet></action>
|
68 |
+
<block type="core/text" name="adyen.diners.validation">
|
69 |
<action method="setText">
|
70 |
<text>
|
71 |
<![CDATA[<script type="text/javascript">
|
72 |
Validation.creditCartTypes.set('DC', [new RegExp('^3(?:0[0-5]|[68][0-9])[0-9]{11}$'), new RegExp('^[0-9]{3}$'), true]);
|
73 |
Validation.creditCartTypes.set('CB', [new RegExp('^4[0-9]{12}([0-9]{3})?$'), new RegExp('^[0-9]{3}$'), true]);
|
74 |
+
Validation.creditCartTypes.set('ELO', [new RegExp(/^((((636368)|(438935)|(504175)|(451416)|(636297)|(506699))\d{0,10})|((5067)|(4576)|(4011))\d{0,12})$/), new RegExp('^[0-9]{3}$'), true]);
|
75 |
+
Validation.creditCartTypes.set('hipercard', [new RegExp(/^(606282\d{10}(\d{3})?)|(3841\d{15})$/), new RegExp('^[0-9]{3}$'), true]);
|
76 |
</script>]]>
|
77 |
</text>
|
78 |
</action>
|
88 |
|
89 |
<onestepcheckout_index_index>
|
90 |
<reference name="head">
|
91 |
+
<action method="addJs"><script>adyen/payment/cc.js</script></action>
|
92 |
<action method="addJs"><script>adyen/payment/elv.js</script></action>
|
93 |
<action method="addCss"><stylesheet>css/adyenstyle.css</stylesheet></action>
|
94 |
+
<block type="core/text" name="adyen.diners.validation">
|
95 |
+
<action method="setText">
|
96 |
+
<text>
|
97 |
+
<![CDATA[<script type="text/javascript">
|
98 |
+
Validation.creditCartTypes.set('DC', [new RegExp('^3(?:0[0-5]|[68][0-9])[0-9]{11}$'), new RegExp('^[0-9]{3}$'), true]);
|
99 |
+
Validation.creditCartTypes.set('CB', [new RegExp('^4[0-9]{12}([0-9]{3})?$'), new RegExp('^[0-9]{3}$'), true]);
|
100 |
+
Validation.creditCartTypes.set('ELO', [new RegExp(/^((((636368)|(438935)|(504175)|(451416)|(636297)|(506699))\d{0,10})|((5067)|(4576)|(4011))\d{0,12})$/), new RegExp('^[0-9]{3}$'), true]);
|
101 |
+
Validation.creditCartTypes.set('hipercard', [new RegExp(/^(606282\d{10}(\d{3})?)|(3841\d{15})$/), new RegExp('^[0-9]{3}$'), true]);
|
102 |
+
</script>]]>
|
103 |
+
</text>
|
104 |
+
</action>
|
105 |
+
</block>
|
106 |
</reference>
|
107 |
</onestepcheckout_index_index>
|
108 |
|
109 |
<checkout_multishipping_billing>
|
110 |
<reference name="head">
|
111 |
+
<action method="addJs"><script>adyen/payment/cc.js</script></action>
|
112 |
<action method="addJs"><script>adyen/payment/elv.js</script></action>
|
113 |
<action method="addCss"><stylesheet>css/adyenstyle.css</stylesheet></action>
|
114 |
</reference>
|
115 |
</checkout_multishipping_billing>
|
116 |
<checkout_onepage_success>
|
117 |
+
<reference name="content">
|
118 |
<block type="adyen/checkout_success" name="adyen.checkout.success" template="adyen/checkout/success.phtml"/>
|
119 |
</reference>
|
120 |
</checkout_onepage_success>
|
Binary file
|
Binary file
|
@@ -1,27 +1,28 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
*
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
7 |
-
* This source file is subject to the
|
8 |
-
* that is bundled with this package in the file
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/
|
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 |
-
*
|
16 |
-
*
|
17 |
-
*
|
18 |
-
*
|
19 |
-
|
20 |
-
|
21 |
-
* @category
|
22 |
-
* @package
|
23 |
-
* @
|
24 |
-
* @
|
|
|
25 |
*/
|
26 |
?>
|
27 |
<?php
|
@@ -80,12 +81,11 @@ $oneMethod = count($methods) <= 1;
|
|
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($('
|
87 |
{
|
88 |
-
var form = $('
|
89 |
var elements = form.getElementsByTagName('input');
|
90 |
for (var i=0; i<elements.length; i++) elements[i].checked = false;
|
91 |
}
|
@@ -123,6 +123,17 @@ $oneMethod = count($methods) <= 1;
|
|
123 |
}
|
124 |
}
|
125 |
payment.switchMethod(method);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
};
|
127 |
Event.observe($('p_method_<?php echo $_code ?>'), 'change', SwitchMethod);
|
128 |
|
@@ -141,13 +152,12 @@ endif;
|
|
141 |
<?php endif; ?>
|
142 |
|
143 |
// always enable the hpp payment options if this payment method is on
|
144 |
-
if($('
|
145 |
{
|
146 |
-
var form = $('
|
147 |
var elements = form.getElementsByTagName('input');
|
148 |
for (var i=0; i<elements.length; i++) elements[i].disabled = false;
|
149 |
}
|
150 |
-
|
151 |
// always enable the oneclick payments options if this payment method is on
|
152 |
if($('oneclick_payment_form_adyen_oneclick'))
|
153 |
{
|
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
|
81 |
|
82 |
var SwitchMethod= function() {
|
83 |
var method = $('p_method_<?php echo $_code?>').value;
|
|
|
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($('adyen_hpp_enable_fields'))
|
87 |
{
|
88 |
+
var form = $('adyen_hpp_enable_fields');
|
89 |
var elements = form.getElementsByTagName('input');
|
90 |
for (var i=0; i<elements.length; i++) elements[i].checked = false;
|
91 |
}
|
123 |
}
|
124 |
}
|
125 |
payment.switchMethod(method);
|
126 |
+
|
127 |
+
// always enable adyen_hpp
|
128 |
+
if ($('payment_form_adyen_hpp')){
|
129 |
+
var form = $('payment_form_adyen_hpp');
|
130 |
+
form.style.display = '';
|
131 |
+
var elements = form.getElementsByTagName('input');
|
132 |
+
for (var i=0; i<elements.length; i++) elements[i].disabled = false;
|
133 |
+
var elements = form.getElementsByTagName('select');
|
134 |
+
for (var i=0; i<elements.length; i++) elements[i].disabled = false;
|
135 |
+
}
|
136 |
+
|
137 |
};
|
138 |
Event.observe($('p_method_<?php echo $_code ?>'), 'change', SwitchMethod);
|
139 |
|
152 |
<?php endif; ?>
|
153 |
|
154 |
// always enable the hpp payment options if this payment method is on
|
155 |
+
if($('adyen_hpp_enable_fields'))
|
156 |
{
|
157 |
+
var form = $('adyen_hpp_enable_fields');
|
158 |
var elements = form.getElementsByTagName('input');
|
159 |
for (var i=0; i<elements.length; i++) elements[i].disabled = false;
|
160 |
}
|
|
|
161 |
// always enable the oneclick payments options if this payment method is on
|
162 |
if($('oneclick_payment_form_adyen_oneclick'))
|
163 |
{
|
@@ -1,7 +1,34 @@
|
|
1 |
-
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
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 |
+
<div class="adyen-boleto-download-pdf">
|
30 |
+
<?php if ($this->isBoletoPayment()): ?>
|
31 |
+
<?php echo Mage::helper('downloadable')->__('<a href="%s">Click here to download the Boleto payment PDF</a>', $this->getUrlBoletoPDF()) ?>
|
32 |
+
<?php endif; ?>
|
33 |
+
</div>
|
34 |
|
@@ -31,7 +31,7 @@ $_code=$this->getMethodCode();
|
|
31 |
<li>
|
32 |
<div class="input-box">
|
33 |
<label for="<?php echo $_code ?>_social_security_number"><?php echo $this->__('Social Security Number') ?> <span class="required">*</span></label><br />
|
34 |
-
<input type="text" title="<?php echo $this->__('Social Security Number') ?>" class="validate-ipayment-boleto-social-security-number required-entry input-text" id="<?php echo $_code ?>_social_security_number" name="payment[social_security_number]" value="" />
|
35 |
</div>
|
36 |
</li>
|
37 |
|
31 |
<li>
|
32 |
<div class="input-box">
|
33 |
<label for="<?php echo $_code ?>_social_security_number"><?php echo $this->__('Social Security Number') ?> <span class="required">*</span></label><br />
|
34 |
+
<input type="text" title="<?php echo $this->__('Social Security Number') ?>" class="validate-ipayment-boleto-social-security-number required-entry input-text" id="<?php echo $_code ?>_social_security_number" name="payment[social_security_number]" value="<?php echo ($this->getUseTaxvat()) ? $this->getTaxvat() : "" ?>" />
|
35 |
</div>
|
36 |
</li>
|
37 |
|
@@ -27,133 +27,230 @@
|
|
27 |
?>
|
28 |
<?php $_code=$this->getMethodCode() ?>
|
29 |
<ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
<
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
<li>
|
55 |
-
<label for="<?php echo $_code ?>_expiration" class="required"><em>*</em><?php echo $this->__('Expiration Date') ?></label>
|
56 |
-
<div class="input-box">
|
57 |
-
<div class="v-fix">
|
58 |
-
<select id="<?php echo $_code ?>_expiration" <?php echo (!$this->isCseEnabled() ? "name=\"payment[cc_exp_month]\"" : "data-encrypted-name=\"expiryMonth\""); ?> class="month validate-cc-exp required-entry">
|
59 |
-
<?php $_ccExpMonth = $this->getInfoData('cc_exp_month') ?>
|
60 |
-
<?php foreach ($this->getCcMonths() as $k=>$v): ?>
|
61 |
-
<option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccExpMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
|
62 |
-
<?php endforeach ?>
|
63 |
-
</select>
|
64 |
-
</div>
|
65 |
-
<div class="v-fix">
|
66 |
-
<?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
|
67 |
-
<select id="<?php echo $_code ?>_expiration_yr" <?php echo (!$this->isCseEnabled() ? "name=\"payment[cc_exp_year]\"" : "data-encrypted-name=\"expiryYear\""); ?> class="year required-entry">
|
68 |
-
<?php foreach ($this->getCcYears() as $k=>$v): ?>
|
69 |
-
<option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccExpYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
|
70 |
-
<?php endforeach ?>
|
71 |
-
</select>
|
72 |
-
</div>
|
73 |
-
</div>
|
74 |
-
</li>
|
75 |
-
<?php echo $this->getChildHtml() ?>
|
76 |
-
<?php if($this->hasVerification()): ?>
|
77 |
-
<li>
|
78 |
-
<label for="<?php echo $_code ?>_cc_cid" class="required"><em>*</em><?php echo $this->__('Card Verification Number') ?></label>
|
79 |
-
<div class="input-box">
|
80 |
-
<div class="v-fix">
|
81 |
-
<input type="text" title="<?php echo $this->__('Card Verification Number') ?>" class="input-text cvv required-entry" id="<?php echo $_code ?>_cc_cid" <?php echo (!$this->isCseEnabled() ? "name=\"payment[cc_cid]\"" : "data-encrypted-name=\"cvc\""); ?> value="" />
|
82 |
-
</div>
|
83 |
-
<a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
|
84 |
-
</div>
|
85 |
-
</li>
|
86 |
-
<?php endif; ?>
|
87 |
-
<?php if($this->hasInstallments()): ?>
|
88 |
-
<li>
|
89 |
-
<label for="<?php echo $_code ?>_installments" class="required"><em>*</em><?php echo $this->__('Installments') ?></label>
|
90 |
-
<div class="input-box">
|
91 |
-
<div class="v-fix">
|
92 |
-
<select id="<?php echo $_code ?>_installments" name="payment[additional_data]" class="number required-entry">
|
93 |
-
<?php foreach ($this->getPossibleInstallments() as $k=>$v): ?>
|
94 |
-
<option value="<?php echo $k?$k:'' ?>"><?php echo $v ?></option>
|
95 |
-
<?php endforeach ?>
|
96 |
-
</select>
|
97 |
-
</div>
|
98 |
-
</div>
|
99 |
-
</li>
|
100 |
-
<?php endif;?>
|
101 |
-
|
102 |
-
<?php if($this->getRecurringType() == "ONECLICK" || $this->getRecurringType() == "ONECLICK,RECURRING"): ?>
|
103 |
-
<li>
|
104 |
-
<div class="input-box">
|
105 |
-
<div class="v-fix">
|
106 |
-
<input type="checkbox" name="payment[store_cc]" id="<?php echo $_code ?>_store_cc" value="1" checked />
|
107 |
-
<label for="<?php echo $_code ?>_store_cc" class="required"><em>*</em><?php echo $this->__('Remember these details') ?></label>
|
108 |
-
</div>
|
109 |
-
</div>
|
110 |
-
</li>
|
111 |
-
<?php endif; ?>
|
112 |
-
</ul>
|
113 |
|
114 |
-
|
115 |
-
|
|
|
116 |
|
117 |
-
|
|
|
118 |
|
119 |
-
|
120 |
-
|
|
|
|
|
|
|
|
|
121 |
|
122 |
-
|
123 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
|
125 |
-
|
|
|
|
|
126 |
|
127 |
-
|
128 |
-
|
129 |
-
|
|
|
130 |
|
131 |
-
|
132 |
|
133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
|
135 |
-
|
|
|
|
|
|
|
|
|
|
|
136 |
|
137 |
-
|
138 |
-
var opt = document.createElement('option');
|
139 |
-
opt.text = response[key]
|
140 |
-
opt.value = key;
|
141 |
-
$('<?php echo $_code ?>_installments').options.add(opt);
|
142 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
}
|
144 |
}
|
145 |
-
|
146 |
-
onFailure: function(){
|
147 |
-
alert('<?php echo $this->jsQuoteEscape($this->__('Server Error. Please try again.')) ?>');
|
148 |
}
|
149 |
-
});
|
150 |
-
}
|
151 |
-
// event on change Credit Card Type
|
152 |
-
Event.observe($('<?php echo $_code?>_cc_type'), 'change', ChangeCCType);
|
153 |
|
154 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
<?php if ($this->isCseEnabled()): ?>
|
158 |
<input type="hidden" id="<?php echo $_code ?>_encrypted_form_expiry_generationtime" value="<?php echo date("c"); ?>" data-encrypted-name="generationtime" />
|
159 |
<input type="hidden" id="adyen-cse-form" />
|
@@ -204,6 +301,22 @@
|
|
204 |
cse.call(this);
|
205 |
});
|
206 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
207 |
}
|
208 |
|
209 |
if (document.readyState === "complete") {
|
27 |
?>
|
28 |
<?php $_code=$this->getMethodCode() ?>
|
29 |
<ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
|
30 |
+
<li class="adyen_payment_creditcard_labels">
|
31 |
+
<?php $count = 0;
|
32 |
+
foreach ($this->getCcAvailableTypes() as $_typeCode => $_typeName): ?>
|
33 |
+
<?php $_filename = $this->getSkinUrl('images'.DS.'adyen'.DS. strtolower($_typeCode) . "_small.png"); ?>
|
34 |
+
<img id="cc_type_<?php echo $count; ?>" width="40" height="22" src="<?php echo $_filename; ?>" alt="" class="mid" />
|
35 |
+
<?php ++$count;
|
36 |
+
endforeach; ?>
|
37 |
+
<input type="hidden" id="<?php echo $_code ?>_cc_type" name="payment[cc_type]" value=""/>
|
38 |
+
</li>
|
39 |
+
<li class="adyen_payment_input_fields">
|
40 |
+
<label for="<?php echo $_code ?>_cc_owner" class="required"><em>*</em><?php echo $this->__('Name on Card') ?></label>
|
41 |
+
<div class="input-box">
|
42 |
+
<input type="text" title="<?php echo $this->__('Name on Card') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_owner" <?php echo (!$this->isCseEnabled() ? "name=\"payment[cc_owner]\"" : "data-encrypted-name=\"holderName\""); ?> value="<?php echo $this->htmlEscape($this->getInfoData('cc_owner')) ?>" maxlength="100" />
|
43 |
+
</div>
|
44 |
+
</li>
|
45 |
+
<li class="adyen_payment_input_fields">
|
46 |
+
<label for="<?php echo $_code ?>_cc_number" class="required"><em>*</em><?php echo $this->__('Credit Card Number') ?></label>
|
47 |
+
<div class="input-box">
|
48 |
+
<input type="text" id="<?php echo $_code ?>_cc_number" <?php echo (!$this->isCseEnabled() ? "name=\"payment[cc_number]\"" : " data-encrypted-name=\"number\""); ?> title="<?php echo $this->__('Credit Card Number') ?>" class="input-text validate-cc-type required-entry" value="" maxlength="23"/>
|
49 |
+
<script type="text/javascript">
|
50 |
+
var group_types = new Array();
|
51 |
+
<?php foreach ($this->getCcAvailableTypes() as $_typeCode => $_typeName): ?>
|
52 |
+
group_types.push("<?php echo $_typeCode; ?>");
|
53 |
+
<?php endforeach ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
|
55 |
+
card_previousCardNumber = "";
|
56 |
+
|
57 |
+
function selectBrand() {
|
58 |
|
59 |
+
cardNumber = (document.getElementById( '<?php echo $_code ?>_cc_number' ).value);
|
60 |
+
dontHideErrorFrame = null;
|
61 |
|
62 |
+
// empty card field - reset all
|
63 |
+
if (cardNumber.length == 0) {
|
64 |
+
card_previousCardNumber = cardNumber;
|
65 |
+
cardSetCardBrand(null, false, group_types);
|
66 |
+
return;
|
67 |
+
}
|
68 |
|
69 |
+
// When editing the card (but not adding digits at the end), don't reformat the number
|
70 |
+
var l=0;
|
71 |
+
while(l < card_previousCardNumber.length && l < cardNumber.length) {
|
72 |
+
if(cardNumber[l] != card_previousCardNumber[l]) {
|
73 |
+
card_previousCardNumber = cardNumber;
|
74 |
+
return;
|
75 |
+
}
|
76 |
+
l++;
|
77 |
+
}
|
78 |
|
79 |
+
// remove all whitespace
|
80 |
+
reg = /\s+/g;
|
81 |
+
cardNumber = cardNumber.replace(reg,'');
|
82 |
|
83 |
+
nrOfDigits = cardNumber.length;
|
84 |
+
if(nrOfDigits > 19){
|
85 |
+
return;
|
86 |
+
}
|
87 |
|
88 |
+
baseCard = getBaseCard(cardNumber, group_types);
|
89 |
|
90 |
+
if(baseCard != null) {
|
91 |
+
cardSetCardBrand(baseCard, true, group_types);
|
92 |
+
} else if(nrOfDigits > 4) {
|
93 |
+
cardSetCardBrand(null, true, group_types);
|
94 |
+
} else {
|
95 |
+
cardSetCardBrand(null, false, group_types);
|
96 |
+
}
|
97 |
|
98 |
+
//show value with white space after four numbers
|
99 |
+
result = cardNumber.replace(/(\d{4})/g, '$1 ');
|
100 |
+
result = result.replace(/\s+$/, ''); //remove trailing spaces
|
101 |
+
card_previousCardNumber = result;
|
102 |
+
document.getElementById( '<?php echo $_code; ?>_cc_number' ).value = result;
|
103 |
+
}
|
104 |
|
105 |
+
function cardSetCardBrand(selectedCard, greyInactive, group_types) {
|
|
|
|
|
|
|
|
|
106 |
|
107 |
+
for(var i = 0; i < group_types.length; ++i) {
|
108 |
+
var imageId = 'cc_type_' + i;
|
109 |
+
if(selectedCard != null && group_types[i] == selectedCard.cardtype) {
|
110 |
+
// remove class
|
111 |
+
$(imageId).removeClassName('grey');
|
112 |
+
// set hidden field cc type for installments
|
113 |
+
$('<?php echo $_code ?>_cc_type').setValue(selectedCard.cardtype);
|
114 |
+
} else {
|
115 |
+
if(greyInactive) {
|
116 |
+
// add class
|
117 |
+
$(imageId).addClassName('grey');
|
118 |
+
} else {
|
119 |
+
// remove class
|
120 |
+
$(imageId).removeClassName('grey');
|
121 |
}
|
122 |
}
|
123 |
+
document.getElementById(imageId).style.display="inline";
|
|
|
|
|
124 |
}
|
|
|
|
|
|
|
|
|
125 |
|
126 |
+
<?php if($this->hasInstallments()): ?>
|
127 |
+
if(selectedCard != null ) {
|
128 |
+
var interval = setInterval(getInstallments(selectedCard.cardtype), 500);
|
129 |
+
}
|
130 |
+
<?php endif; ?>
|
131 |
+
}
|
132 |
+
|
133 |
+
var ajaxReq;
|
134 |
+
function getInstallments(variant) {
|
135 |
+
|
136 |
+
// get the installments for this cardtype
|
137 |
+
var ccType = variant;
|
138 |
+
console.log(ccType);
|
139 |
+
|
140 |
+
var url = '<?php echo $this->getUrl('adyen/GetInstallments', array('_secure'=>true)); ?>';
|
141 |
+
|
142 |
+
if(ajaxReq && ajaxReq.readystate != 4){
|
143 |
+
ajaxReq.transport.abort();
|
144 |
+
}
|
145 |
+
|
146 |
+
ajaxReq = new Ajax.Request(url, {
|
147 |
+
parameters: {ccType: ccType, isAjax: 1, method: 'POST'},
|
148 |
+
onSuccess: function(transport) {
|
149 |
+
|
150 |
+
if(transport.status == 200) {
|
151 |
+
|
152 |
+
// get current selected installment
|
153 |
+
var currentSelectedInstallment = document.getElementById('<?php echo $_code ?>_installments').getValue();
|
154 |
+
|
155 |
+
// clear the select box
|
156 |
+
document.getElementById('<?php echo $_code ?>_installments').options.length = 0;
|
157 |
+
|
158 |
+
var response = transport.responseText.evalJSON();
|
159 |
+
|
160 |
+
var sel = false;
|
161 |
+
for (var key in response) {
|
162 |
+
|
163 |
+
// change the installments
|
164 |
+
var opt = document.createElement('option');
|
165 |
+
opt.text = response[key]
|
166 |
+
opt.value = key;
|
167 |
+
// check if selected installment is still available
|
168 |
+
if(currentSelectedInstallment == key) {
|
169 |
+
sel = true;
|
170 |
+
}
|
171 |
+
$('<?php echo $_code ?>_installments').options.add(opt);
|
172 |
+
}
|
173 |
+
|
174 |
+
if(sel == true && currentSelectedInstallment) {
|
175 |
+
document.getElementById('adyen_cc_installments').value=currentSelectedInstallment;
|
176 |
+
}
|
177 |
+
}
|
178 |
+
},
|
179 |
+
onFailure: function(){
|
180 |
+
alert('<?php echo $this->jsQuoteEscape($this->__('Server Error. Please try again.')) ?>');
|
181 |
+
}
|
182 |
+
});
|
183 |
+
}
|
184 |
+
|
185 |
+
// default
|
186 |
+
cardSetCardBrand(null, false, group_types);
|
187 |
+
|
188 |
+
// observers
|
189 |
+
Event.observe($('<?php echo $_code ?>_cc_number'), 'change', selectBrand);
|
190 |
+
Event.observe($('<?php echo $_code ?>_cc_number'), 'keyup', selectBrand);
|
191 |
+
|
192 |
+
</script>
|
193 |
+
</div>
|
194 |
+
</li>
|
195 |
+
<li class="adyen_payment_input_fields">
|
196 |
+
<label for="<?php echo $_code ?>_expiration" class="required"><em>*</em><?php echo $this->__('Expiration Date') ?></label>
|
197 |
+
<div class="input-box">
|
198 |
+
<div class="v-fix">
|
199 |
+
<select id="<?php echo $_code ?>_expiration" <?php echo (!$this->isCseEnabled() ? "name=\"payment[cc_exp_month]\"" : "data-encrypted-name=\"expiryMonth\""); ?> class="month validate-cc-exp required-entry">
|
200 |
+
<?php $_ccExpMonth = $this->getInfoData('cc_exp_month') ?>
|
201 |
+
<?php foreach ($this->getCcMonths() as $k=>$v): ?>
|
202 |
+
<option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccExpMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
|
203 |
+
<?php endforeach ?>
|
204 |
+
</select>
|
205 |
+
</div>
|
206 |
+
<div class="v-fix">
|
207 |
+
<?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
|
208 |
+
<select id="<?php echo $_code ?>_expiration_yr" <?php echo (!$this->isCseEnabled() ? "name=\"payment[cc_exp_year]\"" : "data-encrypted-name=\"expiryYear\""); ?> class="year required-entry">
|
209 |
+
<?php foreach ($this->getCcYears() as $k=>$v): ?>
|
210 |
+
<option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccExpYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
|
211 |
+
<?php endforeach ?>
|
212 |
+
</select>
|
213 |
+
</div>
|
214 |
+
</div>
|
215 |
+
</li>
|
216 |
+
<?php echo $this->getChildHtml() ?>
|
217 |
+
<?php if($this->hasVerification()): ?>
|
218 |
+
<li class="adyen_payment_input_fields">
|
219 |
+
<label for="<?php echo $_code ?>_cc_cid" class="required"><em>*</em><?php echo $this->__('Card Verification Number') ?></label>
|
220 |
+
<div class="input-box">
|
221 |
+
<div class="v-fix">
|
222 |
+
<input type="text" title="<?php echo $this->__('Card Verification Number') ?>" class="input-text cvv required-entry" id="<?php echo $_code ?>_cc_cid" <?php echo (!$this->isCseEnabled() ? "name=\"payment[cc_cid]\"" : "data-encrypted-name=\"cvc\""); ?> value="" maxlength="4" />
|
223 |
+
</div>
|
224 |
+
<a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
|
225 |
+
</div>
|
226 |
+
</li>
|
227 |
<?php endif; ?>
|
228 |
+
<?php if($this->hasInstallments()): ?>
|
229 |
+
<li class="adyen_payment_input_fields">
|
230 |
+
<label for="<?php echo $_code ?>_installments" class="required"><em>*</em><?php echo $this->__('Installments') ?></label>
|
231 |
+
<div class="input-box">
|
232 |
+
<div class="v-fix">
|
233 |
+
<select id="<?php echo $_code ?>_installments" name="payment[additional_data]" class="number required-entry">
|
234 |
+
<?php foreach ($this->getPossibleInstallments() as $k=>$v): ?>
|
235 |
+
<option value="<?php echo $k?$k:'' ?>"><?php echo $v ?></option>
|
236 |
+
<?php endforeach ?>
|
237 |
+
</select>
|
238 |
+
</div>
|
239 |
+
</div>
|
240 |
+
</li>
|
241 |
+
<?php endif;?>
|
242 |
|
243 |
+
<?php if($this->getRecurringType() == "ONECLICK" || $this->getRecurringType() == "ONECLICK,RECURRING"): ?>
|
244 |
+
<li class="adyen_payment_input_fields">
|
245 |
+
<div class="input-box">
|
246 |
+
<div class="v-fix">
|
247 |
+
<input type="checkbox" name="payment[store_cc]" id="<?php echo $_code ?>_store_cc" value="1" checked />
|
248 |
+
<label for="<?php echo $_code ?>_store_cc" class="required"><em>*</em><?php echo $this->__('Remember these details') ?></label>
|
249 |
+
</div>
|
250 |
+
</div>
|
251 |
+
</li>
|
252 |
+
<?php endif; ?>
|
253 |
+
</ul>
|
254 |
<?php if ($this->isCseEnabled()): ?>
|
255 |
<input type="hidden" id="<?php echo $_code ?>_encrypted_form_expiry_generationtime" value="<?php echo date("c"); ?>" data-encrypted-name="generationtime" />
|
256 |
<input type="hidden" id="adyen-cse-form" />
|
301 |
cse.call(this);
|
302 |
});
|
303 |
}
|
304 |
+
|
305 |
+
// fix for the IWD One Page Checkout
|
306 |
+
if($('checkout-review-submit')) {
|
307 |
+
$$('.opc-btn-checkout').each(function(element) {
|
308 |
+
element.observe('click', function(e) {
|
309 |
+
cse.call(this);
|
310 |
+
});
|
311 |
+
})
|
312 |
+
}
|
313 |
+
|
314 |
+
//Fix for Inovarti One Step Checkout Brasil
|
315 |
+
if($('onestepcheckout-place-order-button')) {
|
316 |
+
$('onestepcheckout-place-order-button').observe('click', function(e) {
|
317 |
+
cse.call(this);
|
318 |
+
});
|
319 |
+
}
|
320 |
}
|
321 |
|
322 |
if (document.readyState === "complete") {
|
@@ -29,15 +29,11 @@
|
|
29 |
|
30 |
<?php $disabled = $this->getHppOptionsDisabled();?>
|
31 |
|
32 |
-
|
|
|
33 |
<?php $hidePaymentMethod = ($disabled) ? ' style="display: none;"' : '';?>
|
34 |
-
<?php
|
35 |
|
36 |
-
|
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();
|
@@ -47,51 +43,62 @@
|
|
47 |
<div class="input-box required-entry">
|
48 |
<?php foreach ($enabledTypes as $_typeCode=>$_type): ?>
|
49 |
<?php $_typeName = $_type['name']; ?>
|
50 |
-
<?php $filename =
|
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 |
<input type="hidden" name="payment[hpp_type_label_<?php echo $_typeCode ?>]" value="<?php echo $_typeName; ?>" />
|
56 |
</td>
|
57 |
-
<?php
|
58 |
-
<td width="80px"><img src="<?php echo $this->getSkinUrl('images'.DS.'adyen'.DS."$_typeCode.png") ?>" alt="<?php echo $_typeName ?>" /></td>
|
59 |
-
<?php endif ?>
|
60 |
|
61 |
<?php if ($_typeName == "pm.c_cash.buttonName"):
|
62 |
$_typeName = "Cash";
|
63 |
endif; ?>
|
64 |
-
<td><?php echo $this->__($_typeName) ?></td>
|
65 |
-
|
66 |
-
<?php if ($_typeCode == 'ideal' && !empty($_type['issuers'])): ?>
|
67 |
-
<td class="payment_form_ideal">
|
68 |
-
<fieldset class="form-list">
|
69 |
-
<ul id="payment_form_ideal" style="display:none">
|
70 |
-
<?php
|
71 |
-
foreach ($_type['issuers'] as $_issueId => $_IssueLabel): ?>
|
72 |
-
<?php
|
73 |
-
$_bankFile = strtoupper(str_replace(" ", '', $_IssueLabel));
|
74 |
-
$_filename = Mage::getBaseDir().DS.'skin'.DS.'frontend'.DS.'base'.DS.'default'.DS.'images'.DS.'adyen'.DS."$_bankFile.png";
|
75 |
-
if (empty($_issueId) || empty($_IssueLabel)) continue;
|
76 |
-
?>
|
77 |
-
<table class="banks">
|
78 |
-
<tr>
|
79 |
-
<td width="20px">
|
80 |
-
<input type="radio" id="hpp_ideal_type_<?php echo $_issueId ?>" name="payment[hpp_ideal_type]" value="<?php echo $_issueId .DS. $_IssueLabel ?>"/>
|
81 |
-
</td>
|
82 |
-
<?php if (file_exists($_filename)): ?>
|
83 |
-
<td width="80px"><img src="<?php echo $this->getSkinUrl('images'.DS.'adyen'.DS."$_bankFile.png") ?>" alt="<?php echo $_IssueLabel ?>" label="<?php echo $_IssueLabel ?>" /></td>
|
84 |
-
<?php else: ?>
|
85 |
-
<td width="80px" class="label_hpp_ideal_type"><label width="80px" for="ideal_type_label_<?php echo $_issueId ?>"><?php echo $_IssueLabel ?></label></td>
|
86 |
-
<?php endif; ?>
|
87 |
-
</tr>
|
88 |
-
</table>
|
89 |
-
<?php endforeach ?>
|
90 |
-
</ul>
|
91 |
-
</fieldset>
|
92 |
-
</td>
|
93 |
-
<?php endif; ?>
|
94 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
</table>
|
96 |
<script type="text/javascript">
|
97 |
//<![CDATA[
|
@@ -129,13 +136,9 @@
|
|
129 |
}
|
130 |
|
131 |
var method = $('hpp_type_<?php echo $_typeCode?>');
|
132 |
-
|
133 |
// set the adyen_hpp payment method
|
134 |
$('p_method_adyen_hpp').checked = true;
|
135 |
-
|
136 |
payment.switchMethod("adyen_hpp");
|
137 |
-
|
138 |
-
|
139 |
if (method.value == 'ideal') {
|
140 |
$('payment_form_ideal').show();
|
141 |
} else {
|
@@ -154,5 +157,5 @@
|
|
154 |
<?php echo $this->__('You will be redirected to Adyen website when you place an order.') ?>
|
155 |
</li>
|
156 |
<?php endif; ?>
|
157 |
-
</ul>
|
158 |
</fieldset>
|
29 |
|
30 |
<?php $disabled = $this->getHppOptionsDisabled();?>
|
31 |
|
32 |
+
<?php $id = ($disabled) ? "" : "adyen_hpp_enable_fields"; ?>
|
33 |
+
<fieldset id="<?php echo $id; ?>" class="">
|
34 |
<?php $hidePaymentMethod = ($disabled) ? ' style="display: none;"' : '';?>
|
|
|
35 |
|
36 |
+
<ul id="<?php echo "payment_form_" . $_code; ?>"<?php echo $hidePaymentMethod; ?>>
|
|
|
|
|
|
|
|
|
37 |
<?php
|
38 |
if(empty($disabled)):
|
39 |
$enabledTypes = $this->getHppAvailableTypes();
|
43 |
<div class="input-box required-entry">
|
44 |
<?php foreach ($enabledTypes as $_typeCode=>$_type): ?>
|
45 |
<?php $_typeName = $_type['name']; ?>
|
46 |
+
<?php $filename = $this->getSkinUrl('images'.DS.'adyen'.DS. $_typeCode . ".png"); ?>
|
47 |
+
<table class="table_adyen_<?php echo $_typeCode; ?>">
|
48 |
+
<tr class="adyen_payment_method_row">
|
49 |
+
<td class="col_radio" width="20px">
|
50 |
<input type="radio" id="hpp_type_<?php echo $_typeCode ?>" name="payment[hpp_type]" value="<?php echo $_typeCode ?>"/>
|
51 |
<input type="hidden" name="payment[hpp_type_label_<?php echo $_typeCode ?>]" value="<?php echo $_typeName; ?>" />
|
52 |
</td>
|
53 |
+
<td class="col_img" width="80px"><label for="hpp_type_<?php echo $_typeCode ?>"><img src="<?php echo $this->getSkinUrl('images'.DS.'adyen'.DS."$_typeCode.png") ?>" alt="<?php echo $_typeName ?>" /></label></td>
|
|
|
|
|
54 |
|
55 |
<?php if ($_typeName == "pm.c_cash.buttonName"):
|
56 |
$_typeName = "Cash";
|
57 |
endif; ?>
|
58 |
+
<td class="col_name"><label for="hpp_type_<?php echo $_typeCode ?>"><?php echo $this->__($_typeName) ?></label></td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
</tr>
|
60 |
+
<?php if ($_typeCode == 'ideal' && !empty($_type['issuers'])): ?>
|
61 |
+
<tr class="adyen_ideal_row">
|
62 |
+
<td colspan="3" class="payment_form_ideal">
|
63 |
+
<fieldset class="form-list" id="payment_form_ideal" style="display:none">
|
64 |
+
<?php
|
65 |
+
if($this->getShowIdealLogos()):
|
66 |
+
foreach ($_type['issuers'] as $_issueId => $_IssueLabel): ?>
|
67 |
+
<?php
|
68 |
+
$_bankFile = strtoupper(str_replace(" ", '', $_IssueLabel));
|
69 |
+
$_filename = $this->getSkinUrl('images'.DS.'adyen'.DS. $_bankFile . ".png");
|
70 |
+
if (empty($_issueId) || empty($_IssueLabel)) continue;
|
71 |
+
?>
|
72 |
+
<table class="banks">
|
73 |
+
<tr>
|
74 |
+
<td width="20px">
|
75 |
+
<input type="radio" id="hpp_ideal_type_<?php echo $_issueId ?>" name="payment[hpp_ideal_type]" value="<?php echo $_issueId .DS. $_IssueLabel ?>"/>
|
76 |
+
</td>
|
77 |
+
<td width="80px"><label for="hpp_ideal_type_<?php echo $_issueId ?>"><img src="<?php echo $this->getSkinUrl('images'.DS.'adyen'.DS."$_bankFile.png") ?>" alt="<?php echo $_IssueLabel ?>" label="<?php echo $_IssueLabel ?>" /></label></td>
|
78 |
+
</tr>
|
79 |
+
</table>
|
80 |
+
<script type="text/javascript">
|
81 |
+
$("hpp_ideal_type_<?php echo $_issueId; ?>").observe("click", function (e) {
|
82 |
+
// set ideal as payment method
|
83 |
+
$('hpp_type_ideal').checked = true;
|
84 |
+
// set the adyen_hpp payment method
|
85 |
+
$('p_method_adyen_hpp').checked = true;
|
86 |
+
payment.switchMethod("adyen_hpp");
|
87 |
+
});
|
88 |
+
</script>
|
89 |
+
<?php endforeach;
|
90 |
+
else:?>
|
91 |
+
<select class="adyen_select_ideal" name="payment[hpp_ideal_type]">
|
92 |
+
<option value=""><?php echo $this->__('Choose Your Bank');?></option>
|
93 |
+
<?php foreach ($_type['issuers'] as $_issueId => $_IssueLabel): ?>
|
94 |
+
<option value="<?php echo $_issueId .DS. $_IssueLabel ?>"><?php echo $_IssueLabel; ?></option>
|
95 |
+
<?php endforeach;?>
|
96 |
+
</select>
|
97 |
+
<?php endif; ?>
|
98 |
+
</fieldset>
|
99 |
+
</td>
|
100 |
+
</tr>
|
101 |
+
<?php endif; ?>
|
102 |
</table>
|
103 |
<script type="text/javascript">
|
104 |
//<![CDATA[
|
136 |
}
|
137 |
|
138 |
var method = $('hpp_type_<?php echo $_typeCode?>');
|
|
|
139 |
// set the adyen_hpp payment method
|
140 |
$('p_method_adyen_hpp').checked = true;
|
|
|
141 |
payment.switchMethod("adyen_hpp");
|
|
|
|
|
142 |
if (method.value == 'ideal') {
|
143 |
$('payment_form_ideal').show();
|
144 |
} else {
|
157 |
<?php echo $this->__('You will be redirected to Adyen website when you place an order.') ?>
|
158 |
</li>
|
159 |
<?php endif; ?>
|
160 |
+
</ul>
|
161 |
</fieldset>
|
@@ -163,10 +163,20 @@
|
|
163 |
$('p_method_adyen_oneclick').checked = true;
|
164 |
payment.switchMethod("adyen_oneclick");
|
165 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
// uncheck hpp_method if exists
|
167 |
-
if($('
|
168 |
{
|
169 |
-
var form = $('
|
170 |
var elements = form.getElementsByTagName('input');
|
171 |
for (var i=0; i<elements.length; i++) elements[i].checked = false;
|
172 |
}
|
@@ -230,7 +240,7 @@
|
|
230 |
// and uncheck HPP payment method selection
|
231 |
function removeAllAttributeCvc() {
|
232 |
|
233 |
-
var form = $('
|
234 |
if(form)
|
235 |
{
|
236 |
var elements = form.getElementsByTagName('input');
|
@@ -356,6 +366,22 @@
|
|
356 |
cseOneClick.call(this);
|
357 |
});
|
358 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
359 |
}
|
360 |
|
361 |
if (document.readyState === "complete") {
|
163 |
$('p_method_adyen_oneclick').checked = true;
|
164 |
payment.switchMethod("adyen_oneclick");
|
165 |
|
166 |
+
// always enable adyen_hpp
|
167 |
+
if ($('payment_form_adyen_hpp')){
|
168 |
+
var form = $('payment_form_adyen_hpp');
|
169 |
+
form.style.display = '';
|
170 |
+
var elements = form.getElementsByTagName('input');
|
171 |
+
for (var i=0; i<elements.length; i++) elements[i].disabled = false;
|
172 |
+
var elements = form.getElementsByTagName('select');
|
173 |
+
for (var i=0; i<elements.length; i++) elements[i].disabled = false;
|
174 |
+
}
|
175 |
+
|
176 |
// uncheck hpp_method if exists
|
177 |
+
if($('adyen_hpp_enable_fields'))
|
178 |
{
|
179 |
+
var form = $('adyen_hpp_enable_fields');
|
180 |
var elements = form.getElementsByTagName('input');
|
181 |
for (var i=0; i<elements.length; i++) elements[i].checked = false;
|
182 |
}
|
240 |
// and uncheck HPP payment method selection
|
241 |
function removeAllAttributeCvc() {
|
242 |
|
243 |
+
var form = $('adyen_hpp_enable_fields');
|
244 |
if(form)
|
245 |
{
|
246 |
var elements = form.getElementsByTagName('input');
|
366 |
cseOneClick.call(this);
|
367 |
});
|
368 |
}
|
369 |
+
|
370 |
+
// fix for the IWD One Page Checkout
|
371 |
+
if($('checkout-review-submit')) {
|
372 |
+
$$('.opc-btn-checkout').each(function(element) {
|
373 |
+
element.observe('click', function(e) {
|
374 |
+
cse.call(this);
|
375 |
+
});
|
376 |
+
})
|
377 |
+
}
|
378 |
+
|
379 |
+
//Fix for Inovarti One Step Checkout Brasil
|
380 |
+
if($('onestepcheckout-place-order-button')) {
|
381 |
+
$('onestepcheckout-place-order-button').observe('click', function(e) {
|
382 |
+
cse.call(this);
|
383 |
+
});
|
384 |
+
}
|
385 |
}
|
386 |
|
387 |
if (document.readyState === "complete") {
|
@@ -84,6 +84,16 @@
|
|
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.') ?>
|
84 |
</script>
|
85 |
</li>
|
86 |
<?php endif; ?>
|
87 |
+
<?php if($this->telephoneShow()):?>
|
88 |
+
<li class="fields">
|
89 |
+
<div class="field">
|
90 |
+
<label for="billing:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
|
91 |
+
<div class="input-box">
|
92 |
+
<input type="tel" name="payment[telephone]" value="<?php echo $this->escapeHtml($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" id="telephone" />
|
93 |
+
</div>
|
94 |
+
</div>
|
95 |
+
</li>
|
96 |
+
<?php endif; ?>
|
97 |
|
98 |
<li>
|
99 |
<?php echo $this->__('You will be redirected to Adyen website when you place an order.') ?>
|
@@ -57,44 +57,9 @@ $_code=$this->getMethodCode();
|
|
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 |
-
|
61 |
-
|
62 |
-
|
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>
|
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 |
+
<?php foreach($this->getCountries() as $_country): ?>
|
61 |
+
<option value="<?php echo $_country['value'] ?>"<?php echo ($_country['value'] == $this->getShopperCountryId()) ? " selected" : ""; ?>><?php echo $_country['label'] ?></option>
|
62 |
+
<?php endforeach; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
</select>
|
64 |
</div>
|
65 |
</li>
|
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* Adyen Payment Module
|
5 |
*
|
@@ -26,11 +25,7 @@
|
|
26 |
* @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
|
27 |
*/
|
28 |
?>
|
29 |
-
|
30 |
-
<
|
31 |
-
<
|
32 |
-
|
33 |
-
<body>
|
34 |
-
<?php echo $this->getChildHtml('content') ?>
|
35 |
-
</body>
|
36 |
-
</html>
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* Adyen Payment Module
|
4 |
*
|
25 |
* @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
|
26 |
*/
|
27 |
?>
|
28 |
+
|
29 |
+
<img class="adyen-payment-method-icon v-middle <?php echo $this->getPaymentMethodClass(); ?>" src="<?php echo $this->getPaymentMethodIcon(); ?>" width="66" height="43" alt="<?php echo $this->getPaymentMethodLabel() ?>" border="0"/>
|
30 |
+
<span><?php echo $this->getPaymentMethodLabel(); ?></span>
|
31 |
+
|
|
|
|
|
|
|
|
@@ -1,4 +1,31 @@
|
|
|
|
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
<?php if($this->hasExpressCheckout() || $this->hasCashExpressCheckout() ): ?>
|
3 |
|
4 |
<div id="adyen-checkout-wrapper">
|
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 |
<?php if($this->hasExpressCheckout() || $this->hasCashExpressCheckout() ): ?>
|
30 |
|
31 |
<div id="adyen-checkout-wrapper">
|
@@ -1,4 +1,31 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
<?php /* @var $this Adyen_Payment_Block_SavedCards */ ?>
|
3 |
<div class="page-title">
|
4 |
<h1><?php echo $this->__('My Saved cards') ?></h1>
|
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 |
<?php /* @var $this Adyen_Payment_Block_SavedCards */ ?>
|
30 |
<div class="page-title">
|
31 |
<h1><?php echo $this->__('My Saved cards') ?></h1>
|
@@ -1,4 +1,31 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
<?php if($this->hasEnableScanner()): ?>
|
3 |
<div id="adyenCustomScanWrapper">
|
4 |
<form id="addToCartBarCode" method='post' action="<?php echo $this->getUrl("adyen/updateCart/index", array('_secure'=>true)); ?>">
|
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 |
<?php if($this->hasEnableScanner()): ?>
|
30 |
<div id="adyenCustomScanWrapper">
|
31 |
<form id="addToCartBarCode" method='post' action="<?php echo $this->getUrl("adyen/updateCart/index", array('_secure'=>true)); ?>">
|
@@ -1,1319 +0,0 @@
|
|
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"> </div>');
|
247 |
-
}
|
248 |
-
|
249 |
-
if(payment_methods){
|
250 |
-
payment_methods.update('<div class="loading-ajax"> </div>');
|
251 |
-
}
|
252 |
-
|
253 |
-
summary.update('<div class="loading-ajax"> </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"> </div>');
|
367 |
-
}
|
368 |
-
|
369 |
-
if(payment_methods){
|
370 |
-
payment_methods.update('<div class="loading-ajax"> </div>');
|
371 |
-
}
|
372 |
-
summary.update('<div class="loading-ajax"> </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"> </div>');
|
474 |
-
}
|
475 |
-
|
476 |
-
if(payment_methods){
|
477 |
-
payment_methods.update('<div class="loading-ajax"> </div>');
|
478 |
-
}
|
479 |
-
summary.update('<div class="loading-ajax"> </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"> </div>');
|
563 |
-
}
|
564 |
-
|
565 |
-
if(payment_methods){
|
566 |
-
payment_methods.update('<div class="loading-ajax"> </div>');
|
567 |
-
}
|
568 |
-
summary.update('<div class="loading-ajax"> </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(); ?>" />
|
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"> </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;"> </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"> </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;"> </div>
|
1317 |
-
|
1318 |
-
|
1319 |
-
<div id="loading-process" style="display: none;"></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1,217 +0,0 @@
|
|
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1,1319 +0,0 @@
|
|
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"> </div>');
|
247 |
-
}
|
248 |
-
|
249 |
-
if(payment_methods){
|
250 |
-
payment_methods.update('<div class="loading-ajax"> </div>');
|
251 |
-
}
|
252 |
-
|
253 |
-
summary.update('<div class="loading-ajax"> </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"> </div>');
|
367 |
-
}
|
368 |
-
|
369 |
-
if(payment_methods){
|
370 |
-
payment_methods.update('<div class="loading-ajax"> </div>');
|
371 |
-
}
|
372 |
-
summary.update('<div class="loading-ajax"> </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"> </div>');
|
474 |
-
}
|
475 |
-
|
476 |
-
if(payment_methods){
|
477 |
-
payment_methods.update('<div class="loading-ajax"> </div>');
|
478 |
-
}
|
479 |
-
summary.update('<div class="loading-ajax"> </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"> </div>');
|
563 |
-
}
|
564 |
-
|
565 |
-
if(payment_methods){
|
566 |
-
payment_methods.update('<div class="loading-ajax"> </div>');
|
567 |
-
}
|
568 |
-
summary.update('<div class="loading-ajax"> </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(); ?>" />
|
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"> </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;"> </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"> </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;"> </div>
|
1317 |
-
|
1318 |
-
|
1319 |
-
<div id="loading-process" style="display: none;"></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1,217 +0,0 @@
|
|
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1,1319 +0,0 @@
|
|
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"> </div>');
|
247 |
-
}
|
248 |
-
|
249 |
-
if(payment_methods){
|
250 |
-
payment_methods.update('<div class="loading-ajax"> </div>');
|
251 |
-
}
|
252 |
-
|
253 |
-
summary.update('<div class="loading-ajax"> </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"> </div>');
|
367 |
-
}
|
368 |
-
|
369 |
-
if(payment_methods){
|
370 |
-
payment_methods.update('<div class="loading-ajax"> </div>');
|
371 |
-
}
|
372 |
-
summary.update('<div class="loading-ajax"> </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"> </div>');
|
474 |
-
}
|
475 |
-
|
476 |
-
if(payment_methods){
|
477 |
-
payment_methods.update('<div class="loading-ajax"> </div>');
|
478 |
-
}
|
479 |
-
summary.update('<div class="loading-ajax"> </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"> </div>');
|
563 |
-
}
|
564 |
-
|
565 |
-
if(payment_methods){
|
566 |
-
payment_methods.update('<div class="loading-ajax"> </div>');
|
567 |
-
}
|
568 |
-
summary.update('<div class="loading-ajax"> </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(); ?>" />
|
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"> </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;"> </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"> </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;"> </div>
|
1317 |
-
|
1318 |
-
|
1319 |
-
<div id="loading-process" style="display: none;"></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1,217 +0,0 @@
|
|
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"You will be redirected to Adyen website when you place an order.", "Sie werden auf Adyens Webseite für Ihre Bestellung weitergeleitet."
|
2 |
+
"%s ( Qty: %s ) (Price: %s %s ) <br />","%s ( Qty: %s ) (Price: %s %s ) <br />"
|
3 |
+
"Adyen %s <br /> authResult: %s <br /> pspReference: %s"
|
4 |
+
"Adyen %s <br /> eventCode: %s <br /> pspReference: %s <br /> success: %s"
|
5 |
+
"Adyen response(s): %s <br /> pspReference: %s"
|
6 |
+
"Authorize Only","Nur Authorisieren"
|
7 |
+
"Authorize and Capture","Authorisieren und Einziehen"
|
8 |
+
"Can not connect payment service. Please try again later.","Verbindung mit der Bezahlmethode konnte nicht hergestellt werden. Bitte versuchen Sie es später erneut."
|
9 |
+
"Capture Mode set to Manual","Capture Modus wurde auf manuell umgestellt"
|
10 |
+
"Customer was redirected to Adyen.", "Der Kunde wurde an Adyen weitergeleitet"
|
11 |
+
"Order can not Hold","Kann Auftrag nicht halten"
|
12 |
+
"Order can not be canceled", "Die Bestellung kann nicht annulliert werden"
|
13 |
+
"Order rows: <br />","Order rows: <br />"
|
14 |
+
"Shipment cost: %s %s <br />","Versandkosten: %s %s <br />"
|
15 |
+
"System error, please try again later","Systemfehler, bitte versuchen Sie es später erneut."
|
16 |
+
"System error, please try again later: %s", "Systemfehler, bitte versuchen Sie es später erneut: %s"
|
17 |
+
"The payment is REFUSED by Adyen.", "Die Bezahlung wurde von ADYEN zurückgewiesen."
|
18 |
+
"You will be redirected to Adyen in a few seconds.", "In einigen Sekunden werden Sie zu Adyen weitergeleitet."
|
19 |
+
"Your payment failed, Please try again later","Ihre Bezahlung ist fehlgeschlagen."
|
20 |
+
"--Please Select--","--Bitte auswählen--"
|
21 |
+
"Account Number","Kontonummer"
|
22 |
+
"Account holder name","Name des Kontoinhabers"
|
23 |
+
"Account holder: %s","Kontoinhaber: %s"
|
24 |
+
"Account number: xxx%s","Kontonummer: xxx%s"
|
25 |
+
"Bank Location","Sitz der Bank"
|
26 |
+
"Bank Location (City)","Sitz der Bank (Stadt)"
|
27 |
+
"Bank Location ID","Sitz der Bank ID"
|
28 |
+
"Bank Name","Name der Bank"
|
29 |
+
"Bank code: %s", "Bankleitzahl"
|
30 |
+
"Bank name: %s","Name der Bank: %s"
|
31 |
+
"Card Verification Number","CVN(Kartenprüfnummer)"
|
32 |
+
"Credit Card Number","Kreditkartennummer"
|
33 |
+
"Credit Card Number: xxxx-%s","Kreditkartennummer: xxxx-%s"
|
34 |
+
"Credit Card Type", "Kreditkartentyp"
|
35 |
+
"Credit Card Type: %s", "Kreditkartentyp: %s"
|
36 |
+
"Expiration Date","Gültig bis"
|
37 |
+
"Expiration Date: %s/%s","Gültig bis: %s/%s"
|
38 |
+
"Name on Card","Name auf der Karte"
|
39 |
+
"Name on the Card: %s","Name auf der Karte: %s"
|
40 |
+
"Payment Method: %s","Bezahlmethode: %s"
|
41 |
+
"Submitting payment information...","Bezahldaten werden übermittelt..."
|
42 |
+
"What is this?","Was ist das?"
|
43 |
+
"Order email sent to shopper.","Auftragsbestätigung wurde an den Kunden verschickt."
|
44 |
+
"The payment is PENDING by Adyen.","Die Bezahlung ist noch AUSSTEHEND durch Adyen."
|
45 |
+
"The payment is AUTHORIZED by Adyen.","Die Bezahlung wurde von ADYEN authorisiert."
|
46 |
+
"There has an error occurred with your Adyen payment.","Bei der Adyenbezahlung ist ein Fehler aufgetreten."
|
47 |
+
"There was an error with your payment.","Bei der Bezahlung ist ein Fehler aufgetreten."
|
48 |
+
"You will be redirected to Adyen website when you place an order.","Sie werden auf Adyens Webseite für Ihre Bestellung weitergeleitet."
|
49 |
+
"Your payment is cancelled.","Ihre Bezahlung wurde annuliert."
|
50 |
+
"Your payment is CANCELLED","Ihre Bezahlung wurde ANNULLIERT"
|
51 |
+
"Your payment is pending.","Ihre Bezahlung befindet sich in bearbeitung."
|
52 |
+
"Your payment is refused.","Ihre Bezahlung wurde abgelehnt."
|
53 |
+
"Your payment is authorized.","Ihre Bezahlung wurde authorisiert."
|
54 |
+
"Remember these details","Sollen diese Angaben für weitere Besuche gespeichert werden"
|
55 |
+
"Choose Your Bank","Wählen Sie ihre Bank aus"
|
56 |
+
"You chose an invalid bank","Sie haben eine ungültige Bank ausgewählt"
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"You will be redirected to Adyen website when you place an order.", "Va a ser redireccionado al website de Adyen cuando efectue su compra."
|
2 |
+
"%s ( Qty: %s ) (Price: %s %s ) <br />","%s ( Ctd: %s ) (Precio: %s %s ) <br />"
|
3 |
+
"Adyen %s <br /> authResult: %s <br /> pspReference: %s"
|
4 |
+
"Adyen %s <br /> eventCode: %s <br /> pspReference: %s <br /> success: %s"
|
5 |
+
"Adyen response(s): %s <br /> pspReference: %s", "Respuesta/s de Adyen: %s <br /> pspReference: %s"
|
6 |
+
"Authorize Only","Solo Autorizar"
|
7 |
+
"Authorize and Capture","Autorizar y Capturar"
|
8 |
+
"Can not connect payment service. Please try again later.","No podemos conectarnos con la pasarela de pagos. Por favor intente luego."
|
9 |
+
"Capture Mode set to Manual","Modo de Captura ajustado a Manual"
|
10 |
+
"Customer was redirected to Adyen.", "El cliente fue redireccionado a Adyen"
|
11 |
+
"Order can not Hold","No se puede mantener la compra"
|
12 |
+
"Order can not be canceled", "La orden no puede ser cancelada"
|
13 |
+
"Order rows: <br />","Filas de la orden: <br />"
|
14 |
+
"Shipment cost: %s %s <br />","Costo de envío: %s %s <br />"
|
15 |
+
"System error, please try again later","Error en el sistema, por favor intente luego"
|
16 |
+
"System error, please try again later: %s", "Error en el sistema, por favor intente luego: %s"
|
17 |
+
"The payment is REFUSED by Adyen.", "El pago fue RECHAZADO por Adyen."
|
18 |
+
"You will be redirected to Adyen in a few seconds.", "Va a ser redireccionado al website de Adyen en unos segundos."
|
19 |
+
"Your payment failed, Please try again later","Su pago falló"
|
20 |
+
"--Please Select--","--Por favor seleccione--"
|
21 |
+
"Account Number","Número de cuenta"
|
22 |
+
"Account holder name","Nombre del titular de cuenta"
|
23 |
+
"Account holder: %s","Titular de cuenta: %s"
|
24 |
+
"Account number: xxx%s","Número de cuenta: xxx%s"
|
25 |
+
"Bank Location","Ubicación del Banco"
|
26 |
+
"Bank Location (City)","Ubicación del Banco (Ciudad)"
|
27 |
+
"Bank Location ID","ID de ubicación del Banco"
|
28 |
+
"Bank Name","Nombre del Banco"
|
29 |
+
"Bank code: %s", "Código del Banco: %s"
|
30 |
+
"Bank name: %s","Nombre del Banco: %s"
|
31 |
+
"Card Verification Number","Número de verificación de tarjeta"
|
32 |
+
"Credit Card Number","Número de Tarjeta de Crédito"
|
33 |
+
"Credit Card Number: xxxx-%s","Número de Tarjeta de Crédito: xxxx-%s"
|
34 |
+
"Credit Card Type", "Tipo de Tarjeta de Crédito"
|
35 |
+
"Credit Card Type: %s", "Tipo de Tarjeta de Crédito: %s"
|
36 |
+
"Expiration Date","Expiratie datum", "Fecha de Vencimiento"
|
37 |
+
"Expiration Date: %s/%s","Fecha de Vencimiento: %s/%s"
|
38 |
+
"Name on Card","Nombre en la tarjeta"
|
39 |
+
"Name on the Card: %s","Nombre en la tarjeta: %s"
|
40 |
+
"Payment Method: %s","Método de Pago: %s"
|
41 |
+
"Submitting payment information...","Confirmando la información del pago..."
|
42 |
+
"What is this?","Que es esto?"
|
43 |
+
"Order email sent to shopper.","La orden ha sido enviada al comprado. "
|
44 |
+
"The payment is PENDING by Adyen.","El pago se encuentra PENDIENTE en Adyen."
|
45 |
+
"The payment is AUTHORIZED by Adyen.","El pago fue AUTORIZADO por Adyen."
|
46 |
+
"There has an error occurred with your Adyen payment.","Se encontro un error en su pago de Adyen."
|
47 |
+
"There was an error with your payment.","Hubo un error con su pago."
|
48 |
+
"You will be redirected to Adyen website when you place an order.","Va a ser redireccionado al website de Adyen cuando efectue su compra."
|
49 |
+
"Your payment is cancelled.","Su pago fue cancelado."
|
50 |
+
"Your payment is CANCELLED","Su pago fue CANCELADO."
|
51 |
+
"Your payment is pending.","Su pago se encuentra pendiente."
|
52 |
+
"Your payment is refused.","Su pago ha sido rechazado."
|
53 |
+
"Your payment is authorized.","Su pago fue autorizado."
|
54 |
+
"Remember these details","Recordar estos datos"
|
55 |
+
"Choose Your Bank","Elija su Banco"
|
56 |
+
"You chose an invalid bank","El Banco elegido es inválido. "
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"You will be redirected to Adyen website when you place an order.", "Vous allez être redirigé vers le site d'Adyen au passage de votre commande."
|
2 |
+
"%s ( Qty: %s ) (Price: %s %s ) <br />","%s ( Qty: %s ) (Price: %s %s ) <br />"
|
3 |
+
"Adyen %s <br /> authResult: %s <br /> pspReference: %s"
|
4 |
+
"Adyen %s <br /> eventCode: %s <br /> pspReference: %s <br /> success: %s"
|
5 |
+
"Adyen response(s): %s <br /> pspReference: %s", "Réponse d'Adyen: %s <br /> pspReference: %s"
|
6 |
+
"Authorize Only","Alleen autorisatie", "Authorisation seulement"
|
7 |
+
"Authorize and Capture","Autoriseren en bevestigen", "Authorisation et capture"
|
8 |
+
"Can not connect payment service. Please try again later.","Ne peut pas se connecter au service de paiement. Merci de réessayer ultérieurement"
|
9 |
+
"Capture Mode set to Manual","Le mode de capture est manuel"
|
10 |
+
"Customer was redirected to Adyen.", "Le client a été redirigé vers Adyen."
|
11 |
+
"Order can not Hold","La commande ne peut attendre"
|
12 |
+
"Order can not be canceled", "La commande ne peut être annulée"
|
13 |
+
"Order rows: <br />","Lignes de commande: <br />"
|
14 |
+
"Shipment cost: %s %s <br />","Coût de livriaison: %s %s <br />"
|
15 |
+
"System error, please try again later","Erreur système, merci de réessayer ultérieurement"
|
16 |
+
"System error, please try again later: %s", "Erreur système, merci de réessayer ultérieurement: %s"
|
17 |
+
"The payment is REFUSED by Adyen.", "Le paiement a été refusé par Adyen."
|
18 |
+
"You will be redirected to Adyen in a few seconds.", "Vous allez maintenant être redirigé dans quelques secondes."
|
19 |
+
"Your payment failed, Please try again later","Votre paiement a échoué"
|
20 |
+
"--Please Select--","--Merci de sélectionner--"
|
21 |
+
"Account Number","Numéro de compte"
|
22 |
+
"Account holder name","Nom du titulaire du compte"
|
23 |
+
"Account holder: %s","Titulaire du compte: %s"
|
24 |
+
"Account number: xxx%s","Numéro de compte: xxx%s"
|
25 |
+
"Bank Location","Emplacement de la banque"
|
26 |
+
"Bank Location (City)","Emplacement de la banque(Ville)"
|
27 |
+
"Bank Location ID","ID de l'emplacement de la banque"
|
28 |
+
"Bank Name","Nom de la banque"
|
29 |
+
"Bank code: %s", "Code de la banque:%s"
|
30 |
+
"Bank name: %s","Nom de la banque: %s"
|
31 |
+
"Card Verification Number","Numéro de vérification de la carte"
|
32 |
+
"Credit Card Number","Numéro de la carte"
|
33 |
+
"Credit Card Number: xxxx-%s","Numéro de la carte: xxxx-%s"
|
34 |
+
"Credit Card Type", "Type de carte"
|
35 |
+
"Credit Card Type: %s", ,"Type de carte: %s"
|
36 |
+
"Expiration Date","Date d'expiration"
|
37 |
+
"Expiration Date: %s/%s","Date d'expiration: %s/%s"
|
38 |
+
"Name on Card","Nom sur la carte"
|
39 |
+
"Name on the Card: %s","Nom sur la carte: %s"
|
40 |
+
"Payment Method: %s","Moyen de paiement: %s"
|
41 |
+
"Submitting payment information...","Envoi des informations de paiement..."
|
42 |
+
"What is this?","Qu'est ce que c'est?"
|
43 |
+
"Order email sent to shopper.","Email de la commande envoyé au client."
|
44 |
+
"The payment is PENDING by Adyen.","Le paiement est en attendre par Adyen."
|
45 |
+
"The payment is AUTHORIZED by Adyen.","Le paiement est autorisé par Adyen."
|
46 |
+
"There has an error occurred with your Adyen payment.","Une erreur est survenue durant votre paiement avec Adyen."
|
47 |
+
"There was an error with your payment.","Il y a eu une erreur avec votre paiement."
|
48 |
+
"You will be redirected to Adyen website when you place an order.","Vous allez être redirigé vers le site d'Adyen au passage de votre commande."
|
49 |
+
"Your payment is cancelled.","Votre paiement a été annulé."
|
50 |
+
"Your payment is CANCELLED","Votre paiement a été ANNULE."
|
51 |
+
"Your payment is pending.","Votre paiement est en attente."
|
52 |
+
"Your payment is refused.","Votre paiement est refusé."
|
53 |
+
"Your payment is authorized.","Votre paiement est autorisé."
|
54 |
+
"Remember these details","Sauvegarder ces informations"
|
55 |
+
"Choose Your Bank","Choisir votre banque"
|
56 |
+
"You chose an invalid bank","Vous avez choisi une banque invalide"
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"You will be redirected to Adyen website when you place an order.", "U wordt doorgestuurd naar de Adyen website bij het plaatsen van uw order."
|
2 |
+
"%s ( Qty: %s ) (Price: %s %s ) <br />","%s ( Aantal: %s ) (Prijs: %s %s ) <br />"
|
3 |
+
"Adyen %s <br /> authResult: %s <br /> pspReference: %s"
|
4 |
+
"Adyen %s <br /> eventCode: %s <br /> pspReference: %s <br /> success: %s"
|
5 |
+
"Adyen response(s): %s <br /> pspReference: %s"
|
6 |
+
"Authorize Only","Alleen autorisatie"
|
7 |
+
"Authorize and Capture","Autoriseren en bevestigen"
|
8 |
+
"Can not connect payment service. Please try again later.","Kan betaalservice niet bereiken. Probeer het later nog eens."
|
9 |
+
"Capture Mode set to Manual","Capture mode is handmatig"
|
10 |
+
"Customer was redirected to Adyen.", "Klant is doorgestuurd aan Adyen"
|
11 |
+
"Order can not Hold","Kan bestelling niet vasthouden"
|
12 |
+
"Order can not be canceled", "Kan order niet annuleren"
|
13 |
+
"Order rows: <br />","Bestel rijen: <br />"
|
14 |
+
"Shipment cost: %s %s <br />","Verzendkosten: %s %s <br />"
|
15 |
+
"System error, please try again later","Systeem error. Probeer het later nog eens."
|
16 |
+
"System error, please try again later: %s", "Systeem error. Probeer het later nog eens: %s"
|
17 |
+
"The payment is REFUSED by Adyen.", "Betaalmethode is TEGENGEHOUDEN door Adyen."
|
18 |
+
"You will be redirected to Adyen in a few seconds.", "U wordt doorgestuurd naar Adyen."
|
19 |
+
"Your payment failed, Please try again later","Betaalmethode niet geslaagd. Probeer het later nog eens."
|
20 |
+
"--Please Select--","--Selecteren--"
|
21 |
+
"Account Number","Account nummmer"
|
22 |
+
"Account holder name","Account houder naam"
|
23 |
+
"Account holder: %s","Account houder: %s"
|
24 |
+
"Account number: xxx%s","Account nummer: xxx%s"
|
25 |
+
"Bank Location","Bank locatie"
|
26 |
+
"Bank Location (City)","Bank locatie (Stad)"
|
27 |
+
"Bank Location ID","Bank locatie ID"
|
28 |
+
"Bank Name","Bank naam"
|
29 |
+
"Bank code: %s"
|
30 |
+
"Bank name: %s","Bank naam: %s"
|
31 |
+
"Card Verification Number","Kaart verificatie nummer CVC"
|
32 |
+
"Credit Card Number","Credit Card Nummer"
|
33 |
+
"Credit Card Number: xxxx-%s","Credit Card Nummer: xxxx-%s"
|
34 |
+
"Credit Card Type"
|
35 |
+
"Credit Card Type: %s"
|
36 |
+
"Expiration Date","Expiratie datum"
|
37 |
+
"Expiration Date: %s/%s","Expiratie Datum: %s/%s"
|
38 |
+
"Name on Card","Naam op de kaart"
|
39 |
+
"Name on the Card: %s","Naam op de kaart: %s"
|
40 |
+
"Payment Method: %s","Betaalmethode: %s"
|
41 |
+
"Submitting payment information...","Betaalinformatie wordt verzonden..."
|
42 |
+
"What is this?","Wat is dit?"
|
43 |
+
"Order email sent to shopper.","Bevestingsemail is verzonden aan klant."
|
44 |
+
"The payment is PENDING by Adyen.","Betaling PENDING by Adyen."
|
45 |
+
"The payment is AUTHORIZED by Adyen.","Betaling AUTHORIZED by Adyen."
|
46 |
+
"There has an error occurred with your Adyen payment.","Er is een probleem met uw betaling bij Adyen."
|
47 |
+
"There was an error with your payment.","Uw betaling is niet afgerond."
|
48 |
+
"You will be redirected to Adyen website when you place an order.","U wordt doorgestuurd naar de Adyen bij het plaatsen van uw order."
|
49 |
+
"Your payment is cancelled.","Betaling geannuleerd."
|
50 |
+
"Your payment is CANCELLED","Betaling geannuleerd."
|
51 |
+
"Your payment is pending.","Betaling wordt verwerkt."
|
52 |
+
"Your payment is refused.","Betaling tegengehouden."
|
53 |
+
"Your payment is authorized.","Betaling bevestigd."
|
54 |
+
"Remember these details","Onthoud deze gegevens"
|
55 |
+
"Choose Your Bank","Kies je bank"
|
56 |
+
"You chose an invalid bank","De bank moet nog ingevuld worden"
|
@@ -0,0 +1,479 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!-- Original: Simon Tneoh (tneohcb@pc.jaring.my) -->
|
2 |
+
|
3 |
+
/*Cardtype format: name, starting numbers ( , separated, (is not a range)), number of digits ( , separated) */
|
4 |
+
var Cards = new makeArray(22);
|
5 |
+
//Cards[0] = new CardType("mc", "51,52,53,54,55", "16");
|
6 |
+
Cards[0] = new CardType("MC", "51,52,53,54,55", "16");
|
7 |
+
var MasterCard = Cards[0];
|
8 |
+
Cards[1] = new CardType("visadankort", "4571", "16");
|
9 |
+
var VisaDankort = Cards[1];
|
10 |
+
//Cards[2] = new CardType("visa", "4", "13,16");
|
11 |
+
Cards[2] = new CardType("VI", "4", "13,16");
|
12 |
+
var VisaCard = Cards[2];
|
13 |
+
//Cards[3] = new CardType("amex", "34,37", "15");
|
14 |
+
Cards[3] = new CardType("AE", "34,37", "15");
|
15 |
+
var AmExCard = Cards[3];
|
16 |
+
Cards[4] = new CardType("vias", "9", "16");
|
17 |
+
var AdyenCard = Cards[4];
|
18 |
+
//Cards[5] = new CardType("diners", "36", "14");
|
19 |
+
Cards[5] = new CardType("DC", "36", "14");
|
20 |
+
var DinersClubCard = Cards[5];
|
21 |
+
Cards[6] = new CardType("maestrouk", "6759", "16,18,19");
|
22 |
+
var MaestroUKCard = Cards[6];
|
23 |
+
Cards[7] = new CardType("solo", "6767", "16,18,19");
|
24 |
+
var SoloCard = Cards[7];
|
25 |
+
Cards[8] = new CardType("laser", "6304,6706,677117,677120", "16,17,18,19");
|
26 |
+
var LaserCard = Cards[8];
|
27 |
+
//Cards[9] = new CardType("discover", "6011,644,645,646,647,648,649,65", "16");
|
28 |
+
Cards[9] = new CardType("DI", "6011,644,645,646,647,648,649,65", "16");
|
29 |
+
var DiscoverCard = Cards[9];
|
30 |
+
//Cards[10] = new CardType("jcb", "3528,3529,353,354,355,356,357,358", "16,19");
|
31 |
+
Cards[10] = new CardType("JCB", "3528,3529,353,354,355,356,357,358", "16,19");
|
32 |
+
var JCBCard = Cards[10];
|
33 |
+
Cards[11] = new CardType("bcmc", "6703", "16,17,18,19");
|
34 |
+
var Bcmc = Cards[11];
|
35 |
+
Cards[12] = new CardType("bijcard", "5100081", "16");
|
36 |
+
var BijCard = Cards[12];
|
37 |
+
Cards[13] = new CardType("dankort", "5019", "16");
|
38 |
+
var Dankort = Cards[13];
|
39 |
+
Cards[14] = new CardType("hipercard", "606282", "16");
|
40 |
+
var Hipercard = Cards[14];
|
41 |
+
//Cards[15] = new CardType("maestro", "50,56,57,58,6", "16");
|
42 |
+
Cards[15] = new CardType("SM", "50,56,57,58,6", "16");
|
43 |
+
var MaestroCard = Cards[15];
|
44 |
+
Cards[16] = new CardType("ELO", "506699,50670,50671,50672,50673,50674,50675,50676,506770,506771,506772,506773,506774,506775,506776,506777,506778,401178,438935,451416,457631,457632,504175,627780,636297,636368", "16");
|
45 |
+
var Elo = Cards[16];
|
46 |
+
Cards[17] = new CardType("uatp", "1", "15");
|
47 |
+
var Uatp = Cards[17];
|
48 |
+
Cards[18] = new CardType("cup", "62", "14,15,16,17,18,19");
|
49 |
+
var Cup = Cards[18];
|
50 |
+
Cards[19] = new CardType("cartebancaire", "4,5,6", "16");
|
51 |
+
var CarteBancaire = Cards[19];
|
52 |
+
Cards[20] = new CardType("visaalphabankbonus", "450903", "16");
|
53 |
+
var VisAlphaBankBonus = Cards[20];
|
54 |
+
Cards[21] = new CardType("mcalphabankbonus", "510099", "16");
|
55 |
+
var McAlphaBankBonus = Cards[21];
|
56 |
+
|
57 |
+
var LuhnCheckSum = Cards[21] = new CardType();
|
58 |
+
|
59 |
+
|
60 |
+
|
61 |
+
/*************************************************************************\
|
62 |
+
CheckCardNumber(form)
|
63 |
+
function called when users click the "check" button.
|
64 |
+
\*************************************************************************/
|
65 |
+
function CheckCardNumber(cardNumber, expYear, expMon, cardType) {
|
66 |
+
var tmpyear;
|
67 |
+
|
68 |
+
if (cardNumber.length == 0) {
|
69 |
+
alert("Please enter a Card Number.");
|
70 |
+
return false;
|
71 |
+
}
|
72 |
+
|
73 |
+
if (expYear.length == 0) {
|
74 |
+
alert("Please enter the Expiration Year.");
|
75 |
+
return false;
|
76 |
+
}
|
77 |
+
|
78 |
+
if (expYear > 96)
|
79 |
+
tmpyear = "19" + expYear;
|
80 |
+
else if (expYear < 21)
|
81 |
+
tmpyear = "20" + expYear;
|
82 |
+
else {
|
83 |
+
alert("The Expiration Year is not valid.");
|
84 |
+
return false;
|
85 |
+
}
|
86 |
+
|
87 |
+
tmpmonth = expMon;
|
88 |
+
// The following line doesn't work in IE3, you need to change it
|
89 |
+
// to something like "(new CardType())...".
|
90 |
+
// if (!CardType().isExpiryDate(tmpyear, tmpmonth)) {
|
91 |
+
if (!(new CardType()).isExpiryDate(tmpyear, tmpmonth)) {
|
92 |
+
alert("This card has already expired.");
|
93 |
+
return false;
|
94 |
+
}
|
95 |
+
card = cardType;
|
96 |
+
var retval = eval(card + ".checkCardNumber(\"" + cardNumber + "\", " + tmpyear + ", " + tmpmonth + ");");
|
97 |
+
cardname = "";
|
98 |
+
|
99 |
+
if (retval){
|
100 |
+
// comment this out if used on an order form
|
101 |
+
return true;
|
102 |
+
}
|
103 |
+
else {
|
104 |
+
// The cardnumber has the valid luhn checksum, but we want to know which
|
105 |
+
// cardtype it belongs to.
|
106 |
+
for (var n = 0; n < Cards.size; n++) {
|
107 |
+
if (Cards[n].checkCardNumber(cardNumber, tmpyear, tmpmonth)) {
|
108 |
+
cardname = Cards[n].getCardType();
|
109 |
+
break;
|
110 |
+
}
|
111 |
+
}
|
112 |
+
if (cardname.length > 0) {
|
113 |
+
alert("This looks like a " + cardname + " number, not a " + card + " number.");
|
114 |
+
}
|
115 |
+
else {
|
116 |
+
alert("This card number is not valid.");
|
117 |
+
}
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
/*************************************************************************\
|
122 |
+
Object CardType([String cardtype, String rules, String len, int year,
|
123 |
+
int month])
|
124 |
+
cardtype : type of card, eg: MasterCard, Visa, etc.
|
125 |
+
rules : rules of the cardnumber, eg: "4", "6011", "34,37".
|
126 |
+
len : valid length of cardnumber, eg: "16,19", "13,16".
|
127 |
+
year : year of expiry date.
|
128 |
+
month : month of expiry date.
|
129 |
+
eg:
|
130 |
+
var VisaCard = new CardType("Visa", "4", "16");
|
131 |
+
var AmExCard = new CardType("AmEx", "34,37", "15");
|
132 |
+
\*************************************************************************/
|
133 |
+
function CardType() {
|
134 |
+
var n;
|
135 |
+
var argv = CardType.arguments;
|
136 |
+
var argc = CardType.arguments.length;
|
137 |
+
|
138 |
+
this.objname = "object CardType";
|
139 |
+
|
140 |
+
var tmpcardtype = (argc > 0) ? argv[0] : "CardObject";
|
141 |
+
var tmprules = (argc > 1) ? argv[1] : "0,1,2,3,4,5,6,7,8,9";
|
142 |
+
var tmplen = (argc > 2) ? argv[2] : "13,14,15,16,19";
|
143 |
+
|
144 |
+
this.setCardNumber = setCardNumber; // set CardNumber method.
|
145 |
+
this.setCardType = setCardType; // setCardType method.
|
146 |
+
this.setLen = setLen; // setLen method.
|
147 |
+
this.setRules = setRules; // setRules method.
|
148 |
+
this.setExpiryDate = setExpiryDate; // setExpiryDate method.
|
149 |
+
|
150 |
+
this.setCardType(tmpcardtype);
|
151 |
+
this.setLen(tmplen);
|
152 |
+
this.setRules(tmprules);
|
153 |
+
if (argc > 4)
|
154 |
+
this.setExpiryDate(argv[3], argv[4]);
|
155 |
+
|
156 |
+
this.checkCardNumber = checkCardNumber; // checkCardNumber method.
|
157 |
+
this.getExpiryDate = getExpiryDate; // getExpiryDate method.
|
158 |
+
this.getCardType = getCardType; // getCardType method.
|
159 |
+
this.isCardNumber = isCardNumber; // isCardNumber method.
|
160 |
+
this.isExpiryDate = isExpiryDate; // isExpiryDate method.
|
161 |
+
this.luhnCheck = luhnCheck;// luhnCheck method.
|
162 |
+
return this;
|
163 |
+
}
|
164 |
+
|
165 |
+
/*************************************************************************\
|
166 |
+
boolean checkCardNumber([String cardnumber, int year, int month])
|
167 |
+
return true if cardnumber pass the luhncheck and the expiry date is
|
168 |
+
valid, else return false.
|
169 |
+
\*************************************************************************/
|
170 |
+
function checkCardNumber() {
|
171 |
+
var argv = checkCardNumber.arguments;
|
172 |
+
var argc = checkCardNumber.arguments.length;
|
173 |
+
var cardnumber = (argc > 0) ? argv[0] : this.cardnumber;
|
174 |
+
var year = (argc > 1) ? argv[1] : this.year;
|
175 |
+
var month = (argc > 2) ? argv[2] : this.month;
|
176 |
+
|
177 |
+
this.setCardNumber(cardnumber);
|
178 |
+
this.setExpiryDate(year, month);
|
179 |
+
|
180 |
+
if (!this.isCardNumber())
|
181 |
+
return false;
|
182 |
+
if (!this.isExpiryDate())
|
183 |
+
return false;
|
184 |
+
|
185 |
+
return true;
|
186 |
+
}
|
187 |
+
/*************************************************************************\
|
188 |
+
String getCardType()
|
189 |
+
return the cardtype.
|
190 |
+
\*************************************************************************/
|
191 |
+
function getCardType() {
|
192 |
+
return this.cardtype;
|
193 |
+
}
|
194 |
+
/*************************************************************************\
|
195 |
+
String getExpiryDate()
|
196 |
+
return the expiry date.
|
197 |
+
\*************************************************************************/
|
198 |
+
function getExpiryDate() {
|
199 |
+
return this.month + "/" + this.year;
|
200 |
+
}
|
201 |
+
/*************************************************************************\
|
202 |
+
boolean isCardNumber([String cardnumber])
|
203 |
+
return true if cardnumber pass the luhncheck and the rules, else return
|
204 |
+
false.
|
205 |
+
\*************************************************************************/
|
206 |
+
function isCardNumber() {
|
207 |
+
var argv = isCardNumber.arguments;
|
208 |
+
var argc = isCardNumber.arguments.length;
|
209 |
+
var cardnumber = (argc > 0) ? argv[0] : this.cardnumber;
|
210 |
+
if (!this.luhnCheck())
|
211 |
+
return false;
|
212 |
+
|
213 |
+
for (var n = 0; n < this.len.size; n++)
|
214 |
+
if (cardnumber.toString().length == this.len[n]) {
|
215 |
+
for (var m = 0; m < this.rules.size; m++) {
|
216 |
+
var headdigit = cardnumber.substring(0, this.rules[m].toString().length);
|
217 |
+
if (headdigit == this.rules[m])
|
218 |
+
return true;
|
219 |
+
}
|
220 |
+
return false;
|
221 |
+
}
|
222 |
+
return false;
|
223 |
+
}
|
224 |
+
|
225 |
+
/*************************************************************************\
|
226 |
+
boolean isExpiryDate([int year, int month])
|
227 |
+
return true if the date is a valid expiry date,
|
228 |
+
else return false.
|
229 |
+
\*************************************************************************/
|
230 |
+
function isExpiryDate() {
|
231 |
+
var argv = isExpiryDate.arguments;
|
232 |
+
var argc = isExpiryDate.arguments.length;
|
233 |
+
|
234 |
+
year = argc > 0 ? argv[0] : this.year;
|
235 |
+
month = argc > 1 ? argv[1] : this.month;
|
236 |
+
|
237 |
+
if (!isNum(year+""))
|
238 |
+
return false;
|
239 |
+
|
240 |
+
if (!isNum(month+""))
|
241 |
+
return false;
|
242 |
+
|
243 |
+
today = new Date();
|
244 |
+
expiry = new Date(year, month);
|
245 |
+
|
246 |
+
if (today.getTime() > expiry.getTime())
|
247 |
+
return false;
|
248 |
+
else
|
249 |
+
return true;
|
250 |
+
}
|
251 |
+
|
252 |
+
/*************************************************************************\
|
253 |
+
boolean isNum(String argvalue)
|
254 |
+
return true if argvalue contains only numeric characters,
|
255 |
+
else return false.
|
256 |
+
\*************************************************************************/
|
257 |
+
function isNum(argvalue) {
|
258 |
+
argvalue = argvalue.toString();
|
259 |
+
|
260 |
+
if (argvalue.length == 0)
|
261 |
+
return false;
|
262 |
+
|
263 |
+
for (var n = 0; n < argvalue.length; n++)
|
264 |
+
if (argvalue.substring(n, n+1) < "0" || argvalue.substring(n, n+1) > "9")
|
265 |
+
return false;
|
266 |
+
return true;
|
267 |
+
}
|
268 |
+
|
269 |
+
/*************************************************************************\
|
270 |
+
boolean luhnCheck([String CardNumber])
|
271 |
+
return true if CardNumber pass the luhn check else return false.
|
272 |
+
Reference: http://www.ling.nwu.edu/~sburke/pub/luhn_lib.pl
|
273 |
+
\*************************************************************************/
|
274 |
+
function luhnCheck() {
|
275 |
+
var argv = luhnCheck.arguments;
|
276 |
+
var argc = luhnCheck.arguments.length;
|
277 |
+
|
278 |
+
var CardNumber = argc > 0 ? argv[0] : this.cardnumber;
|
279 |
+
|
280 |
+
if (! isNum(CardNumber)) {
|
281 |
+
return false;
|
282 |
+
}
|
283 |
+
|
284 |
+
var no_digit = CardNumber.length;
|
285 |
+
var oddoeven = no_digit & 1;
|
286 |
+
var sum = 0;
|
287 |
+
|
288 |
+
for (var count = 0; count < no_digit; count++) {
|
289 |
+
var digit = parseInt(CardNumber.charAt(count));
|
290 |
+
if (!((count & 1) ^ oddoeven)) {
|
291 |
+
digit *= 2;
|
292 |
+
if (digit > 9)
|
293 |
+
digit -= 9;
|
294 |
+
}
|
295 |
+
sum += digit;
|
296 |
+
}
|
297 |
+
|
298 |
+
if (sum % 10 == 0)
|
299 |
+
return true;
|
300 |
+
else
|
301 |
+
return false;
|
302 |
+
}
|
303 |
+
|
304 |
+
/*************************************************************************\
|
305 |
+
ArrayObject makeArray(int size)
|
306 |
+
return the array object in the size specified.
|
307 |
+
\*************************************************************************/
|
308 |
+
function makeArray(size) {
|
309 |
+
this.size = size;
|
310 |
+
return this;
|
311 |
+
}
|
312 |
+
|
313 |
+
/*************************************************************************\
|
314 |
+
CardType setCardNumber(cardnumber)
|
315 |
+
return the CardType object.
|
316 |
+
\*************************************************************************/
|
317 |
+
function setCardNumber(cardnumber) {
|
318 |
+
this.cardnumber = cardnumber;
|
319 |
+
return this;
|
320 |
+
}
|
321 |
+
|
322 |
+
/*************************************************************************\
|
323 |
+
CardType setCardType(cardtype)
|
324 |
+
return the CardType object.
|
325 |
+
\*************************************************************************/
|
326 |
+
function setCardType(cardtype) {
|
327 |
+
this.cardtype = cardtype;
|
328 |
+
return this;
|
329 |
+
}
|
330 |
+
|
331 |
+
/*************************************************************************\
|
332 |
+
CardType setExpiryDate(year, month)
|
333 |
+
return the CardType object.
|
334 |
+
\*************************************************************************/
|
335 |
+
function setExpiryDate(year, month) {
|
336 |
+
this.year = year;
|
337 |
+
this.month = month;
|
338 |
+
return this;
|
339 |
+
}
|
340 |
+
|
341 |
+
/*************************************************************************\
|
342 |
+
CardType setLen(len)
|
343 |
+
return the CardType object.
|
344 |
+
\*************************************************************************/
|
345 |
+
function setLen(len) {
|
346 |
+
// Create the len array.
|
347 |
+
if (len.length == 0 || len == null)
|
348 |
+
len = "13,14,15,16,19";
|
349 |
+
|
350 |
+
var tmplen = len;
|
351 |
+
n = 1;
|
352 |
+
while (tmplen.indexOf(",") != -1) {
|
353 |
+
tmplen = tmplen.substring(tmplen.indexOf(",") + 1, tmplen.length);
|
354 |
+
n++;
|
355 |
+
}
|
356 |
+
|
357 |
+
this.len = new makeArray(n);
|
358 |
+
n = 0;
|
359 |
+
while (len.indexOf(",") != -1) {
|
360 |
+
var tmpstr = len.substring(0, len.indexOf(","));
|
361 |
+
this.len[n] = tmpstr;
|
362 |
+
len = len.substring(len.indexOf(",") + 1, len.length);
|
363 |
+
n++;
|
364 |
+
}
|
365 |
+
this.len[n] = len;
|
366 |
+
return this;
|
367 |
+
}
|
368 |
+
|
369 |
+
/*************************************************************************\
|
370 |
+
CardType setRules()
|
371 |
+
return the CardType object.
|
372 |
+
\*************************************************************************/
|
373 |
+
function setRules(rules) {
|
374 |
+
// Create the rules array.
|
375 |
+
if (rules.length == 0 || rules == null)
|
376 |
+
rules = "0,1,2,3,4,5,6,7,8,9";
|
377 |
+
|
378 |
+
var tmprules = rules;
|
379 |
+
n = 1;
|
380 |
+
while (tmprules.indexOf(",") != -1) {
|
381 |
+
tmprules = tmprules.substring(tmprules.indexOf(",") + 1, tmprules.length);
|
382 |
+
n++;
|
383 |
+
}
|
384 |
+
this.rules = new makeArray(n);
|
385 |
+
n = 0;
|
386 |
+
while (rules.indexOf(",") != -1) {
|
387 |
+
var tmpstr = rules.substring(0, rules.indexOf(","));
|
388 |
+
this.rules[n] = tmpstr;
|
389 |
+
rules = rules.substring(rules.indexOf(",") + 1, rules.length);
|
390 |
+
n++;
|
391 |
+
}
|
392 |
+
this.rules[n] = rules;
|
393 |
+
return this;
|
394 |
+
}
|
395 |
+
|
396 |
+
|
397 |
+
/*****************\
|
398 |
+
* helpers
|
399 |
+
\*****************/
|
400 |
+
|
401 |
+
function contains(a, obj) {
|
402 |
+
var i = a.length;
|
403 |
+
while (i--) {
|
404 |
+
if (a[i] === obj) {
|
405 |
+
return true;
|
406 |
+
}
|
407 |
+
}
|
408 |
+
return false;
|
409 |
+
}
|
410 |
+
|
411 |
+
/*****************\
|
412 |
+
|
413 |
+
Added
|
414 |
+
|
415 |
+
\*****************/
|
416 |
+
function getBaseCard(cardnumber, availablecards){
|
417 |
+
//for each card (except the luhncheck card (last element))
|
418 |
+
for (var i = 0; i < (Cards.size - 1); i++) {
|
419 |
+
//for each card length
|
420 |
+
for (var n = 0; n < Cards[i].len.size; n++){
|
421 |
+
if (cardnumber.toString().length <= Cards[i].len[n]) {
|
422 |
+
for (var m = 0; m < Cards[i].rules.size; m++) {
|
423 |
+
// Get the max length
|
424 |
+
var l = Cards[i].rules[m].toString().length;
|
425 |
+
// If the length of the rule is longer than the cardnumber, it is still a potential candidate
|
426 |
+
if(l>cardnumber.toString().length) {
|
427 |
+
l = cardnumber.toString().length;
|
428 |
+
}
|
429 |
+
var headdigit = cardnumber.substring(0, l);
|
430 |
+
var headruledigit = Cards[i].rules[m].toString().substring(0,l);
|
431 |
+
if (headdigit === headruledigit){
|
432 |
+
if(contains(availablecards,Cards[i].cardtype)) {
|
433 |
+
//alert("cc type: "+Cards[i].getCardType());
|
434 |
+
return Cards[i];
|
435 |
+
}
|
436 |
+
//See if the card is a MaestroCard which is a sub-brand of Mastercard
|
437 |
+
//TODO make this change generic for all card and subcards if required
|
438 |
+
if(contains(availablecards,MasterCard.cardtype)) {
|
439 |
+
if(Cards[i].cardtype === MaestroCard.cardtype){
|
440 |
+
return MasterCard;
|
441 |
+
}
|
442 |
+
}
|
443 |
+
}
|
444 |
+
}
|
445 |
+
//return null;
|
446 |
+
}
|
447 |
+
//return null;
|
448 |
+
}
|
449 |
+
}
|
450 |
+
return null;
|
451 |
+
}
|
452 |
+
|
453 |
+
function getBaseCardByType(variant){
|
454 |
+
//for each card (except the luhncheck card (last element))
|
455 |
+
for (var i = 0; i < (Cards.size - 1); i++) {
|
456 |
+
if(Cards[i].cardtype == variant) {
|
457 |
+
return Cards[i];
|
458 |
+
}
|
459 |
+
}
|
460 |
+
return null;
|
461 |
+
}
|
462 |
+
|
463 |
+
|
464 |
+
function card_setCardBrand(selectedCard, greyInactive, groupName, group_types, group_logos) {
|
465 |
+
|
466 |
+
for(var i = 0; i < group_types.length; ++i) {
|
467 |
+
var imageId = 'card.cclogo' + i;
|
468 |
+
if(selectedCard != null && group_types[i] == selectedCard.cardtype) {
|
469 |
+
document.getElementById(imageId).src=baseURL + group_logos[i] + "_small.png";
|
470 |
+
} else {
|
471 |
+
if(greyInactive) {
|
472 |
+
document.getElementById(imageId).src=baseURL + group_logos[i] + "_small_grey.png";
|
473 |
+
} else {
|
474 |
+
document.getElementById(imageId).src=baseURL + group_logos[i] + "_small.png";
|
475 |
+
}
|
476 |
+
}
|
477 |
+
document.getElementById(imageId).style.display="inline";
|
478 |
+
}
|
479 |
+
}
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function(window,undefined){var socket=null;var ePosC=null;var msgGenerator=null;var deviceInfo=null;var isConnected=false;var ofscCallbackList=new Array();var connectCallback=null;var SOCKET_EVENT_NAME="message";var CONNECT_RESULT_OK="OK";var CONNECT_RESULT_SSL_OK="SSL_CONNECT_OK";var CONNECT_RESULT_ERROR_PARAMETER="ERROR_PARAMETER";var CONNECT_RESULT_ERROR_TIMEOUT="ERROR_TIMEOUT";var ERROR_SYSTEM_ERROR="SYSTEM_ERROR";var ERROR_PARAM_ERROR="PARAM_ERROR";function ePOSDevice(){this.DEVICE_TYPE_SCANNER="type_scanner";this.DEVICE_TYPE_KEYBOARD="type_keyboard";this.DEVICE_TYPE_MSR="type_msr";this.DEVICE_TYPE_CAT="type_cat";this.DEVICE_TYPE_CASH_CHANGER="type_cash_changer";this.DEVICE_TYPE_PRINTER="type_printer";this.DEVICE_TYPE_DISPLAY="type_display";this.DEVICE_TYPE_SCALE="type_scale";this.DEVICE_TYPE_SIMPLE_SERIAL="type_simple_serial";this.DEVICE_TYPE_HYBRID_PRINTER="type_hybrid_printer";this.DEVICE_TYPE_DT="type_dt";this.DEVICE_ID_DT="local_dt";this.CLIENT_DRIVER_SCANNER="Scanner";this.CLIENT_DRIVER_KEYBOARD="Keyboard";this.CLIENT_DRIVER_MSR="MSR";this.CLIENT_DRIVER_CAT="CAT";this.CLIENT_DRIVER_CASH_CHANGER="CashChanger";this.CLIENT_DRIVER_PRINTER="Printer";this.CLIENT_DRIVER_DISPLAY="Display";this.CLIENT_DRIVER_SIMPLE_SERIAL="SimpleSerial";this.CLIENT_DRIVER_HYBRID_PRINTER="HybridPrinter";this.CLIENT_DRIVER_DT="DeviceTerminal";this.ERROR_DEVICE_OPEN_ERROR="DEVICE_OPEN_ERROR";this.ERROR_DEVICE_CLOSE_ERROR="DEVICE_CLOSE_ERROR";this.ERROR_DEVICE_NOT_OPEN="DEVICE_NOT_OPEN";this.ERROR_DEVICE_IN_USE="DEVICE_IN_USE";this.SEQUENCE_INIT_PARAM=1;this.CONNECT_TIMEOUT=15000;this.RECONNECT_INTERVAL=3000;this.RECONNECT_TIMEOUT=15000;this.COOKIE_KEY_CLIENTID="EPSON_EPOSDEVICE_CLIENTID";this.OFSC_SERVICE_ID="OFSC";this.CONNECT_API="CONNECT_API";this.CONNECT_RECONNECT="CONNECT_RECONNECT";this.WEBSOCKET_PORT=8008;this.SSLWEBSOCKET_PORT=8043;socket=null;ePosC=new ePosCrypto();deviceInfo=new clientDeviceInfo();msgGenerator=new clientMessageGenerator();this.cookieIo=new cookieIO;this.utility=new utility;this.adminInfo="";this.locationInfo="";isConnected=false;this.connectProtocol="";this.clientId="";this.connectMode=this.CONNECT_API;this.reconnectTryCount=0;this.reconnectSeqDisconnect=false;this.recievedDataId=0;this.isReconnecting=false;this.sequence=0;this.ipAddress="";this.port="";this.prime="";this.key="";this.onerror=null;this.ondisconnect=null;this.socketList=new Array();this.commBoxManager=null;this.init();var ePosDev=this;window.onbeforeunload=function(){isConnected=false;ePosDev.disconnect()};window.onpagehide=function(){isConnected=false;ePosDev.disconnect()}}ePOSDevice.prototype={init:function(){ePosC=new ePosCrypto();deviceInfo=new clientDeviceInfo();this.adminInfo="";this.locationInfo="";this.clientId="";this.ipAddress="";this.port="";this.prime="";this.key="";this.initSocket();this.initReconnectTimer();this.commBoxManager=new CommBoxManager(this)},initSocket:function(){if(socket==null){return}socket.disconnect();delete socket;socket=null},initReconnectTimer:function(){clearInterval(this.reconnectTimerId);this.reconnectTimerId=null;this.reconnectTryCount=0},setReconnect:function(){if(this.isReconnecting){return}this.isReconnecting=true;this.connectMode=this.CONNECT_RECONNECT;var self=this;this.reconnectTimerId=setInterval(function(){if(socket!=null){self.clearListeners();self.socketList.push(self.utility.clone(socket));self.initSocket()}if(self.reconnectTryCount>=(self.RECONNECT_TIMEOUT/self.RECONNECT_INTERVAL)){isConnected=false;self.isReconnecting=false;self.init();if(self.ondisconnect!=null){self.ondisconnect()}return}var url=self.ipAddress+":"+self.port;self.socketConnect(url,true);self.reconnectTryCount++},this.RECONNECT_INTERVAL);if(this.reconnectTryCount==0){if(this.onreconnecting!=null){this.onreconnecting()}}},connect:function(ipAddress,port,callback){if(socket!=null){var clientId=this.clientId;this.clientId="";if(clientId!=""){var command=msgGenerator.getDisconnect({client_id:clientId});socket.emit(SOCKET_EVENT_NAME,command)}this.clearListeners();this.socketList.push(this.utility.clone(socket));this.initSocket();if((isConnected)&&(this.ondisconnect!=null)){this.ondisconnect()}isConnected=false}this.isReconnecting=false;this.init();this.connectMode=this.CONNECT_API;this.ipAddress=ipAddress;this.port=port;connectCallback=callback;var url="";if(this.ipAddress.match(/^(http:\u002f\u002f)/)){url=this.ipAddress+":"+this.port;this.connectProtocol="http"}else{if(this.ipAddress.match(/^(https:\u002f\u002f)/)){url=this.ipAddress+":"+this.port;this.connectProtocol="https"}else{var port=Number(this.port);switch(port){case this.WEBSOCKET_PORT:url="http://"+this.ipAddress+":"+this.port;this.connectProtocol="http";break;case this.SSLWEBSOCKET_PORT:url="https://"+this.ipAddress+":"+this.port;this.connectProtocol="https";break;default:url="http://"+this.ipAddress+":"+this.port;this.connectProtocol="http";break}}}this.socketConnect(url,false);return},socketConnect:function(url,isReconnect){var timeout=this.CONNECT_TIMEOUT;if(isReconnect){timeout=this.RECONNECT_INTERVAL}socket=io.connect(url,{reconnect:false,"connect timeout":timeout,"force new connection":true});var self=this;socket.on("connect",function(data){try{isConnected=true;for(var i=0;i<self.socketList.length;i++){var oldSocket=self.socketList[i];oldSocket.disconnect()}}catch(e){}});socket.on("close",function(){try{isConnected=false}catch(e){}});socket.on("disconnect",function(data){try{if(self.isReconnecting){return}if(self.isApiDisconnect()){isConnected=false;self.init();if(self.ondisconnect!=null){self.ondisconnect()}}else{self.setReconnect()}}catch(e){}});socket.on("error",function(){try{isConnected=false;if(connectCallback!=null){connectCallback(CONNECT_RESULT_ERROR_PARAMETER);initConnectCallback()}}catch(e){}});socket.on("connect_failed",function(){try{isConnected=false;if(connectCallback!=null){connectCallback(CONNECT_RESULT_ERROR_TIMEOUT);initConnectCallback()}}catch(e){}});socket.on(SOCKET_EVENT_NAME,function(recvData){var SOCKET_COMMAND_CONNECT="connect";var SOCKET_COMMAND_RECONNECT="reconnect";var SOCKET_COMMAND_DISCONNECT="disconnect";var SOCKET_COMMAND_PUBKEY="pubkey";var SOCKET_COMMAND_ADMININFO="admin_info";var SOCKET_COMMAND_OPENDEVICE="open_device";var SOCKET_COMMAND_CLOSEDEVICE="close_device";var SOCKET_COMMAND_DATA="device_data";var SOCKET_COMMAND_SERVICE="service_data";var SOCKET_COMMAND_ERROR="error";var SOCKET_COMMAND_OPENCOMM="open_commbox";var SOCKET_COMMAND_CLOSECOMM="close_commbox";var SOCKET_COMMAND_COMMDATA="commbox_data";var SOCKET_RESULT_OK="OK";var SOCKET_RESULT_SHAREDKEY_MISMATCH_ERROR="SHARED_KEY_MISMATCH_ERROR";var SOCKET_RESULT_CLIENT_NOT_FOUND="CLIENT_NOT_FOUND";var PUBKEY_TEST_TEXT="hello";if(recvData==null){return}var header=recvData[0];switch(header){case SOCKET_COMMAND_CONNECT:socketCommandConnect(recvData);break;case SOCKET_COMMAND_DISCONNECT:socketCommandDisconnect(recvData);break;case SOCKET_COMMAND_RECONNECT:socketCommandReconnect(recvData);break;case SOCKET_COMMAND_PUBKEY:socketCommandPubkey(recvData);break;case SOCKET_COMMAND_ADMININFO:socketCommandAdminInfo(recvData);break;case SOCKET_COMMAND_OPENDEVICE:socketCommandOpenDevice(recvData);break;case SOCKET_COMMAND_CLOSEDEVICE:socketCommandCloseDevice(recvData);break;case SOCKET_COMMAND_DATA:socketCommandData(recvData);break;case SOCKET_COMMAND_SERVICE:socketCommandService(recvData);break;case SOCKET_COMMAND_ERROR:socketCommandError(recvData);break;case SOCKET_COMMAND_OPENCOMM:socketCommandOpenComm(recvData);break;case SOCKET_COMMAND_CLOSECOMM:socketCommandCloseComm(recvData);break;case SOCKET_COMMAND_COMMDATA:socketCommandCommData(recvData);break;default:break}function socketCommandConnect(recvData){try{var data=recvData[1];self.prime=data.prime;self.key=data.key;var protocol_version=data.protocol_version;var client_id=data.client_id;if(self.connectMode==self.CONNECT_RECONNECT){if(self.reconnectTryCount==0){return}else{self.initReconnectTimer()}}if(protocol_version<2){sendPubkeyInfo(self.prime,self.key);self.setClientId(client_id);return}if(self.clientId!=""){var command=msgGenerator.getReconnect({old_client_id:self.clientId,new_client_id:client_id,received_id:self.recievedDataId});socket.emit(SOCKET_EVENT_NAME,command);self.setClientId(client_id);return}var cookieClientId=self.cookieIo.readCookie(self.COOKIE_KEY_CLIENTID);if(cookieClientId==""){sendPubkeyInfo(self.prime,self.key);self.setClientId(client_id);return}else{self.reconnectSeqDisconnect=true;if(cookieClientId!=""){var command=msgGenerator.getDisconnect({client_id:cookieClientId});socket.emit(SOCKET_EVENT_NAME,command)}self.setClientId(client_id);return}}catch(e){if(connectCallback!=null){connectCallback(e.message);initConnectCallback()}}return}function socketCommandDisconnect(recvData){var result=recvData[1];if(self.reconnectSeqDisconnect){sendPubkeyInfo(self.prime,self.key)}self.reconnectSeqDisconnect=false}function socketCommandReconnect(recvData){try{self.isReconnecting=false;if(self.connectMode!=self.CONNECT_RECONNECT){return}var result=recvData[1];switch(result){case SOCKET_RESULT_OK:if(self.onreconnect!=null){self.onreconnect()}break;case SOCKET_RESULT_CLIENT_NOT_FOUND:isConnected=false;self.init();if(self.ondisconnect!=null){self.ondisconnect()}break;default:throw new Error(result);break}}catch(e){if(self.onerror!=null){self.onerror("0","",e.message,null)}}return}function socketCommandPubkey(recvData){try{var result=recvData[1];if(result==SOCKET_RESULT_SHAREDKEY_MISMATCH_ERROR){throw new Error("")}if(result==ERROR_PARAM_ERROR){throw new Error(ERROR_SYSTEM_ERROR)}sendAdminInfo()}catch(e){var exception=e.message;if((exception==null)||(exception=="")){self.connect(self.ipAddress,self.port,connectCallback)}else{if(connectCallback!=null){connectCallback(exception);initConnectCallback()}}}return}function socketCommandAdminInfo(recvData){try{var result=recvData[1];var data=recvData[2];if(result!=SOCKET_RESULT_OK){throw new Error(result)}self.adminInfo=data.admin_name;self.locationInfo=data.location;if(connectCallback!=null){var code=CONNECT_RESULT_OK;if(self.connectProtocol=="https"){code=CONNECT_RESULT_SSL_OK}connectCallback(code);initConnectCallback()}}catch(e){if(connectCallback!=null){connectCallback(e.message);initConnectCallback()}}return}function socketCommandOpenDevice(recvData){var deviceID="";try{deviceID=recvData[1];var code=recvData[2];if(recvData.length>4){if(recvData[4]!=""){self.recievedDataId=recvData[4]}}var driverObj=null;if(code==SOCKET_RESULT_OK){var driverObj=deviceInfo.getClientDriverObj(deviceID)}var callback=deviceInfo.getResultCallback(deviceID);if(callback!=null){callback(driverObj,code)}if(code!=SOCKET_RESULT_OK){deviceInfo.removeClientDeviceInfo(deviceID)}}catch(e){if(self.onerror!=null){self.onerror("0",deviceID,ERROR_SYSTEM_ERROR,null)}}return}function socketCommandCloseDevice(recvData){var deviceID="";try{deviceID=recvData[1];var code=recvData[2];if(recvData.length>4){if(recvData[4]!=""){self.recievedDataId=recvData[4]}}var callback=deviceInfo.getResultCallback(deviceID);if(callback!=null){callback(code)}if(code==SOCKET_RESULT_OK){deviceInfo.removeClientDeviceInfo(deviceID)}}catch(e){if(self.onerror!=null){self.onerror("0",deviceID,ERROR_SYSTEM_ERROR,null)}}return}function socketCommandData(recvData){var sq="";var deviceID="";try{sq=recvData[1];deviceID=recvData[2];var data=recvData[3];if(recvData.length>4){if(recvData[4]!=""){self.recievedDataId=recvData[4]}}if(deviceInfo.getClientDeviceInfo(deviceID).isCrypto){var strData=ePosC.bfDecrypt(data);data=JSON.parse(strData)}var drvObj=deviceInfo.getClientDeviceInfo(deviceID).driverObj;var method="client_"+data.type;try{try{eval("drvObj."+method+"(data, sq)")}catch(e){eval("drvObj."+data.type+"(data, sq)")}}catch(e){throw new Error("")}}catch(e){if(self.onerror!=null){self.onerror(sq,deviceID,ERROR_SYSTEM_ERROR,null)}}return}function socketCommandService(recvData){var sq="";try{sq=recvData[1];var isCrypto=recvData[3];var data=recvData[4];if(recvData.length>5){if(recvData[5]!=""){self.recievedDataId=recvData[5]}}if(isCrypto=="1"){var strData=ePosC.bfDecrypt(data,sq);data=JSON.parse(strData)}try{ofscCallbackList[0](data.resultdata,sq);ofscCallbackList.splice(0,1)}catch(e){throw new Error("")}}catch(e){if(self.onerror!=null){self.onerror(sq,self.OFSC_SERVICE_ID,ERROR_SYSTEM_ERROR,null)}}return}function socketCommandError(recvData){var sq="";var deviceID="";try{sq=recvData[1];deviceID=recvData[2];var code=recvData[3];var data=recvData[4];if(recvData.length>5){if(recvData[5]!=""){self.recievedDataId=recvData[5]}}if(self.onerror!=null){self.onerror(sq,deviceID,code,data)}}catch(e){if(self.onerror!=null){self.onerror(sq,deviceID,ERROR_SYSTEM_ERROR,null)}}return}function socketCommandOpenComm(recvData){var sq="";var boxID="";try{sq=recvData[1];var data=recvData[2];var boxID=data.box_id;if(recvData.length>3){if(recvData[3]!=""){self.recievedDataId=recvData[3]}}self.commBoxManager.client_opencommbox(data,sq)}catch(e){if(self.onerror!=null){self.onerror(sq,"",ERROR_SYSTEM_ERROR,null)}}return}function socketCommandCloseComm(recvData){var sq="";var boxID="";try{sq=recvData[1];var data=recvData[2];var boxID=data.box_id;if(recvData.length>3){if(recvData[3]!=""){self.recievedDataId=recvData[3]}}self.commBoxManager.client_closecommbox(data,sq)}catch(e){if(self.onerror!=null){self.onerror(sq,"",ERROR_SYSTEM_ERROR,null)}}return}function socketCommandCommData(recvData){var sq="";var boxID="";try{sq=recvData[1];var data=recvData[2];var boxID=data.box_id;if(recvData.length>3){if(recvData[3]!=""){self.recievedDataId=recvData[3]}}self.commBoxManager.executeCommDataCallback(data,sq)}catch(e){if(self.onerror!=null){self.onerror(sq,"",ERROR_SYSTEM_ERROR,null)}}return}function sendPubkeyInfo(prime,key){try{ePosC.genClientKeys(prime,key);var testData=ePosC.bfEncrypt(PUBKEY_TEST_TEXT);var pubkey=bigInt2str(ePosC.pubkey_c,16);var command=msgGenerator.getPubkey(null,{key:pubkey,testData:testData});socket.emit(SOCKET_EVENT_NAME,command)}catch(e){throw new Error(ERROR_SYSTEM_ERROR)}return}function sendAdminInfo(){try{var command=msgGenerator.getAdminInfo(null,{});socket.emit(SOCKET_EVENT_NAME,command)}catch(e){throw new Error(ERROR_SYSTEM_ERROR)}return}function initConnectCallback(){connectCallback=null;return}})},isApiDisconnect:function(){var ret=false;var cookieClientId=this.cookieIo.readCookie(this.COOKIE_KEY_CLIENTID);if((this.clientId=="")&&(cookieClientId=="")){ret=true}return ret},setClientId:function(id){var ret=false;if(id==null){return ret}this.clientId=id;ret=this.cookieIo.writeCookie(this.COOKIE_KEY_CLIENTID,id);return ret},clearListeners:function(){var ret=false;if(socket==null){return ret}socket.removeAllListeners("connect");socket.removeAllListeners("close");socket.removeAllListeners("disconnect");socket.removeAllListeners("error");socket.removeAllListeners("connect_failed");socket.removeAllListeners(SOCKET_EVENT_NAME);ret=true;return(ret)},disconnect:function(){if(socket==null){return}var clientId=this.clientId;this.clientId="";var command=msgGenerator.getDisconnect({client_id:clientId});socket.emit(SOCKET_EVENT_NAME,command);this.clearListeners();this.init();if(this.ondisconnect!=null){this.ondisconnect()}isConnected=false;return(true)},isConnected:function(){return isConnected},getAdmin:function(){return this.adminInfo},getLocation:function(){return this.locationInfo},createDevice:function(deviceID,deviceType,options,callback){try{var isCrypto=false;var isBuffer=null;if(deviceType==this.DEVICE_TYPE_DT){isCrypto=true;deviceID=this.DEVICE_ID_DT}if(typeof(options)=="boolean"){isCrypto=options}else{if(typeof(options.crypto)=="boolean"){isCrypto=options.crypto}if(typeof(options.buffer)=="boolean"){isBuffer=options.buffer}}if(deviceInfo.isExsitClientDeviceInfo(deviceID)){throw new Error(this.ERROR_DEVICE_IN_USE)}if(socket==null){throw new Error(ERROR_SYSTEM_ERROR)}var driverClass="";switch(deviceType){case this.DEVICE_TYPE_SCANNER:driverClass=this.CLIENT_DRIVER_SCANNER;break;case this.DEVICE_TYPE_KEYBOARD:driverClass=this.CLIENT_DRIVER_KEYBOARD;break;case this.DEVICE_TYPE_MSR:driverClass=this.CLIENT_DRIVER_MSR;break;case this.DEVICE_TYPE_CAT:driverClass=this.CLIENT_DRIVER_CAT;break;case this.DEVICE_TYPE_CASH_CHANGER:driverClass=this.CLIENT_DRIVER_CASH_CHANGER;break;case this.DEVICE_TYPE_PRINTER:driverClass=this.CLIENT_DRIVER_PRINTER;break;case this.DEVICE_TYPE_DISPLAY:driverClass=this.CLIENT_DRIVER_DISPLAY;break;case this.DEVICE_TYPE_SIMPLE_SERIAL:driverClass=this.CLIENT_DRIVER_SIMPLE_SERIAL;break;case this.DEVICE_TYPE_HYBRID_PRINTER:driverClass=this.CLIENT_DRIVER_HYBRID_PRINTER;break;case this.DEVICE_TYPE_DT:driverClass=this.CLIENT_DRIVER_DT;break;default:break}if(typeof(options.driver)=="string"){driverClass=options.driver}var func=eval(driverClass);if(typeof(func)!="function"){throw new Error(ERROR_PARAM_ERROR)}var driverObj=new func(this,deviceID);switch(deviceType){case this.DEVICE_TYPE_PRINTER:case this.DEVICE_TYPE_HYBRID_PRINTER:driverObj.setIpAddress(this.ipAddress);break;default:break}deviceInfo.addClientDeviceInfo(deviceID,isCrypto,driverObj,callback);var data={type:deviceType,crypto:isCrypto};if(isBuffer!=null){data.buffer=isBuffer}var command=msgGenerator.getOpenDevice(deviceID,null,data);socket.emit(SOCKET_EVENT_NAME,command)}catch(e){var exception=e.message;if((exception==null)||(exception=="")){exception=this.ERROR_DEVICE_OPEN_ERROR}if(callback!=null){callback(null,exception)}}return},deleteDevice:function(driverObject,callback){try{if(socket==null){throw new Error(ERROR_SYSTEM_ERROR)}var devStruct=deviceInfo.getClientDeviceInfoByDriverObj(driverObject);if(devStruct==null){throw new Error(this.ERROR_DEVICE_NOT_OPEN)}deviceInfo.setResultCallback(devStruct.deviceID,callback);var command=msgGenerator.getCloseDevice(devStruct.deviceID,null,{});socket.emit(SOCKET_EVENT_NAME,command)}catch(e){var exception=e.message;if((exception==null)||(exception=="")){exception=this.ERROR_DEVICE_CLOSE_ERROR}if(callback!=null){callback(exception)}}},sendDeviceData:function(deviceID,deviceData){var sq=-1;try{if(socket==null){return sq}var devInfo=deviceInfo.getClientDeviceInfo(deviceID);var command="";var sq=this.genSequence();if(devInfo.isCrypto){command=msgGenerator.getDeviceData(sq,deviceID,deviceData,ePosC)}else{command=msgGenerator.getDeviceData(sq,deviceID,deviceData,null)}socket.emit(SOCKET_EVENT_NAME,command)}catch(e){sq=-1}return sq},sendOfscXml:function(xml,timeout,isCrypto,callback){try{var serviceID=this.OFSC_SERVICE_ID;if(socket==null){throw new Error("")}var command="";var sq=this.genSequence();ofscCallbackList.push(callback);var data={type:"print",timeout:timeout,printdata:xml};if(isCrypto){command=msgGenerator.getServiceData(sq,serviceID,data,ePosC)}else{command=msgGenerator.getServiceData(sq,serviceID,data,null)}socket.emit(SOCKET_EVENT_NAME,command)}catch(e){return -1}},genSequence:function(){this.sequence++;if(this.sequence>=Number.MAX_VALUE){this.sequence=this.SEQUENCE_INIT_PARAM}return String(this.sequence)},getCommBoxManager:function(){if(socket==null){return null}return this.commBoxManager},sendOpenComm:function(sq,data){try{if(socket==null){return -1}var command=msgGenerator.getOpenComm(sq,null,data);socket.emit(SOCKET_EVENT_NAME,command)}catch(e){return -1}return sq},sendCloseComm:function(sq,data){try{if(socket==null){return -1}var command=msgGenerator.getCloseComm(sq,null,data);socket.emit(SOCKET_EVENT_NAME,command)}catch(e){return -1}return sq},sendCommData:function(sq,data){try{if(socket==null){return -1}var command=msgGenerator.getCommData(sq,data,null);socket.emit(SOCKET_EVENT_NAME,command)}catch(e){return -1}return sq}};function utility(){}utility.prototype={init:function(){},clone:function(obj){var func=function(){};func.prototype=obj;return new func}};function cookieIO(){this.init()}cookieIO.prototype={init:function(){},writeCookie:function(valueId,value){if((valueId==null)||(valueId=="")){return false}if(value==null){return false}var path=location.pathname;if(path.slice(-1)=="/"){path=path+"index.html"}document.cookie=valueId+"="+escape(value)+"; path="+path+";";return true},readCookie:function(valueId){var ret="";valueId+="=";var strCookie=document.cookie+";";var start=strCookie.indexOf(valueId);if(start!=-1){var end=strCookie.indexOf(";",start);ret=unescape(strCookie.substring(start+valueId.length,end))}return ret}};function clientDeviceInfo(){this.clientDevStructList=null;this.init()}clientDeviceInfo.prototype={init:function(){this.clientDevStructList=new Array()},addClientDeviceInfo:function(deviceID,isCrypto,driverObj,callback){var clientDevStruct=new clientDeviceStruct(deviceID,isCrypto,driverObj,callback);this.clientDevStructList[deviceID]=clientDevStruct},getClientDeviceInfo:function(deviceID){for(var i in this.clientDevStructList){if(this.clientDevStructList[i].deviceID==deviceID){return this.clientDevStructList[i]}}return null},getClientDeviceInfoByDriverObj:function(driverObj){for(var i in this.clientDevStructList){if(this.clientDevStructList[i].driverObj==driverObj){return this.clientDevStructList[i]}}return null},getClientDriverObj:function(deviceID){return this.getClientDeviceInfo(deviceID).driverObj},setResultCallback:function(deviceID,callback){var devStruct=this.getClientDeviceInfo(deviceID);devStruct.resultCallback=callback;this.removeClientDeviceInfo(deviceID);this.addClientDeviceInfo(devStruct.deviceID,devStruct.isCrypto,devStruct.driverObj,callback);return},getResultCallback:function(deviceID){var callback=null;var devStruct=this.getClientDeviceInfo(deviceID);if(devStruct!=null){callback=devStruct.resultCallback}return callback},removeClientDeviceInfo:function(deviceID){for(var i in this.clientDevStructList){if(this.clientDevStructList[i].deviceID==deviceID){delete this.clientDevStructList[i];return}}},isExsitClientDeviceInfo:function(deviceID){var ret=true;if(this.clientDevStructList[deviceID]==null){ret=false}return ret}};function clientDeviceStruct(deviceID,isCrypto,driverObj,resultCallback){this.deviceID=deviceID;this.isCrypto=isCrypto;this.driverObj=driverObj;this.resultCallback=resultCallback}function clientMessageGenerator(){}clientMessageGenerator.prototype={getOpenDevice:function(deviceID,code,data){var message="";if(code==null){message=["open_device",deviceID,data,"0"]}else{message=["open_device",deviceID,code,data,"0"]}return message},getCloseDevice:function(deviceID,code,data){var message="";if(code==null){message=["close_device",deviceID,data,"0"]}else{message=["close_device",deviceID,code,data,"0"]}return message},getDeviceData:function(sq,deviceID,data,cryptoObj){var message="";if(cryptoObj==null){message=["device_data",sq,deviceID,data,"0"]}else{var encryptData=cryptoObj.bfEncrypt(JSON.stringify(data));message=["device_data",sq,deviceID,encryptData,"0"]}return message},getPubkey:function(code,data){var message="";if(code==null){message=["pubkey",data,"0"]}else{message=["pubkey",code,data,"0"]}return message},getAdminInfo:function(code,data){var message="";if(code==null){message=["admin_info",data,"0"]}else{message=["admin_info",code,data,"0"]}return message},getConnect:function(data){return["connect",data,"0"]},getReconnect:function(data){return["reconnect",data,"0"]},getDisconnect:function(data){return["disconnect",data,"0"]},getServiceData:function(sq,serviceID,data,crypto){var message="";if(crypto==null){message=["service_data",sq,serviceID,"0",data,"0"]}else{var encryptData=crypto.bfEncrypt(JSON.stringify(data));message=["service_data",sq,serviceID,"1",encryptData,"0"]}return message},getError:function(sq,deviceID,code){return["error",sq,deviceID,code,"0"]},getOpenComm:function(sq,code,data){var message="";if(code==null){message=["open_commbox",sq,data,"0"]}else{message=["open_commbox",sq,code,data,"0"]}return message},getCloseComm:function(sq,code,data){var message="";if(code==null){message=["close_commbox",sq,data,"0"]}else{message=["close_commbox",sq,code,data,"0"]}return message},getCommData:function(sq,data,cryptoObj){var message="";if(cryptoObj==null){message=["commbox_data",sq,data,"0"]}else{var encryptData=cryptoObj.bfEncrypt(JSON.stringify(data));message=["commbox_data",sq,encryptData,"0"]}return message}};function CommBoxManager(ePosDevObj){this.ERROR_OK="OK";this.ERROR_BOX_COUNT_OVER="BOX_COUNT_OVER";this.ERROR_BOX_CLIENT_OVER="BOX_CLIENT_OVER";this.ERROR_MEMBERID_ALREADY_USED="MEMBERID_ALREADY_USED";this.ERROR_ALREADY_OPENED="ALREADY_OPENED";this.ERROR_NOT_OPENED="NOT_OPENED";this.ERROR_PARAMETER_ERROR="PARAMETER_ERROR";this.ERROR_SYSTEM_ERROR="SYSTEM_ERROR";this.ePosDevObj=ePosDevObj;this.callbackInfo=null;this.commBoxList=null;this.init()}CommBoxManager.prototype={init:function(){this.callbackInfo=new callbackInfo();this.commBoxList=new Array()},openCommBox:function(boxID,option,callback){var sq=this.ePosDevObj.genSequence();var memberID="";if(option!=null&&option.memberID!=null){memberID=option.memberID}var data={box_id:boxID,member_id:memberID};this.callbackInfo.addCallback(callback,sq);sq=this.ePosDevObj.sendOpenComm(sq,data);return sq},closeCommBox:function(boxObj,callback){var sq=this.ePosDevObj.genSequence();try{var boxID=boxObj.getBoxId();if(!this.isOpened(boxID)){if(callback!=null){callback(this.ERROR_NOT_OPENED,sq)}return sq}var data={box_id:boxID};this.callbackInfo.addCallback(callback,sq);sq=this.ePosDevObj.sendCloseComm(sq,data)}catch(e){if(callback!=null){callback(this.ERROR_PARAMETER_ERROR,sq)}this.callbackInfo.removeCallback(sq)}return sq},client_opencommbox:function(data,sq){var boxID=data.box_id;var code=data.code;var commBoxObj=null;if(code==this.ERROR_OK&&this.getCommBox(boxID)==null){commBoxObj=new CommBox(boxID,this,this.callbackInfo)}if(commBoxObj!=null){this.commBoxList.push(commBoxObj)}var openCommBoxCB=this.callbackInfo.getCallback(sq);this.callbackInfo.removeCallback(sq);if(openCommBoxCB!=null){openCommBoxCB(commBoxObj,code,sq)}return},client_closecommbox:function(data,sq){var boxID=data.box_id;var code=data.code;this.removeCommBox(boxID);var closeCommBoxCB=this.callbackInfo.getCallback(sq);this.callbackInfo.removeCallback(sq);if(closeCommBoxCB!=null){closeCommBoxCB(code,sq)}return},sendCommData:function(sq,data){var ret=this.ePosDevObj.sendCommData(sq,data);return ret},executeCommDataCallback:function(data,sq){var boxID=data.box_id;var commBoxObj=this.getCommBox(boxID);var method="client_"+data.type;try{eval("commBoxObj."+method+"(data, sq)")}catch(e){throw new Error("")}return},getCommBox:function(boxID){var commBoxObj=null;for(var i=0;i<this.commBoxList.length;i++){if(this.commBoxList[i].getBoxId()==boxID){commBoxObj=this.commBoxList[i];break}}return commBoxObj},removeCommBox:function(boxID){var result=false;for(var i=0;i<this.commBoxList.length;i++){if(this.commBoxList[i].getBoxId()==boxID){this.commBoxList.splice(i,1);result=true;break}}return result},isOpened:function(boxID){var result=false;for(var i=0;i<this.commBoxList.length;i++){if(this.commBoxList[i].getBoxId()==boxID){result=true;break}}return result},genSequence:function(){return this.ePosDevObj.genSequence()}};function CommBox(boxID,commBoxManager,callbackInfo){this.ERROR_OK="OK";this.ERROR_NOT_OPENED="NOT_OPENED";this.ERROR_MEMBER_NOT_FOUND="MEMBER_NOT_FOUND";this.ERROR_SYSTEM_ERROR="SYSTEM_ERROR";this.boxID=boxID;this.commBoxManager=commBoxManager;this.callbackInfo=callbackInfo;this.onreceive=null;this.init()}CommBox.prototype={init:function(){},getCommHistory:function(option,callback){var sq=this.commBoxManager.genSequence();var _option=(typeof(option)=="function")?null:option;var _callback=(typeof(option)=="function")?option:callback;var allHistory=(_option==null)?false:option.allHistory;if(!this.commBoxManager.isOpened(this.getBoxId())){if(_callback!=null){_callback(this.ERROR_NOT_OPENED,null,sq)}return sq}this.callbackInfo.addCallback(_callback,sq);var data={type:"getcommhistory",box_id:this.boxID,all_history:allHistory};sq=this.commBoxManager.sendCommData(sq,data);return sq},send:function(message,memberID,callback){var sq=this.commBoxManager.genSequence();if(!this.commBoxManager.isOpened(this.getBoxId())){if(callback!=null){callback(this.ERROR_NOT_OPENED,0,sq)}return sq}this.callbackInfo.addCallback(callback,sq);var data={type:"send",box_id:this.boxID,message:message,member_id:memberID};sq=this.commBoxManager.sendCommData(sq,data);return sq},client_getcommhistory:function(data,sq){var code=data.code;var historyList=data.history_list;var getCommHistoryCB=this.callbackInfo.getCallback(sq);this.callbackInfo.removeCallback(sq);if(getCommHistoryCB!=null){getCommHistoryCB(code,historyList,sq)}return},client_send:function(data,sq){var code=data.code;var count=data.count;var sendCB=this.callbackInfo.getCallback(sq);this.callbackInfo.removeCallback(sq);if(sendCB!=null){sendCB(code,count,sq)}return},client_onreceive:function(data,sq){var rcvData=new Object();rcvData.senderId=data.sender_id;rcvData.receiverId=data.receiver_id;rcvData.message=data.message;if(this.onreceive!=null){this.onreceive(rcvData)}return},getBoxId:function(){return this.boxID}};function callbackInfo(){this.callbackInfoList=null;this.init()}callbackInfo.prototype={init:function(){this.callbackInfoList=new Object()},addCallback:function(callback,sq){this.callbackInfoList[sq]=callback},removeCallback:function(sq){for(var i in this.callbackInfoList){if(i==sq){delete this.callbackInfoList[i];return}}},getCallback:function(sq){if(this.callbackInfoList[sq]!=null){return this.callbackInfoList[sq]}return null}};function SimpleSerial(ePosDevObj,deviceID){this.ePosDevObj=ePosDevObj;this.deviceID=deviceID}SimpleSerial.prototype={sendCommand:function(command){var data={type:"sendcommand",command:toHexBinary(command)};var sq=this.ePosDevObj.sendDeviceData(this.deviceID,data);return sq},client_oncommandreply:function(data){try{if(this.oncommandreply==null){return}var hexData=data.data;hexData=hexData.replace(/[0-9a-fA-F]{2}/g,function(c){var hexNum=parseInt(c,16);return String.fromCharCode(hexNum)});data.data=hexData;this.oncommandreply(data)}catch(e){}return}};function CAT(ePosDevObj,deviceID){this.ePosDevObj=ePosDevObj;this.deviceID=deviceID}CAT.prototype={sendCommand:function(command){var data={type:"sendcommand",command:toHexBinary(command)};var sq=this.ePosDevObj.sendDeviceData(this.deviceID,data);return sq},client_oncommandreply:function(data){try{if(this.oncommandreply==null){return}var hexData=data.command;hexData=hexData.replace(/[0-9a-fA-F]{2}/g,function(c){var hexNum=parseInt(c,16);return String.fromCharCode(hexNum)});data.command=hexData;this.oncommandreply(data)}catch(e){}return}};function Scanner(ePosDevObj,deviceID){this.ePosDevObj=ePosDevObj;this.deviceID=deviceID;this.init()}Scanner.prototype={init:function(){},client_ondata:function(data){try{if(this.ondata==null){return}this.ondata(data)}catch(e){}return},callEvent:function(eventName,data){var eventReq=data;eventReq.type=eventName;var sq=this.ePosDevObj.sendDeviceData(this.deviceID,eventReq);return sq}};function Keyboard(ePosDevObj,deviceID){this.VK_CANCEL=3;this.VK_BACK=8;this.VK_TAB=9;this.VK_RETURN=13;this.VK_SHIFT=16;this.VK_CONTROL=17;this.VK_MENU=18;this.VK_PAUSE=19;this.VK_CAPITAL=20;this.VK_KANA=21;this.VK_ESCAPE=27;this.VK_CONVERT=28;this.VK_NONCONVERT=29;this.VK_SPACE=32;this.VK_PRIOR=33;this.VK_NEXT=34;this.VK_END=35;this.VK_HOME=36;this.VK_LEFT=37;this.VK_UP=38;this.VK_RIGHT=39;this.VK_DOWN=40;this.VK_INSERT=45;this.VK_DELETE=46;this.VK_0=48;this.VK_1=49;this.VK_2=50;this.VK_3=51;this.VK_4=52;this.VK_5=53;this.VK_6=54;this.VK_7=55;this.VK_8=56;this.VK_9=57;this.VK_A=65;this.VK_B=66;this.VK_C=67;this.VK_D=68;this.VK_E=69;this.VK_F=70;this.VK_G=71;this.VK_H=72;this.VK_I=73;this.VK_J=74;this.VK_K=75;this.VK_L=76;this.VK_M=77;this.VK_N=78;this.VK_O=79;this.VK_P=80;this.VK_Q=81;this.VK_R=82;this.VK_S=83;this.VK_T=84;this.VK_U=85;this.VK_V=86;this.VK_W=87;this.VK_X=88;this.VK_Y=89;this.VK_Z=90;this.VK_LWIN=91;this.VK_RWIN=92;this.VK_APPS=93;this.VK_NUMPAD0=96;this.VK_NUMPAD1=97;this.VK_NUMPAD2=98;this.VK_NUMPAD3=99;this.VK_NUMPAD4=100;this.VK_NUMPAD5=101;this.VK_NUMPAD6=102;this.VK_NUMPAD7=103;this.VK_NUMPAD8=104;this.VK_NUMPAD9=105;this.VK_MULTIPLY=106;this.VK_ADD=107;this.VK_SEPARATOR=108;this.VK_SUBTRACT=109;this.VK_DECIMAL=110;this.VK_DIVIDE=111;this.VK_F1=112;this.VK_F2=113;this.VK_F3=114;this.VK_F4=115;this.VK_F5=116;this.VK_F6=117;this.VK_F7=118;this.VK_F8=119;this.VK_F9=120;this.VK_F10=121;this.VK_F11=122;this.VK_F12=123;this.VK_NUMLOCK=144;this.VK_SCROLL=145;this.VK_LSHIFT=160;this.VK_RSHIFT=161;this.VK_LCONTROL=162;this.VK_RCONTROL=163;this.VK_LMENU=164;this.VK_RMENU=165;this.VK_OEM_1=186;this.VK_OEM_PLUS=187;this.VK_OEM_COMMA=188;this.VK_OEM_MINUS=189;this.VK_OEM_PERIOD=190;this.VK_OEM_2=191;this.VK_OEM_3=192;this.VK_OEM_4=219;this.VK_OEM_5=220;this.VK_OEM_6=221;this.VK_OEM_7=222;this.VK_OEM_102=226;this.VK_OEM_ATTN=240;this.ePosDevObj=ePosDevObj;this.deviceID=deviceID}Keyboard.prototype={client_onkeypress:function(data){try{if(this.onkeypress==null){return}this.onkeypress(data)}catch(e){}return},client_onstring:function(data){try{if(this.onstring==null){return}this.onstring(data)}catch(e){}return},setPrefix:function(keycodes){var data={type:"setprefix"};if(typeof keycodes=="object"){if((keycodes.length==0)){return -1}data.keycodes=keycodes}else{if((keycodes==null)||(keycodes=="")){return -1}data.keycodes=[keycodes]}var sq=this.ePosDevObj.sendDeviceData(this.deviceID,data);return sq},callEvent:function(eventName,data){var eventReq=data;eventReq.type=eventName;var sq=this.ePosDevObj.sendDeviceData(this.deviceID,eventReq);return sq}};function MSR(ePosDevObj,deviceID){this.ePosDevObj=ePosDevObj;this.deviceID=deviceID;this.init()}MSR.prototype={init:function(){},client_ondata:function(data){try{if(this.ondata==null){return}this.ondata(data)}catch(e){}return},callEvent:function(eventName,data){var eventReq=data;eventReq.type=eventName;var sq=this.ePosDevObj.sendDeviceData(this.deviceID,eventReq);return sq}};function CashChanger(ePosDevObj,deviceID){this.CONFIG_LEFT_CASH="CONFIG_LEFT_CASH";this.CONFIG_COUNT_MODE="CONFIG_COUNT_MODE";this.MODE_MANUAL_INPUT="MODE_MANUAL_INPUT";this.MODE_AUTOCOUNT="MODE_AUTO_COUNT";this.DEPOSIT_CHANGE="DEPOSIT_CHANGE";this.DEPOSIT_NOCHANGE="DEPOSIT_NOCHANGE";this.DEPOSIT_REPAY="DEPOSIT_REPAY";this.COLLECT_ALL_CASH="ALL_CASH";this.COLLECT_PART_OF_CASH="PART_OF_CASH";this.ePosDevObj=ePosDevObj;this.deviceID=deviceID}CashChanger.prototype={client_oncashcounts:function(data){try{if(this.oncashcounts==null){return}this.oncashcounts(data)}catch(e){}return},client_onstatuschange:function(data){try{if(this.onstatuschange==null){return}this.onstatuschange(data)}catch(e){}return},client_ondeposit:function(data){try{if(this.ondeposit==null){return}this.ondeposit(data)}catch(e){}return},client_ondispense:function(data){try{if(this.ondispense==null){return}this.ondispense(data)}catch(e){}return},client_oncollect:function(data){try{if(this.oncollect==null){return}this.oncollect(data)}catch(e){}return},client_onconfigchange:function(data){try{if(this.onconfigchange==null){return}this.onconfigchange(data)}catch(e){}return},client_oncommandreply:function(data){try{if(this.oncommandreply==null){return}var hexData=data.data;hexData=hexData.replace(/[0-9a-fA-F]{2}/g,function(c){var hexNum=parseInt(c,16);return String.fromCharCode(hexNum)});data.data=hexData;this.oncommandreply(data)}catch(e){}return},readCashCounts:function(){var data={type:"readcashcounts"};var sq=this.ePosDevObj.sendDeviceData(this.deviceID,data);return sq},beginDeposit:function(){var data={type:"begindeposit"};var sq=this.ePosDevObj.sendDeviceData(this.deviceID,data);return sq},pauseDeposit:function(){var data={type:"pausedeposit"};var sq=this.ePosDevObj.sendDeviceData(this.deviceID,data);return sq},restartDeposit:function(){var data={type:"restartdeposit"};var sq=this.ePosDevObj.sendDeviceData(this.deviceID,data);return sq},endDeposit:function(cmd){var data={type:"enddeposit",cmd:cmd};var sq=this.ePosDevObj.sendDeviceData(this.deviceID,data);return sq},dispenseCash:function(cash){var data={type:"dispensecash",cash:cash};var sq=this.ePosDevObj.sendDeviceData(this.deviceID,data);return sq},dispenseChange:function(data){data.type="dispensechange";var sq=this.ePosDevObj.sendDeviceData(this.deviceID,data);return sq},openDrawer:function(){var data={type:"opendrawer"};var ret=this.ePosDevObj.sendDeviceData(this.deviceID,data);return ret},collectCash:function(collectMode){var data={type:"collectcash",collectmode:collectMode};var sq=this.ePosDevObj.sendDeviceData(this.deviceID,data);return sq},setConfig:function(config,value){var data=null;switch(config){case this.CONFIG_COUNT_MODE:data={type:"setconfig",config:config,mode:value.mode};break;case this.CONFIG_LEFT_CASH:if((value.bills==null)||(value.bills=="")){value.bills="0"}if((value.coins==null)||(value.coins=="")){value.coins="0"}data={type:"setconfig",config:config,bills:value.bills,coins:value.coins};break;default:break}var sq=-1;if(data!=null){sq=this.ePosDevObj.sendDeviceData(this.deviceID,data)}return sq},sendCommand:function(command){var data={type:"sendcommand",command:toHexBinary(command)};var sq=this.ePosDevObj.sendDeviceData(this.deviceID,data);return sq},callEvent:function(eventName,data){var eventReq=data;eventReq.type=eventName;var sq=this.ePosDevObj.sendDeviceData(this.deviceID,eventReq);return sq}};
|
2 |
+
/*! Based JavaScript is ePOS-Print API Version 4.1.0 */
|
3 |
+
function ePOSBuilder(){this.message="";this.halftone=0;this.brightness=1;this.force=false;this.FONT_A="font_a";this.FONT_B="font_b";this.FONT_C="font_c";this.FONT_D="font_d";this.FONT_E="font_e";this.FONT_SPECIAL_A="special_a";this.FONT_SPECIAL_B="special_b";this.ALIGN_LEFT="left";this.ALIGN_CENTER="center";this.ALIGN_RIGHT="right";this.COLOR_NONE="none";this.COLOR_1="color_1";this.COLOR_2="color_2";this.COLOR_3="color_3";this.COLOR_4="color_4";this.FEED_PEELING="peeling";this.FEED_CUTTING="cutting";this.FEED_CURRENT_TOF="current_tof";this.FEED_NEXT_TOF="next_tof";this.MODE_MONO="mono";this.MODE_GRAY16="gray16";this.BARCODE_UPC_A="upc_a";this.BARCODE_UPC_E="upc_e";this.BARCODE_EAN13="ean13";this.BARCODE_JAN13="jan13";this.BARCODE_EAN8="ean8";this.BARCODE_JAN8="jan8";this.BARCODE_CODE39="code39";this.BARCODE_ITF="itf";this.BARCODE_CODABAR="codabar";this.BARCODE_CODE93="code93";this.BARCODE_CODE128="code128";this.BARCODE_GS1_128="gs1_128";this.BARCODE_GS1_DATABAR_OMNIDIRECTIONAL="gs1_databar_omnidirectional";this.BARCODE_GS1_DATABAR_TRUNCATED="gs1_databar_truncated";this.BARCODE_GS1_DATABAR_LIMITED="gs1_databar_limited";this.BARCODE_GS1_DATABAR_EXPANDED="gs1_databar_expanded";this.HRI_NONE="none";this.HRI_ABOVE="above";this.HRI_BELOW="below";this.HRI_BOTH="both";this.SYMBOL_PDF417_STANDARD="pdf417_standard";this.SYMBOL_PDF417_TRUNCATED="pdf417_truncated";this.SYMBOL_QRCODE_MODEL_1="qrcode_model_1";this.SYMBOL_QRCODE_MODEL_2="qrcode_model_2";this.SYMBOL_QRCODE_MICRO="qrcode_micro";this.SYMBOL_MAXICODE_MODE_2="maxicode_mode_2";this.SYMBOL_MAXICODE_MODE_3="maxicode_mode_3";this.SYMBOL_MAXICODE_MODE_4="maxicode_mode_4";this.SYMBOL_MAXICODE_MODE_5="maxicode_mode_5";this.SYMBOL_MAXICODE_MODE_6="maxicode_mode_6";this.SYMBOL_GS1_DATABAR_STACKED="gs1_databar_stacked";this.SYMBOL_GS1_DATABAR_STACKED_OMNIDIRECTIONAL="gs1_databar_stacked_omnidirectional";this.SYMBOL_GS1_DATABAR_EXPANDED_STACKED="gs1_databar_expanded_stacked";this.SYMBOL_AZTECCODE_FULLRANGE="azteccode_fullrange";this.SYMBOL_AZTECCODE_COMPACT="azteccode_compact";this.SYMBOL_DATAMATRIX_SQUARE="datamatrix_square";this.SYMBOL_DATAMATRIX_RECTANGLE_8="datamatrix_rectangle_8";this.SYMBOL_DATAMATRIX_RECTANGLE_12="datamatrix_rectangle_12";this.SYMBOL_DATAMATRIX_RECTANGLE_16="datamatrix_rectangle_16";this.LEVEL_0="level_0";this.LEVEL_1="level_1";this.LEVEL_2="level_2";this.LEVEL_3="level_3";this.LEVEL_4="level_4";this.LEVEL_5="level_5";this.LEVEL_6="level_6";this.LEVEL_7="level_7";this.LEVEL_8="level_8";this.LEVEL_L="level_l";this.LEVEL_M="level_m";this.LEVEL_Q="level_q";this.LEVEL_H="level_h";this.LEVEL_DEFAULT="default";this.LINE_THIN="thin";this.LINE_MEDIUM="medium";this.LINE_THICK="thick";this.LINE_THIN_DOUBLE="thin_double";this.LINE_MEDIUM_DOUBLE="medium_double";this.LINE_THICK_DOUBLE="thick_double";this.DIRECTION_LEFT_TO_RIGHT="left_to_right";this.DIRECTION_BOTTOM_TO_TOP="bottom_to_top";this.DIRECTION_RIGHT_TO_LEFT="right_to_left";this.DIRECTION_TOP_TO_BOTTOM="top_to_bottom";this.CUT_NO_FEED="no_feed";this.CUT_FEED="feed";this.CUT_RESERVE="reserve";this.DRAWER_1="drawer_1";this.DRAWER_2="drawer_2";this.PULSE_100="pulse_100";this.PULSE_200="pulse_200";this.PULSE_300="pulse_300";this.PULSE_400="pulse_400";this.PULSE_500="pulse_500";this.PATTERN_NONE="none";this.PATTERN_1="pattern_1";this.PATTERN_2="pattern_2";this.PATTERN_3="pattern_3";this.PATTERN_4="pattern_4";this.PATTERN_5="pattern_5";this.PATTERN_6="pattern_6";this.PATTERN_7="pattern_7";this.PATTERN_8="pattern_8";this.PATTERN_9="pattern_9";this.PATTERN_10="pattern_10";this.PATTERN_A="pattern_a";this.PATTERN_B="pattern_b";this.PATTERN_C="pattern_c";this.PATTERN_D="pattern_d";this.PATTERN_E="pattern_e";this.PATTERN_ERROR="error";this.PATTERN_PAPER_END="paper_end";this.LAYOUT_RECEIPT="receipt";this.LAYOUT_RECEIPT_BM="receipt_bm";this.LAYOUT_LABEL="label";this.LAYOUT_LABEL_BM="label_bm";this.HALFTONE_DITHER=0;this.HALFTONE_ERROR_DIFFUSION=1;this.HALFTONE_THRESHOLD=2}ePOSBuilder.prototype.addText=function(data){this.message+="<text>"+escapeMarkup(data)+"</text>";return this};ePOSBuilder.prototype.addTextLang=function(lang){this.message+='<text lang="'+lang+'"/>';return this};ePOSBuilder.prototype.addTextAlign=function(align){var s="";s+=getEnumAttr("align",align,regexAlign);this.message+="<text"+s+"/>";return this};ePOSBuilder.prototype.addTextRotate=function(rotate){var s="";s+=getBoolAttr("rotate",rotate);this.message+="<text"+s+"/>";return this};ePOSBuilder.prototype.addTextLineSpace=function(linespc){var s="";s+=getUByteAttr("linespc",linespc);this.message+="<text"+s+"/>";return this};ePOSBuilder.prototype.addTextFont=function(font){var s="";s+=getEnumAttr("font",font,regexFont);this.message+="<text"+s+"/>";return this};ePOSBuilder.prototype.addTextSmooth=function(smooth){var s="";s+=getBoolAttr("smooth",smooth);this.message+="<text"+s+"/>";return this};ePOSBuilder.prototype.addTextDouble=function(dw,dh){var s="";if(dw!==undefined){s+=getBoolAttr("dw",dw)}if(dh!==undefined){s+=getBoolAttr("dh",dh)}this.message+="<text"+s+"/>";return this};ePOSBuilder.prototype.addTextSize=function(width,height){var s="";if(width!==undefined){s+=getIntAttr("width",width,1,8)}if(height!==undefined){s+=getIntAttr("height",height,1,8)}this.message+="<text"+s+"/>";return this};ePOSBuilder.prototype.addTextStyle=function(reverse,ul,em,color){var s="";if(reverse!==undefined){s+=getBoolAttr("reverse",reverse)}if(ul!==undefined){s+=getBoolAttr("ul",ul)}if(em!==undefined){s+=getBoolAttr("em",em)}if(color!==undefined){s+=getEnumAttr("color",color,regexColor)}this.message+="<text"+s+"/>";return this};ePOSBuilder.prototype.addTextPosition=function(x){var s="";s+=getUShortAttr("x",x);this.message+="<text"+s+"/>";return this};ePOSBuilder.prototype.addTextVPosition=function(y){var s="";s+=getUShortAttr("y",y);this.message+="<text"+s+"/>";return this};ePOSBuilder.prototype.addFeedUnit=function(unit){var s="";s+=getUByteAttr("unit",unit);this.message+="<feed"+s+"/>";return this};ePOSBuilder.prototype.addFeedLine=function(line){var s="";s+=getUByteAttr("line",line);this.message+="<feed"+s+"/>";return this};ePOSBuilder.prototype.addFeed=function(){this.message+="<feed/>";return this};ePOSBuilder.prototype.addFeedPosition=function(pos){var s="";s+=getEnumAttr("pos",pos,regexFeed);this.message+="<feed"+s+"/>";return this};ePOSBuilder.prototype.addImage=function(context,x,y,width,height,color,mode){var s="",ht=this.halftone,br=this.brightness,imgdata,raster;getUShortAttr("x",x);getUShortAttr("y",y);s+=getUShortAttr("width",width);s+=getUShortAttr("height",height);if(color!==undefined){s+=getEnumAttr("color",color,regexColor)}if(mode!==undefined){s+=getEnumAttr("mode",mode,regexMode)}if(isNaN(ht)||ht<0||ht>2){throw new Error('Property "halftone" is invalid')}if(isNaN(br)||br<0.1||br>10){throw new Error('Property "brightness" is invalid')}imgdata=context.getImageData(x,y,width,height);raster=(mode==this.MODE_GRAY16)?toGrayImage(imgdata,br):toMonoImage(imgdata,ht,br);this.message+="<image"+s+">"+toBase64Binary(raster)+"</image>";return this};ePOSBuilder.prototype.addLogo=function(key1,key2){var s="";s+=getUByteAttr("key1",key1);s+=getUByteAttr("key2",key2);this.message+="<logo"+s+"/>";return this};ePOSBuilder.prototype.addBarcode=function(data,type,hri,font,width,height){var s="";s+=getEnumAttr("type",type,regexBarcode);if(hri!==undefined){s+=getEnumAttr("hri",hri,regexHri)}if(font!==undefined){s+=getEnumAttr("font",font,regexFont)}if(width!==undefined){s+=getUByteAttr("width",width)}if(height!==undefined){s+=getUByteAttr("height",height)}this.message+="<barcode"+s+">"+escapeControl(escapeMarkup(data))+"</barcode>";return this};ePOSBuilder.prototype.addSymbol=function(data,type,level,width,height,size){var s="";s+=getEnumAttr("type",type,regexSymbol);if(level!==undefined){s+=getEnumIntAttr("level",level,regexLevel,0,255)}if(width!==undefined){s+=getUByteAttr("width",width)}if(height!==undefined){s+=getUByteAttr("height",height)}if(size!==undefined){s+=getUShortAttr("size",size)}this.message+="<symbol"+s+">"+escapeControl(escapeMarkup(data))+"</symbol>";return this};ePOSBuilder.prototype.addHLine=function(x1,x2,style){var s="";s+=getUShortAttr("x1",x1);s+=getUShortAttr("x2",x2);if(style!==undefined){s+=getEnumAttr("style",style,regexLine)}this.message+="<hline"+s+"/>";return this};ePOSBuilder.prototype.addVLineBegin=function(x,style){var s="";s+=getUShortAttr("x",x);if(style!==undefined){s+=getEnumAttr("style",style,regexLine)}this.message+="<vline-begin"+s+"/>";return this};ePOSBuilder.prototype.addVLineEnd=function(x,style){var s="";s+=getUShortAttr("x",x);if(style!==undefined){s+=getEnumAttr("style",style,regexLine)}this.message+="<vline-end"+s+"/>";return this};ePOSBuilder.prototype.addPageBegin=function(){this.message+="<page>";return this};ePOSBuilder.prototype.addPageEnd=function(){this.message+="</page>";return this};ePOSBuilder.prototype.addPageArea=function(x,y,width,height){var s="";s+=getUShortAttr("x",x);s+=getUShortAttr("y",y);s+=getUShortAttr("width",width);s+=getUShortAttr("height",height);this.message+="<area"+s+"/>";return this};ePOSBuilder.prototype.addPageDirection=function(dir){var s="";s+=getEnumAttr("dir",dir,regexDirection);this.message+="<direction"+s+"/>";return this};ePOSBuilder.prototype.addPagePosition=function(x,y){var s="";s+=getUShortAttr("x",x);s+=getUShortAttr("y",y);this.message+="<position"+s+"/>";return this};ePOSBuilder.prototype.addPageLine=function(x1,y1,x2,y2,style){var s="";s+=getUShortAttr("x1",x1);s+=getUShortAttr("y1",y1);s+=getUShortAttr("x2",x2);s+=getUShortAttr("y2",y2);if(style!==undefined){s+=getEnumAttr("style",style,regexLine)}this.message+="<line"+s+"/>";return this};ePOSBuilder.prototype.addPageRectangle=function(x1,y1,x2,y2,style){var s="";s+=getUShortAttr("x1",x1);s+=getUShortAttr("y1",y1);s+=getUShortAttr("x2",x2);s+=getUShortAttr("y2",y2);if(style!==undefined){s+=getEnumAttr("style",style,regexLine)}this.message+="<rectangle"+s+"/>";return this};ePOSBuilder.prototype.addCut=function(type){var s="";if(type!==undefined){s+=getEnumAttr("type",type,regexCut)}this.message+="<cut"+s+"/>";return this};ePOSBuilder.prototype.addPulse=function(drawer,time){var s="";if(drawer!==undefined){s+=getEnumAttr("drawer",drawer,regexDrawer)}if(time!==undefined){s+=getEnumAttr("time",time,regexPulse)}this.message+="<pulse"+s+"/>";return this};ePOSBuilder.prototype.addSound=function(pattern,repeat,cycle){var s="";if(pattern!==undefined){s+=getEnumAttr("pattern",pattern,regexPattern)}if(repeat!==undefined){s+=getUByteAttr("repeat",repeat)}if(cycle!==undefined){s+=getUShortAttr("cycle",cycle)}this.message+="<sound"+s+"/>";return this};ePOSBuilder.prototype.addLayout=function(type,width,height,margin_top,margin_bottom,offset_cut,offset_label){var s="";s+=getEnumAttr("type",type,regexLayout);if(width!==undefined){s+=getUShortAttr("width",width)}if(height!==undefined){s+=getUShortAttr("height",height)}if(margin_top!==undefined){s+=getShortAttr("margin-top",margin_top)}if(margin_bottom!==undefined){s+=getShortAttr("margin-bottom",margin_bottom)}if(offset_cut!==undefined){s+=getShortAttr("offset-cut",offset_cut)}if(offset_label!==undefined){s+=getShortAttr("offset-label",offset_label)}this.message+="<layout"+s+"/>";return this};ePOSBuilder.prototype.addRecovery=function(){this.message+="<recovery/>";return this};ePOSBuilder.prototype.addReset=function(){this.message+="<reset/>";return this};ePOSBuilder.prototype.addCommand=function(data){this.message+="<command>"+toHexBinary(data)+"</command>";return this};ePOSBuilder.prototype.toString=function(){var s="";if(this.force){s+=getBoolAttr("force",true)}return'<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print"'+s+">"+this.message+"</epos-print>"};function toHexBinary(s){var l=s.length,r=new Array(l),i;for(i=0;i<l;i++){r[i]=("0"+s.charCodeAt(i).toString(16)).slice(-2)}return r.join("")}function toBase64Binary(s){var l=s.length,r=new Array((l+2)/3<<2),t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=(3-l%3)%3,j=0,i=0,n;s+="\x00\x00";while(i<l){n=s.charCodeAt(i++)<<16|s.charCodeAt(i++)<<8|s.charCodeAt(i++);r[j++]=t.charAt(n>>18&63);r[j++]=t.charAt(n>>12&63);r[j++]=t.charAt(n>>6&63);r[j++]=t.charAt(n&63)}while(p--){r[--j]="="}return r.join("")}function toMonoImage(imgdata,s,g){var x=String.fromCharCode,m8=[[2,130,34,162,10,138,42,170],[194,66,226,98,202,74,234,106],[50,178,18,146,58,186,26,154],[242,114,210,82,250,122,218,90],[14,142,46,174,6,134,38,166],[206,78,238,110,198,70,230,102],[62,190,30,158,54,182,22,150],[254,126,222,94,246,118,214,86]],d=imgdata.data,w=imgdata.width,h=imgdata.height,r=new Array((w+7>>3)*h),n=0,p=0,q=0,t=128,e=new Array(),e1,e2,b,v,f,i,j;if(s==1){i=w;while(i--){e.push(0)}}for(j=0;j<h;j++){e1=0;e2=0;i=0;while(i<w){b=i&7;if(s==0){t=m8[j&7][b]}v=Math.pow(((d[p++]*0.29891+d[p++]*0.58661+d[p++]*0.11448)*d[p]/255+255-d[p++])/255,1/g)*255|0;if(s==1){v+=e[i]+e1>>4;f=v-(v<t?0:255);if(i>0){e[i-1]+=f}e[i]=f*7+e2;e1=f*5;e2=f*3}if(v<t){n|=128>>b}i++;if(b==7||i==w){r[q++]=x(n==16?32:n);n=0}}}return r.join("")}function toGrayImage(imgdata,g){var x=String.fromCharCode,m4=[[0,9,2,11],[13,4,15,6],[3,12,1,10],[16,7,14,5]],thermal=[0,7,13,19,23,27,31,35,40,44,49,52,54,55,57,59,61,62,64,66,67,69,70,70,71,72,73,74,75,76,77,78,79,80,81,82,83,83,84,85,86,86,87,88,88,89,90,90,91,91,92,93,93,94,94,95,96,96,97,98,98,99,99,100,101,101,102,102,103,103,104,104,105,105,106,106,107,107,108,108,109,109,110,110,111,111,112,112,112,113,113,114,114,115,115,116,116,117,117,118,118,119,119,120,120,120,121,121,122,122,123,123,123,124,124,125,125,125,126,126,127,127,127,128,128,129,129,130,130,130,131,131,132,132,132,133,133,134,134,135,135,135,136,136,137,137,137,138,138,139,139,139,140,140,141,141,141,142,142,143,143,143,144,144,145,145,146,146,146,147,147,148,148,148,149,149,150,150,150,151,151,152,152,152,153,153,154,154,155,155,155,156,156,157,157,158,158,159,159,160,160,161,161,161,162,162,163,163,164,164,165,165,166,166,166,167,167,168,168,169,169,170,170,171,171,172,173,173,174,175,175,176,177,178,178,179,180,180,181,182,182,183,184,184,185,186,186,187,189,191,193,195,198,200,202,255],d=imgdata.data,w=imgdata.width,h=imgdata.height,r=new Array((w+1>>1)*h),n=0,p=0,q=0,b,v,v1,i,j;for(j=0;j<h;j++){i=0;while(i<w){b=i&1;v=thermal[Math.pow(((d[p++]*0.29891+d[p++]*0.58661+d[p++]*0.11448)*d[p]/255+255-d[p++])/255,1/g)*255|0];v1=v/17|0;if(m4[j&3][i&3]<v%17){v1++}n|=v1<<((1-b)<<2);i++;if(b==1||i==w){r[q++]=x(n);n=0}}}return r.join("")}function escapeMarkup(s){var markup=/[<>&'"\t\n\r]/g;if(markup.test(s)){s=s.replace(markup,function(c){var r="";switch(c){case"<":r="<";break;case">":r=">";break;case"&":r="&";break;case"'":r="'";break;case'"':r=""";break;case"\t":r="	";break;case"\n":r=" ";break;case"\r":r=" ";break;default:break}return r})}return s}function escapeControl(s){var control=/[\\\x00-\x1f\x7f-\xff]/g;if(control.test(s)){s=s.replace(control,function(c){return(c=="\\")?"\\\\":"\\x"+("0"+c.charCodeAt(0).toString(16)).slice(-2)})}return s}var regexFont=/^(font_[a-e]|special_[ab])$/,regexAlign=/^(left|center|right)$/,regexColor=/^(none|color_[1-4])$/,regexFeed=/^(peeling|cutting|current_tof|next_tof)$/,regexMode=/^(mono|gray16)$/,regexBarcode=/^(upc_[ae]|[ej]an13|[ej]an8|code(39|93|128)|itf|codabar|gs1_128|gs1_databar_(omnidirectional|truncated|limited|expanded))$/,regexHri=/^(none|above|below|both)$/,regexSymbol=/^(pdf417_(standard|truncated)|qrcode_(model_[12]|micro)|maxicode_mode_[2-6]|gs1_databar_(stacked(_omnidirectional)?|expanded_stacked)|azteccode_(fullrange|compact)|datamatrix_(square|rectangle_(8|12|16)))$/,regexLevel=/^(level_[0-8lmqh]|default)$/,regexLine=/^(thin|medium|thick)(_double)?$/,regexDirection=/^(left_to_right|bottom_to_top|right_to_left|top_to_bottom)$/,regexCut=/^(no_feed|feed|reserve)$/,regexDrawer=/^drawer_[12]$/,regexPulse=/^pulse_[1-5]00$/,regexPattern=/^(none|pattern_(10|[1-9a-e])|error|paper_end)$/,regexLayout=/^(receipt|label)(_bm)?$/;function getEnumAttr(name,value,regex){if(!regex.test(value)){throw new Error('Parameter "'+name+'" is invalid')}return" "+name+'="'+value+'"'}function getBoolAttr(name,value){return" "+name+'="'+!!value+'"'}function getIntAttr(name,value,min,max){if(isNaN(value)||value<min||value>max){throw new Error('Parameter "'+name+'" is invalid')}return" "+name+'="'+value+'"'}function getUByteAttr(name,value){return getIntAttr(name,value,0,255)}function getUShortAttr(name,value){return getIntAttr(name,value,0,65535)}function getShortAttr(name,value){return getIntAttr(name,value,-32768,32767)}function getEnumIntAttr(name,value,regex,min,max){if(!regex.test(value)){if(isNaN(value)||value<min||value>max){throw new Error('Parameter "'+name+'" is invalid')}}return" "+name+'="'+value+'"'}function ePOSPrint(address){this.address=address;this.enabled=false;this.interval=3000;this.timeout=300000;this.status=0;this.battery=0;this.onreceive=null;this.onerror=null;this.onstatuschange=null;this.ononline=null;this.onoffline=null;this.onpoweroff=null;this.oncoverok=null;this.oncoveropen=null;this.onpaperok=null;this.onpaperend=null;this.onpapernearend=null;this.ondrawerclosed=null;this.ondraweropen=null;this.onbatterylow=null;this.onbatteryok=null;this.onbatterystatuschange=null;this.ASB_NO_RESPONSE=1;this.ASB_PRINT_SUCCESS=2;this.ASB_DRAWER_KICK=4;this.ASB_BATTERY_OFFLINE=4;this.ASB_OFF_LINE=8;this.ASB_COVER_OPEN=32;this.ASB_PAPER_FEED=64;this.ASB_WAIT_ON_LINE=256;this.ASB_PANEL_SWITCH=512;this.ASB_MECHANICAL_ERR=1024;this.ASB_AUTOCUTTER_ERR=2048;this.ASB_UNRECOVER_ERR=8192;this.ASB_AUTORECOVER_ERR=16384;this.ASB_RECEIPT_NEAR_END=131072;this.ASB_RECEIPT_END=524288;this.ASB_BUZZER=16777216;this.ASB_WAIT_REMOVE_LABEL=16777216;this.ASB_NO_LABEL=67108864;this.ASB_SPOOLER_IS_STOPPED=2147483648}ePOSPrint.prototype=new ePOSBuilder();ePOSPrint.prototype.constructor=ePOSPrint;ePOSPrint.prototype.open=function(){if(!this.enabled){this.enabled=true;this.status=0;this.battery=0;this.send()}};ePOSPrint.prototype.close=function(){this.enabled=false;if(this.intervalid){clearTimeout(this.intervalid);delete this.intervalid}if(this.intervalxhr){this.intervalxhr.abort();delete this.intervalxhr}};ePOSPrint.prototype.getPrintJobStatus=function(printjobid){this.send(printjobid)};ePOSPrint.prototype.send=function(request,printjobid){var args=arguments.length,epos=this,address=epos.address,soap,xhr,tid,res,success,code,status,battery;if(!/^<epos/.test(request)){if(args<2){printjobid=request;request=new ePOSBuilder().toString()}else{address=request;request=printjobid;printjobid=arguments[2]}}soap='<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">';if(printjobid){soap+='<s:Header><parameter xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print"><printjobid>'+printjobid+"</printjobid></parameter></s:Header>"}soap+="<s:Body>"+request+"</s:Body></s:Envelope>";if(window.XMLHttpRequest){xhr=new XMLHttpRequest();if(!("withCredentials" in xhr)&&window.XDomainRequest){xhr=new XDomainRequest();xhr.open("POST",address,true);xhr.onload=function(){res=xhr.responseText;if(/response/.test(res)){success=/success\s*=\s*"\s*(1|true)\s*"/.test(res);code=res.match(/code\s*=\s*"\s*(\S*)\s*"/)?RegExp.$1:"";status=res.match(/status\s*=\s*"\s*(\d+)\s*"/)?parseInt(RegExp.$1):0;battery=res.match(/battery\s*=\s*"\s*(\d+)\s*"/)?parseInt(RegExp.$1):0;printjobid=res.match(/<printjobid>\s*(\S*)\s*<\/printjobid>/)?RegExp.$1:"";if(args>0){fireReceiveEvent(epos,success,code,status,battery,printjobid)}else{fireStatusEvent(epos,status,battery)}}else{if(args>0){fireErrorEvent(epos,0,xhr.responseText)}else{fireStatusEvent(epos,epos.ASB_NO_RESPONSE,0)}}if(args<1){updateStatus(epos)}};xhr.onerror=function(){if(args>0){fireErrorEvent(epos,0,xhr.responseText)}else{fireStatusEvent(epos,epos.ASB_NO_RESPONSE,0);updateStatus(epos)}};xhr.onprogress=function(){};xhr.ontimeout=xhr.onerror;xhr.timeout=epos.timeout;xhr.send(soap)}else{xhr.open("POST",address,true);xhr.setRequestHeader("Content-Type","text/xml; charset=utf-8");xhr.setRequestHeader("If-Modified-Since","Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("SOAPAction",'""');xhr.onreadystatechange=function(){if(xhr.readyState==4){clearTimeout(tid);if(xhr.status==200&&xhr.responseXML){res=xhr.responseXML.getElementsByTagName("response");if(res.length>0){success=/^(1|true)$/.test(res[0].getAttribute("success"));code=res[0].hasAttribute("code")?res[0].getAttribute("code"):"";status=res[0].hasAttribute("status")?parseInt(res[0].getAttribute("status")):0;battery=res[0].hasAttribute("battery")?parseInt(res[0].getAttribute("battery")):0;res=xhr.responseXML.getElementsByTagName("printjobid");printjobid=res.length>0?res[0].textContent:"";if(args>0){fireReceiveEvent(epos,success,code,status,battery,printjobid)}else{fireStatusEvent(epos,status,battery)}}else{if(args>0){fireErrorEvent(epos,xhr.status,xhr.responseText)}else{fireStatusEvent(epos,epos.ASB_NO_RESPONSE,0)}}}else{if(args>0){fireErrorEvent(epos,xhr.status,xhr.responseText)}else{fireStatusEvent(epos,epos.ASB_NO_RESPONSE,0)}}if(args<1){updateStatus(epos)}}};tid=setTimeout(function(){xhr.abort()},epos.timeout);xhr.send(soap)}if(args<1){epos.intervalxhr=xhr}}else{throw new Error("XMLHttpRequest is not supported")}};function fireReceiveEvent(epos,success,code,status,battery,printjobid){if(epos.onreceive){epos.onreceive({success:success,code:code,status:status,battery:battery,printjobid:printjobid})}}function fireStatusEvent(epos,status,battery){var diff,difb;if(status==0||status==epos.ASB_NO_RESPONSE){status=epos.status|epos.ASB_NO_RESPONSE}diff=epos.status==0?~0:epos.status^status;difb=epos.status==0?~0:epos.battery^battery;epos.status=status;epos.battery=battery;if(diff&&epos.onstatuschange){epos.onstatuschange(status)}if(difb&&epos.onbatterystatuschange){epos.onbatterystatuschange(battery)}if(diff&(epos.ASB_NO_RESPONSE|epos.ASB_OFF_LINE)){if(status&epos.ASB_NO_RESPONSE){if(epos.onpoweroff){epos.onpoweroff()}}else{if(status&epos.ASB_OFF_LINE){if(epos.onoffline){epos.onoffline()}}else{if(epos.ononline){epos.ononline()}}}}if(diff&epos.ASB_COVER_OPEN){if(status&epos.ASB_NO_RESPONSE){}else{if(status&epos.ASB_COVER_OPEN){if(epos.oncoveropen){epos.oncoveropen()}}else{if(epos.oncoverok){epos.oncoverok()}}}}if(diff&(epos.ASB_RECEIPT_END|epos.ASB_RECEIPT_NEAR_END)){if(status&epos.ASB_NO_RESPONSE){}else{if(status&epos.ASB_RECEIPT_END){if(epos.onpaperend){epos.onpaperend()}}else{if(status&epos.ASB_RECEIPT_NEAR_END){if(epos.onpapernearend){epos.onpapernearend()}}else{if(epos.onpaperok){epos.onpaperok()}}}}}if(diff&epos.ASB_DRAWER_KICK){if(status&epos.ASB_NO_RESPONSE){}else{if(status&epos.ASB_DRAWER_KICK){if(epos.ondrawerclosed){epos.ondrawerclosed()}if(epos.onbatterylow){epos.onbatterylow()}}else{if(epos.ondraweropen){epos.ondraweropen()}if(epos.onbatteryok){epos.onbatteryok()}}}}}function fireErrorEvent(epos,status,responseText){if(epos.onerror){epos.onerror({status:status,responseText:responseText})}}function updateStatus(epos){var delay=epos.interval;if(epos.enabled){if(isNaN(delay)||delay<1000){delay=3000}epos.intervalid=setTimeout(function(){delete epos.intervalid;if(epos.enabled){epos.send()}},delay)}delete epos.intervalxhr}function CanvasPrint(address){this.address=address;this.mode="mono";this.halftone=0;this.brightness=1;this.align="left";this.color="color_1";this.paper="receipt";this.feed="current_tof";this.cut=false;this.layout=null;this.ALIGN_LEFT="left";this.ALIGN_CENTER="center";this.ALIGN_RIGHT="right";this.COLOR_NONE="none";this.COLOR_1="color_1";this.COLOR_2="color_2";this.COLOR_3="color_3";this.COLOR_4="color_4";this.FEED_PEELING="peeling";this.FEED_CUTTING="cutting";this.FEED_CURRENT_TOF="current_tof";this.FEED_NEXT_TOF="next_tof";this.HALFTONE_DITHER=0;this.HALFTONE_ERROR_DIFFUSION=1;this.HALFTONE_THRESHOLD=2;this.MODE_MONO="mono";this.MODE_GRAY16="gray16";this.PAPER_RECEIPT="receipt";this.PAPER_RECEIPT_BM="receipt_bm";this.PAPER_LABEL="label";this.PAPER_LABEL_BM="label_bm"}CanvasPrint.prototype=new ePOSPrint();CanvasPrint.prototype.constructor=CanvasPrint;CanvasPrint.prototype.print=function(canvas,cut,mode,printjobid){var args=arguments.length,address=this.address,layout=this.layout,paper=this.paper,builder=new ePOSBuilder();if(!canvas.getContext){throw new Error("Canvas is not supported")}if(layout){builder.addLayout(paper,layout.width,layout.height,layout.margin_top,layout.margin_bottom,layout.offset_cut,layout.offset_label)}if(paper!=this.PAPER_RECEIPT){builder.addFeedPosition(builder.FEED_CURRENT_TOF);if(layout){builder.addFeedPosition(builder.FEED_NEXT_TOF)}}builder.addTextAlign(this.align);builder.halftone=this.halftone;builder.brightness=this.brightness;builder.addImage(canvas.getContext("2d"),0,0,canvas.width,canvas.height,this.color,mode);if(paper!=this.PAPER_RECEIPT){builder.addFeedPosition(this.feed);if(cut){builder.addCut(builder.CUT_NO_FEED)}}else{if(cut){builder.addCut(builder.CUT_FEED)}}this.send(address,builder.toString(),printjobid)};CanvasPrint.prototype.recover=function(){var builder=new ePOSBuilder();builder.force=true;builder.addRecovery();this.send(this.address,builder.toString())};CanvasPrint.prototype.reset=function(){var builder=new ePOSBuilder();builder.addReset();this.send(this.address,builder.toString())};function Printer(ePosDevObj,deviceID){this.ePosDevObj=ePosDevObj;this.deviceID=deviceID;this.timeout=10000;this.ipAddress="";var result=this.init();return(result)?this:null}Printer.prototype=new CanvasPrint();Printer.prototype.init=function(){var result=false;try{result=true}catch(e){}return result};Printer.prototype.setIpAddress=function(ipAddress){this.ipAddress=ipAddress};Printer.prototype.toString=function(){var str=ePOSBuilder.prototype.toString.apply(this);return str};Printer.prototype.addFeedUnit=function(unit){try{ePOSBuilder.prototype.addFeedUnit.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addFeedLine=function(line){try{ePOSBuilder.prototype.addFeedLine.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addFeed=function(unit){try{ePOSBuilder.prototype.addFeed.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addFeedPosition=function(line){try{ePOSBuilder.prototype.addFeedPosition.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addText=function(text){try{ePOSBuilder.prototype.addText.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addTextLang=function(lang){try{ePOSBuilder.prototype.addTextLang.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addTextAlign=function(align){try{ePOSBuilder.prototype.addTextAlign.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addTextRotate=function(rotate){try{ePOSBuilder.prototype.addTextRotate.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addTextLineSpace=function(linespc){try{ePOSBuilder.prototype.addTextLineSpace.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addTextFont=function(font){try{ePOSBuilder.prototype.addTextFont.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addTextSmooth=function(smooth){try{ePOSBuilder.prototype.addTextSmooth.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addTextDouble=function(dw,dh){try{ePOSBuilder.prototype.addTextDouble.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addTextSize=function(width,height){try{ePOSBuilder.prototype.addTextSize.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addTextStyle=function(reverse,ul,em,color){try{ePOSBuilder.prototype.addTextStyle.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addTextPosition=function(x){try{ePOSBuilder.prototype.addTextPosition.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addTextVPosition=function(y){try{ePOSBuilder.prototype.addTextVPosition.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addImage=function(context,x,y,width,height,color,mode){try{ePOSBuilder.prototype.addImage.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addLogo=function(key1,key2){try{ePOSBuilder.prototype.addLogo.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addBarcode=function(barCodeData,type,hri,font,width,height){try{ePOSBuilder.prototype.addBarcode.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addSymbol=function(symbolData,type,level,width,height,size){try{ePOSBuilder.prototype.addSymbol.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addCommand=function(data){try{ePOSBuilder.prototype.addCommand.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addHLine=function(x1,x2,style){try{ePOSBuilder.prototype.addHLine.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addVLineBegin=function(x,style){try{ePOSBuilder.prototype.addVLineBegin.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addVLineEnd=function(x,style){try{ePOSBuilder.prototype.addVLineEnd.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addPageBegin=function(){try{ePOSBuilder.prototype.addPageBegin.apply(this)}catch(e){throw e}return this};Printer.prototype.addPageEnd=function(){try{ePOSBuilder.prototype.addPageEnd.apply(this)}catch(e){throw e}return this};Printer.prototype.addPageArea=function(x,y,width,height){try{ePOSBuilder.prototype.addPageArea.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addPageDirection=function(dir){try{ePOSBuilder.prototype.addPageDirection.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addPagePosition=function(x,y){try{ePOSBuilder.prototype.addPagePosition.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addPageLine=function(x1,y1,x2,y2,style){try{ePOSBuilder.prototype.addPageLine.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addPageRectangle=function(x1,y1,x2,y2,style){try{ePOSBuilder.prototype.addPageRectangle.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addCut=function(type){try{ePOSBuilder.prototype.addCut.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addPulse=function(drawer,time){try{ePOSBuilder.prototype.addPulse.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addSound=function(pattern,repeat,cycle){try{ePOSBuilder.prototype.addSound.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.addLayout=function(type,width,height,margin_top,margin_bottom,offset_cut,offset_label){try{ePOSBuilder.prototype.addLayout.apply(this,arguments)}catch(e){throw e}return this};Printer.prototype.setXmlString=function(xml){this.message=xml};Printer.prototype.getXmlString=function(){return this.message};Printer.prototype.getPrintJobStatus=function(printjobid){this.setXmlString("");this.send(printjobid)};Printer.prototype.send=function(printjobid){var sq=-1;try{var data={type:"print",timeout:this.timeout,printdata:this.toString()};switch(arguments.length){case 0:data.printdata=this.toString();break;case 1:data.printdata=this.toString();data.printjobid=printjobid;break;case 2:case 3:data.printdata=arguments[1];data.printjobid=arguments[2]}sq=this.ePosDevObj.sendDeviceData(this.deviceID,data);this.force=false;this.setXmlString("")}catch(e){sq=-1}return sq};Printer.prototype.client_onxmlresult=function(res,sq){if(res){var xml=res.resultdata;var success=/success\s*=\s*"\s*(1|true)\s*"/.test(xml);xml.match(/code\s*=\s*"\s*(\S*)\s*"/);var code=RegExp.$1;xml.match(/status\s*=\s*"\s*(\d+)\s*"/);var status=parseInt(RegExp.$1);xml.match(/battery\s*=\s*"\s*(\d+)\s*"/);var battery=parseInt(RegExp.$1);this.fireReceiveEvent(success,code,status,battery,res.printjobid,sq)}else{this.fireErrorEvent(0,this.ASB_NO_RESPONSE,sq)}};Printer.prototype.startMonitor=function(){var result=false;var protocol=this.ePosDevObj.connectProtocol;var address=protocol+"://"+this.ipAddress+"/cgi-bin/epos/service.cgi?devid="+this.deviceID+"&timeout=10000";try{if(!this.enabled){this.address=address;this.enabled=true;this.status=this.ASB_DRAWER_KICK;this.sendStartMonitorCommand()}result=true}catch(e){throw e}return result};Printer.prototype.sendStartMonitorCommand=function(){var self=this;var address=this.address;var request=new ePOSBuilder().toString();var soap='<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body>'+request+"</s:Body></s:Envelope>";var epos=this;if(window.XDomainRequest){var xdr=new XDomainRequest();xdr.open("POST",address,true);xdr.onload=function(){var res=xdr.responseText;if(/response/.test(res)){var success=/success\s*=\s*"\s*(1|true)\s*"/.test(res);res.match(/code\s*=\s*"\s*(\S*)\s*"/);var code=RegExp.$1;res.match(/status\s*=\s*"\s*(\d+)\s*"/);var status=parseInt(RegExp.$1);res.match(/battery\s*=\s*"\s*(\d+)\s*"/);var battery=parseInt(RegExp.$1);self.fireStatusEvent(epos,status,battery)}else{self.fireStatusEvent(epos,epos.ASB_NO_RESPONSE,0)}self.updateStatus(epos)};xdr.onerror=function(){self.fireStatusEvent(epos,epos.ASB_NO_RESPONSE);self.updateStatus(epos)};xdr.onprogress=function(){};xdr.ontimeout=xdr.onerror;xdr.send(soap)}else{if(window.XMLHttpRequest){var xhr=new XMLHttpRequest();xhr.open("POST",address,true);xhr.setRequestHeader("Content-Type","text/xml; charset=utf-8");xhr.setRequestHeader("If-Modified-Since","Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("SOAPAction",'""');xhr.onreadystatechange=function(){if(xhr.readyState==4){if(xhr.status==200&&xhr.responseXML){var res=xhr.responseXML.getElementsByTagName("response");if(res.length>0){var success=/^(1|true)$/.test(res[0].getAttribute("success"));var code=res[0].getAttribute("code");var status=parseInt(res[0].getAttribute("status"));var battery=res[0].hasAttribute("battery")?parseInt(res[0].getAttribute("battery")):0;self.fireStatusEvent(epos,status,battery)}else{self.fireStatusEvent(epos,epos.ASB_NO_RESPONSE,0)}}else{self.fireStatusEvent(epos,epos.ASB_NO_RESPONSE,0)}self.updateStatus(epos)}};xhr.send(soap)}else{throw new Error("XMLHttpRequest is not supported")}}};Printer.prototype.stopMonitor=function(){var result=false;try{this.enabled=false;if(this.timeoutid){clearTimeout(this.timeoutid);delete this.timeoutid}result=true}catch(e){throw e}return result};Printer.prototype.fireReceiveEvent=function(success,code,status,battery,printjobid,sq){delete this.isPrint;if(this.onreceive){this.onreceive({success:success,code:code,status:status,battery:battery,printjobid:printjobid},sq)}};Printer.prototype.fireErrorEvent=function(status,responseText,sq){if(this.onerror){this.onerror({status:status,responseText:responseText},sq)}};Printer.prototype.fireStatusEvent=function(epos,status,battery){if(status==0||status==this.ASB_NO_RESPONSE){status=this.status|this.ASB_NO_RESPONSE}var diff=this.status==this.ASB_DRAWER_KICK?~0:this.status^status;var difb=this.status==0?~0:this.battery^battery;this.status=status;this.battery=battery;if(diff&&this.onstatuschange){this.onstatuschange(status)}if(difb&&this.onbatterystatuschange){this.onbatterystatuschange(battery)}if(diff&(this.ASB_NO_RESPONSE|this.ASB_OFF_LINE)){if(status&this.ASB_NO_RESPONSE){if(this.onpoweroff){this.onpoweroff()}}else{if(status&this.ASB_OFF_LINE){if(this.onoffline){this.onoffline()}}else{if(this.ononline){this.ononline()}}}}if(diff&this.ASB_COVER_OPEN){if(status&this.ASB_NO_RESPONSE){}else{if(status&this.ASB_COVER_OPEN){if(this.oncoveropen){this.oncoveropen()}}else{if(this.oncoverok){this.oncoverok()}}}}if(diff&(this.ASB_RECEIPT_END|this.ASB_RECEIPT_NEAR_END)){if(status&this.ASB_NO_RESPONSE){}else{if(status&this.ASB_RECEIPT_END){if(this.onpaperend){this.onpaperend()}}else{if(status&this.ASB_RECEIPT_NEAR_END){if(this.onpapernearend){this.onpapernearend()}}else{if(this.onpaperok){this.onpaperok()}}}}}if(diff&this.ASB_DRAWER_KICK){if(status&this.ASB_NO_RESPONSE){}else{if(status&this.ASB_DRAWER_KICK){if(this.ondrawerclosed){this.ondrawerclosed()}if(this.onbatterylow){this.onbatterylow()}}else{if(this.ondraweropen){this.ondraweropen()}if(this.onbatteryok){this.onbatteryok()}}}}};Printer.prototype.updateStatus=function(){var self=this;if(this.enabled){var delay=this.interval;if(isNaN(delay)||delay<1000){delay=3000}this.timeoutid=setTimeout(function(){delete self.timeoutid;if(self.enabled){self.sendStartMonitorCommand()}},delay)}};Printer.prototype.print=function(canvas,cut,mode,printjobid){try{CanvasPrint.prototype.print.apply(this,arguments)}catch(e){throw e}};Printer.prototype.reset=function(){try{var builder=new ePOSBuilder();builder.addReset();builder.force=this.force;this.send(null,builder.toString())}catch(e){throw e}};Printer.prototype.recover=function(){try{CanvasPrint.prototype.recover.apply(this,arguments)}catch(e){throw e}};function Display(ePosDevObj,deviceID){this.message="";this.ePosDevObj=ePosDevObj;this.deviceID=deviceID;this.timeout=10000;this.onreceive=null;this.onerror=null;this.ASB_NO_RESPONSE=1;this.ASB_DISPLAY_SUCCESS=2;this.SCROLL_OVERWRITE="overwrite";this.SCROLL_VERTICAL="v_scroll";this.SCROLL_HORIZONTAL="h_scroll";this.MOVE_TOP_LEFT="top_left";this.MOVE_TOP_RIGHT="top_right";this.MOVE_BOTTOM_LEFT="bottom_left";this.MOVE_BOTTOM_RIGHT="bottom_right";this.CURSOR_NONE="none";this.CURSOR_UNDERLINE="underline";this.BRIGHTNESS_20=20;this.BRIGHTNESS_40=40;this.BRIGHTNESS_60=60;this.BRIGHTNESS_100=100;this.MARQUEE_WALK="walk";this.MARQUEE_PLACE="place";var result=this.init();return(result)?this:null}Display.prototype.init=function(){var result=false;try{result=true}catch(e){}return result};Display.prototype.reset=function(){try{this.message+="<reset />"}catch(e){throw e}return this};Display.prototype.createWindow=function(number,x,y,width,hight,scrollMode){try{var s="";s+=getIntAttr("number",number,1,4);s+=getIntAttr("x",x,1,20);s+=getIntAttr("y",y,1,2);s+=getIntAttr("width",width,1,(21-x));s+=getIntAttr("height",hight,1,(3-y));s+=getEnumAttr("scrollmode",scrollMode,regexScrollMode);this.message+="<window"+s+"/>"}catch(e){throw e}return this};Display.prototype.destroyWindow=function(number){try{var s="";s+=getIntAttr("number",number,1,4);this.message+="<window"+s+' destroy="true"/>'}catch(e){throw e}return this};Display.prototype.setCurrentWindow=function(number){try{var s="";s+=getIntAttr("number",number,1,4);this.message+="<window"+s+"/>"}catch(e){throw e}return this};Display.prototype.setCursorPosition=function(){try{var s="";s+=getIntAttr("x",arguments[0],1,20);s+=getIntAttr("y",arguments[1],1,2);this.message+="<cursor"+s+"/>"}catch(e){throw e}return this};Display.prototype.moveCursorPosition=function(){try{var s="";s+=getEnumAttr("moveto",arguments[0],regexMoveto);this.message+="<cursor"+s+"/>"}catch(e){throw e}return this};Display.prototype.setCursorType=function(underline){try{var s="";s+=getEnumAttr("type",underline,regexUnderline);this.message+="<cursor"+s+"/>"}catch(e){throw e}return this};Display.prototype.addText=function(){try{var s="";switch(arguments.length){case 1:break;case 2:s+=' lang="'+arguments[1]+'"';break;case 3:s+=getIntAttr("x",arguments[1],1,20);s+=getIntAttr("y",arguments[2],1,2);break;case 4:s+=getIntAttr("x",arguments[1],1,20);s+=getIntAttr("y",arguments[2],1,2);s+=' lang="'+arguments[3]+'"';break;default:throw new Error("Parameters are invalid");break}this.message+="<text"+s+">"+escapeMarkup(arguments[0])+"</text>"}catch(e){throw e}return this};Display.prototype.addReverseText=function(){try{var s="";switch(arguments.length){case 1:s+=getBoolAttr("reverse",true);break;case 2:s+=' lang="'+arguments[1]+'"';s+=getBoolAttr("reverse",true);break;case 3:s+=getIntAttr("x",arguments[1],1,20);s+=getIntAttr("y",arguments[2],1,2);s+=getBoolAttr("reverse",true);break;case 4:s+=getIntAttr("x",arguments[1],1,20);s+=getIntAttr("y",arguments[2],1,2);s+=' lang="'+arguments[3]+'"';s+=getBoolAttr("reverse",true);break;default:throw new Error("Parameters are invalid");break}this.message+="<text"+s+">"+escapeMarkup(arguments[0])+"</text>"}catch(e){throw e}return this};Display.prototype.clearWindow=function(){try{this.message+="<clear/>"}catch(e){throw e}return this};Display.prototype.setBlink=function(interval){try{var s="";s+=getUShortAttr("interval",interval);this.message+="<blink"+s+"/>"}catch(e){throw e}return this};Display.prototype.setBrightness=function(value){try{var s="";s+=getEnumAttr("value",value,regexBrightness);this.message+="<brightness"+s+"/>"}catch(e){throw e}return this};Display.prototype.addMarquee=function(text,format,uwait,rwait,repeat,lang){try{var s="";s+=getEnumAttr("format",format,regexMarquee);s+=getIntAttr("uwait",uwait,0,2000);s+=getIntAttr("rwait",rwait,100,2000);s+=getIntAttr("repeat",repeat,0,127);if((typeof lang)!=="undefined"){s+=' lang="'+lang+'"'}this.message+="<marquee"+s+">"+escapeMarkup(text)+"</marquee>"}catch(e){throw e}return this};Display.prototype.showClock=function(){try{this.message+="<clock/>"}catch(e){throw e}return this};Display.prototype.addCommand=function(text){try{this.message+="<command>"+toHexBinary(text)+"</command>"}catch(e){throw e}return this};Display.prototype.send=function(){var sq=-1;try{var xml=this.toString();var data={type:"display",timeout:this.timeout,displaydata:xml};sq=this.ePosDevObj.sendDeviceData(this.deviceID,data);this.message=""}catch(e){sq=-1}return sq};Display.prototype.client_onxmlresult=function(res,sq){if(res){var xml=res.resultdata;var success=/success\s*=\s*"\s*(1|true)\s*"/.test(xml);xml.match(/code\s*=\s*"\s*(\S*)\s*"/);var code=RegExp.$1;xml.match(/status\s*=\s*"\s*(\d+)\s*"/);var status=parseInt(RegExp.$1);if(this.onreceive){this.onreceive({success:success,code:code,status:status},sq)}}else{if(this.onerror){this.onerror({status:0,responseText:this.ASB_NO_RESPONSE})}}};Display.prototype.toString=function(){var epos='<epos-display xmlns="http://www.epson-pos.com/schemas/2012/09/epos-display">'+this.message+"</epos-display>";return epos};Display.prototype.setXmlString=function(xml){this.message=xml};Display.prototype.getXmlString=function(){return this.message};Display.prototype.callEvent=function(eventName,data){var eventReq={type:eventName,data:data};var sq=this.ePosDevObj.sendDeviceData(this.deviceID,eventReq);return sq};var regexBrightness=/^(20|40|60|100)$/;var regexScrollMode=/^(overwrite|v_scroll|h_scroll)$/;var regexMoveto=/^(top_left|top_right|bottom_left|bottom_right)$/;var regexUnderline=/^(none|underline)$/;var regexMarquee=/^(walk|place)$/;function HybridPrinter(ePosDevObj,deviceID){this.ePosDevObj=ePosDevObj;this.deviceID=deviceID;this.ReceiptPrinter;this.SlipPrinter;this.EndorsePrinter;this.MICRReader;this.force=false;this.onstatuschange;this.ononline;this.onoffline;this.onpoweroff;this.oncoveropen;this.onpaperok;this.onpapernearend;this.onpaperend;this.ondrawerclosed;this.ondraweropen;this.ASB_NO_RESPONSE=1;this.ASB_PRINT_SUCCESS=2;this.ASB_DRAWER_KICK=4;this.ASB_OFF_LINE=8;this.ASB_COVER_OPEN=32;this.ASB_PAPER_FEED=64;this.ASB_WAIT_ON_LINE=256;this.ASB_PANEL_SWITCH=512;this.ASB_MECHANICAL_ERR=1024;this.ASB_AUTOCUTTER_ERR=2048;this.ASB_UNRECOVER_ERR=8192;this.ASB_AUTORECOVER_ERR=16384;this.ASB_RECEIPT_NEAR_END=131072;this.ASB_RECEIPT_END=524288;this.ASB_TOF_NOPAPER=2097152;this.ASB_BOF_NOPAPER=4194304;this.ASB_SLIP_NO_SELECT=16777216;this.ASB_SLIP_IMPOSSIBLE_PRINT=33554432;this.ASB_SPOOLER_IS_STOPPED=2147483648;this.SUCCESS="SUCCESS";this.CANCEL="CANCEL";this.ERROR_PARAMMETER="ERROR_PARAMMETER";this.ERROR_COMMAND="ERROR_COMMAND";this.ERROR_DEVICE_NOT_FOUND="ERROR_DEVICE_NOT_FOUND";this.ERROR_DEVICE_BUSY="ERROR_DEVICE_BUSY";this.ERROR_NOT_SUPPORTED="ERROR_NOT_SUPPORTED";this.ERROR_COVER_OPEN="ERROR_COVER_OPEN";this.ERROR_TIMEOUT="ERROR_TIMEOUT";this.ERROR_AUTOMATICAL="ERROR_AUTOMATICAL";this.ERROR_UNRECOVERABLE="ERROR_UNRECOVERABLE";this.ERROR_BADPORT="ERROR_BADPORT";this.SYSTEM_ERROR="SYSTEM_ERROR";this.init(ePosDevObj,deviceID)}HybridPrinter.prototype={init:function(ePosDevObj,deviceID){var obj=this;obj.ePosDevObj=ePosDevObj;obj.deviceID=deviceID;obj.ReceiptPrinter=new ReceiptPrinter(ePosDevObj,deviceID,this);obj.SlipPrinter=new SlipPrinter(ePosDevObj,deviceID);obj.EndorsePrinter=new EndorsePrinter(ePosDevObj,deviceID);obj.MICRReader=new MICRReader(ePosDevObj,deviceID);obj.ReceiptPrinter.onstatuschange=function(status){if(obj.onstatuschange!=null){obj.onstatuschange(status)}};obj.ReceiptPrinter.ononline=function(){if(obj.ononline!=null){obj.ononline()}};obj.ReceiptPrinter.onoffline=function(){if(obj.onoffline!=null){obj.onoffline()}};obj.ReceiptPrinter.onpoweroff=function(){if(obj.onpoweroff!=null){obj.onpoweroff()}};obj.ReceiptPrinter.oncoveropen=function(){if(obj.oncoveropen!=null){obj.oncoveropen()}};obj.ReceiptPrinter.onpaperok=function(){if(obj.onpaperok!=null){obj.onpaperok()}};obj.ReceiptPrinter.onpapernearend=function(){if(obj.onpapernearend!=null){obj.onpapernearend()}};obj.ReceiptPrinter.onpaperend=function(){if(obj.onpaperend!=null){obj.onpaperend()}};obj.ReceiptPrinter.ondrawerclosed=function(){if(obj.ondrawerclosed!=null){obj.ondrawerclosed()}};obj.ReceiptPrinter.ondraweropen=function(){if(obj.ondraweropen!=null){obj.ondraweropen()}}},setIpAddress:function(ipAddress){this.ReceiptPrinter.setIpAddress(ipAddress)},lock:function(){var sq=-1;try{var data={type:"lock"};sq=this.ePosDevObj.sendDeviceData(this.deviceID,data)}catch(e){sq=-1}return sq},unlock:function(){var sq=-1;try{var data={type:"unlock"};sq=this.ePosDevObj.sendDeviceData(this.deviceID,data)}catch(e){sq=-1}return sq},eject:function(){var sq=-1;try{var data={type:"eject"};var sq=this.ePosDevObj.sendDeviceData(this.deviceID,data)}catch(e){sq=-1}return sq},recover:function(){return this.ReceiptPrinter.recover()},reset:function(){this.ReceiptPrinter.force=this.force;var ret=this.ReceiptPrinter.reset();this.force=false;return ret},startMonitor:function(){return this.ReceiptPrinter.startMonitor()},stopMonitor:function(){return this.ReceiptPrinter.stopMonitor()},client_onreceive:function(res,sq){switch(res.eventtype){case"slipprint":case"slipcancel":this.SlipPrinter.fireOnReceive(res,sq);break;case"endorseprint":case"endorsecancel":this.EndorsePrinter.fireOnReceive(res,sq);break;case"micrread":case"micrcleaning":case"micrcancel":this.MICRReader.fireOnReceive(res,sq);break;case"print":var tmp=res;tmp.eventtype=this.ReceiptPrinter.methodName;this.fireOnReceive(tmp,sq);break;default:this.fireOnReceive(res,sq);break}},client_onxmlresult:function(res,sq){this.ReceiptPrinter.fireOnReceive(res,sq)},fireOnReceive:function(res,sq){if(this.onreceive==null){return}if(res==null){return}this.onreceive({eventtype:res.eventtype,success:res.success,code:res.code,status:res.status},sq)},callEvent:function(eventName,data){var eventReq=data;eventReq.type=eventName;var sq=this.ePosDevObj.sendDeviceData(this.deviceID,eventReq);return sq}};function ReceiptPrinter(ePosDevObj,deviceID,hPrinterObj){this.ePosDevObj=ePosDevObj;this.deviceID=deviceID;this.hPrinterObj=hPrinterObj;this.methodName="";this.SUCCESS="SUCCESS";this.CANCEL="CANCEL";this.ERROR_PARAMMETER="ERROR_PARAMMETER";this.ERROR_COMMAND="ERROR_COMMAND";this.ERROR_DEVICE_NOT_FOUND="DeviceNotFound";this.ERROR_DEVICE_BUSY="ERROR_DEVICE_BUSY";this.ERROR_NOT_SUPPORTED="ERROR_NOT_SUPPORTED";this.ERROR_COVER_OPEN="EPTR_COVER_OPEN";this.ERROR_TIMEOUT="EX_TIMEOUT";this.ERROR_AUTOMATICAL="EPTR_AUTOMATICAL";this.ERROR_UNRECOVERABLE="EPTR_UNRECOVERABLE";this.ERROR_BADPORT="EX_BADPORT";this.SYSTEM_ERROR="SYSTEM_ERROR";this.EPTR_CUTTER="EPTR_CUTTER";this.EPTR_MECHANICAL="EPTR_MECHANICAL";this.EPTR_REC_EMPTY="EPTR_REC_EMPTY";this.EPTR_SCHEMAERROR="SchemaError";this.EPTR_PRINT_SYSTEM_ERROR="PrintSystemError"}ReceiptPrinter.prototype=new Printer;ReceiptPrinter.prototype.send=function(){if(this.methodName==""){this.methodName="send"}return Printer.prototype.send.apply(this,arguments)};ReceiptPrinter.prototype.print=function(canvas,cut,mode){this.methodName="print";return Printer.prototype.print.apply(this,arguments)};ReceiptPrinter.prototype.recover=function(){this.methodName="recover";return Printer.prototype.recover.apply(this,arguments)};ReceiptPrinter.prototype.reset=function(){this.methodName="reset";return Printer.prototype.reset.apply(this,arguments)};ReceiptPrinter.prototype.fireOnReceive=function(res,sq){if(this.onreceive==null){return}var eventtype=this.methodName;var success="false";var code="";var status=this.ASB_NO_RESPONSE;if(res){var xml=res.resultdata;success=/success\s*=\s*"\s*(1|true)\s*"/.test(xml);xml.match(/code\s*=\s*"\s*(\S*)\s*"/);code=RegExp.$1;if(code==""){code=(success)?"SUCCESS":"ERROR_DEVICE_NOT_FOUND"}xml.match(/status\s*=\s*"\s*(\d+)\s*"/);status=parseInt(RegExp.$1)}this.onreceive({eventtype:eventtype,success:success,code:code,status:status},sq);this.methodName=""};function SlipPrinter(ePosDevObj,deviceID){this.ePosDevObj=ePosDevObj;this.deviceID=deviceID;this.SUCCESS="SUCCESS";this.CANCEL="CANCEL";this.ERROR_PARAMMETER="ERROR_PARAMMETER";this.ERROR_COMMAND="ERROR_COMMAND";this.ERROR_DEVICE_NOT_FOUND="ERROR_DEVICE_NOT_FOUND";this.ERROR_DEVICE_BUSY="ERROR_DEVICE_BUSY";this.ERROR_NOT_SUPPORTED="ERROR_NOT_SUPPORTED";this.ERROR_COVER_OPEN="ERROR_COVER_OPEN";this.ERROR_TIMEOUT="ERROR_TIMEOUT";this.ERROR_AUTOMATICAL="ERROR_AUTOMATICAL";this.ERROR_UNRECOVERABLE="ERROR_UNRECOVERABLE";this.ERROR_BADPORT="ERROR_BADPORT";this.SYSTEM_ERROR="SYSTEM_ERROR";this.EPTR_CUTTER="EPTR_CUTTER";this.EPTR_MECHANICAL="EPTR_MECHANICAL";this.EPTR_REC_EMPTY="EPTR_REC_EMPTY";this.EPTR_SCHEMAERROR="EPTR_SCHEMAERROR";this.EPTR_PRINT_SYSTEM_ERROR="EPTR_PRINT_SYSTEM_ERROR"}SlipPrinter.prototype=new ePOSBuilder();SlipPrinter.prototype.timeout=60000;SlipPrinter.prototype.send=function(){var sq=-1;try{var xml=(arguments.length<1)?this.toString():arguments[1];var data={type:"slipprint",timeout:this.timeout,printdata:xml};sq=this.ePosDevObj.sendDeviceData(this.deviceID,data);this.setXmlString("")}catch(e){sq=-1}return sq};SlipPrinter.prototype.setXmlString=function(xml){this.message=xml};SlipPrinter.prototype.getXmlString=function(){return this.message};SlipPrinter.prototype.cancel=function(){var sq=-1;try{var data={type:"slipcancel"};var sq=this.ePosDevObj.sendDeviceData(this.deviceID,data)}catch(e){sq=-1}return sq};SlipPrinter.prototype.fireOnReceive=function(res,sq){if(this.onreceive==null){return}if(res==null){return}var eventtype="";switch(res.eventtype){case"slipprint":eventtype="send";break;case"slipcancel":eventtype="cancel";break;default:break}this.onreceive({eventtype:eventtype,success:res.success,code:res.code,status:res.status},sq)};function EndorsePrinter(ePosDevObj,deviceID){this.ePosDevObj=ePosDevObj;this.deviceID=deviceID;this.mode40cpl=false;this.SUCCESS="SUCCESS";this.CANCEL="CANCEL";this.ERROR_PARAMMETER="ERROR_PARAMMETER";this.ERROR_COMMAND="ERROR_COMMAND";this.ERROR_DEVICE_NOT_FOUND="ERROR_DEVICE_NOT_FOUND";this.ERROR_DEVICE_BUSY="ERROR_DEVICE_BUSY";this.ERROR_NOT_SUPPORTED="ERROR_NOT_SUPPORTED";this.ERROR_COVER_OPEN="ERROR_COVER_OPEN";this.ERROR_TIMEOUT="ERROR_TIMEOUT";this.ERROR_AUTOMATICAL="ERROR_AUTOMATICAL";this.ERROR_UNRECOVERABLE="ERROR_UNRECOVERABLE";this.ERROR_BADPORT="ERROR_BADPORT";this.SYSTEM_ERROR="SYSTEM_ERROR";this.EPTR_CUTTER="EPTR_CUTTER";this.EPTR_MECHANICAL="EPTR_MECHANICAL";this.EPTR_REC_EMPTY="EPTR_REC_EMPTY";this.EPTR_SCHEMAERROR="EPTR_SCHEMAERROR";this.EPTR_PRINT_SYSTEM_ERROR="EPTR_PRINT_SYSTEM_ERROR"}EndorsePrinter.prototype=new ePOSBuilder();EndorsePrinter.prototype.timeout=60000;EndorsePrinter.prototype.send=function(){var sq=-1;try{var xml=(arguments.length<1)?this.toString():arguments[1];var data={type:"endorseprint","40cplmode":this.mode40cpl,timeout:this.timeout,printdata:xml};sq=this.ePosDevObj.sendDeviceData(this.deviceID,data);this.setXmlString("")}catch(e){sq=-1}return sq};EndorsePrinter.prototype.setXmlString=function(xml){this.message=xml};EndorsePrinter.prototype.getXmlString=function(){return this.message};EndorsePrinter.prototype.cancel=function(){var sq=-1;try{var data={type:"endorsecancel"};var sq=this.ePosDevObj.sendDeviceData(this.deviceID,data)}catch(e){sq=-1}return sq};EndorsePrinter.prototype.enable40cplmode=function(flag){this.mode40cpl=flag};EndorsePrinter.prototype.fireOnReceive=function(res,sq){if(this.onreceive==null){return}if(res==null){return}var eventtype="";switch(res.eventtype){case"endorseprint":eventtype="send";break;case"endorsecancel":eventtype="cancel";break;default:break}this.onreceive({eventtype:eventtype,success:res.success,code:res.code,status:res.status},sq)};function MICRReader(ePosDevObj,deviceID){this.ePosDevObj=ePosDevObj;this.deviceID=deviceID;this.timeout=60000;this.FONT_E13B="MICR_E13B";this.FONT_CMC7="MICR_CMC7";this.SUCCESS="SUCCESS";this.CANCEL="CANCEL";this.ERROR_PARAMMETER="ERROR_PARAMMETER";this.ERROR_COMMAND="ERROR_COMMAND";this.ERROR_DEVICE_NOT_FOUND="ERROR_DEVICE_NOT_FOUND";this.ERROR_DEVICE_BUSY="ERROR_DEVICE_BUSY";this.ERROR_NOT_SUPPORTED="ERROR_NOT_SUPPORTED";this.ERROR_COVER_OPEN="ERROR_COVER_OPEN";this.ERROR_TIMEOUT="ERROR_TIMEOUT";this.ERROR_AUTOMATICAL="ERROR_AUTOMATICAL";this.ERROR_UNRECOVERABLE="ERROR_UNRECOVERABLE";this.ERROR_BADPORT="ERROR_BADPORT";this.SYSTEM_ERROR="SYSTEM_ERROR";this.EMICR_ILLEGAL_LENGTH="EMICR_ILLEGAL_LENGTH";this.EMICR_NO_MICR="EMICR_NO_MICR";this.EMICR_RECOGNITION="EMICR_RECOGNITION";this.EMICR_READ="EMICR_READ";this.EMICR_NOISE_DETECTED="EMICR_NOISE_DETECTED";this.EMICR_COVER_OPENED="EMICR_COVER_OPENED";this.EMICR_PAPER_JAM="EMICR_PAPER_JAM"}MICRReader.prototype.read=function(ignoreerror,font){var sq=-1;try{var data={type:"micrread",ignoreerror:ignoreerror,font:font,timeout:this.timeout};var sq=this.ePosDevObj.sendDeviceData(this.deviceID,data)}catch(e){sq=-1}return sq};MICRReader.prototype.cleaning=function(){var sq=-1;try{var data={type:"micrcleaning",timeout:this.timeout};var sq=this.ePosDevObj.sendDeviceData(this.deviceID,data)}catch(e){sq=-1}return sq};MICRReader.prototype.cancel=function(){var sq=-1;try{var data={type:"micrcancel"};var sq=this.ePosDevObj.sendDeviceData(this.deviceID,data)}catch(e){sq=-1}return sq};MICRReader.prototype.fireOnReceive=function(res,sq){if(this.onreceive==null){return}if(res==null){return}var eventtype="";switch(res.eventtype){case"micrread":eventtype="read";break;case"micrcleaning":eventtype="cleaning";break;case"micrcancel":eventtype="cancel";break;default:break}this.onreceive({eventtype:eventtype,success:res.success,code:res.code,status:res.status,data:res.data},sq)};function DeviceTerminal(ePosDevObj,deviceID){this.ePosDevObj=ePosDevObj;this.deviceID=deviceID;this.onshutdown=null;this.onrestart=null}DeviceTerminal.prototype={shutdown:function(password,callback){this.onshutdown=callback;var data={type:"shutdown",password:password};var sq=this.ePosDevObj.sendDeviceData(this.deviceID,data);return sq},client_onshutdown:function(data){try{if(typeof(this.onshutdown)!="function"){return}this.onshutdown(data)}catch(e){}return},restart:function(password,callback){this.onrestart=callback;var data={type:"restart",password:password};var sq=this.ePosDevObj.sendDeviceData(this.deviceID,data);return sq},client_onrestart:function(data){try{if(typeof(this.onrestart)!="function"){return}this.onrestart(data)}catch(e){}return}};function ePosCrypto(){this.pubkey_c;this.secretKey}ePosCrypto.prototype={init:function(){this.pubkey_c="";this.secretKey=""},genClientKeys:function(arg_prime_s,arg_pubkey_s){var g=str2bigInt("2",10);var prime_c=str2bigInt(arg_prime_s,16);var privkey_c=randBigInt(64,0);this.pubkey_c=powMod(g,privkey_c,prime_c);var intPubkey=str2bigInt(arg_pubkey_s,16);var modNum=powMod(intPubkey,privkey_c,prime_c);var strModNum=bigInt2str(modNum,16);var strSecretKey=strModNum.toLowerCase();while(strSecretKey.length<192){strSecretKey="0"+strSecretKey}this.secretKey=md5.bin(strSecretKey)},bfEncrypt:function(data){try{var enc_req={data:data,key:this.secretKey,mode:"cbc",round:16,iv:blowfish.mkIV()};var enc_data=blowfish.encrypt(enc_req);var cdata=base64.encode(enc_data)}catch(e){return""}return cdata},bfDecrypt:function(data){try{var dec_req={data:base64.decode(data),key:this.secretKey,mode:"cbc"};var ddata=blowfish.decrypt(dec_req)}catch(e){return""}return ddata}};
|
4 |
+
/*! Socket.IO.js build:0.8.7, development. Copyright(c) 2011 LearnBoost <dev@learnboost.com> MIT Licensed */
|
5 |
+
(function(exports,global){var io=exports;io.version="0.8.7";io.protocol=1;io.transports=[];io.j=[];io.sockets={};io.connect=function(host,details){var uri=io.util.parseUri(host),uuri,socket;if(global&&global.location){uri.protocol=uri.protocol||global.location.protocol.slice(0,-1);uri.host=uri.host||(global.document?global.document.domain:global.location.hostname);uri.port=uri.port||global.location.port}uuri=io.util.uniqueUri(uri);var options={host:uri.host,secure:"https"==uri.protocol,port:uri.port||("https"==uri.protocol?443:80),query:uri.query||""};io.util.merge(options,details);if(options["force new connection"]||!io.sockets[uuri]){socket=new io.Socket(options)}if(!options["force new connection"]&&socket){io.sockets[uuri]=socket}socket=socket||io.sockets[uuri];return socket.of(uri.path.length>1?uri.path:"")}})("object"===typeof module?module.exports:(this.io={}),this);(function(exports,global){var util=exports.util={};var re=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/;var parts=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];util.parseUri=function(str){var m=re.exec(str||""),uri={},i=14;while(i--){uri[parts[i]]=m[i]||""}return uri};util.uniqueUri=function(uri){var protocol=uri.protocol,host=uri.host,port=uri.port;if("document" in global){host=host||document.domain;port=port||(protocol=="https"&&document.location.protocol!=="https:"?443:document.location.port)}else{host=host||"localhost";if(!port&&protocol=="https"){port=443}}return(protocol||"http")+"://"+host+":"+(port||80)};util.query=function(base,addition){var query=util.chunkQuery(base||""),components=[];util.merge(query,util.chunkQuery(addition||""));for(var part in query){if(query.hasOwnProperty(part)){components.push(part+"="+query[part])}}return components.length?"?"+components.join("&"):""};util.chunkQuery=function(qs){var query={},params=qs.split("&"),i=0,l=params.length,kv;for(;i<l;++i){kv=params[i].split("=");if(kv[0]){query[kv[0]]=decodeURIComponent(kv[1])}}return query};var pageLoaded=false;util.load=function(fn){if("document" in global&&document.readyState==="complete"||pageLoaded){return fn()}util.on(global,"load",fn,false)};util.on=function(element,event,fn,capture){if(element.attachEvent){element.attachEvent("on"+event,fn)}else{if(element.addEventListener){element.addEventListener(event,fn,capture)}}};util.request=function(xdomain){if(xdomain&&"undefined"!=typeof XDomainRequest){return new XDomainRequest()}if("undefined"!=typeof XMLHttpRequest&&(!xdomain||util.ua.hasCORS)){return new XMLHttpRequest()}if(!xdomain){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}return null};if("undefined"!=typeof window){util.load(function(){pageLoaded=true})}util.defer=function(fn){if(!util.ua.webkit||"undefined"!=typeof importScripts){return fn()}util.load(function(){setTimeout(fn,100)})};util.merge=function merge(target,additional,deep,lastseen){var seen=lastseen||[],depth=typeof deep=="undefined"?2:deep,prop;for(prop in additional){if(additional.hasOwnProperty(prop)&&util.indexOf(seen,prop)<0){if(typeof target[prop]!=="object"||!depth){target[prop]=additional[prop];seen.push(additional[prop])}else{util.merge(target[prop],additional[prop],depth-1,seen)}}}return target};util.mixin=function(ctor,ctor2){util.merge(ctor.prototype,ctor2.prototype)};util.inherit=function(ctor,ctor2){function f(){}f.prototype=ctor2.prototype;ctor.prototype=new f};util.isArray=Array.isArray||function(obj){return Object.prototype.toString.call(obj)==="[object Array]"};util.intersect=function(arr,arr2){var ret=[],longest=arr.length>arr2.length?arr:arr2,shortest=arr.length>arr2.length?arr2:arr;for(var i=0,l=shortest.length;i<l;i++){if(~util.indexOf(longest,shortest[i])){ret.push(shortest[i])}}return ret};util.indexOf=function(arr,o,i){if(Array.prototype.indexOf){return Array.prototype.indexOf.call(arr,o,i)}for(var j=arr.length,i=i<0?i+j<0?0:i+j:i||0;i<j&&arr[i]!==o;i++){}return j<=i?-1:i};util.toArray=function(enu){var arr=[];for(var i=0,l=enu.length;i<l;i++){arr.push(enu[i])}return arr};util.ua={};util.ua.hasCORS="undefined"!=typeof XMLHttpRequest&&(function(){try{var a=new XMLHttpRequest()}catch(e){return false}return a.withCredentials!=undefined})();util.ua.webkit="undefined"!=typeof navigator&&/webkit/i.test(navigator.userAgent)})("undefined"!=typeof io?io:module.exports,this);(function(exports,io){exports.EventEmitter=EventEmitter;function EventEmitter(){}EventEmitter.prototype.on=function(name,fn){if(!this.$events){this.$events={}}if(!this.$events[name]){this.$events[name]=fn}else{if(io.util.isArray(this.$events[name])){this.$events[name].push(fn)}else{this.$events[name]=[this.$events[name],fn]}}return this};EventEmitter.prototype.addListener=EventEmitter.prototype.on;EventEmitter.prototype.once=function(name,fn){var self=this;function on(){self.removeListener(name,on);fn.apply(this,arguments)}on.listener=fn;this.on(name,on);return this};EventEmitter.prototype.removeListener=function(name,fn){if(this.$events&&this.$events[name]){var list=this.$events[name];if(io.util.isArray(list)){var pos=-1;for(var i=0,l=list.length;i<l;i++){if(list[i]===fn||(list[i].listener&&list[i].listener===fn)){pos=i;break}}if(pos<0){return this}list.splice(pos,1);if(!list.length){delete this.$events[name]}}else{if(list===fn||(list.listener&&list.listener===fn)){delete this.$events[name]}}}return this};EventEmitter.prototype.removeAllListeners=function(name){if(this.$events&&this.$events[name]){this.$events[name]=null}return this};EventEmitter.prototype.listeners=function(name){if(!this.$events){this.$events={}}if(!this.$events[name]){this.$events[name]=[]}if(!io.util.isArray(this.$events[name])){this.$events[name]=[this.$events[name]]}return this.$events[name]};EventEmitter.prototype.emit=function(name){if(!this.$events){return false}var handler=this.$events[name];if(!handler){return false}var args=Array.prototype.slice.call(arguments,1);if("function"==typeof handler){handler.apply(this,args)}else{if(io.util.isArray(handler)){var listeners=handler.slice();for(var i=0,l=listeners.length;i<l;i++){listeners[i].apply(this,args)}}else{return false}}return true}})("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports);(function(exports,nativeJSON){if(nativeJSON&&nativeJSON.parse){return exports.JSON={parse:nativeJSON.parse,stringify:nativeJSON.stringify}}var JSON=exports.JSON={};function f(n){return n<10?"0"+n:n}function date(d,key){return isFinite(d.valueOf())?d.getUTCFullYear()+"-"+f(d.getUTCMonth()+1)+"-"+f(d.getUTCDate())+"T"+f(d.getUTCHours())+":"+f(d.getUTCMinutes())+":"+f(d.getUTCSeconds())+"Z":null}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 instanceof Date){value=date(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}}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})};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")}})("undefined"!=typeof io?io:module.exports,typeof JSON!=="undefined"?JSON:undefined);(function(exports,io){var parser=exports.parser={};var packets=parser.packets=["disconnect","connect","heartbeat","message","json","event","ack","error","noop"];var reasons=parser.reasons=["transport not supported","client not handshaken","unauthorized"];var advice=parser.advice=["reconnect"];var JSON=io.JSON,indexOf=io.util.indexOf;parser.encodePacket=function(packet){var type=indexOf(packets,packet.type),id=packet.id||"",endpoint=packet.endpoint||"",ack=packet.ack,data=null;switch(packet.type){case"error":var reason=packet.reason?indexOf(reasons,packet.reason):"",adv=packet.advice?indexOf(advice,packet.advice):"";if(reason!==""||adv!==""){data=reason+(adv!==""?("+"+adv):"")}break;case"message":if(packet.data!==""){data=packet.data}break;case"event":var ev={name:packet.name};if(packet.args&&packet.args.length){ev.args=packet.args}data=JSON.stringify(ev);break;case"json":data=JSON.stringify(packet.data);break;case"connect":if(packet.qs){data=packet.qs}break;case"ack":data=packet.ackId+(packet.args&&packet.args.length?"+"+JSON.stringify(packet.args):"");break}var encoded=[type,id+(ack=="data"?"+":""),endpoint];if(data!==null&&data!==undefined){encoded.push(data)}return encoded.join(":")};parser.encodePayload=function(packets){var decoded="";if(packets.length==1){return packets[0]}for(var i=0,l=packets.length;i<l;i++){var packet=packets[i];decoded+="\ufffd"+packet.length+"\ufffd"+packets[i]}return decoded};var regexp=/([^:]+):([0-9]+)?(\+)?:([^:]+)?:?([\s\S]*)?/;parser.decodePacket=function(data){var pieces=data.match(regexp);if(!pieces){return{}}var id=pieces[2]||"",data=pieces[5]||"",packet={type:packets[pieces[1]],endpoint:pieces[4]||""};if(id){packet.id=id;if(pieces[3]){packet.ack="data"}else{packet.ack=true}}switch(packet.type){case"error":var pieces=data.split("+");packet.reason=reasons[pieces[0]]||"";packet.advice=advice[pieces[1]]||"";break;case"message":packet.data=data||"";break;case"event":try{var opts=JSON.parse(data);packet.name=opts.name;packet.args=opts.args}catch(e){}packet.args=packet.args||[];break;case"json":try{packet.data=JSON.parse(data)}catch(e){}break;case"connect":packet.qs=data||"";break;case"ack":var pieces=data.match(/^([0-9]+)(\+)?(.*)/);if(pieces){packet.ackId=pieces[1];packet.args=[];if(pieces[3]){try{packet.args=pieces[3]?JSON.parse(pieces[3]):[]}catch(e){}}}break;case"disconnect":case"heartbeat":break}return packet};parser.decodePayload=function(data){if(data.charAt(0)=="\ufffd"){var ret=[];for(var i=1,length="";i<data.length;i++){if(data.charAt(i)=="\ufffd"){ret.push(parser.decodePacket(data.substr(i+1).substr(0,length)));i+=Number(length)+1;length=""}else{length+=data.charAt(i)}}return ret}else{return[parser.decodePacket(data)]}}})("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports);(function(exports,io){exports.Transport=Transport;function Transport(socket,sessid){this.socket=socket;this.sessid=sessid}io.util.mixin(Transport,io.EventEmitter);Transport.prototype.onData=function(data){this.clearCloseTimeout();if(this.socket.connected||this.socket.connecting||this.socket.reconnecting){this.setCloseTimeout()}if(data!==""){var msgs=io.parser.decodePayload(data);if(msgs&&msgs.length){for(var i=0,l=msgs.length;i<l;i++){this.onPacket(msgs[i])}}}return this};Transport.prototype.onPacket=function(packet){if(packet.type=="heartbeat"){return this.onHeartbeat()}if(packet.type=="connect"&&packet.endpoint==""){this.onConnect()}this.socket.onPacket(packet);return this};Transport.prototype.setCloseTimeout=function(){if(!this.closeTimeout){var self=this;this.closeTimeout=setTimeout(function(){self.onDisconnect()},this.socket.closeTimeout)}};Transport.prototype.onDisconnect=function(){if(this.close&&this.open){this.close()}this.clearTimeouts();this.socket.onDisconnect();return this};Transport.prototype.onConnect=function(){this.socket.onConnect();return this};Transport.prototype.clearCloseTimeout=function(){if(this.closeTimeout){clearTimeout(this.closeTimeout);this.closeTimeout=null}};Transport.prototype.clearTimeouts=function(){this.clearCloseTimeout();if(this.reopenTimeout){clearTimeout(this.reopenTimeout)}};Transport.prototype.packet=function(packet){this.send(io.parser.encodePacket(packet))};Transport.prototype.onHeartbeat=function(heartbeat){this.packet({type:"heartbeat"})};Transport.prototype.onOpen=function(){this.open=true;this.clearCloseTimeout();this.socket.onOpen()};Transport.prototype.onClose=function(){var self=this;this.open=false;this.socket.onClose();this.onDisconnect()};Transport.prototype.prepareUrl=function(){var options=this.socket.options;return this.scheme()+"://"+options.host+":"+options.port+"/"+options.resource+"/"+io.protocol+"/"+this.name+"/"+this.sessid};Transport.prototype.ready=function(socket,fn){fn.call(this)}})("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports);(function(exports,io,global){exports.Socket=Socket;function Socket(options){this.options={port:80,secure:false,document:"document" in global?document:false,resource:"socket.io",transports:io.transports,"connect timeout":10000,"try multiple transports":true,reconnect:true,"reconnection delay":500,"reconnection limit":Infinity,"reopen delay":3000,"max reconnection attempts":10,"sync disconnect on unload":true,"auto connect":true,"flash policy port":10843};io.util.merge(this.options,options);this.connected=false;this.open=false;this.connecting=false;this.reconnecting=false;this.namespaces={};this.buffer=[];this.doBuffer=false;if(this.options["sync disconnect on unload"]&&(!this.isXDomain()||io.util.ua.hasCORS)){var self=this;io.util.on(global,"beforeunload",function(){self.disconnectSync()},false)}if(this.options["auto connect"]){this.connect()}}io.util.mixin(Socket,io.EventEmitter);Socket.prototype.of=function(name){if(!this.namespaces[name]){this.namespaces[name]=new io.SocketNamespace(this,name);if(name!==""){this.namespaces[name].packet({type:"connect"})}}return this.namespaces[name]};Socket.prototype.publish=function(){this.emit.apply(this,arguments);var nsp;for(var i in this.namespaces){if(this.namespaces.hasOwnProperty(i)){nsp=this.of(i);nsp.$emit.apply(nsp,arguments)}}};function empty(){}Socket.prototype.handshake=function(fn){var self=this,options=this.options;function complete(data){if(data instanceof Error){self.onError(data.message)}else{fn.apply(null,data.split(":"))}}var url=["http"+(options.secure?"s":"")+":/",options.host+":"+options.port,options.resource,io.protocol,io.util.query(this.options.query,"t="+ +new Date)].join("/");var loadTimeout=setTimeout(function(){if(typeof script!=="undefined"){try{var srcIndex=script.src.lastIndexOf("=")+1;var arrayIndex=script.src.substring(srcIndex);io.j[arrayIndex]=function(data){script.parentNode.removeChild(script)}}catch(e){}}self.publish("connect_failed")},this.options["connect timeout"]);if(this.isXDomain()&&!io.util.ua.hasCORS){var insertAt=document.getElementsByTagName("script")[0],script=document.createElement("script");script.src=url+"&jsonp="+io.j.length;insertAt.parentNode.insertBefore(script,insertAt);io.j.push(function(data){clearTimeout(loadTimeout);complete(data);script.parentNode.removeChild(script)})}else{var xhr=io.util.request();xhr.open("GET",url,true);xhr.onreadystatechange=function(){if(xhr.readyState==4){xhr.onreadystatechange=empty;clearTimeout(loadTimeout);if(xhr.status==200){complete(xhr.responseText)}else{!self.reconnecting&&self.onError(xhr.responseText)}}};xhr.timeout=this.options["connect timeout"];xhr.send(null)}};Socket.prototype.getTransport=function(override){var transports=override||this.transports,match;for(var i=0,transport;transport=transports[i];i++){if(io.Transport[transport]&&io.Transport[transport].check(this)&&(!this.isXDomain()||io.Transport[transport].xdomainCheck())){return new io.Transport[transport](this,this.sessionid)}}return null};Socket.prototype.connect=function(fn){if(this.connecting){return this}var self=this;this.handshake(function(sid,heartbeat,close,transports){self.sessionid=sid;self.closeTimeout=close*1000;self.heartbeatTimeout=heartbeat*1000;self.transports=io.util.intersect(transports.split(","),self.options.transports);function connect(transports){if(self.transport){self.transport.clearTimeouts()}self.transport=self.getTransport(transports);if(!self.transport){return self.publish("connect_failed")}self.transport.ready(self,function(){self.connecting=true;self.publish("connecting",self.transport.name);self.transport.open();if(self.options["connect timeout"]){self.connectTimeoutTimer=setTimeout(function(){if(!self.connected){self.connecting=false;if(self.options["try multiple transports"]){if(!self.remainingTransports){self.remainingTransports=self.transports.slice(0)}var remaining=self.remainingTransports;while(remaining.length>0&&remaining.splice(0,1)[0]!=self.transport.name){}if(remaining.length){connect(remaining)}else{self.publish("connect_failed")}}}},self.options["connect timeout"])}})}connect();self.once("connect",function(){clearTimeout(self.connectTimeoutTimer);fn&&typeof fn=="function"&&fn()})});return this};Socket.prototype.packet=function(data){if(this.connected&&!this.doBuffer){this.transport.packet(data)}else{this.buffer.push(data)}return this};Socket.prototype.setBuffer=function(v){this.doBuffer=v;if(!v&&this.connected&&this.buffer.length){this.transport.payload(this.buffer);this.buffer=[]}};Socket.prototype.disconnect=function(){if(this.connected){if(this.open){this.of("").packet({type:"disconnect"})}this.onDisconnect("booted")}return this};Socket.prototype.disconnectSync=function(){var xhr=io.util.request(),uri=this.resource+"/"+io.protocol+"/"+this.sessionid;xhr.open("GET",uri,true);this.onDisconnect("booted")};Socket.prototype.isXDomain=function(){var port=global.location.port||("https:"==global.location.protocol?443:80);return this.options.host!==global.location.hostname||this.options.port!=port};Socket.prototype.onConnect=function(){if(!this.connected){this.connected=true;this.connecting=false;if(!this.doBuffer){this.setBuffer(false)}this.emit("connect")}};Socket.prototype.onOpen=function(){this.open=true};Socket.prototype.onClose=function(){this.open=false};Socket.prototype.onPacket=function(packet){this.of(packet.endpoint).onPacket(packet)};Socket.prototype.onError=function(err){if(err&&err.advice){if(err.advice==="reconnect"&&this.connected){this.disconnect();this.reconnect()}}this.publish("error",err&&err.reason?err.reason:err)};Socket.prototype.onDisconnect=function(reason){var wasConnected=this.connected;this.connected=false;this.connecting=false;this.open=false;if(wasConnected){this.transport.close();this.transport.clearTimeouts();this.publish("disconnect",reason);if("booted"!=reason&&this.options.reconnect&&!this.reconnecting){this.reconnect()}}};Socket.prototype.reconnect=function(){this.reconnecting=true;this.reconnectionAttempts=0;this.reconnectionDelay=this.options["reconnection delay"];var self=this,maxAttempts=this.options["max reconnection attempts"],tryMultiple=this.options["try multiple transports"],limit=this.options["reconnection limit"];function reset(){if(self.connected){for(var i in self.namespaces){if(self.namespaces.hasOwnProperty(i)&&""!==i){self.namespaces[i].packet({type:"connect"})}}self.publish("reconnect",self.transport.name,self.reconnectionAttempts)}self.removeListener("connect_failed",maybeReconnect);self.removeListener("connect",maybeReconnect);self.reconnecting=false;delete self.reconnectionAttempts;delete self.reconnectionDelay;delete self.reconnectionTimer;delete self.redoTransports;self.options["try multiple transports"]=tryMultiple}function maybeReconnect(){if(!self.reconnecting){return}if(self.connected){return reset()}if(self.connecting&&self.reconnecting){return self.reconnectionTimer=setTimeout(maybeReconnect,1000)}if(self.reconnectionAttempts++>=maxAttempts){if(!self.redoTransports){self.on("connect_failed",maybeReconnect);self.options["try multiple transports"]=true;self.transport=self.getTransport();self.redoTransports=true;self.connect()}else{self.publish("reconnect_failed");reset()}}else{if(self.reconnectionDelay<limit){self.reconnectionDelay*=2}self.connect();self.publish("reconnecting",self.reconnectionDelay,self.reconnectionAttempts);self.reconnectionTimer=setTimeout(maybeReconnect,self.reconnectionDelay)}}this.options["try multiple transports"]=false;this.reconnectionTimer=setTimeout(maybeReconnect,this.reconnectionDelay);this.on("connect",maybeReconnect)}})("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports,this);(function(exports,io){exports.SocketNamespace=SocketNamespace;function SocketNamespace(socket,name){this.socket=socket;this.name=name||"";this.flags={};this.json=new Flag(this,"json");this.ackPackets=0;this.acks={}}io.util.mixin(SocketNamespace,io.EventEmitter);SocketNamespace.prototype.$emit=io.EventEmitter.prototype.emit;SocketNamespace.prototype.of=function(){return this.socket.of.apply(this.socket,arguments)};SocketNamespace.prototype.packet=function(packet){packet.endpoint=this.name;this.socket.packet(packet);this.flags={};return this};SocketNamespace.prototype.send=function(data,fn){var packet={type:this.flags.json?"json":"message",data:data};if("function"==typeof fn){packet.id=++this.ackPackets;packet.ack=true;this.acks[packet.id]=fn}return this.packet(packet)};SocketNamespace.prototype.emit=function(name){var args=Array.prototype.slice.call(arguments,1),lastArg=args[args.length-1],packet={type:"event",name:name};if("function"==typeof lastArg){packet.id=++this.ackPackets;packet.ack="data";this.acks[packet.id]=lastArg;args=args.slice(0,args.length-1)}packet.args=args;return this.packet(packet)};SocketNamespace.prototype.disconnect=function(){if(this.name===""){this.socket.disconnect()}else{this.packet({type:"disconnect"});this.$emit("disconnect")}return this};SocketNamespace.prototype.onPacket=function(packet){var self=this;function ack(){self.packet({type:"ack",args:io.util.toArray(arguments),ackId:packet.id})}switch(packet.type){case"connect":this.$emit("connect");break;case"disconnect":if(this.name===""){this.socket.onDisconnect(packet.reason||"booted")}else{this.$emit("disconnect",packet.reason)}break;case"message":case"json":var params=["message",packet.data];if(packet.ack=="data"){params.push(ack)}else{if(packet.ack){this.packet({type:"ack",ackId:packet.id})}}this.$emit.apply(this,params);break;case"event":var params=[packet.name].concat(packet.args);if(packet.ack=="data"){params.push(ack)}this.$emit.apply(this,params);break;case"ack":if(this.acks[packet.ackId]){this.acks[packet.ackId].apply(this,packet.args);delete this.acks[packet.ackId]}break;case"error":if(packet.advice){this.socket.onError(packet)}else{if(packet.reason=="unauthorized"){this.$emit("connect_failed",packet.reason)}else{this.$emit("error",packet.reason)}}break}};function Flag(nsp,name){this.namespace=nsp;this.name=name}Flag.prototype.send=function(){this.namespace.flags[this.name]=true;this.namespace.send.apply(this.namespace,arguments)};Flag.prototype.emit=function(){this.namespace.flags[this.name]=true;this.namespace.emit.apply(this.namespace,arguments)}})("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports);(function(exports,io,global){exports.websocket=WS;function WS(socket){io.Transport.apply(this,arguments)}io.util.inherit(WS,io.Transport);WS.prototype.name="websocket";WS.prototype.open=function(){var query=io.util.query(this.socket.options.query),self=this,Socket;if(!Socket){Socket=global.MozWebSocket||global.WebSocket}this.websocket=new Socket(this.prepareUrl()+query);this.websocket.onopen=function(){self.onOpen();self.socket.setBuffer(false)};this.websocket.onmessage=function(ev){self.onData(ev.data)};this.websocket.onclose=function(){self.onClose();self.socket.setBuffer(true)};this.websocket.onerror=function(e){self.onError(e)};return this};WS.prototype.send=function(data){this.websocket.send(data);return this};WS.prototype.payload=function(arr){for(var i=0,l=arr.length;i<l;i++){this.packet(arr[i])}return this};WS.prototype.close=function(){this.websocket.close();return this};WS.prototype.onError=function(e){this.socket.onError(e)};WS.prototype.scheme=function(){return this.socket.options.secure?"wss":"ws"};WS.check=function(){return("WebSocket" in global&&!("__addTask" in WebSocket))||"MozWebSocket" in global};WS.xdomainCheck=function(){return true};io.transports.push("websocket")})("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports,this);(function(exports,io){exports.flashsocket=Flashsocket;function Flashsocket(){io.Transport.websocket.apply(this,arguments)}io.util.inherit(Flashsocket,io.Transport.websocket);Flashsocket.prototype.name="flashsocket";Flashsocket.prototype.open=function(){var self=this,args=arguments;WebSocket.__addTask(function(){io.Transport.websocket.prototype.open.apply(self,args)});return this};Flashsocket.prototype.send=function(){var self=this,args=arguments;WebSocket.__addTask(function(){io.Transport.websocket.prototype.send.apply(self,args)});return this};Flashsocket.prototype.close=function(){WebSocket.__tasks.length=0;io.Transport.websocket.prototype.close.call(this);return this};Flashsocket.prototype.ready=function(socket,fn){function init(){var options=socket.options,port=options["flash policy port"],path=["http"+(options.secure?"s":"")+":/",options.host+":"+options.port,options.resource,"static/flashsocket","WebSocketMain"+(socket.isXDomain()?"Insecure":"")+".swf"];if(!Flashsocket.loaded){if(typeof WEB_SOCKET_SWF_LOCATION==="undefined"){WEB_SOCKET_SWF_LOCATION=path.join("/")}if(port!==843){WebSocket.loadFlashPolicyFile("xmlsocket://"+options.host+":"+port)}WebSocket.__initialize();Flashsocket.loaded=true}fn.call(self)}var self=this;if(document.body){return init()}io.util.load(init)};Flashsocket.check=function(){if(typeof WebSocket=="undefined"||!("__initialize" in WebSocket)||!swfobject){return false}return swfobject.getFlashPlayerVersion().major>=10};Flashsocket.xdomainCheck=function(){return true};if(typeof window!="undefined"){WEB_SOCKET_DISABLE_AUTO_INITIALIZATION=true}io.transports.push("flashsocket")})("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports);if("undefined"!=typeof window){var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}()}(function(){if("undefined"==typeof window||window.WebSocket){return}var console=window.console;if(!console||!console.log||!console.error){console={log:function(){},error:function(){}}}if(!swfobject.hasFlashPlayerVersion("10.0.0")){console.error("Flash Player >= 10.0.0 is required.");return}if(location.protocol=="file:"){console.error("WARNING: web-socket-js doesn't work in file:///... URL unless you set Flash Security Settings properly. Open the page via Web server i.e. http://...")}WebSocket=function(url,protocols,proxyHost,proxyPort,headers){var self=this;self.__id=WebSocket.__nextId++;WebSocket.__instances[self.__id]=self;self.readyState=WebSocket.CONNECTING;self.bufferedAmount=0;self.__events={};if(!protocols){protocols=[]}else{if(typeof protocols=="string"){protocols=[protocols]}}setTimeout(function(){WebSocket.__addTask(function(){WebSocket.__flash.create(self.__id,url,protocols,proxyHost||null,proxyPort||0,headers||null)})},0)};WebSocket.prototype.send=function(data){if(this.readyState==WebSocket.CONNECTING){throw"INVALID_STATE_ERR: Web Socket connection has not been established"}var result=WebSocket.__flash.send(this.__id,encodeURIComponent(data));if(result<0){return true}else{this.bufferedAmount+=result;return false}};WebSocket.prototype.close=function(){if(this.readyState==WebSocket.CLOSED||this.readyState==WebSocket.CLOSING){return}this.readyState=WebSocket.CLOSING;WebSocket.__flash.close(this.__id)};WebSocket.prototype.addEventListener=function(type,listener,useCapture){if(!(type in this.__events)){this.__events[type]=[]}this.__events[type].push(listener)};WebSocket.prototype.removeEventListener=function(type,listener,useCapture){if(!(type in this.__events)){return}var events=this.__events[type];for(var i=events.length-1;i>=0;--i){if(events[i]===listener){events.splice(i,1);break}}};WebSocket.prototype.dispatchEvent=function(event){var events=this.__events[event.type]||[];for(var i=0;i<events.length;++i){events[i](event)}var handler=this["on"+event.type];if(handler){handler(event)}};WebSocket.prototype.__handleEvent=function(flashEvent){if("readyState" in flashEvent){this.readyState=flashEvent.readyState}if("protocol" in flashEvent){this.protocol=flashEvent.protocol}var jsEvent;if(flashEvent.type=="open"||flashEvent.type=="error"){jsEvent=this.__createSimpleEvent(flashEvent.type)}else{if(flashEvent.type=="close"){jsEvent=this.__createSimpleEvent("close")}else{if(flashEvent.type=="message"){var data=decodeURIComponent(flashEvent.message);jsEvent=this.__createMessageEvent("message",data)}else{throw"unknown event type: "+flashEvent.type}}}this.dispatchEvent(jsEvent)};WebSocket.prototype.__createSimpleEvent=function(type){if(document.createEvent&&window.Event){var event=document.createEvent("Event");event.initEvent(type,false,false);return event}else{return{type:type,bubbles:false,cancelable:false}}};WebSocket.prototype.__createMessageEvent=function(type,data){if(document.createEvent&&window.MessageEvent&&!window.opera){var event=document.createEvent("MessageEvent");event.initMessageEvent("message",false,false,data,null,null,window,null);return event}else{return{type:type,data:data,bubbles:false,cancelable:false}}};WebSocket.CONNECTING=0;WebSocket.OPEN=1;WebSocket.CLOSING=2;WebSocket.CLOSED=3;WebSocket.__flash=null;WebSocket.__instances={};WebSocket.__tasks=[];WebSocket.__nextId=0;WebSocket.loadFlashPolicyFile=function(url){WebSocket.__addTask(function(){WebSocket.__flash.loadManualPolicyFile(url)})};WebSocket.__initialize=function(){if(WebSocket.__flash){return}if(WebSocket.__swfLocation){window.WEB_SOCKET_SWF_LOCATION=WebSocket.__swfLocation}if(!window.WEB_SOCKET_SWF_LOCATION){console.error("[WebSocket] set WEB_SOCKET_SWF_LOCATION to location of WebSocketMain.swf");return}var container=document.createElement("div");container.id="webSocketContainer";container.style.position="absolute";if(WebSocket.__isFlashLite()){container.style.left="0px";container.style.top="0px"}else{container.style.left="-100px";container.style.top="-100px"}var holder=document.createElement("div");holder.id="webSocketFlash";container.appendChild(holder);document.body.appendChild(container);swfobject.embedSWF(WEB_SOCKET_SWF_LOCATION,"webSocketFlash","1","1","10.0.0",null,null,{hasPriority:true,swliveconnect:true,allowScriptAccess:"always"},null,function(e){if(!e.success){console.error("[WebSocket] swfobject.embedSWF failed")}})};WebSocket.__onFlashInitialized=function(){setTimeout(function(){WebSocket.__flash=document.getElementById("webSocketFlash");WebSocket.__flash.setCallerUrl(location.href);WebSocket.__flash.setDebug(!!window.WEB_SOCKET_DEBUG);for(var i=0;i<WebSocket.__tasks.length;++i){WebSocket.__tasks[i]()}WebSocket.__tasks=[]},0)};WebSocket.__onFlashEvent=function(){setTimeout(function(){try{var events=WebSocket.__flash.receiveEvents();for(var i=0;i<events.length;++i){WebSocket.__instances[events[i].webSocketId].__handleEvent(events[i])}}catch(e){console.error(e)}},0);return true};WebSocket.__log=function(message){console.log(decodeURIComponent(message))};WebSocket.__error=function(message){console.error(decodeURIComponent(message))};WebSocket.__addTask=function(task){if(WebSocket.__flash){task()}else{WebSocket.__tasks.push(task)}};WebSocket.__isFlashLite=function(){if(!window.navigator||!window.navigator.mimeTypes){return false}var mimeType=window.navigator.mimeTypes["application/x-shockwave-flash"];if(!mimeType||!mimeType.enabledPlugin||!mimeType.enabledPlugin.filename){return false}return mimeType.enabledPlugin.filename.match(/flashlite/i)?true:false};if(!window.WEB_SOCKET_DISABLE_AUTO_INITIALIZATION){if(window.addEventListener){window.addEventListener("load",function(){WebSocket.__initialize()},false)}else{window.attachEvent("onload",function(){WebSocket.__initialize()})}}})();(function(exports,io,global){exports.XHR=XHR;function XHR(socket){if(!socket){return}io.Transport.apply(this,arguments);this.sendBuffer=[]}io.util.inherit(XHR,io.Transport);XHR.prototype.open=function(){this.socket.setBuffer(false);this.onOpen();this.get();this.setCloseTimeout();return this};XHR.prototype.payload=function(payload){var msgs=[];for(var i=0,l=payload.length;i<l;i++){msgs.push(io.parser.encodePacket(payload[i]))}this.send(io.parser.encodePayload(msgs))};XHR.prototype.send=function(data){this.post(data);return this};function empty(){}XHR.prototype.post=function(data){var self=this;this.socket.setBuffer(true);function stateChange(){if(this.readyState==4){this.onreadystatechange=empty;self.posting=false;if(this.status==200){self.socket.setBuffer(false)}else{self.onClose()}}}function onload(){this.onload=empty;self.socket.setBuffer(false)}this.sendXHR=this.request("POST");if(global.XDomainRequest&&this.sendXHR instanceof XDomainRequest){this.sendXHR.onload=this.sendXHR.onerror=onload}else{this.sendXHR.onreadystatechange=stateChange}this.sendXHR.send(data)};XHR.prototype.close=function(){this.onClose();return this};XHR.prototype.request=function(method){var req=io.util.request(this.socket.isXDomain()),query=io.util.query(this.socket.options.query,"t="+ +new Date);req.open(method||"GET",this.prepareUrl()+query,true);if(method=="POST"){try{if(req.setRequestHeader){req.setRequestHeader("Content-type","text/plain;charset=UTF-8")}else{req.contentType="text/plain"}}catch(e){}}return req};XHR.prototype.scheme=function(){return this.socket.options.secure?"https":"http"};XHR.check=function(socket,xdomain){try{if(io.util.request(xdomain)){return true}}catch(e){}return false};XHR.xdomainCheck=function(){return XHR.check(null,true)}})("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports,this);(function(exports,io){exports.htmlfile=HTMLFile;function HTMLFile(socket){io.Transport.XHR.apply(this,arguments)}io.util.inherit(HTMLFile,io.Transport.XHR);HTMLFile.prototype.name="htmlfile";HTMLFile.prototype.get=function(){this.doc=new ActiveXObject("htmlfile");this.doc.open();this.doc.write("<html></html>");this.doc.close();this.doc.parentWindow.s=this;var iframeC=this.doc.createElement("div");iframeC.className="socketio";this.doc.body.appendChild(iframeC);this.iframe=this.doc.createElement("iframe");iframeC.appendChild(this.iframe);var self=this,query=io.util.query(this.socket.options.query,"t="+ +new Date);this.iframe.src=this.prepareUrl()+query;io.util.on(window,"unload",function(){self.destroy()})};HTMLFile.prototype._=function(data,doc){this.onData(data);try{var script=doc.getElementsByTagName("script")[0];script.parentNode.removeChild(script)}catch(e){}};HTMLFile.prototype.destroy=function(){if(this.iframe){try{this.iframe.src="about:blank"}catch(e){}this.doc=null;this.iframe.parentNode.removeChild(this.iframe);this.iframe=null;CollectGarbage()}};HTMLFile.prototype.close=function(){this.destroy();return io.Transport.XHR.prototype.close.call(this)};HTMLFile.check=function(){if("ActiveXObject" in window){try{var a=new ActiveXObject("htmlfile");return a&&io.Transport.XHR.check()}catch(e){}}return false};HTMLFile.xdomainCheck=function(){return false};io.transports.push("htmlfile")})("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports);(function(exports,io,global){exports["xhr-polling"]=XHRPolling;function XHRPolling(){io.Transport.XHR.apply(this,arguments)}io.util.inherit(XHRPolling,io.Transport.XHR);io.util.merge(XHRPolling,io.Transport.XHR);XHRPolling.prototype.name="xhr-polling";XHRPolling.prototype.open=function(){var self=this;io.Transport.XHR.prototype.open.call(self);return false};function empty(){}XHRPolling.prototype.get=function(){if(!this.open){return}var self=this;function stateChange(){if(this.readyState==4){this.onreadystatechange=empty;if(this.status==200){self.onData(this.responseText);self.get()}else{self.onClose()}}}function onload(){this.onload=empty;self.onData(this.responseText);self.get()}this.xhr=this.request();if(global.XDomainRequest&&this.xhr instanceof XDomainRequest){this.xhr.onload=this.xhr.onerror=onload}else{this.xhr.onreadystatechange=stateChange}this.xhr.send(null)};XHRPolling.prototype.onClose=function(){io.Transport.XHR.prototype.onClose.call(this);if(this.xhr){this.xhr.onreadystatechange=this.xhr.onload=empty;try{this.xhr.abort()}catch(e){}this.xhr=null}};XHRPolling.prototype.ready=function(socket,fn){var self=this;io.util.defer(function(){fn.call(self)})};io.transports.push("xhr-polling")})("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports,this);(function(exports,io,global){var indicator=global.document&&"MozAppearance" in global.document.documentElement.style;exports["jsonp-polling"]=JSONPPolling;function JSONPPolling(socket){io.Transport["xhr-polling"].apply(this,arguments);this.index=io.j.length;var self=this;io.j.push(function(msg){self._(msg)})}io.util.inherit(JSONPPolling,io.Transport["xhr-polling"]);JSONPPolling.prototype.name="jsonp-polling";JSONPPolling.prototype.post=function(data){var self=this,query=io.util.query(this.socket.options.query,"t="+(+new Date)+"&i="+this.index);if(!this.form){var form=document.createElement("form"),area=document.createElement("textarea"),id=this.iframeId="socketio_iframe_"+this.index,iframe;form.className="socketio";form.style.position="absolute";form.style.top="-1000px";form.style.left="-1000px";form.target=id;form.method="POST";form.setAttribute("accept-charset","utf-8");area.name="d";form.appendChild(area);document.body.appendChild(form);this.form=form;this.area=area}this.form.action=this.prepareUrl()+query;function complete(){initIframe();self.socket.setBuffer(false)}function initIframe(){if(self.iframe){self.form.removeChild(self.iframe)}try{iframe=document.createElement('<iframe name="'+self.iframeId+'">')}catch(e){iframe=document.createElement("iframe");iframe.name=self.iframeId}iframe.id=self.iframeId;self.form.appendChild(iframe);self.iframe=iframe}initIframe();this.area.value=io.JSON.stringify(data);try{this.form.submit()}catch(e){}if(this.iframe.attachEvent){iframe.onreadystatechange=function(){if(self.iframe.readyState=="complete"){complete()}}}else{this.iframe.onload=complete}this.socket.setBuffer(true)};JSONPPolling.prototype.get=function(){var self=this,script=document.createElement("script"),query=io.util.query(this.socket.options.query,"t="+(+new Date)+"&i="+this.index);if(this.script){this.script.parentNode.removeChild(this.script);this.script=null}script.async=true;script.src=this.prepareUrl()+query;script.onerror=function(){self.onClose()};var insertAt=document.getElementsByTagName("script")[0];insertAt.parentNode.insertBefore(script,insertAt);this.script=script;if(indicator){setTimeout(function(){var iframe=document.createElement("iframe");document.body.appendChild(iframe);document.body.removeChild(iframe)},100)}};JSONPPolling.prototype._=function(msg){this.onData(msg);if(this.open){this.get()}return this};JSONPPolling.prototype.ready=function(socket,fn){var self=this;if(!indicator){return fn.call(this)}io.util.load(function(){fn.call(self)})};JSONPPolling.check=function(){return"document" in global};JSONPPolling.xdomainCheck=function(){return true};io.transports.push("jsonp-polling")})("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports,this);var JSON;if(!JSON){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")}}}());base64=new function(){var utfLibName="utf";var b64char="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var b64encTable=b64char.split("");var b64decTable=[];for(var i=0;i<b64char.length;i++){b64decTable[b64char.charAt(i)]=i}this.encode=function(_dat,_strMode){return encoder(_strMode?unpackUTF8(_dat):unpackChar(_dat))};var encoder=function(_ary){var md=_ary.length%3;var b64="";var i,tmp=0;if(md){for(i=3-md;i>0;i--){_ary[_ary.length]=0}}for(i=0;i<_ary.length;i+=3){tmp=(_ary[i]<<16)|(_ary[i+1]<<8)|_ary[i+2];b64+=b64encTable[(tmp>>>18)&63]+b64encTable[(tmp>>>12)&63]+b64encTable[(tmp>>>6)&63]+b64encTable[tmp&63]}if(md){md=3-md;b64=b64.substr(0,b64.length-md);while(md--){b64+="="}}return b64};this.decode=function(_b64,_strMode){var tmp=decoder(_b64);return _strMode?packUTF8(tmp):packChar(tmp)};var decoder=function(_b64){_b64=_b64.replace(/[^A-Za-z0-9\+\/]/g,"");var md=_b64.length%4;var j,i,tmp;var dat=[];if(md){for(i=0;i<4-md;i++){_b64+="A"}}for(j=i=0;i<_b64.length;i+=4,j+=3){tmp=(b64decTable[_b64.charAt(i)]<<18)|(b64decTable[_b64.charAt(i+1)]<<12)|(b64decTable[_b64.charAt(i+2)]<<6)|b64decTable[_b64.charAt(i+3)];dat[j]=tmp>>>16;dat[j+1]=(tmp>>>8)&255;dat[j+2]=tmp&255}if(md){dat.length-=[0,0,2,1][md]}return dat};var packUTF8=function(_x){return window[utfLibName].packUTF8(_x)};var unpackUTF8=function(_x){return window[utfLibName].unpackUTF8(_x)};var packChar=function(_x){return window[utfLibName].packChar(_x)};var unpackChar=function(_x){return window[utfLibName].unpackChar(_x)}};utf=new function(){this.unpackUTF16=function(_str){var i,utf16=[];for(i=0;i<_str.length;i++){utf16[i]=_str.charCodeAt(i)}return utf16};this.unpackChar=function(_str){var utf16=this.unpackUTF16(_str);var i,n,tmp=[];for(n=i=0;i<utf16.length;i++){if(utf16[i]<=255){tmp[n++]=utf16[i]}else{tmp[n++]=utf16[i]>>8;tmp[n++]=utf16[i]&255}}return tmp};this.packChar=this.packUTF16=function(_utf16){var i,str="";for(i in _utf16){str+=String.fromCharCode(_utf16[i])}return str};this.unpackUTF8=function(_str){return this.toUTF8(this.unpackUTF16(_str))};this.packUTF8=function(_utf8){return this.packUTF16(this.toUTF16(_utf8))};this.toUTF8=function(_utf16){var utf8=[];var idx=0;var i,j,c;for(i=0;i<_utf16.length;i++){c=_utf16[i];if(c<=127){utf8[idx++]=c}else{if(c<=2047){utf8[idx++]=192|(c>>>6);utf8[idx++]=128|(c&63)}else{if(c<=65535){utf8[idx++]=224|(c>>>12);utf8[idx++]=128|((c>>>6)&63);utf8[idx++]=128|(c&63)}else{j=4;while(c>>(6*j)){j++}utf8[idx++]=((65280>>>j)&255)|(c>>>(6*--j));while(j--){utf8[idx++]=128|((c>>>(6*j))&63)}}}}}return utf8};this.toUTF16=function(_utf8){var utf16=[];var idx=0;var i,s;for(i=0;i<_utf8.length;i++,idx++){if(_utf8[i]<=127){utf16[idx]=_utf8[i]}else{if((_utf8[i]>>5)==6){utf16[idx]=((_utf8[i]&31)<<6)|(_utf8[++i]&63)}else{if((_utf8[i]>>4)==14){utf16[idx]=((_utf8[i]&15)<<12)|((_utf8[++i]&63)<<6)|(_utf8[++i]&63)}else{s=1;while(_utf8[i]&(32>>>s)){s++}utf16[idx]=_utf8[i]&(31>>>s);while(s-->=0){utf16[idx]=(utf16[idx]<<6)^(_utf8[++i]&63)}}}}}return utf16};this.URLencode=function(_str){return _str.replace(/([^a-zA-Z0-9_\-\.])/g,function(_tmp,_c){if(_c=="\x20"){return"+"}var tmp=utf.toUTF8([_c.charCodeAt(0)]);var c="";for(var i in tmp){i=tmp[i].toString(16);if(i.length==1){i="0"+i}c+="%"+i}return c})};this.URLdecode=function(_dat){_dat=_dat.replace(/\+/g,"\x20");_dat=_dat.replace(/%([a-fA-F0-9][a-fA-F0-9])/g,function(_tmp,_hex){return String.fromCharCode(parseInt(_hex,16))});return this.packChar(this.toUTF16(this.unpackUTF16(_dat)))}};bpe=0;mask=0;radix=mask+1;digitsStr="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_=!@#$%^&*()[]{}|;:,.<>/?`~ \\'\"+-";for(bpe=0;(1<<(bpe+1))>(1<<bpe);bpe++){}bpe>>=1;mask=(1<<bpe)-1;radix=mask+1;one=int2bigInt(1,1,1);t=new Array(0);ss=t;s0=t;s1=t;s2=t;s3=t;s4=t;s5=t;s6=t;s7=t;T=t;sa=t;mr_x1=t;mr_r=t;mr_a=t;eg_v=t;eg_u=t;eg_A=t;eg_B=t;eg_C=t;eg_D=t;md_q1=t;md_q2=t;md_q3=t;md_r=t;md_r1=t;md_r2=t;md_tt=t;primes=t;pows=t;s_i=t;s_i2=t;s_R=t;s_rm=t;s_q=t;s_n1=t;s_a=t;s_r2=t;s_n=t;s_b=t;s_d=t;s_x1=t;s_x2=t,s_aa=t;rpprb=t;function findPrimes(n){var i,s,p,ans;s=new Array(n);for(i=0;i<n;i++){s[i]=0}s[0]=2;p=0;for(;s[p]<n;){for(i=s[p]*s[p];i<n;i+=s[p]){s[i]=1}p++;s[p]=s[p-1]+1;for(;s[p]<n&&s[s[p]];s[p]++){}}ans=new Array(p);for(i=0;i<p;i++){ans[i]=s[i]}return ans}function millerRabinInt(x,b){if(mr_x1.length!=x.length){mr_x1=dup(x);mr_r=dup(x);mr_a=dup(x)}copyInt_(mr_a,b);return millerRabin(x,mr_a)}function millerRabin(x,b){var i,j,k,s;if(mr_x1.length!=x.length){mr_x1=dup(x);mr_r=dup(x);mr_a=dup(x)}copy_(mr_a,b);copy_(mr_r,x);copy_(mr_x1,x);addInt_(mr_r,-1);addInt_(mr_x1,-1);k=0;for(i=0;i<mr_r.length;i++){for(j=1;j<mask;j<<=1){if(x[i]&j){s=(k<mr_r.length+bpe?k:0);i=mr_r.length;j=mask}else{k++}}}if(s){rightShift_(mr_r,s)}powMod_(mr_a,mr_r,x);if(!equalsInt(mr_a,1)&&!equals(mr_a,mr_x1)){j=1;while(j<=s-1&&!equals(mr_a,mr_x1)){squareMod_(mr_a,x);if(equalsInt(mr_a,1)){return 0}j++}if(!equals(mr_a,mr_x1)){return 0}}return 1}function bitSize(x){var j,z,w;for(j=x.length-1;(x[j]==0)&&(j>0);j--){}for(z=0,w=x[j];w;(w>>=1),z++){}z+=bpe*j;return z}function expand(x,n){var ans=int2bigInt(0,(x.length>n?x.length:n)*bpe,0);copy_(ans,x);return ans}function randTruePrime(k){var ans=int2bigInt(0,k,0);randTruePrime_(ans,k);return trim(ans,1)}function randProbPrime(k){if(k>=600){return randProbPrimeRounds(k,2)}if(k>=550){return randProbPrimeRounds(k,4)}if(k>=500){return randProbPrimeRounds(k,5)}if(k>=400){return randProbPrimeRounds(k,6)}if(k>=350){return randProbPrimeRounds(k,7)}if(k>=300){return randProbPrimeRounds(k,9)}if(k>=250){return randProbPrimeRounds(k,12)}if(k>=200){return randProbPrimeRounds(k,15)}if(k>=150){return randProbPrimeRounds(k,18)}if(k>=100){return randProbPrimeRounds(k,27)}return randProbPrimeRounds(k,40)}function randProbPrimeRounds(k,n){var ans,i,divisible,B;B=30000;ans=int2bigInt(0,k,0);if(primes.length==0){primes=findPrimes(30000)}if(rpprb.length!=ans.length){rpprb=dup(ans)}for(;;){randBigInt_(ans,k,0);ans[0]|=1;divisible=0;for(i=0;(i<primes.length)&&(primes[i]<=B);i++){if(modInt(ans,primes[i])==0&&!equalsInt(ans,primes[i])){divisible=1;break}}for(i=0;i<n&&!divisible;i++){randBigInt_(rpprb,k,0);while(!greater(ans,rpprb)){randBigInt_(rpprb,k,0)}if(!millerRabin(ans,rpprb)){divisible=1}}if(!divisible){return ans}}}function mod(x,n){var ans=dup(x);mod_(ans,n);return trim(ans,1)}function addInt(x,n){var ans=expand(x,x.length+1);addInt_(ans,n);return trim(ans,1)}function mult(x,y){var ans=expand(x,x.length+y.length);mult_(ans,y);return trim(ans,1)}function powMod(x,y,n){var ans=expand(x,n.length);powMod_(ans,trim(y,2),trim(n,2),0);return trim(ans,1)}function sub(x,y){var ans=expand(x,(x.length>y.length?x.length+1:y.length+1));sub_(ans,y);return trim(ans,1)}function add(x,y){var ans=expand(x,(x.length>y.length?x.length+1:y.length+1));add_(ans,y);return trim(ans,1)}function inverseMod(x,n){var ans=expand(x,n.length);var s;s=inverseMod_(ans,n);return s?trim(ans,1):null}function multMod(x,y,n){var ans=expand(x,n.length);multMod_(ans,y,n);return trim(ans,1)}function randTruePrime_(ans,k){var c,m,pm,dd,j,r,B,divisible,z,zz,recSize;if(primes.length==0){primes=findPrimes(30000)}if(pows.length==0){pows=new Array(512);for(j=0;j<512;j++){pows[j]=Math.pow(2,j/511-1)}}c=0.1;m=20;recLimit=20;if(s_i2.length!=ans.length){s_i2=dup(ans);s_R=dup(ans);s_n1=dup(ans);s_r2=dup(ans);s_d=dup(ans);s_x1=dup(ans);s_x2=dup(ans);s_b=dup(ans);s_n=dup(ans);s_i=dup(ans);s_rm=dup(ans);s_q=dup(ans);s_a=dup(ans);s_aa=dup(ans)}if(k<=recLimit){pm=(1<<((k+2)>>1))-1;copyInt_(ans,0);for(dd=1;dd;){dd=0;ans[0]=1|(1<<(k-1))|Math.floor(Math.random()*(1<<k));for(j=1;(j<primes.length)&&((primes[j]&pm)==primes[j]);j++){if(0==(ans[0]%primes[j])){dd=1;break}}}carry_(ans);return}B=c*k*k;if(k>2*m){for(r=1;k-k*r<=m;){r=pows[Math.floor(Math.random()*512)]}}else{r=0.5}recSize=Math.floor(r*k)+1;randTruePrime_(s_q,recSize);copyInt_(s_i2,0);s_i2[Math.floor((k-2)/bpe)]|=(1<<((k-2)%bpe));divide_(s_i2,s_q,s_i,s_rm);z=bitSize(s_i);for(;;){for(;;){randBigInt_(s_R,z,0);if(greater(s_i,s_R)){break}}addInt_(s_R,1);add_(s_R,s_i);copy_(s_n,s_q);mult_(s_n,s_R);multInt_(s_n,2);addInt_(s_n,1);copy_(s_r2,s_R);multInt_(s_r2,2);for(divisible=0,j=0;(j<primes.length)&&(primes[j]<B);j++){if(modInt(s_n,primes[j])==0&&!equalsInt(s_n,primes[j])){divisible=1;break}}if(!divisible){if(!millerRabinInt(s_n,2)){divisible=1}}if(!divisible){addInt_(s_n,-3);for(j=s_n.length-1;(s_n[j]==0)&&(j>0);j--){}for(zz=0,w=s_n[j];w;(w>>=1),zz++){}zz+=bpe*j;for(;;){randBigInt_(s_a,zz,0);if(greater(s_n,s_a)){break}}addInt_(s_n,3);addInt_(s_a,2);copy_(s_b,s_a);copy_(s_n1,s_n);addInt_(s_n1,-1);powMod_(s_b,s_n1,s_n);addInt_(s_b,-1);if(isZero(s_b)){copy_(s_b,s_a);powMod_(s_b,s_r2,s_n);addInt_(s_b,-1);copy_(s_aa,s_n);copy_(s_d,s_b);GCD_(s_d,s_n);if(equalsInt(s_d,1)){copy_(ans,s_aa);return}}}}}function randBigInt(n,s){var a,b;a=Math.floor((n-1)/bpe)+2;b=int2bigInt(0,0,a);randBigInt_(b,n,s);return b}function randBigInt_(b,n,s){var i,a;for(i=0;i<b.length;i++){b[i]=0}a=Math.floor((n-1)/bpe)+1;for(i=0;i<a;i++){b[i]=Math.floor(Math.random()*(1<<(bpe-1)))}b[a-1]&=(2<<((n-1)%bpe))-1;if(s==1){b[a-1]|=(1<<((n-1)%bpe))}}function GCD(x,y){var xc,yc;xc=dup(x);yc=dup(y);GCD_(xc,yc);return xc}function GCD_(x,y){var i,xp,yp,A,B,C,D,q,sing;if(T.length!=x.length){T=dup(x)}sing=1;while(sing){sing=0;for(i=1;i<y.length;i++){if(y[i]){sing=1;break}}if(!sing){break}for(i=x.length;!x[i]&&i>=0;i--){}xp=x[i];yp=y[i];A=1;B=0;C=0;D=1;while((yp+C)&&(yp+D)){q=Math.floor((xp+A)/(yp+C));qp=Math.floor((xp+B)/(yp+D));if(q!=qp){break}t=A-q*C;A=C;C=t;t=B-q*D;B=D;D=t;t=xp-q*yp;xp=yp;yp=t}if(B){copy_(T,x);linComb_(x,y,A,B);linComb_(y,T,D,C)}else{mod_(x,y);copy_(T,x);copy_(x,y);copy_(y,T)}}if(y[0]==0){return}t=modInt(x,y[0]);copyInt_(x,y[0]);y[0]=t;while(y[0]){x[0]%=y[0];t=x[0];x[0]=y[0];y[0]=t}}function inverseMod_(x,n){var k=1+2*Math.max(x.length,n.length);if(!(x[0]&1)&&!(n[0]&1)){copyInt_(x,0);return 0}if(eg_u.length!=k){eg_u=new Array(k);eg_v=new Array(k);eg_A=new Array(k);eg_B=new Array(k);eg_C=new Array(k);eg_D=new Array(k)}copy_(eg_u,x);copy_(eg_v,n);copyInt_(eg_A,1);copyInt_(eg_B,0);copyInt_(eg_C,0);copyInt_(eg_D,1);for(;;){while(!(eg_u[0]&1)){halve_(eg_u);if(!(eg_A[0]&1)&&!(eg_B[0]&1)){halve_(eg_A);halve_(eg_B)}else{add_(eg_A,n);halve_(eg_A);sub_(eg_B,x);halve_(eg_B)}}while(!(eg_v[0]&1)){halve_(eg_v);if(!(eg_C[0]&1)&&!(eg_D[0]&1)){halve_(eg_C);halve_(eg_D)}else{add_(eg_C,n);halve_(eg_C);sub_(eg_D,x);halve_(eg_D)}}if(!greater(eg_v,eg_u)){sub_(eg_u,eg_v);sub_(eg_A,eg_C);sub_(eg_B,eg_D)}else{sub_(eg_v,eg_u);sub_(eg_C,eg_A);sub_(eg_D,eg_B)}if(equalsInt(eg_u,0)){if(negative(eg_C)){add_(eg_C,n)}copy_(x,eg_C);if(!equalsInt(eg_v,1)){copyInt_(x,0);return 0}return 1}}}function inverseModInt(x,n){var a=1,b=0,t;for(;;){if(x==1){return a}if(x==0){return 0}b-=a*Math.floor(n/x);n%=x;if(n==1){return b}if(n==0){return 0}a-=b*Math.floor(x/n);x%=n}}function inverseModInt_(x,n){return inverseModInt(x,n)}function eGCD_(x,y,v,a,b){var g=0;var k=Math.max(x.length,y.length);if(eg_u.length!=k){eg_u=new Array(k);eg_A=new Array(k);eg_B=new Array(k);eg_C=new Array(k);eg_D=new Array(k)}while(!(x[0]&1)&&!(y[0]&1)){halve_(x);halve_(y);g++}copy_(eg_u,x);copy_(v,y);copyInt_(eg_A,1);copyInt_(eg_B,0);copyInt_(eg_C,0);copyInt_(eg_D,1);for(;;){while(!(eg_u[0]&1)){halve_(eg_u);if(!(eg_A[0]&1)&&!(eg_B[0]&1)){halve_(eg_A);halve_(eg_B)}else{add_(eg_A,y);halve_(eg_A);sub_(eg_B,x);halve_(eg_B)}}while(!(v[0]&1)){halve_(v);if(!(eg_C[0]&1)&&!(eg_D[0]&1)){halve_(eg_C);halve_(eg_D)}else{add_(eg_C,y);halve_(eg_C);sub_(eg_D,x);halve_(eg_D)}}if(!greater(v,eg_u)){sub_(eg_u,v);sub_(eg_A,eg_C);sub_(eg_B,eg_D)}else{sub_(v,eg_u);sub_(eg_C,eg_A);sub_(eg_D,eg_B)}if(equalsInt(eg_u,0)){if(negative(eg_C)){add_(eg_C,y);sub_(eg_D,x)}multInt_(eg_D,-1);copy_(a,eg_C);copy_(b,eg_D);leftShift_(v,g);return}}}function negative(x){return((x[x.length-1]>>(bpe-1))&1)}function greaterShift(x,y,shift){var i,kx=x.length,ky=y.length;k=((kx+shift)<ky)?(kx+shift):ky;for(i=ky-1-shift;i<kx&&i>=0;i++){if(x[i]>0){return 1}}for(i=kx-1+shift;i<ky;i++){if(y[i]>0){return 0}}for(i=k-1;i>=shift;i--){if(x[i-shift]>y[i]){return 1}else{if(x[i-shift]<y[i]){return 0}}}return 0}function greater(x,y){var i;var k=(x.length<y.length)?x.length:y.length;for(i=x.length;i<y.length;i++){if(y[i]){return 0}}for(i=y.length;i<x.length;i++){if(x[i]){return 1}}for(i=k-1;i>=0;i--){if(x[i]>y[i]){return 1}else{if(x[i]<y[i]){return 0}}}return 0}function divide_(x,y,q,r){var kx,ky;var i,j,y1,y2,c,a,b;copy_(r,x);for(ky=y.length;y[ky-1]==0;ky--){}b=y[ky-1];for(a=0;b;a++){b>>=1}a=bpe-a;leftShift_(y,a);leftShift_(r,a);for(kx=r.length;r[kx-1]==0&&kx>ky;kx--){}copyInt_(q,0);while(!greaterShift(y,r,kx-ky)){subShift_(r,y,kx-ky);q[kx-ky]++}for(i=kx-1;i>=ky;i--){if(r[i]==y[ky-1]){q[i-ky]=mask}else{q[i-ky]=Math.floor((r[i]*radix+r[i-1])/y[ky-1])}for(;;){y2=(ky>1?y[ky-2]:0)*q[i-ky];c=y2>>bpe;y2=y2&mask;y1=c+q[i-ky]*y[ky-1];c=y1>>bpe;y1=y1&mask;if(c==r[i]?y1==r[i-1]?y2>(i>1?r[i-2]:0):y1>r[i-1]:c>r[i]){q[i-ky]--}else{break}}linCombShift_(r,y,-q[i-ky],i-ky);if(negative(r)){addShift_(r,y,i-ky);q[i-ky]--}}rightShift_(y,a);rightShift_(r,a)}function carry_(x){var i,k,c,b;k=x.length;c=0;for(i=0;i<k;i++){c+=x[i];b=0;if(c<0){b=-(c>>bpe);c+=b*radix}x[i]=c&mask;c=(c>>bpe)-b}}function modInt(x,n){var i,c=0;for(i=x.length-1;i>=0;i--){c=(c*radix+x[i])%n}return c}function int2bigInt(t,bits,minSize){var i,k;k=Math.ceil(bits/bpe)+1;k=minSize>k?minSize:k;buff=new Array(k);copyInt_(buff,t);return buff}function str2bigInt(s,base,minSize){var d,i,j,x,y,kk;var k=s.length;if(base==-1){x=new Array(0);for(;;){y=new Array(x.length+1);for(i=0;i<x.length;i++){y[i+1]=x[i]}y[0]=parseInt(s,10);x=y;d=s.indexOf(",",0);if(d<1){break}s=s.substring(d+1);if(s.length==0){break}}if(x.length<minSize){y=new Array(minSize);copy_(y,x);return y}return x}x=int2bigInt(0,base*k,0);for(i=0;i<k;i++){d=digitsStr.indexOf(s.substring(i,i+1),0);if(base<=36&&d>=36){d-=26}if(d>=base||d<0){break}multInt_(x,base);addInt_(x,d)}for(k=x.length;k>0&&!x[k-1];k--){}k=minSize>k+1?minSize:k+1;y=new Array(k);kk=k<x.length?k:x.length;for(i=0;i<kk;i++){y[i]=x[i]}for(;i<k;i++){y[i]=0}return y}function equalsInt(x,y){var i;if(x[0]!=y){return 0}for(i=1;i<x.length;i++){if(x[i]){return 0}}return 1}function equals(x,y){var i;var k=x.length<y.length?x.length:y.length;for(i=0;i<k;i++){if(x[i]!=y[i]){return 0}}if(x.length>y.length){for(;i<x.length;i++){if(x[i]){return 0}}}else{for(;i<y.length;i++){if(y[i]){return 0}}}return 1}function isZero(x){var i;for(i=0;i<x.length;i++){if(x[i]){return 0}}return 1}function bigInt2str(x,base){var i,t,s="";if(s6.length!=x.length){s6=dup(x)}else{copy_(s6,x)}if(base==-1){for(i=x.length-1;i>0;i--){s+=x[i]+","}s+=x[0]}else{while(!isZero(s6)){t=divInt_(s6,base);s=digitsStr.substring(t,t+1)+s}}if(s.length==0){s="0"}return s}function dup(x){var i;buff=new Array(x.length);copy_(buff,x);return buff}function copy_(x,y){var i;var k=x.length<y.length?x.length:y.length;for(i=0;i<k;i++){x[i]=y[i]}for(i=k;i<x.length;i++){x[i]=0}}function copyInt_(x,n){var i,c;for(c=n,i=0;i<x.length;i++){x[i]=c&mask;c>>=bpe}}function addInt_(x,n){var i,k,c,b;x[0]+=n;k=x.length;c=0;for(i=0;i<k;i++){c+=x[i];b=0;if(c<0){b=-(c>>bpe);c+=b*radix}x[i]=c&mask;c=(c>>bpe)-b;if(!c){return}}}function rightShift_(x,n){var i;var k=Math.floor(n/bpe);if(k){for(i=0;i<x.length-k;i++){x[i]=x[i+k]}for(;i<x.length;i++){x[i]=0}n%=bpe}for(i=0;i<x.length-1;i++){x[i]=mask&((x[i+1]<<(bpe-n))|(x[i]>>n))}x[i]>>=n}function halve_(x){var i;for(i=0;i<x.length-1;i++){x[i]=mask&((x[i+1]<<(bpe-1))|(x[i]>>1))}x[i]=(x[i]>>1)|(x[i]&(radix>>1))}function leftShift_(x,n){var i;var k=Math.floor(n/bpe);if(k){for(i=x.length;i>=k;i--){x[i]=x[i-k]}for(;i>=0;i--){x[i]=0}n%=bpe}if(!n){return}for(i=x.length-1;i>0;i--){x[i]=mask&((x[i]<<n)|(x[i-1]>>(bpe-n)))}x[i]=mask&(x[i]<<n)}function multInt_(x,n){var i,k,c,b;if(!n){return}k=x.length;c=0;for(i=0;i<k;i++){c+=x[i]*n;b=0;if(c<0){b=-(c>>bpe);c+=b*radix}x[i]=c&mask;c=(c>>bpe)-b}}function divInt_(x,n){var i,r=0,s;for(i=x.length-1;i>=0;i--){s=r*radix+x[i];x[i]=Math.floor(s/n);r=s%n}return r}function linComb_(x,y,a,b){var i,c,k,kk;k=x.length<y.length?x.length:y.length;kk=x.length;for(c=0,i=0;i<k;i++){c+=a*x[i]+b*y[i];x[i]=c&mask;c>>=bpe}for(i=k;i<kk;i++){c+=a*x[i];x[i]=c&mask;c>>=bpe}}function linCombShift_(x,y,b,ys){var i,c,k,kk;k=x.length<ys+y.length?x.length:ys+y.length;kk=x.length;for(c=0,i=ys;i<k;i++){c+=x[i]+b*y[i-ys];x[i]=c&mask;c>>=bpe}for(i=k;c&&i<kk;i++){c+=x[i];x[i]=c&mask;c>>=bpe}}function addShift_(x,y,ys){var i,c,k,kk;k=x.length<ys+y.length?x.length:ys+y.length;kk=x.length;for(c=0,i=ys;i<k;i++){c+=x[i]+y[i-ys];x[i]=c&mask;c>>=bpe}for(i=k;c&&i<kk;i++){c+=x[i];x[i]=c&mask;c>>=bpe}}function subShift_(x,y,ys){var i,c,k,kk;k=x.length<ys+y.length?x.length:ys+y.length;kk=x.length;for(c=0,i=ys;i<k;i++){c+=x[i]-y[i-ys];x[i]=c&mask;c>>=bpe}for(i=k;c&&i<kk;i++){c+=x[i];x[i]=c&mask;c>>=bpe}}function sub_(x,y){var i,c,k,kk;k=x.length<y.length?x.length:y.length;for(c=0,i=0;i<k;i++){c+=x[i]-y[i];x[i]=c&mask;c>>=bpe}for(i=k;c&&i<x.length;i++){c+=x[i];x[i]=c&mask;c>>=bpe}}function add_(x,y){var i,c,k,kk;k=x.length<y.length?x.length:y.length;for(c=0,i=0;i<k;i++){c+=x[i]+y[i];x[i]=c&mask;c>>=bpe}for(i=k;c&&i<x.length;i++){c+=x[i];x[i]=c&mask;c>>=bpe}}function mult_(x,y){var i;if(ss.length!=2*x.length){ss=new Array(2*x.length)}copyInt_(ss,0);for(i=0;i<y.length;i++){if(y[i]){linCombShift_(ss,x,y[i],i)}}copy_(x,ss)}function mod_(x,n){if(s4.length!=x.length){s4=dup(x)}else{copy_(s4,x)}if(s5.length!=x.length){s5=dup(x)}divide_(s4,n,s5,x)}function multMod_(x,y,n){var i;if(s0.length!=2*x.length){s0=new Array(2*x.length)}copyInt_(s0,0);for(i=0;i<y.length;i++){if(y[i]){linCombShift_(s0,x,y[i],i)}}mod_(s0,n);copy_(x,s0)}function squareMod_(x,n){var i,j,d,c,kx,kn,k;for(kx=x.length;kx>0&&!x[kx-1];kx--){}k=kx>n.length?2*kx:2*n.length;if(s0.length!=k){s0=new Array(k)}copyInt_(s0,0);for(i=0;i<kx;i++){c=s0[2*i]+x[i]*x[i];s0[2*i]=c&mask;c>>=bpe;for(j=i+1;j<kx;j++){c=s0[i+j]+2*x[i]*x[j]+c;s0[i+j]=(c&mask);c>>=bpe}s0[i+kx]=c}mod_(s0,n);copy_(x,s0)}function trim(x,k){var i,y;for(i=x.length;i>0&&!x[i-1];i--){}y=new Array(i+k);copy_(y,x);return y}function powMod_(x,y,n){var k1,k2,kn,np;if(s7.length!=n.length){s7=dup(n)}if((n[0]&1)==0){copy_(s7,x);copyInt_(x,1);while(!equalsInt(y,0)){if(y[0]&1){multMod_(x,s7,n)}divInt_(y,2);squareMod_(s7,n)}return}copyInt_(s7,0);for(kn=n.length;kn>0&&!n[kn-1];kn--){}np=radix-inverseModInt(modInt(n,radix),radix);s7[kn]=1;multMod_(x,s7,n);if(s3.length!=x.length){s3=dup(x)}else{copy_(s3,x)}for(k1=y.length-1;k1>0&!y[k1];k1--){}if(y[k1]==0){copyInt_(x,1);return}for(k2=1<<(bpe-1);k2&&!(y[k1]&k2);k2>>=1){}for(;;){if(!(k2>>=1)){k1--;if(k1<0){mont_(x,one,n,np);return}k2=1<<(bpe-1)}mont_(x,x,n,np);if(k2&y[k1]){mont_(x,s3,n,np)}}}function mont_(x,y,n,np){var i,j,c,ui,t,ks;var kn=n.length;var ky=y.length;if(sa.length!=kn){sa=new Array(kn)}copyInt_(sa,0);for(;kn>0&&n[kn-1]==0;kn--){}for(;ky>0&&y[ky-1]==0;ky--){}ks=sa.length-1;for(i=0;i<kn;i++){t=sa[0]+x[i]*y[0];ui=((t&mask)*np)&mask;c=(t+ui*n[0])>>bpe;t=x[i];j=1;for(;j<ky-4;){c+=sa[j]+ui*n[j]+t*y[j];sa[j-1]=c&mask;c>>=bpe;j++;c+=sa[j]+ui*n[j]+t*y[j];sa[j-1]=c&mask;c>>=bpe;j++;c+=sa[j]+ui*n[j]+t*y[j];sa[j-1]=c&mask;c>>=bpe;j++;c+=sa[j]+ui*n[j]+t*y[j];sa[j-1]=c&mask;c>>=bpe;j++;c+=sa[j]+ui*n[j]+t*y[j];sa[j-1]=c&mask;c>>=bpe;j++}for(;j<ky;){c+=sa[j]+ui*n[j]+t*y[j];sa[j-1]=c&mask;c>>=bpe;j++}for(;j<kn-4;){c+=sa[j]+ui*n[j];sa[j-1]=c&mask;c>>=bpe;j++;c+=sa[j]+ui*n[j];sa[j-1]=c&mask;c>>=bpe;j++;c+=sa[j]+ui*n[j];sa[j-1]=c&mask;c>>=bpe;j++;c+=sa[j]+ui*n[j];sa[j-1]=c&mask;c>>=bpe;j++;c+=sa[j]+ui*n[j];sa[j-1]=c&mask;c>>=bpe;j++}for(;j<kn;){c+=sa[j]+ui*n[j];sa[j-1]=c&mask;c>>=bpe;j++}for(;j<ks;){c+=sa[j];sa[j-1]=c&mask;c>>=bpe;j++}sa[j-1]=c&mask}if(!greater(n,sa)){sub_(sa,n)}copy_(x,sa)}var w;blowfish=new function(){var utfLibName="utf";var def_mode="ecb";var def_padChar="\x05";var def_round=16;var blockLen=8;var keyLen=56;var keyz=[];var tmpBlk=[];var S=[];var P=[];var enc={};var dec={};var rTime=def_round;var argKeyz=["data","key","mode","iv","round","pchar"];var argDKeyz=[argKeyz[0],argKeyz[1],argKeyz[2],argKeyz[4],argKeyz[5]];this.binMode=0;this.mkIV=function(_len){if(!_len||isNaN(_len)){_len=blockLen}var iv="";while(_len--){iv+=String.fromCharCode(Math.floor(Math.random()*255))}return iv};this.mkKey=function(_len){if(!_len||isNaN(_len)){_len=keyLen}var k="";while(_len--){k+=String.fromCharCode(parseInt(Math.random()*80)+32)}return k};this.encrypt=function(){var arg=initArg(arguments,"encrypt",this.binMode);keyUpdate(arg.keyz);tmpBlk=arg.ivz;rTime=checkRound(arg.round);var i,edat="";for(i=0;i<arg.datz.length;i+=blockLen){edat+=packChar(enc[arg.mode](arg.datz.slice(i,i+blockLen)))}return arg.iv+edat};this.decrypt=function(){var arg=initArg(arguments,"decrypt");keyUpdate(arg.keyz);tmpBlk=arg.ivz;rTime=checkRound(arg.round);var i,edat=[];for(i=0;i<arg.datz.length;i+=blockLen){edat=edat.concat(dec[arg.mode](arg.datz.slice(i,i+blockLen)))}return(this.binMode?packChar(edat):packUTF8(edat)).replace(new RegExp(arg.pchar+"+$"),"")};dec.ecb=function(_blk){return round(_blk)};enc.ecb=function(_blk){return re_round(_blk)};enc.cbc=function(_blk){return tmpBlk=round(xor(_blk,tmpBlk))};dec.cbc=function(_blk){var tmp=_blk;_blk=xor(re_round(_blk),tmpBlk);tmpBlk=tmp;return _blk};enc.cfb=function(_blk){return tmpBlk=xor(round(tmpBlk),_blk)};dec.cfb=function(_blk){var tmp=xor(round(tmpBlk),_blk);tmpBlk=_blk;return tmp};enc.ofb=function(_blk){tmpBlk=round(tmpBlk);return xor(tmpBlk,_blk)};dec.ofb=function(_blk){tmpBlk=round(tmpBlk);return xor(tmpBlk,_blk)};var initArg=function(_arg,_encrypt,_bin){var val={};var padDatz=1;var padKeyz=0;var i;var isStr=new Function("_x","return typeof(_x) == typeof('string')");_encrypt=!!(_encrypt&&_encrypt.match(/^enc/i)!==null);var aks=_encrypt?argKeyz:argDKeyz;if(typeof(_arg[0])==typeof(val)){val=_arg[0]}else{for(i=0;i<_arg.length;i++){val[aks[i]]=_arg[i]}}if(!isStr(val.pchar)){val.pchar=def_padChar}var tmpPChar=unpackChar(val.pchar);if(!isStr(val.mode)||val.mode.match(/^(ecb|cbc|ofb|cfb)$/i)===null){val.mode=def_mode}val.mode=val.mode.toLowerCase();if(!isStr(val.key)){val.key="\0"}val.keyz=unpackChar(val.key);if(padKeyz){for(i=val.keyz.length;i<keyLen;i++){val.keyz[i]=0}}if(!_encrypt||_bin){val.datz=unpackChar(val.data)}else{val.datz=unpackUTF8(val.data)}if(_encrypt&&padDatz){for(i=val.datz.length%blockLen;i<blockLen;i++){val.datz[val.datz.length]=tmpPChar}}if(val.mode=="ecb"){val.iv="";val.ivz=[]}else{if(_encrypt){if(!isStr(val.iv)){val.iv=""}val.ivz=unpackChar(val.iv);for(i=val.ivz.length;i<blockLen;i++){val.ivz[i]=0}val.ivz.length=blockLen;val.iv=packChar(val.ivz)}else{val.ivz=val.datz.slice(0,blockLen);val.datz=val.datz.slice(blockLen)}}return val};var xor=function(_a,_b){var i,tmp=[];for(i=0;i<_a.length;i++){tmp[i]=_a[i]^_b[i]}return tmp};var packUTF8=function(_x){return window[utfLibName].packUTF8(_x)};var unpackUTF8=function(_x){return window[utfLibName].unpackUTF8(_x)};var packChar=function(_x){return window[utfLibName].packChar(_x)};var unpackChar=function(_x){return window[utfLibName].unpackChar(_x)};var toBigEndian32=function(_x){var i,tmp=[];for(i=0;i<_x.length;i+=4){tmp[i/4]=(_x[i]<<24)|(_x[i+1]<<16)|(_x[i+2]<<8)|_x[i+3]}return tmp};var fromBigEndian32=function(_x){var i,tmp=[];for(i=0;i<_x.length;i++){tmp[i*4]=(_x[i]>>>24)&255;tmp[i*4+1]=(_x[i]>>>16)&255;tmp[i*4+2]=(_x[i]>>>8)&255;tmp[i*4+3]=_x[i]&255}return tmp};var round=function(_blk,_32){var xl,xr;if(_32){xl=_blk[0];xr=_blk[1]}else{xl=toBigEndian32(_blk.slice(0,4));xr=toBigEndian32(_blk.slice(4))}var i,tmp;for(i=0;i<rTime;i++){xl^=P[i];xr^=f(xl);tmp=xl;xl=xr;xr=tmp}tmp=xl;xl=xr^P[rTime+1];xr=tmp^P[rTime];if(_32){return[xl,xr]}else{return fromBigEndian32([xl,xr])}};var re_round=function(_blk){var xl=toBigEndian32(_blk.slice(0,4));var xr=toBigEndian32(_blk.slice(4));var i,tmp;for(i=rTime+1;i>1;i--){xl^=P[i];xr^=f(xl);tmp=xl;xl=xr;xr=tmp}tmp=xl;xl=xr^P[0];xr=tmp^P[1];return fromBigEndian32([xl,xr])};var f=function(_x){return((S[0][(_x>>>24)&255]+S[1][(_x>>>16)&255])^S[2][(_x>>>8)&255])+S[3][_x&255]};var keyUpdate=function(_key){var keyLen=_key.length;var i,j,tmp;var tmpD=[0,0];initVal();for(j=i=0;i<18;i++){for(tmp=k=0;k<4;k++,j++){tmp=(tmp<<8)|_key[j%keyLen]}P[i]^=tmp}for(i=0;i<18;i+=2){tmpD=round(tmpD,1);P[i]=tmpD[0];P[i+1]=tmpD[1]}for(i=0;i<4;i++){for(j=0;j<=255;j+=2){tmpD=round(tmpD,1);S[i][j]=tmpD[0];S[i][j+1]=tmpD[1]}}};var checkRound=function(_r){if(!_r||isNaN(_r)||_r>16){_r=def_round}return _r};var initVal=function(){P=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731];S=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,2909710000,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409000,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]]}};md5=new function(){var blockLen=64;var state=[1732584193,4023233417,2562383102,271733878];var sttLen=state.length;this.hex=function(_data){return toHex(getMD(_data))};this.dec=function(_data){return getMD(_data)};this.bin=function(_data){return pack(getMD(_data))};var getMD=function(_data){var datz=[];if(isAry(_data)){datz=_data}else{if(isStr(_data)){datz=unpack(_data)}else{"unknown type"}}datz=paddingData(datz);return round(datz)};var isAry=function(_ary){return _ary&&_ary.constructor===[].constructor};var isStr=function(_str){return typeof(_str)==typeof("string")};var round=function(_blk){var stt=[];var tmpS=[];var i,j,tmp,x=[];for(j=0;j<sttLen;j++){stt[j]=state[j]}for(i=0;i<_blk.length;i+=blockLen){for(j=0;j<sttLen;j++){tmpS[j]=stt[j]}x=toLittleEndian32(_blk.slice(i,i+blockLen));for(j=0;j<64;j++){if(j<16){tmp=(stt[1]&stt[2])|(~stt[1]&stt[3])}else{if(j<32){tmp=(stt[1]&stt[3])|(stt[2]&~stt[3])}else{if(j<48){tmp=stt[1]^stt[2]^stt[3]}else{tmp=stt[2]^(stt[1]|~stt[3])}}}tmp+=x[K[j]]+T[j]+stt[0];stt[0]=stt[1]+((tmp<<S[j])|(tmp>>>(32-S[j])));stt=[stt[3],stt[0],stt[1],stt[2]]}for(j=0;j<sttLen;j++){stt[j]+=tmpS[j]}}return fromLittleEndian32(stt)};var paddingData=function(_datz){var datLen=_datz.length;var n=datLen;_datz[n++]=128;while(n%blockLen!=56){_datz[n++]=0}datLen*=8;return _datz.concat(fromLittleEndian32([datLen]),0,0,0,0)};var toHex=function(_decz){var i,hex="";for(i=0;i<_decz.length;i++){hex+=(_decz[i]>15?"":"0")+_decz[i].toString(16)}return hex};var fromLittleEndian32=function(_blk){var tmp=[];for(n=i=0;i<_blk.length;i++){tmp[n++]=_blk[i]&255;tmp[n++]=(_blk[i]>>>8)&255;tmp[n++]=(_blk[i]>>>16)&255;tmp[n++]=(_blk[i]>>>24)&255}return tmp};var toLittleEndian32=function(_blk){var tmp=[];var i,n;for(n=i=0;i<_blk.length;i+=4,n++){tmp[n]=(_blk[i+3]<<24)|(_blk[i+2]<<16)|(_blk[i+1]<<8)|_blk[i]}return tmp};var unpack=function(_dat){var i,n,c,tmp=[];for(n=i=0;i<_dat.length;i++){c=_dat.charCodeAt(i);if(c<=255){tmp[n++]=c}else{tmp[n++]=c>>>8;tmp[n++]=c&255}}return tmp};var pack=function(_ary){var i,tmp="";for(i in _ary){tmp+=String.fromCharCode(_ary[i])}return tmp};var K=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9];var S=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21];var T=[3614090360,3905402710,606105819,3250441966,4118548399,1200080426,2821735955,4249261313,1770035416,2336552879,4294925233,2304563134,1804603682,4254626195,2792965006,1236535329,4129170786,3225465664,643717713,3921069994,3593408605,38016083,3634488961,3889429448,568446438,3275163606,4107603335,1163531501,2850285829,4243563512,1735328473,2368359562,4294588738,2272392833,1839030562,4259657740,2763975236,1272893353,4139469664,3200236656,681279174,3936430074,3572445317,76029189,3654602809,3873151461,530742520,3299628645,4096336452,1126891415,2878612391,4237533241,1700485571,2399980690,4293915773,2240044497,1873313359,4264355552,2734768916,1309151649,4149444226,3174756917,718787259,3951481745]};if(!window.epson){window.epson={}}window.epson.ePOSDevice=ePOSDevice})(window);
|
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Adyen_Payment</name>
|
4 |
-
<version>2.
|
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>
|
@@ -9,39 +9,41 @@
|
|
9 |
<summary>Magento Plugin for Payment service provider Adyen</summary>
|
10 |
<description>Magento Plugin for Payment Service Provider Adyen. The plugin supports the Magento Community and Enterprise edition. Inhouse support on magento@adyen.com as well available through GitHub on https://github.com/adyenpayments/magento</description>
|
11 |
<notes>Features:
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
|
|
27 |

|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
</notes>
|
41 |
<authors><author><name>Adyen</name><user>adyen</user><email>magento@adyen.com</email></author></authors>
|
42 |
-
<date>
|
43 |
-
<time>13:
|
44 |
-
<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="51ccb4688de33d2d2ab680c3805a49e3"/><file name="Elv.php" hash="c3de45c9161b1564209b79a80140fec3"/><file name="Hpp.php" hash="afe655b84cfbdddde988725c4cee2740"/><file name="Oneclick.php" hash="f1d4c1bba402e2da141373209693b927"/><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="6068acbb3d3dec90a797390871150956"/><file name="Cc.php" hash="9861c34ed4eee0d0b22d66c9b9a0b9ad"/><file name="Elv.php" hash="09a10412250e2bed303a189cfb216254"/><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="2f6fbcfeb770a208abc9c8dd4cd1a613"/></dir><file name="PosExpressCheckout.php" hash="7ba0d55c5db72b602555ae3c45da4d13"/><file name="Redirect.php" hash="1b889330908cc61aaf9ba4731c05d84c"/><dir name="Sales"><dir name="Order"><file name="Totals.php" hash="a39a86ab4e7f49a91c0d3ef37a37d45a"/></dir></dir><file name="SavedCards.php" hash="3fe47b88678d0c30aa3fc6b2b9592eae"/><file name="ScanProduct.php" hash="31c08b14b9e17a8f065b7d553470d518"/></dir><dir name="Helper"><file name="Data.php" hash="667547930c09310cd6eae4ba8bedce49"/><file name="Installments.php" hash="dfa5b59503843388869fb5e05a3429e8"/></dir><dir name="Model"><dir name="Adyen"><file name="Abstract.php" hash="0d8c81f4c2d16ad8b15d61dd55b92c95"/><file name="Boleto.php" hash="e92f38062af2dcc766161ce2e92d9fac"/><file name="Cc.php" hash="f534ec37e51137dc625234e507cf29bd"/><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="caa2f530ea8a2100fee55f9d16fa8235"/><file name="ModificationRequest.php" hash="35877a23e1159cae3b9a1b4687e1a663"/><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="175ded3287bfec672c0d815078c2a744"/><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="381fb948b18cea9910093a455bf28815"/><file name="Ideal.php" hash="8359f4eb5c28363680c08ecbc88a28a5"/><file name="Oneclick.php" hash="fd17671dd0d6fdd849da02013f33b3ac"/><file name="Openinvoice.php" hash="0306be4843a9c4f372ccc954d41900dd"/><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="584b4cfc2a80d275c6c8592bf02c9b48"/><dir name="Mysql4"><dir name="Adyen"><dir name="Debug"><file name="Collection.php" hash="dee84aa1c2b370a72d79031a09b9bba4"/></dir><file name="Debug.php" hash="123808b460f70ad416ed9bb92e6a1d60"/><dir name="Event"><file name="Collection.php" hash="42557a95b574a2cbebaf9915a182c554"/></dir><file name="Event.php" hash="ea832389ca8f4fbb116155b9ef7889f1"/></dir><file name="Order.php" hash="05c5ce3b68f877b23d1396d13db18517"/><file name="Setup.php" hash="45997ed47c197cb302d6fbb684489201"/></dir><file name="Observer.php" hash="e7ac9e06f582e7c150b13dec41c99c31"/><file name="Process.php" hash="1beded3781535d0c86ed923f5fe11794"/><dir name="Sales"><dir name="Quote"><dir name="Address"><dir name="Total"><file name="PaymentFee.php" hash="f14a964cb2cba6b7f6fcf6162b8a91fd"/><file name="PaymentInstallmentFee.php" hash="1e794cd1cbfebd097ff43faf624138ce"/></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"/><file name="SepaFlow.php" hash="64e6fd9181772db70e3dfc012c117a46"/><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="CheckoutCashController.php" hash="6ff54e58a6797d6e87c733e466f777f7"/><file name="CheckoutPosController.php" hash="c7efe60bb75c06fb279fc051597a37b8"/><file name="GetInstallmentsController.php" hash="e46511c8759a6cd064d90f79af5f97c3"/><file name="ProcessController.php" hash="bedf96280c94d0f747fc7ff4f8efe193"/><file name="SavedCardController.php" hash="1f96ef803a29c754159e440c2a8e701d"/><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="4190412f599a3eac827d7ed0931754da"/><file name="config.xml" hash="e9619d6adddbae175cd98787d29da0de"/><file name="system.xml" hash="be5ace7957e71d74e3f4917d657618a8"/></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="8a387d0ed76f7cabfbc3331dd1caead3"/></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="7f2e27f6067aed385d5b07abbe7988ce"/><file name="elv.phtml" hash="7a6b627e0c6acd04497d52f5047e930a"/><file name="hpp.phtml" hash="6f216fcc9e05b8f8c7176f4f0f86578f"/><file name="openinvoice.phtml" hash="46550d1d3dbe0a92c89dd6272f5d9104"/><file name="pos.phtml" hash="a5b175023f0670409122876074d6f050"/><file name="sepa.phtml" hash="49f960b088e563135860774517fbcdfe"/></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=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></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"><dir name="onepage"><dir name="payment"><file name="methods.phtml" hash="fc92a82fe2faffa7657683212e517542"/></dir></dir><file name="success.phtml" hash="56c5bdd54f9cbed22be7afe0deedead4"/></dir><dir name="form"><file name="boleto.phtml" hash="21b6c7d06dfef2bb9f8de8205bc2c6a9"/><file name="cc.phtml" hash="864d9bac115acb5e43883a0fd5810587"/><file name="elv.phtml" hash="789610e3d1f8973f6aecb4ef119a59c9"/><file name="hpp.phtml" hash="c091a1049c8d13d75cbc58100cf16e43"/><file name="oneclick.phtml" hash="ae32df3c77c06142536c70a4a181a729"/><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="8999dfee0c638f44b5010779b8bbf711"/><file name="openinvoice.phtml" hash="2bcd711e1255923d53f353819e19529e"/><file name="pos.phtml" hash="9b917920aa1cc77c9e8c3a26943b1335"/><file name="sepa.phtml" hash="c886a3d9923c3ade6ca5056f18c1b856"/></dir><file name="posExpressCheckout.phtml" hash="46c4450207f7f587ca84d2d23b9521f8"/><file name="savedCards.phtml" hash="b0777660cdd38c3a6c5ec7b5d24acd92"/><file name="scanProduct.phtml" hash="3af73cb40cbbc1d74b208e4b2ce04d97"/></dir></dir><dir name="layout"><file name="adyen.xml" hash="b198d1da091204731b946b139834120a"/></dir></dir></dir><dir name="default"><dir name="adyen"><dir name="template"><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="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="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="096fc2858874e260da465bc62f2bdd14"/></dir></dir></dir><dir name="default"><dir name="adyen"><dir><dir name="onestepcheckout"><dir name="js"><file name="onestepcheckout.js" hash="fd2e1fa2222de70b7eb47429a581ad6c"/></dir></dir></dir></dir></dir><dir name="rwd"><dir name="adyen"><dir><dir name="onestepcheckout"><dir name="js"><file name="onestepcheckout.js" hash="fd2e1fa2222de70b7eb47429a581ad6c"/></dir></dir></dir></dir></dir><dir name="enterprise"><dir name="adyen"><dir><dir name="onestepcheckout"><dir name="js"><file name="onestepcheckout.js" hash="fd2e1fa2222de70b7eb47429a581ad6c"/></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>
|
45 |
<compatible/>
|
46 |
<dependencies><required><php><min>5.3.3</min><max>6.0.0</max></php></required></dependencies>
|
47 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Adyen_Payment</name>
|
4 |
+
<version>2.2.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>
|
9 |
<summary>Magento Plugin for Payment service provider Adyen</summary>
|
10 |
<description>Magento Plugin for Payment Service Provider Adyen. The plugin supports the Magento Community and Enterprise edition. Inhouse support on magento@adyen.com as well available through GitHub on https://github.com/adyenpayments/magento</description>
|
11 |
<notes>Features:
|
12 |
+
#156 CreditCard logos are shown and automatically detected instead of selecting your cart type
|
13 |
+
#174 Added Elo and Hipercard to CreditCard types
|
14 |
+
#175 Show number of installments in payment details of the order
|
15 |
+
#170 Encrypt password fields in configuration settings
|
16 |
+
#168 Option to add phonenumber field only for the OpenInvoice payment method
|
17 |
+
#113 Show fraudscore in Magento (if you have this setup for your account or if you have Adyen CC payment method enabled)
|
18 |
+
#144 Show by default Ideal payment method as a list instead of logos (can be changed in the configurations)
|
19 |
+
#140 Added payment logos for all payment methods
|
20 |
+
#149 Pre fill country for Payment Method SEPA based on billing information
|
21 |
+
#157 Added option to use IPFilter for the payment method Adyen POS
|
22 |
+
#150 Create a new configuration field for Client-Side Encryption Public Key for test
|
23 |
+
#114 Added extra setting so you can can define a different status for Downloadable products 
|
24 |
+
#165 Option to send out confirmation mail for Banktransfer/SEPA before payment is received
|
25 |
+
#176 Added CSE support for IWD One Page Checkout
|
26 |
+
#154 Added Filter on N.A in Adyen Status column of sales order grid
|
27 |
+
#127 #180 Added translation for Dutch,German,Spanish and French 
|
28 |
+
#181 Cash Drawer support for epson ePOS-Device 
|
29 |

|
30 |
+
Fixes:
|
31 |
+
#152 IOS CheckSum Fix For POS payments
|
32 |
+
#172 Update scripts now support tables that have prefixes
|
33 |
+
#169 Admin Order is now showing Total Due and Total Refunded
|
34 |
+
#126 Change logic for Capture so it will shoot in an api call to Adyen when you use the magento API capture
|
35 |
+
#158 Orders not using Adyen Payments can now be cancelled without errors
|
36 |
+
#151 #155 Database Optimization for better performance
|
37 |
+
#130 Adyen PSP Reference link in order details goes directly to the payment instead of the list with filtering on this PSP Reference.
|
38 |
+
#121 Don’t throw exception when there are no payment methods available for the Adyen HPP payment method
|
39 |
+
#117 Use for Afterpay afterpay_default payment method instead of old open invoice integration
|
40 |
+
#115 Fix validation for Diners cards
|
41 |
+
#183 Openinvoice (Afterpay/Klarna) are always manual captured
|
42 |
+
#116 Removed specific OneStepCheckout changes from the module, this will be added on GitHub as an external asset</notes>
|
43 |
<authors><author><name>Adyen</name><user>adyen</user><email>magento@adyen.com</email></author></authors>
|
44 |
+
<date>2015-01-29</date>
|
45 |
+
<time>13:39:31</time>
|
46 |
+
<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="f0428953d0ffb335d0d4a1362500ec2e"/></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="e56db3fa837b78c3fa79851a82bac575"/></dir></dir><file name="Version.php" hash="8ae6d538b9616499eb898579bef4abaa"/></dir><dir name="Checkout"><file name="Success.php" hash="9903de28ec3467e222c145491b87839b"/></dir><file name="Failure.php" hash="ead96fee55fba2cbb5044f09566e85e4"/><dir name="Form"><file name="Boleto.php" hash="2fb2938a4e4467a2a0e69a38f3496e8f"/><file name="Cc.php" hash="70963f94a208424863d7cc17e21741e9"/><file name="Elv.php" hash="a4c7408071ba07edd2207bf3c930d2f9"/><file name="Hpp.php" hash="08bf6b40565a450fb9a768219988ed81"/><file name="Oneclick.php" hash="f1d4c1bba402e2da141373209693b927"/><file name="Openinvoice.php" hash="e83c5f7064b847a2009976b86beea83c"/><file name="Pos.php" hash="e8a3250e792583ba06f3b2df3cefe3af"/><file name="Sepa.php" hash="847756eb15a9bcde5d09f25514c3c631"/></dir><file name="Form.php" hash="77d0589a32cb816dcdc6df16c98f2cd6"/><dir name="Info"><file name="Boleto.php" hash="6068acbb3d3dec90a797390871150956"/><file name="Cc.php" hash="9861c34ed4eee0d0b22d66c9b9a0b9ad"/><file name="Elv.php" hash="09a10412250e2bed303a189cfb216254"/><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="2f6fbcfeb770a208abc9c8dd4cd1a613"/></dir><file name="PosExpressCheckout.php" hash="7ba0d55c5db72b602555ae3c45da4d13"/><file name="Redirect.php" hash="e90771aea572504cb5a109944988aabc"/><dir name="Sales"><dir name="Order"><file name="Totals.php" hash="a39a86ab4e7f49a91c0d3ef37a37d45a"/></dir></dir><file name="SavedCards.php" hash="3fe47b88678d0c30aa3fc6b2b9592eae"/><file name="ScanProduct.php" hash="31c08b14b9e17a8f065b7d553470d518"/></dir><dir name="Helper"><file name="Data.php" hash="11a6a07eb9eadb173d92bf8770bdcaa5"/><file name="Installments.php" hash="6bfc01af88a457be9f444aade1fd5e1d"/></dir><dir name="Model"><dir name="Adyen"><file name="Abstract.php" hash="8bda55aa9890d122e4bb2b05ccd55560"/><file name="Boleto.php" hash="9a3e23f8daee54881a4e82cb26b883df"/><file name="Cc.php" hash="c772702eea7ee37f76bf6450a88f9ac3"/><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="Installments.php" hash="ab285677d94614d631b927b427268eff"/><file name="InvoiceLine.php" hash="2013af2bbae2b07df4db34b4d8565796"/><file name="InvoiceRow.php" hash="caa2f530ea8a2100fee55f9d16fa8235"/><file name="ModificationRequest.php" hash="35877a23e1159cae3b9a1b4687e1a663"/><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="175ded3287bfec672c0d815078c2a744"/><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="a4deba8bc252ca4ce219f95bfe714a97"/><file name="Hpp.php" hash="11a135d1a8c20d28f48f9bd3e40891a1"/><file name="Oneclick.php" hash="fd17671dd0d6fdd849da02013f33b3ac"/><file name="Openinvoice.php" hash="027ed8137b815f28a246a6bcb7ebc6d5"/><file name="Pos.php" hash="d5bcc939415be259d3afd29f70cc82ac"/><file name="Sepa.php" hash="21b0081b6cba065f58a15ea9276587b4"/><file name="Shared.php" hash="7f3fe961a7107b6fb5625a9efe7854fd"/><file name=".DS_Store" hash="d179556f904a5601ccd01a54743c155f"/></dir><file name="Authenticate.php" hash="a001fc39945d4c939f8184232cbe22fb"/><file name="Event.php" hash="a82554aaf0d5733349ff16b1fb39796d"/><dir name="Mysql4"><dir name="Adyen"><dir name="Debug"><file name="Collection.php" hash="dee84aa1c2b370a72d79031a09b9bba4"/></dir><file name="Debug.php" hash="123808b460f70ad416ed9bb92e6a1d60"/><dir name="Event"><file name="Collection.php" hash="6bbb986416f3e4cb1dc499e568d43ef7"/></dir><file name="Event.php" hash="4c52b7e1dfb0778ae5ebf76ce8dd1a15"/></dir><file name="Order.php" hash="05c5ce3b68f877b23d1396d13db18517"/><file name="Setup.php" hash="45997ed47c197cb302d6fbb684489201"/></dir><file name="Observer.php" hash="6863e22a7e3dff259b2e224bf5653e29"/><file name="Process.php" hash="0f356af09e8acf45fd4f89cad4f85379"/><dir name="Sales"><dir name="Quote"><dir name="Address"><dir name="Total"><file name="PaymentFee.php" hash="a5b1568d998315c1fbfae5c74405e41b"/><file name="PaymentInstallmentFee.php" hash="1e794cd1cbfebd097ff43faf624138ce"/></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="DefaultPaymentMethods.php" hash="2c06a0cb2d8e526afca2b4342b59b32c"/><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"/><file name="SepaFlow.php" hash="64e6fd9181772db70e3dfc012c117a46"/><dir name="Status"><file name="Complete.php" hash="1580706a7d28010ed5acc678f549df73"/><file name="Refund.php" hash="f763d00e989f39dce9daddb7c1bd28f6"/></dir><file name="VisibleType.php" hash="ecc88ad246d8e52316d53f879d615803"/></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="CheckoutCashController.php" hash="6ff54e58a6797d6e87c733e466f777f7"/><file name="CheckoutPosController.php" hash="c7efe60bb75c06fb279fc051597a37b8"/><file name="GetInstallmentsController.php" hash="e46511c8759a6cd064d90f79af5f97c3"/><file name="ProcessController.php" hash="555d4261b4db1497bafdc7595e75e959"/><file name="SavedCardController.php" hash="992b62e8cdeda582b459cd55cde3ec6b"/><file name="UpdateCartController.php" hash="c7280eb6b5b5f87e2dd9f06cc4370e97"/></dir><dir name="data"><dir name="adyen_setup"><file name="data-upgrade-2.1.2.3-2.1.2.4.php" hash="8262bf4038ba435fe15bd08c36814936"/></dir></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="4190412f599a3eac827d7ed0931754da"/><file name="config.xml" hash="c3a509579fcb2a7cc200bd0eef70751c"/><file name="system.xml" hash="ea7699cdf4be6acfc9075877274b08eb"/></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="91a318943b2ead4fd5d3dc7cfa04023e"/><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="b185927a102e0cefa08fe155cfa16004"/><file name="mysql4-upgrade-2.0.3-2.1.0.php" hash="fc4fc300116a7e471fd35699979f21f7"/><file name="mysql4-upgrade-2.1.1-2.1.2.1.php" hash="50716af509a51f67eb3535f59206d3c1"/><file name="mysql4-upgrade-2.1.2.1-2.1.2.2.php" hash="42480b5f0081e89faa8da76e53d10a91"/><file name="mysql4-upgrade-2.1.2.2-2.1.2.3.php" hash="3c68f09a8bcd44943587428ee24e0947"/></dir></dir><file name=".DS_Store" hash="8a387d0ed76f7cabfbc3331dd1caead3"/></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="d54095e88b03dcee8ef3183b24a2468b"/><file name="elv.phtml" hash="4d370d2d737f0a42ebcb33e7151ecee6"/><file name="hpp.phtml" hash="38457f21f239afbed434bdae45bef0e3"/><file name="openinvoice.phtml" hash="33127af4713430e153cccbe8684fab13"/><file name="pos.phtml" hash="c07c11d348fced7d889ded4fc77e3363"/><file name="sepa.phtml" hash="00f368ac2b0b5b402174e36bf94cdcc9"/></dir><dir name="info"><file name="boleto.phtml" hash="353271ac7dd3fdfa13780e470bc3693f"/><file name="cc.phtml" hash="8ad4b1f8362136e1b9524e5ec531ee1e"/><file name="elv.phtml" hash="7b41e3cd069c3323ce6080905c8984c3"/><file name="hpp.phtml" hash="06abc95b4690cbeae8875c79c31a6901"/><file name="openinvoice.phtml" hash="7b2de9b28c0eb8e3315d4f0048cc8adf"/><file name="pos.phtml" hash="d37defb03cfa5697455eee174199d595"/><file name="sepa.phtml" hash="79bc367ff04a042b689156ba93e33521"/></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=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="adyen"><dir name="checkout"><dir name="onepage"><dir name="payment"><file name="methods.phtml" hash="a2a0a92b00c43d49e3d63d6da9bb9f85"/></dir></dir><file name="success.phtml" hash="4c06b168acd8971e20a7c8d1205c264b"/><file name=".DS_Store" hash="21ecd78ea5715d7392b2d8a533c6630a"/></dir><dir name="form"><file name="boleto.phtml" hash="309a0152cd5219e2c22da4270307222c"/><file name="cc.phtml" hash="816cabb84d569f98e1d6d1e0f25b2b0e"/><file name="elv.phtml" hash="789610e3d1f8973f6aecb4ef119a59c9"/><file name="hpp.phtml" hash="610ab62715a35522d58da8d4be2e7ee8"/><file name="oneclick.phtml" hash="41572aabfa0340a3be71c03962cbde3e"/><file name="openinvoice.phtml" hash="dd49a42b84e0917135eb56cc27b9c764"/><file name="pos.phtml" hash="674097ccf62f13c969d39c2f6a6824b8"/><file name="sepa.phtml" hash="101dac131fccc22da5c8fc207a8db650"/></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="8999dfee0c638f44b5010779b8bbf711"/><file name="openinvoice.phtml" hash="2bcd711e1255923d53f353819e19529e"/><file name="pos.phtml" hash="9b917920aa1cc77c9e8c3a26943b1335"/><file name="sepa.phtml" hash="c886a3d9923c3ade6ca5056f18c1b856"/></dir><dir name="payment"><file name="payment_method_label.phtml" hash="256b943044431874fbaea43760544fcc"/></dir><file name="pos_express_checkout.phtml" hash="f0bd55cb16b8d3bb01a222066f7194fd"/><file name="saved_cards.phtml" hash="157f22deea44340377805c1098d81f4f"/><file name="scan_product.phtml" hash="b3b84dc6804f832919406644a0378492"/><file name=".DS_Store" hash="ab6d0ae72b40033c9fed5850d3f5d499"/></dir></dir><dir name="layout"><file name="adyen.xml" hash="4368d2521f829dab843db9d8ebf076d6"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Adyen_Payment.xml" hash="e4d297a9b401c4548acb47aea1ae41d9"/></dir></target><target name="magelocale"><dir><dir name="de_DE"><file name="Adyen_Payment.csv" hash="7135f6f9bb2b5e9627c974275b7fae0d"/></dir><dir name="es_ES"><file name="Adyen_Payment.csv" hash="073a8f2fc408311e6b9a127e0ef4732f"/></dir><dir name="fr_FR"><file name="Adyen_Payment.csv" hash="9cf75a38d7e2583d2ca17be7e0732435"/></dir><dir name="nl_NL"><file name="Adyen_Payment.csv" hash="202fcd84eabf3e41ac4023b952d9995c"/></dir></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="ae_small.png" hash="6ce7c9a2b330c9c46f0213c40db55683"/><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="dc_small.png" hash="ecf5d635a74460ca9575bb7d6d8550dd"/><file name="di_small.png" hash="8573aebe4938afb288749badb22aa091"/><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="elo.png" hash="d8ed45be5e2a933584a58c78a5ec3568"/><file name="elo_small.png" hash="b0c3bec4e8cccf4339e142365a30fca7"/><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="hipercard.png" hash="9310c18cee9f43c4019a7560d74ffd4c"/><file name="hipercard_small.png" hash="d4d0e1aab233b3ec3f94cbbe985fd8ad"/><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="img_trans.gif" hash="325472601571f31e1bf00674c368d335"/><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="pm_gloss.png" hash="dcfc71b0c819e58a1287cd206cfb9d14"/><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="sm_small.png" hash="7814fbfff53e57643137fd68889ec807"/><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="vi_small.png" hash="cdab39efaf22fcd2ab88f3dc42c32de1"/><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="d3fef2eef6952e158538e1b7857546ad"/></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="cc.js" hash="0add596d6708192fc5deee8848ec2684"/><file name="elv.js" hash="db612a634c95727ec9db82c50e9aec8e"/><file name="epos-device-2.6.0.js" hash="94c73689bec45b74a311d76400f05ba6"/></dir></dir></dir></target></contents>
|
47 |
<compatible/>
|
48 |
<dependencies><required><php><min>5.3.3</min><max>6.0.0</max></php></required></dependencies>
|
49 |
</package>
|
@@ -28,10 +28,41 @@
|
|
28 |
|
29 |
/* Adyen Customs */
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
/* Checkout */
|
|
|
32 |
.sp-methods #payment_form_adyen_hpp { }
|
33 |
.sp-methods #payment_form_adyen_hpp .input-box table { margin-bottom: 5px; }
|
34 |
-
.sp-methods #payment_form_adyen_hpp
|
|
|
35 |
.sp-methods #payment_form_adyen_hpp #payment_form_ideal label.required { border: 0; padding: 0; background: none; }
|
36 |
.sp-methods #payment_form_adyen_hpp #payment_form_ideal label { }
|
37 |
.sp-methods #payment_form_adyen_hpp #payment_form_ideal table.banks { padding: 5px; border: 1px solid #bebebe; width: 175px; margin-bottom: 5px; background: #fff; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; }
|
@@ -39,6 +70,7 @@
|
|
39 |
.sp-methods #payment_form_adyen_hpp #payment_form_ideal table.banks td.label_hpp_ideal_type { width: 100px; }
|
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;}
|
@@ -59,6 +91,7 @@
|
|
59 |
padding:10px;
|
60 |
margin-left:10px;
|
61 |
min-width: 568px;
|
|
|
62 |
}
|
63 |
|
64 |
.saved-cards .creditcard-block { min-width:350px;}
|
@@ -105,7 +138,7 @@
|
|
105 |
.redirect-body-adyen { margin:0; padding:0;}
|
106 |
#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; }
|
107 |
#pos-redirect-page .grey-header { background-color: #4C4C4C; width:100%; margin:10px 0;}
|
108 |
-
#pos-redirect-page .grey-header h1 { padding: 16px 10px; font-family:
|
109 |
#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;}
|
110 |
#pos-redirect-page #launchlink { margin-top:10px; clear:both; display:block; color:#797C83; text-decoration:none; }
|
111 |
|
28 |
|
29 |
/* Adyen Customs */
|
30 |
|
31 |
+
#co-payment-form .sp-methods dt { margin:0px 0 5px;}
|
32 |
+
#co-payment-form .sp-methods dt input.radio { margin:20px 0 0 ; padding:0; }
|
33 |
+
#co-payment-form .sp-methods dt label {background:none; padding:0 0 0 6px; }
|
34 |
+
#co-payment-form .sp-methods dt label span { display:block; padding-top:9px;}
|
35 |
+
|
36 |
+
.sp-methods #payment_form_adyen_cc .v-fix label { float:none; vertical-align: middle;}
|
37 |
+
|
38 |
+
.sp-methods img.adyen-payment-method-icon { margin-right: 14px; margin-left:2px; border:none !important; width:66px; height:43px; background:url(../images/adyen/pm_gloss.png) left top no-repeat; }
|
39 |
+
.sp-methods img.adyen-payment-method-icon.adyen_cc { background-position: 0px -272px; }
|
40 |
+
.sp-methods img.adyen-payment-method-icon.adyen_boleto { background-position: 0px -2092px; }
|
41 |
+
.sp-methods img.adyen-payment-method-icon.adyen_elv {background-position: 0px -2000px; }
|
42 |
+
.sp-methods img.adyen-payment-method-icon.adyen_openinvoice_afterpay_default {background-position: 0px -1637px; }
|
43 |
+
.sp-methods img.adyen-payment-method-icon.adyen_openinvoice_klarna {background-position: 0px -1728px; }
|
44 |
+
.sp-methods img.adyen-payment-method-icon.adyen_pos { background-position: 0px -1818px; }
|
45 |
+
.sp-methods img.adyen-payment-method-icon.adyen_sepa { background-position: 0px -1910px; }
|
46 |
+
|
47 |
+
.sp-methods .adyen-payment-method-icon .no-mc { background-position: left top; }
|
48 |
+
.sp-methods dd { clear:both; }
|
49 |
+
.sp-methods dd li { margin:5px 0 -10px 0px;}
|
50 |
+
|
51 |
+
.sp-methods .form-list li.adyen_payment_creditcard_labels { margin-top:15px; }
|
52 |
+
.adyen_payment_creditcard_labels img.grey {
|
53 |
+
-webkit-filter: grayscale(100%);
|
54 |
+
filter: grayscale(100%);
|
55 |
+
filter: gray;
|
56 |
+
filter: url("data:image/svg+xml;utf8,<svg version='1.1' xmlns='http://www.w3.org/2000/svg' height='0'><filter id='greyscale'><feColorMatrix type='matrix' values='0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0' /></filter></svg>#greyscale");
|
57 |
+
}
|
58 |
+
|
59 |
+
.sp-methods .adyen_payment_input_fields { clear:both; }
|
60 |
/* Checkout */
|
61 |
+
.sp-methods #payment_form_adyen_hpp li { margin:0;}
|
62 |
.sp-methods #payment_form_adyen_hpp { }
|
63 |
.sp-methods #payment_form_adyen_hpp .input-box table { margin-bottom: 5px; }
|
64 |
+
.sp-methods #payment_form_adyen_hpp .input-box table td { vertical-align: middle;}
|
65 |
+
.sp-methods #payment_form_adyen_hpp #payment_form_ideal { width: 160px; margin-top:5px; display: block; position: relative; z-index: 1; }
|
66 |
.sp-methods #payment_form_adyen_hpp #payment_form_ideal label.required { border: 0; padding: 0; background: none; }
|
67 |
.sp-methods #payment_form_adyen_hpp #payment_form_ideal label { }
|
68 |
.sp-methods #payment_form_adyen_hpp #payment_form_ideal table.banks { padding: 5px; border: 1px solid #bebebe; width: 175px; margin-bottom: 5px; background: #fff; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; }
|
70 |
.sp-methods #payment_form_adyen_hpp #payment_form_ideal table.banks td.label_hpp_ideal_type { width: 100px; }
|
71 |
.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;*/ }
|
72 |
.sp-methods #payment_form_adyen_hpp #payment_form_ideal table td img { /*margin-left: -25px;*/ }
|
73 |
+
.sp-methods #payment_form_adyen_hpp #payment_form_ideal .adyen_select_ideal { margin-bottom:10px;}
|
74 |
|
75 |
/* for onepagecheckout */
|
76 |
.payment-methods dd#container_payment_method_adyen_hpp { margin:0; padding:0;}
|
91 |
padding:10px;
|
92 |
margin-left:10px;
|
93 |
min-width: 568px;
|
94 |
+
vertical-align: middle;
|
95 |
}
|
96 |
|
97 |
.saved-cards .creditcard-block { min-width:350px;}
|
138 |
.redirect-body-adyen { margin:0; padding:0;}
|
139 |
#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; }
|
140 |
#pos-redirect-page .grey-header { background-color: #4C4C4C; width:100%; margin:10px 0;}
|
141 |
+
#pos-redirect-page .grey-header h1 { padding: 16px 10px; font-family: sans-serif; font-size:24px;color:white; }
|
142 |
#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;}
|
143 |
#pos-redirect-page #launchlink { margin-top:10px; clear:both; display:block; color:#797C83; text-decoration:none; }
|
144 |
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,1107 +0,0 @@
|
|
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"> </div>');
|
296 |
-
|
297 |
-
if(update_payments) {
|
298 |
-
var payment_methods = $$('div.payment-methods')[0];
|
299 |
-
payment_methods.update('<div class="loading-ajax"> </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"> </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[method]');
|
454 |
-
var payment_recurring_type_cvc = $('adyen_oneclick_oneclick_cid_'+payment_recurring_type);
|
455 |
-
var payment_method = $RF(form, 'payment[method]');
|
456 |
-
|
457 |
-
// save all input and select fields in array so after ajax call you can reset the values
|
458 |
-
var paymentInputFields = {};
|
459 |
-
var inputs = form.querySelectorAll("input,select");
|
460 |
-
for (x = 0 ; x < inputs.length ; x++){
|
461 |
-
inputname = inputs[x].getAttribute("name");
|
462 |
-
if(inputname != null) {
|
463 |
-
if(inputname.startsWith("payment") && inputs[x].type != "hidden") {
|
464 |
-
var inputname = inputname.replace('payment[','').replace(']','');
|
465 |
-
paymentInputFields[inputname] = inputs[x].value;
|
466 |
-
}
|
467 |
-
}
|
468 |
-
}
|
469 |
-
|
470 |
-
parameters['payment_method'] = payment_method;
|
471 |
-
parameters['payment[method]'] = payment_method;
|
472 |
-
|
473 |
-
if(update_payments){
|
474 |
-
var payment_methods = $$('div.payment-methods')[0];
|
475 |
-
payment_methods.update('<div class="loading-ajax"> </div>');
|
476 |
-
}
|
477 |
-
|
478 |
-
var totals = get_totals_element();
|
479 |
-
totals.update('<div class="loading-ajax"> </div>');
|
480 |
-
|
481 |
-
|
482 |
-
new Ajax.Request(url, {
|
483 |
-
method: 'post',
|
484 |
-
onSuccess: function(transport) {
|
485 |
-
if(transport.status == 200) {
|
486 |
-
|
487 |
-
var data = transport.responseText.evalJSON();
|
488 |
-
|
489 |
-
// Update shipment methods
|
490 |
-
if(shipment_methods_found) {
|
491 |
-
shipment_methods.update(data.shipping_method);
|
492 |
-
}
|
493 |
-
|
494 |
-
if(update_payments){
|
495 |
-
payment_methods.replace(data.payment_method);
|
496 |
-
}
|
497 |
-
|
498 |
-
totals.update(data.summary);
|
499 |
-
|
500 |
-
|
501 |
-
}
|
502 |
-
},
|
503 |
-
onComplete: function(transport){
|
504 |
-
if(transport.status == 200) {
|
505 |
-
if(shipment_methods_found) {
|
506 |
-
$$('dl.shipment-methods input').invoke('observe', 'click', get_separate_save_methods_function(set_methods_url, update_payments));
|
507 |
-
$$('dl.shipment-methods input').invoke('observe', 'click', function() {
|
508 |
-
$$('div.onestepcheckout-shipment-method-error').each(function(item) {
|
509 |
-
new Effect.Fade(item);
|
510 |
-
});
|
511 |
-
});
|
512 |
-
}
|
513 |
-
|
514 |
-
if(update_payments){
|
515 |
-
$$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(set_methods_url));
|
516 |
-
$$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
|
517 |
-
$$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
|
518 |
-
|
519 |
-
$$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
|
520 |
-
$$('div.onestepcheckout-payment-method-error').each(function(item) {
|
521 |
-
new Effect.Fade(item);
|
522 |
-
});
|
523 |
-
});
|
524 |
-
|
525 |
-
if($RF(form, 'payment[method]') != null) {
|
526 |
-
|
527 |
-
// loop through input fields and reset the values
|
528 |
-
for (var name in paymentInputFields) {
|
529 |
-
|
530 |
-
var inputname = "payment[" + name + "]";
|
531 |
-
var inputElements = document.getElementsByName(inputname);
|
532 |
-
var inputElement = inputElements[0];
|
533 |
-
|
534 |
-
if($(inputElement).type && $(inputElement).type.toLowerCase() != 'radio') {
|
535 |
-
// element is unique so get first and only item
|
536 |
-
inputElements[0].value = paymentInputFields[name];
|
537 |
-
}
|
538 |
-
}
|
539 |
-
|
540 |
-
try {
|
541 |
-
var payment_method = $RF(form, 'payment[method]');
|
542 |
-
$('container_payment_method_' + payment_method).show();
|
543 |
-
var payment_form = $('payment_form_' + payment_method);
|
544 |
-
if(payment_form)
|
545 |
-
$(payment_form).show();
|
546 |
-
else if(payment_method == "adyen_hpp") { // check if payment type is hpp (this has other id so should come in else )
|
547 |
-
// set sub payment method back
|
548 |
-
$('hpp_type_'+payment_hpp_type).checked = true;
|
549 |
-
|
550 |
-
// check if ideal payment bank is chosen
|
551 |
-
if(payment_hpp_type == "ideal") {
|
552 |
-
if(payment_hpp_ideal_type) {
|
553 |
-
// get issue_id this is before the slash
|
554 |
-
var issue_id = payment_hpp_ideal_type.substr(0, payment_hpp_ideal_type.indexOf('/'));
|
555 |
-
$('hpp_ideal_type_'+issue_id).checked = true;
|
556 |
-
}
|
557 |
-
$('payment_form_ideal').show();
|
558 |
-
}
|
559 |
-
} else if(payment_method == "adyen_oneclick") { // check if payment type is hpp
|
560 |
-
// set sub payment method back
|
561 |
-
$('recurring_type_'+payment_recurring_type).checked = true;
|
562 |
-
// set back the cvc code
|
563 |
-
$('adyen_oneclick_oneclick_cid_'+payment_recurring_type).value = payment_recurring_type_cvc.value;
|
564 |
-
// show the cvc code block
|
565 |
-
var cvc_block = "cvc_block_" + payment_recurring_type;
|
566 |
-
$(cvc_block).show();
|
567 |
-
}
|
568 |
-
} catch(err) {
|
569 |
-
|
570 |
-
}
|
571 |
-
}
|
572 |
-
}
|
573 |
-
}
|
574 |
-
},
|
575 |
-
parameters: parameters
|
576 |
-
});
|
577 |
-
|
578 |
-
}
|
579 |
-
}
|
580 |
-
|
581 |
-
function get_separate_save_methods_function(url, update_payments)
|
582 |
-
{
|
583 |
-
if(typeof update_payments == 'undefined') {
|
584 |
-
var update_payments = false;
|
585 |
-
}
|
586 |
-
|
587 |
-
return function(e) {
|
588 |
-
if(typeof e != 'undefined') {
|
589 |
-
var element = e.element();
|
590 |
-
|
591 |
-
if(element.name != 'shipping_method') {
|
592 |
-
update_payments = false;
|
593 |
-
}
|
594 |
-
}
|
595 |
-
|
596 |
-
var form = $('onestepcheckout-form');
|
597 |
-
var shipping_method = $RF(form, 'shipping_method');
|
598 |
-
var payment_method = $RF(form, 'payment[method]');
|
599 |
-
var payment_hpp_type = $RF(form, 'payment[hpp_type]');
|
600 |
-
var payment_hpp_ideal_type = $RF(form, 'payment[hpp_ideal_type]');
|
601 |
-
var payment_recurring_type = $RF(form, 'payment[recurring]');
|
602 |
-
var payment_recurring_type_cvc = $('adyen_oneclick_oneclick_cid_'+payment_recurring_type);
|
603 |
-
|
604 |
-
// save all input and select fields in array so after ajax call you can reset the values
|
605 |
-
var paymentInputFields = {};
|
606 |
-
var inputs = form.querySelectorAll("input,select");
|
607 |
-
for (x = 0 ; x < inputs.length ; x++){
|
608 |
-
inputname = inputs[x].getAttribute("name");
|
609 |
-
if(inputname != null) {
|
610 |
-
if(inputname.startsWith("payment") && inputs[x].type != "hidden") {
|
611 |
-
var inputname = inputname.replace('payment[','').replace(']','');
|
612 |
-
paymentInputFields[inputname] = inputs[x].value;
|
613 |
-
}
|
614 |
-
}
|
615 |
-
}
|
616 |
-
|
617 |
-
var totals = get_totals_element();
|
618 |
-
|
619 |
-
var freeMethod = $('p_method_free');
|
620 |
-
if(freeMethod){
|
621 |
-
payment.reloadcallback = true;
|
622 |
-
payment.countreload = 1;
|
623 |
-
}
|
624 |
-
|
625 |
-
totals.update('<div class="loading-ajax"> </div>');
|
626 |
-
|
627 |
-
if(update_payments) {
|
628 |
-
var payment_methods = $$('div.payment-methods')[0];
|
629 |
-
payment_methods.update('<div class="loading-ajax"> </div>');
|
630 |
-
}
|
631 |
-
|
632 |
-
var parameters = {
|
633 |
-
shipping_method: shipping_method,
|
634 |
-
payment_method: payment_method
|
635 |
-
}
|
636 |
-
|
637 |
-
/* Find payment parameters and include */
|
638 |
-
var items = $$('input[name^=payment]').concat($$('select[name^=payment]'));
|
639 |
-
var names = items.pluck('name');
|
640 |
-
var values = items.pluck('value');
|
641 |
-
|
642 |
-
for(var x=0; x < names.length; x++) {
|
643 |
-
if(names[x] != 'payment[method]') {
|
644 |
-
parameters[names[x]] = values[x];
|
645 |
-
}
|
646 |
-
}
|
647 |
-
|
648 |
-
new Ajax.Request(url, {
|
649 |
-
method: 'post',
|
650 |
-
onSuccess: function(transport) {
|
651 |
-
if(transport.status == 200) {
|
652 |
-
var data = transport.responseText.evalJSON();
|
653 |
-
var form = $('onestepcheckout-form');
|
654 |
-
|
655 |
-
totals.update(data.summary);
|
656 |
-
|
657 |
-
if(update_payments) {
|
658 |
-
|
659 |
-
payment_methods.replace(data.payment_method);
|
660 |
-
|
661 |
-
$$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
|
662 |
-
$$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
|
663 |
-
$$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
|
664 |
-
$$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
|
665 |
-
$$('div.onestepcheckout-payment-method-error').each(function(item) {
|
666 |
-
new Effect.Fade(item);
|
667 |
-
});
|
668 |
-
});
|
669 |
-
|
670 |
-
if($RF($('onestepcheckout-form'), 'payment[method]') != null) {
|
671 |
-
|
672 |
-
|
673 |
-
// loop through input fields and reset the values
|
674 |
-
for (var name in paymentInputFields) {
|
675 |
-
|
676 |
-
var inputname = "payment[" + name + "]";
|
677 |
-
var inputElements = document.getElementsByName(inputname);
|
678 |
-
var inputElement = inputElements[0];
|
679 |
-
|
680 |
-
if($(inputElement).type && $(inputElement).type.toLowerCase() != 'radio') {
|
681 |
-
// element is unique so get first and only item
|
682 |
-
inputElements[0].value = paymentInputFields[name];
|
683 |
-
}
|
684 |
-
}
|
685 |
-
|
686 |
-
try {
|
687 |
-
var payment_method = $RF(form, 'payment[method]');
|
688 |
-
$('container_payment_method_' + payment_method).show();
|
689 |
-
var payment_form = $('payment_form_' + payment_method);
|
690 |
-
if(payment_form)
|
691 |
-
$(payment_form).show();
|
692 |
-
else if(payment_method == "adyen_hpp") { // check if payment type is hpp (this has other id so should come in else )
|
693 |
-
// set sub payment method back
|
694 |
-
$('hpp_type_'+payment_hpp_type).checked = true;
|
695 |
-
|
696 |
-
// check if ideal payment bank is chosen
|
697 |
-
if(payment_hpp_type == "ideal") {
|
698 |
-
if(payment_hpp_ideal_type) {
|
699 |
-
// get issue_id this is before the slash
|
700 |
-
var issue_id = payment_hpp_ideal_type.substr(0, payment_hpp_ideal_type.indexOf('/'));
|
701 |
-
$('hpp_ideal_type_'+issue_id).checked = true;
|
702 |
-
}
|
703 |
-
$('payment_form_ideal').show();
|
704 |
-
}
|
705 |
-
} else if(payment_method == "adyen_oneclick") { // check if payment type is hpp
|
706 |
-
// set sub payment method back
|
707 |
-
$('recurring_type_'+payment_recurring_type).checked = true;
|
708 |
-
// set back the cvc code
|
709 |
-
$('adyen_oneclick_oneclick_cid_'+payment_recurring_type).value = payment_recurring_type_cvc.value;
|
710 |
-
// show the cvc code block
|
711 |
-
var cvc_block = "cvc_block_" + payment_recurring_type;
|
712 |
-
$(cvc_block).show();
|
713 |
-
// show update link url
|
714 |
-
var update_link = "update-expiration-date-" + payment_recurring_type;
|
715 |
-
$(update_link).show();
|
716 |
-
}
|
717 |
-
} catch(err) {
|
718 |
-
|
719 |
-
}
|
720 |
-
}
|
721 |
-
}
|
722 |
-
}
|
723 |
-
},
|
724 |
-
parameters: parameters
|
725 |
-
});
|
726 |
-
}
|
727 |
-
}
|
728 |
-
|
729 |
-
function paymentrefresh(url) {
|
730 |
-
var payment_methods = $$('div.payment-methods')[0];
|
731 |
-
payment_methods.update('<div class="loading-ajax"> </div>');
|
732 |
-
new Ajax.Request(url, {
|
733 |
-
method: 'get',
|
734 |
-
onSuccess: function(transport){
|
735 |
-
if(transport.status == 200) {
|
736 |
-
var data = transport.responseText.evalJSON();
|
737 |
-
payment_methods.replace(data.payment_method);
|
738 |
-
|
739 |
-
$$('div.payment-methods input[name="payment\[method\]"]', 'div.payment-methods input[name="payment\[useProfile\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
|
740 |
-
$$('div.payment-methods input[name="payment\[method\]"]', 'div.payment-methods input[name="payment\[useProfile\]"]').invoke('observe', 'click', function() {
|
741 |
-
$$('div.onestepcheckout-payment-method-error').each(function(item) {
|
742 |
-
new Effect.Fade(item);
|
743 |
-
});
|
744 |
-
});
|
745 |
-
|
746 |
-
if($RF(form, 'payment[method]') != null) {
|
747 |
-
try {
|
748 |
-
var payment_method = $RF(form, 'payment[method]');
|
749 |
-
$('container_payment_method_' + payment_method).show();
|
750 |
-
$('payment_form_' + payment_method).show();
|
751 |
-
} catch(err){}
|
752 |
-
}
|
753 |
-
|
754 |
-
}
|
755 |
-
}
|
756 |
-
});
|
757 |
-
}
|
758 |
-
|
759 |
-
function addressPreview(templates, target) {
|
760 |
-
var bparams = {};
|
761 |
-
var sparams = {};
|
762 |
-
var savedBillingItems = $('billing-address-select');
|
763 |
-
if(savedBillingItems && savedBillingItems.getValue()){
|
764 |
-
index = savedBillingItems.selectedIndex;
|
765 |
-
bparams = customerBAddresses[index];
|
766 |
-
} else {
|
767 |
-
var items = $$('input[name^=billing]').concat($$('select[name^=billing]'));
|
768 |
-
items.each(function(s) {
|
769 |
-
if(s.getStyle('display') != 'none'){
|
770 |
-
selectText = s.options
|
771 |
-
if(selectText){
|
772 |
-
value = selectText[s.selectedIndex].text;
|
773 |
-
} else {
|
774 |
-
value = s.getValue();
|
775 |
-
}
|
776 |
-
if(value){
|
777 |
-
value = '<span class="' + s.id.replace(':','-') + '">' + value.escapeHTML() + '</span>';
|
778 |
-
}
|
779 |
-
if(s.id == 'billing:region_id'){
|
780 |
-
bparams['billing:region'] = value;
|
781 |
-
} else {
|
782 |
-
bparams[s.id] = value;
|
783 |
-
}
|
784 |
-
}
|
785 |
-
});
|
786 |
-
}
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
var savedShippingItems = $('shipping-address-select');
|
791 |
-
if(savedShippingItems && savedShippingItems.getValue()){
|
792 |
-
index = savedShippingItems.selectedIndex;
|
793 |
-
sparams = customerSAddresses[index];
|
794 |
-
} else {
|
795 |
-
var items = $$('input[name^=shipping]').concat($$('select[name^=shipping]'));
|
796 |
-
items.each(function(s) {
|
797 |
-
if(s.getStyle('display') != 'none'){
|
798 |
-
selectText = s.options
|
799 |
-
if(selectText){
|
800 |
-
value = selectText[s.selectedIndex].text;
|
801 |
-
} else {
|
802 |
-
value = s.getValue();
|
803 |
-
}
|
804 |
-
if(value){
|
805 |
-
value = '<span class="' + s.id.replace(':','-') + '">' + value.escapeHTML() + '</span>';
|
806 |
-
}
|
807 |
-
if(s.id == 'shipping:region_id'){
|
808 |
-
sparams['shipping:region'] = value;
|
809 |
-
} else {
|
810 |
-
sparams[s.id] = value;
|
811 |
-
}
|
812 |
-
}
|
813 |
-
});
|
814 |
-
}
|
815 |
-
|
816 |
-
|
817 |
-
var form = $('onestepcheckout-form');
|
818 |
-
|
819 |
-
var shipping_method = $RF(form, 'shipping_method');
|
820 |
-
if(shipping_method){
|
821 |
-
var shipping_label = $('s_method_' + shipping_method).up('dt').down('label').innerHTML.stripScripts();
|
822 |
-
var shipping_title = $('s_method_' + shipping_method).up('dt').previous('dd').innerHTML.stripScripts();
|
823 |
-
var shipping_row = shipping_title + ' - ' + shipping_label
|
824 |
-
}
|
825 |
-
|
826 |
-
var useOnlyBilling = $('billing:use_for_shipping_yes').getValue();
|
827 |
-
billinga_template = new Template(templates.billing);
|
828 |
-
|
829 |
-
if(useOnlyBilling){
|
830 |
-
shippinga_template = new Template(templates.billing);
|
831 |
-
}else{
|
832 |
-
shippinga_template = new Template(templates.shipping);
|
833 |
-
}
|
834 |
-
|
835 |
-
var payment_method = payment.currentMethod;
|
836 |
-
|
837 |
-
if(payment_method){
|
838 |
-
var payment_label = $('p_method_'+payment_method).up('dt').down('label').innerHTML.stripScripts();
|
839 |
-
}
|
840 |
-
|
841 |
-
var targetelem = $(target + '_billinga').childElements()[1];
|
842 |
-
if(targetelem){
|
843 |
-
targetelem.update(billinga_template.evaluate(bparams));
|
844 |
-
}
|
845 |
-
|
846 |
-
var targetelem = $(target + '_shippinga').childElements()[1];
|
847 |
-
if(targetelem){
|
848 |
-
if(useOnlyBilling){
|
849 |
-
targetelem.update(shippinga_template.evaluate(bparams));
|
850 |
-
}else{
|
851 |
-
targetelem.update(shippinga_template.evaluate(sparams));
|
852 |
-
}
|
853 |
-
}
|
854 |
-
|
855 |
-
var targetelem = $(target + '_shipping').childElements()[1];
|
856 |
-
if(targetelem){
|
857 |
-
targetelem.update(shipping_row);
|
858 |
-
}
|
859 |
-
|
860 |
-
var targetelem = $(target + '_payment').childElements()[1];
|
861 |
-
if(targetelem){
|
862 |
-
targetelem.update(payment_label);
|
863 |
-
}
|
864 |
-
|
865 |
-
var targetelem = $(target + '_summary').childElements()[1];
|
866 |
-
if(targetelem){
|
867 |
-
targetelem.update('');
|
868 |
-
targetelem.insert($$('table.onestepcheckout-summary')[0].cloneNode(true));
|
869 |
-
targetelem.insert($$('table.onestepcheckout-totals')[0].cloneNode(true));
|
870 |
-
}
|
871 |
-
}
|
872 |
-
|
873 |
-
|
874 |
-
var Checkout = Class.create();
|
875 |
-
Checkout.prototype = {
|
876 |
-
initialize: function(){
|
877 |
-
this.accordion = '';
|
878 |
-
this.progressUrl = '';
|
879 |
-
this.reviewUrl = '';
|
880 |
-
this.saveMethodUrl = '';
|
881 |
-
this.failureUrl = '';
|
882 |
-
this.billingForm = false;
|
883 |
-
this.shippingForm= false;
|
884 |
-
this.syncBillingShipping = false;
|
885 |
-
this.method = '';
|
886 |
-
this.payment = '';
|
887 |
-
this.loadWaiting = false;
|
888 |
-
},
|
889 |
-
|
890 |
-
ajaxFailure: function(){
|
891 |
-
location.href = this.failureUrl;
|
892 |
-
},
|
893 |
-
|
894 |
-
setLoadWaiting: function(step, keepDisabled) {
|
895 |
-
return true
|
896 |
-
}
|
897 |
-
};
|
898 |
-
|
899 |
-
//billing
|
900 |
-
var Billing = Class.create();
|
901 |
-
Billing.prototype = {
|
902 |
-
initialize: function(form, addressUrl, saveUrl){
|
903 |
-
this.form = form;
|
904 |
-
},
|
905 |
-
|
906 |
-
setAddress: function(addressId){
|
907 |
-
|
908 |
-
},
|
909 |
-
|
910 |
-
newAddress: function(isNew){
|
911 |
-
if (isNew) {
|
912 |
-
//this.resetSelectedAddress();
|
913 |
-
Element.show('billing_address_list');
|
914 |
-
if($('billing:use_for_shipping_yes').getValue() != "1" && $('shipping-address-select').getValue() == ''){
|
915 |
-
Element.show('shipping_address_list');
|
916 |
-
}
|
917 |
-
|
918 |
-
} else {
|
919 |
-
Element.hide('billing_address_list');
|
920 |
-
}
|
921 |
-
$$('input[name^=billing]', 'select[id=billing:region_id]').each(function(e){
|
922 |
-
if(e.name=='billing[use_for_shipping]' || e.name=='billing[save_in_address_book]'){
|
923 |
-
|
924 |
-
} else {
|
925 |
-
e.value = '';
|
926 |
-
}
|
927 |
-
});
|
928 |
-
},
|
929 |
-
|
930 |
-
resetSelectedAddress: function(){
|
931 |
-
var selectElement = $('shipping-address-select')
|
932 |
-
if (selectElement) {
|
933 |
-
selectElement.value='';
|
934 |
-
}
|
935 |
-
},
|
936 |
-
|
937 |
-
fillForm: function(transport){
|
938 |
-
|
939 |
-
},
|
940 |
-
|
941 |
-
setUseForShipping: function(flag) {
|
942 |
-
|
943 |
-
},
|
944 |
-
|
945 |
-
save: function(){
|
946 |
-
|
947 |
-
},
|
948 |
-
|
949 |
-
resetLoadWaiting: function(transport){
|
950 |
-
|
951 |
-
},
|
952 |
-
|
953 |
-
nextStep: function(transport){
|
954 |
-
|
955 |
-
}
|
956 |
-
};
|
957 |
-
|
958 |
-
//shipping
|
959 |
-
var Shipping = Class.create();
|
960 |
-
Shipping.prototype = {
|
961 |
-
initialize: function(form){
|
962 |
-
this.form = form;
|
963 |
-
},
|
964 |
-
|
965 |
-
setAddress: function(addressId){
|
966 |
-
|
967 |
-
},
|
968 |
-
|
969 |
-
newAddress: function(isNew){
|
970 |
-
if (isNew) {
|
971 |
-
this.resetSelectedAddress();
|
972 |
-
Element.show('shipping_address_list');
|
973 |
-
} else {
|
974 |
-
Element.hide('shipping_address_list');
|
975 |
-
}
|
976 |
-
|
977 |
-
$$('#shipping_address input[name^=shipping],#shipping_address select[id=shipping:region_id]').each(function(e){
|
978 |
-
if(e.name=='shipping[save_in_address_book]'){
|
979 |
-
|
980 |
-
} else {
|
981 |
-
e.value = '';
|
982 |
-
}
|
983 |
-
})
|
984 |
-
|
985 |
-
},
|
986 |
-
|
987 |
-
resetSelectedAddress: function(){
|
988 |
-
var selectElement = $('shipping-address-select')
|
989 |
-
if (selectElement) {
|
990 |
-
selectElement.value='';
|
991 |
-
}
|
992 |
-
},
|
993 |
-
|
994 |
-
fillForm: function(transport){
|
995 |
-
|
996 |
-
},
|
997 |
-
|
998 |
-
setSameAsBilling: function(flag) {
|
999 |
-
|
1000 |
-
},
|
1001 |
-
|
1002 |
-
syncWithBilling: function () {
|
1003 |
-
|
1004 |
-
},
|
1005 |
-
|
1006 |
-
setRegionValue: function(){
|
1007 |
-
//$('shipping:region').value = $('billing:region').value;
|
1008 |
-
},
|
1009 |
-
|
1010 |
-
save: function(){
|
1011 |
-
|
1012 |
-
}
|
1013 |
-
};
|
1014 |
-
|
1015 |
-
//payment object
|
1016 |
-
var Payment = Class.create();
|
1017 |
-
Payment.prototype = {
|
1018 |
-
beforeInitFunc:$H({}),
|
1019 |
-
afterInitFunc:$H({}),
|
1020 |
-
beforeValidateFunc:$H({}),
|
1021 |
-
afterValidateFunc:$H({}),
|
1022 |
-
initialize: function(form, saveUrl){
|
1023 |
-
this.form = form;
|
1024 |
-
this.saveUrl = saveUrl;
|
1025 |
-
},
|
1026 |
-
|
1027 |
-
init : function () {
|
1028 |
-
var elements = Form.getElements(this.form);
|
1029 |
-
if ($(this.form)) {
|
1030 |
-
//$(this.form).observe('submit', function(event){this.save();Event.stop(event);}.bind(this));
|
1031 |
-
}
|
1032 |
-
var method = null;
|
1033 |
-
for (var i=0; i<elements.length; i++) {
|
1034 |
-
if (elements[i].name=='payment[method]') {
|
1035 |
-
if (elements[i].checked) {
|
1036 |
-
method = elements[i].value;
|
1037 |
-
}
|
1038 |
-
} else {
|
1039 |
-
elements[i].disabled = true;
|
1040 |
-
}
|
1041 |
-
}
|
1042 |
-
if (method) this.switchMethod(method);
|
1043 |
-
},
|
1044 |
-
|
1045 |
-
switchMethod: function(method){
|
1046 |
-
if (this.currentMethod && $('payment_form_'+this.currentMethod)) {
|
1047 |
-
var form = $('payment_form_'+this.currentMethod);
|
1048 |
-
form.style.display = 'none';
|
1049 |
-
var elements = form.select('input').concat(form.select('select')).concat(form.select('textarea'));
|
1050 |
-
for (var i=0; i<elements.length; i++) elements[i].disabled = true;
|
1051 |
-
}
|
1052 |
-
|
1053 |
-
if ($('payment_form_'+method)){
|
1054 |
-
var form = $('payment_form_'+method);
|
1055 |
-
form.style.display = '';
|
1056 |
-
var elements = form.select('input').concat(form.select('select')).concat(form.select('textarea'));
|
1057 |
-
for (var i=0; i<elements.length; i++) elements[i].disabled = false;
|
1058 |
-
this.currentMethod = method;
|
1059 |
-
}
|
1060 |
-
},
|
1061 |
-
|
1062 |
-
addBeforeValidateFunction : function(code, func) {
|
1063 |
-
this.beforeValidateFunc.set(code, func);
|
1064 |
-
},
|
1065 |
-
|
1066 |
-
beforeValidate : function() {
|
1067 |
-
var validateResult = true;
|
1068 |
-
var hasValidation = false;
|
1069 |
-
(this.beforeValidateFunc).each(function(validate){
|
1070 |
-
hasValidation = true;
|
1071 |
-
if ((validate.value)() == false) {
|
1072 |
-
validateResult = false;
|
1073 |
-
}
|
1074 |
-
}.bind(this));
|
1075 |
-
if (!hasValidation) {
|
1076 |
-
validateResult = false;
|
1077 |
-
}
|
1078 |
-
return validateResult;
|
1079 |
-
},
|
1080 |
-
|
1081 |
-
validate: function() {
|
1082 |
-
var methods = document.getElementsByName('payment[method]');
|
1083 |
-
if (methods.length==0) {
|
1084 |
-
alert(Translator.translate('Your order can not be completed at this time as there is no payment methods available for it.'));
|
1085 |
-
return false;
|
1086 |
-
}
|
1087 |
-
for (var i=0; i<methods.length; i++) {
|
1088 |
-
if (methods[i].checked) {
|
1089 |
-
return true;
|
1090 |
-
}
|
1091 |
-
}
|
1092 |
-
alert(Translator.translate('Please specify payment method.'));
|
1093 |
-
return false;
|
1094 |
-
},
|
1095 |
-
|
1096 |
-
save: function(){
|
1097 |
-
},
|
1098 |
-
addAfterInitFunction : function(code, func) {
|
1099 |
-
this.afterInitFunc.set(code, func);
|
1100 |
-
},
|
1101 |
-
|
1102 |
-
afterInit : function() {
|
1103 |
-
(this.afterInitFunc).each(function(init){
|
1104 |
-
(init.value)();
|
1105 |
-
});
|
1106 |
-
}
|
1107 |
-
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1,1107 +0,0 @@
|
|
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"> </div>');
|
296 |
-
|
297 |
-
if(update_payments) {
|
298 |
-
var payment_methods = $$('div.payment-methods')[0];
|
299 |
-
payment_methods.update('<div class="loading-ajax"> </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"> </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[method]');
|
454 |
-
var payment_recurring_type_cvc = $('adyen_oneclick_oneclick_cid_'+payment_recurring_type);
|
455 |
-
var payment_method = $RF(form, 'payment[method]');
|
456 |
-
|
457 |
-
// save all input and select fields in array so after ajax call you can reset the values
|
458 |
-
var paymentInputFields = {};
|
459 |
-
var inputs = form.querySelectorAll("input,select");
|
460 |
-
for (x = 0 ; x < inputs.length ; x++){
|
461 |
-
inputname = inputs[x].getAttribute("name");
|
462 |
-
if(inputname != null) {
|
463 |
-
if(inputname.startsWith("payment") && inputs[x].type != "hidden") {
|
464 |
-
var inputname = inputname.replace('payment[','').replace(']','');
|
465 |
-
paymentInputFields[inputname] = inputs[x].value;
|
466 |
-
}
|
467 |
-
}
|
468 |
-
}
|
469 |
-
|
470 |
-
parameters['payment_method'] = payment_method;
|
471 |
-
parameters['payment[method]'] = payment_method;
|
472 |
-
|
473 |
-
if(update_payments){
|
474 |
-
var payment_methods = $$('div.payment-methods')[0];
|
475 |
-
payment_methods.update('<div class="loading-ajax"> </div>');
|
476 |
-
}
|
477 |
-
|
478 |
-
var totals = get_totals_element();
|
479 |
-
totals.update('<div class="loading-ajax"> </div>');
|
480 |
-
|
481 |
-
|
482 |
-
new Ajax.Request(url, {
|
483 |
-
method: 'post',
|
484 |
-
onSuccess: function(transport) {
|
485 |
-
if(transport.status == 200) {
|
486 |
-
|
487 |
-
var data = transport.responseText.evalJSON();
|
488 |
-
|
489 |
-
// Update shipment methods
|
490 |
-
if(shipment_methods_found) {
|
491 |
-
shipment_methods.update(data.shipping_method);
|
492 |
-
}
|
493 |
-
|
494 |
-
if(update_payments){
|
495 |
-
payment_methods.replace(data.payment_method);
|
496 |
-
}
|
497 |
-
|
498 |
-
totals.update(data.summary);
|
499 |
-
|
500 |
-
|
501 |
-
}
|
502 |
-
},
|
503 |
-
onComplete: function(transport){
|
504 |
-
if(transport.status == 200) {
|
505 |
-
if(shipment_methods_found) {
|
506 |
-
$$('dl.shipment-methods input').invoke('observe', 'click', get_separate_save_methods_function(set_methods_url, update_payments));
|
507 |
-
$$('dl.shipment-methods input').invoke('observe', 'click', function() {
|
508 |
-
$$('div.onestepcheckout-shipment-method-error').each(function(item) {
|
509 |
-
new Effect.Fade(item);
|
510 |
-
});
|
511 |
-
});
|
512 |
-
}
|
513 |
-
|
514 |
-
if(update_payments){
|
515 |
-
$$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(set_methods_url));
|
516 |
-
$$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
|
517 |
-
$$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
|
518 |
-
|
519 |
-
$$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
|
520 |
-
$$('div.onestepcheckout-payment-method-error').each(function(item) {
|
521 |
-
new Effect.Fade(item);
|
522 |
-
});
|
523 |
-
});
|
524 |
-
|
525 |
-
if($RF(form, 'payment[method]') != null) {
|
526 |
-
|
527 |
-
// loop through input fields and reset the values
|
528 |
-
for (var name in paymentInputFields) {
|
529 |
-
|
530 |
-
var inputname = "payment[" + name + "]";
|
531 |
-
var inputElements = document.getElementsByName(inputname);
|
532 |
-
var inputElement = inputElements[0];
|
533 |
-
|
534 |
-
if($(inputElement).type && $(inputElement).type.toLowerCase() != 'radio') {
|
535 |
-
// element is unique so get first and only item
|
536 |
-
inputElements[0].value = paymentInputFields[name];
|
537 |
-
}
|
538 |
-
}
|
539 |
-
|
540 |
-
try {
|
541 |
-
var payment_method = $RF(form, 'payment[method]');
|
542 |
-
$('container_payment_method_' + payment_method).show();
|
543 |
-
var payment_form = $('payment_form_' + payment_method);
|
544 |
-
if(payment_form)
|
545 |
-
$(payment_form).show();
|
546 |
-
else if(payment_method == "adyen_hpp") { // check if payment type is hpp (this has other id so should come in else )
|
547 |
-
// set sub payment method back
|
548 |
-
$('hpp_type_'+payment_hpp_type).checked = true;
|
549 |
-
|
550 |
-
// check if ideal payment bank is chosen
|
551 |
-
if(payment_hpp_type == "ideal") {
|
552 |
-
if(payment_hpp_ideal_type) {
|
553 |
-
// get issue_id this is before the slash
|
554 |
-
var issue_id = payment_hpp_ideal_type.substr(0, payment_hpp_ideal_type.indexOf('/'));
|
555 |
-
$('hpp_ideal_type_'+issue_id).checked = true;
|
556 |
-
}
|
557 |
-
$('payment_form_ideal').show();
|
558 |
-
}
|
559 |
-
} else if(payment_method == "adyen_oneclick") { // check if payment type is hpp
|
560 |
-
// set sub payment method back
|
561 |
-
$('recurring_type_'+payment_recurring_type).checked = true;
|
562 |
-
// set back the cvc code
|
563 |
-
$('adyen_oneclick_oneclick_cid_'+payment_recurring_type).value = payment_recurring_type_cvc.value;
|
564 |
-
// show the cvc code block
|
565 |
-
var cvc_block = "cvc_block_" + payment_recurring_type;
|
566 |
-
$(cvc_block).show();
|
567 |
-
}
|
568 |
-
} catch(err) {
|
569 |
-
|
570 |
-
}
|
571 |
-
}
|
572 |
-
}
|
573 |
-
}
|
574 |
-
},
|
575 |
-
parameters: parameters
|
576 |
-
});
|
577 |
-
|
578 |
-
}
|
579 |
-
}
|
580 |
-
|
581 |
-
function get_separate_save_methods_function(url, update_payments)
|
582 |
-
{
|
583 |
-
if(typeof update_payments == 'undefined') {
|
584 |
-
var update_payments = false;
|
585 |
-
}
|
586 |
-
|
587 |
-
return function(e) {
|
588 |
-
if(typeof e != 'undefined') {
|
589 |
-
var element = e.element();
|
590 |
-
|
591 |
-
if(element.name != 'shipping_method') {
|
592 |
-
update_payments = false;
|
593 |
-
}
|
594 |
-
}
|
595 |
-
|
596 |
-
var form = $('onestepcheckout-form');
|
597 |
-
var shipping_method = $RF(form, 'shipping_method');
|
598 |
-
var payment_method = $RF(form, 'payment[method]');
|
599 |
-
var payment_hpp_type = $RF(form, 'payment[hpp_type]');
|
600 |
-
var payment_hpp_ideal_type = $RF(form, 'payment[hpp_ideal_type]');
|
601 |
-
var payment_recurring_type = $RF(form, 'payment[recurring]');
|
602 |
-
var payment_recurring_type_cvc = $('adyen_oneclick_oneclick_cid_'+payment_recurring_type);
|
603 |
-
|
604 |
-
// save all input and select fields in array so after ajax call you can reset the values
|
605 |
-
var paymentInputFields = {};
|
606 |
-
var inputs = form.querySelectorAll("input,select");
|
607 |
-
for (x = 0 ; x < inputs.length ; x++){
|
608 |
-
inputname = inputs[x].getAttribute("name");
|
609 |
-
if(inputname != null) {
|
610 |
-
if(inputname.startsWith("payment") && inputs[x].type != "hidden") {
|
611 |
-
var inputname = inputname.replace('payment[','').replace(']','');
|
612 |
-
paymentInputFields[inputname] = inputs[x].value;
|
613 |
-
}
|
614 |
-
}
|
615 |
-
}
|
616 |
-
|
617 |
-
var totals = get_totals_element();
|
618 |
-
|
619 |
-
var freeMethod = $('p_method_free');
|
620 |
-
if(freeMethod){
|
621 |
-
payment.reloadcallback = true;
|
622 |
-
payment.countreload = 1;
|
623 |
-
}
|
624 |
-
|
625 |
-
totals.update('<div class="loading-ajax"> </div>');
|
626 |
-
|
627 |
-
if(update_payments) {
|
628 |
-
var payment_methods = $$('div.payment-methods')[0];
|
629 |
-
payment_methods.update('<div class="loading-ajax"> </div>');
|
630 |
-
}
|
631 |
-
|
632 |
-
var parameters = {
|
633 |
-
shipping_method: shipping_method,
|
634 |
-
payment_method: payment_method
|
635 |
-
}
|
636 |
-
|
637 |
-
/* Find payment parameters and include */
|
638 |
-
var items = $$('input[name^=payment]').concat($$('select[name^=payment]'));
|
639 |
-
var names = items.pluck('name');
|
640 |
-
var values = items.pluck('value');
|
641 |
-
|
642 |
-
for(var x=0; x < names.length; x++) {
|
643 |
-
if(names[x] != 'payment[method]') {
|
644 |
-
parameters[names[x]] = values[x];
|
645 |
-
}
|
646 |
-
}
|
647 |
-
|
648 |
-
new Ajax.Request(url, {
|
649 |
-
method: 'post',
|
650 |
-
onSuccess: function(transport) {
|
651 |
-
if(transport.status == 200) {
|
652 |
-
var data = transport.responseText.evalJSON();
|
653 |
-
var form = $('onestepcheckout-form');
|
654 |
-
|
655 |
-
totals.update(data.summary);
|
656 |
-
|
657 |
-
if(update_payments) {
|
658 |
-
|
659 |
-
payment_methods.replace(data.payment_method);
|
660 |
-
|
661 |
-
$$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
|
662 |
-
$$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
|
663 |
-
$$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
|
664 |
-
$$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
|
665 |
-
$$('div.onestepcheckout-payment-method-error').each(function(item) {
|
666 |
-
new Effect.Fade(item);
|
667 |
-
});
|
668 |
-
});
|
669 |
-
|
670 |
-
if($RF($('onestepcheckout-form'), 'payment[method]') != null) {
|
671 |
-
|
672 |
-
|
673 |
-
// loop through input fields and reset the values
|
674 |
-
for (var name in paymentInputFields) {
|
675 |
-
|
676 |
-
var inputname = "payment[" + name + "]";
|
677 |
-
var inputElements = document.getElementsByName(inputname);
|
678 |
-
var inputElement = inputElements[0];
|
679 |
-
|
680 |
-
if($(inputElement).type && $(inputElement).type.toLowerCase() != 'radio') {
|
681 |
-
// element is unique so get first and only item
|
682 |
-
inputElements[0].value = paymentInputFields[name];
|
683 |
-
}
|
684 |
-
}
|
685 |
-
|
686 |
-
try {
|
687 |
-
var payment_method = $RF(form, 'payment[method]');
|
688 |
-
$('container_payment_method_' + payment_method).show();
|
689 |
-
var payment_form = $('payment_form_' + payment_method);
|
690 |
-
if(payment_form)
|
691 |
-
$(payment_form).show();
|
692 |
-
else if(payment_method == "adyen_hpp") { // check if payment type is hpp (this has other id so should come in else )
|
693 |
-
// set sub payment method back
|
694 |
-
$('hpp_type_'+payment_hpp_type).checked = true;
|
695 |
-
|
696 |
-
// check if ideal payment bank is chosen
|
697 |
-
if(payment_hpp_type == "ideal") {
|
698 |
-
if(payment_hpp_ideal_type) {
|
699 |
-
// get issue_id this is before the slash
|
700 |
-
var issue_id = payment_hpp_ideal_type.substr(0, payment_hpp_ideal_type.indexOf('/'));
|
701 |
-
$('hpp_ideal_type_'+issue_id).checked = true;
|
702 |
-
}
|
703 |
-
$('payment_form_ideal').show();
|
704 |
-
}
|
705 |
-
} else if(payment_method == "adyen_oneclick") { // check if payment type is hpp
|
706 |
-
// set sub payment method back
|
707 |
-
$('recurring_type_'+payment_recurring_type).checked = true;
|
708 |
-
// set back the cvc code
|
709 |
-
$('adyen_oneclick_oneclick_cid_'+payment_recurring_type).value = payment_recurring_type_cvc.value;
|
710 |
-
// show the cvc code block
|
711 |
-
var cvc_block = "cvc_block_" + payment_recurring_type;
|
712 |
-
$(cvc_block).show();
|
713 |
-
// show update link url
|
714 |
-
var update_link = "update-expiration-date-" + payment_recurring_type;
|
715 |
-
$(update_link).show();
|
716 |
-
}
|
717 |
-
} catch(err) {
|
718 |
-
|
719 |
-
}
|
720 |
-
}
|
721 |
-
}
|
722 |
-
}
|
723 |
-
},
|
724 |
-
parameters: parameters
|
725 |
-
});
|
726 |
-
}
|
727 |
-
}
|
728 |
-
|
729 |
-
function paymentrefresh(url) {
|
730 |
-
var payment_methods = $$('div.payment-methods')[0];
|
731 |
-
payment_methods.update('<div class="loading-ajax"> </div>');
|
732 |
-
new Ajax.Request(url, {
|
733 |
-
method: 'get',
|
734 |
-
onSuccess: function(transport){
|
735 |
-
if(transport.status == 200) {
|
736 |
-
var data = transport.responseText.evalJSON();
|
737 |
-
payment_methods.replace(data.payment_method);
|
738 |
-
|
739 |
-
$$('div.payment-methods input[name="payment\[method\]"]', 'div.payment-methods input[name="payment\[useProfile\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
|
740 |
-
$$('div.payment-methods input[name="payment\[method\]"]', 'div.payment-methods input[name="payment\[useProfile\]"]').invoke('observe', 'click', function() {
|
741 |
-
$$('div.onestepcheckout-payment-method-error').each(function(item) {
|
742 |
-
new Effect.Fade(item);
|
743 |
-
});
|
744 |
-
});
|
745 |
-
|
746 |
-
if($RF(form, 'payment[method]') != null) {
|
747 |
-
try {
|
748 |
-
var payment_method = $RF(form, 'payment[method]');
|
749 |
-
$('container_payment_method_' + payment_method).show();
|
750 |
-
$('payment_form_' + payment_method).show();
|
751 |
-
} catch(err){}
|
752 |
-
}
|
753 |
-
|
754 |
-
}
|
755 |
-
}
|
756 |
-
});
|
757 |
-
}
|
758 |
-
|
759 |
-
function addressPreview(templates, target) {
|
760 |
-
var bparams = {};
|
761 |
-
var sparams = {};
|
762 |
-
var savedBillingItems = $('billing-address-select');
|
763 |
-
if(savedBillingItems && savedBillingItems.getValue()){
|
764 |
-
index = savedBillingItems.selectedIndex;
|
765 |
-
bparams = customerBAddresses[index];
|
766 |
-
} else {
|
767 |
-
var items = $$('input[name^=billing]').concat($$('select[name^=billing]'));
|
768 |
-
items.each(function(s) {
|
769 |
-
if(s.getStyle('display') != 'none'){
|
770 |
-
selectText = s.options
|
771 |
-
if(selectText){
|
772 |
-
value = selectText[s.selectedIndex].text;
|
773 |
-
} else {
|
774 |
-
value = s.getValue();
|
775 |
-
}
|
776 |
-
if(value){
|
777 |
-
value = '<span class="' + s.id.replace(':','-') + '">' + value.escapeHTML() + '</span>';
|
778 |
-
}
|
779 |
-
if(s.id == 'billing:region_id'){
|
780 |
-
bparams['billing:region'] = value;
|
781 |
-
} else {
|
782 |
-
bparams[s.id] = value;
|
783 |
-
}
|
784 |
-
}
|
785 |
-
});
|
786 |
-
}
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
var savedShippingItems = $('shipping-address-select');
|
791 |
-
if(savedShippingItems && savedShippingItems.getValue()){
|
792 |
-
index = savedShippingItems.selectedIndex;
|
793 |
-
sparams = customerSAddresses[index];
|
794 |
-
} else {
|
795 |
-
var items = $$('input[name^=shipping]').concat($$('select[name^=shipping]'));
|
796 |
-
items.each(function(s) {
|
797 |
-
if(s.getStyle('display') != 'none'){
|
798 |
-
selectText = s.options
|
799 |
-
if(selectText){
|
800 |
-
value = selectText[s.selectedIndex].text;
|
801 |
-
} else {
|
802 |
-
value = s.getValue();
|
803 |
-
}
|
804 |
-
if(value){
|
805 |
-
value = '<span class="' + s.id.replace(':','-') + '">' + value.escapeHTML() + '</span>';
|
806 |
-
}
|
807 |
-
if(s.id == 'shipping:region_id'){
|
808 |
-
sparams['shipping:region'] = value;
|
809 |
-
} else {
|
810 |
-
sparams[s.id] = value;
|
811 |
-
}
|
812 |
-
}
|
813 |
-
});
|
814 |
-
}
|
815 |
-
|
816 |
-
|
817 |
-
var form = $('onestepcheckout-form');
|
818 |
-
|
819 |
-
var shipping_method = $RF(form, 'shipping_method');
|
820 |
-
if(shipping_method){
|
821 |
-
var shipping_label = $('s_method_' + shipping_method).up('dt').down('label').innerHTML.stripScripts();
|
822 |
-
var shipping_title = $('s_method_' + shipping_method).up('dt').previous('dd').innerHTML.stripScripts();
|
823 |
-
var shipping_row = shipping_title + ' - ' + shipping_label
|
824 |
-
}
|
825 |
-
|
826 |
-
var useOnlyBilling = $('billing:use_for_shipping_yes').getValue();
|
827 |
-
billinga_template = new Template(templates.billing);
|
828 |
-
|
829 |
-
if(useOnlyBilling){
|
830 |
-
shippinga_template = new Template(templates.billing);
|
831 |
-
}else{
|
832 |
-
shippinga_template = new Template(templates.shipping);
|
833 |
-
}
|
834 |
-
|
835 |
-
var payment_method = payment.currentMethod;
|
836 |
-
|
837 |
-
if(payment_method){
|
838 |
-
var payment_label = $('p_method_'+payment_method).up('dt').down('label').innerHTML.stripScripts();
|
839 |
-
}
|
840 |
-
|
841 |
-
var targetelem = $(target + '_billinga').childElements()[1];
|
842 |
-
if(targetelem){
|
843 |
-
targetelem.update(billinga_template.evaluate(bparams));
|
844 |
-
}
|
845 |
-
|
846 |
-
var targetelem = $(target + '_shippinga').childElements()[1];
|
847 |
-
if(targetelem){
|
848 |
-
if(useOnlyBilling){
|
849 |
-
targetelem.update(shippinga_template.evaluate(bparams));
|
850 |
-
}else{
|
851 |
-
targetelem.update(shippinga_template.evaluate(sparams));
|
852 |
-
}
|
853 |
-
}
|
854 |
-
|
855 |
-
var targetelem = $(target + '_shipping').childElements()[1];
|
856 |
-
if(targetelem){
|
857 |
-
targetelem.update(shipping_row);
|
858 |
-
}
|
859 |
-
|
860 |
-
var targetelem = $(target + '_payment').childElements()[1];
|
861 |
-
if(targetelem){
|
862 |
-
targetelem.update(payment_label);
|
863 |
-
}
|
864 |
-
|
865 |
-
var targetelem = $(target + '_summary').childElements()[1];
|
866 |
-
if(targetelem){
|
867 |
-
targetelem.update('');
|
868 |
-
targetelem.insert($$('table.onestepcheckout-summary')[0].cloneNode(true));
|
869 |
-
targetelem.insert($$('table.onestepcheckout-totals')[0].cloneNode(true));
|
870 |
-
}
|
871 |
-
}
|
872 |
-
|
873 |
-
|
874 |
-
var Checkout = Class.create();
|
875 |
-
Checkout.prototype = {
|
876 |
-
initialize: function(){
|
877 |
-
this.accordion = '';
|
878 |
-
this.progressUrl = '';
|
879 |
-
this.reviewUrl = '';
|
880 |
-
this.saveMethodUrl = '';
|
881 |
-
this.failureUrl = '';
|
882 |
-
this.billingForm = false;
|
883 |
-
this.shippingForm= false;
|
884 |
-
this.syncBillingShipping = false;
|
885 |
-
this.method = '';
|
886 |
-
this.payment = '';
|
887 |
-
this.loadWaiting = false;
|
888 |
-
},
|
889 |
-
|
890 |
-
ajaxFailure: function(){
|
891 |
-
location.href = this.failureUrl;
|
892 |
-
},
|
893 |
-
|
894 |
-
setLoadWaiting: function(step, keepDisabled) {
|
895 |
-
return true
|
896 |
-
}
|
897 |
-
};
|
898 |
-
|
899 |
-
//billing
|
900 |
-
var Billing = Class.create();
|
901 |
-
Billing.prototype = {
|
902 |
-
initialize: function(form, addressUrl, saveUrl){
|
903 |
-
this.form = form;
|
904 |
-
},
|
905 |
-
|
906 |
-
setAddress: function(addressId){
|
907 |
-
|
908 |
-
},
|
909 |
-
|
910 |
-
newAddress: function(isNew){
|
911 |
-
if (isNew) {
|
912 |
-
//this.resetSelectedAddress();
|
913 |
-
Element.show('billing_address_list');
|
914 |
-
if($('billing:use_for_shipping_yes').getValue() != "1" && $('shipping-address-select').getValue() == ''){
|
915 |
-
Element.show('shipping_address_list');
|
916 |
-
}
|
917 |
-
|
918 |
-
} else {
|
919 |
-
Element.hide('billing_address_list');
|
920 |
-
}
|
921 |
-
$$('input[name^=billing]', 'select[id=billing:region_id]').each(function(e){
|
922 |
-
if(e.name=='billing[use_for_shipping]' || e.name=='billing[save_in_address_book]'){
|
923 |
-
|
924 |
-
} else {
|
925 |
-
e.value = '';
|
926 |
-
}
|
927 |
-
});
|
928 |
-
},
|
929 |
-
|
930 |
-
resetSelectedAddress: function(){
|
931 |
-
var selectElement = $('shipping-address-select')
|
932 |
-
if (selectElement) {
|
933 |
-
selectElement.value='';
|
934 |
-
}
|
935 |
-
},
|
936 |
-
|
937 |
-
fillForm: function(transport){
|
938 |
-
|
939 |
-
},
|
940 |
-
|
941 |
-
setUseForShipping: function(flag) {
|
942 |
-
|
943 |
-
},
|
944 |
-
|
945 |
-
save: function(){
|
946 |
-
|
947 |
-
},
|
948 |
-
|
949 |
-
resetLoadWaiting: function(transport){
|
950 |
-
|
951 |
-
},
|
952 |
-
|
953 |
-
nextStep: function(transport){
|
954 |
-
|
955 |
-
}
|
956 |
-
};
|
957 |
-
|
958 |
-
//shipping
|
959 |
-
var Shipping = Class.create();
|
960 |
-
Shipping.prototype = {
|
961 |
-
initialize: function(form){
|
962 |
-
this.form = form;
|
963 |
-
},
|
964 |
-
|
965 |
-
setAddress: function(addressId){
|
966 |
-
|
967 |
-
},
|
968 |
-
|
969 |
-
newAddress: function(isNew){
|
970 |
-
if (isNew) {
|
971 |
-
this.resetSelectedAddress();
|
972 |
-
Element.show('shipping_address_list');
|
973 |
-
} else {
|
974 |
-
Element.hide('shipping_address_list');
|
975 |
-
}
|
976 |
-
|
977 |
-
$$('#shipping_address input[name^=shipping],#shipping_address select[id=shipping:region_id]').each(function(e){
|
978 |
-
if(e.name=='shipping[save_in_address_book]'){
|
979 |
-
|
980 |
-
} else {
|
981 |
-
e.value = '';
|
982 |
-
}
|
983 |
-
})
|
984 |
-
|
985 |
-
},
|
986 |
-
|
987 |
-
resetSelectedAddress: function(){
|
988 |
-
var selectElement = $('shipping-address-select')
|
989 |
-
if (selectElement) {
|
990 |
-
selectElement.value='';
|
991 |
-
}
|
992 |
-
},
|
993 |
-
|
994 |
-
fillForm: function(transport){
|
995 |
-
|
996 |
-
},
|
997 |
-
|
998 |
-
setSameAsBilling: function(flag) {
|
999 |
-
|
1000 |
-
},
|
1001 |
-
|
1002 |
-
syncWithBilling: function () {
|
1003 |
-
|
1004 |
-
},
|
1005 |
-
|
1006 |
-
setRegionValue: function(){
|
1007 |
-
//$('shipping:region').value = $('billing:region').value;
|
1008 |
-
},
|
1009 |
-
|
1010 |
-
save: function(){
|
1011 |
-
|
1012 |
-
}
|
1013 |
-
};
|
1014 |
-
|
1015 |
-
//payment object
|
1016 |
-
var Payment = Class.create();
|
1017 |
-
Payment.prototype = {
|
1018 |
-
beforeInitFunc:$H({}),
|
1019 |
-
afterInitFunc:$H({}),
|
1020 |
-
beforeValidateFunc:$H({}),
|
1021 |
-
afterValidateFunc:$H({}),
|
1022 |
-
initialize: function(form, saveUrl){
|
1023 |
-
this.form = form;
|
1024 |
-
this.saveUrl = saveUrl;
|
1025 |
-
},
|
1026 |
-
|
1027 |
-
init : function () {
|
1028 |
-
var elements = Form.getElements(this.form);
|
1029 |
-
if ($(this.form)) {
|
1030 |
-
//$(this.form).observe('submit', function(event){this.save();Event.stop(event);}.bind(this));
|
1031 |
-
}
|
1032 |
-
var method = null;
|
1033 |
-
for (var i=0; i<elements.length; i++) {
|
1034 |
-
if (elements[i].name=='payment[method]') {
|
1035 |
-
if (elements[i].checked) {
|
1036 |
-
method = elements[i].value;
|
1037 |
-
}
|
1038 |
-
} else {
|
1039 |
-
elements[i].disabled = true;
|
1040 |
-
}
|
1041 |
-
}
|
1042 |
-
if (method) this.switchMethod(method);
|
1043 |
-
},
|
1044 |
-
|
1045 |
-
switchMethod: function(method){
|
1046 |
-
if (this.currentMethod && $('payment_form_'+this.currentMethod)) {
|
1047 |
-
var form = $('payment_form_'+this.currentMethod);
|
1048 |
-
form.style.display = 'none';
|
1049 |
-
var elements = form.select('input').concat(form.select('select')).concat(form.select('textarea'));
|
1050 |
-
for (var i=0; i<elements.length; i++) elements[i].disabled = true;
|
1051 |
-
}
|
1052 |
-
|
1053 |
-
if ($('payment_form_'+method)){
|
1054 |
-
var form = $('payment_form_'+method);
|
1055 |
-
form.style.display = '';
|
1056 |
-
var elements = form.select('input').concat(form.select('select')).concat(form.select('textarea'));
|
1057 |
-
for (var i=0; i<elements.length; i++) elements[i].disabled = false;
|
1058 |
-
this.currentMethod = method;
|
1059 |
-
}
|
1060 |
-
},
|
1061 |
-
|
1062 |
-
addBeforeValidateFunction : function(code, func) {
|
1063 |
-
this.beforeValidateFunc.set(code, func);
|
1064 |
-
},
|
1065 |
-
|
1066 |
-
beforeValidate : function() {
|
1067 |
-
var validateResult = true;
|
1068 |
-
var hasValidation = false;
|
1069 |
-
(this.beforeValidateFunc).each(function(validate){
|
1070 |
-
hasValidation = true;
|
1071 |
-
if ((validate.value)() == false) {
|
1072 |
-
validateResult = false;
|
1073 |
-
}
|
1074 |
-
}.bind(this));
|
1075 |
-
if (!hasValidation) {
|
1076 |
-
validateResult = false;
|
1077 |
-
}
|
1078 |
-
return validateResult;
|
1079 |
-
},
|
1080 |
-
|
1081 |
-
validate: function() {
|
1082 |
-
var methods = document.getElementsByName('payment[method]');
|
1083 |
-
if (methods.length==0) {
|
1084 |
-
alert(Translator.translate('Your order can not be completed at this time as there is no payment methods available for it.'));
|
1085 |
-
return false;
|
1086 |
-
}
|
1087 |
-
for (var i=0; i<methods.length; i++) {
|
1088 |
-
if (methods[i].checked) {
|
1089 |
-
return true;
|
1090 |
-
}
|
1091 |
-
}
|
1092 |
-
alert(Translator.translate('Please specify payment method.'));
|
1093 |
-
return false;
|
1094 |
-
},
|
1095 |
-
|
1096 |
-
save: function(){
|
1097 |
-
},
|
1098 |
-
addAfterInitFunction : function(code, func) {
|
1099 |
-
this.afterInitFunc.set(code, func);
|
1100 |
-
},
|
1101 |
-
|
1102 |
-
afterInit : function() {
|
1103 |
-
(this.afterInitFunc).each(function(init){
|
1104 |
-
(init.value)();
|
1105 |
-
});
|
1106 |
-
}
|
1107 |
-
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1,1107 +0,0 @@
|
|
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"> </div>');
|
296 |
-
|
297 |
-
if(update_payments) {
|
298 |
-
var payment_methods = $$('div.payment-methods')[0];
|
299 |
-
payment_methods.update('<div class="loading-ajax"> </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"> </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[method]');
|
454 |
-
var payment_recurring_type_cvc = $('adyen_oneclick_oneclick_cid_'+payment_recurring_type);
|
455 |
-
var payment_method = $RF(form, 'payment[method]');
|
456 |
-
|
457 |
-
// save all input and select fields in array so after ajax call you can reset the values
|
458 |
-
var paymentInputFields = {};
|
459 |
-
var inputs = form.querySelectorAll("input,select");
|
460 |
-
for (x = 0 ; x < inputs.length ; x++){
|
461 |
-
inputname = inputs[x].getAttribute("name");
|
462 |
-
if(inputname != null) {
|
463 |
-
if(inputname.startsWith("payment") && inputs[x].type != "hidden") {
|
464 |
-
var inputname = inputname.replace('payment[','').replace(']','');
|
465 |
-
paymentInputFields[inputname] = inputs[x].value;
|
466 |
-
}
|
467 |
-
}
|
468 |
-
}
|
469 |
-
|
470 |
-
parameters['payment_method'] = payment_method;
|
471 |
-
parameters['payment[method]'] = payment_method;
|
472 |
-
|
473 |
-
if(update_payments){
|
474 |
-
var payment_methods = $$('div.payment-methods')[0];
|
475 |
-
payment_methods.update('<div class="loading-ajax"> </div>');
|
476 |
-
}
|
477 |
-
|
478 |
-
var totals = get_totals_element();
|
479 |
-
totals.update('<div class="loading-ajax"> </div>');
|
480 |
-
|
481 |
-
|
482 |
-
new Ajax.Request(url, {
|
483 |
-
method: 'post',
|
484 |
-
onSuccess: function(transport) {
|
485 |
-
if(transport.status == 200) {
|
486 |
-
|
487 |
-
var data = transport.responseText.evalJSON();
|
488 |
-
|
489 |
-
// Update shipment methods
|
490 |
-
if(shipment_methods_found) {
|
491 |
-
shipment_methods.update(data.shipping_method);
|
492 |
-
}
|
493 |
-
|
494 |
-
if(update_payments){
|
495 |
-
payment_methods.replace(data.payment_method);
|
496 |
-
}
|
497 |
-
|
498 |
-
totals.update(data.summary);
|
499 |
-
|
500 |
-
|
501 |
-
}
|
502 |
-
},
|
503 |
-
onComplete: function(transport){
|
504 |
-
if(transport.status == 200) {
|
505 |
-
if(shipment_methods_found) {
|
506 |
-
$$('dl.shipment-methods input').invoke('observe', 'click', get_separate_save_methods_function(set_methods_url, update_payments));
|
507 |
-
$$('dl.shipment-methods input').invoke('observe', 'click', function() {
|
508 |
-
$$('div.onestepcheckout-shipment-method-error').each(function(item) {
|
509 |
-
new Effect.Fade(item);
|
510 |
-
});
|
511 |
-
});
|
512 |
-
}
|
513 |
-
|
514 |
-
if(update_payments){
|
515 |
-
$$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(set_methods_url));
|
516 |
-
$$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
|
517 |
-
$$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
|
518 |
-
|
519 |
-
$$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
|
520 |
-
$$('div.onestepcheckout-payment-method-error').each(function(item) {
|
521 |
-
new Effect.Fade(item);
|
522 |
-
});
|
523 |
-
});
|
524 |
-
|
525 |
-
if($RF(form, 'payment[method]') != null) {
|
526 |
-
|
527 |
-
// loop through input fields and reset the values
|
528 |
-
for (var name in paymentInputFields) {
|
529 |
-
|
530 |
-
var inputname = "payment[" + name + "]";
|
531 |
-
var inputElements = document.getElementsByName(inputname);
|
532 |
-
var inputElement = inputElements[0];
|
533 |
-
|
534 |
-
if($(inputElement).type && $(inputElement).type.toLowerCase() != 'radio') {
|
535 |
-
// element is unique so get first and only item
|
536 |
-
inputElements[0].value = paymentInputFields[name];
|
537 |
-
}
|
538 |
-
}
|
539 |
-
|
540 |
-
try {
|
541 |
-
var payment_method = $RF(form, 'payment[method]');
|
542 |
-
$('container_payment_method_' + payment_method).show();
|
543 |
-
var payment_form = $('payment_form_' + payment_method);
|
544 |
-
if(payment_form)
|
545 |
-
$(payment_form).show();
|
546 |
-
else if(payment_method == "adyen_hpp") { // check if payment type is hpp (this has other id so should come in else )
|
547 |
-
// set sub payment method back
|
548 |
-
$('hpp_type_'+payment_hpp_type).checked = true;
|
549 |
-
|
550 |
-
// check if ideal payment bank is chosen
|
551 |
-
if(payment_hpp_type == "ideal") {
|
552 |
-
if(payment_hpp_ideal_type) {
|
553 |
-
// get issue_id this is before the slash
|
554 |
-
var issue_id = payment_hpp_ideal_type.substr(0, payment_hpp_ideal_type.indexOf('/'));
|
555 |
-
$('hpp_ideal_type_'+issue_id).checked = true;
|
556 |
-
}
|
557 |
-
$('payment_form_ideal').show();
|
558 |
-
}
|
559 |
-
} else if(payment_method == "adyen_oneclick") { // check if payment type is hpp
|
560 |
-
// set sub payment method back
|
561 |
-
$('recurring_type_'+payment_recurring_type).checked = true;
|
562 |
-
// set back the cvc code
|
563 |
-
$('adyen_oneclick_oneclick_cid_'+payment_recurring_type).value = payment_recurring_type_cvc.value;
|
564 |
-
// show the cvc code block
|
565 |
-
var cvc_block = "cvc_block_" + payment_recurring_type;
|
566 |
-
$(cvc_block).show();
|
567 |
-
}
|
568 |
-
} catch(err) {
|
569 |
-
|
570 |
-
}
|
571 |
-
}
|
572 |
-
}
|
573 |
-
}
|
574 |
-
},
|
575 |
-
parameters: parameters
|
576 |
-
});
|
577 |
-
|
578 |
-
}
|
579 |
-
}
|
580 |
-
|
581 |
-
function get_separate_save_methods_function(url, update_payments)
|
582 |
-
{
|
583 |
-
if(typeof update_payments == 'undefined') {
|
584 |
-
var update_payments = false;
|
585 |
-
}
|
586 |
-
|
587 |
-
return function(e) {
|
588 |
-
if(typeof e != 'undefined') {
|
589 |
-
var element = e.element();
|
590 |
-
|
591 |
-
if(element.name != 'shipping_method') {
|
592 |
-
update_payments = false;
|
593 |
-
}
|
594 |
-
}
|
595 |
-
|
596 |
-
var form = $('onestepcheckout-form');
|
597 |
-
var shipping_method = $RF(form, 'shipping_method');
|
598 |
-
var payment_method = $RF(form, 'payment[method]');
|
599 |
-
var payment_hpp_type = $RF(form, 'payment[hpp_type]');
|
600 |
-
var payment_hpp_ideal_type = $RF(form, 'payment[hpp_ideal_type]');
|
601 |
-
var payment_recurring_type = $RF(form, 'payment[recurring]');
|
602 |
-
var payment_recurring_type_cvc = $('adyen_oneclick_oneclick_cid_'+payment_recurring_type);
|
603 |
-
|
604 |
-
// save all input and select fields in array so after ajax call you can reset the values
|
605 |
-
var paymentInputFields = {};
|
606 |
-
var inputs = form.querySelectorAll("input,select");
|
607 |
-
for (x = 0 ; x < inputs.length ; x++){
|
608 |
-
inputname = inputs[x].getAttribute("name");
|
609 |
-
if(inputname != null) {
|
610 |
-
if(inputname.startsWith("payment") && inputs[x].type != "hidden") {
|
611 |
-
var inputname = inputname.replace('payment[','').replace(']','');
|
612 |
-
paymentInputFields[inputname] = inputs[x].value;
|
613 |
-
}
|
614 |
-
}
|
615 |
-
}
|
616 |
-
|
617 |
-
var totals = get_totals_element();
|
618 |
-
|
619 |
-
var freeMethod = $('p_method_free');
|
620 |
-
if(freeMethod){
|
621 |
-
payment.reloadcallback = true;
|
622 |
-
payment.countreload = 1;
|
623 |
-
}
|
624 |
-
|
625 |
-
totals.update('<div class="loading-ajax"> </div>');
|
626 |
-
|
627 |
-
if(update_payments) {
|
628 |
-
var payment_methods = $$('div.payment-methods')[0];
|
629 |
-
payment_methods.update('<div class="loading-ajax"> </div>');
|
630 |
-
}
|
631 |
-
|
632 |
-
var parameters = {
|
633 |
-
shipping_method: shipping_method,
|
634 |
-
payment_method: payment_method
|
635 |
-
}
|
636 |
-
|
637 |
-
/* Find payment parameters and include */
|
638 |
-
var items = $$('input[name^=payment]').concat($$('select[name^=payment]'));
|
639 |
-
var names = items.pluck('name');
|
640 |
-
var values = items.pluck('value');
|
641 |
-
|
642 |
-
for(var x=0; x < names.length; x++) {
|
643 |
-
if(names[x] != 'payment[method]') {
|
644 |
-
parameters[names[x]] = values[x];
|
645 |
-
}
|
646 |
-
}
|
647 |
-
|
648 |
-
new Ajax.Request(url, {
|
649 |
-
method: 'post',
|
650 |
-
onSuccess: function(transport) {
|
651 |
-
if(transport.status == 200) {
|
652 |
-
var data = transport.responseText.evalJSON();
|
653 |
-
var form = $('onestepcheckout-form');
|
654 |
-
|
655 |
-
totals.update(data.summary);
|
656 |
-
|
657 |
-
if(update_payments) {
|
658 |
-
|
659 |
-
payment_methods.replace(data.payment_method);
|
660 |
-
|
661 |
-
$$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
|
662 |
-
$$('div.payment-methods input[name="payment[hpp_type]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange hpp method reload
|
663 |
-
$$('div.payment-methods input[name="payment[recurring]"]').invoke('observe', 'click', get_separate_save_methods_function(url)); // for Adyen onchange oneclick method reload
|
664 |
-
$$('div.payment-methods input[name="payment\[method\]"]').invoke('observe', 'click', function() {
|
665 |
-
$$('div.onestepcheckout-payment-method-error').each(function(item) {
|
666 |
-
new Effect.Fade(item);
|
667 |
-
});
|
668 |
-
});
|
669 |
-
|
670 |
-
if($RF($('onestepcheckout-form'), 'payment[method]') != null) {
|
671 |
-
|
672 |
-
|
673 |
-
// loop through input fields and reset the values
|
674 |
-
for (var name in paymentInputFields) {
|
675 |
-
|
676 |
-
var inputname = "payment[" + name + "]";
|
677 |
-
var inputElements = document.getElementsByName(inputname);
|
678 |
-
var inputElement = inputElements[0];
|
679 |
-
|
680 |
-
if($(inputElement).type && $(inputElement).type.toLowerCase() != 'radio') {
|
681 |
-
// element is unique so get first and only item
|
682 |
-
inputElements[0].value = paymentInputFields[name];
|
683 |
-
}
|
684 |
-
}
|
685 |
-
|
686 |
-
try {
|
687 |
-
var payment_method = $RF(form, 'payment[method]');
|
688 |
-
$('container_payment_method_' + payment_method).show();
|
689 |
-
var payment_form = $('payment_form_' + payment_method);
|
690 |
-
if(payment_form)
|
691 |
-
$(payment_form).show();
|
692 |
-
else if(payment_method == "adyen_hpp") { // check if payment type is hpp (this has other id so should come in else )
|
693 |
-
// set sub payment method back
|
694 |
-
$('hpp_type_'+payment_hpp_type).checked = true;
|
695 |
-
|
696 |
-
// check if ideal payment bank is chosen
|
697 |
-
if(payment_hpp_type == "ideal") {
|
698 |
-
if(payment_hpp_ideal_type) {
|
699 |
-
// get issue_id this is before the slash
|
700 |
-
var issue_id = payment_hpp_ideal_type.substr(0, payment_hpp_ideal_type.indexOf('/'));
|
701 |
-
$('hpp_ideal_type_'+issue_id).checked = true;
|
702 |
-
}
|
703 |
-
$('payment_form_ideal').show();
|
704 |
-
}
|
705 |
-
} else if(payment_method == "adyen_oneclick") { // check if payment type is hpp
|
706 |
-
// set sub payment method back
|
707 |
-
$('recurring_type_'+payment_recurring_type).checked = true;
|
708 |
-
// set back the cvc code
|
709 |
-
$('adyen_oneclick_oneclick_cid_'+payment_recurring_type).value = payment_recurring_type_cvc.value;
|
710 |
-
// show the cvc code block
|
711 |
-
var cvc_block = "cvc_block_" + payment_recurring_type;
|
712 |
-
$(cvc_block).show();
|
713 |
-
// show update link url
|
714 |
-
var update_link = "update-expiration-date-" + payment_recurring_type;
|
715 |
-
$(update_link).show();
|
716 |
-
}
|
717 |
-
} catch(err) {
|
718 |
-
|
719 |
-
}
|
720 |
-
}
|
721 |
-
}
|
722 |
-
}
|
723 |
-
},
|
724 |
-
parameters: parameters
|
725 |
-
});
|
726 |
-
}
|
727 |
-
}
|
728 |
-
|
729 |
-
function paymentrefresh(url) {
|
730 |
-
var payment_methods = $$('div.payment-methods')[0];
|
731 |
-
payment_methods.update('<div class="loading-ajax"> </div>');
|
732 |
-
new Ajax.Request(url, {
|
733 |
-
method: 'get',
|
734 |
-
onSuccess: function(transport){
|
735 |
-
if(transport.status == 200) {
|
736 |
-
var data = transport.responseText.evalJSON();
|
737 |
-
payment_methods.replace(data.payment_method);
|
738 |
-
|
739 |
-
$$('div.payment-methods input[name="payment\[method\]"]', 'div.payment-methods input[name="payment\[useProfile\]"]').invoke('observe', 'click', get_separate_save_methods_function(url));
|
740 |
-
$$('div.payment-methods input[name="payment\[method\]"]', 'div.payment-methods input[name="payment\[useProfile\]"]').invoke('observe', 'click', function() {
|
741 |
-
$$('div.onestepcheckout-payment-method-error').each(function(item) {
|
742 |
-
new Effect.Fade(item);
|
743 |
-
});
|
744 |
-
});
|
745 |
-
|
746 |
-
if($RF(form, 'payment[method]') != null) {
|
747 |
-
try {
|
748 |
-
var payment_method = $RF(form, 'payment[method]');
|
749 |
-
$('container_payment_method_' + payment_method).show();
|
750 |
-
$('payment_form_' + payment_method).show();
|
751 |
-
} catch(err){}
|
752 |
-
}
|
753 |
-
|
754 |
-
}
|
755 |
-
}
|
756 |
-
});
|
757 |
-
}
|
758 |
-
|
759 |
-
function addressPreview(templates, target) {
|
760 |
-
var bparams = {};
|
761 |
-
var sparams = {};
|
762 |
-
var savedBillingItems = $('billing-address-select');
|
763 |
-
if(savedBillingItems && savedBillingItems.getValue()){
|
764 |
-
index = savedBillingItems.selectedIndex;
|
765 |
-
bparams = customerBAddresses[index];
|
766 |
-
} else {
|
767 |
-
var items = $$('input[name^=billing]').concat($$('select[name^=billing]'));
|
768 |
-
items.each(function(s) {
|
769 |
-
if(s.getStyle('display') != 'none'){
|
770 |
-
selectText = s.options
|
771 |
-
if(selectText){
|
772 |
-
value = selectText[s.selectedIndex].text;
|
773 |
-
} else {
|
774 |
-
value = s.getValue();
|
775 |
-
}
|
776 |
-
if(value){
|
777 |
-
value = '<span class="' + s.id.replace(':','-') + '">' + value.escapeHTML() + '</span>';
|
778 |
-
}
|
779 |
-
if(s.id == 'billing:region_id'){
|
780 |
-
bparams['billing:region'] = value;
|
781 |
-
} else {
|
782 |
-
bparams[s.id] = value;
|
783 |
-
}
|
784 |
-
}
|
785 |
-
});
|
786 |
-
}
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
var savedShippingItems = $('shipping-address-select');
|
791 |
-
if(savedShippingItems && savedShippingItems.getValue()){
|
792 |
-
index = savedShippingItems.selectedIndex;
|
793 |
-
sparams = customerSAddresses[index];
|
794 |
-
} else {
|
795 |
-
var items = $$('input[name^=shipping]').concat($$('select[name^=shipping]'));
|
796 |
-
items.each(function(s) {
|
797 |
-
if(s.getStyle('display') != 'none'){
|
798 |
-
selectText = s.options
|
799 |
-
if(selectText){
|
800 |
-
value = selectText[s.selectedIndex].text;
|
801 |
-
} else {
|
802 |
-
value = s.getValue();
|
803 |
-
}
|
804 |
-
if(value){
|
805 |
-
value = '<span class="' + s.id.replace(':','-') + '">' + value.escapeHTML() + '</span>';
|
806 |
-
}
|
807 |
-
if(s.id == 'shipping:region_id'){
|
808 |
-
sparams['shipping:region'] = value;
|
809 |
-
} else {
|
810 |
-
sparams[s.id] = value;
|
811 |
-
}
|
812 |
-
}
|
813 |
-
});
|
814 |
-
}
|
815 |
-
|
816 |
-
|
817 |
-
var form = $('onestepcheckout-form');
|
818 |
-
|
819 |
-
var shipping_method = $RF(form, 'shipping_method');
|
820 |
-
if(shipping_method){
|
821 |
-
var shipping_label = $('s_method_' + shipping_method).up('dt').down('label').innerHTML.stripScripts();
|
822 |
-
var shipping_title = $('s_method_' + shipping_method).up('dt').previous('dd').innerHTML.stripScripts();
|
823 |
-
var shipping_row = shipping_title + ' - ' + shipping_label
|
824 |
-
}
|
825 |
-
|
826 |
-
var useOnlyBilling = $('billing:use_for_shipping_yes').getValue();
|
827 |
-
billinga_template = new Template(templates.billing);
|
828 |
-
|
829 |
-
if(useOnlyBilling){
|
830 |
-
shippinga_template = new Template(templates.billing);
|
831 |
-
}else{
|
832 |
-
shippinga_template = new Template(templates.shipping);
|
833 |
-
}
|
834 |
-
|
835 |
-
var payment_method = payment.currentMethod;
|
836 |
-
|
837 |
-
if(payment_method){
|
838 |
-
var payment_label = $('p_method_'+payment_method).up('dt').down('label').innerHTML.stripScripts();
|
839 |
-
}
|
840 |
-
|
841 |
-
var targetelem = $(target + '_billinga').childElements()[1];
|
842 |
-
if(targetelem){
|
843 |
-
targetelem.update(billinga_template.evaluate(bparams));
|
844 |
-
}
|
845 |
-
|
846 |
-
var targetelem = $(target + '_shippinga').childElements()[1];
|
847 |
-
if(targetelem){
|
848 |
-
if(useOnlyBilling){
|
849 |
-
targetelem.update(shippinga_template.evaluate(bparams));
|
850 |
-
}else{
|
851 |
-
targetelem.update(shippinga_template.evaluate(sparams));
|
852 |
-
}
|
853 |
-
}
|
854 |
-
|
855 |
-
var targetelem = $(target + '_shipping').childElements()[1];
|
856 |
-
if(targetelem){
|
857 |
-
targetelem.update(shipping_row);
|
858 |
-
}
|
859 |
-
|
860 |
-
var targetelem = $(target + '_payment').childElements()[1];
|
861 |
-
if(targetelem){
|
862 |
-
targetelem.update(payment_label);
|
863 |
-
}
|
864 |
-
|
865 |
-
var targetelem = $(target + '_summary').childElements()[1];
|
866 |
-
if(targetelem){
|
867 |
-
targetelem.update('');
|
868 |
-
targetelem.insert($$('table.onestepcheckout-summary')[0].cloneNode(true));
|
869 |
-
targetelem.insert($$('table.onestepcheckout-totals')[0].cloneNode(true));
|
870 |
-
}
|
871 |
-
}
|
872 |
-
|
873 |
-
|
874 |
-
var Checkout = Class.create();
|
875 |
-
Checkout.prototype = {
|
876 |
-
initialize: function(){
|
877 |
-
this.accordion = '';
|
878 |
-
this.progressUrl = '';
|
879 |
-
this.reviewUrl = '';
|
880 |
-
this.saveMethodUrl = '';
|
881 |
-
this.failureUrl = '';
|
882 |
-
this.billingForm = false;
|
883 |
-
this.shippingForm= false;
|
884 |
-
this.syncBillingShipping = false;
|
885 |
-
this.method = '';
|
886 |
-
this.payment = '';
|
887 |
-
this.loadWaiting = false;
|
888 |
-
},
|
889 |
-
|
890 |
-
ajaxFailure: function(){
|
891 |
-
location.href = this.failureUrl;
|
892 |
-
},
|
893 |
-
|
894 |
-
setLoadWaiting: function(step, keepDisabled) {
|
895 |
-
return true
|
896 |
-
}
|
897 |
-
};
|
898 |
-
|
899 |
-
//billing
|
900 |
-
var Billing = Class.create();
|
901 |
-
Billing.prototype = {
|
902 |
-
initialize: function(form, addressUrl, saveUrl){
|
903 |
-
this.form = form;
|
904 |
-
},
|
905 |
-
|
906 |
-
setAddress: function(addressId){
|
907 |
-
|
908 |
-
},
|
909 |
-
|
910 |
-
newAddress: function(isNew){
|
911 |
-
if (isNew) {
|
912 |
-
//this.resetSelectedAddress();
|
913 |
-
Element.show('billing_address_list');
|
914 |
-
if($('billing:use_for_shipping_yes').getValue() != "1" && $('shipping-address-select').getValue() == ''){
|
915 |
-
Element.show('shipping_address_list');
|
916 |
-
}
|
917 |
-
|
918 |
-
} else {
|
919 |
-
Element.hide('billing_address_list');
|
920 |
-
}
|
921 |
-
$$('input[name^=billing]', 'select[id=billing:region_id]').each(function(e){
|
922 |
-
if(e.name=='billing[use_for_shipping]' || e.name=='billing[save_in_address_book]'){
|
923 |
-
|
924 |
-
} else {
|
925 |
-
e.value = '';
|
926 |
-
}
|
927 |
-
});
|
928 |
-
},
|
929 |
-
|
930 |
-
resetSelectedAddress: function(){
|
931 |
-
var selectElement = $('shipping-address-select')
|
932 |
-
if (selectElement) {
|
933 |
-
selectElement.value='';
|
934 |
-
}
|
935 |
-
},
|
936 |
-
|
937 |
-
fillForm: function(transport){
|
938 |
-
|
939 |
-
},
|
940 |
-
|
941 |
-
setUseForShipping: function(flag) {
|
942 |
-
|
943 |
-
},
|
944 |
-
|
945 |
-
save: function(){
|
946 |
-
|
947 |
-
},
|
948 |
-
|
949 |
-
resetLoadWaiting: function(transport){
|
950 |
-
|
951 |
-
},
|
952 |
-
|
953 |
-
nextStep: function(transport){
|
954 |
-
|
955 |
-
}
|
956 |
-
};
|
957 |
-
|
958 |
-
//shipping
|
959 |
-
var Shipping = Class.create();
|
960 |
-
Shipping.prototype = {
|
961 |
-
initialize: function(form){
|
962 |
-
this.form = form;
|
963 |
-
},
|
964 |
-
|
965 |
-
setAddress: function(addressId){
|
966 |
-
|
967 |
-
},
|
968 |
-
|
969 |
-
newAddress: function(isNew){
|
970 |
-
if (isNew) {
|
971 |
-
this.resetSelectedAddress();
|
972 |
-
Element.show('shipping_address_list');
|
973 |
-
} else {
|
974 |
-
Element.hide('shipping_address_list');
|
975 |
-
}
|
976 |
-
|
977 |
-
$$('#shipping_address input[name^=shipping],#shipping_address select[id=shipping:region_id]').each(function(e){
|
978 |
-
if(e.name=='shipping[save_in_address_book]'){
|
979 |
-
|
980 |
-
} else {
|
981 |
-
e.value = '';
|
982 |
-
}
|
983 |
-
})
|
984 |
-
|
985 |
-
},
|
986 |
-
|
987 |
-
resetSelectedAddress: function(){
|
988 |
-
var selectElement = $('shipping-address-select')
|
989 |
-
if (selectElement) {
|
990 |
-
selectElement.value='';
|
991 |
-
}
|
992 |
-
},
|
993 |
-
|
994 |
-
fillForm: function(transport){
|
995 |
-
|
996 |
-
},
|
997 |
-
|
998 |
-
setSameAsBilling: function(flag) {
|
999 |
-
|
1000 |
-
},
|
1001 |
-
|
1002 |
-
syncWithBilling: function () {
|
1003 |
-
|
1004 |
-
},
|
1005 |
-
|
1006 |
-
setRegionValue: function(){
|
1007 |
-
//$('shipping:region').value = $('billing:region').value;
|
1008 |
-
},
|
1009 |
-
|
1010 |
-
save: function(){
|
1011 |
-
|
1012 |
-
}
|
1013 |
-
};
|
1014 |
-
|
1015 |
-
//payment object
|
1016 |
-
var Payment = Class.create();
|
1017 |
-
Payment.prototype = {
|
1018 |
-
beforeInitFunc:$H({}),
|
1019 |
-
afterInitFunc:$H({}),
|
1020 |
-
beforeValidateFunc:$H({}),
|
1021 |
-
afterValidateFunc:$H({}),
|
1022 |
-
initialize: function(form, saveUrl){
|
1023 |
-
this.form = form;
|
1024 |
-
this.saveUrl = saveUrl;
|
1025 |
-
},
|
1026 |
-
|
1027 |
-
init : function () {
|
1028 |
-
var elements = Form.getElements(this.form);
|
1029 |
-
if ($(this.form)) {
|
1030 |
-
//$(this.form).observe('submit', function(event){this.save();Event.stop(event);}.bind(this));
|
1031 |
-
}
|
1032 |
-
var method = null;
|
1033 |
-
for (var i=0; i<elements.length; i++) {
|
1034 |
-
if (elements[i].name=='payment[method]') {
|
1035 |
-
if (elements[i].checked) {
|
1036 |
-
method = elements[i].value;
|
1037 |
-
}
|
1038 |
-
} else {
|
1039 |
-
elements[i].disabled = true;
|
1040 |
-
}
|
1041 |
-
}
|
1042 |
-
if (method) this.switchMethod(method);
|
1043 |
-
},
|
1044 |
-
|
1045 |
-
switchMethod: function(method){
|
1046 |
-
if (this.currentMethod && $('payment_form_'+this.currentMethod)) {
|
1047 |
-
var form = $('payment_form_'+this.currentMethod);
|
1048 |
-
form.style.display = 'none';
|
1049 |
-
var elements = form.select('input').concat(form.select('select')).concat(form.select('textarea'));
|
1050 |
-
for (var i=0; i<elements.length; i++) elements[i].disabled = true;
|
1051 |
-
}
|
1052 |
-
|
1053 |
-
if ($('payment_form_'+method)){
|
1054 |
-
var form = $('payment_form_'+method);
|
1055 |
-
form.style.display = '';
|
1056 |
-
var elements = form.select('input').concat(form.select('select')).concat(form.select('textarea'));
|
1057 |
-
for (var i=0; i<elements.length; i++) elements[i].disabled = false;
|
1058 |
-
this.currentMethod = method;
|
1059 |
-
}
|
1060 |
-
},
|
1061 |
-
|
1062 |
-
addBeforeValidateFunction : function(code, func) {
|
1063 |
-
this.beforeValidateFunc.set(code, func);
|
1064 |
-
},
|
1065 |
-
|
1066 |
-
beforeValidate : function() {
|
1067 |
-
var validateResult = true;
|
1068 |
-
var hasValidation = false;
|
1069 |
-
(this.beforeValidateFunc).each(function(validate){
|
1070 |
-
hasValidation = true;
|
1071 |
-
if ((validate.value)() == false) {
|
1072 |
-
validateResult = false;
|
1073 |
-
}
|
1074 |
-
}.bind(this));
|
1075 |
-
if (!hasValidation) {
|
1076 |
-
validateResult = false;
|
1077 |
-
}
|
1078 |
-
return validateResult;
|
1079 |
-
},
|
1080 |
-
|
1081 |
-
validate: function() {
|
1082 |
-
var methods = document.getElementsByName('payment[method]');
|
1083 |
-
if (methods.length==0) {
|
1084 |
-
alert(Translator.translate('Your order can not be completed at this time as there is no payment methods available for it.'));
|
1085 |
-
return false;
|
1086 |
-
}
|
1087 |
-
for (var i=0; i<methods.length; i++) {
|
1088 |
-
if (methods[i].checked) {
|
1089 |
-
return true;
|
1090 |
-
}
|
1091 |
-
}
|
1092 |
-
alert(Translator.translate('Please specify payment method.'));
|
1093 |
-
return false;
|
1094 |
-
},
|
1095 |
-
|
1096 |
-
save: function(){
|
1097 |
-
},
|
1098 |
-
addAfterInitFunction : function(code, func) {
|
1099 |
-
this.afterInitFunc.set(code, func);
|
1100 |
-
},
|
1101 |
-
|
1102 |
-
afterInit : function() {
|
1103 |
-
(this.afterInitFunc).each(function(init){
|
1104 |
-
(init.value)();
|
1105 |
-
});
|
1106 |
-
}
|
1107 |
-
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|