Gene_Braintree - Version 1.0.5.1

Version Notes

Connect your Magento store to Braintree to accept Credit Cards & PayPal using V.Zero SDK

Download this release

Release Info

Developer Dave Macaulay
Extension Gene_Braintree
Version 1.0.5.1
Comparing to
See all releases


Code changes from version 1.0.5 to 1.0.5.1

app/code/community/Gene/Braintree/Block/Js.php CHANGED
@@ -90,8 +90,7 @@ class Gene_Braintree_Block_Js extends Mage_Core_Block_Template
90
  protected function getSingleUse()
91
  {
92
  // We prefer to do future payments, so anything else is future
93
- $paymentAction = Mage::getStoreConfig('payment/gene_braintree_paypal/payment_type');
94
- if($paymentAction == Gene_Braintree_Model_Source_Paypal_Paymenttype::GENE_BRAINTREE_PAYPAL_SINGLE_PAYMENT) {
95
  return 'true';
96
  }
97
 
@@ -106,8 +105,7 @@ class Gene_Braintree_Block_Js extends Mage_Core_Block_Template
106
  protected function getSingleFutureUse()
107
  {
108
  // We prefer to do future payments, so anything else is future
109
- $paymentAction = Mage::getStoreConfig('payment/gene_braintree_paypal/payment_type');
110
- if($paymentAction == Gene_Braintree_Model_Source_Paypal_Paymenttype::GENE_BRAINTREE_PAYPAL_FUTURE_PAYMENTS
111
  && !Mage::getModel('gene_braintree/paymentmethod_paypal')->isVaultEnabled()) {
112
  return 'true';
113
  }
90
  protected function getSingleUse()
91
  {
92
  // We prefer to do future payments, so anything else is future
93
+ if(Mage::getSingleton('gene_braintree/paymentmethod_paypal')->getPaymentType() == Gene_Braintree_Model_Source_Paypal_Paymenttype::GENE_BRAINTREE_PAYPAL_SINGLE_PAYMENT) {
 
94
  return 'true';
95
  }
96
 
105
  protected function getSingleFutureUse()
106
  {
107
  // We prefer to do future payments, so anything else is future
108
+ if(Mage::getSingleton('gene_braintree/paymentmethod_paypal')->getPaymentType() == Gene_Braintree_Model_Source_Paypal_Paymenttype::GENE_BRAINTREE_PAYPAL_FUTURE_PAYMENTS
 
109
  && !Mage::getModel('gene_braintree/paymentmethod_paypal')->isVaultEnabled()) {
110
  return 'true';
111
  }
app/code/community/Gene/Braintree/Block/Paypal.php CHANGED
@@ -40,8 +40,7 @@ class Gene_Braintree_Block_Paypal extends Mage_Payment_Block_Form
40
  public function getSingleUse()
41
  {
42
  // We prefer to do future payments, so anything else is future
43
- $paymentAction = Mage::getStoreConfig('payment/gene_braintree_paypal/payment_type');
44
- if($paymentAction == Gene_Braintree_Model_Source_Paypal_Paymenttype::GENE_BRAINTREE_PAYPAL_SINGLE_PAYMENT) {
45
  return 'true';
46
  }
47
 
40
  public function getSingleUse()
41
  {
42
  // We prefer to do future payments, so anything else is future
43
+ if(Mage::getSingleton('gene_braintree/paymentmethod_paypal')->getPaymentType() == Gene_Braintree_Model_Source_Paypal_Paymenttype::GENE_BRAINTREE_PAYPAL_SINGLE_PAYMENT) {
 
44
  return 'true';
45
  }
46
 
app/code/community/Gene/Braintree/Helper/Data.php CHANGED
@@ -42,6 +42,7 @@ class Gene_Braintree_Helper_Data extends Mage_Core_Helper_Abstract
42
  */
43
  public function formatPrice($price)
44
  {
45
- return number_format($price, 2, '.', '');
 
46
  }
47
  }
42
  */
43
  public function formatPrice($price)
44
  {
45
+ // Suppress errors from formatting the price, as we may have EUR12,00 etc
46
+ return @number_format($price, 2, '.', '');
47
  }
48
  }
app/code/community/Gene/Braintree/Model/.DS_Store ADDED
Binary file
app/code/community/Gene/Braintree/Model/Observer.php CHANGED
@@ -36,6 +36,10 @@ class Gene_Braintree_Model_Observer
36
  $layout->getUpdate()->addHandle('unicode_onestep_checkout');
37
  }
38
 
 
 
 
 
39
  }
40
 
41
  // As some 3rd party checkouts use the same handles, and URL we have to dynamically add new handles
@@ -52,7 +56,6 @@ class Gene_Braintree_Model_Observer
52
  if (Mage::helper('core')->isModuleEnabled('Idev_OneStepCheckout')) {
53
  $layout->getUpdate()->addHandle('idev_onestepcheckout_index');
54
  }
55
-
56
  }
57
 
58
  return $this;
@@ -74,7 +77,7 @@ class Gene_Braintree_Model_Observer
74
  // Get the customer
75
  $customer = Mage::getSingleton('customer/session')->getCustomer();
76
 
77
- // Save the braintree customer ID
78
  $customer->setBraintreeCustomerId(Mage::getSingleton('checkout/session')->getBraintreeCustomerId())->save();
79
  }
80
 
36
  $layout->getUpdate()->addHandle('unicode_onestep_checkout');
37
  }
38
 
39
+ // Detect the Oye one step checkout
40
+ if(Mage::helper('core')->isModuleEnabled('Oye_Checkout') && Mage::helper('oyecheckout')->isOneStepLayout()) {
41
+ $layout->getUpdate()->addHandle('oye_onestep_checkout');
42
+ }
43
  }
44
 
45
  // As some 3rd party checkouts use the same handles, and URL we have to dynamically add new handles
56
  if (Mage::helper('core')->isModuleEnabled('Idev_OneStepCheckout')) {
57
  $layout->getUpdate()->addHandle('idev_onestepcheckout_index');
58
  }
 
59
  }
60
 
61
  return $this;
77
  // Get the customer
78
  $customer = Mage::getSingleton('customer/session')->getCustomer();
79
 
80
+ // Save the Braintree customer ID
81
  $customer->setBraintreeCustomerId(Mage::getSingleton('checkout/session')->getBraintreeCustomerId())->save();
82
  }
83
 
app/code/community/Gene/Braintree/Model/Paymentmethod/Abstract.php CHANGED
@@ -67,16 +67,6 @@ abstract class Gene_Braintree_Model_Paymentmethod_Abstract extends Mage_Payment_
67
  return Mage::getStoreConfig('payment/'.$this->_code.'/'.$key);
68
  }
69
 
70
- /**
71
- * Is the vault enabled?
72
- *
73
- * @return bool
74
- */
75
- public function isVaultEnabled()
76
- {
77
- return $this->_getConfig('use_vault');
78
- }
79
-
80
  /**
81
  * Handle any risk decision returned from Braintree
82
  *
67
  return Mage::getStoreConfig('payment/'.$this->_code.'/'.$key);
68
  }
69
 
 
 
 
 
 
 
 
 
 
 
70
  /**
71
  * Handle any risk decision returned from Braintree
72
  *
app/code/community/Gene/Braintree/Model/Paymentmethod/Creditcard.php CHANGED
@@ -44,6 +44,25 @@ class Gene_Braintree_Model_Paymentmethod_Creditcard extends Gene_Braintree_Model
44
  protected $_canCreateBillingAgreement = false;
45
  protected $_canManageRecurringProfiles = false;
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  /**
48
  * If we're trying to charge a 3D secure card in the vault we need to build a special nonce
49
  *
@@ -88,6 +107,28 @@ class Gene_Braintree_Model_Paymentmethod_Creditcard extends Gene_Braintree_Model
88
  return false;
89
  }
90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  /**
92
  * Validate payment method information object
93
  *
@@ -106,9 +147,7 @@ class Gene_Braintree_Model_Paymentmethod_Creditcard extends Gene_Braintree_Model
106
  if ((!isset($paymentPost['payment_method_nonce']) || empty($paymentPost['payment_method_nonce']))) {
107
 
108
  Gene_Braintree_Model_Debug::log('Card payment has failed, missing token/nonce');
109
-
110
- // Clean up
111
- Gene_Braintree_Model_Wrapper_Braintree::cleanUp();
112
 
113
  Mage::throwException(
114
  $this->_getHelper()->__('Your card payment has failed, please try again.')
@@ -117,9 +156,7 @@ class Gene_Braintree_Model_Paymentmethod_Creditcard extends Gene_Braintree_Model
117
  } else if (isset($paymentPost['card_payment_method_token']) && empty($paymentPost['card_payment_method_token'])) {
118
 
119
  Gene_Braintree_Model_Debug::log('No saved card token present');
120
-
121
- // Clean up
122
- Gene_Braintree_Model_Wrapper_Braintree::cleanUp();
123
 
124
  Mage::throwException(
125
  $this->_getHelper()->__('Your card payment has failed, please try again.')
@@ -211,7 +248,7 @@ class Gene_Braintree_Model_Paymentmethod_Creditcard extends Gene_Braintree_Model
211
  $payment->getOrder(),
212
  $shouldCapture,
213
  $deviceData,
214
- ($this->isVaultEnabled() && isset($paymentPost['save_card']) && $paymentPost['save_card'] == 1),
215
  $threeDSecure
216
  );
217
 
44
  protected $_canCreateBillingAgreement = false;
45
  protected $_canManageRecurringProfiles = false;
46
 
47
+ /**
48
+ * Is the vault enabled?
49
+ *
50
+ * @return bool
51
+ */
52
+ public function isVaultEnabled()
53
+ {
54
+ $object = new Varien_Object();
55
+ $object->setResponse($this->_getConfig('use_vault'));
56
+
57
+ // Specific event for this method
58
+ Mage::dispatchEvent('gene_braintree_creditcard_is_vault_enabled', array('object' => $object));
59
+
60
+ // General event if we want to enforce saving of all payment methods
61
+ Mage::dispatchEvent('gene_braintree_is_vault_enabled', array('object' => $object));
62
+
63
+ return $object->getResponse();
64
+ }
65
+
66
  /**
67
  * If we're trying to charge a 3D secure card in the vault we need to build a special nonce
68
  *
107
  return false;
108
  }
109
 
110
+ /**
111
+ * Should we save this method in the database?
112
+ *
113
+ * @param \Varien_Object $payment
114
+ * @param $paymentPost
115
+ *
116
+ * @return mixed
117
+ */
118
+ public function shouldSaveMethod($payment, $paymentPost)
119
+ {
120
+ $object = new Varien_Object();
121
+ $object->setResponse(($this->isVaultEnabled() && isset($paymentPost['save_card']) && $paymentPost['save_card'] == 1));
122
+
123
+ // Specific event for this method
124
+ Mage::dispatchEvent('gene_braintree_creditcard_should_save_method', array('object' => $object, 'payment' => $payment));
125
+
126
+ // General event if we want to enforce saving of all payment methods
127
+ Mage::dispatchEvent('gene_braintree_save_method', array('object' => $object, 'payment' => $payment));
128
+
129
+ return $object->getResponse();
130
+ }
131
+
132
  /**
133
  * Validate payment method information object
134
  *
147
  if ((!isset($paymentPost['payment_method_nonce']) || empty($paymentPost['payment_method_nonce']))) {
148
 
149
  Gene_Braintree_Model_Debug::log('Card payment has failed, missing token/nonce');
150
+ Gene_Braintree_Model_Debug::log($_SERVER['HTTP_USER_AGENT']);
 
 
151
 
152
  Mage::throwException(
153
  $this->_getHelper()->__('Your card payment has failed, please try again.')
156
  } else if (isset($paymentPost['card_payment_method_token']) && empty($paymentPost['card_payment_method_token'])) {
157
 
158
  Gene_Braintree_Model_Debug::log('No saved card token present');
159
+ Gene_Braintree_Model_Debug::log($_SERVER['HTTP_USER_AGENT']);
 
 
160
 
161
  Mage::throwException(
162
  $this->_getHelper()->__('Your card payment has failed, please try again.')
248
  $payment->getOrder(),
249
  $shouldCapture,
250
  $deviceData,
251
+ $this->shouldSaveMethod($payment, $paymentPost),
252
  $threeDSecure
253
  );
254
 
app/code/community/Gene/Braintree/Model/Paymentmethod/Paypal.php CHANGED
@@ -44,6 +44,22 @@ class Gene_Braintree_Model_Paymentmethod_Paypal extends Gene_Braintree_Model_Pay
44
  protected $_canCreateBillingAgreement = false;
45
  protected $_canManageRecurringProfiles = false;
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  /**
48
  * Is the vault enabled?
49
  *
@@ -51,12 +67,38 @@ class Gene_Braintree_Model_Paymentmethod_Paypal extends Gene_Braintree_Model_Pay
51
  */
52
  public function isVaultEnabled()
53
  {
54
- if ($this->_getConfig('payment_type') == Gene_Braintree_Model_Source_Paypal_Paymenttype::GENE_BRAINTREE_PAYPAL_FUTURE_PAYMENTS
55
- && $this->_getConfig('use_vault'))
56
- {
57
- return true;
58
- }
59
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  }
61
 
62
  /**
@@ -114,7 +156,7 @@ class Gene_Braintree_Model_Paymentmethod_Paypal extends Gene_Braintree_Model_Pay
114
  $payment->getOrder(),
115
  true,
116
  $deviceData,
117
- ($this->isVaultEnabled() && isset($paymentPost['save_paypal']) && $paymentPost['save_paypal'] == 1)
118
  );
119
 
120
  // Pass the sale array into a varien object
44
  protected $_canCreateBillingAgreement = false;
45
  protected $_canManageRecurringProfiles = false;
46
 
47
+ /**
48
+ * Return the PayPal payment type
49
+ *
50
+ * @return mixed
51
+ */
52
+ public function getPaymentType()
53
+ {
54
+ $object = new Varien_Object();
55
+ $object->setType($this->_getConfig('payment_type'));
56
+
57
+ // Specific event for this method
58
+ Mage::dispatchEvent('gene_paypal_get_payment_type', array('object' => $object));
59
+
60
+ return $object->getType();
61
+ }
62
+
63
  /**
64
  * Is the vault enabled?
65
  *
67
  */
68
  public function isVaultEnabled()
69
  {
70
+ $object = new Varien_Object();
71
+ $object->setResponse(($this->getPaymentType() == Gene_Braintree_Model_Source_Paypal_Paymenttype::GENE_BRAINTREE_PAYPAL_FUTURE_PAYMENTS && $this->_getConfig('use_vault')));
72
+
73
+ // Specific event for this method
74
+ Mage::dispatchEvent('gene_braintree_paypal_is_vault_enabled', array('object' => $object));
75
+
76
+ // General event if we want to enforce saving of all payment methods
77
+ Mage::dispatchEvent('gene_braintree_is_vault_enabled', array('object' => $object));
78
+
79
+ return $object->getResponse();
80
+ }
81
+
82
+ /**
83
+ * Should we save this method in the database?
84
+ *
85
+ * @param \Varien_Object $payment
86
+ * @param $paymentPost
87
+ *
88
+ * @return mixed
89
+ */
90
+ public function shouldSaveMethod($payment, $paymentPost)
91
+ {
92
+ $object = new Varien_Object();
93
+ $object->setResponse(($this->isVaultEnabled() && isset($paymentPost['save_paypal']) && $paymentPost['save_paypal'] == 1));
94
+
95
+ // Specific event for this method
96
+ Mage::dispatchEvent('gene_braintree_paypal_should_save_method', array('object' => $object, 'payment' => $payment));
97
+
98
+ // General event if we want to enforce saving of all payment methods
99
+ Mage::dispatchEvent('gene_braintree_save_method', array('object' => $object, 'payment' => $payment));
100
+
101
+ return $object->getResponse();
102
  }
103
 
104
  /**
156
  $payment->getOrder(),
157
  true,
158
  $deviceData,
159
+ $this->shouldSaveMethod($payment, $paymentPost)
160
  );
161
 
162
  // Pass the sale array into a varien object
app/code/community/Gene/Braintree/Model/Saved.php CHANGED
@@ -40,7 +40,12 @@ class Gene_Braintree_Model_Saved extends Mage_Core_Model_Abstract
40
  if ($customer = $wrapper->getCustomer($customerSession->getCustomer()->getBraintreeCustomerId())) {
41
 
42
  // Assign them into our model
43
- $this->savedAccounts = array_merge($customer->creditCards, $customer->paypalAccounts);
 
 
 
 
 
44
  }
45
 
46
  }
40
  if ($customer = $wrapper->getCustomer($customerSession->getCustomer()->getBraintreeCustomerId())) {
41
 
42
  // Assign them into our model
43
+ $object = new Varien_Object();
44
+ $object->setSavedAccounts(array_merge($customer->creditCards, $customer->paypalAccounts));
45
+
46
+ Mage::dispatchEvent('gene_braintree_get_saved_methods', array('object' => $object));
47
+
48
+ $this->savedAccounts = $object->getSavedAccounts();
49
  }
50
 
51
  }
app/code/community/Gene/Braintree/Model/Wrapper/Braintree.php CHANGED
@@ -474,6 +474,7 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
474
  public function storeInGuestVault($nonce, $billingAddress = false)
475
  {
476
  $guestCustomerCreate = array(
 
477
  'creditCard' => array(
478
  'paymentMethodNonce' => $nonce,
479
  'options' => array(
@@ -530,6 +531,7 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
530
  $wrapper = Mage::getSingleton('gene_braintree/wrapper_braintree');
531
  $wrapper->init()->deleteCustomer($guestCustomerId);
532
  Mage::getSingleton('checkout/session')->unsGuestBraintreeCustomerId();
 
533
  }
534
 
535
  // Remove the temporary payment method
@@ -576,33 +578,51 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
576
  // Store whether or not we created a new method
577
  $createdMethod = false;
578
 
579
- // If the user is already a customer and wants to store in the vault we've gotta do something a bit special
580
- if($storeInVault && $this->checkIsCustomer() && isset($paymentDataArray['paymentMethodNonce'])) {
581
 
582
- // Do we already have a saved token in the session?
583
- if($token = Mage::getSingleton('checkout/session')->getTemporaryPaymentToken()) {
584
 
585
- try {
 
 
586
 
587
- // Attempt to load the temporary payment method
588
- $paymentMethod = Braintree_PaymentMethod::find($token);
589
- if(isset($paymentMethod->token)) {
590
 
591
- // Remove this from the session so it doesn't get deleted at the end of checkout
592
- Mage::getSingleton('checkout/session')->unsTemporaryPaymentToken();
593
 
594
- // We no longer need this nonce
595
- unset($paymentDataArray['paymentMethodNonce']);
596
 
597
- // Instead use the token
598
- $paymentDataArray['paymentMethodToken'] = $paymentMethod->token;
 
 
 
599
 
600
- // Create a flag for other methods
601
- $createdMethod = true;
602
 
603
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
604
 
605
- } catch (Exception $e) {
606
  // If the method doesn't exist, clear the token and re-build the sale
607
  Mage::getSingleton('checkout/session')->unsTemporaryPaymentToken();
608
  return $this->buildSale($amount, $paymentDataArray, $order, $submitForSettlement, $deviceData, $storeInVault, $threeDSecure, $extra);
@@ -715,6 +735,26 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
715
  return $request;
716
  }
717
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
718
  /**
719
  * Attempt to make a sale using the Braintree PHP SDK
720
  *
@@ -898,7 +938,7 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
898
  public function currencyMappingEnabled(Mage_Sales_Model_Order $order = null)
899
  {
900
  return Mage::getStoreConfigFlag(self::BRAINTREE_MULTI_CURRENCY)
901
- && Mage::getStoreConfig(self::BRAINTREE_MULTI_CURRENCY_MAPPING);
902
  }
903
 
904
  /**
@@ -954,13 +994,8 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
954
  // Convert the current
955
  $convertedCurrency = Mage::helper('directory')->currencyConvert($amount, $baseCurrencyCode, $orderQuoteCurrencyCode);
956
 
957
- // Format it to a precision of 2
958
- $options = array(
959
- 'currency' => $orderQuoteCurrencyCode,
960
- 'display' => ''
961
- );
962
-
963
- return Mage::app()->getLocale()->currency($orderQuoteCurrencyCode)->toCurrency($convertedCurrency, $options);
964
  }
965
 
966
  /**
474
  public function storeInGuestVault($nonce, $billingAddress = false)
475
  {
476
  $guestCustomerCreate = array(
477
+ 'id' => $this->getBraintreeId(),
478
  'creditCard' => array(
479
  'paymentMethodNonce' => $nonce,
480
  'options' => array(
531
  $wrapper = Mage::getSingleton('gene_braintree/wrapper_braintree');
532
  $wrapper->init()->deleteCustomer($guestCustomerId);
533
  Mage::getSingleton('checkout/session')->unsGuestBraintreeCustomerId();
534
+ Mage::getSingleton('checkout/session')->unsGuestPaymentToken();
535
  }
536
 
537
  // Remove the temporary payment method
578
  // Store whether or not we created a new method
579
  $createdMethod = false;
580
 
581
+ // Are we storing in the vault, from a guest customer account?
582
+ if($storeInVault && Mage::getSingleton('checkout/session')->getGuestBraintreeCustomerId() && ($token = Mage::getSingleton('checkout/session')->getGuestPaymentToken())) {
583
 
584
+ if($this->checkPaymentMethod($token)) {
 
585
 
586
+ // Remove this from the session so it doesn't get deleted at the end of checkout
587
+ Mage::getSingleton('checkout/session')->unsGuestBraintreeCustomerId();
588
+ Mage::getSingleton('checkout/session')->unsGuestPaymentToken();
589
 
590
+ // We no longer need this nonce
591
+ unset($paymentDataArray['paymentMethodNonce']);
 
592
 
593
+ // Instead use the token
594
+ $paymentDataArray['paymentMethodToken'] = $token;
595
 
596
+ // Create a flag for other methods
597
+ $createdMethod = true;
598
 
599
+ } else {
600
+ // If the method doesn't exist, clear the token and re-build the sale
601
+ Mage::getSingleton('checkout/session')->unsGuestPaymentToken();
602
+ return $this->buildSale($amount, $paymentDataArray, $order, $submitForSettlement, $deviceData, $storeInVault, $threeDSecure, $extra);
603
+ }
604
 
605
+ } else if($storeInVault && $this->checkIsCustomer() && isset($paymentDataArray['paymentMethodNonce'])) {
606
+ // If the user is already a customer and wants to store in the vault we've gotta do something a bit special
607
 
608
+ // Do we already have a saved token in the session?
609
+ if($token = Mage::getSingleton('checkout/session')->getTemporaryPaymentToken()) {
610
+
611
+ if($this->checkPaymentMethod($token)) {
612
+
613
+ // Remove this from the session so it doesn't get deleted at the end of checkout
614
+ Mage::getSingleton('checkout/session')->unsTemporaryPaymentToken();
615
+
616
+ // We no longer need this nonce
617
+ unset($paymentDataArray['paymentMethodNonce']);
618
+
619
+ // Instead use the token
620
+ $paymentDataArray['paymentMethodToken'] = $token;
621
+
622
+ // Create a flag for other methods
623
+ $createdMethod = true;
624
 
625
+ } else {
626
  // If the method doesn't exist, clear the token and re-build the sale
627
  Mage::getSingleton('checkout/session')->unsTemporaryPaymentToken();
628
  return $this->buildSale($amount, $paymentDataArray, $order, $submitForSettlement, $deviceData, $storeInVault, $threeDSecure, $extra);
735
  return $request;
736
  }
737
 
738
+ /**
739
+ * Check whether a payment method exists
740
+ *
741
+ * @param $token
742
+ *
743
+ * @return bool
744
+ */
745
+ public function checkPaymentMethod($token)
746
+ {
747
+ try {
748
+ // Attempt to load the temporary payment method
749
+ $paymentMethod = Braintree_PaymentMethod::find($token);
750
+ if(isset($paymentMethod->token) && $paymentMethod->token == $token) {
751
+ return true;
752
+ }
753
+ } catch (Exception $e) {
754
+ return false;
755
+ }
756
+ }
757
+
758
  /**
759
  * Attempt to make a sale using the Braintree PHP SDK
760
  *
938
  public function currencyMappingEnabled(Mage_Sales_Model_Order $order = null)
939
  {
940
  return Mage::getStoreConfigFlag(self::BRAINTREE_MULTI_CURRENCY)
941
+ && Mage::getStoreConfig(self::BRAINTREE_MULTI_CURRENCY_MAPPING);
942
  }
943
 
944
  /**
994
  // Convert the current
995
  $convertedCurrency = Mage::helper('directory')->currencyConvert($amount, $baseCurrencyCode, $orderQuoteCurrencyCode);
996
 
997
+ // Always make sure the number has two decimal places
998
+ return Mage::helper('gene_braintree')->formatPrice($convertedCurrency);
 
 
 
 
 
999
  }
1000
 
1001
  /**
app/code/community/Gene/Braintree/controllers/CheckoutController.php CHANGED
@@ -125,6 +125,7 @@ class Gene_Braintree_CheckoutController extends Mage_Core_Controller_Front_Actio
125
  $method = $response->customer->creditCards[0];
126
  if (isset($method->token)) {
127
  $token = $method->token;
 
128
  }
129
 
130
  }
125
  $method = $response->customer->creditCards[0];
126
  if (isset($method->token)) {
127
  $token = $method->token;
128
+ Mage::getSingleton('checkout/session')->setGuestPaymentToken($token);
129
  }
130
 
131
  }
app/code/community/Gene/Braintree/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Gene_Braintree>
5
- <version>1.0.5</version>
6
  </Gene_Braintree>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <Gene_Braintree>
5
+ <version>1.0.5.1</version>
6
  </Gene_Braintree>
7
  </modules>
8
  <global>
app/design/adminhtml/default/default/layout/gene/braintree.xml CHANGED
@@ -15,7 +15,7 @@
15
  <adminhtml_sales_order_create_index>
16
  <reference name="head">
17
  <action method="addJs"><file>gene/braintree/braintree-0.1.js</file></action>
18
- <action method="addJs"><file>gene/braintree/vzero-0.5.min.js</file></action>
19
  </reference>
20
  <reference name="before_body_end">
21
  <block type="gene_braintree/js" name="gene_braintree_js" template="gene/braintree/js.phtml" />
15
  <adminhtml_sales_order_create_index>
16
  <reference name="head">
17
  <action method="addJs"><file>gene/braintree/braintree-0.1.js</file></action>
18
+ <action method="addJs"><file>gene/braintree/vzero-0.6-min.js</file></action>
19
  </reference>
20
  <reference name="before_body_end">
21
  <block type="gene_braintree/js" name="gene_braintree_js" template="gene/braintree/js.phtml" />
app/design/frontend/base/default/layout/gene/braintree.xml CHANGED
@@ -4,7 +4,7 @@
4
  <checkout_onepage_index>
5
  <reference name="head">
6
  <action method="addJs"><file>gene/braintree/braintree-0.1.js</file></action>
7
- <action method="addJs"><file>gene/braintree/vzero-0.5.min.js</file></action>
8
  <action method="addCss"><file>css/gene/braintree/default.css</file></action>
9
  </reference>
10
  <reference name="before_body_end">
@@ -45,7 +45,7 @@
45
  <idev_onestepcheckout_index>
46
  <reference name="head">
47
  <action method="addJs"><file>gene/braintree/braintree-0.1.js</file></action>
48
- <action method="addJs"><file>gene/braintree/vzero-0.5.min.js</file></action>
49
  <action method="addCss"><file>css/gene/braintree/idev.css</file></action>
50
  </reference>
51
  <reference name="before_body_end">
@@ -66,7 +66,7 @@
66
  <magestore_onestepcheckout_index>
67
  <reference name="head">
68
  <action method="addJs"><file>gene/braintree/braintree-0.1.js</file></action>
69
- <action method="addJs"><file>gene/braintree/vzero-0.5.min.js</file></action>
70
  <action method="addCss"><file>css/gene/braintree/magestore.css</file></action>
71
  </reference>
72
  <reference name="before_body_end">
@@ -87,7 +87,7 @@
87
  <aw_onestepcheckout_index_index>
88
  <reference name="head">
89
  <action method="addJs"><file>gene/braintree/braintree-0.1.js</file></action>
90
- <action method="addJs"><file>gene/braintree/vzero-0.5.min.js</file></action>
91
  <action method="addCss"><file>css/gene/braintree/aheadworks.css</file></action>
92
  </reference>
93
  <reference name="before_body_end">
@@ -108,7 +108,7 @@
108
  <opc_index_index>
109
  <reference name="head">
110
  <action method="addJs"><file>gene/braintree/braintree-0.1.js</file></action>
111
- <action method="addJs"><file>gene/braintree/vzero-0.5.min.js</file></action>
112
  <action method="addCss"><file>css/gene/braintree/iwd.css</file></action>
113
  </reference>
114
  <reference name="before_body_end">
@@ -129,7 +129,7 @@
129
  <firecheckout_index_index>
130
  <reference name="head">
131
  <action method="addJs"><file>gene/braintree/braintree-0.1.js</file></action>
132
- <action method="addJs"><file>gene/braintree/vzero-0.5.min.js</file></action>
133
  <action method="addCss"><file>css/gene/braintree/firecheckout.css</file></action>
134
  </reference>
135
  <reference name="before_body_end">
@@ -151,7 +151,7 @@
151
  <reference name="head">
152
  <action method="removeItem"><type>skin_css</type><name>css/gene/braintree/default.css</name></action>
153
  <action method="addJs"><file>gene/braintree/braintree-0.1.js</file></action>
154
- <action method="addJs"><file>gene/braintree/vzero-0.5.min.js</file></action>
155
  <action method="addCss"><file>css/gene/braintree/unicode.css</file></action>
156
  </reference>
157
  <reference name="before_body_end">
@@ -168,6 +168,26 @@
168
  </reference>
169
  </unicode_onestep_checkout>
170
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
  <checkout_onepage_paymentmethod>
172
  <reference name="root">
173
  <block type="core/text_list" name="additional" as="additional">
4
  <checkout_onepage_index>
5
  <reference name="head">
6
  <action method="addJs"><file>gene/braintree/braintree-0.1.js</file></action>
7
+ <action method="addJs"><file>gene/braintree/vzero-0.6-min.js</file></action>
8
  <action method="addCss"><file>css/gene/braintree/default.css</file></action>
9
  </reference>
10
  <reference name="before_body_end">
45
  <idev_onestepcheckout_index>
46
  <reference name="head">
47
  <action method="addJs"><file>gene/braintree/braintree-0.1.js</file></action>
48
+ <action method="addJs"><file>gene/braintree/vzero-0.6-min.js</file></action>
49
  <action method="addCss"><file>css/gene/braintree/idev.css</file></action>
50
  </reference>
51
  <reference name="before_body_end">
66
  <magestore_onestepcheckout_index>
67
  <reference name="head">
68
  <action method="addJs"><file>gene/braintree/braintree-0.1.js</file></action>
69
+ <action method="addJs"><file>gene/braintree/vzero-0.6-min.js</file></action>
70
  <action method="addCss"><file>css/gene/braintree/magestore.css</file></action>
71
  </reference>
72
  <reference name="before_body_end">
87
  <aw_onestepcheckout_index_index>
88
  <reference name="head">
89
  <action method="addJs"><file>gene/braintree/braintree-0.1.js</file></action>
90
+ <action method="addJs"><file>gene/braintree/vzero-0.6-min.js</file></action>
91
  <action method="addCss"><file>css/gene/braintree/aheadworks.css</file></action>
92
  </reference>
93
  <reference name="before_body_end">
108
  <opc_index_index>
109
  <reference name="head">
110
  <action method="addJs"><file>gene/braintree/braintree-0.1.js</file></action>
111
+ <action method="addJs"><file>gene/braintree/vzero-0.6-min.js</file></action>
112
  <action method="addCss"><file>css/gene/braintree/iwd.css</file></action>
113
  </reference>
114
  <reference name="before_body_end">
129
  <firecheckout_index_index>
130
  <reference name="head">
131
  <action method="addJs"><file>gene/braintree/braintree-0.1.js</file></action>
132
+ <action method="addJs"><file>gene/braintree/vzero-0.6-min.js</file></action>
133
  <action method="addCss"><file>css/gene/braintree/firecheckout.css</file></action>
134
  </reference>
135
  <reference name="before_body_end">
151
  <reference name="head">
152
  <action method="removeItem"><type>skin_css</type><name>css/gene/braintree/default.css</name></action>
153
  <action method="addJs"><file>gene/braintree/braintree-0.1.js</file></action>
154
+ <action method="addJs"><file>gene/braintree/vzero-0.6-min.js</file></action>
155
  <action method="addCss"><file>css/gene/braintree/unicode.css</file></action>
156
  </reference>
157
  <reference name="before_body_end">
168
  </reference>
169
  </unicode_onestep_checkout>
170
 
171
+ <!-- Add in support for the Oye one step cehckout -->
172
+ <oye_onestep_checkout>
173
+ <reference name="head">
174
+ <action method="removeItem"><type>skin_css</type><name>css/gene/braintree/default.css</name></action>
175
+ <action method="addCss"><file>css/gene/braintree/oye.css</file></action>
176
+ </reference>
177
+ <reference name="before_body_end">
178
+ <block type="gene_braintree/js" name="gene_braintree_setup" template="gene/braintree/js/setup.phtml" />
179
+ <block type="gene_braintree/js" name="gene_braintree_js" template="gene/braintree/js/oye.phtml" />
180
+
181
+ <!-- We include device data at the end of the larger form -->
182
+ <block type="gene_braintree/js" name="gene_braintree_data" template="gene/braintree/js/data.phtml">
183
+ <action method="setData">
184
+ <key>payment_form_id</key>
185
+ <value>custom-checkout-form</value>
186
+ </action>
187
+ </block>
188
+ </reference>
189
+ </oye_onestep_checkout>
190
+
191
  <checkout_onepage_paymentmethod>
192
  <reference name="root">
193
  <block type="core/text_list" name="additional" as="additional">
app/design/frontend/base/default/template/gene/braintree/js/idev.phtml CHANGED
@@ -62,7 +62,7 @@
62
 
63
  // Observe the click event
64
  var _originalSubmitEvent = $('onestepcheckout-form').submit;
65
- $('onestepcheckout-form').submit = function() {
66
 
67
  if (vzeroIntegration.shouldInterceptSubmit('creditcard')) {
68
 
@@ -84,7 +84,7 @@
84
  */
85
  submitCheckout: function() {
86
  // Submit the checkout
87
- $$('#onestepcheckout-place-order').first().click();
88
  }
89
 
90
  });
@@ -93,8 +93,9 @@
93
  * Start a new instance of our integration
94
  *
95
  * @type {vZeroIntegration}
 
96
  */
97
- new vZeroIntegration(
98
  (window.vzero || false),
99
  (window.vzeroPaypal || false),
100
  '<div id="paypal-complete"><div id="paypal-container"></div><label id="paypal-label"><?php echo $this->__('Complete checkout with'); ?> </label></div>',
@@ -105,4 +106,54 @@
105
  }
106
  );
107
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  </script>
62
 
63
  // Observe the click event
64
  var _originalSubmitEvent = $('onestepcheckout-form').submit;
65
+ $('onestepcheckout-form').submit = function braintreeOverride() {
66
 
67
  if (vzeroIntegration.shouldInterceptSubmit('creditcard')) {
68
 
84
  */
85
  submitCheckout: function() {
86
  // Submit the checkout
87
+ return $('onestepcheckout-form').submit();
88
  }
89
 
90
  });
93
  * Start a new instance of our integration
94
  *
95
  * @type {vZeroIntegration}
96
+ * @private
97
  */
98
+ var _integration = new vZeroIntegration(
99
  (window.vzero || false),
100
  (window.vzeroPaypal || false),
101
  '<div id="paypal-complete"><div id="paypal-container"></div><label id="paypal-label"><?php echo $this->__('Complete checkout with'); ?> </label></div>',
106
  }
107
  );
108
 
109
+ // Attach an event onto the button to verify it's submit function has been overridden with our own
110
+ document.observe("dom:loaded", function () {
111
+
112
+ if($('onestepcheckout-place-order') != null) {
113
+
114
+ // Observe the click event so we can double check the integration has fired correctly
115
+ $('onestepcheckout-place-order').observe('click', function(e) {
116
+
117
+ if($('onestepcheckout-form') != null) {
118
+
119
+ // Detect if we've override the function
120
+ if(!/braintreeOverride/.match($('onestepcheckout-form').submit.toString())) {
121
+
122
+ // Stop the event whilst we prepare the submission observer
123
+ Event.stop(e);
124
+
125
+ // If not, and the integration is loaded, attempt to attach the observer
126
+ if(typeof vZeroIntegration === 'function' && _integration instanceof vZeroIntegration && vZeroIntegration.prototype.loaded) {
127
+
128
+ // Attempt to prepare the submit observer again
129
+ _integration.prepareSubmitObserver();
130
+
131
+ // Detect if we've overriden the function
132
+ if(!/braintreeOverride/.match($('onestepcheckout-form').submit.toString())) {
133
+
134
+ // Re-fire the event
135
+ return $('onestepcheckout-place-order').click();
136
+
137
+ } else {
138
+ alert('Sadly we\'re currently unable to process your order, please contact a member of our support team.');
139
+ console.error('_integration is not loaded or an instance of the vZeroIntegration class, or the class failed to originally initialize.');
140
+ return false;
141
+ }
142
+
143
+ } else {
144
+ alert('Sadly we\'re currently unable to process your order, please contact a member of our support team.');
145
+ console.error('_integration is not loaded or an instance of the vZeroIntegration class, or the class failed to originally initialize.');
146
+ return false;
147
+ }
148
+ }
149
+
150
+ } else {
151
+ Event.stop(e);
152
+ console.error('We cannot locate the form \'onestepcheckout-form\', please make sure your form has the correct ID.');
153
+ return false;
154
+ }
155
+ });
156
+ }
157
+ });
158
+
159
  </script>
app/design/frontend/base/default/template/gene/braintree/js/iwd.phtml CHANGED
@@ -50,11 +50,13 @@
50
  return false;
51
  }
52
  }
53
- if (IWD.OPC.Shipping.validateShippingMethod() === false) {
54
- $iwdjQuery('.opc-message-container').html($iwdjQuery('#pssm_msg').html());
55
- $iwdjQuery('.opc-message-wrapper').show();
56
- IWD.OPC.Checkout.hideLoader();
57
- return false;
 
 
58
  }
59
  return true;
60
  },
50
  return false;
51
  }
52
  }
53
+ if (IWD.OPC.Checkout.isVirtual === false) {
54
+ if (IWD.OPC.Shipping.validateShippingMethod() === false) {
55
+ $iwdjQuery('.opc-message-container').html($iwdjQuery('#pssm_msg').html());
56
+ $iwdjQuery('.opc-message-wrapper').show();
57
+ IWD.OPC.Checkout.hideLoader();
58
+ return false;
59
+ }
60
  }
61
  return true;
62
  },
app/design/frontend/base/default/template/gene/braintree/js/oye.phtml ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Add in support for Oye One Step Checkout
4
+ * http://oyenetwork.com/products/advanced-checkout.html
5
+ * @author Dave Macaulay <dave@gene.co.uk>
6
+ */
7
+ ?>
8
+ <!-- OYE BRAINTREE SUPPORT -->
9
+ <script type="text/javascript">
10
+ vZeroIntegration.addMethods({
11
+
12
+ /**
13
+ * Validate the entire checkout
14
+ * Annoyingly IWD hasn't already wrapped this in a function
15
+ */
16
+ validateAll: function() {
17
+ return checkout.validateCheckout();
18
+ },
19
+
20
+ setLoading: function() {
21
+ checkout.setLoadWaiting();
22
+ },
23
+
24
+ resetLoading: function() {
25
+ checkout.resetLoadWaiting();
26
+ },
27
+
28
+ /**
29
+ * Attach an observer to the submit action of the checkout to tokenize the card details
30
+ */
31
+ prepareSubmitObserver: function() {
32
+
33
+ // Store a pointer to the vZero integration
34
+ var vzeroIntegration = this;
35
+
36
+ // Store the old complete checkout function
37
+ var _originalSaveOrder = Checkout.prototype.saveOrder;
38
+
39
+ // Re-define the original method so we can do some jazz with it
40
+ Checkout.prototype.saveOrder = function () {
41
+
42
+ if (vzeroIntegration.shouldInterceptSubmit('creditcard')) {
43
+
44
+ // Store a pointer to the payment class
45
+ var paymentThis = this;
46
+ var paymentArguments = arguments;
47
+
48
+ // If everything was a success on the checkout end, let's submit the vZero integration
49
+ vzeroIntegration.submit('creditcard', function () {
50
+ return _originalSaveOrder.apply(paymentThis, paymentArguments);
51
+ });
52
+
53
+ } else {
54
+ // If not run the original code
55
+ return _originalSaveOrder.apply(this, arguments);
56
+ }
57
+
58
+ };
59
+
60
+ // Disable the save action, so the checkout doesn't submit multiple times
61
+ Review.prototype.save = function() { return false; };
62
+
63
+ },
64
+
65
+ /**
66
+ * The action to run after the PayPal action has been completed
67
+ */
68
+ submitCheckout: function() {
69
+ // Run the original checkouts submit action
70
+ return checkout.saveOrder();
71
+ }
72
+
73
+ });
74
+
75
+ /**
76
+ * Start a new instance of our integration
77
+ *
78
+ * @type {vZeroIntegration}
79
+ */
80
+ var integration = new vZeroIntegration(
81
+ (window.vzero || false),
82
+ (window.vzeroPaypal || false),
83
+ '<div id="paypal-complete"><div id="paypal-container"></div><label id="paypal-label"><?php echo $this->__('Complete checkout with'); ?> </label></div>',
84
+ '#review-buttons-container .btn-checkout',
85
+ true,
86
+ {
87
+ ignoreAjax: ['checkout/onepage/saveOrder']
88
+ }
89
+ );
90
+
91
+ </script>
js/gene/braintree/config.codekit CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "CodeKitInfo": "This is a CodeKit 2.x project configuration file. It is designed to sync project settings across multiple machines. MODIFYING THE CONTENTS OF THIS FILE IS A POOR LIFE DECISION. If you do so, you will likely cause CodeKit to crash. This file is not useful unless accompanied by the project that created it in CodeKit 2. This file is not backwards-compatible with CodeKit 1.x. For more information, see: http:\/\/incident57.com\/codekit",
3
- "creatorBuild": "19051",
4
  "files": {
5
  "\/braintree-0.1.js": {
6
  "fileType": 64,
@@ -13,27 +13,27 @@
13
  "outputStyle": 1,
14
  "syntaxCheckerStyle": 1
15
  },
16
- "\/vzero-0.5.js": {
17
  "fileType": 64,
18
- "ignore": 0,
19
  "ignoreWasSetByUser": 0,
20
- "inputAbbreviatedPath": "\/vzero-0.5.js",
21
- "outputAbbreviatedPath": "\/vzero-0.5.min.js",
22
  "outputPathIsOutsideProject": 0,
23
- "outputPathIsSetByUser": 1,
24
  "outputStyle": 1,
25
- "syntaxCheckerStyle": 0
26
  },
27
- "\/vzero-0.5.min.js": {
28
  "fileType": 64,
29
- "ignore": 1,
30
  "ignoreWasSetByUser": 0,
31
- "inputAbbreviatedPath": "\/vzero-0.5.min.js",
32
- "outputAbbreviatedPath": "\/min\/vzero-0.5.min-min.js",
33
  "outputPathIsOutsideProject": 0,
34
- "outputPathIsSetByUser": 0,
35
- "outputStyle": 1,
36
- "syntaxCheckerStyle": 1
37
  }
38
  },
39
  "hooks": [
@@ -664,7 +664,9 @@
664
  "typescriptAutoOutputPathStyle": 2,
665
  "typescriptCreateDeclarationFile": 0,
666
  "typescriptCreateSourceMap": 0,
 
667
  "typescriptMinifyOutput": 0,
 
668
  "typescriptModuleType": 0,
669
  "typescriptNoImplicitAny": 0,
670
  "typescriptPreserveConstEnums": 0,
1
  {
2
  "CodeKitInfo": "This is a CodeKit 2.x project configuration file. It is designed to sync project settings across multiple machines. MODIFYING THE CONTENTS OF THIS FILE IS A POOR LIFE DECISION. If you do so, you will likely cause CodeKit to crash. This file is not useful unless accompanied by the project that created it in CodeKit 2. This file is not backwards-compatible with CodeKit 1.x. For more information, see: http:\/\/incident57.com\/codekit",
3
+ "creatorBuild": "19076",
4
  "files": {
5
  "\/braintree-0.1.js": {
6
  "fileType": 64,
13
  "outputStyle": 1,
14
  "syntaxCheckerStyle": 1
15
  },
16
+ "\/vzero-0.6-min.js": {
17
  "fileType": 64,
18
+ "ignore": 1,
19
  "ignoreWasSetByUser": 0,
20
+ "inputAbbreviatedPath": "\/vzero-0.6-min.js",
21
+ "outputAbbreviatedPath": "\/min\/vzero-0.6-min-min.js",
22
  "outputPathIsOutsideProject": 0,
23
+ "outputPathIsSetByUser": 0,
24
  "outputStyle": 1,
25
+ "syntaxCheckerStyle": 1
26
  },
27
+ "\/vzero-0.6.js": {
28
  "fileType": 64,
29
+ "ignore": 0,
30
  "ignoreWasSetByUser": 0,
31
+ "inputAbbreviatedPath": "\/vzero-0.6.js",
32
+ "outputAbbreviatedPath": "\/vzero-0.6-min.js",
33
  "outputPathIsOutsideProject": 0,
34
+ "outputPathIsSetByUser": 1,
35
+ "outputStyle": 2,
36
+ "syntaxCheckerStyle": 0
37
  }
38
  },
39
  "hooks": [
664
  "typescriptAutoOutputPathStyle": 2,
665
  "typescriptCreateDeclarationFile": 0,
666
  "typescriptCreateSourceMap": 0,
667
+ "typescriptJSXMode": 0,
668
  "typescriptMinifyOutput": 0,
669
+ "typescriptModuleResolutionType": 0,
670
  "typescriptModuleType": 0,
671
  "typescriptNoImplicitAny": 0,
672
  "typescriptPreserveConstEnums": 0,
js/gene/braintree/vzero-0.5.min.js DELETED
@@ -1 +0,0 @@
1
- var vZero=Class.create();vZero.prototype={initialize:function(e,t,i,n,a,s,o,r,d){this.code=e,this.clientToken=t,this.threeDSecure=i,this.hostedFields=n,a&&(this.billingName=a),s&&(this.billingPostcode=s),o&&(this.quoteUrl=o),r&&(this.tokenizeUrl=r),d&&(this.vaultToNonceUrl=d),this._hostedFieldsTokenGenerated=!1,this.acceptedCards=!1,this.closeMethod=!1,this._hostedFieldsTimeout=!1,this._updateDataXhr=!1,this._updateDataCallbacks=[],this._updateDataParams={}},init:function(){this.client=new braintree.api.Client({clientToken:this.clientToken})},initHostedFields:function(e){return $$('iframe[name^="braintree-"]').length>0?!1:null===$("braintree-hosted-submit")?!1:(this.integration=e,this._hostedFieldsTokenGenerated=!1,clearTimeout(this._hostedFieldsTimeout),void(this._hostedFieldsTimeout=setTimeout(function(){this._hostedIntegration?this._hostedIntegration.teardown(function(){this.setupHostedFieldsClient()}.bind(this)):this.setupHostedFieldsClient()}.bind(this),50)))},setupHostedFieldsClient:function(){if($$('iframe[name^="braintree-"]').length>0)return!1;this._hostedIntegration=!1;var e={id:this.integration.form,hostedFields:{styles:{input:{"font-size":"14pt",color:"#3A3A3A"},":focus":{color:"black"},".valid":{color:"green"},".invalid":{color:"red"}},number:{selector:"#card-number",placeholder:"0000 0000 0000 0000"},expirationMonth:{selector:"#expiration-month",placeholder:"MM"},expirationYear:{selector:"#expiration-year",placeholder:"YY"},onFieldEvent:this.hostedFieldsOnFieldEvent.bind(this)},onReady:function(e){this._hostedIntegration=e}.bind(this),onPaymentMethodReceived:this.hostedFieldsPaymentMethodReceived.bind(this),onError:this.hostedFieldsError.bind(this)};null!==$("cvv")&&(e.hostedFields.cvv={selector:"#cvv"}),braintree.setup(this.clientToken,"custom",e)},hostedFieldsOnFieldEvent:function(e){if("fieldStateChange"===e.type&&e.card){var t={visa:"VI","american-express":"AE","master-card":"MC",discovery:"DI",jcb:"JCB",maestro:"ME"};void 0!==typeof t[e.card.type]?this.updateCardType(!1,t[e.card.type]):this.updateCardType(!1,"card")}},vaultToNonce:function(nonce,callback){var parameters=this.getBillingAddress();parameters.nonce=nonce,new Ajax.Request(this.vaultToNonceUrl,{method:"post",parameters:parameters,onSuccess:function(transport){if(transport&&transport.responseText){try{response=eval("("+transport.responseText+")")}catch(e){response={}}response.success&&response.nonce?callback(response.nonce):("function"==typeof this.integration.resetLoading&&this.integration.resetLoading(),response.error?alert(response.error):alert("Something wen't wrong and we're currently unable to take your payment."))}}.bind(this),onFailure:function(){"function"==typeof this.integration.resetLoading&&this.integration.resetLoading(),alert("Something wen't wrong and we're currently unable to take your payment.")}.bind(this)})},hostedFieldsPaymentMethodReceived:function(e){this.threeDSecure?("function"==typeof this.integration.setLoading&&this.integration.setLoading(),this.updateData(function(){this.vaultToNonce(e.nonce,function(e){"function"==typeof this.integration.resetLoading&&this.integration.resetLoading(),vzero.verify3dSecureNonce(e,{onSuccess:function(e){this.hostedFieldsNonceReceived(e.nonce)}.bind(this),onFailure:function(e,t){alert(t)}.bind(this)})}.bind(this))}.bind(this))):this.hostedFieldsNonceReceived(e.nonce)},hostedFieldsNonceReceived:function(e){$("creditcard-payment-nonce").value=e,$("creditcard-payment-nonce").setAttribute("value",e),"function"==typeof this.integration.resetLoading&&this.integration.resetLoading(),this._hostedFieldsTokenGenerated=!0,"function"==typeof this.integration.afterHostedFieldsNonceReceived&&this.integration.afterHostedFieldsNonceReceived(e)},hostedFieldsError:function(e){return"function"==typeof this.integration.resetLoading&&this.integration.resetLoading(),-1==e.message.indexOf("Cannot place two elements in")&&alert(e.message),this._hostedFieldsTokenGenerated=!1,"function"==typeof this.integration.afterHostedFieldsError&&this.integration.afterHostedFieldsError(e.message),!1},usingSavedCard:function(){return void 0!=$("creditcard-saved-accounts")&&void 0!=$$("#creditcard-saved-accounts input:checked[type=radio]").first()&&"other"!==$$("#creditcard-saved-accounts input:checked[type=radio]").first().value},setThreeDSecure:function(e){this.threeDSecure=e},setAmount:function(e){this.amount=parseFloat(e)},setBillingName:function(e){this.billingName=e},getBillingName:function(){return"object"==typeof this.billingName?this.combineElementsValues(this.billingName):this.billingName},setBillingPostcode:function(e){this.billingPostcode=e},getBillingPostcode:function(){return"object"==typeof this.billingPostcode?this.combineElementsValues(this.billingPostcode):this.billingPostcode},setAcceptedCards:function(e){this.acceptedCards=e},getBillingAddress:function(){if("function"==typeof this.integration.getBillingAddress)return this.integration.getBillingAddress();var e={};return null!==$("co-billing-form")?e="FORM"==$("co-billing-form").tagName?$("co-billing-form").serialize(!0):this.extractBilling($("co-billing-form").up("form").serialize(!0)):null!==$("billing:firstname")&&(e=this.extractBilling($("billing:firstname").up("form").serialize(!0))),e?e:void 0},extractBilling:function(e){var t={};return $H(e).each(function(e){0==e.key.indexOf("billing")&&-1==e.key.indexOf("password")&&(t[e.key]=e.value)}),t},getAcceptedCards:function(){return this.acceptedCards},combineElementsValues:function(e,t){t||(t=" ");var i=[];return e.each(function(e,t){void 0!==$(e)&&(i[t]=$(e).value)}),i.join(t)},updateCardType:function(e,t){if(t||(t=this.getCardType(e)),void 0!=$("gene_braintree_creditcard_cc_type")&&("card"==t?$("gene_braintree_creditcard_cc_type").value="":$("gene_braintree_creditcard_cc_type").value=t),void 0!=$("card-type-image")){var i=$("card-type-image").src.substring(0,$("card-type-image").src.lastIndexOf("/"));$("card-type-image").setAttribute("src",i+"/"+t+".png")}},observeCardType:function(){void 0!==$$('[data-genebraintree-name="number"]').first()&&(Element.observe($$('[data-genebraintree-name="number"]').first(),"keyup",function(){vzero.updateCardType(this.value)}),$$('[data-genebraintree-name="number"]').first().oninput=function(){var e=this.value.split(" ").join("");e.length>0&&(e=e.match(new RegExp(".{1,4}","g")).join(" ")),this.value=e})},observeAjaxRequests:function(e,t){Ajax.Responders.register({onComplete:function(i){return this.handleAjaxRequest(i.url,e,t)}.bind(this)}),window.jQuery&&jQuery(document).ajaxComplete(function(i,n,a){return this.handleAjaxRequest(a.url,e,t)})},handleAjaxRequest:function(e,t,i){if("undefined"!=typeof i&&i instanceof Array&&i.length>0){var n=!1;if(i.each(function(t){e&&-1!=e.indexOf(t)&&(n=!0)}),n===!0)return!1}e&&-1==e.indexOf("braintree")&&(t?t(e):this.updateData())},updateData:function(callback,params){this._updateDataCallbacks.push(callback),this._updateDataParams=params,this._updateDataXhr!==!1&&this._updateDataXhr.transport.abort(),this._updateDataXhr=new Ajax.Request(this.quoteUrl,{method:"post",parameters:this._updateDataParams,onSuccess:function(transport){if(transport&&transport.responseText){try{response=eval("("+transport.responseText+")")}catch(e){response={}}void 0!=response.billingName&&(this.billingName=response.billingName),void 0!=response.billingPostcode&&(this.billingPostcode=response.billingPostcode),void 0!=response.grandTotal&&(this.amount=response.grandTotal),void 0!=response.threeDSecure&&this.setThreeDSecure(response.threeDSecure),"undefined"!=typeof vzeroPaypal&&void 0!=response.grandTotal&&void 0!=response.currencyCode&&vzeroPaypal.setPricing(response.grandTotal,response.currencyCode),this._updateDataParams={},this._updateDataXhr=!1,this._updateDataCallbacks.length&&(this._updateDataCallbacks.each(function(e){e(response)}.bind(this)),this._updateDataCallbacks=[])}}.bind(this),onFailure:function(){this._updateDataParams={},this._updateDataXhr=!1,this._updateDataCallbacks=[]}.bind(this)})},close3dSecureMethod:function(e){this.closeMethod=e},tokenize3dSavedCards:function(callback){if(this.threeDSecure)if(void 0!==$$("[data-token]").first()){var tokens=[];$$("[data-token]").each(function(e,t){tokens[t]=e.getAttribute("data-token")}),new Ajax.Request(this.tokenizeUrl,{method:"post",onSuccess:function(transport){if(transport&&transport.responseText){try{response=eval("("+transport.responseText+")")}catch(e){response={}}response.success&&$H(response.tokens).each(function(e){void 0!=$$('[data-token="'+e.key+'"]').first()&&$$('[data-token="'+e.key+'"]').first().setAttribute("data-threedsecure-nonce",e.value)}),callback&&callback(response)}}.bind(this),parameters:{tokens:Object.toJSON(tokens)}})}else callback();else callback()},onUserClose3ds:function(){this._hostedFieldsTokenGenerated=!1,this.closeMethod?this.closeMethod():checkout.setLoadWaiting(!1)},verify3dSecureNonce:function(e,t){var i={amount:this.amount,creditCard:e,onUserClose:this.onUserClose3ds.bind(this)};this.client.verify3DS(i,function(e,i){e?t.onFailure&&t.onFailure(i,e.message):t.onSuccess&&t.onSuccess(i)})},verify3dSecure:function(e){var t={amount:this.amount,creditCard:{number:$$('[data-genebraintree-name="number"]').first().value,expirationMonth:$$('[data-genebraintree-name="expiration_month"]').first().value,expirationYear:$$('[data-genebraintree-name="expiration_year"]').first().value,cardholderName:this.getBillingName()},onUserClose:this.onUserClose3ds.bind(this)};void 0!=$$('[data-genebraintree-name="cvv"]').first()&&(t.creditCard.cvv=$$('[data-genebraintree-name="cvv"]').first().value),""!=this.getBillingPostcode()&&(t.creditCard.billingAddress={postalCode:this.getBillingPostcode()}),this.client.verify3DS(t,function(t,i){t?(alert(t.message),e.onFailure?e.onFailure():checkout.setLoadWaiting(!1)):($("creditcard-payment-nonce").value=i.nonce,$("creditcard-payment-nonce").setAttribute("value",i.nonce),e.onSuccess&&e.onSuccess())})},verify3dSecureVault:function(e){var t=$$("#creditcard-saved-accounts input:checked[type=radio]").first().getAttribute("data-threedsecure-nonce");t?this.client.verify3DS({amount:this.amount,creditCard:t},function(t,i){t?(alert(t.message),e.onFailure?e.onFailure():checkout.setLoadWaiting(!1)):($("creditcard-payment-nonce").removeAttribute("disabled"),$("creditcard-payment-nonce").value=i.nonce,$("creditcard-payment-nonce").setAttribute("value",i.nonce),e.onSuccess&&e.onSuccess())}):(alert("No payment nonce present."),e.onFailure?e.onFailure():checkout.setLoadWaiting(!1))},processCard:function(e){var t={number:$$('[data-genebraintree-name="number"]').first().value,cardholderName:this.getBillingName(),expirationMonth:$$('[data-genebraintree-name="expiration_month"]').first().value,expirationYear:$$('[data-genebraintree-name="expiration_year"]').first().value};void 0!=$$('[data-genebraintree-name="cvv"]').first()&&(t.cvv=$$('[data-genebraintree-name="cvv"]').first().value),""!=this.getBillingPostcode()&&(t.billingAddress={postalCode:this.getBillingPostcode()}),this.client.tokenizeCard(t,function(t,i){if(t){for(var n=0;n<t.length;n++)alert(t[n].code+" "+t[n].message);e.onFailure?e.onFailure():checkout.setLoadWaiting(!1)}else $("creditcard-payment-nonce").value=i,$("creditcard-payment-nonce").setAttribute("value",i),e.onSuccess&&e.onSuccess()})},shouldInterceptCreditCard:function(){return!0},shouldInterceptPayPal:function(){return!0},getCardType:function(e){if(e){if(null!=e.match(/^4/))return"VI";if(null!=e.match(/^(34|37)/))return"AE";if(null!=e.match(/^5[1-5]/))return"MC";if(null!=e.match(/^6011/))return"DI";if(null!=e.match(/^(?:2131|1800|35)/))return"JCB";if(null!=e.match(/^(5018|5020|5038|6304|67[0-9]{2})/))return"ME"}return"card"},process:function(e){e=e||{},this._hostedFieldsTokenGenerated?e.onSuccess&&e.onSuccess():this.usingSavedCard()&&$$("#creditcard-saved-accounts input:checked[type=radio]").first().hasAttribute("data-threedsecure-nonce")?this.verify3dSecureVault(e):this.usingSavedCard()?this.updateData(function(){e.onSuccess&&e.onSuccess()}):1==this.threeDSecure?this.verify3dSecure(e):this.processCard(e)},creditCardLoaded:function(){return!1},paypalLoaded:function(){return!1}};var vZeroPayPalButton=Class.create();vZeroPayPalButton.prototype={initialize:function(e,t,i,n,a){this.clientToken=e,this.storeFrontName=t,this.singleUse=i,this.locale=n,this.futureSingleUse=a,this._paypalOptions={},this._paypalIntegration=!1},setPricing:function(e,t){this.amount=parseFloat(e),this.currency=t,this.rebuildButton()},rebuildButton:function(){this._paypalIntegration!==!1&&this._paypalIntegration.teardown(function(){this.addPayPalButton(this._paypalOptions)}.bind(this))},addPayPalButton:function(e){if(null===$("paypal-container"))return!1;this._paypalOptions=e,this._paypalIntegration=!1;var t={container:"paypal-container",paymentMethodNonceInputField:"paypal-payment-nonce",displayName:this.storeFrontName,onPaymentMethodReceived:function(t){"function"==typeof e.onSuccess?e.onSuccess(t):(payment.switchMethod("gene_braintree_paypal"),$("paypal-payment-nonce").removeAttribute("disabled"),$("paypal-complete").remove(),window.review&&review.save())},onUnsupported:function(){alert("You need to link your PayPal account with your Braintree account in your Braintree control panel to utilise the PayPal functionality of this extension.")},onReady:function(t){this._paypalIntegration=t,"function"==typeof e.onReady&&e.onReady(t)}.bind(this)};1==this.singleUse?(t.singleUse=!0,t.amount=this.amount,t.currency=this.currency,t.locale=this.locale):1==this.futureSingleUse&&(t.singleUse=!0),braintree.setup(this.clientToken,"paypal",t)},closePayPalWindow:function(e){}};var vZeroIntegration=Class.create();vZeroIntegration.prototype={initialize:function(e,t,i,n,a,s){return vZeroIntegration.prototype.loaded?(console.error("Your checkout is including the Braintree resources multiple times, please resolve this."),!1):(vZeroIntegration.prototype.loaded=!0,this.vzero=e||!1,this.vzeroPaypal=t||!1,this.vzero===!1&&this.vzeroPaypal===!1?(console.warn("The vzero and vzeroPaypal objects are not initiated."),!1):(this.paypalMarkUp=i||!1,this.paypalButtonClass=n||!1,this.isOnepage=a||!1,this.config=s||{},this._methodSwitchTimeout=!1,this._hostedFieldsInit=!1,this.prepareSubmitObserver(),this.preparePaymentMethodSwitchObserver(),this.hostedFieldsGenerated=!1,this.vzero.close3dSecureMethod(function(){this.vzero._hostedFieldsValidationRunning=!1,this.vzero.tokenize3dSavedCards(function(){this.threeDTokenizationComplete()}.bind(this))}.bind(this)),this.isOnepage&&(this.vzero.observeCardType(),this.observeAjaxRequests(),document.observe("dom:loaded",function(){this.initSavedPayPal(),this.initDefaultMethod(),null!==$("braintree-hosted-submit")&&this.initHostedFields()}.bind(this))),void document.observe("dom:loaded",function(){this.initSavedMethods()}.bind(this))))},initSavedMethods:function(){$$('#creditcard-saved-accounts input[type="radio"], #paypal-saved-accounts input[type="radio"]').each(function(e){var t="",i="";void 0!==e.up("#creditcard-saved-accounts")?(t="#creditcard-saved-accounts",i="#credit-card-form"):void 0!==e.up("#paypal-saved-accounts")&&(t="#paypal-saved-accounts",i=".paypal-info"),$(e).stopObserving("change").observe("change",function(e){return this.showHideOtherMethod(t,i)}.bind(this))}.bind(this))},showHideOtherMethod:function(e,t){void 0!==$$(e+" input:checked[type=radio]").first()&&"other"==$$(e+" input:checked[type=radio]").first().value?void 0!==$$(t).first()&&($$(t).first().show(),$$(t+" input, "+t+" select").each(function(e){e.removeAttribute("disabled")})):void 0!==$$(e+" input:checked[type=radio]").first()&&void 0!==$$(t).first()&&($$(t).first().hide(),$$(t+" input, "+t+" select").each(function(e){e.setAttribute("disabled","disabled")}))},checkSavedOther:function(){var e="",t="";"gene_braintree_creditcard"==this.getPaymentMethod()?(e="#creditcard-saved-accounts",t="#credit-card-form"):"gene_braintree_paypal"==this.getPaymentMethod()&&(e="#paypal-saved-accounts",t=".paypal-info"),void 0!==$$(e).first()&&this.showHideOtherMethod(e,t)},initHostedFields:function(){this.vzero.hostedFields&&null!==$("braintree-hosted-submit")&&(void 0!==$("braintree-hosted-submit").up("form")?(this._hostedFieldsInit=!0,this.form=$("braintree-hosted-submit").up("form"),this.vzero.initHostedFields(this)):console.error("Hosted Fields cannot be initialized as we're unable to locate the parent form."))},afterHostedFieldsNonceReceived:function(e){return this.resetLoading(),this.vzero._hostedFieldsTokenGenerated=!0,this.hostedFieldsGenerated=!0,this.isOnepage?this.submitCheckout():this.submitPayment()},afterHostedFieldsError:function(e){return this.vzero._hostedFieldsTokenGenerated=!1,this.hostedFieldsGenerated=!1,!1},initDefaultMethod:function(){this.shouldAddPayPalButton(!1)&&(this.setLoading(),this.vzero.updateData(function(){this.resetLoading(),this.updatePayPalButton("add")}.bind(this)))},observeAjaxRequests:function(){this.vzero.observeAjaxRequests(function(){this.vzero.updateData(function(){this.isOnepage&&(this.initSavedPayPal(),this.checkSavedOther(),this.vzero.hostedFields&&this.initHostedFields()),this.initSavedMethods()}.bind(this))}.bind(this),"undefined"!=typeof this.config.ignoreAjax?this.config.ignoreAjax:!1)},initSavedPayPal:function(){void 0!==$$("#paypal-saved-accounts input[type=radio]").first()&&$("paypal-saved-accounts").on("change","input[type=radio]",function(e){this.updatePayPalButton(!1,"gene_braintree_paypal")}.bind(this))},prepareSubmitObserver:function(){return!1},beforeSubmit:function(e){return this._beforeSubmit(e)},_beforeSubmit:function(e){if(this.hostedFieldsGenerated===!1&&this.vzero.hostedFields&&(void 0===$$("#creditcard-saved-accounts input:checked[type=radio]").first()||void 0!==$$("#creditcard-saved-accounts input:checked[type=radio]").first()&&"other"==$$("#creditcard-saved-accounts input:checked[type=radio]").first().value)){var t=$("braintree-hosted-submit").down("button");t.removeAttribute("disabled"),t.click()}else e()},afterSubmit:function(){return!1},submit:function(e,t,i,n){this.shouldInterceptSubmit(e)&&(this.validateAll()?(this.setLoading(),this.beforeSubmit(function(){void 0!=$$('[data-genebraintree-name="number"]').first()&&this.vzero.updateCardType($$('[data-genebraintree-name="number"]').first().value),this.vzero.updateData(function(){this.updateBilling(),this.vzero.process({onSuccess:function(){if(this.enableDeviceData(),this.disableCreditCardForm(),this.resetLoading(),this.afterSubmit(),this.enableDisableNonce(),this.vzero._hostedFieldsTokenGenerated=!1,this.hostedFieldsGenerated=!1,"function"==typeof t)var e=t();return this.setLoading(),this.enableCreditCardForm(),e}.bind(this),onFailure:function(){return this.vzero._hostedFieldsTokenGenerated=!1,this.hostedFieldsGenerated=!1,this.resetLoading(),this.afterSubmit(),"function"==typeof i?i():void 0}.bind(this)})}.bind(this),this.getUpdateDataParams())}.bind(this))):(this.vzero._hostedFieldsTokenGenerated=!1,this.hostedFieldsGenerated=!1,this.resetLoading(),"function"==typeof n&&n()))},submitCheckout:function(){window.review&&review.save()},submitPayment:function(){payment.save&&payment.save()},enableDisableNonce:function(){"gene_braintree_creditcard"==this.getPaymentMethod()?(null!==$("creditcard-payment-nonce")&&$("creditcard-payment-nonce").removeAttribute("disabled"),null!==$("paypal-payment-nonce")&&$("paypal-payment-nonce").setAttribute("disabled","disabled")):"gene_braintree_paypal"==this.getPaymentMethod()&&(null!==$("creditcard-payment-nonce")&&$("creditcard-payment-nonce").setAttribute("disabled","disabled"),null!==$("paypal-payment-nonce")&&$("paypal-payment-nonce").removeAttribute("disabled"))},preparePaymentMethodSwitchObserver:function(){return this.defaultPaymentMethodSwitch()},defaultPaymentMethodSwitch:function(){var e=this,t=Payment.prototype.switchMethod;Payment.prototype.switchMethod=function(i){return e.paymentMethodSwitch(i),t.apply(this,arguments)}},paymentMethodSwitch:function(e){clearTimeout(this._methodSwitchTimeout),this._methodSwitchTimeout=setTimeout(function(){this.shouldAddPayPalButton(e)?this.updatePayPalButton("add",e):this.updatePayPalButton("remove",e),"gene_braintree_creditcard"==(e?e:this.getPaymentMethod())&&this.initHostedFields(),this.checkSavedOther()}.bind(this),50)},completePayPal:function(e){return this.enableDisableNonce(),this.enableDeviceData(),e.nonce&&null!==$("paypal-payment-nonce")?($("paypal-payment-nonce").value=e.nonce,$("paypal-payment-nonce").setAttribute("value",e.nonce)):console.warn("Unable to update PayPal nonce, please verify that the nonce input field has the ID: paypal-payment-nonce"),this.afterPayPalComplete(),!1},afterPayPalComplete:function(){return this.resetLoading(),this.submitCheckout()},updatePayPalButton:function(e,t){if(this.paypalMarkUp===!1)return!1;if("refresh"==e)return this.updatePayPalButton("remove"),this.updatePayPalButton("add"),!0;if(this.shouldAddPayPalButton(t)&&"remove"!=e||"add"==e)if(void 0!==$$(this.paypalButtonClass).first()){if(void 0!==$$("#paypal-complete").first()&&$$("#paypal-complete").first().visible())return!0;$$(this.paypalButtonClass).first().hide(),$$(this.paypalButtonClass).first().insert({after:this.paypalMarkUp});var i={onSuccess:this.completePayPal.bind(this),onReady:this.paypalOnReady.bind(this)};this.vzeroPaypal.addPayPalButton(i)}else console.warn("We're unable to find the element "+this.paypalButtonClass+". Please check your integration.");else void 0!==$$(this.paypalButtonClass).first()&&$$(this.paypalButtonClass).first().show(),void 0!==$$("#paypal-complete").first()&&$("paypal-complete").remove()},paypalOnReady:function(e){$("braintree-paypal-button").stopObserving("click").on("click",function(e){return this.validateAll()?void 0:(Event.stop(e),!1)}.bind(this))},setLoading:function(){checkout.setLoadWaiting("payment")},resetLoading:function(){checkout.setLoadWaiting(!1)},enableDeviceData:function(){null!==$("device_data")&&$("device_data").removeAttribute("disabled")},disableCreditCardForm:function(){$$("#credit-card-form input, #credit-card-form select").each(function(e){"creditcard-payment-nonce"!=e.id&&"gene_braintree_creditcard_store_in_vault"!=e.id&&e.setAttribute("disabled","disabled")})},enableCreditCardForm:function(){$$("#credit-card-form input, #credit-card-form select").each(function(e){e.removeAttribute("disabled")})},updateBilling:function(){(null!==$("billing-address-select")&&""==$("billing-address-select").value||null===$("billing-address-select"))&&(null!==$("billing:firstname")&&null!==$("billing:lastname")&&this.vzero.setBillingName($("billing:firstname").value+" "+$("billing:lastname").value),null!==$("billing:postcode")&&this.vzero.setBillingPostcode($("billing:postcode").value))},getUpdateDataParams:function(){var e={};return null!==$("billing-address-select")&&""!=$("billing-address-select").value&&(e.addressId=$("billing-address-select").value),e},getPaymentMethod:function(){return payment.currentMethod},shouldInterceptSubmit:function(e){switch(e){case"creditcard":return"gene_braintree_creditcard"==this.getPaymentMethod()&&this.vzero.shouldInterceptCreditCard();break;case"paypal":return"gene_braintree_paypal"==this.getPaymentMethod()&&this.vzero.shouldInterceptCreditCard()}return!1},shouldAddPayPalButton:function(e){return"gene_braintree_paypal"==(e?e:this.getPaymentMethod())&&null===$("paypal-saved-accounts")||"gene_braintree_paypal"==(e?e:this.getPaymentMethod())&&void 0!==$$("#paypal-saved-accounts input:checked[type=radio]").first()&&"other"==$$("#paypal-saved-accounts input:checked[type=radio]").first().value},threeDTokenizationComplete:function(){this.resetLoading()},validateAll:function(){return!0}};
 
js/gene/braintree/vzero-0.6-min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ var vZero=Class.create();vZero.prototype={initialize:function(e,t,i,n,a,s,o,r,d){this.code=e,this.clientToken=t,this.threeDSecure=i,this.hostedFields=n,a&&(this.billingName=a),s&&(this.billingPostcode=s),o&&(this.quoteUrl=o),r&&(this.tokenizeUrl=r),d&&(this.vaultToNonceUrl=d),this._hostedFieldsTokenGenerated=!1,this.acceptedCards=!1,this.closeMethod=!1,this._hostedFieldsTimeout=!1,this._updateDataXhr=!1,this._updateDataCallbacks=[],this._updateDataParams={},this._vaultToNonceXhr=!1},init:function(){this.client=new braintree.api.Client({clientToken:this.clientToken})},initHostedFields:function(e){return $$('iframe[name^="braintree-"]').length>0?!1:null===$("braintree-hosted-submit")?!1:(this.integration=e,this._hostedFieldsTokenGenerated=!1,clearTimeout(this._hostedFieldsTimeout),void(this._hostedFieldsTimeout=setTimeout(function(){if(this._hostedIntegration!==!1)try{this._hostedIntegration.teardown(function(){this._hostedIntegration=!1,this.setupHostedFieldsClient()}.bind(this))}catch(e){this.setupHostedFieldsClient()}else this.setupHostedFieldsClient()}.bind(this),50)))},setupHostedFieldsClient:function(){if($$('iframe[name^="braintree-"]').length>0)return!1;this._hostedIntegration=!1;var e={id:this.integration.form,hostedFields:{styles:{input:{"font-size":"14pt",color:"#3A3A3A"},":focus":{color:"black"},".valid":{color:"green"},".invalid":{color:"red"}},number:{selector:"#card-number",placeholder:"0000 0000 0000 0000"},expirationMonth:{selector:"#expiration-month",placeholder:"MM"},expirationYear:{selector:"#expiration-year",placeholder:"YY"},onFieldEvent:this.hostedFieldsOnFieldEvent.bind(this)},onReady:function(e){this._hostedIntegration=e}.bind(this),onPaymentMethodReceived:this.hostedFieldsPaymentMethodReceived.bind(this),onError:this.hostedFieldsError.bind(this)};null!==$("cvv")&&(e.hostedFields.cvv={selector:"#cvv"}),braintree.setup(this.clientToken,"custom",e)},hostedFieldsOnFieldEvent:function(e){if("fieldStateChange"===e.type&&e.card){var t={visa:"VI","american-express":"AE","master-card":"MC",discovery:"DI",jcb:"JCB",maestro:"ME"};void 0!==typeof t[e.card.type]?this.updateCardType(!1,t[e.card.type]):this.updateCardType(!1,"card")}},vaultToNonce:function(nonce,callback){var parameters=this.getBillingAddress();parameters.nonce=nonce,new Ajax.Request(this.vaultToNonceUrl,{method:"post",parameters:parameters,onSuccess:function(transport){if(transport&&transport.responseText){try{response=eval("("+transport.responseText+")")}catch(e){response={}}response.success&&response.nonce?callback(response.nonce):("function"==typeof this.integration.resetLoading&&this.integration.resetLoading(),response.error?alert(response.error):alert("Something wen't wrong and we're currently unable to take your payment."))}}.bind(this),onFailure:function(){"function"==typeof this.integration.resetLoading&&this.integration.resetLoading(),alert("Something wen't wrong and we're currently unable to take your payment.")}.bind(this)})},hostedFieldsPaymentMethodReceived:function(e){this.threeDSecure?("function"==typeof this.integration.setLoading&&this.integration.setLoading(),this.updateData(function(){this.vaultToNonce(e.nonce,function(e){"function"==typeof this.integration.resetLoading&&this.integration.resetLoading(),this.verify3dSecureNonce(e,{onSuccess:function(e){this.hostedFieldsNonceReceived(e.nonce)}.bind(this),onFailure:function(e,t){alert(t)}.bind(this)})}.bind(this))}.bind(this))):this.hostedFieldsNonceReceived(e.nonce)},hostedFieldsNonceReceived:function(e){$("creditcard-payment-nonce").value=e,$("creditcard-payment-nonce").setAttribute("value",e),"function"==typeof this.integration.resetLoading&&this.integration.resetLoading(),this._hostedFieldsTokenGenerated=!0,"function"==typeof this.integration.afterHostedFieldsNonceReceived&&this.integration.afterHostedFieldsNonceReceived(e)},hostedFieldsError:function(e){return"function"==typeof this.integration.resetLoading&&this.integration.resetLoading(),"undefined"!=typeof e.message&&-1==e.message.indexOf("Cannot place two elements in")&&alert(e.message),this._hostedFieldsTokenGenerated=!1,"function"==typeof this.integration.afterHostedFieldsError&&this.integration.afterHostedFieldsError(e.message),!1},usingSavedCard:function(){return void 0!=$("creditcard-saved-accounts")&&void 0!=$$("#creditcard-saved-accounts input:checked[type=radio]").first()&&"other"!==$$("#creditcard-saved-accounts input:checked[type=radio]").first().value},setThreeDSecure:function(e){this.threeDSecure=e},setAmount:function(e){this.amount=parseFloat(e)},setBillingName:function(e){this.billingName=e},getBillingName:function(){return"object"==typeof this.billingName?this.combineElementsValues(this.billingName):this.billingName},setBillingPostcode:function(e){this.billingPostcode=e},getBillingPostcode:function(){return"object"==typeof this.billingPostcode?this.combineElementsValues(this.billingPostcode):this.billingPostcode},setAcceptedCards:function(e){this.acceptedCards=e},getBillingAddress:function(){if("function"==typeof this.integration.getBillingAddress)return this.integration.getBillingAddress();var e={};return null!==$("co-billing-form")?e="FORM"==$("co-billing-form").tagName?$("co-billing-form").serialize(!0):this.extractBilling($("co-billing-form").up("form").serialize(!0)):null!==$("billing:firstname")&&(e=this.extractBilling($("billing:firstname").up("form").serialize(!0))),e?e:void 0},extractBilling:function(e){var t={};return $H(e).each(function(e){0==e.key.indexOf("billing")&&-1==e.key.indexOf("password")&&(t[e.key]=e.value)}),t},getAcceptedCards:function(){return this.acceptedCards},combineElementsValues:function(e,t){t||(t=" ");var i=[];return e.each(function(e,t){void 0!==$(e)&&(i[t]=$(e).value)}),i.join(t)},updateCardType:function(e,t){if(t||(t=this.getCardType(e)),void 0!=$("gene_braintree_creditcard_cc_type")&&("card"==t?$("gene_braintree_creditcard_cc_type").value="":$("gene_braintree_creditcard_cc_type").value=t),void 0!=$("card-type-image")){var i=$("card-type-image").src.substring(0,$("card-type-image").src.lastIndexOf("/"));$("card-type-image").setAttribute("src",i+"/"+t+".png")}},observeCardType:function(){void 0!==$$('[data-genebraintree-name="number"]').first()&&(Element.observe($$('[data-genebraintree-name="number"]').first(),"keyup",function(){vzero.updateCardType(this.value)}),$$('[data-genebraintree-name="number"]').first().oninput=function(){var e=this.value.split(" ").join("");e.length>0&&(e=e.match(new RegExp(".{1,4}","g")).join(" ")),this.value=e})},observeAjaxRequests:function(e,t){Ajax.Responders.register({onComplete:function(i){return this.handleAjaxRequest(i.url,e,t)}.bind(this)}),window.jQuery&&jQuery(document).ajaxComplete(function(i,n,a){return this.handleAjaxRequest(a.url,e,t)}.bind(this))},handleAjaxRequest:function(e,t,i){if("undefined"!=typeof i&&i instanceof Array&&i.length>0){var n=!1;if(i.each(function(t){e&&-1!=e.indexOf(t)&&(n=!0)}),n===!0)return!1}e&&-1==e.indexOf("braintree")&&(t?t(e):this.updateData())},updateData:function(callback,params){this._updateDataCallbacks.push(callback),this._updateDataParams=params,this._updateDataXhr!==!1&&this._updateDataXhr.transport.abort(),this._updateDataXhr=new Ajax.Request(this.quoteUrl,{method:"post",parameters:this._updateDataParams,onSuccess:function(transport){if(transport&&transport.responseText){try{response=eval("("+transport.responseText+")")}catch(e){response={}}void 0!=response.billingName&&(this.billingName=response.billingName),void 0!=response.billingPostcode&&(this.billingPostcode=response.billingPostcode),void 0!=response.grandTotal&&(this.amount=response.grandTotal),void 0!=response.threeDSecure&&this.setThreeDSecure(response.threeDSecure),"undefined"!=typeof vzeroPaypal&&void 0!=response.grandTotal&&void 0!=response.currencyCode&&vzeroPaypal.setPricing(response.grandTotal,response.currencyCode),this._updateDataParams={},this._updateDataXhr=!1,this._updateDataCallbacks.length&&(this._updateDataCallbacks.each(function(e){e(response)}.bind(this)),this._updateDataCallbacks=[])}}.bind(this),onFailure:function(){this._updateDataParams={},this._updateDataXhr=!1,this._updateDataCallbacks=[]}.bind(this)})},close3dSecureMethod:function(e){this.closeMethod=e},tokenize3dSavedCards:function(callback){if(this.threeDSecure)if(void 0!==$$("[data-token]").first()){var tokens=[];$$("[data-token]").each(function(e,t){tokens[t]=e.getAttribute("data-token")}),new Ajax.Request(this.tokenizeUrl,{method:"post",onSuccess:function(transport){if(transport&&transport.responseText){try{response=eval("("+transport.responseText+")")}catch(e){response={}}response.success&&$H(response.tokens).each(function(e){void 0!=$$('[data-token="'+e.key+'"]').first()&&$$('[data-token="'+e.key+'"]').first().setAttribute("data-threedsecure-nonce",e.value)}),callback&&callback(response)}}.bind(this),parameters:{tokens:Object.toJSON(tokens)}})}else callback();else callback()},onUserClose3ds:function(){this._hostedFieldsTokenGenerated=!1,this.closeMethod?this.closeMethod():checkout.setLoadWaiting(!1)},verify3dSecureNonce:function(e,t){var i={amount:this.amount,creditCard:e,onUserClose:this.onUserClose3ds.bind(this)};this.client.verify3DS(i,function(e,i){e?t.onFailure&&t.onFailure(i,e.message):t.onSuccess&&t.onSuccess(i)})},verify3dSecure:function(e){var t={amount:this.amount,creditCard:{number:$$('[data-genebraintree-name="number"]').first().value,expirationMonth:$$('[data-genebraintree-name="expiration_month"]').first().value,expirationYear:$$('[data-genebraintree-name="expiration_year"]').first().value,cardholderName:this.getBillingName()},onUserClose:this.onUserClose3ds.bind(this)};void 0!=$$('[data-genebraintree-name="cvv"]').first()&&(t.creditCard.cvv=$$('[data-genebraintree-name="cvv"]').first().value),""!=this.getBillingPostcode()&&(t.creditCard.billingAddress={postalCode:this.getBillingPostcode()}),this.client.verify3DS(t,function(t,i){t?(alert(t.message),e.onFailure?e.onFailure():checkout.setLoadWaiting(!1)):($("creditcard-payment-nonce").value=i.nonce,$("creditcard-payment-nonce").setAttribute("value",i.nonce),e.onSuccess&&e.onSuccess())})},verify3dSecureVault:function(e){var t=$$("#creditcard-saved-accounts input:checked[type=radio]").first().getAttribute("data-threedsecure-nonce");t?this.client.verify3DS({amount:this.amount,creditCard:t},function(t,i){t?(alert(t.message),e.onFailure?e.onFailure():checkout.setLoadWaiting(!1)):($("creditcard-payment-nonce").removeAttribute("disabled"),$("creditcard-payment-nonce").value=i.nonce,$("creditcard-payment-nonce").setAttribute("value",i.nonce),e.onSuccess&&e.onSuccess())}):(alert("No payment nonce present."),e.onFailure?e.onFailure():checkout.setLoadWaiting(!1))},processCard:function(e){var t={number:$$('[data-genebraintree-name="number"]').first().value,cardholderName:this.getBillingName(),expirationMonth:$$('[data-genebraintree-name="expiration_month"]').first().value,expirationYear:$$('[data-genebraintree-name="expiration_year"]').first().value};void 0!=$$('[data-genebraintree-name="cvv"]').first()&&(t.cvv=$$('[data-genebraintree-name="cvv"]').first().value),""!=this.getBillingPostcode()&&(t.billingAddress={postalCode:this.getBillingPostcode()}),this.client.tokenizeCard(t,function(t,i){if(t){for(var n=0;n<t.length;n++)alert(t[n].code+" "+t[n].message);e.onFailure?e.onFailure():checkout.setLoadWaiting(!1)}else $("creditcard-payment-nonce").value=i,$("creditcard-payment-nonce").setAttribute("value",i),e.onSuccess&&e.onSuccess()})},shouldInterceptCreditCard:function(){return!0},shouldInterceptPayPal:function(){return!0},getCardType:function(e){if(e){if(null!=e.match(/^4/))return"VI";if(null!=e.match(/^(34|37)/))return"AE";if(null!=e.match(/^5[1-5]/))return"MC";if(null!=e.match(/^6011/))return"DI";if(null!=e.match(/^(?:2131|1800|35)/))return"JCB";if(null!=e.match(/^(5018|5020|5038|6304|67[0-9]{2})/))return"ME"}return"card"},process:function(e){e=e||{},this._hostedFieldsTokenGenerated?e.onSuccess&&e.onSuccess():this.usingSavedCard()&&$$("#creditcard-saved-accounts input:checked[type=radio]").first().hasAttribute("data-threedsecure-nonce")?this.verify3dSecureVault(e):this.usingSavedCard()?e.onSuccess&&e.onSuccess():1==this.threeDSecure?this.verify3dSecure(e):this.processCard(e)},creditCardLoaded:function(){return!1},paypalLoaded:function(){return!1}};var vZeroPayPalButton=Class.create();vZeroPayPalButton.prototype={initialize:function(e,t,i,n,a){this.clientToken=e,this.storeFrontName=t,this.singleUse=i,this.locale=n,this.futureSingleUse=a,this._paypalOptions={},this._paypalIntegration=!1,this._rebuildTimer=!1,this._rebuildCount=0},setPricing:function(e,t){this.amount=parseFloat(e),this.currency=t,this.rebuildButton()},rebuildButton:function(){if(clearTimeout(this._rebuildTimer),this._paypalIntegration!==!1)try{this._paypalIntegration.teardown(function(){this._paypalIntegration=!1,this.addPayPalButton(this._paypalOptions)}.bind(this))}catch(e){if("Cannot teardown integration more than once"==e.message)this._paypalIntegration=!1,this.addPayPalButton(this._paypalOptions);else{if(this._rebuildCount>=10)return!1;this._rebuildTimer=setTimeout(function(){++this._rebuildCount,this.rebuildButton()}.bind(this),200)}}},addPayPalButton:function(e){if(null===$("paypal-container"))return!1;this._paypalOptions=e,this._paypalIntegration=!1;var t={container:"paypal-container",paymentMethodNonceInputField:"paypal-payment-nonce",displayName:this.storeFrontName,onPaymentMethodReceived:function(t){"function"==typeof e.onSuccess?e.onSuccess(t):(payment.switchMethod("gene_braintree_paypal"),$("paypal-payment-nonce").removeAttribute("disabled"),$("paypal-complete").remove(),window.review&&review.save())},onUnsupported:function(){alert("You need to link your PayPal account with your Braintree account in your Braintree control panel to utilise the PayPal functionality of this extension.")},onReady:function(t){this._paypalIntegration=t,"function"==typeof e.onReady&&e.onReady(t)}.bind(this)};1==this.singleUse?(t.singleUse=!0,t.amount=this.amount,t.currency=this.currency,t.locale=this.locale):1==this.futureSingleUse?t.singleUse=!0:t.singleUse=!1,braintree.setup(this.clientToken,"paypal",t)},closePayPalWindow:function(e){}};var vZeroIntegration=Class.create();vZeroIntegration.prototype={initialize:function(e,t,i,n,a,s,o){return vZeroIntegration.prototype.loaded?(console.error("Your checkout is including the Braintree resources multiple times, please resolve this."),!1):(vZeroIntegration.prototype.loaded=!0,this.vzero=e||!1,this.vzeroPaypal=t||!1,this.vzero===!1&&this.vzeroPaypal===!1?(console.warn("The vzero and vzeroPaypal objects are not initiated."),!1):(this.paypalMarkUp=i||!1,this.paypalButtonClass=n||!1,this.isOnepage=a||!1,this.config=s||{},this._methodSwitchTimeout=!1,this._hostedFieldsInit=!1,document.observe("dom:loaded",function(){this.prepareSubmitObserver(),this.preparePaymentMethodSwitchObserver()}.bind(this)),this.hostedFieldsGenerated=!1,this.vzero.close3dSecureMethod(function(){this.vzero._hostedFieldsValidationRunning=!1,this.vzero.tokenize3dSavedCards(function(){this.threeDTokenizationComplete()}.bind(this))}.bind(this)),this.isOnepage&&(this.vzero.observeCardType(),this.observeAjaxRequests(),document.observe("dom:loaded",function(){this.initSavedPayPal(),this.initDefaultMethod(),null!==$("braintree-hosted-submit")&&this.initHostedFields()}.bind(this))),void document.observe("dom:loaded",function(){this.initSavedMethods()}.bind(this))))},initSavedMethods:function(){$$('#creditcard-saved-accounts input[type="radio"], #paypal-saved-accounts input[type="radio"]').each(function(e){var t="",i="";void 0!==e.up("#creditcard-saved-accounts")?(t="#creditcard-saved-accounts",i="#credit-card-form"):void 0!==e.up("#paypal-saved-accounts")&&(t="#paypal-saved-accounts",i=".paypal-info"),$(e).stopObserving("change").observe("change",function(e){return this.showHideOtherMethod(t,i)}.bind(this))}.bind(this))},showHideOtherMethod:function(e,t){void 0!==$$(e+" input:checked[type=radio]").first()&&"other"==$$(e+" input:checked[type=radio]").first().value?void 0!==$$(t).first()&&($$(t).first().show(),$$(t+" input, "+t+" select").each(function(e){e.removeAttribute("disabled")})):void 0!==$$(e+" input:checked[type=radio]").first()&&void 0!==$$(t).first()&&($$(t).first().hide(),$$(t+" input, "+t+" select").each(function(e){e.setAttribute("disabled","disabled")}))},checkSavedOther:function(){var e="",t="";"gene_braintree_creditcard"==this.getPaymentMethod()?(e="#creditcard-saved-accounts",t="#credit-card-form"):"gene_braintree_paypal"==this.getPaymentMethod()&&(e="#paypal-saved-accounts",t=".paypal-info"),void 0!==$$(e).first()&&this.showHideOtherMethod(e,t)},initHostedFields:function(){this.vzero.hostedFields&&null!==$("braintree-hosted-submit")&&(void 0!==$("braintree-hosted-submit").up("form")?(this._hostedFieldsInit=!0,this.form=$("braintree-hosted-submit").up("form"),this.vzero.initHostedFields(this)):console.error("Hosted Fields cannot be initialized as we're unable to locate the parent form."))},afterHostedFieldsNonceReceived:function(e){return this.resetLoading(),this.vzero._hostedFieldsTokenGenerated=!0,this.hostedFieldsGenerated=!0,this.isOnepage?this.submitCheckout():this.submitPayment()},afterHostedFieldsError:function(e){return this.vzero._hostedFieldsTokenGenerated=!1,this.hostedFieldsGenerated=!1,!1},initDefaultMethod:function(){this.shouldAddPayPalButton(!1)&&(this.setLoading(),this.vzero.updateData(function(){this.resetLoading(),this.updatePayPalButton("add")}.bind(this)))},observeAjaxRequests:function(){this.vzero.observeAjaxRequests(function(){this.vzero.updateData(function(){this.isOnepage&&(this.initSavedPayPal(),this.rebuildPayPalButton(),this.checkSavedOther(),this.vzero.hostedFields&&this.initHostedFields()),this.initSavedMethods()}.bind(this))}.bind(this),"undefined"!=typeof this.config.ignoreAjax?this.config.ignoreAjax:!1)},rebuildPayPalButton:function(){null==$("paypal-container")&&this.updatePayPalButton()},initSavedPayPal:function(){void 0!==$$("#paypal-saved-accounts input[type=radio]").first()&&$("paypal-saved-accounts").on("change","input[type=radio]",function(e){this.updatePayPalButton(!1,"gene_braintree_paypal")}.bind(this))},prepareSubmitObserver:function(){return!1},beforeSubmit:function(e){return this._beforeSubmit(e)},_beforeSubmit:function(e){if(this.hostedFieldsGenerated===!1&&this.vzero.hostedFields&&(void 0===$$("#creditcard-saved-accounts input:checked[type=radio]").first()||void 0!==$$("#creditcard-saved-accounts input:checked[type=radio]").first()&&"other"==$$("#creditcard-saved-accounts input:checked[type=radio]").first().value)){var t=$("braintree-hosted-submit").down("button");t.removeAttribute("disabled"),t.click()}else e()},afterSubmit:function(){return!1},submit:function(e,t,i,n){this.shouldInterceptSubmit(e)&&(this.validateAll()?(this.setLoading(),this.beforeSubmit(function(){void 0!=$$('[data-genebraintree-name="number"]').first()&&this.vzero.updateCardType($$('[data-genebraintree-name="number"]').first().value),this.vzero.updateData(function(){this.updateBilling(),this.vzero.process({onSuccess:function(){if(this.enableDeviceData(),this.disableCreditCardForm(),this.resetLoading(),this.afterSubmit(),this.enableDisableNonce(),this.vzero._hostedFieldsTokenGenerated=!1,this.hostedFieldsGenerated=!1,"function"==typeof t)var e=t();return this.setLoading(),this.enableCreditCardForm(),e}.bind(this),onFailure:function(){return this.vzero._hostedFieldsTokenGenerated=!1,this.hostedFieldsGenerated=!1,this.resetLoading(),this.afterSubmit(),"function"==typeof i?i():void 0}.bind(this)})}.bind(this),this.getUpdateDataParams())}.bind(this))):(this.vzero._hostedFieldsTokenGenerated=!1,this.hostedFieldsGenerated=!1,this.resetLoading(),"function"==typeof n&&n()))},submitCheckout:function(){window.review&&review.save()},submitPayment:function(){payment.save&&payment.save()},enableDisableNonce:function(){"gene_braintree_creditcard"==this.getPaymentMethod()?(null!==$("creditcard-payment-nonce")&&$("creditcard-payment-nonce").removeAttribute("disabled"),null!==$("paypal-payment-nonce")&&$("paypal-payment-nonce").setAttribute("disabled","disabled")):"gene_braintree_paypal"==this.getPaymentMethod()&&(null!==$("creditcard-payment-nonce")&&$("creditcard-payment-nonce").setAttribute("disabled","disabled"),null!==$("paypal-payment-nonce")&&$("paypal-payment-nonce").removeAttribute("disabled"))},preparePaymentMethodSwitchObserver:function(){return this.defaultPaymentMethodSwitch()},defaultPaymentMethodSwitch:function(){var e=this,t=Payment.prototype.switchMethod;Payment.prototype.switchMethod=function(i){return e.paymentMethodSwitch(i),t.apply(this,arguments)}},paymentMethodSwitch:function(e){clearTimeout(this._methodSwitchTimeout),this._methodSwitchTimeout=setTimeout(function(){this.shouldAddPayPalButton(e)?this.updatePayPalButton("add",e):this.updatePayPalButton("remove",e),"gene_braintree_creditcard"==(e?e:this.getPaymentMethod())&&this.initHostedFields(),this.checkSavedOther()}.bind(this),50)},completePayPal:function(e){return this.enableDisableNonce(),this.enableDeviceData(),e.nonce&&null!==$("paypal-payment-nonce")?($("paypal-payment-nonce").value=e.nonce,$("paypal-payment-nonce").setAttribute("value",e.nonce)):console.warn("Unable to update PayPal nonce, please verify that the nonce input field has the ID: paypal-payment-nonce"),this.afterPayPalComplete(),!1},afterPayPalComplete:function(){return this.resetLoading(),this.submitCheckout()},updatePayPalButton:function(e,t){if(this.paypalMarkUp===!1)return!1;if("refresh"==e)return this.updatePayPalButton("remove"),this.updatePayPalButton("add"),!0;if(this.shouldAddPayPalButton(t)&&"remove"!=e||"add"==e)if(void 0!==$$(this.paypalButtonClass).first()){if(void 0!==$$("#paypal-complete").first()&&$$("#paypal-complete").first().visible())return!0;$$(this.paypalButtonClass).first().hide(),$$(this.paypalButtonClass).first().insert({after:this.paypalMarkUp});var i={onSuccess:this.completePayPal.bind(this),onReady:this.paypalOnReady.bind(this)};this.vzeroPaypal.addPayPalButton(i)}else console.warn("We're unable to find the element "+this.paypalButtonClass+". Please check your integration.");else void 0!==$$(this.paypalButtonClass).first()&&$$(this.paypalButtonClass).first().show(),void 0!==$$("#paypal-complete").first()&&$("paypal-complete").remove()},paypalOnReady:function(e){null!=$("braintree-paypal-button")&&$("braintree-paypal-button").stopObserving("click").on("click",function(e){return this.validateAll()?void 0:(Event.stop(e),!1)}.bind(this))},setLoading:function(){checkout.setLoadWaiting("payment")},resetLoading:function(){checkout.setLoadWaiting(!1)},enableDeviceData:function(){null!==$("device_data")&&$("device_data").removeAttribute("disabled")},disableCreditCardForm:function(){$$("#credit-card-form input, #credit-card-form select").each(function(e){"creditcard-payment-nonce"!=e.id&&"gene_braintree_creditcard_store_in_vault"!=e.id&&e.setAttribute("disabled","disabled")})},enableCreditCardForm:function(){$$("#credit-card-form input, #credit-card-form select").each(function(e){e.removeAttribute("disabled")})},updateBilling:function(){(null!==$("billing-address-select")&&""==$("billing-address-select").value||null===$("billing-address-select"))&&(null!==$("billing:firstname")&&null!==$("billing:lastname")&&this.vzero.setBillingName($("billing:firstname").value+" "+$("billing:lastname").value),null!==$("billing:postcode")&&this.vzero.setBillingPostcode($("billing:postcode").value))},getUpdateDataParams:function(){var e={};return null!==$("billing-address-select")&&""!=$("billing-address-select").value&&(e.addressId=$("billing-address-select").value),e},getPaymentMethod:function(){return payment.currentMethod},shouldInterceptSubmit:function(e){switch(e){case"creditcard":return"gene_braintree_creditcard"==this.getPaymentMethod()&&this.vzero.shouldInterceptCreditCard();break;case"paypal":return"gene_braintree_paypal"==this.getPaymentMethod()&&this.vzero.shouldInterceptCreditCard()}return!1},shouldAddPayPalButton:function(e){return"gene_braintree_paypal"==(e?e:this.getPaymentMethod())&&null===$("paypal-saved-accounts")||"gene_braintree_paypal"==(e?e:this.getPaymentMethod())&&void 0!==$$("#paypal-saved-accounts input:checked[type=radio]").first()&&"other"==$$("#paypal-saved-accounts input:checked[type=radio]").first().value},threeDTokenizationComplete:function(){this.resetLoading()},validateAll:function(){return!0}},function(){for(var e,t=function(){},i=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","markTimeline","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],n=i.length,a=window.console=window.console||{};n--;)e=i[n],a[e]||(a[e]=t)}();
2
+ //# sourceMappingURL=./vzero-0.6-min.js.map
js/gene/braintree/vzero-0.6-min.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["vzero-0.6.js"],"names":["vZero","Class","create","prototype","initialize","code","clientToken","threeDSecure","hostedFields","billingName","billingPostcode","quoteUrl","tokenizeUrl","vaultToNonceUrl","this","_hostedFieldsTokenGenerated","acceptedCards","closeMethod","_hostedFieldsTimeout","_updateDataXhr","_updateDataCallbacks","_updateDataParams","_vaultToNonceXhr","init","client","braintree","api","Client","initHostedFields","integration","$$","length","$","clearTimeout","setTimeout","_hostedIntegration","teardown","setupHostedFieldsClient","bind","e","hostedFieldsConfiguration","id","form","styles","input","font-size","color",":focus",".valid",".invalid","number","selector","placeholder","expirationMonth","expirationYear","onFieldEvent","hostedFieldsOnFieldEvent","onReady","onPaymentMethodReceived","hostedFieldsPaymentMethodReceived","onError","hostedFieldsError","cvv","setup","event","type","card","cardMapping","visa","american-express","master-card","discovery","jcb","maestro","undefined","updateCardType","vaultToNonce","nonce","callback","parameters","getBillingAddress","Ajax","Request","method","onSuccess","transport","responseText","response","eval","success","resetLoading","error","alert","onFailure","setLoading","updateData","verify3dSecureNonce","hostedFieldsNonceReceived","value","setAttribute","afterHostedFieldsNonceReceived","message","indexOf","afterHostedFieldsError","usingSavedCard","first","setThreeDSecure","flag","setAmount","amount","parseFloat","setBillingName","getBillingName","combineElementsValues","setBillingPostcode","getBillingPostcode","setAcceptedCards","cards","billingAddress","tagName","serialize","extractBilling","up","formData","billing","$H","each","data","key","getAcceptedCards","elements","seperator","element","index","join","cardNumber","cardType","getCardType","skinImageUrl","src","substring","lastIndexOf","observeCardType","Element","observe","vzero","oninput","split","match","RegExp","observeAjaxRequests","ignore","Responders","register","onComplete","handleAjaxRequest","url","window","jQuery","document","ajaxComplete","xhr","settings","Array","shouldIgnore","params","push","abort","grandTotal","vzeroPaypal","currencyCode","setPricing","close3dSecureMethod","tokenize3dSavedCards","tokens","getAttribute","Object","toJSON","onUserClose3ds","checkout","setLoadWaiting","options","threeDSecureRequest","creditCard","onUserClose","verify3DS","verify3dSecure","cardholderName","postalCode","verify3dSecureVault","paymentNonce","removeAttribute","processCard","tokenizeRequest","tokenizeCard","errors","i","shouldInterceptCreditCard","shouldInterceptPayPal","process","hasAttribute","creditCardLoaded","paypalLoaded","vZeroPayPalButton","storeFrontName","singleUse","locale","futureSingleUse","_paypalOptions","_paypalIntegration","_rebuildTimer","_rebuildCount","currency","rebuildButton","addPayPalButton","setupConfiguration","container","paymentMethodNonceInputField","displayName","obj","payment","switchMethod","remove","review","save","onUnsupported","closePayPalWindow","vZeroIntegration","paypalMarkUp","paypalButtonClass","isOnepage","config","loaded","console","warn","_methodSwitchTimeout","_hostedFieldsInit","prepareSubmitObserver","preparePaymentMethodSwitchObserver","hostedFieldsGenerated","_hostedFieldsValidationRunning","threeDTokenizationComplete","initSavedPayPal","initDefaultMethod","initSavedMethods","parentElement","targetElement","stopObserving","showHideOtherMethod","show","formElement","hide","checkSavedOther","getPaymentMethod","submitCheckout","submitPayment","shouldAddPayPalButton","updatePayPalButton","rebuildPayPalButton","ignoreAjax","on","beforeSubmit","_beforeSubmit","button","down","click","afterSubmit","submit","successCallback","failedCallback","validateFailedCallback","shouldInterceptSubmit","validateAll","updateBilling","enableDeviceData","disableCreditCardForm","enableDisableNonce","enableCreditCardForm","getUpdateDataParams","defaultPaymentMethodSwitch","vzeroIntegration","paymentSwitchOriginal","Payment","paymentMethodSwitch","apply","arguments","completePayPal","afterPayPalComplete","action","visible","insert","after","buttonParams","paypalOnReady","Event","stop","addressId","currentMethod","noop","methods"],"mappings":"AAOA,GAAIA,OAAQC,MAAMC,QAClBF,OAAMG,WAeFC,WAAY,SAAUC,EAAMC,EAAaC,EAAcC,EAAcC,EAAaC,EAAiBC,EAAUC,EAAaC,GACtHC,KAAKT,KAAOA,EACZS,KAAKR,YAAcA,EACnBQ,KAAKP,aAAeA,EACpBO,KAAKN,aAAeA,EAEhBC,IACAK,KAAKL,YAAcA,GAEnBC,IACAI,KAAKJ,gBAAkBA,GAEvBC,IACAG,KAAKH,SAAWA,GAEhBC,IACAE,KAAKF,YAAcA,GAEpBC,IACCC,KAAKD,gBAAkBA,GAG3BC,KAAKC,6BAA8B,EAEnCD,KAAKE,eAAgB,EAErBF,KAAKG,aAAc,EAGnBH,KAAKI,sBAAuB,EAG5BJ,KAAKK,gBAAiB,EACtBL,KAAKM,wBACLN,KAAKO,qBAELP,KAAKQ,kBAAmB,GAO5BC,KAAM,WACFT,KAAKU,OAAS,GAAIC,WAAUC,IAAIC,QAAQrB,YAAaQ,KAAKR,eAQ9DsB,iBAA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AGjF,OAAO,GAOX2D,sBAAuB,SAAS7K,GAC5B,MAAwD,0BAA9CA,EAASA,EAASrE,KAAK+O,qBAAiF,OAA/B7N,EAAE,0BAAsF,0BAA9CmD,EAASA,EAASrE,KAAK+O,qBAAsHnL,SAAnE5C,GAAG,oDAAoD2E,SAAiG,SAAxE3E,GAAG,oDAAoD2E,QAAQP,OAM1V+I,2BAA4B,WACxBnO,KAAK4E,gBAQTsL,YAAa,WACT,OAAO,IAMd,WAYG,IAXA,GAAI7L,GACAuN,EAAO,aACPC,GACA,SAAU,QAAS,QAAS,QAAS,MAAO,SAAU,QACtD,YAAa,QAAS,iBAAkB,WAAY,OAAQ,MAC5D,eAAgB,UAAW,aAAc,QAAS,OAAQ,UAC1D,YAAa,QAAS,QAEtB5Q,EAAS4Q,EAAQ5Q,OACjB0M,EAAW5E,OAAO4E,QAAU5E,OAAO4E,YAEhC1M,KACHoD,EAASwN,EAAQ5Q,GAGZ0M,EAAQtJ,KACTsJ,EAAQtJ,GAAUuN","file":"vzero-0.6-min.js"}
js/gene/braintree/{vzero-0.5.js → vzero-0.6.js} RENAMED
@@ -1,6 +1,6 @@
1
 
2
  /**
3
- * Magento Braintree functionality wrapped up into a neat class
4
  *
5
  * @class vZero
6
  * @author Dave Macaulay <dave@gene.co.uk>
@@ -56,6 +56,8 @@ vZero.prototype = {
56
  this._updateDataXhr = false;
57
  this._updateDataCallbacks = [];
58
  this._updateDataParams = {};
 
 
59
  },
60
 
61
  /**
@@ -92,12 +94,17 @@ vZero.prototype = {
92
  // Utilise a 50ms timeout to ensure the last call of HF is ran
93
  clearTimeout(this._hostedFieldsTimeout);
94
  this._hostedFieldsTimeout = setTimeout(function() {
95
- if (this._hostedIntegration) {
96
- // If the integration already exists, tear it down and start again
97
- this._hostedIntegration.teardown(function() {
98
- // Setup the hosted fields client
 
 
 
 
 
99
  this.setupHostedFieldsClient();
100
- }.bind(this));
101
  } else {
102
  // Setup the hosted fields client
103
  this.setupHostedFieldsClient();
@@ -282,7 +289,7 @@ vZero.prototype = {
282
  }
283
 
284
  // Verify the nonce through 3Ds
285
- vzero.verify3dSecureNonce(nonce, {
286
  onSuccess: function (response) {
287
  this.hostedFieldsNonceReceived(response.nonce);
288
  }.bind(this),
@@ -336,7 +343,7 @@ vZero.prototype = {
336
 
337
  // Stop any "Cannot place two elements in #xxx" messages being shown to the user
338
  // These are non critical errors and the functionality will still work as expected
339
- if(response.message.indexOf('Cannot place two elements in') == -1) {
340
  // Let the user know what went wrong
341
  alert(response.message);
342
  }
@@ -358,8 +365,8 @@ vZero.prototype = {
358
  */
359
  usingSavedCard: function() {
360
  return ($('creditcard-saved-accounts') != undefined
361
- && $$('#creditcard-saved-accounts input:checked[type=radio]').first() != undefined
362
- && $$('#creditcard-saved-accounts input:checked[type=radio]').first().value !== 'other');
363
  },
364
 
365
 
@@ -617,7 +624,7 @@ vZero.prototype = {
617
  if (window.jQuery) {
618
  jQuery(document).ajaxComplete(function(event, xhr, settings) {
619
  return this.handleAjaxRequest(settings.url, callback, ignore)
620
- });
621
  }
622
 
623
  },
@@ -1113,13 +1120,10 @@ vZero.prototype = {
1113
 
1114
  } else if (this.usingSavedCard()) {
1115
 
1116
- // Update data and process
1117
- this.updateData(function() {
1118
- // No action required as we're using a saved card
1119
- if (options.onSuccess) {
1120
- options.onSuccess()
1121
- }
1122
- });
1123
 
1124
  } else if (this.threeDSecure == true) {
1125
 
@@ -1170,6 +1174,9 @@ vZeroPayPalButton.prototype = {
1170
 
1171
  this._paypalOptions = {};
1172
  this._paypalIntegration = false;
 
 
 
1173
  },
1174
 
1175
  /**
@@ -1196,13 +1203,31 @@ vZeroPayPalButton.prototype = {
1196
  */
1197
  rebuildButton: function() {
1198
 
 
1199
  if (this._paypalIntegration !== false) {
1200
- this._paypalIntegration.teardown(function() {
1201
-
1202
- // Re-add the button with the same options
1203
- this.addPayPalButton(this._paypalOptions);
1204
-
1205
- }.bind(this));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1206
  }
1207
  },
1208
 
@@ -1270,6 +1295,10 @@ vZeroPayPalButton.prototype = {
1270
 
1271
  setupConfiguration.singleUse = true;
1272
 
 
 
 
 
1273
  }
1274
 
1275
  // Start a new version of the client and assign for later modifications
@@ -1306,8 +1335,9 @@ vZeroIntegration.prototype = {
1306
  * @param paypalButtonClass The class of the button we need to replace with the above mark up
1307
  * @param isOnepage Is the integration a onepage checkout?
1308
  * @param config Any further config the integration wants to push into the class
 
1309
  */
1310
- initialize: function(vzero, vzeroPaypal, paypalMarkUp, paypalButtonClass, isOnepage, config) {
1311
 
1312
  // Only allow the system to be initialized twice
1313
  if (vZeroIntegration.prototype.loaded) {
@@ -1337,9 +1367,14 @@ vZeroIntegration.prototype = {
1337
  // Hosted fields hasn't been initialized yet
1338
  this._hostedFieldsInit = false;
1339
 
1340
- // Call the function which is going to intercept the submit event
1341
- this.prepareSubmitObserver();
1342
- this.preparePaymentMethodSwitchObserver();
 
 
 
 
 
1343
 
1344
  // Has the hosted fields method been generated successfully?
1345
  this.hostedFieldsGenerated = false;
@@ -1376,6 +1411,7 @@ vZeroIntegration.prototype = {
1376
  // Saved methods need events to!
1377
  this.initSavedMethods();
1378
  }.bind(this));
 
1379
  },
1380
 
1381
  /**
@@ -1549,6 +1585,7 @@ vZeroIntegration.prototype = {
1549
  // The Ajax request might kill our events
1550
  if (this.isOnepage) {
1551
  this.initSavedPayPal();
 
1552
  this.checkSavedOther();
1553
 
1554
  // If hosted fields is enabled init the environment
@@ -1564,6 +1601,18 @@ vZeroIntegration.prototype = {
1564
  }.bind(this), (typeof this.config.ignoreAjax !== 'undefined' ? this.config.ignoreAjax : false))
1565
  },
1566
 
 
 
 
 
 
 
 
 
 
 
 
 
1567
  /**
1568
  * Handle saved PayPals being present on the page
1569
  */
@@ -1926,18 +1975,22 @@ vZeroIntegration.prototype = {
1926
  */
1927
  paypalOnReady: function(integration) {
1928
 
1929
- // Always stop the window from opening
1930
- $('braintree-paypal-button').stopObserving('click').on('click', function (event) {
1931
 
1932
- // Validate the form before we open the PayPal modal window
1933
- if (!this.validateAll()) {
1934
 
1935
- // If the form fails to validate kill the event
1936
- Event.stop(event);
1937
- return false;
1938
- }
1939
 
1940
- }.bind(this));
 
 
 
 
 
 
 
1941
 
1942
  },
1943
 
@@ -2071,4 +2124,27 @@ vZeroIntegration.prototype = {
2071
  return true;
2072
  }
2073
 
2074
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
 
2
  /**
3
+ * Magento Braintree class to bridge the v.zero JS SDK and Magento
4
  *
5
  * @class vZero
6
  * @author Dave Macaulay <dave@gene.co.uk>
56
  this._updateDataXhr = false;
57
  this._updateDataCallbacks = [];
58
  this._updateDataParams = {};
59
+
60
+ this._vaultToNonceXhr = false;
61
  },
62
 
63
  /**
94
  // Utilise a 50ms timeout to ensure the last call of HF is ran
95
  clearTimeout(this._hostedFieldsTimeout);
96
  this._hostedFieldsTimeout = setTimeout(function() {
97
+
98
+ if (this._hostedIntegration !== false) {
99
+ try {
100
+ this._hostedIntegration.teardown(function () {
101
+ this._hostedIntegration = false;
102
+ // Setup the hosted fields client
103
+ this.setupHostedFieldsClient();
104
+ }.bind(this));
105
+ } catch (e) {
106
  this.setupHostedFieldsClient();
107
+ }
108
  } else {
109
  // Setup the hosted fields client
110
  this.setupHostedFieldsClient();
289
  }
290
 
291
  // Verify the nonce through 3Ds
292
+ this.verify3dSecureNonce(nonce, {
293
  onSuccess: function (response) {
294
  this.hostedFieldsNonceReceived(response.nonce);
295
  }.bind(this),
343
 
344
  // Stop any "Cannot place two elements in #xxx" messages being shown to the user
345
  // These are non critical errors and the functionality will still work as expected
346
+ if(typeof response.message !== 'undefined' && response.message.indexOf('Cannot place two elements in') == -1) {
347
  // Let the user know what went wrong
348
  alert(response.message);
349
  }
365
  */
366
  usingSavedCard: function() {
367
  return ($('creditcard-saved-accounts') != undefined
368
+ && $$('#creditcard-saved-accounts input:checked[type=radio]').first() != undefined
369
+ && $$('#creditcard-saved-accounts input:checked[type=radio]').first().value !== 'other');
370
  },
371
 
372
 
624
  if (window.jQuery) {
625
  jQuery(document).ajaxComplete(function(event, xhr, settings) {
626
  return this.handleAjaxRequest(settings.url, callback, ignore)
627
+ }.bind(this));
628
  }
629
 
630
  },
1120
 
1121
  } else if (this.usingSavedCard()) {
1122
 
1123
+ // No action required as we're using a saved card
1124
+ if (options.onSuccess) {
1125
+ options.onSuccess()
1126
+ }
 
 
 
1127
 
1128
  } else if (this.threeDSecure == true) {
1129
 
1174
 
1175
  this._paypalOptions = {};
1176
  this._paypalIntegration = false;
1177
+
1178
+ this._rebuildTimer = false;
1179
+ this._rebuildCount = 0;
1180
  },
1181
 
1182
  /**
1203
  */
1204
  rebuildButton: function() {
1205
 
1206
+ clearTimeout(this._rebuildTimer);
1207
  if (this._paypalIntegration !== false) {
1208
+ try {
1209
+ // Wait 100ms to rebuild the button
1210
+ this._paypalIntegration.teardown(function () {
1211
+ this._paypalIntegration = false;
1212
+ // Re-add the button with the same options
1213
+ this.addPayPalButton(this._paypalOptions);
1214
+ }.bind(this));
1215
+ } catch (e) {
1216
+ // This error means the integration has already been torn down
1217
+ if(e.message == 'Cannot teardown integration more than once') {
1218
+ this._paypalIntegration = false;
1219
+ this.addPayPalButton(this._paypalOptions);
1220
+ } else if(this._rebuildCount >= 10) {
1221
+ // Infinite loops are bad kids
1222
+ return false;
1223
+ } else {
1224
+ // Check to see if the teardown function will work once the integration is built fully
1225
+ this._rebuildTimer = setTimeout(function () {
1226
+ ++this._rebuildCount;
1227
+ this.rebuildButton();
1228
+ }.bind(this), 200);
1229
+ }
1230
+ }
1231
  }
1232
  },
1233
 
1295
 
1296
  setupConfiguration.singleUse = true;
1297
 
1298
+ } else {
1299
+
1300
+ setupConfiguration.singleUse = false;
1301
+
1302
  }
1303
 
1304
  // Start a new version of the client and assign for later modifications
1335
  * @param paypalButtonClass The class of the button we need to replace with the above mark up
1336
  * @param isOnepage Is the integration a onepage checkout?
1337
  * @param config Any further config the integration wants to push into the class
1338
+ * @param onReady function fired after integration is "ready"
1339
  */
1340
+ initialize: function(vzero, vzeroPaypal, paypalMarkUp, paypalButtonClass, isOnepage, config, onReady) {
1341
 
1342
  // Only allow the system to be initialized twice
1343
  if (vZeroIntegration.prototype.loaded) {
1367
  // Hosted fields hasn't been initialized yet
1368
  this._hostedFieldsInit = false;
1369
 
1370
+ // Wait for the DOM to finish loading before creating observers
1371
+ document.observe("dom:loaded", function () {
1372
+
1373
+ // Call the function which is going to intercept the submit event
1374
+ this.prepareSubmitObserver();
1375
+ this.preparePaymentMethodSwitchObserver();
1376
+
1377
+ }.bind(this));
1378
 
1379
  // Has the hosted fields method been generated successfully?
1380
  this.hostedFieldsGenerated = false;
1411
  // Saved methods need events to!
1412
  this.initSavedMethods();
1413
  }.bind(this));
1414
+
1415
  },
1416
 
1417
  /**
1585
  // The Ajax request might kill our events
1586
  if (this.isOnepage) {
1587
  this.initSavedPayPal();
1588
+ this.rebuildPayPalButton();
1589
  this.checkSavedOther();
1590
 
1591
  // If hosted fields is enabled init the environment
1601
  }.bind(this), (typeof this.config.ignoreAjax !== 'undefined' ? this.config.ignoreAjax : false))
1602
  },
1603
 
1604
+ /**
1605
+ * Rebuild the PayPal button if it's been removed
1606
+ */
1607
+ rebuildPayPalButton: function() {
1608
+
1609
+ // Check to see if the DOM element has been removed?
1610
+ if ($('paypal-container') == null) {
1611
+ this.updatePayPalButton();
1612
+ }
1613
+
1614
+ },
1615
+
1616
  /**
1617
  * Handle saved PayPals being present on the page
1618
  */
1975
  */
1976
  paypalOnReady: function(integration) {
1977
 
1978
+ if($('braintree-paypal-button') != null) {
 
1979
 
1980
+ // Always stop the window from opening
1981
+ $('braintree-paypal-button').stopObserving('click').on('click', function (event) {
1982
 
1983
+ // Validate the form before we open the PayPal modal window
1984
+ if (!this.validateAll()) {
 
 
1985
 
1986
+ // If the form fails to validate kill the event
1987
+ Event.stop(event);
1988
+ return false;
1989
+ }
1990
+
1991
+ }.bind(this));
1992
+
1993
+ }
1994
 
1995
  },
1996
 
2124
  return true;
2125
  }
2126
 
2127
+ };
2128
+
2129
+ // Avoid 'console' errors in browsers that lack a console.
2130
+ (function() {
2131
+ var method;
2132
+ var noop = function () {};
2133
+ var methods = [
2134
+ 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
2135
+ 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
2136
+ 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
2137
+ 'timeStamp', 'trace', 'warn'
2138
+ ];
2139
+ var length = methods.length;
2140
+ var console = (window.console = window.console || {});
2141
+
2142
+ while (length--) {
2143
+ method = methods[length];
2144
+
2145
+ // Only stub undefined methods.
2146
+ if (!console[method]) {
2147
+ console[method] = noop;
2148
+ }
2149
+ }
2150
+ }());
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Gene_Braintree</name>
4
- <version>1.0.5</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/mit-license.php">MIT License</license>
7
  <channel>community</channel>
@@ -36,9 +36,9 @@ Easily add PayPal to your checkout. We've built the best PayPal integration arou
36
  &lt;/ul&gt;</description>
37
  <notes>Connect your Magento store to Braintree to accept Credit Cards &amp;amp; PayPal using V.Zero SDK</notes>
38
  <authors><author><name>Dave Macaulay</name><user>dave</user><email>magento@gene.co.uk</email></author></authors>
39
- <date>2015-10-14</date>
40
- <time>09:42:09</time>
41
- <contents><target name="magecommunity"><dir name="Gene"><dir name="Braintree"><dir name="Block"><dir name="Adminhtml"><dir name="Report"><dir name="Transactions"><file name="Grid.php" hash="32b32086548f62ae4aca4baf456b9ed2"/><file name="Search.php" hash="81d57c3744530f36c37782ce9d0f3a70"/></dir><file name="Transactions.php" hash="7afe45b49353e52b432aa0392d76a08e"/></dir><dir name="System"><dir name="Config"><dir name="Braintree"><file name="Config.php" hash="eaaf6c74be4233a315d5aa5932f7c9ca"/><file name="Currency.php" hash="9ffa8a2ded53be75e88a60a024883b07"/><file name="Moduleversion.php" hash="fe3836bde24bb31c4c4585f2cd2f20ed"/><file name="Version.php" hash="ce58278a4faf965301cc2d8b2da4483c"/></dir></dir></dir></dir><dir name="Cart"><file name="Totals.php" hash="a03c441e8143896f92d02931a809f666"/></dir><dir name="Creditcard"><file name="Info.php" hash="6faf4be87ad62f13373a6b2e852a478b"/><file name="Threedsecure.php" hash="7848d4ecac743be985f328fa969318bf"/></dir><file name="Creditcard.php" hash="3d9dd20d9617a891084950f9a8aa1309"/><file name="Info.php" hash="4d9513f53e20bf7752c1f826bbd63b0e"/><file name="Js.php" hash="eb24c9f10bac596fbbe06fc399ed50f2"/><dir name="Paypal"><file name="Info.php" hash="0874c0839a27c14ec9be47fed152e880"/></dir><file name="Paypal.php" hash="36294a461378cceee66e99d45753c6e1"/><file name="Saved.php" hash="213d66f1dc05052fc389ff353fc4ed2c"/></dir><dir name="Helper"><file name="Data.php" hash="7ab1dba0f90dc067f0293e3f34bdf387"/></dir><dir name="Model"><file name="Debug.php" hash="f3360f71e2346881f93424792ed9f209"/><file name="Observer.php" hash="adfd3115aa000d73e63f888052b403e6"/><dir name="Paymentmethod"><file name="Abstract.php" hash="237976cd80eaaf4dc86051b525af2dbc"/><file name="Creditcard.php" hash="a582f52c8a721ce84bd5731290c61543"/><file name="Paypal.php" hash="54d4c11ac4527f3af97f9a07a9612a64"/></dir><file name="Saved.php" hash="3b235b454a3692d1c3d5343e2a1c91e9"/><dir name="Source"><file name="Cctype.php" hash="d76aa6c3a4bd798e3a47695f579d21d4"/><dir name="Creditcard"><file name="CaptureAction.php" hash="6444cfc430de44f06e85bd9c8b80d77b"/><file name="FormIntegration.php" hash="4f137002a98c8f1f352b02abc4506b3b"/><file name="PaymentAction.php" hash="a2f3f3d36a98df4d12f76b6ab77f9c47"/></dir><file name="Environment.php" hash="02567d2ddba74d06ac000b4ddb12723a"/><dir name="Paypal"><file name="Locale.php" hash="8988ca77f9c2aa2d19ff0b614a4b7621"/><file name="Paymenttype.php" hash="fe1fe4ee89d5b7a87c7c28716bb2f1cb"/></dir></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Currency.php" hash="73cb15b1de303e88c487db4c585ef94e"/></dir></dir></dir><dir name="Wrapper"><file name="Braintree.php" hash="4230f248d167abadb574e6c42a3aef6a"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="BraintreeController.php" hash="7c621fa1548c04e24bb1136bcbbe1d72"/></dir><file name="CheckoutController.php" hash="35475823fe0afdf7f62651a5bb3af58c"/><file name="SavedController.php" hash="036e97703c853a5bae064dd7cf5030a8"/></dir><dir name="etc"><file name="adminhtml.xml" hash="c9c940beffa0ec19e4a1499a66f7fd12"/><file name="config.xml" hash="1f1a2d10efb872bed6878de1f0db3815"/><file name="system.xml" hash="9aa9be1ba351343fe90920b4233bd1c2"/></dir><dir name="sql"><dir name="gene_braintree_setup"><file name="install-0.1.0.php" hash="7ef62b7c19b9da5990974da6edb3e77c"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="gene"><file name="braintree.xml" hash="bfd8ca8a7a6f2c9f21946fde160d4c07"/></dir></dir><dir name="template"><dir name="gene"><dir name="braintree"><dir name="creditcard"><file name="hostedfields.phtml" hash="10757415338b805700d36b25296c90c5"/><file name="info.phtml" hash="2ae1e397b3a633dd305bc26c7b9c1065"/><file name="threedsecure.phtml" hash="ee8ad689afde041c39dd92ffa5274883"/></dir><file name="creditcard.phtml" hash="e019b6da4d3c50fbc570d446b18962c5"/><dir name="customer"><file name="methods.phtml" hash="eb5e2d8f4a0f419fcf720c12062f808a"/><file name="saved.phtml" hash="691162b89ed085599f76072226ca2307"/></dir><dir name="js"><file name="aheadworks.phtml" hash="c024bdbf79bfb5dda71ad6acbbcb58d1"/><file name="amasty.phtml" hash="905800a115f06a681a1d31cb0696b2d7"/><file name="data.phtml" hash="2d575380d05455c6eae90d3644b525dc"/><file name="default.phtml" hash="d2375da07bf8f1d50f5b38ba8fab70aa"/><file name="firecheckout.phtml" hash="6295ce2e602c91dc5fbe14e849e7791f"/><file name="idev.phtml" hash="87c9c2014e12d25cb50b00a614615c8f"/><file name="iwd.phtml" hash="30ee8f1351f091278ad16482140d472c"/><file name="magestore.phtml" hash="9d15ccd68804eb72a5db280793922668"/><file name="setup.phtml" hash="f39b3e066b1c1eef36834d41b59174f7"/><file name="unicode.phtml" hash="caeae3b5031ee8539185f78fd4554765"/></dir><dir name="paypal"><file name="info.phtml" hash="5149b273730121e4dec3c3179820f747"/></dir><file name="paypal.phtml" hash="c81c90096517a5a844306345b3c648ca"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="gene"><file name="braintree.xml" hash="67a55c4c984286607f15dd66406b2c5b"/></dir></dir><dir name="template"><dir name="gene"><dir name="braintree"><dir name="creditcard"><file name="hostedfields.phtml" hash="3e835a116317449620a90964d2b34b5e"/><file name="info.phtml" hash="24c67bab482ea7383ce57d9a06bb9d6f"/></dir><file name="creditcard.phtml" hash="e95b7ff1b2db6ed33190b879ad547a45"/><file name="js.phtml" hash="4f547da52ab1888485cea4f376aa9d5a"/><dir name="paypal"><file name="info.phtml" hash="a8f92f312f8aa5a9463f1d5c2a38cd1b"/></dir><dir name="transactions"><file name="index.phtml" hash="1791b6393f319616dd79c0b46e391847"/><file name="search.phtml" hash="1682ce6200681681f0ce3c848e2e6694"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Gene_Braintree.xml" hash="8c0ffda8566dca2f0b98a999921e3e55"/></dir></target><target name="mageweb"><dir name="js"><dir name="gene"><dir name="braintree"><file name="braintree-0.1.js" hash="a72cc4545d0d01dd0947dae1474516dd"/><file name="config.codekit" hash="34c2ad713dd097a9fee41f979b28183c"/><file name="vzero-0.5.js" hash="bb743fd9480ed4b3f6df783b4e872452"/><file name="vzero-0.5.min.js" hash="3824911eb9b06d8303dfcaed5cf210c8"/></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="gene"><dir name="braintree"><file name="AE.png" hash="6b6f405105413b0723a62ee498f88bf6"/><file name="DI.png" hash="d8e3c3022dda9e723f466b8976ae428f"/><file name="JCB.png" hash="3aa9a71ed8a1d6610bbe0dfe2040e29e"/><file name="MC.png" hash="1fcd14928245139962b72f9368bdbe32"/><file name="ME.png" hash="b9389913c47b9546a67f907fcca73706"/><file name="PP.png" hash="b4946bccba574e86c9716a4986e21c36"/><file name="VI.png" hash="c9f74d1d54e61ab2c748f45a4bdface0"/><file name="card.png" hash="66e16f8c573fad93bb0d62258dce28bb"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir></dir></dir><dir name="css"><dir name="gene"><dir name="braintree"><file name="aheadworks.css" hash="6a9d989e354e4069c1a93301460e4151"/><file name="amasty.css" hash="4c7d73736d10dd1d6be077c091e6511d"/><file name="default.css" hash="17035148ee7da331e11f321f8962536b"/><file name="firecheckout.css" hash="9cd93a2534ca4dc6d049c4146bee4f25"/><file name="idev.css" hash="542423bbb2c61c09331717808cd8c841"/><file name="iwd.css" hash="3774db6ec06341de440a5c73b04ca488"/><file name="magestore.css" hash="47bc1ec7b9bd6ac0cf44f0711bf950a9"/><file name="unicode.css" hash="582421c71dbcd123916cb35c4c0d2618"/></dir></dir></dir></dir></dir></dir></target><target name="magelib"><dir name="Braintree"><file name="AddOn.php" hash="e8bbb6db343ba99192346b1dcbf45677"/><file name="AddOnGateway.php" hash="d8698ffe89c01fba78a8a06a2fc68122"/><file name="Address.php" hash="004d3d36d39fc6fcc3d510f4b15b1fca"/><file name="AddressGateway.php" hash="41b5a3be7bdb2fe326a49a1554e1b0c3"/><file name="AndroidPayCard.php" hash="7a1de1da0aa0733277a87b75307bb201"/><file name="ApplePayCard.php" hash="06eea10b110792c18d692e482445ffe4"/><file name="Base.php" hash="60d52fd1bef5655bcb607fba45bb4c1c"/><file name="ClientToken.php" hash="358c0a1dba687baf635db818cb7d1dac"/><file name="ClientTokenGateway.php" hash="6f2259a51415a779a072719288811c16"/><file name="CoinbaseAccount.php" hash="ee5cb6963f675a9a71293c453b128866"/><file name="Collection.php" hash="0e7d31ffcbd9780fb554186bd2c194b0"/><file name="Configuration.php" hash="cce5e6b7e215c73767127d3d8441cc8f"/><file name="CredentialsParser.php" hash="c4bb2248a33129d8523a6120ce44108b"/><file name="CreditCard.php" hash="d32b8d8e64b2d046d3d9e4f00c67f1ed"/><file name="CreditCardGateway.php" hash="0d120ed06f06fd614468d6e3f0ad22d2"/><file name="CreditCardVerification.php" hash="48d6ea546914278f4bea2fefb75e7836"/><file name="CreditCardVerificationGateway.php" hash="6a07430c9437f6e6c1516d5b4572a749"/><file name="CreditCardVerificationSearch.php" hash="18efe7d508c2bd5fea1c0e68fc26182f"/><file name="Customer.php" hash="62d0937de86f7a14a512ad66edba7569"/><file name="CustomerGateway.php" hash="1232a22dd6de6ad1446c6fbb9b0f79c3"/><file name="CustomerSearch.php" hash="8aacc83dac341cd9afec5a3deab17593"/><file name="Descriptor.php" hash="3f5db5e817280ce7f2fa18a205281ad9"/><file name="Digest.php" hash="9d12d067770f55b123b8498fce4478fa"/><file name="Disbursement.php" hash="ad122f0f33b27dfd98bcdd38ea138ae4"/><file name="DisbursementDetails.php" hash="ae632207d0982e288a83aed401c880d9"/><file name="Discount.php" hash="763b3f9cde0ff3af3e8795cac4097595"/><file name="DiscountGateway.php" hash="47796edb8ac2fa68e9af8fb8a13aacb1"/><dir name="Dispute"><file name="TransactionDetails.php" hash="7fdea673a1295055508f42286ad57f4e"/></dir><file name="Dispute.php" hash="c3a4e93fa2b3b0e20ddcb593dcdc7b2b"/><file name="EqualityNode.php" hash="cfd6aa184186233b8d6d1ec0f0e79298"/><dir name="Error"><file name="Codes.php" hash="a7f98ff690e725b7fcd198b4b22d0637"/><file name="ErrorCollection.php" hash="e28d638db56524f5bf3609fa725e6d55"/><file name="Validation.php" hash="bf4e2198300019c52ba56f16269d66ce"/><file name="ValidationErrorCollection.php" hash="9ef25d0126a0b4f6951da5334ae6f0dc"/></dir><dir name="Exception"><file name="Authentication.php" hash="f9e13654988452cca2ac5228a80adae4"/><file name="Authorization.php" hash="5f8c017c6e9fd79a556dade8e15a72e8"/><file name="Configuration.php" hash="b50f67e8ea36cff0d9f6ad718126c6fc"/><file name="DownForMaintenance.php" hash="7fd30b1f8976ed7e38b7e9fae5c20f03"/><file name="ForgedQueryString.php" hash="6884dbae1e86767834b77c821df2db62"/><file name="InvalidChallenge.php" hash="1c283a1c9dac65feb137594d0dcf0e35"/><file name="InvalidSignature.php" hash="b83f5b16735cb3a8e0a8111c4f32711e"/><file name="NotFound.php" hash="f832f771d20b381c2780eb2a572b9f44"/><file name="SSLCaFileNotFound.php" hash="e927c7307bf1761814dc8a755238070d"/><file name="SSLCertificate.php" hash="d509b6a6206bd7c5563ac142dfe3801f"/><file name="ServerError.php" hash="b4645290229ab228a257047d08ef63d7"/><file name="Unexpected.php" hash="01ea2800fb91995ec2a15aee5024611e"/><file name="UpgradeRequired.php" hash="7f40b174df891cc3b3e206d1be884a58"/><file name="ValidationsFailed.php" hash="cd2d30c69911f81b55279c3d6bf88c61"/></dir><file name="Exception.php" hash="f14c94bf67206184eb3e4e7aeb4a608a"/><file name="Gateway.php" hash="103156f5646a8193ed548405f5ac476f"/><file name="Http.php" hash="1baa32e0efcae13c4d6294d1233512a1"/><file name="Instance.php" hash="f0603b3f9213b53687e079c5621ac8f3"/><file name="IsNode.php" hash="e4b1f7bbfcbd24b1d08b97f94df592be"/><file name="KeyValueNode.php" hash="255595ec01a16906dd0c49faf67d9efb"/><file name="Merchant.php" hash="5053ebe889c854d11f2686bffdeb58be"/><dir name="MerchantAccount"><file name="AddressDetails.php" hash="1d265d864a884ebcf2504f55207cc0dd"/><file name="BusinessDetails.php" hash="3e80148bac9fda676844aa19d5b2dc28"/><file name="FundingDetails.php" hash="7368f653fcbcc3d87924447b1763e616"/><file name="IndividualDetails.php" hash="777b6f28f643e78616c7ed753a39c0cd"/></dir><file name="MerchantAccount.php" hash="496c93182d824bb2967cc9366dec1ac3"/><file name="MerchantAccountGateway.php" hash="e2073aff6f8b3c5f2e64b23b210c44f7"/><file name="MerchantGateway.php" hash="e0a2e3a28c68dac8bd082973b269ed1b"/><file name="Modification.php" hash="0abe992d4f821327f617ca883c4eb2d1"/><file name="MultipleValueNode.php" hash="92700fa03011eaa9561010b3a160449c"/><file name="MultipleValueOrTextNode.php" hash="ef06bac18e2bc40974bdc0bcb854890f"/><file name="OAuthCredentials.php" hash="e992dca9dfedb27e3d050af55971a968"/><file name="OAuthGateway.php" hash="e2e238d067f43c0f28fcb25c2de4a274"/><file name="PartialMatchNode.php" hash="370c7e0ab8a445cfeef6b19ef1755f4d"/><file name="PartnerMerchant.php" hash="bdb69ebdc75d67009710be9703a47e80"/><file name="PayPalAccount.php" hash="672a7d424f94e590c5e66a21e62d7bc2"/><file name="PayPalAccountGateway.php" hash="d73f5744ebaca6cc882c42d0e9c1a05e"/><file name="PaymentInstrumentType.php" hash="be97a30c7d8fbbb180864dc4efea71f2"/><file name="PaymentMethod.php" hash="5bc31d3e97610e7218c95aba2422cc9a"/><file name="PaymentMethodGateway.php" hash="1ce13a8b1ec93cf32b8029c55ea26fa2"/><file name="PaymentMethodNonce.php" hash="e99302e2468f55c8fb4b2ceeb1bce68e"/><file name="PaymentMethodNonceGateway.php" hash="22a0d89eee071a28b530c6be477dcc6e"/><file name="Plan.php" hash="22ab0117d462352aecb9531d4a26619e"/><file name="PlanGateway.php" hash="95e093b55ad20f8b652ee5f2fc2a0fcf"/><file name="RangeNode.php" hash="4ad9a92547423b3d54d69097114c3daf"/><file name="ResourceCollection.php" hash="8f437cb5014148c0e2f6049347ae795c"/><dir name="Result"><file name="CreditCardVerification.php" hash="7c41787025ec7cffb269f53e3ce479e2"/><file name="Error.php" hash="0e0460f1eea017bc7591e05351f51eb0"/><file name="Successful.php" hash="03f1c379fcedaef499296ab7778d1e36"/></dir><file name="RiskData.php" hash="8bef1074f9f1c50c841a7c7cf627c9cf"/><file name="SettlementBatchSummary.php" hash="388d88e8cea7bec61ee78f388fb78c2c"/><file name="SettlementBatchSummaryGateway.php" hash="bc54658b75fa0505e072331799c2d9ad"/><file name="SignatureService.php" hash="4b78d3e5897e715dcc877c5f65b3cfae"/><dir name="Subscription"><file name="StatusDetails.php" hash="29e375f02150bfd7147591f0eb27cb4f"/></dir><file name="Subscription.php" hash="cde05aa61192d5b930b57330db308835"/><file name="SubscriptionGateway.php" hash="bd1b2aa2d4d41a595463bead64ed34e0"/><file name="SubscriptionSearch.php" hash="1874ebe5cb42d7d2836617810cced1af"/><dir name="Test"><file name="CreditCardNumbers.php" hash="676a9100354eb679e7ca1e0f0d67293f"/><file name="MerchantAccount.php" hash="612e7e30cca364c0d14cbff3b54ebf3f"/><file name="Nonces.php" hash="230dc3687abaf95e9f516573b1836f4a"/><file name="TransactionAmounts.php" hash="ed9bf1f57d871542c32d11de9e031f05"/><file name="VenmoSdk.php" hash="6ce94deccd1f968596011487c7e69cc7"/></dir><file name="TextNode.php" hash="94c95ec9645de57acace2179fef7fb43"/><file name="ThreeDSecureInfo.php" hash="542550c4e03a24551d00e8aad5493035"/><dir name="Transaction"><file name="AddressDetails.php" hash="ff52a4a48248085b7ea92e992160e413"/><file name="AndroidPayCardDetails.php" hash="4dab3acc0cc35b5a6f12f95004074374"/><file name="ApplePayCardDetails.php" hash="c4dd87cd46fe7269e1bd51c867adf7cb"/><file name="CoinbaseDetails.php" hash="d19a625f8de98698b8277c25660358f0"/><file name="CreditCardDetails.php" hash="aac5eb1f5804d4f979b9c71f7b98cb36"/><file name="CustomerDetails.php" hash="e137895c646127312be44292c84a2d81"/><file name="PayPalDetails.php" hash="ede299e376bce7714838d79ca3d40842"/><file name="StatusDetails.php" hash="7c6e719c51bf13bdfd07615030100ac6"/><file name="SubscriptionDetails.php" hash="1cf1f511d1545a2e27b8d3f4bee800ca"/></dir><file name="Transaction.php" hash="09b9e7a574d304e9edebe578173f2994"/><file name="TransactionGateway.php" hash="4282d7497100c26afcd709fd77eae0bd"/><file name="TransactionSearch.php" hash="3101c79514520a1a500e4623f4ca1c32"/><file name="TransparentRedirect.php" hash="154c9850be5175a5cd1b35bdf78ae939"/><file name="TransparentRedirectGateway.php" hash="5ead181bf0d5484db5eb305efa13bec4"/><file name="UnknownPaymentMethod.php" hash="9107498774ab5bc2b25de98838736b47"/><file name="Util.php" hash="9832a44da18b97a55248cadc4bb9a4ad"/><file name="Version.php" hash="2f088b43efe46edb3262b89b7d40d051"/><file name="WebhookNotification.php" hash="4097fb57d46368d903c42bb20fbd49ca"/><file name="WebhookTesting.php" hash="c40311458bb64e37b4c08eb88df37805"/><dir name="Xml"><file name="Generator.php" hash="19f9c9b9b61d4f97f65775f527ac408d"/><file name="Parser.php" hash="c06b1ae155ac7687eaa856fac472656d"/></dir><file name="Xml.php" hash="dc69e05bea21e3d1185d45d53e4747db"/></dir><dir name="."><file name="Braintree.php" hash="424b8ccb072fda0ddf3459be6279734a"/></dir><dir name="ssl"><file name="api_braintreegateway_com.ca.crt" hash="04beb23c767547e980c76eb68c7eab15"/><file name="sandbox_braintreegateway_com.ca.crt" hash="f1b529883c7c2cbb4251658f5da7b4c9"/></dir></target><target name="magelocale"><dir><dir name="en_US"><file name="Gene_Braintree.csv" hash="00ae6dc359bc0d9c48bfc90a865232a3"/></dir></dir></target></contents>
42
  <compatible/>
43
  <dependencies><required><php><min>5.2.1</min><max>6.0.0</max></php><package><name/><channel>connect.magentocommerce.com/core</channel><min/><max/></package></required></dependencies>
44
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Gene_Braintree</name>
4
+ <version>1.0.5.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/mit-license.php">MIT License</license>
7
  <channel>community</channel>
36
  &lt;/ul&gt;</description>
37
  <notes>Connect your Magento store to Braintree to accept Credit Cards &amp;amp; PayPal using V.Zero SDK</notes>
38
  <authors><author><name>Dave Macaulay</name><user>dave</user><email>magento@gene.co.uk</email></author></authors>
39
+ <date>2015-11-02</date>
40
+ <time>09:19:12</time>
41
+ <contents><target name="magecommunity"><dir name="Gene"><dir name="Braintree"><dir name="Block"><dir name="Adminhtml"><dir name="Report"><dir name="Transactions"><file name="Grid.php" hash="32b32086548f62ae4aca4baf456b9ed2"/><file name="Search.php" hash="81d57c3744530f36c37782ce9d0f3a70"/></dir><file name="Transactions.php" hash="7afe45b49353e52b432aa0392d76a08e"/></dir><dir name="System"><dir name="Config"><dir name="Braintree"><file name="Config.php" hash="eaaf6c74be4233a315d5aa5932f7c9ca"/><file name="Currency.php" hash="9ffa8a2ded53be75e88a60a024883b07"/><file name="Moduleversion.php" hash="fe3836bde24bb31c4c4585f2cd2f20ed"/><file name="Version.php" hash="ce58278a4faf965301cc2d8b2da4483c"/></dir></dir></dir></dir><dir name="Cart"><file name="Totals.php" hash="a03c441e8143896f92d02931a809f666"/></dir><dir name="Creditcard"><file name="Info.php" hash="6faf4be87ad62f13373a6b2e852a478b"/><file name="Threedsecure.php" hash="7848d4ecac743be985f328fa969318bf"/></dir><file name="Creditcard.php" hash="3d9dd20d9617a891084950f9a8aa1309"/><file name="Info.php" hash="4d9513f53e20bf7752c1f826bbd63b0e"/><file name="Js.php" hash="cef4a5a297b95969b882d42c04773a69"/><dir name="Paypal"><file name="Info.php" hash="0874c0839a27c14ec9be47fed152e880"/></dir><file name="Paypal.php" hash="b507a5f3340e3cc06ffba03d07ff87cd"/><file name="Saved.php" hash="213d66f1dc05052fc389ff353fc4ed2c"/></dir><dir name="Helper"><file name="Data.php" hash="4dfe4c3a7f186640c77b79cedf273f76"/></dir><dir name="Model"><file name="Debug.php" hash="f3360f71e2346881f93424792ed9f209"/><file name="Observer.php" hash="b2486212947330ce2e5c8d84f725a90c"/><dir name="Paymentmethod"><file name="Abstract.php" hash="0bd5c8409d4dad2c24368891af67b7a3"/><file name="Creditcard.php" hash="e4d1a181c9dabf64d76595e9c186a5de"/><file name="Paypal.php" hash="b23e53d2312d27332b0b10d97a247c2a"/></dir><file name="Saved.php" hash="b0ed5312b1e5efa93eb4bfc82bef8892"/><dir name="Source"><file name="Cctype.php" hash="d76aa6c3a4bd798e3a47695f579d21d4"/><dir name="Creditcard"><file name="CaptureAction.php" hash="6444cfc430de44f06e85bd9c8b80d77b"/><file name="FormIntegration.php" hash="4f137002a98c8f1f352b02abc4506b3b"/><file name="PaymentAction.php" hash="a2f3f3d36a98df4d12f76b6ab77f9c47"/></dir><file name="Environment.php" hash="02567d2ddba74d06ac000b4ddb12723a"/><dir name="Paypal"><file name="Locale.php" hash="8988ca77f9c2aa2d19ff0b614a4b7621"/><file name="Paymenttype.php" hash="fe1fe4ee89d5b7a87c7c28716bb2f1cb"/></dir></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Currency.php" hash="73cb15b1de303e88c487db4c585ef94e"/></dir></dir></dir><dir name="Wrapper"><file name="Braintree.php" hash="1f723e134bee735228dd517a2b096d93"/></dir><file name=".DS_Store" hash="cc4c7586697ffb0a3228c23a17787dc8"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="BraintreeController.php" hash="7c621fa1548c04e24bb1136bcbbe1d72"/></dir><file name="CheckoutController.php" hash="02a35bc3ccacba6ba820842508835569"/><file name="SavedController.php" hash="036e97703c853a5bae064dd7cf5030a8"/></dir><dir name="etc"><file name="adminhtml.xml" hash="c9c940beffa0ec19e4a1499a66f7fd12"/><file name="config.xml" hash="27ebc5770d12391fb038681eed15a16b"/><file name="system.xml" hash="9aa9be1ba351343fe90920b4233bd1c2"/></dir><dir name="sql"><dir name="gene_braintree_setup"><file name="install-0.1.0.php" hash="7ef62b7c19b9da5990974da6edb3e77c"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="gene"><file name="braintree.xml" hash="871112dbc7a662e41a309c56622753da"/></dir></dir><dir name="template"><dir name="gene"><dir name="braintree"><dir name="creditcard"><file name="hostedfields.phtml" hash="10757415338b805700d36b25296c90c5"/><file name="info.phtml" hash="2ae1e397b3a633dd305bc26c7b9c1065"/><file name="threedsecure.phtml" hash="ee8ad689afde041c39dd92ffa5274883"/></dir><file name="creditcard.phtml" hash="e019b6da4d3c50fbc570d446b18962c5"/><dir name="customer"><file name="methods.phtml" hash="eb5e2d8f4a0f419fcf720c12062f808a"/><file name="saved.phtml" hash="691162b89ed085599f76072226ca2307"/></dir><dir name="js"><file name="aheadworks.phtml" hash="c024bdbf79bfb5dda71ad6acbbcb58d1"/><file name="amasty.phtml" hash="905800a115f06a681a1d31cb0696b2d7"/><file name="data.phtml" hash="2d575380d05455c6eae90d3644b525dc"/><file name="default.phtml" hash="d2375da07bf8f1d50f5b38ba8fab70aa"/><file name="firecheckout.phtml" hash="6295ce2e602c91dc5fbe14e849e7791f"/><file name="idev.phtml" hash="54358bd2916ca3e5c705b8a63d8b1373"/><file name="iwd.phtml" hash="48474604fe3b0a3923f77a0ebd82ef70"/><file name="magestore.phtml" hash="9d15ccd68804eb72a5db280793922668"/><file name="oye.phtml" hash="9b9252a04474d08f2387bef8dfe53b84"/><file name="setup.phtml" hash="f39b3e066b1c1eef36834d41b59174f7"/><file name="unicode.phtml" hash="caeae3b5031ee8539185f78fd4554765"/></dir><dir name="paypal"><file name="info.phtml" hash="5149b273730121e4dec3c3179820f747"/></dir><file name="paypal.phtml" hash="c81c90096517a5a844306345b3c648ca"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="gene"><file name="braintree.xml" hash="2ec661d9b06ab603a914d091268ba4b5"/></dir></dir><dir name="template"><dir name="gene"><dir name="braintree"><dir name="creditcard"><file name="hostedfields.phtml" hash="3e835a116317449620a90964d2b34b5e"/><file name="info.phtml" hash="24c67bab482ea7383ce57d9a06bb9d6f"/></dir><file name="creditcard.phtml" hash="e95b7ff1b2db6ed33190b879ad547a45"/><file name="js.phtml" hash="4f547da52ab1888485cea4f376aa9d5a"/><dir name="paypal"><file name="info.phtml" hash="a8f92f312f8aa5a9463f1d5c2a38cd1b"/></dir><dir name="transactions"><file name="index.phtml" hash="1791b6393f319616dd79c0b46e391847"/><file name="search.phtml" hash="1682ce6200681681f0ce3c848e2e6694"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Gene_Braintree.xml" hash="8c0ffda8566dca2f0b98a999921e3e55"/></dir></target><target name="mageweb"><dir name="js"><dir name="gene"><dir name="braintree"><file name="braintree-0.1.js" hash="a72cc4545d0d01dd0947dae1474516dd"/><file name="config.codekit" hash="cdd81b4b8bf0798c19de798daf230479"/><file name="vzero-0.6-min.js" hash="04306225bad1b725ff69fafa14863909"/><file name="vzero-0.6-min.js.map" hash="2c2dc5a84e46eb7eb54050fdbf6fb17f"/><file name="vzero-0.6.js" hash="d4bbf4c1590f200e388adcd7008be6f4"/></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="gene"><dir name="braintree"><file name="AE.png" hash="6b6f405105413b0723a62ee498f88bf6"/><file name="DI.png" hash="d8e3c3022dda9e723f466b8976ae428f"/><file name="JCB.png" hash="3aa9a71ed8a1d6610bbe0dfe2040e29e"/><file name="MC.png" hash="1fcd14928245139962b72f9368bdbe32"/><file name="ME.png" hash="b9389913c47b9546a67f907fcca73706"/><file name="PP.png" hash="b4946bccba574e86c9716a4986e21c36"/><file name="VI.png" hash="c9f74d1d54e61ab2c748f45a4bdface0"/><file name="card.png" hash="66e16f8c573fad93bb0d62258dce28bb"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir></dir></dir><dir name="css"><dir name="gene"><dir name="braintree"><file name="aheadworks.css" hash="6a9d989e354e4069c1a93301460e4151"/><file name="amasty.css" hash="4c7d73736d10dd1d6be077c091e6511d"/><file name="default.css" hash="17035148ee7da331e11f321f8962536b"/><file name="firecheckout.css" hash="9cd93a2534ca4dc6d049c4146bee4f25"/><file name="idev.css" hash="542423bbb2c61c09331717808cd8c841"/><file name="iwd.css" hash="3774db6ec06341de440a5c73b04ca488"/><file name="magestore.css" hash="47bc1ec7b9bd6ac0cf44f0711bf950a9"/><file name="oye.css" hash="33157880b52f3f67d1203d2eb5e8e343"/><file name="unicode.css" hash="582421c71dbcd123916cb35c4c0d2618"/></dir></dir></dir></dir></dir></dir></target><target name="magelib"><dir name="Braintree"><file name="AddOn.php" hash="e8bbb6db343ba99192346b1dcbf45677"/><file name="AddOnGateway.php" hash="d8698ffe89c01fba78a8a06a2fc68122"/><file name="Address.php" hash="004d3d36d39fc6fcc3d510f4b15b1fca"/><file name="AddressGateway.php" hash="41b5a3be7bdb2fe326a49a1554e1b0c3"/><file name="AndroidPayCard.php" hash="7a1de1da0aa0733277a87b75307bb201"/><file name="ApplePayCard.php" hash="06eea10b110792c18d692e482445ffe4"/><file name="Base.php" hash="60d52fd1bef5655bcb607fba45bb4c1c"/><file name="ClientToken.php" hash="358c0a1dba687baf635db818cb7d1dac"/><file name="ClientTokenGateway.php" hash="6f2259a51415a779a072719288811c16"/><file name="CoinbaseAccount.php" hash="ee5cb6963f675a9a71293c453b128866"/><file name="Collection.php" hash="0e7d31ffcbd9780fb554186bd2c194b0"/><file name="Configuration.php" hash="cce5e6b7e215c73767127d3d8441cc8f"/><file name="CredentialsParser.php" hash="c4bb2248a33129d8523a6120ce44108b"/><file name="CreditCard.php" hash="d32b8d8e64b2d046d3d9e4f00c67f1ed"/><file name="CreditCardGateway.php" hash="0d120ed06f06fd614468d6e3f0ad22d2"/><file name="CreditCardVerification.php" hash="48d6ea546914278f4bea2fefb75e7836"/><file name="CreditCardVerificationGateway.php" hash="6a07430c9437f6e6c1516d5b4572a749"/><file name="CreditCardVerificationSearch.php" hash="18efe7d508c2bd5fea1c0e68fc26182f"/><file name="Customer.php" hash="62d0937de86f7a14a512ad66edba7569"/><file name="CustomerGateway.php" hash="1232a22dd6de6ad1446c6fbb9b0f79c3"/><file name="CustomerSearch.php" hash="8aacc83dac341cd9afec5a3deab17593"/><file name="Descriptor.php" hash="3f5db5e817280ce7f2fa18a205281ad9"/><file name="Digest.php" hash="9d12d067770f55b123b8498fce4478fa"/><file name="Disbursement.php" hash="ad122f0f33b27dfd98bcdd38ea138ae4"/><file name="DisbursementDetails.php" hash="ae632207d0982e288a83aed401c880d9"/><file name="Discount.php" hash="763b3f9cde0ff3af3e8795cac4097595"/><file name="DiscountGateway.php" hash="47796edb8ac2fa68e9af8fb8a13aacb1"/><dir name="Dispute"><file name="TransactionDetails.php" hash="7fdea673a1295055508f42286ad57f4e"/></dir><file name="Dispute.php" hash="c3a4e93fa2b3b0e20ddcb593dcdc7b2b"/><file name="EqualityNode.php" hash="cfd6aa184186233b8d6d1ec0f0e79298"/><dir name="Error"><file name="Codes.php" hash="a7f98ff690e725b7fcd198b4b22d0637"/><file name="ErrorCollection.php" hash="e28d638db56524f5bf3609fa725e6d55"/><file name="Validation.php" hash="bf4e2198300019c52ba56f16269d66ce"/><file name="ValidationErrorCollection.php" hash="9ef25d0126a0b4f6951da5334ae6f0dc"/></dir><dir name="Exception"><file name="Authentication.php" hash="f9e13654988452cca2ac5228a80adae4"/><file name="Authorization.php" hash="5f8c017c6e9fd79a556dade8e15a72e8"/><file name="Configuration.php" hash="b50f67e8ea36cff0d9f6ad718126c6fc"/><file name="DownForMaintenance.php" hash="7fd30b1f8976ed7e38b7e9fae5c20f03"/><file name="ForgedQueryString.php" hash="6884dbae1e86767834b77c821df2db62"/><file name="InvalidChallenge.php" hash="1c283a1c9dac65feb137594d0dcf0e35"/><file name="InvalidSignature.php" hash="b83f5b16735cb3a8e0a8111c4f32711e"/><file name="NotFound.php" hash="f832f771d20b381c2780eb2a572b9f44"/><file name="SSLCaFileNotFound.php" hash="e927c7307bf1761814dc8a755238070d"/><file name="SSLCertificate.php" hash="d509b6a6206bd7c5563ac142dfe3801f"/><file name="ServerError.php" hash="b4645290229ab228a257047d08ef63d7"/><file name="Unexpected.php" hash="01ea2800fb91995ec2a15aee5024611e"/><file name="UpgradeRequired.php" hash="7f40b174df891cc3b3e206d1be884a58"/><file name="ValidationsFailed.php" hash="cd2d30c69911f81b55279c3d6bf88c61"/></dir><file name="Exception.php" hash="f14c94bf67206184eb3e4e7aeb4a608a"/><file name="Gateway.php" hash="103156f5646a8193ed548405f5ac476f"/><file name="Http.php" hash="1baa32e0efcae13c4d6294d1233512a1"/><file name="Instance.php" hash="f0603b3f9213b53687e079c5621ac8f3"/><file name="IsNode.php" hash="e4b1f7bbfcbd24b1d08b97f94df592be"/><file name="KeyValueNode.php" hash="255595ec01a16906dd0c49faf67d9efb"/><file name="Merchant.php" hash="5053ebe889c854d11f2686bffdeb58be"/><dir name="MerchantAccount"><file name="AddressDetails.php" hash="1d265d864a884ebcf2504f55207cc0dd"/><file name="BusinessDetails.php" hash="3e80148bac9fda676844aa19d5b2dc28"/><file name="FundingDetails.php" hash="7368f653fcbcc3d87924447b1763e616"/><file name="IndividualDetails.php" hash="777b6f28f643e78616c7ed753a39c0cd"/></dir><file name="MerchantAccount.php" hash="496c93182d824bb2967cc9366dec1ac3"/><file name="MerchantAccountGateway.php" hash="e2073aff6f8b3c5f2e64b23b210c44f7"/><file name="MerchantGateway.php" hash="e0a2e3a28c68dac8bd082973b269ed1b"/><file name="Modification.php" hash="0abe992d4f821327f617ca883c4eb2d1"/><file name="MultipleValueNode.php" hash="92700fa03011eaa9561010b3a160449c"/><file name="MultipleValueOrTextNode.php" hash="ef06bac18e2bc40974bdc0bcb854890f"/><file name="OAuthCredentials.php" hash="e992dca9dfedb27e3d050af55971a968"/><file name="OAuthGateway.php" hash="e2e238d067f43c0f28fcb25c2de4a274"/><file name="PartialMatchNode.php" hash="370c7e0ab8a445cfeef6b19ef1755f4d"/><file name="PartnerMerchant.php" hash="bdb69ebdc75d67009710be9703a47e80"/><file name="PayPalAccount.php" hash="672a7d424f94e590c5e66a21e62d7bc2"/><file name="PayPalAccountGateway.php" hash="d73f5744ebaca6cc882c42d0e9c1a05e"/><file name="PaymentInstrumentType.php" hash="be97a30c7d8fbbb180864dc4efea71f2"/><file name="PaymentMethod.php" hash="5bc31d3e97610e7218c95aba2422cc9a"/><file name="PaymentMethodGateway.php" hash="1ce13a8b1ec93cf32b8029c55ea26fa2"/><file name="PaymentMethodNonce.php" hash="e99302e2468f55c8fb4b2ceeb1bce68e"/><file name="PaymentMethodNonceGateway.php" hash="22a0d89eee071a28b530c6be477dcc6e"/><file name="Plan.php" hash="22ab0117d462352aecb9531d4a26619e"/><file name="PlanGateway.php" hash="95e093b55ad20f8b652ee5f2fc2a0fcf"/><file name="RangeNode.php" hash="4ad9a92547423b3d54d69097114c3daf"/><file name="ResourceCollection.php" hash="8f437cb5014148c0e2f6049347ae795c"/><dir name="Result"><file name="CreditCardVerification.php" hash="7c41787025ec7cffb269f53e3ce479e2"/><file name="Error.php" hash="0e0460f1eea017bc7591e05351f51eb0"/><file name="Successful.php" hash="03f1c379fcedaef499296ab7778d1e36"/></dir><file name="RiskData.php" hash="8bef1074f9f1c50c841a7c7cf627c9cf"/><file name="SettlementBatchSummary.php" hash="388d88e8cea7bec61ee78f388fb78c2c"/><file name="SettlementBatchSummaryGateway.php" hash="bc54658b75fa0505e072331799c2d9ad"/><file name="SignatureService.php" hash="4b78d3e5897e715dcc877c5f65b3cfae"/><dir name="Subscription"><file name="StatusDetails.php" hash="29e375f02150bfd7147591f0eb27cb4f"/></dir><file name="Subscription.php" hash="cde05aa61192d5b930b57330db308835"/><file name="SubscriptionGateway.php" hash="bd1b2aa2d4d41a595463bead64ed34e0"/><file name="SubscriptionSearch.php" hash="1874ebe5cb42d7d2836617810cced1af"/><dir name="Test"><file name="CreditCardNumbers.php" hash="676a9100354eb679e7ca1e0f0d67293f"/><file name="MerchantAccount.php" hash="612e7e30cca364c0d14cbff3b54ebf3f"/><file name="Nonces.php" hash="230dc3687abaf95e9f516573b1836f4a"/><file name="TransactionAmounts.php" hash="ed9bf1f57d871542c32d11de9e031f05"/><file name="VenmoSdk.php" hash="6ce94deccd1f968596011487c7e69cc7"/></dir><file name="TextNode.php" hash="94c95ec9645de57acace2179fef7fb43"/><file name="ThreeDSecureInfo.php" hash="542550c4e03a24551d00e8aad5493035"/><dir name="Transaction"><file name="AddressDetails.php" hash="ff52a4a48248085b7ea92e992160e413"/><file name="AndroidPayCardDetails.php" hash="4dab3acc0cc35b5a6f12f95004074374"/><file name="ApplePayCardDetails.php" hash="c4dd87cd46fe7269e1bd51c867adf7cb"/><file name="CoinbaseDetails.php" hash="d19a625f8de98698b8277c25660358f0"/><file name="CreditCardDetails.php" hash="aac5eb1f5804d4f979b9c71f7b98cb36"/><file name="CustomerDetails.php" hash="e137895c646127312be44292c84a2d81"/><file name="PayPalDetails.php" hash="ede299e376bce7714838d79ca3d40842"/><file name="StatusDetails.php" hash="7c6e719c51bf13bdfd07615030100ac6"/><file name="SubscriptionDetails.php" hash="1cf1f511d1545a2e27b8d3f4bee800ca"/></dir><file name="Transaction.php" hash="09b9e7a574d304e9edebe578173f2994"/><file name="TransactionGateway.php" hash="4282d7497100c26afcd709fd77eae0bd"/><file name="TransactionSearch.php" hash="3101c79514520a1a500e4623f4ca1c32"/><file name="TransparentRedirect.php" hash="154c9850be5175a5cd1b35bdf78ae939"/><file name="TransparentRedirectGateway.php" hash="5ead181bf0d5484db5eb305efa13bec4"/><file name="UnknownPaymentMethod.php" hash="9107498774ab5bc2b25de98838736b47"/><file name="Util.php" hash="9832a44da18b97a55248cadc4bb9a4ad"/><file name="Version.php" hash="2f088b43efe46edb3262b89b7d40d051"/><file name="WebhookNotification.php" hash="4097fb57d46368d903c42bb20fbd49ca"/><file name="WebhookTesting.php" hash="c40311458bb64e37b4c08eb88df37805"/><dir name="Xml"><file name="Generator.php" hash="19f9c9b9b61d4f97f65775f527ac408d"/><file name="Parser.php" hash="c06b1ae155ac7687eaa856fac472656d"/></dir><file name="Xml.php" hash="dc69e05bea21e3d1185d45d53e4747db"/></dir><dir name="."><file name="Braintree.php" hash="424b8ccb072fda0ddf3459be6279734a"/></dir><dir name="ssl"><file name="api_braintreegateway_com.ca.crt" hash="04beb23c767547e980c76eb68c7eab15"/><file name="sandbox_braintreegateway_com.ca.crt" hash="f1b529883c7c2cbb4251658f5da7b4c9"/></dir></target><target name="magelocale"><dir><dir name="en_US"><file name="Gene_Braintree.csv" hash="00ae6dc359bc0d9c48bfc90a865232a3"/></dir></dir></target></contents>
42
  <compatible/>
43
  <dependencies><required><php><min>5.2.1</min><max>6.0.0</max></php><package><name/><channel>connect.magentocommerce.com/core</channel><min/><max/></package></required></dependencies>
44
  </package>
skin/frontend/base/default/css/gene/braintree/oye.css ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* @todo remove */
2
+ .checkout-onepage-index .col-main {
3
+ width: 100%!important;
4
+ }
5
+
6
+ #paypal-complete #paypal-label {
7
+ float: right;
8
+ margin-right: 8px;
9
+ line-height: 44px;
10
+ }
11
+ #paypal-container iframe {
12
+ display: none;
13
+ }
14
+ #paypal-complete #paypal-container {
15
+ float: right;
16
+ }
17
+ #braintree-paypal-button {
18
+ padding: 0;
19
+ }
20
+
21
+ #payment_form_gene_braintree_paypal, #payment_form_gene_braintree_creditcard {
22
+ padding-top: 6px;
23
+ padding-bottom: 6px;
24
+ }
25
+
26
+ /* Saved Accounts */
27
+ #creditcard-saved-accounts, #paypal-saved-accounts {
28
+ font-size: 0;
29
+ width: 100%;
30
+ }
31
+ #creditcard-saved-accounts tr, #paypal-saved-accounts tr {
32
+ border-bottom: 1px dotted lightgrey;
33
+ }
34
+ #creditcard-saved-accounts tr.other-row, #paypal-saved-accounts tr.other-row {
35
+ border-bottom: 0;
36
+ }
37
+ #creditcard-saved-accounts label {
38
+ padding: 14px 0;
39
+ line-height: 48px;
40
+ width: auto;
41
+ }
42
+ #creditcard-saved-accounts tr.other-row label, #paypal-saved-accounts tr.other-row label {
43
+ padding: 18px 0;
44
+ }
45
+ #creditcard-saved-accounts tr.other-row label[for="other-creditcard"], #paypal-saved-accounts tr.other-row label[for="other-paypal"] {
46
+ padding: 8px 0;
47
+ }
48
+ #paypal-saved-accounts label {
49
+ padding: 8px 0;
50
+ line-height: 48px;
51
+ width: auto;
52
+ }
53
+ #creditcard-saved-accounts label img {
54
+ float: left;
55
+ }
56
+ #creditcard-saved-accounts label .saved-card-info, #paypal-saved-accounts label .saved-paypal-email {
57
+ margin-left: 12px;
58
+ float: left;
59
+ }
60
+ #creditcard-saved-accounts label .saved-card-info span {
61
+ display: block;
62
+ line-height: 24px;
63
+ }
64
+ #creditcard-saved-accounts label .saved-card-info span.saved-expiry-date {
65
+ font-size: 12px;
66
+ }
67
+
68
+ /* Hosted Fields */
69
+ #braintree-hosted-submit {
70
+ display: none;
71
+ }
72
+ .braintree-input-field {
73
+ height: 42px;
74
+ max-width: 340px;
75
+ padding: 0 10px;
76
+ border: 1px solid lightgrey;
77
+ background: white;
78
+ }
79
+ .braintree-card-input-field {
80
+ height: 50px;
81
+ width: 100%;
82
+ max-width: 372px;
83
+ border: 1px solid lightgrey;
84
+ position: relative;
85
+ background: white;
86
+ }
87
+ .braintree-card-input-field .card-type {
88
+ position: absolute;
89
+ top: 0;
90
+ left: 0;
91
+ bottom: 0;
92
+ padding: 0 10px 0 8px;
93
+ }
94
+ .braintree-card-input-field .card-type img {
95
+ height: 48px;
96
+ }
97
+ .braintree-card-input-field #card-number {
98
+ float: left;
99
+ height: 48px;
100
+ width: 100%;
101
+ padding-left: 66px;
102
+ box-sizing: border-box;
103
+ }
104
+ #braintree-expiration-container {
105
+ display: block;
106
+ width: 100%;
107
+ vertical-align: middle;
108
+ font-size: 0;
109
+ }
110
+ .braintree-expiration {
111
+ width: 70px;
112
+ display: inline-block;
113
+ *zoom: 1;
114
+ *display: inline;
115
+ }
116
+ .braintree-expiration-seperator {
117
+ vertical-align: top;
118
+ line-height: 42px;
119
+ display: inline-block;
120
+ *zoom: 1;
121
+ *display: inline;
122
+ font-size: 30px;
123
+ padding: 0 8px;
124
+ }
125
+ .braintree-cvv {
126
+ width: 80px;
127
+ }
128
+ .braintree-hostedfield .cvv-what-is-this {
129
+ margin-left: 0;
130
+ }