Gene_Braintree - Version 2.2.0

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 2.2.0
Comparing to
See all releases


Code changes from version 2.1.7 to 2.2.0

Files changed (142) hide show
  1. app/code/community/Gene/Braintree/Block/Adminhtml/Report/Transactions.php +1 -1
  2. app/code/community/Gene/Braintree/Block/Adminhtml/Report/Transactions/Grid.php +5 -3
  3. app/code/community/Gene/Braintree/Block/Adminhtml/Report/Transactions/Search.php +1 -1
  4. app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Braintree/Config.php +1 -1
  5. app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Braintree/Currency.php +1 -1
  6. app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Braintree/Kount/Ens.php +1 -1
  7. app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Braintree/Migration.php +1 -1
  8. app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Braintree/Moduleversion.php +1 -1
  9. app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Braintree/Version.php +1 -1
  10. app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Migration.php +1 -1
  11. app/code/community/Gene/Braintree/Block/Assets.php +140 -4
  12. app/code/community/Gene/Braintree/Block/Cart/Totals.php +1 -1
  13. app/code/community/Gene/Braintree/Block/Creditcard.php +1 -1
  14. app/code/community/Gene/Braintree/Block/Creditcard/Info.php +1 -1
  15. app/code/community/Gene/Braintree/Block/Creditcard/Saved.php +1 -1
  16. app/code/community/Gene/Braintree/Block/Creditcard/Threedsecure.php +1 -1
  17. app/code/community/Gene/Braintree/Block/Express/Abstract.php +1 -1
  18. app/code/community/Gene/Braintree/Block/Express/Button.php +1 -1
  19. app/code/community/Gene/Braintree/Block/Express/Checkout.php +1 -1
  20. app/code/community/Gene/Braintree/Block/Express/Setup.php +5 -10
  21. app/code/community/Gene/Braintree/Block/Info.php +1 -1
  22. app/code/community/Gene/Braintree/Block/Js.php +1 -1
  23. app/code/community/Gene/Braintree/Block/Paypal.php +1 -1
  24. app/code/community/Gene/Braintree/Block/Paypal/Info.php +1 -1
  25. app/code/community/Gene/Braintree/Block/Paypal/Saved.php +1 -1
  26. app/code/community/Gene/Braintree/Block/Saved.php +1 -1
  27. app/code/community/Gene/Braintree/Block/Saved/Edit.php +1 -1
  28. app/code/community/Gene/Braintree/Helper/Data.php +25 -2
  29. app/code/community/Gene/Braintree/Model/Debug.php +1 -1
  30. app/code/community/Gene/Braintree/Model/Entity/Setup.php +1 -1
  31. app/code/community/Gene/Braintree/Model/Express/Assets.php +1 -1
  32. app/code/community/Gene/Braintree/Model/Kount/Ens.php +1 -1
  33. app/code/community/Gene/Braintree/Model/Kount/Rest.php +1 -1
  34. app/code/community/Gene/Braintree/Model/Migration.php +1 -1
  35. app/code/community/Gene/Braintree/Model/Observer.php +32 -29
  36. app/code/community/Gene/Braintree/Model/Paymentmethod/Abstract.php +1 -1
  37. app/code/community/Gene/Braintree/Model/Paymentmethod/Creditcard.php +21 -1
  38. app/code/community/Gene/Braintree/Model/Paymentmethod/Legacy/Creditcard.php +1 -1
  39. app/code/community/Gene/Braintree/Model/Paymentmethod/Legacy/Paypal.php +1 -1
  40. app/code/community/Gene/Braintree/Model/Paymentmethod/Paypal.php +1 -1
  41. app/code/community/Gene/Braintree/Model/Saved.php +1 -1
  42. app/code/community/Gene/Braintree/Model/Source/Cctype.php +1 -1
  43. app/code/community/Gene/Braintree/Model/Source/Creditcard/CaptureAction.php +1 -1
  44. app/code/community/Gene/Braintree/Model/Source/Creditcard/FormIntegration.php +1 -1
  45. app/code/community/Gene/Braintree/Model/Source/Creditcard/PaymentAction.php +1 -1
  46. app/code/community/Gene/Braintree/Model/Source/Environment.php +1 -1
  47. app/code/community/Gene/Braintree/Model/Source/Paypal/CaptureAction.php +1 -1
  48. app/code/community/Gene/Braintree/Model/Source/Paypal/Locale.php +1 -1
  49. app/code/community/Gene/Braintree/Model/Source/Paypal/Paymenttype.php +1 -1
  50. app/code/community/Gene/Braintree/Model/System/Config/Backend/Currency.php +1 -1
  51. app/code/community/Gene/Braintree/Model/System/Config/Source/Payment/Liabilityaction.php +1 -1
  52. app/code/community/Gene/Braintree/Model/System/Config/Source/Payment/Threedsecurecountries.php +1 -1
  53. app/code/community/Gene/Braintree/Model/Wrapper/Braintree.php +1 -1
  54. app/code/community/Gene/Braintree/controllers/Adminhtml/Braintree/MigrationController.php +1 -1
  55. app/code/community/Gene/Braintree/controllers/Adminhtml/BraintreeController.php +1 -1
  56. app/code/community/Gene/Braintree/controllers/CheckoutController.php +21 -1
  57. app/code/community/Gene/Braintree/controllers/ExpressController.php +34 -13
  58. app/code/community/Gene/Braintree/controllers/Kount/EnsController.php +1 -1
  59. app/code/community/Gene/Braintree/controllers/SavedController.php +1 -1
  60. app/code/community/Gene/Braintree/etc/config.xml +2 -1
  61. app/code/community/Gene/Braintree/etc/system.xml +18 -20
  62. app/design/adminhtml/default/default/layout/gene/braintree.xml +9 -1
  63. app/design/adminhtml/default/default/template/gene/braintree/assets.phtml +7 -12
  64. app/design/adminhtml/default/default/template/gene/braintree/js.phtml +5 -2
  65. app/design/frontend/base/default/layout/gene/braintree.xml +27 -7
  66. app/design/frontend/base/default/template/gene/braintree/assets.phtml +7 -12
  67. app/design/frontend/base/default/template/gene/braintree/express/cart.phtml +2 -1
  68. app/design/frontend/base/default/template/gene/braintree/express/catalog.phtml +2 -1
  69. app/design/frontend/base/default/template/gene/braintree/js/aheadworks.phtml +1 -2
  70. app/design/frontend/base/default/template/gene/braintree/js/amasty.phtml +1 -1
  71. app/design/frontend/base/default/template/gene/braintree/js/awesomecheckout.phtml +1 -1
  72. app/design/frontend/base/default/template/gene/braintree/js/default.phtml +1 -1
  73. app/design/frontend/base/default/template/gene/braintree/js/fancycheckout.phtml +1 -1
  74. app/design/frontend/base/default/template/gene/braintree/js/firecheckout.phtml +9 -2
  75. app/design/frontend/base/default/template/gene/braintree/js/fme.phtml +1 -1
  76. app/design/frontend/base/default/template/gene/braintree/js/iwd.phtml +9 -3
  77. app/design/frontend/base/default/template/gene/braintree/js/magestore.phtml +1 -1
  78. app/design/frontend/base/default/template/gene/braintree/js/multishipping.phtml +1 -1
  79. app/design/frontend/base/default/template/gene/braintree/js/oye.phtml +1 -1
  80. app/design/frontend/base/default/template/gene/braintree/js/setup.phtml +7 -5
  81. app/design/frontend/base/default/template/gene/braintree/js/unicode.phtml +1 -1
  82. {skin/adminhtml/default/default/css → js}/gene/braintree/.DS_Store +0 -0
  83. js/gene/braintree/2.1.7/express/abstract-min.js +0 -1
  84. js/gene/braintree/2.1.7/express/paypal-min.js +0 -1
  85. js/gene/braintree/2.1.7/vzero-integration-min.js +0 -1
  86. js/gene/braintree/2.1.7/vzero-min.js +0 -1
  87. js/gene/braintree/2.1.7/vzero-paypal-min.js +0 -1
  88. js/gene/braintree/2.2.0/express/abstract-min.js +1 -0
  89. js/gene/braintree/2.2.0/express/paypal-min.js +1 -0
  90. js/gene/braintree/2.2.0/vzero-integration-min.js +1 -0
  91. js/gene/braintree/2.2.0/vzero-min.js +1 -0
  92. js/gene/braintree/2.2.0/vzero-paypal-min.js +1 -0
  93. js/gene/braintree/config.codekit +29 -29
  94. js/gene/braintree/express/abstract-min.js +1 -1
  95. js/gene/braintree/source/express/abstract.js +3 -2
  96. js/gene/braintree/source/express/paypal.js +5 -2
  97. js/gene/braintree/source/vzero-integration.js +17 -3
  98. js/gene/braintree/source/vzero-paypal.js +93 -17
  99. js/gene/braintree/source/vzero.js +105 -30
  100. lib/Gene/Braintree/autoload.php +1 -1
  101. lib/Gene/Braintree/braintree/braintree_php/ACKNOWLEDGEMENTS.md +6 -0
  102. lib/Gene/Braintree/braintree/braintree_php/CHANGELOG.md +22 -0
  103. lib/Gene/Braintree/braintree/braintree_php/README.md +10 -5
  104. lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/AchMandate.php +58 -0
  105. lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/Configuration.php +27 -0
  106. lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/Customer.php +10 -1
  107. lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/CustomerGateway.php +1 -1
  108. lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/Error/Codes.php +6 -0
  109. lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/Http.php +4 -0
  110. lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/MerchantAccountGateway.php +28 -0
  111. lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/PaginatedCollection.php +111 -0
  112. lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/PaginatedResult.php +32 -0
  113. lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/PaymentInstrumentType.php +1 -0
  114. lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/PaymentMethod.php +2 -2
  115. lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/PaymentMethodGateway.php +34 -9
  116. lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/Transaction/UsBankAccountDetails.php +10 -4
  117. lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/TransactionGateway.php +16 -6
  118. lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/UsBankAccount.php +12 -0
  119. lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/Version.php +2 -2
  120. lib/Gene/Braintree/braintree/braintree_php/tests/Helper.php +12 -3
  121. lib/Gene/Braintree/braintree/braintree_php/tests/integration/CustomerTest.php +41 -0
  122. lib/Gene/Braintree/braintree/braintree_php/tests/integration/HttpClientApi.php +3 -3
  123. lib/Gene/Braintree/braintree/braintree_php/tests/integration/HttpTest.php +34 -0
  124. lib/Gene/Braintree/braintree/braintree_php/tests/integration/MerchantAccountTest.php +200 -0
  125. lib/Gene/Braintree/braintree/braintree_php/tests/integration/MerchantTest.php +61 -44
  126. lib/Gene/Braintree/braintree/braintree_php/tests/integration/PaymentMethodNonceTest.php +13 -4
  127. lib/Gene/Braintree/braintree/braintree_php/tests/integration/PaymentMethodTest.php +32 -8
  128. lib/Gene/Braintree/braintree/braintree_php/tests/integration/TransactionTest.php +126 -6
  129. lib/Gene/Braintree/braintree/braintree_php/tests/integration/UsBankAccountTest.php +14 -6
  130. lib/Gene/Braintree/braintree/braintree_php/tests/unit/ConfigurationTest.php +68 -4
  131. lib/Gene/Braintree/braintree/braintree_php/tests/unit/PaymentMethodTest.php +40 -0
  132. lib/Gene/Braintree/braintree/braintree_php/tests/unit/TransactionTest.php +81 -11
  133. lib/Gene/Braintree/braintree/braintree_php/tests/unit/UsBankAccount.php +21 -0
  134. lib/Gene/Braintree/braintree/braintree_php/tests/unit/WebhookNotificationTest.php +0 -2
  135. lib/Gene/Braintree/composer/ClassLoader.php +7 -5
  136. lib/Gene/Braintree/composer/autoload_real.php +4 -4
  137. lib/Gene/Braintree/composer/autoload_static.php +4 -4
  138. lib/Gene/Braintree/composer/installed.json +6 -6
  139. lib/Gene/composer.json +1 -1
  140. lib/Gene/composer.lock +7 -7
  141. package.xml +6 -6
  142. skin/frontend/base/default/css/gene/braintree/.DS_Store +0 -0
app/code/community/Gene/Braintree/Block/Adminhtml/Report/Transactions.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Block_Adminhtml_Report_Transactions
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Adminhtml_Report_Transactions extends Mage_Adminhtml_Block_Widget_Grid_Container
9
  {
3
  /**
4
  * Class Gene_Braintree_Block_Adminhtml_Report_Transactions
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Adminhtml_Report_Transactions extends Mage_Adminhtml_Block_Widget_Grid_Container
9
  {
app/code/community/Gene/Braintree/Block/Adminhtml/Report/Transactions/Grid.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Block_Adminhtml_Report_Transactions_Grid
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Adminhtml_Report_Transactions_Grid extends Mage_Adminhtml_Block_Widget_Grid
9
  {
@@ -114,14 +114,16 @@ class Gene_Braintree_Block_Adminhtml_Report_Transactions_Grid extends Mage_Admin
114
 
115
  /* @var $transaction Braintree_Transaction */
116
  foreach ($transactions as $transaction) {
 
 
117
 
118
  // Create a new varien object
119
  $transactionItem = new Varien_Object();
120
- $transactionItem->setData((array)$transaction->_attributes);
121
 
122
  // Grab the Magento order from the previously built collection
123
  /* @var $magentoOrder Mage_Sales_Model_Order */
124
- $magentoOrder = $orders->getItemByColumnValue('increment_id', $transaction->orderId);
125
 
126
  // Set the Magento Order ID into the collection
127
  // Not all transactions maybe coming from Magento
3
  /**
4
  * Class Gene_Braintree_Block_Adminhtml_Report_Transactions_Grid
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Adminhtml_Report_Transactions_Grid extends Mage_Adminhtml_Block_Widget_Grid
9
  {
114
 
115
  /* @var $transaction Braintree_Transaction */
116
  foreach ($transactions as $transaction) {
117
+ $transaction = (array) $transaction;
118
+ $transaction = current($transaction);
119
 
120
  // Create a new varien object
121
  $transactionItem = new Varien_Object();
122
+ $transactionItem->setData($transaction);
123
 
124
  // Grab the Magento order from the previously built collection
125
  /* @var $magentoOrder Mage_Sales_Model_Order */
126
+ $magentoOrder = $orders->getItemByColumnValue('increment_id', $transaction['orderId']);
127
 
128
  // Set the Magento Order ID into the collection
129
  // Not all transactions maybe coming from Magento
app/code/community/Gene/Braintree/Block/Adminhtml/Report/Transactions/Search.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Block_Adminhtml_Report_Transactions_Search
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Adminhtml_Report_Transactions_Search extends Mage_Core_Block_Template
9
  {
3
  /**
4
  * Class Gene_Braintree_Block_Adminhtml_Report_Transactions_Search
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Adminhtml_Report_Transactions_Search extends Mage_Core_Block_Template
9
  {
app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Braintree/Config.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Config
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Config
9
  extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface
3
  /**
4
  * Class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Config
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Config
9
  extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface
app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Braintree/Currency.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Currency
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Currency
9
  extends Mage_Adminhtml_Block_System_Config_Form_Field
3
  /**
4
  * Class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Currency
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Currency
9
  extends Mage_Adminhtml_Block_System_Config_Form_Field
app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Braintree/Kount/Ens.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Model_System_Config_Backend_Kount_Ens
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Kount_Ens extends Mage_Adminhtml_Block_System_Config_Form_Field
9
  {
3
  /**
4
  * Class Gene_Braintree_Model_System_Config_Backend_Kount_Ens
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Kount_Ens extends Mage_Adminhtml_Block_System_Config_Form_Field
9
  {
app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Braintree/Migration.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Migration
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Migration
9
  extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface
3
  /**
4
  * Class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Migration
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Migration
9
  extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface
app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Braintree/Moduleversion.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Moduleversion
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Moduleversion
9
  extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface
3
  /**
4
  * Class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Moduleversion
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Moduleversion
9
  extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface
app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Braintree/Version.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Version
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Version
9
  extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface
3
  /**
4
  * Class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Version
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Version
9
  extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface
app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Migration.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Block_Adminhtml_System_Config_Migration
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Adminhtml_System_Config_Migration extends Mage_Core_Block_Template
9
  {
3
  /**
4
  * Class Gene_Braintree_Block_Adminhtml_System_Config_Migration
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Adminhtml_System_Config_Migration extends Mage_Core_Block_Template
9
  {
app/code/community/Gene/Braintree/Block/Assets.php CHANGED
@@ -3,10 +3,15 @@
3
  /**
4
  * Class Gene_Braintree_Block_Assets
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Assets extends Mage_Core_Block_Template
9
  {
 
 
 
 
 
10
  /**
11
  * Record the current version
12
  *
@@ -14,6 +19,75 @@ class Gene_Braintree_Block_Assets extends Mage_Core_Block_Template
14
  */
15
  protected $version = null;
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  /**
18
  * Return the Braintree module version
19
  *
@@ -33,7 +107,8 @@ class Gene_Braintree_Block_Assets extends Mage_Core_Block_Template
33
  }
34
 
35
  /**
36
- * Replace {VERSION} with the current module verison
 
37
  *
38
  * @param string $fileName
39
  *
@@ -41,8 +116,36 @@ class Gene_Braintree_Block_Assets extends Mage_Core_Block_Template
41
  */
42
  public function getJsUrl($fileName = '')
43
  {
44
- $fileName = str_replace('{VERSION}', $this->getModuleVersion(), $fileName);
45
- return parent::getJsUrl($fileName);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  }
47
 
48
  /**
@@ -88,6 +191,32 @@ class Gene_Braintree_Block_Assets extends Mage_Core_Block_Template
88
  return Mage::helper('gene_braintree')->isExpressEnabled('checkout_cart_index');
89
  }
90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  /**
92
  * Does the module require setup and thus these assets?
93
  *
@@ -95,6 +224,13 @@ class Gene_Braintree_Block_Assets extends Mage_Core_Block_Template
95
  */
96
  protected function _toHtml()
97
  {
 
 
 
 
 
 
 
98
  if (Mage::helper('gene_braintree')->isSetupRequired() && $this->handleRequiresAssets()) {
99
  return parent::_toHtml();
100
  }
3
  /**
4
  * Class Gene_Braintree_Block_Assets
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Assets extends Mage_Core_Block_Template
9
  {
10
+ /**
11
+ * Version of Braintree SDK to be included
12
+ */
13
+ const SDK_VERSION = '3.9.0';
14
+
15
  /**
16
  * Record the current version
17
  *
19
  */
20
  protected $version = null;
21
 
22
+ /**
23
+ * An array of JavaScript to be included as assets
24
+ *
25
+ * @var array
26
+ */
27
+ protected $js = array();
28
+
29
+ /**
30
+ * Any external JavaScript to be included
31
+ *
32
+ * @var array
33
+ */
34
+ protected $externalJs = array();
35
+
36
+ /**
37
+ * Initialize template
38
+ *
39
+ */
40
+ protected function _construct()
41
+ {
42
+ $this->setTemplate('gene/braintree/assets.phtml');
43
+ }
44
+
45
+ /**
46
+ * Add internal JS
47
+ *
48
+ * @param $url
49
+ *
50
+ * @return $this
51
+ */
52
+ public function addJs($url)
53
+ {
54
+ $this->js[] = $url;
55
+ return $this;
56
+ }
57
+
58
+ /**
59
+ * Return the JS URLs
60
+ *
61
+ * @return array
62
+ */
63
+ public function getJs()
64
+ {
65
+ return array_unique($this->js);
66
+ }
67
+
68
+ /**
69
+ * Add an external JS asset to the page
70
+ *
71
+ * @param $url
72
+ *
73
+ * @return $this
74
+ */
75
+ public function addExternalJs($url)
76
+ {
77
+ $this->externalJs[] = $url;
78
+ return $this;
79
+ }
80
+
81
+ /**
82
+ * Return the external JS scripts
83
+ *
84
+ * @return array
85
+ */
86
+ public function getExternalJs()
87
+ {
88
+ return array_unique($this->externalJs);
89
+ }
90
+
91
  /**
92
  * Return the Braintree module version
93
  *
107
  }
108
 
109
  /**
110
+ * Replace {MODULE_VERSION} with the current module version
111
+ * Replace {SDK_VERSION} with the current require SDK version
112
  *
113
  * @param string $fileName
114
  *
116
  */
117
  public function getJsUrl($fileName = '')
118
  {
119
+ $fileName = str_replace('{MODULE_VERSION}', $this->getModuleVersion(), $fileName);
120
+ $fileName = str_replace('{SDK_VERSION}', self::SDK_VERSION, $fileName);
121
+
122
+ // Detect if the filename as :// within it meaning it's an external URL
123
+ if (strpos($fileName, '://') === false) {
124
+ $cacheBust = '';
125
+ if ($modifiedTime = $this->getAssetModifiedTime($fileName)) {
126
+ $cacheBust = '?v=' . $modifiedTime;
127
+ }
128
+ return parent::getJsUrl($fileName) . $cacheBust;
129
+ }
130
+
131
+ return $fileName;
132
+ }
133
+
134
+ /**
135
+ * Get the last time the file was modified
136
+ *
137
+ * @param $fileName
138
+ *
139
+ * @return bool|int
140
+ */
141
+ protected function getAssetModifiedTime($fileName)
142
+ {
143
+ $filePath = Mage::getBaseDir() . DS . 'js' . DS . ltrim($fileName, '/');
144
+ if (file_exists($filePath)) {
145
+ return filemtime($filePath);
146
+ }
147
+
148
+ return false;
149
  }
150
 
151
  /**
191
  return Mage::helper('gene_braintree')->isExpressEnabled('checkout_cart_index');
192
  }
193
 
194
+ /**
195
+ * Determine whether setup is required to run int the admin or not
196
+ *
197
+ * @return bool
198
+ */
199
+ protected function isSetupRequiredInAdmin()
200
+ {
201
+ // First check if the method is enabled in the admin directly?
202
+ if (Mage::helper('gene_braintree')->isSetupRequired()) {
203
+ true;
204
+ }
205
+
206
+ // If it's not it might be enabled on a website level, payment methods cannot be disabled / enabled on store
207
+ // level by in our extension.
208
+ $websites = Mage::app()->getWebsites();
209
+ /* @var $website Mage_Core_Model_Website */
210
+ foreach ($websites as $website) {
211
+ $defaultStoreId = $website->getDefaultStore()->getId();
212
+ if (Mage::helper('gene_braintree')->isSetupRequired($defaultStoreId)) {
213
+ return true;
214
+ }
215
+ }
216
+
217
+ return false;
218
+ }
219
+
220
  /**
221
  * Does the module require setup and thus these assets?
222
  *
224
  */
225
  protected function _toHtml()
226
  {
227
+ // Handle the blocks inclusion differently in the admin
228
+ if (Mage::app()->getStore()->isAdmin() && $this->isSetupRequiredInAdmin()) {
229
+ return parent::_toHtml();
230
+ } elseif (Mage::app()->getStore()->isAdmin()) {
231
+ return false;
232
+ }
233
+
234
  if (Mage::helper('gene_braintree')->isSetupRequired() && $this->handleRequiresAssets()) {
235
  return parent::_toHtml();
236
  }
app/code/community/Gene/Braintree/Block/Cart/Totals.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Block_Cart_Totals
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Cart_Totals extends Mage_Checkout_Block_Cart_Totals
9
  {
3
  /**
4
  * Class Gene_Braintree_Block_Cart_Totals
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Cart_Totals extends Mage_Checkout_Block_Cart_Totals
9
  {
app/code/community/Gene/Braintree/Block/Creditcard.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Block_Creditcard
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Creditcard extends Mage_Payment_Block_Form_Cc
9
  {
3
  /**
4
  * Class Gene_Braintree_Block_Creditcard
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Creditcard extends Mage_Payment_Block_Form_Cc
9
  {
app/code/community/Gene/Braintree/Block/Creditcard/Info.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Block_Creditcard_Info
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Creditcard_Info extends Gene_Braintree_Block_Info
9
  {
3
  /**
4
  * Class Gene_Braintree_Block_Creditcard_Info
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Creditcard_Info extends Gene_Braintree_Block_Info
9
  {
app/code/community/Gene/Braintree/Block/Creditcard/Saved.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Block_Creditcard_Saved
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Creditcard_Saved extends Mage_Core_Block_Template
9
  {
3
  /**
4
  * Class Gene_Braintree_Block_Creditcard_Saved
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Creditcard_Saved extends Mage_Core_Block_Template
9
  {
app/code/community/Gene/Braintree/Block/Creditcard/Threedsecure.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Block_Creditcard_Threedsecure
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Creditcard_Threedsecure extends Mage_Core_Block_Template
9
  {
3
  /**
4
  * Class Gene_Braintree_Block_Creditcard_Threedsecure
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Creditcard_Threedsecure extends Mage_Core_Block_Template
9
  {
app/code/community/Gene/Braintree/Block/Express/Abstract.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Block_Express_Abstract
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Express_Abstract extends Mage_Core_Block_Template
9
  {
3
  /**
4
  * Class Gene_Braintree_Block_Express_Abstract
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Express_Abstract extends Mage_Core_Block_Template
9
  {
app/code/community/Gene/Braintree/Block/Express/Button.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Block_Express_Button
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Express_Button extends Gene_Braintree_Block_Express_Abstract
9
  {
3
  /**
4
  * Class Gene_Braintree_Block_Express_Button
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Express_Button extends Gene_Braintree_Block_Express_Abstract
9
  {
app/code/community/Gene/Braintree/Block/Express/Checkout.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Block_Express_Checkout
5
  *
6
- * @author Aidan Threadgold <aidan@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Express_Checkout extends Mage_Core_Block_Template
9
  {
3
  /**
4
  * Class Gene_Braintree_Block_Express_Checkout
5
  *
6
+ * @author Aidan Threadgold <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Express_Checkout extends Mage_Core_Block_Template
9
  {
app/code/community/Gene/Braintree/Block/Express/Setup.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Block_Express_Button
5
  *
6
- * @author Aidan Threadgold <aidan@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Express_Setup extends Gene_Braintree_Block_Express_Abstract
9
  {
@@ -14,15 +14,6 @@ class Gene_Braintree_Block_Express_Setup extends Gene_Braintree_Block_Express_Ab
14
  */
15
  protected $_token = null;
16
 
17
- /**
18
- * Generate braintree token
19
- */
20
- protected function _construct()
21
- {
22
- parent::_construct();
23
- $this->_token = Mage::getModel('gene_braintree/wrapper_braintree')->init()->generateToken();
24
- }
25
-
26
  /**
27
  * Get braintree token
28
  *
@@ -30,6 +21,10 @@ class Gene_Braintree_Block_Express_Setup extends Gene_Braintree_Block_Express_Ab
30
  */
31
  public function getToken()
32
  {
 
 
 
 
33
  return $this->_token;
34
  }
35
 
3
  /**
4
  * Class Gene_Braintree_Block_Express_Button
5
  *
6
+ * @author Aidan Threadgold <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Express_Setup extends Gene_Braintree_Block_Express_Abstract
9
  {
14
  */
15
  protected $_token = null;
16
 
 
 
 
 
 
 
 
 
 
17
  /**
18
  * Get braintree token
19
  *
21
  */
22
  public function getToken()
23
  {
24
+ if ($this->_token === null) {
25
+ $this->_token = Mage::getModel('gene_braintree/wrapper_braintree')->init()->generateToken();
26
+ }
27
+
28
  return $this->_token;
29
  }
30
 
app/code/community/Gene/Braintree/Block/Info.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Block_Info
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Info extends Mage_Payment_Block_Info
9
  {
3
  /**
4
  * Class Gene_Braintree_Block_Info
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Info extends Mage_Payment_Block_Info
9
  {
app/code/community/Gene/Braintree/Block/Js.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Block_Js
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Js extends Gene_Braintree_Block_Assets
9
  {
3
  /**
4
  * Class Gene_Braintree_Block_Js
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Js extends Gene_Braintree_Block_Assets
9
  {
app/code/community/Gene/Braintree/Block/Paypal.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Block_Form
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Paypal extends Mage_Payment_Block_Form
9
  {
3
  /**
4
  * Class Gene_Braintree_Block_Form
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Paypal extends Mage_Payment_Block_Form
9
  {
app/code/community/Gene/Braintree/Block/Paypal/Info.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Block_Info
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Paypal_Info extends Gene_Braintree_Block_Info
9
  {
3
  /**
4
  * Class Gene_Braintree_Block_Info
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Paypal_Info extends Gene_Braintree_Block_Info
9
  {
app/code/community/Gene/Braintree/Block/Paypal/Saved.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Block_Paypal_Saved
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Paypal_Saved extends Mage_Core_Block_Template
9
  {
3
  /**
4
  * Class Gene_Braintree_Block_Paypal_Saved
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Paypal_Saved extends Mage_Core_Block_Template
9
  {
app/code/community/Gene/Braintree/Block/Saved.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Block_Saved
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Saved extends Mage_Core_Block_Template
9
  {
3
  /**
4
  * Class Gene_Braintree_Block_Saved
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Saved extends Mage_Core_Block_Template
9
  {
app/code/community/Gene/Braintree/Block/Saved/Edit.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Block_Saved_Edit
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Saved_Edit extends Mage_Customer_Block_Address_Edit
9
  {
3
  /**
4
  * Class Gene_Braintree_Block_Saved_Edit
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Block_Saved_Edit extends Mage_Customer_Block_Address_Edit
9
  {
app/code/community/Gene/Braintree/Helper/Data.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Helper_Data
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Helper_Data extends Mage_Core_Helper_Abstract
9
  {
@@ -61,6 +61,9 @@ class Gene_Braintree_Helper_Data extends Mage_Core_Helper_Abstract
61
  public function convertToMagentoAddress($address)
62
  {
63
  $addressModel = Mage::getModel('customer/address');
 
 
 
64
 
65
  $addressModel->addData(array(
66
  'firstname' => $address->firstName,
@@ -164,23 +167,43 @@ class Gene_Braintree_Helper_Data extends Mage_Core_Helper_Abstract
164
  * Utilising the 'setup_required' feature in XML files, loop through and determine if setup is required based on
165
  * various modules being "available"
166
  *
 
 
167
  * @return bool
168
  */
169
- public function isSetupRequired()
170
  {
 
 
 
 
 
 
 
171
  $methodCodes = Mage::getConfig()->getNode('global/payment/setup_required')->asArray();
172
  if (is_array($methodCodes) && count($methodCodes) > 0) {
173
  foreach (array_keys($methodCodes) as $methodCode) {
174
  $methodModel = Mage::getConfig()->getNode('default/payment/' . (string) $methodCode . '/model');
175
  if ($methodModel) {
176
  $model = Mage::getModel($methodModel);
 
177
  if ($model && method_exists($model, 'isAvailable') && $model->isAvailable()) {
 
 
 
 
 
178
  return true;
179
  }
180
  }
181
  }
182
  }
183
 
 
 
 
 
 
184
  return false;
185
  }
186
 
3
  /**
4
  * Class Gene_Braintree_Helper_Data
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Helper_Data extends Mage_Core_Helper_Abstract
9
  {
61
  public function convertToMagentoAddress($address)
62
  {
63
  $addressModel = Mage::getModel('customer/address');
64
+ if (!$address) {
65
+ return $addressModel;
66
+ }
67
 
68
  $addressModel->addData(array(
69
  'firstname' => $address->firstName,
167
  * Utilising the 'setup_required' feature in XML files, loop through and determine if setup is required based on
168
  * various modules being "available"
169
  *
170
+ * @param $storeId
171
+ *
172
  * @return bool
173
  */
174
+ public function isSetupRequired($storeId = false)
175
  {
176
+ // If a store ID is specific emulate the store first
177
+ if ($storeId !== false) {
178
+ /* @var $appEmulation Mage_Core_Model_App_Emulation */
179
+ $appEmulation = Mage::getSingleton('core/app_emulation');
180
+ $initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($storeId);
181
+ }
182
+
183
  $methodCodes = Mage::getConfig()->getNode('global/payment/setup_required')->asArray();
184
  if (is_array($methodCodes) && count($methodCodes) > 0) {
185
  foreach (array_keys($methodCodes) as $methodCode) {
186
  $methodModel = Mage::getConfig()->getNode('default/payment/' . (string) $methodCode . '/model');
187
  if ($methodModel) {
188
  $model = Mage::getModel($methodModel);
189
+ $model->setIsSetupRequiredCall(true);
190
  if ($model && method_exists($model, 'isAvailable') && $model->isAvailable()) {
191
+ // Stop the app emulation is running
192
+ if (isset($appEmulation) && isset($initialEnvironmentInfo)) {
193
+ $appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);
194
+ }
195
+
196
  return true;
197
  }
198
  }
199
  }
200
  }
201
 
202
+ // Stop the app emulation is running
203
+ if (isset($appEmulation) && isset($initialEnvironmentInfo)) {
204
+ $appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);
205
+ }
206
+
207
  return false;
208
  }
209
 
app/code/community/Gene/Braintree/Model/Debug.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Model_Debug
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Debug extends Mage_Core_Model_Abstract
9
  {
3
  /**
4
  * Class Gene_Braintree_Model_Debug
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Debug extends Mage_Core_Model_Abstract
9
  {
app/code/community/Gene/Braintree/Model/Entity/Setup.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Model_Entity_Setup
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Entity_Setup extends Mage_Eav_Model_Entity_Setup
9
  {
3
  /**
4
  * Class Gene_Braintree_Model_Entity_Setup
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Entity_Setup extends Mage_Eav_Model_Entity_Setup
9
  {
app/code/community/Gene/Braintree/Model/Express/Assets.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Model_Express_Assets
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Express_Assets extends Mage_Core_Model_Abstract
9
  {
3
  /**
4
  * Class Gene_Braintree_Model_Express_Assets
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Express_Assets extends Mage_Core_Model_Abstract
9
  {
app/code/community/Gene/Braintree/Model/Kount/Ens.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Model_Kount_Ens
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Kount_Ens extends Mage_Core_Model_Abstract
9
  {
3
  /**
4
  * Class Gene_Braintree_Model_Kount_Ens
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Kount_Ens extends Mage_Core_Model_Abstract
9
  {
app/code/community/Gene/Braintree/Model/Kount/Rest.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Model_Kount_Rest
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Kount_Rest extends Mage_Core_Model_Abstract
9
  {
3
  /**
4
  * Class Gene_Braintree_Model_Kount_Rest
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Kount_Rest extends Mage_Core_Model_Abstract
9
  {
app/code/community/Gene/Braintree/Model/Migration.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Model_Migration
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Migration extends Mage_Core_Model_Abstract
9
  {
3
  /**
4
  * Class Gene_Braintree_Model_Migration
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Migration extends Mage_Core_Model_Abstract
9
  {
app/code/community/Gene/Braintree/Model/Observer.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Model_Observer
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Observer
9
  {
@@ -107,34 +107,34 @@ class Gene_Braintree_Model_Observer
107
 
108
  // Should we capture the payment in shipment?
109
  if ($this->_shouldCaptureShipment($order)) {
110
-
111
  // Check the order can be invoiced
112
- if ($order->canInvoice()) {
113
-
114
- /* @var @invoice Mage_Sales_Model_Order_Invoice */
115
- $invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();
116
-
117
- // Check the invoice has items to invoice
118
- if ($invoice->getTotalQty()) {
119
-
120
- // Set the requested capture case
121
- $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);
122
-
123
- // Register the invoice
124
- $invoice->register();
125
 
126
- // Save the transaction
127
- $transactionSave = Mage::getModel('core/resource_transaction')
128
- ->addObject($invoice)
129
- ->addObject($invoice->getOrder());
130
 
131
- // Save the transaction
132
- $transactionSave->save();
 
133
 
134
- }
 
 
 
135
 
 
 
136
  }
137
-
138
  }
139
 
140
  return $this;
@@ -191,19 +191,22 @@ class Gene_Braintree_Model_Observer
191
  {
192
  // Determine whether the compiler has been enabled
193
  if(defined('COMPILER_INCLUDE_PATH')) {
194
- $certificates = array('api_braintreegateway_com.ca.crt', 'sandbox_braintreegateway_com.ca.crt');
195
  $compilerPath = COMPILER_INCLUDE_PATH;
196
- $directory = '/ssl/';
197
 
198
  // Verify the SSL folder exists
199
- if(!is_dir($compilerPath . '/..' . $directory)) {
200
- mkdir($compilerPath . '/..' . $directory, 0777, true);
201
  }
202
 
203
  // Loop through each certificate and check whether it's in the includes directory, if not copy it!
204
  foreach($certificates as $file) {
205
- if(!file_exists($compilerPath . '/..' . $directory . $file)) {
206
- copy(Mage::getBaseDir('lib') . DS . 'Gene' . DS . $directory . $file, $compilerPath . '/..' . $directory . $file);
 
 
 
207
  }
208
  }
209
  }
3
  /**
4
  * Class Gene_Braintree_Model_Observer
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Observer
9
  {
107
 
108
  // Should we capture the payment in shipment?
109
  if ($this->_shouldCaptureShipment($order)) {
 
110
  // Check the order can be invoiced
111
+ if ($shipment->getTotalQty() && $order->canInvoice()) {
112
+ $invoiceItems = array();
113
+ /* @var $item Mage_Sales_Model_Order_Shipment_Item */
114
+ foreach ($shipment->getAllItems() as $item) {
115
+ $invoiceItems[$item->getOrderItemId()] = $item->getQty();
116
+ }
117
+ foreach ($order->getAllVisibleItems() as $item) {
118
+ if (!isset($invoiceItems[$item->getId()])) {
119
+ $invoiceItems[$item->getId()] = 0;
120
+ }
121
+ }
 
 
122
 
123
+ /* @var $invoice Mage_Sales_Model_Order_Invoice */
124
+ $invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice($invoiceItems);
 
 
125
 
126
+ // Set the requested capture case
127
+ $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);
128
+ $invoice->register();
129
 
130
+ // Save the transaction
131
+ $transactionSave = Mage::getModel('core/resource_transaction')
132
+ ->addObject($invoice)
133
+ ->addObject($invoice->getOrder());
134
 
135
+ // Save the transaction
136
+ $transactionSave->save();
137
  }
 
138
  }
139
 
140
  return $this;
191
  {
192
  // Determine whether the compiler has been enabled
193
  if(defined('COMPILER_INCLUDE_PATH')) {
194
+ $certificates = array('api_braintreegateway_com.ca.crt');
195
  $compilerPath = COMPILER_INCLUDE_PATH;
196
+ $directory = 'Braintree' . DS . 'braintree' . DS . 'braintree_php' . DS . 'lib' . DS . 'ssl' . DS;
197
 
198
  // Verify the SSL folder exists
199
+ if(!is_dir($compilerPath . DS . '..' . DS . $directory)) {
200
+ mkdir($compilerPath . DS . '..' . DS . $directory, 0777, true);
201
  }
202
 
203
  // Loop through each certificate and check whether it's in the includes directory, if not copy it!
204
  foreach($certificates as $file) {
205
+ if(!file_exists($compilerPath . DS . '..' . DS . $directory . $file)) {
206
+ copy(
207
+ Mage::getBaseDir('lib') . DS . 'Gene' . DS . $directory . $file,
208
+ $compilerPath . DS . '..' . DS . $directory . $file
209
+ );
210
  }
211
  }
212
  }
app/code/community/Gene/Braintree/Model/Paymentmethod/Abstract.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Model_Paymentmethod_Abstract
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  abstract class Gene_Braintree_Model_Paymentmethod_Abstract extends Mage_Payment_Model_Method_Abstract
9
  {
3
  /**
4
  * Class Gene_Braintree_Model_Paymentmethod_Abstract
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  abstract class Gene_Braintree_Model_Paymentmethod_Abstract extends Mage_Payment_Model_Method_Abstract
9
  {
app/code/community/Gene/Braintree/Model/Paymentmethod/Creditcard.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Model_Paymentmethod_Creditcard
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Paymentmethod_Creditcard extends Gene_Braintree_Model_Paymentmethod_Abstract
9
  {
@@ -149,6 +149,20 @@ class Gene_Braintree_Model_Paymentmethod_Creditcard extends Gene_Braintree_Model
149
  return ($result == 1 ? true : false);
150
  }
151
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  /**
153
  * Should we save this method in the database?
154
  *
@@ -278,6 +292,12 @@ class Gene_Braintree_Model_Paymentmethod_Creditcard extends Gene_Braintree_Model
278
  $this->_is3DEnabled()
279
  );
280
 
 
 
 
 
 
 
281
  // Attempt to create the sale
282
  $result = $this->_getWrapper()->makeSale(
283
  $this->_dispatchSaleArrayEvent('gene_braintree_creditcard_sale_array', $saleArray, $payment)
3
  /**
4
  * Class Gene_Braintree_Model_Paymentmethod_Creditcard
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Paymentmethod_Creditcard extends Gene_Braintree_Model_Paymentmethod_Abstract
9
  {
149
  return ($result == 1 ? true : false);
150
  }
151
 
152
+ /**
153
+ * Skip advanced fraud on this order
154
+ *
155
+ * @return bool
156
+ */
157
+ protected function _skipAdvancedFraudChecking()
158
+ {
159
+ if (Mage::app()->getStore()->isAdmin() && $this->_getConfig('skip_advanced_fraud_checking')) {
160
+ return true;
161
+ }
162
+
163
+ return false;
164
+ }
165
+
166
  /**
167
  * Should we save this method in the database?
168
  *
292
  $this->_is3DEnabled()
293
  );
294
 
295
+ // If in the admin and we want to skip advanced fraud checks.
296
+ // @see https://developers.braintreepayments.com/reference/request/transaction/sale/php#options.skip_advanced_fraud_checking
297
+ if ($this->_skipAdvancedFraudChecking()) {
298
+ $saleArray['options']['skipAdvancedFraudChecking'] = true;
299
+ }
300
+
301
  // Attempt to create the sale
302
  $result = $this->_getWrapper()->makeSale(
303
  $this->_dispatchSaleArrayEvent('gene_braintree_creditcard_sale_array', $saleArray, $payment)
app/code/community/Gene/Braintree/Model/Paymentmethod/Legacy/Creditcard.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Model_Paymentmethod_Legacy_Creditcard
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Paymentmethod_Legacy_Creditcard extends Gene_Braintree_Model_Paymentmethod_Creditcard
9
  {
3
  /**
4
  * Class Gene_Braintree_Model_Paymentmethod_Legacy_Creditcard
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Paymentmethod_Legacy_Creditcard extends Gene_Braintree_Model_Paymentmethod_Creditcard
9
  {
app/code/community/Gene/Braintree/Model/Paymentmethod/Legacy/Paypal.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Model_Paymentmethod_Legacy_Paypal
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Paymentmethod_Legacy_Paypal extends Gene_Braintree_Model_Paymentmethod_Paypal
9
  {
3
  /**
4
  * Class Gene_Braintree_Model_Paymentmethod_Legacy_Paypal
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Paymentmethod_Legacy_Paypal extends Gene_Braintree_Model_Paymentmethod_Paypal
9
  {
app/code/community/Gene/Braintree/Model/Paymentmethod/Paypal.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Model_Paymentmethod_Paypal
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Paymentmethod_Paypal extends Gene_Braintree_Model_Paymentmethod_Abstract
9
  {
3
  /**
4
  * Class Gene_Braintree_Model_Paymentmethod_Paypal
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Paymentmethod_Paypal extends Gene_Braintree_Model_Paymentmethod_Abstract
9
  {
app/code/community/Gene/Braintree/Model/Saved.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Class Gene_Braintree_Model_Saved
4
  *
5
- * @author Dave Macaulay <dave@gene.co.uk>
6
  */
7
  class Gene_Braintree_Model_Saved extends Mage_Core_Model_Abstract
8
  {
2
  /**
3
  * Class Gene_Braintree_Model_Saved
4
  *
5
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
6
  */
7
  class Gene_Braintree_Model_Saved extends Mage_Core_Model_Abstract
8
  {
app/code/community/Gene/Braintree/Model/Source/Cctype.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Model_Source_Cctype
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Source_Cctype extends Mage_Payment_Model_Source_Cctype
9
  {
3
  /**
4
  * Class Gene_Braintree_Model_Source_Cctype
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Source_Cctype extends Mage_Payment_Model_Source_Cctype
9
  {
app/code/community/Gene/Braintree/Model/Source/Creditcard/CaptureAction.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Model_Source_Creditcard_CaptureAction
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Source_Creditcard_CaptureAction
9
  {
3
  /**
4
  * Class Gene_Braintree_Model_Source_Creditcard_CaptureAction
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Source_Creditcard_CaptureAction
9
  {
app/code/community/Gene/Braintree/Model/Source/Creditcard/FormIntegration.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Model_Source_Creditcard_FormIntegration
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Source_Creditcard_FormIntegration
9
  {
3
  /**
4
  * Class Gene_Braintree_Model_Source_Creditcard_FormIntegration
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Source_Creditcard_FormIntegration
9
  {
app/code/community/Gene/Braintree/Model/Source/Creditcard/PaymentAction.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Model_Source_Creditcard_PaymentAction
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Source_Creditcard_PaymentAction
9
  {
3
  /**
4
  * Class Gene_Braintree_Model_Source_Creditcard_PaymentAction
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Source_Creditcard_PaymentAction
9
  {
app/code/community/Gene/Braintree/Model/Source/Environment.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Braintree_Payments_Model_Source_Environment
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Source_Environment
9
  {
3
  /**
4
  * Class Braintree_Payments_Model_Source_Environment
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Source_Environment
9
  {
app/code/community/Gene/Braintree/Model/Source/Paypal/CaptureAction.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Model_Source_Creditcard_CaptureAction
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Source_Paypal_CaptureAction
9
  {
3
  /**
4
  * Class Gene_Braintree_Model_Source_Creditcard_CaptureAction
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Source_Paypal_CaptureAction
9
  {
app/code/community/Gene/Braintree/Model/Source/Paypal/Locale.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  /**
4
  * Class Gene_Braintree_Model_Source_Paypal_Locale
5
- * @author Dave Macaulay <dave@gene.co.uk>
6
  */
7
  class Gene_Braintree_Model_Source_Paypal_Locale
8
  {
2
 
3
  /**
4
  * Class Gene_Braintree_Model_Source_Paypal_Locale
5
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
6
  */
7
  class Gene_Braintree_Model_Source_Paypal_Locale
8
  {
app/code/community/Gene/Braintree/Model/Source/Paypal/Paymenttype.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Model_Source_Paypal_Paymenttype
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Source_Paypal_Paymenttype
9
  {
3
  /**
4
  * Class Gene_Braintree_Model_Source_Paypal_Paymenttype
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Source_Paypal_Paymenttype
9
  {
app/code/community/Gene/Braintree/Model/System/Config/Backend/Currency.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Model_System_Config_Backend_Currency
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_System_Config_Backend_Currency extends Mage_Core_Model_Config_Data
9
  {
3
  /**
4
  * Class Gene_Braintree_Model_System_Config_Backend_Currency
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_System_Config_Backend_Currency extends Mage_Core_Model_Config_Data
9
  {
app/code/community/Gene/Braintree/Model/System/Config/Source/Payment/Liabilityaction.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Model_System_Config_Source_Payment_Liabilityaction
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_System_Config_Source_Payment_Liabilityaction
9
  {
3
  /**
4
  * Class Gene_Braintree_Model_System_Config_Source_Payment_Liabilityaction
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_System_Config_Source_Payment_Liabilityaction
9
  {
app/code/community/Gene/Braintree/Model/System/Config/Source/Payment/Threedsecurecountries.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Model_System_Config_Source_Payment_Threedsecurecountries
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_System_Config_Source_Payment_Threedsecurecountries
9
  {
3
  /**
4
  * Class Gene_Braintree_Model_System_Config_Source_Payment_Threedsecurecountries
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_System_Config_Source_Payment_Threedsecurecountries
9
  {
app/code/community/Gene/Braintree/Model/Wrapper/Braintree.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Model_Wrapper_Braintree
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
9
  {
3
  /**
4
  * Class Gene_Braintree_Model_Wrapper_Braintree
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
9
  {
app/code/community/Gene/Braintree/controllers/Adminhtml/Braintree/MigrationController.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Adminhtml_Braintree_MigrationController
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Adminhtml_Braintree_MigrationController extends Mage_Adminhtml_Controller_Action
9
  {
3
  /**
4
  * Class Gene_Braintree_Adminhtml_Braintree_MigrationController
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Adminhtml_Braintree_MigrationController extends Mage_Adminhtml_Controller_Action
9
  {
app/code/community/Gene/Braintree/controllers/Adminhtml/BraintreeController.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Adminhtml_BraintreeController
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Adminhtml_BraintreeController extends Mage_Adminhtml_Controller_Action
9
  {
3
  /**
4
  * Class Gene_Braintree_Adminhtml_BraintreeController
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Adminhtml_BraintreeController extends Mage_Adminhtml_Controller_Action
9
  {
app/code/community/Gene/Braintree/controllers/CheckoutController.php CHANGED
@@ -3,10 +3,30 @@
3
  /**
4
  * Class Gene_Braintree_CheckoutController
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_CheckoutController extends Mage_Core_Controller_Front_Action
9
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  /**
11
  * The front-end is requesting the grand total of the quote
12
  *
3
  /**
4
  * Class Gene_Braintree_CheckoutController
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_CheckoutController extends Mage_Core_Controller_Front_Action
9
  {
10
+ /**
11
+ * Return a client token to the browser
12
+ *
13
+ * @return \Gene_Braintree_CheckoutController
14
+ */
15
+ public function clientTokenAction()
16
+ {
17
+ try {
18
+ return $this->_returnJson(array(
19
+ 'success' => true,
20
+ 'client_token' => Mage::getSingleton('gene_braintree/wrapper_braintree')->init()->generateToken()
21
+ ));
22
+ } catch (Exception $e) {
23
+ return $this->_returnJson(array(
24
+ 'success' => false,
25
+ 'error' => $e->getMessage()
26
+ ));
27
+ }
28
+ }
29
+
30
  /**
31
  * The front-end is requesting the grand total of the quote
32
  *
app/code/community/Gene/Braintree/controllers/ExpressController.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_ExpressController
5
  *
6
- * @author Aidan Threadgold <aidan@gene.co.uk> & Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_ExpressController extends Mage_Core_Controller_Front_Action
9
  {
@@ -175,20 +175,13 @@ class Gene_Braintree_ExpressController extends Mage_Core_Controller_Front_Action
175
  ->setCity($paypalData['shippingAddress']['city'])
176
  ->setCountryId($paypalData['shippingAddress']['countryCode'])
177
  ->setPostcode($paypalData['shippingAddress']['postalCode'])
178
- ->setTelephone('0000000000');
179
 
180
- // Check if the region is needed
181
- if (Mage::helper('directory')->isRegionRequired($address->getCountryId())) {
182
- $region = Mage::getModel('directory/region')->loadbyCode($paypalData['shippingAddress']['state'], $address->getCountryId());
183
- $regionId = $region->getRegionId();
184
-
185
- if (empty($regionId)) {
186
- Mage::getSingleton('core/session')->addError(Mage::helper('gene_braintree')->__('We were unable to process the country.'));
187
-
188
- return $this->_redirect("braintree/express/error");
189
  }
190
-
191
- $address->setRegionId($region->getRegionId());
192
  }
193
 
194
  // Save the addresses
@@ -203,6 +196,34 @@ class Gene_Braintree_ExpressController extends Mage_Core_Controller_Front_Action
203
  return $this->_redirect("braintree/express/shipping");
204
  }
205
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
206
  /**
207
  * Display shipping methods for the user to select.
208
  *
3
  /**
4
  * Class Gene_Braintree_ExpressController
5
  *
6
+ * @author Aidan Threadgold <braintreesupport@gene.co.uk> & Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_ExpressController extends Mage_Core_Controller_Front_Action
9
  {
175
  ->setCity($paypalData['shippingAddress']['city'])
176
  ->setCountryId($paypalData['shippingAddress']['countryCode'])
177
  ->setPostcode($paypalData['shippingAddress']['postalCode'])
178
+ ->setTelephone(isset($paypalData['phone']) ? $paypalData['phone'] : '00000000000');
179
 
180
+ // Determine if a region is required for the selected country
181
+ if (Mage::helper('directory')->isRegionRequired($address->getCountryId()) && isset($paypalData['shippingAddress']['state'])) {
182
+ if ($regionId = $this->getRegionId($address, $paypalData['shippingAddress']['state'])) {
183
+ $address->setRegionId($regionId);
 
 
 
 
 
184
  }
 
 
185
  }
186
 
187
  // Save the addresses
196
  return $this->_redirect("braintree/express/shipping");
197
  }
198
 
199
+ /**
200
+ * Retrieve the region_id based on various items
201
+ *
202
+ * @param $address
203
+ * @param $regionId
204
+ *
205
+ * @return bool|mixed
206
+ */
207
+ protected function getRegionId($address, $regionId)
208
+ {
209
+ $region = Mage::getResourceModel('directory/region_collection')
210
+ ->addFieldToFilter('country_id', $address->getCountryId())
211
+ ->addFieldToFilter(
212
+ array('code', 'default_name'),
213
+ array(
214
+ array('eq' => $regionId),
215
+ array('eq' => $regionId)
216
+ )
217
+ );
218
+
219
+ // Check we have a region
220
+ if ($region->count() >= 1) {
221
+ return $region->getFirstItem()->getId();
222
+ }
223
+
224
+ return false;
225
+ }
226
+
227
  /**
228
  * Display shipping methods for the user to select.
229
  *
app/code/community/Gene/Braintree/controllers/Kount/EnsController.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_Kount_EnsController
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_Kount_EnsController extends Mage_Core_Controller_Front_Action
9
  {
3
  /**
4
  * Class Gene_Braintree_Kount_EnsController
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_Kount_EnsController extends Mage_Core_Controller_Front_Action
9
  {
app/code/community/Gene/Braintree/controllers/SavedController.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Class Gene_Braintree_SavedController
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  class Gene_Braintree_SavedController extends Mage_Core_Controller_Front_Action
9
  {
3
  /**
4
  * Class Gene_Braintree_SavedController
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  class Gene_Braintree_SavedController extends Mage_Core_Controller_Front_Action
9
  {
app/code/community/Gene/Braintree/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Gene_Braintree>
5
- <version>2.1.7</version>
6
  </Gene_Braintree>
7
  </modules>
8
  <global>
@@ -126,6 +126,7 @@
126
  <environment>sandbox</environment>
127
  <allowspecific>0</allowspecific>
128
  <form_integration>hosted</form_integration>
 
129
  <use_vault>0</use_vault>
130
  <threedsecure>0</threedsecure>
131
  <threedsecure_failed_liability>1</threedsecure_failed_liability>
2
  <config>
3
  <modules>
4
  <Gene_Braintree>
5
+ <version>2.2.0</version>
6
  </Gene_Braintree>
7
  </modules>
8
  <global>
126
  <environment>sandbox</environment>
127
  <allowspecific>0</allowspecific>
128
  <form_integration>hosted</form_integration>
129
+ <disable_auto_formatting>0</disable_auto_formatting>
130
  <use_vault>0</use_vault>
131
  <threedsecure>0</threedsecure>
132
  <threedsecure_failed_liability>1</threedsecure_failed_liability>
app/code/community/Gene/Braintree/etc/system.xml CHANGED
@@ -11,7 +11,7 @@
11
  <show_in_store>1</show_in_store>
12
  <comment><![CDATA[
13
  <div class="braintree-logos" style="float: left;width: 100%;margin: 8px 0 24px 0;">
14
- <img src="https://www.braintreepayments.com/images/bt-logo-black-d9116046.png" height="36" style="display: inline-block; vertical-align: middle;" border="0" />
15
  <div style="display: inline-block;padding: 0 14px;vertical-align: middle;opacity: 0.7;">by</div>
16
  <a href="http://gene.co.uk/" title="Gene Commerce" target="_blank"><img src="https://i.imgur.com/OAXtYNg.png" style="display: inline-block;vertical-align: middle;" height="36" /></a>
17
  </div>
@@ -553,7 +553,7 @@
553
  <show_in_store>1</show_in_store>
554
  <comment>
555
  <![CDATA[
556
- <img src="https://www.braintreepayments.com/images/bt-logo-black-d9116046.png" height="30" style="margin-top: 6px; display: inline-block; vertical-align: middle;" border="0" /><br />
557
  <img src="https://s3-us-west-1.amazonaws.com/bt-partner-assets/payment-method-cards.png" style="margin: 12px 0 10px 0;" alt="Accept Visa, Mastercard, Discover, and American Express payments" width="140"><br />
558
  You must first configure the <strong>Braintree Payments - Configuration</strong> section with your Braintree account details.
559
  ]]>
@@ -744,21 +744,6 @@
744
  <show_in_store>0</show_in_store>
745
  </specificcountry>
746
 
747
- <!-- @todo to be included in a future release -->
748
- <!--<dynamic_descriptors translate="label comment">-->
749
- <!--<label>Dynamic Descriptors</label>-->
750
- <!--<frontend_type>select</frontend_type>-->
751
- <!--<source_model>adminhtml/system_config_source_yesno</source_model>-->
752
- <!--<sort_order>100</sort_order>-->
753
- <!--<show_in_default>1</show_in_default>-->
754
- <!--<show_in_website>1</show_in_website>-->
755
- <!--<show_in_store>0</show_in_store>-->
756
- <!--<comment><![CDATA[-->
757
- <!--Dyanmic descriptors allow you to modify the entry shown on the customers statement. This will include the company name, company phone number and the company URL.<br />-->
758
- <!--<strong>Note:</strong> You must have this enabled on your account, you can find out more information <a href="https://developers.braintreepayments.com/javascript+php/sdk/server/transaction-processing/dynamic-descriptors">here</a>.-->
759
- <!--]]></comment>-->
760
- <!--</dynamic_descriptors>-->
761
-
762
  <threedsecure_heading translate="label">
763
  <label>3D Secure</label>
764
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
@@ -772,7 +757,7 @@
772
  <label>Enable 3D Secure</label>
773
  <frontend_type>select</frontend_type>
774
  <source_model>adminhtml/system_config_source_yesno</source_model>
775
- <sort_order>100</sort_order>
776
  <show_in_default>1</show_in_default>
777
  <show_in_website>1</show_in_website>
778
  <show_in_store>1</show_in_store>
@@ -785,13 +770,13 @@
785
  <label>Failed Liability Shift Action</label>
786
  <frontend_type>select</frontend_type>
787
  <source_model>gene_braintree/system_config_source_payment_liabilityaction</source_model>
788
- <sort_order>101</sort_order>
789
  <show_in_default>1</show_in_default>
790
  <show_in_website>1</show_in_website>
791
  <show_in_store>1</show_in_store>
792
  <comment><![CDATA[
793
  Action to complete if the liability shift fails after the 3D secure. If the liability cannot be shifted the merchant is liable for charge backs.<br />
794
- <strong>Request Alternative Payment Method</strong> - Block the payment and inform the customer to choose a different payment method.<br />
795
  <strong>Accept & Mark as Fraud</strong> - Will accept the payment but mark as fraudulent within Magento for manual inspection.<br />
796
  <strong>Accept</strong> - Will accept the payment and be processed as a normal order (this setting is not recommended).
797
  ]]></comment>
@@ -891,6 +876,19 @@
891
  ]]></comment>
892
  </kount_api_key>
893
 
 
 
 
 
 
 
 
 
 
 
 
 
 
894
  <kount_ens_url translate="label comment">
895
  <label>Event Notification System (ENS) URL</label>
896
  <frontend_type>text</frontend_type>
11
  <show_in_store>1</show_in_store>
12
  <comment><![CDATA[
13
  <div class="braintree-logos" style="float: left;width: 100%;margin: 8px 0 24px 0;">
14
+ <img src="https://www.braintreepayments.com/images/bt-logo-black-2dc4ba9a.png" height="36" style="display: inline-block; vertical-align: middle;" border="0" />
15
  <div style="display: inline-block;padding: 0 14px;vertical-align: middle;opacity: 0.7;">by</div>
16
  <a href="http://gene.co.uk/" title="Gene Commerce" target="_blank"><img src="https://i.imgur.com/OAXtYNg.png" style="display: inline-block;vertical-align: middle;" height="36" /></a>
17
  </div>
553
  <show_in_store>1</show_in_store>
554
  <comment>
555
  <![CDATA[
556
+ <img src="https://www.braintreepayments.com/images/bt-logo-black-2dc4ba9a.png" height="30" style="margin-top: 6px; display: inline-block; vertical-align: middle;" border="0" /><br />
557
  <img src="https://s3-us-west-1.amazonaws.com/bt-partner-assets/payment-method-cards.png" style="margin: 12px 0 10px 0;" alt="Accept Visa, Mastercard, Discover, and American Express payments" width="140"><br />
558
  You must first configure the <strong>Braintree Payments - Configuration</strong> section with your Braintree account details.
559
  ]]>
744
  <show_in_store>0</show_in_store>
745
  </specificcountry>
746
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
747
  <threedsecure_heading translate="label">
748
  <label>3D Secure</label>
749
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
757
  <label>Enable 3D Secure</label>
758
  <frontend_type>select</frontend_type>
759
  <source_model>adminhtml/system_config_source_yesno</source_model>
760
+ <sort_order>101</sort_order>
761
  <show_in_default>1</show_in_default>
762
  <show_in_website>1</show_in_website>
763
  <show_in_store>1</show_in_store>
770
  <label>Failed Liability Shift Action</label>
771
  <frontend_type>select</frontend_type>
772
  <source_model>gene_braintree/system_config_source_payment_liabilityaction</source_model>
773
+ <sort_order>102</sort_order>
774
  <show_in_default>1</show_in_default>
775
  <show_in_website>1</show_in_website>
776
  <show_in_store>1</show_in_store>
777
  <comment><![CDATA[
778
  Action to complete if the liability shift fails after the 3D secure. If the liability cannot be shifted the merchant is liable for charge backs.<br />
779
+ <strong>Request Alternative Payment Method</strong> - Block the payment and inform the customer to choose a different payment method. This will also block any cards that do not support 3DSecure.<br />
780
  <strong>Accept & Mark as Fraud</strong> - Will accept the payment but mark as fraudulent within Magento for manual inspection.<br />
781
  <strong>Accept</strong> - Will accept the payment and be processed as a normal order (this setting is not recommended).
782
  ]]></comment>
876
  ]]></comment>
877
  </kount_api_key>
878
 
879
+ <skip_advanced_fraud_checking translate="label comment">
880
+ <label>Skip Advanced Fraud Checks on Admin Orders</label>
881
+ <frontend_type>select</frontend_type>
882
+ <source_model>adminhtml/system_config_source_yesno</source_model>
883
+ <sort_order>136</sort_order>
884
+ <show_in_default>1</show_in_default>
885
+ <show_in_website>1</show_in_website>
886
+ <show_in_store>1</show_in_store>
887
+ <comment><![CDATA[
888
+ Prevents the transaction from being sent to Kount for evaluation as part of Advanced Fraud Tools checks, on orders placed through the admin only.
889
+ ]]></comment>
890
+ </skip_advanced_fraud_checking>
891
+
892
  <kount_ens_url translate="label comment">
893
  <label>Event Notification System (ENS) URL</label>
894
  <frontend_type>text</frontend_type>
app/design/adminhtml/default/default/layout/gene/braintree.xml CHANGED
@@ -22,7 +22,15 @@
22
  </reference>
23
  <reference name="js">
24
  <!-- Include all Braintree assets through a dynamic block -->
25
- <block type="gene_braintree/assets" name="gene.braintree.head.assets" template="gene/braintree/assets.phtml" after="-" />
 
 
 
 
 
 
 
 
26
  </reference>
27
  <reference name="before_body_end">
28
  <block type="gene_braintree/js" name="gene_braintree_js" template="gene/braintree/js.phtml" />
22
  </reference>
23
  <reference name="js">
24
  <!-- Include all Braintree assets through a dynamic block -->
25
+ <block type="gene_braintree/assets" name="gene.braintree.head.assets" template="gene/braintree/assets.phtml" after="-">
26
+ <action method="addExternalJs"><url>https://js.braintreegateway.com/web/{SDK_VERSION}/js/client.min.js</url></action>
27
+ <action method="addExternalJs"><url>https://js.braintreegateway.com/web/{SDK_VERSION}/js/hosted-fields.min.js</url></action>
28
+ <action method="addExternalJs"><url>https://js.braintreegateway.com/web/{SDK_VERSION}/js/three-d-secure.min.js</url></action>
29
+ <action method="addExternalJs"><url>https://js.braintreegateway.com/web/{SDK_VERSION}/js/data-collector.min.js</url></action>
30
+ <action method="addJs"><url>gene/braintree/{MODULE_VERSION}/vzero-min.js</url></action>
31
+ <action method="addJs"><url>gene/braintree/{MODULE_VERSION}/vzero-paypal-min.js</url></action>
32
+ <action method="addJs"><url>gene/braintree/{MODULE_VERSION}/vzero-integration-min.js</url></action>
33
+ </block>
34
  </reference>
35
  <reference name="before_body_end">
36
  <block type="gene_braintree/js" name="gene_braintree_js" template="gene/braintree/js.phtml" />
app/design/adminhtml/default/default/template/gene/braintree/assets.phtml CHANGED
@@ -1,15 +1,10 @@
1
  <?php
2
  /* @var $this Gene_Braintree_Block_Assets */
3
  ?>
4
- <!-- Braintree External SDK -->
5
- <script src="https://js.braintreegateway.com/web/3.6.0/js/client.min.js"></script>
6
- <script src="https://js.braintreegateway.com/web/3.6.0/js/hosted-fields.min.js"></script>
7
- <script src="https://js.braintreegateway.com/web/3.6.0/js/three-d-secure.min.js"></script>
8
- <script src="https://js.braintreegateway.com/web/3.6.0/js/paypal.min.js"></script>
9
- <script src="https://js.braintreegateway.com/web/3.6.0/js/data-collector.min.js"></script>
10
-
11
- <!-- Internal SDK Magento Interfaces -->
12
- <?php /* {VERSION} is replaced with the current version of the Braintree module */ ?>
13
- <script src="<?php echo $this->getJsUrl('gene/braintree/{VERSION}/vzero-min.js'); ?>"></script>
14
- <script src="<?php echo $this->getJsUrl('gene/braintree/{VERSION}/vzero-paypal-min.js'); ?>"></script>
15
- <script src="<?php echo $this->getJsUrl('gene/braintree/{VERSION}/vzero-integration-min.js'); ?>"></script>
1
  <?php
2
  /* @var $this Gene_Braintree_Block_Assets */
3
  ?>
4
+ <!-- Gene_Braintree (<?php echo base64_encode($this->getModuleVersion()); ?>) -->
5
+ <?php foreach ($this->getExternalJs() as $js) : ?>
6
+ <script src="<?php echo $this->getJsUrl($js); ?>"></script>
7
+ <?php endforeach; ?>
8
+ <?php foreach ($this->getJs() as $js) : ?>
9
+ <script src="<?php echo $this->getJsUrl($js); ?>"></script>
10
+ <?php endforeach; ?>
 
 
 
 
 
app/design/adminhtml/default/default/template/gene/braintree/js.phtml CHANGED
@@ -3,11 +3,14 @@
3
  // Pass some data over to vZero integration JS
4
  var vzero = new vZero(
5
  'gene_braintree_creditcard',
6
- '<?php echo $this->getClientToken(); ?>',
7
  false,
8
  true,
9
  ['order-billing_address_firstname', 'order-billing_address_lastname'],
10
- ['order-billing_address_postcode']
 
 
 
11
  );
12
 
13
  // Pass the supported card types over to the front-end
3
  // Pass some data over to vZero integration JS
4
  var vzero = new vZero(
5
  'gene_braintree_creditcard',
6
+ false,
7
  false,
8
  true,
9
  ['order-billing_address_firstname', 'order-billing_address_lastname'],
10
+ ['order-billing_address_postcode'],
11
+ false,
12
+ false,
13
+ '<?php echo Mage::getUrl('braintree/checkout/clientToken', array('_secure' => Mage::app()->getFrontController()->getRequest()->isSecure())); ?>'
14
  );
15
 
16
  // Pass the supported card types over to the front-end
app/design/frontend/base/default/layout/gene/braintree.xml CHANGED
@@ -1,12 +1,26 @@
1
  <?xml version="1.0"?>
2
  <layout version="0.1.0">
3
 
 
 
 
 
 
 
 
4
  <!-- All checkout integrations must include this as a handle -->
5
  <gene_braintree_assets>
 
 
 
 
 
 
 
 
 
 
6
  <reference name="head">
7
- <!-- Include all Braintree assets through a dynamic block -->
8
- <block type="gene_braintree/assets" name="gene.braintree.head.assets" template="gene/braintree/assets.phtml" after="-" />
9
-
10
  <!-- If Braintree_Payments is enabled remove their JS -->
11
  <action method="removeItem"><type>js</type><name>braintree/braintree-1.3.4.js</name></action>
12
  </reference>
@@ -228,9 +242,12 @@
228
  <!-- Express Checkout through product pages -->
229
  <catalog_product_view>
230
  <update handle="gene_braintree_assets" />
 
 
 
 
 
231
  <reference name="head">
232
- <action method="addJs"><file>gene/braintree/2.1.7/express/abstract-min.js</file></action>
233
- <action method="addJs"><file>gene/braintree/2.1.7/express/paypal-min.js</file></action>
234
  <action method="addCss"><file>css/gene/braintree/default.css</file></action>
235
  <action method="addCss"><file>css/gene/braintree/express.css</file></action>
236
  </reference>
@@ -250,9 +267,12 @@
250
  <!-- Express checkout through the cart page -->
251
  <checkout_cart_index>
252
  <update handle="gene_braintree_assets" />
 
 
 
 
 
253
  <reference name="head">
254
- <action method="addJs"><file>gene/braintree/2.1.7/express/abstract-min.js</file></action>
255
- <action method="addJs"><file>gene/braintree/2.1.7/express/paypal-min.js</file></action>
256
  <action method="addCss"><file>css/gene/braintree/default.css</file></action>
257
  <action method="addCss"><file>css/gene/braintree/express.css</file></action>
258
  </reference>
1
  <?xml version="1.0"?>
2
  <layout version="0.1.0">
3
 
4
+ <!-- Include our empty assets block in the head -->
5
+ <default>
6
+ <reference name="head">
7
+ <block type="gene_braintree/assets" name="gene.braintree.head.assets" as="braintree.assets" template="gene/braintree/assets.phtml" after="-" />
8
+ </reference>
9
+ </default>
10
+
11
  <!-- All checkout integrations must include this as a handle -->
12
  <gene_braintree_assets>
13
+ <reference name="gene.braintree.head.assets">
14
+ <action method="addExternalJs"><url>https://js.braintreegateway.com/web/{SDK_VERSION}/js/client.min.js</url></action>
15
+ <action method="addExternalJs"><url>https://js.braintreegateway.com/web/{SDK_VERSION}/js/hosted-fields.min.js</url></action>
16
+ <action method="addExternalJs"><url>https://js.braintreegateway.com/web/{SDK_VERSION}/js/three-d-secure.min.js</url></action>
17
+ <action method="addExternalJs"><url>https://js.braintreegateway.com/web/{SDK_VERSION}/js/paypal.min.js</url></action>
18
+ <action method="addExternalJs"><url>https://js.braintreegateway.com/web/{SDK_VERSION}/js/data-collector.min.js</url></action>
19
+ <action method="addJs"><url>gene/braintree/{MODULE_VERSION}/vzero-min.js</url></action>
20
+ <action method="addJs"><url>gene/braintree/{MODULE_VERSION}/vzero-paypal-min.js</url></action>
21
+ <action method="addJs"><url>gene/braintree/{MODULE_VERSION}/vzero-integration-min.js</url></action>
22
+ </reference>
23
  <reference name="head">
 
 
 
24
  <!-- If Braintree_Payments is enabled remove their JS -->
25
  <action method="removeItem"><type>js</type><name>braintree/braintree-1.3.4.js</name></action>
26
  </reference>
242
  <!-- Express Checkout through product pages -->
243
  <catalog_product_view>
244
  <update handle="gene_braintree_assets" />
245
+ <reference name="gene.braintree.head.assets">
246
+ <!-- Instruct the asset block to include our Express assets -->
247
+ <action method="addJs"><url>gene/braintree/{MODULE_VERSION}/express/abstract-min.js</url></action>
248
+ <action method="addJs"><url>gene/braintree/{MODULE_VERSION}/express/paypal-min.js</url></action>
249
+ </reference>
250
  <reference name="head">
 
 
251
  <action method="addCss"><file>css/gene/braintree/default.css</file></action>
252
  <action method="addCss"><file>css/gene/braintree/express.css</file></action>
253
  </reference>
267
  <!-- Express checkout through the cart page -->
268
  <checkout_cart_index>
269
  <update handle="gene_braintree_assets" />
270
+ <reference name="gene.braintree.head.assets">
271
+ <!-- Instruct the asset block to include our Express assets -->
272
+ <action method="addJs"><url>gene/braintree/{MODULE_VERSION}/express/abstract-min.js</url></action>
273
+ <action method="addJs"><url>gene/braintree/{MODULE_VERSION}/express/paypal-min.js</url></action>
274
+ </reference>
275
  <reference name="head">
 
 
276
  <action method="addCss"><file>css/gene/braintree/default.css</file></action>
277
  <action method="addCss"><file>css/gene/braintree/express.css</file></action>
278
  </reference>
app/design/frontend/base/default/template/gene/braintree/assets.phtml CHANGED
@@ -1,15 +1,10 @@
1
  <?php
2
  /* @var $this Gene_Braintree_Block_Assets */
3
  ?>
4
- <!-- Braintree External SDK -->
5
- <script src="https://js.braintreegateway.com/web/3.6.0/js/client.min.js"></script>
6
- <script src="https://js.braintreegateway.com/web/3.6.0/js/hosted-fields.min.js"></script>
7
- <script src="https://js.braintreegateway.com/web/3.6.0/js/three-d-secure.min.js"></script>
8
- <script src="https://js.braintreegateway.com/web/3.6.0/js/paypal.min.js"></script>
9
- <script src="https://js.braintreegateway.com/web/3.6.0/js/data-collector.min.js"></script>
10
-
11
- <!-- Internal SDK Magento Interfaces -->
12
- <?php /* {VERSION} is replaced with the current version of the Braintree module */ ?>
13
- <script src="<?php echo $this->getJsUrl('gene/braintree/{VERSION}/vzero-min.js'); ?>"></script>
14
- <script src="<?php echo $this->getJsUrl('gene/braintree/{VERSION}/vzero-paypal-min.js'); ?>"></script>
15
- <script src="<?php echo $this->getJsUrl('gene/braintree/{VERSION}/vzero-integration-min.js'); ?>"></script>
1
  <?php
2
  /* @var $this Gene_Braintree_Block_Assets */
3
  ?>
4
+ <!-- Gene_Braintree (<?php echo base64_encode($this->getModuleVersion()); ?>) -->
5
+ <?php foreach ($this->getExternalJs() as $js) : ?>
6
+ <script src="<?php echo $this->getJsUrl($js); ?>"></script>
7
+ <?php endforeach; ?>
8
+ <?php foreach ($this->getJs() as $js) : ?>
9
+ <script src="<?php echo $this->getJsUrl($js); ?>"></script>
10
+ <?php endforeach; ?>
 
 
 
 
 
app/design/frontend/base/default/template/gene/braintree/express/cart.phtml CHANGED
@@ -19,11 +19,12 @@ if (!$this->isEnabledCart()) {
19
  (function () {
20
  document.observe("dom:loaded", function() {
21
  var express = new BraintreePayPalExpress(
22
- '<?php echo $this->getToken(); ?>',
23
  '<?php echo Mage::app()->getStore()->getFrontendName(); ?>',
24
  '<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>',
25
  'cart',
26
  {
 
27
  authUrl: '<?php echo $this->getUrl('braintree/express/authorization') ?>',
28
  shippingSaveUrl:'<?php echo $this->getUrl('braintree/express/saveShipping') ?>',
29
  couponSaveUrl: '<?php echo $this->getUrl('braintree/express/saveCoupon') ?>',
19
  (function () {
20
  document.observe("dom:loaded", function() {
21
  var express = new BraintreePayPalExpress(
22
+ false,
23
  '<?php echo Mage::app()->getStore()->getFrontendName(); ?>',
24
  '<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>',
25
  'cart',
26
  {
27
+ clientTokenUrl: '<?php echo $this->getUrl('braintree/checkout/clientToken') ?>',
28
  authUrl: '<?php echo $this->getUrl('braintree/express/authorization') ?>',
29
  shippingSaveUrl:'<?php echo $this->getUrl('braintree/express/saveShipping') ?>',
30
  couponSaveUrl: '<?php echo $this->getUrl('braintree/express/saveCoupon') ?>',
app/design/frontend/base/default/template/gene/braintree/express/catalog.phtml CHANGED
@@ -29,11 +29,12 @@ if (!$this->isEnabledPdp()) {
29
  (function () {
30
  document.observe("dom:loaded", function() {
31
  var express = new BraintreePayPalExpress(
32
- '<?php echo $this->getToken(); ?>',
33
  '<?php echo Mage::app()->getStore()->getFrontendName(); ?>',
34
  '<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>',
35
  'product',
36
  {
 
37
  authUrl: '<?php echo $this->getUrl('braintree/express/authorization') ?>',
38
  shippingSaveUrl:'<?php echo $this->getUrl('braintree/express/saveShipping') ?>',
39
  couponSaveUrl: '<?php echo $this->getUrl('braintree/express/saveCoupon') ?>',
29
  (function () {
30
  document.observe("dom:loaded", function() {
31
  var express = new BraintreePayPalExpress(
32
+ false,
33
  '<?php echo Mage::app()->getStore()->getFrontendName(); ?>',
34
  '<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>',
35
  'product',
36
  {
37
+ clientTokenUrl: '<?php echo $this->getUrl('braintree/checkout/clientToken') ?>',
38
  authUrl: '<?php echo $this->getUrl('braintree/express/authorization') ?>',
39
  shippingSaveUrl:'<?php echo $this->getUrl('braintree/express/saveShipping') ?>',
40
  couponSaveUrl: '<?php echo $this->getUrl('braintree/express/saveCoupon') ?>',
app/design/frontend/base/default/template/gene/braintree/js/aheadworks.phtml CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Add in support for Aheadworks One Step Checkout
4
  * http://ecommerce.aheadworks.com/magento-extensions/one-step-checkout.html
5
- * @author Dave Macaulay <dave@gene.co.uk>
6
  */
7
  ?>
8
  <!-- AHEADWORKS BRAINTREE SUPPORT -->
@@ -131,7 +131,6 @@
131
  * The action to run after the PayPal action has been completed
132
  */
133
  submitCheckout: function() {
134
- this.updatePayPalButton('remove');
135
  return awOSCForm.placeOrder();
136
  }
137
 
2
  /**
3
  * Add in support for Aheadworks One Step Checkout
4
  * http://ecommerce.aheadworks.com/magento-extensions/one-step-checkout.html
5
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
6
  */
7
  ?>
8
  <!-- AHEADWORKS BRAINTREE SUPPORT -->
131
  * The action to run after the PayPal action has been completed
132
  */
133
  submitCheckout: function() {
 
134
  return awOSCForm.placeOrder();
135
  }
136
 
app/design/frontend/base/default/template/gene/braintree/js/amasty.phtml CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Add in support for Amasty One Step Checkout
4
  * https://amasty.com/single-step-checkout.html
5
- * @author Dave Macaulay <dave@gene.co.uk>
6
  */
7
  ?>
8
  <!-- AMASTY BRAINTREE SUPPORT -->
2
  /**
3
  * Add in support for Amasty One Step Checkout
4
  * https://amasty.com/single-step-checkout.html
5
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
6
  */
7
  ?>
8
  <!-- AMASTY BRAINTREE SUPPORT -->
app/design/frontend/base/default/template/gene/braintree/js/awesomecheckout.phtml CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * Intercept various functions for the Awesome Checkout checkout flow
4
- * @author Dave Macaulay <dave@gene.co.uk>
5
  */
6
  ?>
7
  <!-- AWESOME CHECKOUT BRAINTREE SUPPORT -->
1
  <?php
2
  /**
3
  * Intercept various functions for the Awesome Checkout checkout flow
4
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
5
  */
6
  ?>
7
  <!-- AWESOME CHECKOUT BRAINTREE SUPPORT -->
app/design/frontend/base/default/template/gene/braintree/js/default.phtml CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * Intercept various functions for the default checkout flow
4
- * @author Dave Macaulay <dave@gene.co.uk>
5
  */
6
  ?>
7
  <!-- DEFAULT BRAINTREE SUPPORT -->
1
  <?php
2
  /**
3
  * Intercept various functions for the default checkout flow
4
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
5
  */
6
  ?>
7
  <!-- DEFAULT BRAINTREE SUPPORT -->
app/design/frontend/base/default/template/gene/braintree/js/fancycheckout.phtml CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Add in support for FancyCheckout
4
  * https://www.fancycheckout.com
5
- * @author Dave Macaulay <dave@gene.co.uk>
6
  */
7
  ?>
8
  <!-- FANCYCHECKOUT BRAINTREE SUPPORT -->
2
  /**
3
  * Add in support for FancyCheckout
4
  * https://www.fancycheckout.com
5
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
6
  */
7
  ?>
8
  <!-- FANCYCHECKOUT BRAINTREE SUPPORT -->
app/design/frontend/base/default/template/gene/braintree/js/firecheckout.phtml CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Add in support for Fire Checkout
4
  * http://templates-master.com/magento-one-page-checkout.html
5
- * @author Dave Macaulay <dave@gene.co.uk>
6
  */
7
  ?>
8
  <!-- FIRECHECKOUT BRAINTREE SUPPORT -->
@@ -22,6 +22,7 @@
22
  */
23
  captureOriginalSubmitFn: function () {
24
  this._originalSubmitFn = FireCheckout.prototype.save;
 
25
  return true;
26
  },
27
 
@@ -34,7 +35,7 @@
34
  var vzeroIntegration = this;
35
 
36
  // Re-define the original method so we can do some jazz with it
37
- FireCheckout.prototype.save = function () {
38
 
39
  if (vzeroIntegration.shouldInterceptSubmit('creditcard')) {
40
 
@@ -57,6 +58,12 @@
57
 
58
  };
59
 
 
 
 
 
 
 
60
  },
61
 
62
  /**
2
  /**
3
  * Add in support for Fire Checkout
4
  * http://templates-master.com/magento-one-page-checkout.html
5
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
6
  */
7
  ?>
8
  <!-- FIRECHECKOUT BRAINTREE SUPPORT -->
22
  */
23
  captureOriginalSubmitFn: function () {
24
  this._originalSubmitFn = FireCheckout.prototype.save;
25
+ this._originalPaymentInitialize = Payment.prototype.init;
26
  return true;
27
  },
28
 
35
  var vzeroIntegration = this;
36
 
37
  // Re-define the original method so we can do some jazz with it
38
+ FireCheckout.prototype.save = function (urlSuffix, forceSave) {
39
 
40
  if (vzeroIntegration.shouldInterceptSubmit('creditcard')) {
41
 
58
 
59
  };
60
 
61
+ // Ensure initSavedMethods is ran on initialize
62
+ Payment.prototype.init = function () {
63
+ vzeroIntegration.initSavedMethods();
64
+ return vzeroIntegration._originalPaymentInitialize.apply(this, arguments);
65
+ };
66
+
67
  },
68
 
69
  /**
app/design/frontend/base/default/template/gene/braintree/js/fme.phtml CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Add in support for FME Quick Checkout
4
  * https://www.fmeextensions.com/one-step-checkout.html
5
- * @author Dave Macaulay <dave@gene.co.uk>
6
  */
7
  ?>
8
  <!-- FME QUCKCHECKOUT BRAINTREE SUPPORT -->
2
  /**
3
  * Add in support for FME Quick Checkout
4
  * https://www.fmeextensions.com/one-step-checkout.html
5
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
6
  */
7
  ?>
8
  <!-- FME QUCKCHECKOUT BRAINTREE SUPPORT -->
app/design/frontend/base/default/template/gene/braintree/js/iwd.phtml CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Add in support for IWD One Step Checkout
4
  * https://www.iwdagency.com/extensions/one-step-page-checkout.html
5
- * @author Dave Macaulay <dave@gene.co.uk>
6
  */
7
  ?>
8
  <!-- IWD BRAINTREE SUPPORT -->
@@ -157,8 +157,14 @@
157
  };
158
 
159
  // Stop the system from validating the credit card hosted fields form for hosted fields
160
- IWD.OPC.validatePayment = function() {
161
- if (IWD.OPC.saveOrderStatus === true || vzeroIntegration.getPaymentMethod() != 'gene_braintree_creditcard' || (vzeroIntegration.getPaymentMethod() == 'gene_braintree_creditcard' && !vzeroIntegration.vzero.hostedFields)) {
 
 
 
 
 
 
162
  return vzeroIntegration._originalValidatePaymentFn.apply(this, arguments);
163
  }
164
  };
2
  /**
3
  * Add in support for IWD One Step Checkout
4
  * https://www.iwdagency.com/extensions/one-step-page-checkout.html
5
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
6
  */
7
  ?>
8
  <!-- IWD BRAINTREE SUPPORT -->
157
  };
158
 
159
  // Stop the system from validating the credit card hosted fields form for hosted fields
160
+ IWD.OPC.validatePayment = function () {
161
+ if (
162
+ IWD.OPC.saveOrderStatus === true ||
163
+ (
164
+ vzeroIntegration.getPaymentMethod() != 'gene_braintree_applepay' &&
165
+ vzeroIntegration.getPaymentMethod() != 'gene_braintree_creditcard'
166
+ )
167
+ ) {
168
  return vzeroIntegration._originalValidatePaymentFn.apply(this, arguments);
169
  }
170
  };
app/design/frontend/base/default/template/gene/braintree/js/magestore.phtml CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Add in support for Magestore One Step Checkout
4
  * http://ecommerce.aheadworks.com/magento-extensions/one-step-checkout.html
5
- * @author Dave Macaulay <dave@gene.co.uk>
6
  */
7
  ?>
8
  <!-- MAGESTORE BRAINTREE SUPPORT -->
2
  /**
3
  * Add in support for Magestore One Step Checkout
4
  * http://ecommerce.aheadworks.com/magento-extensions/one-step-checkout.html
5
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
6
  */
7
  ?>
8
  <!-- MAGESTORE BRAINTREE SUPPORT -->
app/design/frontend/base/default/template/gene/braintree/js/multishipping.phtml CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * Intercept various functions for the multi shipping checkout flow
4
- * @author Dave Macaulay <dave@gene.co.uk>
5
  */
6
  ?>
7
  <!-- MULTI SHIPPING BRAINTREE SUPPORT -->
1
  <?php
2
  /**
3
  * Intercept various functions for the multi shipping checkout flow
4
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
5
  */
6
  ?>
7
  <!-- MULTI SHIPPING BRAINTREE SUPPORT -->
app/design/frontend/base/default/template/gene/braintree/js/oye.phtml CHANGED
@@ -2,7 +2,7 @@
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 -->
2
  /**
3
  * Add in support for Oye One Step Checkout
4
  * http://oyenetwork.com/products/advanced-checkout.html
5
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
6
  */
7
  ?>
8
  <!-- OYE BRAINTREE SUPPORT -->
app/design/frontend/base/default/template/gene/braintree/js/setup.phtml CHANGED
@@ -11,13 +11,14 @@
11
  // Pass some data over to vZero integration JS
12
  var vzero = new vZero(
13
  'gene_braintree_creditcard',
14
- '<?php echo $this->getClientToken(); ?>',
15
  <?php echo $this->is3DEnabled(); ?>,
16
  true,
17
  false,
18
  false,
19
  '<?php echo Mage::getUrl('braintree/checkout/quoteTotal', array('_secure' => Mage::app()->getFrontController()->getRequest()->isSecure())); ?>',
20
- '<?php echo Mage::getUrl('braintree/checkout/tokenizeCard', array('_secure' => Mage::app()->getFrontController()->getRequest()->isSecure())); ?>'
 
21
  );
22
 
23
  // Pass the supported card types over to the front-end
@@ -38,12 +39,13 @@
38
  <?php if ($this->isPayPalActive()) : ?>
39
  // Pass some data through to the PayPal integration
40
  var vzeroPaypal = new vZeroPayPalButton(
41
- '<?php echo $this->getClientToken(); ?>',
42
  '<?php echo Mage::app()->getStore()->getFrontendName(); ?>',
43
  <?php echo $this->getSingleUse(); ?>,
44
  '<?php echo $this->getLocale(); ?>',
45
  <?php echo $this->getSingleFutureUse(); ?>,
46
- <?php echo $this->shouldOnlyVaultOnVault() ? $this->shouldOnlyVaultOnVault() : 'false'; ?>
 
47
  );
48
  <?php endif; ?>
49
  }
@@ -53,7 +55,7 @@
53
  <button type="button" name="braintree-paypal-button" class="braintree-paypal-button">
54
  <span>
55
  <span>
56
- <?php echo $this->__('Checkout with'); ?>
57
  </span>
58
  </span>
59
  </button>
11
  // Pass some data over to vZero integration JS
12
  var vzero = new vZero(
13
  'gene_braintree_creditcard',
14
+ false,
15
  <?php echo $this->is3DEnabled(); ?>,
16
  true,
17
  false,
18
  false,
19
  '<?php echo Mage::getUrl('braintree/checkout/quoteTotal', array('_secure' => Mage::app()->getFrontController()->getRequest()->isSecure())); ?>',
20
+ '<?php echo Mage::getUrl('braintree/checkout/tokenizeCard', array('_secure' => Mage::app()->getFrontController()->getRequest()->isSecure())); ?>',
21
+ '<?php echo Mage::getUrl('braintree/checkout/clientToken', array('_secure' => Mage::app()->getFrontController()->getRequest()->isSecure())); ?>'
22
  );
23
 
24
  // Pass the supported card types over to the front-end
39
  <?php if ($this->isPayPalActive()) : ?>
40
  // Pass some data through to the PayPal integration
41
  var vzeroPaypal = new vZeroPayPalButton(
42
+ false,
43
  '<?php echo Mage::app()->getStore()->getFrontendName(); ?>',
44
  <?php echo $this->getSingleUse(); ?>,
45
  '<?php echo $this->getLocale(); ?>',
46
  <?php echo $this->getSingleFutureUse(); ?>,
47
+ <?php echo $this->shouldOnlyVaultOnVault() ? $this->shouldOnlyVaultOnVault() : 'false'; ?>,
48
+ '<?php echo Mage::getUrl('braintree/checkout/clientToken', array('_secure' => Mage::app()->getFrontController()->getRequest()->isSecure())); ?>'
49
  );
50
  <?php endif; ?>
51
  }
55
  <button type="button" name="braintree-paypal-button" class="braintree-paypal-button">
56
  <span>
57
  <span>
58
+ <?php echo $this->__('Login to'); ?>
59
  </span>
60
  </span>
61
  </button>
app/design/frontend/base/default/template/gene/braintree/js/unicode.phtml CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Add in support for Unicode OP Checkout
4
  * http://store.unicodesystems.in/extensions/op-checkout-extension.html
5
- * @author Dave Macaulay <dave@gene.co.uk>
6
  */
7
  ?>
8
  <!-- UNICODE BRAINTREE SUPPORT -->
2
  /**
3
  * Add in support for Unicode OP Checkout
4
  * http://store.unicodesystems.in/extensions/op-checkout-extension.html
5
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
6
  */
7
  ?>
8
  <!-- UNICODE BRAINTREE SUPPORT -->
{skin/adminhtml/default/default/css → js}/gene/braintree/.DS_Store RENAMED
Binary file
js/gene/braintree/2.1.7/express/abstract-min.js DELETED
@@ -1 +0,0 @@
1
- var BraintreeExpressAbstract=Class.create();BraintreeExpressAbstract.prototype={initialize:function(e,t,o,s,a,n){this.clientToken=e,this.storeFrontName=t,this.formKey=o,this.source=s,this.urls=a,this.config=n||{},this._init(),this.insertDom()},_init:function(){return!1},insertDom:function(){this.getModal()||$$("body").first().insert('<div id="pp-express-overlay"></div><div id="pp-express-modal"></div><div id="pp-express-container"></div>')},getOverlay:function(){return document.getElementById("pp-express-overlay")},getModal:function(){return document.getElementById("pp-express-modal")},hideModal:function(){this.getOverlay().style.display="none",this.getModal().style.display="none",this.getModal().innerHTML=""},showModal:function(){this.getModal().innerHTML="",this.getModal().classList.add("loading"),this.getOverlay().style.display="block",this.getModal().style.display="block"},initModal:function(e){"undefined"==typeof e.form_key&&(e.form_key=this.formKey),"undefined"==typeof e.source&&(e.source=this.source),this.showModal(),new Ajax.Request(this.urls.authUrl,{method:"POST",parameters:e,onSuccess:function(e){this.getModal().classList.remove("loading"),this.getModal().innerHTML=e.responseText,this.prepareCoupon(),this.ajaxHandler()}.bind(this),onFailure:function(){this.hideModal(),alert("object"==typeof Translator?Translator.translate("We were unable to complete the request. Please try again."):"We were unable to complete the request. Please try again.")}.bind(this)})},updateShipping:function(e){this._setLoading($("paypal-express-submit")),new Ajax.Request(this.urls.shippingSaveUrl,{method:"POST",parameters:{submit_shipping:!0,shipping_method:e},onSuccess:function(e){var t=this._getJson(e);this._unsetLoading($("paypal-express-submit")),this._updateTotals(t)}.bind(this),onFailure:function(){this._unsetLoading($("paypal-express-submit")),api.hideModal(),alert("object"==typeof Translator?Translator.translate("We were unable to complete the request. Please try again."):"We were unable to complete the request. Please try again.")}})},prepareCoupon:function(){$("paypal-express-coupon")&&$("paypal-express-coupon").observe("keypress",function(e){var t=e.which||e.keyCode;t==Event.KEY_RETURN&&(Event.stop(e),this.updateCoupon())}.bind(this))},updateCoupon:function(e){return $("paypal-express-coupon-error").hide(),!e&&$("paypal-express-coupon")&&(e=$("paypal-express-coupon").value),""!=e&&(this._setLoading($("paypal-express-coupon-apply")),new Ajax.Request(this.urls.couponSaveUrl,{method:"POST",parameters:{coupon:e},onSuccess:function(e){var t=this._getJson(e);this._unsetLoading($("paypal-express-coupon-apply")),this._updateTotals(t),1==t.success?($("paypal-express-coupon-remove").show(),$("paypal-express-coupon-apply").hide()):t.message&&$("paypal-express-coupon-error").update(t.message).show()}.bind(this),onFailure:function(){this._unsetLoading($("paypal-express-coupon-submit")),api.hideModal(),alert("object"==typeof Translator?Translator.translate("We were unable to complete the request. Please try again."):"We were unable to complete the request. Please try again.")}}),!1)},removeCoupon:function(){$("paypal-express-coupon-error").hide(),this._setLoading($("paypal-express-coupon-remove")),new Ajax.Request(this.urls.couponSaveUrl,{method:"POST",parameters:{remove:!0},onSuccess:function(e){var t=this._getJson(e);this._unsetLoading($("paypal-express-coupon-remove")),this._updateTotals(t),1==t.success?($("paypal-express-coupon-remove").hide(),$("paypal-express-coupon-apply").show(),$("paypal-express-coupon").value="",$("paypal-express-coupon").focus()):t.message&&$("paypal-express-coupon-error").update(t.message).show()}.bind(this),onFailure:function(){this._unsetLoading($("paypal-express-coupon-submit")),api.hideModal(),alert("object"==typeof Translator?Translator.translate("We were unable to complete the request. Please try again."):"We were unable to complete the request. Please try again.")}})},_updateTotals:function(e){"undefined"!=typeof e.totals&&$("paypal-express-totals").update(e.totals)},_getJson:function(e){return"undefined"!=typeof e.responseJSON?e.responseJSON:"string"==typeof e.responseText?e.responseText.evalJSON():void 0},_setLoading:function(e){return!!e&&(e.setAttribute("disabled","disabled"),void e.addClassName("loading"))},_unsetLoading:function(e){return!!e&&(e.removeAttribute("disabled"),void e.removeClassName("loading"))},ajaxHandler:function(){var e=this.getModal().getElementsByTagName("form"),t=0;if(e.length>0)for(t=0;t<e.length;t++)Element.observe(e[t],"submit",function(e){return Event.stop(e),this.getModal().classList.add("loading"),this.getModal().innerHTML="",new Ajax.Request(e.target.getAttribute("action"),{method:"POST",parameters:$(e.target).serialize(!0),onSuccess:function(e){return"complete"==e.responseText?void(document.location=this.urls.successUrl):(this.getModal().classList.remove("loading"),this.getModal().innerHTML=e.responseText,void this.ajaxHandler())}.bind(this),onFailure:function(){this.hideModal(),alert("object"==typeof Translator?Translator.translate("We were unable to complete the request. Please try again."):"We were unable to complete the request. Please try again.")}.bind(this)}),!1}.bind(this))},validateForm:function(){if("object"==typeof productAddToCartForm&&productAddToCartForm.validator.validate()){if("object"==typeof productAddToCartFormOld&&productAddToCartFormOld.validator.validate())return!0;if("object"!=typeof productAddToCartFormOld)return!0}return"object"!=typeof productAddToCartForm&&"object"!=typeof productAddToCartFormOld},attachToButtons:function(e){console.warn("This method cannot be called directly.")}};
 
js/gene/braintree/2.1.7/express/paypal-min.js DELETED
@@ -1 +0,0 @@
1
- var BraintreePayPalExpress=Class.create(BraintreeExpressAbstract,{vzeroPayPal:!1,_init:function(){this.vzeroPayPal=new vZeroPayPalButton(this.config.token,"",!1,this.config.locale)},attachToButtons:function(t){var a={validate:this.validateForm,onSuccess:function(t){var a={paypal:JSON.stringify(t)};"undefined"!=typeof this.config.productId&&(a.product_id=this.config.productId,a.form_data=$("product_addtocart_form")?$("product_addtocart_form").serialize():$("pp_express_form").serialize()),this.initModal(a)}.bind(this),tokenizeRequest:{enableShippingAddress:!0}};t.each(function(t){t.up().addClassName("braintree-paypal-express-container")}),this.vzeroPayPal.attachPayPalButtonEvent(t,a)}});
 
js/gene/braintree/2.1.7/vzero-integration-min.js DELETED
@@ -1 +0,0 @@
1
- var vZeroIntegration=Class.create();vZeroIntegration.prototype={initialize:function(e,t,i,n,a,r,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.paypalWrapperMarkUp=i||!1,this.paypalButtonClass=n||!1,this.submitButtonClass=this.paypalButtonClass,this.isOnepage=a||!1,this.config=r||{},this.submitAfterPayment=o||!1,this._methodSwitchTimeout=!1,this._originalSubmitFn=!1,this.kountEnvironment=!1,this.kountId=!1,document.observe("dom:loaded",function(){this.captureOriginalSubmitFn()&&this.observeSubmissionOverride(),this.prepareSubmitObserver(),this.preparePaymentMethodSwitchObserver()}.bind(this)),this.hostedFieldsGenerated=!1,this.isOnepage&&(this.observeAjaxRequests(),document.observe("dom:loaded",function(){this.initSavedPayPal(),this.initDefaultMethod(),null!==$("braintree-hosted-submit")&&this.initHostedFields()}.bind(this))),document.observe("dom:loaded",function(){this.initSavedMethods(),null!==$("braintree-hosted-submit")&&this.initHostedFields()}.bind(this)),this._deviceDataInit=!1,this.vzero.observeEvent(["onHandleAjaxRequest","integration.onInitSavedMethods"],this.initDeviceData,this),this.vzero.observeEvent("integration.onBeforeSubmit",function(){null!=$("braintree-device-data")&&$("braintree-device-data").writeAttribute("disabled",!1)},this),void this.vzero.fireEvent(this,"integration.onInit",{integration:this})))},initDeviceData:function(e,t){if(null!=$("credit-card-form")){var i=$("credit-card-form").up("form");if(void 0!=i&&0==i.select("#braintree-device-data").length){if(t._deviceDataInit===!0)return!1;t._deviceDataInit=!0;var n=new Element("input",{type:"hidden",name:"payment[device_data]",id:"braintree-device-data"});i.insert(n),t.populateDeviceData(n)}}},populateDeviceData:function(e){this.vzero.getClient(function(t){var i={client:t,kount:!0};this.vzeroPaypal!==!1&&(i.paypal=!0),braintree.dataCollector.create(i,function(t,i){return t?void("DATA_COLLECTOR_KOUNT_NOT_ENABLED"!=t.code&&"DATA_COLLECTOR_PAYPAL_NOT_ENABLED"!=t.code?console.error(t):(console.warn("A warning occurred whilst initialisation the Braintree data collector. This warning can be safely ignored."),console.warn(t))):(e.value=i.deviceData,e.writeAttribute("disabled",!1),void(this._deviceDataInit=!1))}.bind(this))}.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)),this.vzero.fireEvent(this,"integration.onInitSavedMethods")},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")})),this.vzero.fireEvent(this,"integration.onShowHideOtherMethod",{parentElement:e,targetElement:t})},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),this.vzero.fireEvent(this,"integration.onCheckSavedOther")},afterPaymentMethodSwitch:function(){return!0},initHostedFields:function(){this.vzero.hostedFields&&null!==$("braintree-hosted-submit")&&(void 0!==$("braintree-hosted-submit").up("form")?(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."))},validateHostedFields:function(){if(!this.vzero.usingSavedCard()&&this.vzero._hostedIntegration){var e=this.vzero._hostedIntegration.getState(),t=[],i={number:Translator.translate("Card Number"),expirationMonth:Translator.translate("Expiry Month"),expirationYear:Translator.translate("Expiry Year"),cvv:Translator.translate("CVV")};if($H(e.fields).each(function(e){0==e[1].isValid&&t.push(i[e[0]]+" "+Translator.translate("is invalid."))}.bind(this)),t.length>0)return alert(Translator.translate("There are a number of errors present with the credit card form:")+"\n"+t.join("\n")),!1;if(this.vzero.cardType&&this.vzero.supportedCards&&this.vzero.supportedCards.indexOf(this.vzero.cardType)==-1)return alert(Translator.translate("We're currently unable to process this card type, please try another card or payment method.")),!1}return!0},initDefaultMethod:function(){this.shouldAddPayPalButton(!1)&&(this.setLoading(),this.vzero.updateData(function(){this.resetLoading(),this.updatePayPalButton("add")}.bind(this))),this.afterPaymentMethodSwitch(),this.vzero.fireEvent(this,"integration.onInitDefaultMethod")},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(),this.afterPaymentMethodSwitch(),this.vzero.fireEvent(this,"integration.onObserveAjaxRequests")}.bind(this))}.bind(this),"undefined"!=typeof this.config.ignoreAjax&&this.config.ignoreAjax)},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))},captureOriginalSubmitFn:function(){return!1},observeSubmissionOverride:function(){setInterval(function(){this._originalSubmitFn&&this.prepareSubmitObserver()}.bind(this),500)},prepareSubmitObserver:function(){return!1},beforeSubmit:function(e){return this._beforeSubmit(e)},_beforeSubmit:function(e){this.vzero.fireEvent(this,"integration.onBeforeSubmit"),this.submitAfterPayment&&$("braintree-submit-after-payment")&&$("braintree-submit-after-payment").remove(),e()},afterSubmit:function(){return this.vzero.fireEvent(this,"integration.onAfterSubmit"),!1},submit:function(e,t,i,n){this.vzero._hostedFieldsTokenGenerated=!1,this.hostedFieldsGenerated=!1,this.shouldInterceptSubmit(e)&&("creditcard"!=e||"creditcard"==e&&this.validateHostedFields())&&(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.resetLoading(),this.afterSubmit(),this.enableDisableNonce(),this.vzero._hostedFieldsTokenGenerated=!0,this.hostedFieldsGenerated=!0,"function"==typeof t)var e=t();return this.setLoading(),e}.bind(this),onFailure:function(){if(this.vzero._hostedFieldsTokenGenerated=!1,this.hostedFieldsGenerated=!1,this.resetLoading(),this.afterSubmit(),"function"==typeof i)return i()}.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(),this.afterPaymentMethodSwitch(),this.vzero.fireEvent(this,"integration.onPaymentMethodSwitch",{method:e})}.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()},getPayPalMarkUp:function(){return $("braintree-paypal-button").innerHTML},updatePayPalButton:function(e,t){if(this.paypalWrapperMarkUp===!1)return!1;if("refresh"==e)return!0;if(this.shouldAddPayPalButton(t)&&"remove"!=e||"add"==e)if(void 0!==$$(this.paypalButtonClass).first()){if($$(this.paypalButtonClass).first().hide(),void 0!==$$("#paypal-complete").first())return $$("#paypal-complete").first().show(),!0;$$(this.paypalButtonClass).first().insert({after:this.paypalWrapperMarkUp}),this.vzeroPaypal.addPayPalButton({validate:this.validateAll.bind(this),onSuccess:this.completePayPal.bind(this),onReady:this.paypalOnReady.bind(this)},this.getPayPalMarkUp(),"#paypal-container")}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").hide()},onReviewInit:function(){this.isOnepage||this.updatePayPalButton(),this.vzero.fireEvent(this,"integration.onReviewInit")},paypalOnReady:function(e){return!0},setLoading:function(){checkout.setLoadWaiting("payment")},resetLoading:function(){checkout.setLoadWaiting(!1)},enableDeviceData:function(){null!==$("device_data")&&$("device_data").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},disableCreditCardForm:function(){},enableCreditCardForm:function(){}};
 
js/gene/braintree/2.1.7/vzero-min.js DELETED
@@ -1 +0,0 @@
1
- var vZero=Class.create();vZero.prototype={initialize:function(e,t,i,n,o,r,s,a){this.code=e,this.clientToken=t,this.threeDSecure=i,this.hostedFields=n,o&&(this.billingName=o),r&&(this.billingPostcode=r),this.billingCountryId=!1,s&&(this.quoteUrl=s),a&&(this.tokenizeUrl=a),this._hostedFieldsTokenGenerated=!1,this.acceptedCards=!1,this._hostedFieldsTimeout=!1,this._updateDataCallbacks=[],this._updateDataTimeout=null,this.client=!1,this.threeDSpecificCountries=!1,this.threeDCountries=[],this.threeDSecureFailedAction=0,this.supportedCards=[],this.cardType=!1,this.initEvents()},initEvents:function(){this.events={onBeforeUpdateData:[],onAfterUpdateData:[],onHandleAjaxRequest:[],integration:{onInit:[],onInitDefaultMethod:[],onInitSavedMethods:[],onShowHideOtherMethod:[],onCheckSavedOther:[],onPaymentMethodSwitch:[],onReviewInit:[],onBeforeSubmit:[],onAfterSubmit:[],onObserveAjaxRequests:[]}}},setKount:function(e,t){this.kountEnvironment=e,""!=t&&(this.kountId=t)},setSupportedCards:function(e){"string"==typeof e&&(e=e.split(",")),this.supportedCards=e},setThreeDCountries:function(e){"string"==typeof e&&(e=e.split(",")),this.threeDSpecificCountries=!0,this.threeDCountries=e},setThreeDFailedAction:function(e){this.threeDSecureFailedAction=e},observeEvent:function(e,t,i){Array.isArray(e)||(e=[e]),e.each(function(e){var n=this._resolveEvent(e);void 0===n?console.warn("Event for "+e+" does not exist."):n.push({fn:t,params:i})}.bind(this))},fireEvent:function(e,t,i){var n=this._resolveEvent(t);void 0!==n&&n.length>0&&n.each(function(t){if("function"==typeof t.fn){var arguments=[i];"object"==typeof t.params&&arguments.push(t.params),t.fn.apply(e,arguments)}})},_resolveEvent:function(e){return e.split(".").reduce(function(e,t){return e?e[t]:void 0},this.events)},getClient:function(e){this.client!==!1?"function"==typeof e&&e(this.client):braintree.client.create({authorization:this.clientToken},function(t,i){return t?void console.error(t):(this.client=i,void e(this.client))}.bind(this))},initHostedFields:function(e){return!($$('iframe[name^="braintree-"]').length>0)&&(null!==$("braintree-hosted-submit")&&(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))))},teardownHostedFields:function(e){"undefined"!=typeof this._hostedIntegration&&this._hostedIntegration!==!1?this._hostedIntegration.teardown(function(){this._hostedIntegration=!1,"function"==typeof e&&e()}.bind(this)):"function"==typeof e&&e()},setupHostedFieldsClient:function(){return!($$('iframe[name^="braintree-"]').length>0)&&(this._hostedIntegration=!1,void this.getClient(function(e){var t={client:e,styles:this.getHostedFieldsStyles(),fields:{number:{selector:"#card-number",placeholder:"0000 0000 0000 0000"},expirationMonth:{selector:"#expiration-month",placeholder:"MM"},expirationYear:{selector:"#expiration-year",placeholder:"YY"}}};null!==$("cvv")&&(t.fields.cvv={selector:"#cvv"});var i=e.getConfiguration();"object"==typeof i.gatewayConfiguration.challenges&&i.gatewayConfiguration.challenges.indexOf("postal_code")!==-1&&(void 0==$$(".braintree-avs-postal-code").first()?console.error("We've detected you have AVS rules enabled, however the braintree-avs-postal-code field is not present in your Hosted Fields form. Please ensure you haven't overriden hostedfields.phtml and if you have please update it."):($$(".braintree-avs-postal-code").first().show(),t.fields.postalCode={selector:"#postal-code"})),braintree.hostedFields.create(t,function(e,t){if(e){if("HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME"==e.code)return;return void console.error(e)}return this.hostedFieldsOnReady(t)}.bind(this))}.bind(this)))},hostedFieldsOnReady:function(e){if(this._hostedIntegration=e,$$("#credit-card-form.loading").length&&$$("#credit-card-form.loading").first().removeClassName("loading"),this.integration.submitAfterPayment){var t=new Element("input",{type:"hidden",name:"payment[submit_after_payment]",value:1,id:"braintree-submit-after-payment"});$("payment_form_gene_braintree_creditcard").insert(t)}else $("braintree-submit-after-payment")&&$("braintree-submit-after-payment").remove();e.on("cardTypeChange",this.hostedFieldsCardTypeChange.bind(this))},getHostedFieldsStyles:function(){return"function"==typeof this.integration.getHostedFieldsStyles?this.integration.getHostedFieldsStyles():{input:{"font-size":"14pt",color:"#3A3A3A"},":focus":{color:"black"},".valid":{color:"green"},".invalid":{color:"red"}}},hostedFieldsCardTypeChange:function(e){if("undefined"!=typeof e.cards){var t={visa:"VI","american-express":"AE","master-card":"MC",discover:"DI",jcb:"JCB",maestro:"ME"};void 0!==typeof t[e.cards[0].type]?(this.cardType=t[e.cards[0].type],this.updateCardType(!1,this.cardType),this.supportedCards.indexOf(this.cardType)==-1?this.showCardUnsupported():this.removeCardUnsupported()):(this.removeCardUnsupported(),this.cardType=!1,this.updateCardType(!1,"card"))}},showCardUnsupported:function(){if($$(".braintree-card-input-field").length>0){var e=$$(".braintree-card-input-field").first().up();if(0==e.select(".braintree-card-unsupported").length){var t=new Element("div",{class:"braintree-card-unsupported"}).update(Translator.translate("We're currently unable to process this card type, please try another card or payment method."));e.insert(t)}}},removeCardUnsupported:function(){$$(".braintree-card-unsupported").length>0&&$$(".braintree-card-unsupported").each(function(e){e.remove()})},getBillingCountryId:function(){if(null==$("billing-address-select")||""==$("billing-address-select").value){var e=this.getBillingAddress();if("undefined"!=typeof e["billing[country_id]"])return e["billing[country_id]"]}return!!this.billingCountryId&&this.billingCountryId},shouldInvokeThreeDSecure:function(){if(this.threeDSpecificCountries&&this.threeDCountries.length>0){var e;if(e=this.getBillingCountryId())return this.threeDCountries.indexOf(e)!==-1}return this.threeDSecure},hostedFieldsNonceReceived:function(e,t){this.shouldInvokeThreeDSecure()?("function"==typeof this.integration.setLoading&&this.integration.setLoading(),this.verify3dSecureNonce(e,{onSuccess:function(e){this.updateNonce(e.nonce),"function"==typeof t.onSuccess&&t.onSuccess()}.bind(this),onFailure:function(){"function"==typeof t.onFailure&&t.onFailure()}.bind(this)})):(this.updateNonce(e),"function"==typeof t.onSuccess&&t.onSuccess())},updateNonce:function(e){$("creditcard-payment-nonce").value=e,$("creditcard-payment-nonce").setAttribute("value",e),"function"==typeof this.integration.resetLoading&&this.integration.resetLoading(),this._hostedFieldsTokenGenerated=!0},hostedFieldsError:function(e){return"function"==typeof this.integration.resetLoading&&this.integration.resetLoading(),"undefined"!=typeof e.message&&e.message.indexOf("Cannot place two elements in")==-1&&e.message.indexOf("Unable to find element with selector")==-1&&e.message.indexOf("User did not enter a payment method")==-1&&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},usingSavedThreeDCard:function(){return this.usingSavedCard()&&$$("#creditcard-saved-accounts input:checked[type=radio]").first().hasAttribute("data-threedsecure-nonce")},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")&&e.key.indexOf("password")==-1&&(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(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")}},observeAjaxRequests:function(e,t){return!vZero.prototype.observingAjaxRequests&&(vZero.prototype.observingAjaxRequests=!0,Ajax.Responders.register({onComplete:function(i){return this.handleAjaxRequest(i.url,e,t)}.bind(this)}),void(window.jQuery&&jQuery(document).ajaxComplete(function(i,n,o){return this.handleAjaxRequest(o.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&&e.indexOf(t)!=-1&&(n=!0)}),n===!0)return!1}e&&e.indexOf("/braintree/")==-1&&(this.fireEvent(this,"onHandleAjaxRequest",{url:e}),t?t(e):this.updateData())},updateData:function(e,t){this._updateDataCallbacks.push(e),clearTimeout(this._updateDataTimeout),this._updateDataTimeout=setTimeout(function(){var e=this._updateDataCallbacks;this._updateDataCallbacks=[],this.fireEvent(this,"integration.onBeforeUpdateData",{params:t}),new Ajax.Request(this.quoteUrl,{method:"post",parameters:t,onSuccess:function(t){if(t&&(t.responseJSON||t.responseText)){var i=this._parseTransportAsJson(t);void 0!=i.billingName&&(this.billingName=i.billingName),void 0!=i.billingPostcode&&(this.billingPostcode=i.billingPostcode),void 0!=i.billingCountryId&&(this.billingCountryId=i.billingCountryId),void 0!=i.grandTotal&&(this.amount=i.grandTotal),void 0!=i.threeDSecure&&this.setThreeDSecure(i.threeDSecure),"undefined"!=typeof vzeroPaypal&&void 0!=i.grandTotal&&void 0!=i.currencyCode&&vzeroPaypal.setPricing(i.grandTotal,i.currencyCode),e.length>0&&e.each(function(e){e(i)}.bind(this)),this.fireEvent(this,"onAfterUpdateData",{response:i})}}.bind(this),onFailure:function(){}.bind(this)})}.bind(this),250)},tokenize3dSavedCards:function(e){if(this.threeDSecure)if(void 0!==$$("[data-token]").first()){var t=[];$$("[data-token]").each(function(e,i){t[i]=e.getAttribute("data-token")}),new Ajax.Request(this.tokenizeUrl,{method:"post",onSuccess:function(t){if(t&&(t.responseJSON||t.responseText)){var i=this._parseTransportAsJson(t);i.success&&$H(i.tokens).each(function(e){void 0!=$$('[data-token="'+e.key+'"]').first()&&$$('[data-token="'+e.key+'"]').first().setAttribute("data-threedsecure-nonce",e.value)}),e&&e(i)}}.bind(this),parameters:{tokens:Object.toJSON(t)}})}else e();else e()},verify3dSecureNonce:function(e,t){this.getClient(function(i){braintree.threeDSecure.create({client:i},function(i,n){if(i)return void console.error(i);var o={amount:this.amount,nonce:e,addFrame:function(e,t){$$("#three-d-modal .bt-modal-body").first().insert(t),$("three-d-modal").removeClassName("hidden")},removeFrame:function(){$$("#three-d-modal .bt-modal-body iframe").first().remove(),$("three-d-modal").addClassName("hidden")}.bind(this)};n.verifyCard(o,function(e,i){e?t.onFailure&&t.onFailure(i,e):i.liabilityShifted?t.onSuccess&&t.onSuccess(i):1==this.threeDSecureFailedAction?t.onFailure&&t.onFailure(i,Translator.translate("Your payment has failed 3D secure verification, please try an alternate payment method.")):t.onSuccess&&t.onSuccess(i)}.bind(this))}.bind(this))}.bind(this))},verify3dSecureVault:function(e){var t=$$("#creditcard-saved-accounts input:checked[type=radio]").first().getAttribute("data-threedsecure-nonce");t?this.verify3dSecureNonce(t,{onSuccess:function(t){$("creditcard-payment-nonce").removeAttribute("disabled"),$("creditcard-payment-nonce").value=t.nonce,$("creditcard-payment-nonce").setAttribute("value",t.nonce),"function"==typeof e.onSuccess&&e.onSuccess()},onFailure:function(t,i){alert(i),"function"==typeof e.onFailure?e.onFailure():checkout.setLoadWaiting(!1)}}):(alert("No payment nonce present."),"function"==typeof e.onFailure?e.onFailure():checkout.setLoadWaiting(!1))},processCard:function(e){this._hostedIntegration.tokenize(function(t,i){return t?("function"==typeof e.onFailure?e.onFailure():checkout.setLoadWaiting(!1),void("string"==typeof t.message&&alert(t.message))):this.hostedFieldsNonceReceived(i.nonce,e)}.bind(this))},shouldInterceptCreditCard:function(){return"0.00"!=this.amount},shouldInterceptPayPal:function(){return!0},process:function(e){return e=e||{},this._hostedFieldsTokenGenerated||this.usingSavedCard()&&!this.usingSavedThreeDCard()?void("function"==typeof e.onSuccess&&e.onSuccess()):this.usingSavedThreeDCard()?this.verify3dSecureVault(e):this.processCard(e)},creditCardLoaded:function(){return!1},paypalLoaded:function(){return!1},_parseTransportAsJson:function(transport){return transport.responseJSON&&"object"==typeof transport.responseJSON?transport.responseJSON:transport.responseText?"object"==typeof JSON&&"function"==typeof JSON.parse?JSON.parse(transport.responseText):eval("("+transport.responseText+")"):{}}},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,o=window.console=window.console||{};n--;)e=i[n],o[e]||(o[e]=t)}();
 
js/gene/braintree/2.1.7/vzero-paypal-min.js DELETED
@@ -1 +0,0 @@
1
- var vZeroPayPalButton=Class.create();vZeroPayPalButton.prototype={initialize:function(t,e,n,i,a,o){this.clientToken=t,this.storeFrontName=e,this.singleUse=n,this.locale=i,this.amount=0,this.currency=!1,this.client=!1,this.onlyVaultOnVault=o||!1},getClient:function(t){this.client!==!1?"function"==typeof t&&t(this.client):braintree.client.create({authorization:this.clientToken},function(e,n){return e?void console.log(e):(this.client=n,void t(this.client))}.bind(this))},setPricing:function(t,e){this.amount=parseFloat(t),this.currency=e},rebuildButton:function(){return!1},addPayPalButton:function(t,e,n,i){var a;if(e=e||$("braintree-paypal-button").innerHTML,n=n||"#paypal-container",i=i||!1,a="string"==typeof n?$$(n).first():n,!a)return console.warn("Unable to locate container "+n+" for PayPal button."),!1;if(i?a.insert(e):a.update(e),!a.select(">button").length)return console.warn("Unable to find valid <button /> element within container."),!1;var o=a.select(">button").first();o.addClassName("braintree-paypal-loading"),o.setAttribute("disabled","disabled"),this.attachPayPalButtonEvent(o,t)},attachPayPalButtonEvent:function(t,e){this.getClient(function(n){braintree.paypal.create({client:n},function(n,i){return n?void console.error("Error creating PayPal:",n):("function"==typeof e.onReady&&e.onReady(i),this._attachPayPalButtonEvent(t,i,e))}.bind(this))}.bind(this))},_attachPayPalButtonEvent:function(t,e,n){t&&e&&(Array.isArray(t)||(t=[t]),t.each(function(t){t.removeClassName("braintree-paypal-loading"),t.removeAttribute("disabled"),Event.stopObserving(t,"click"),Event.observe(t,"click",function(t){return Event.stop(t),"function"!=typeof n.validate?this._tokenizePayPal(e,n):n.validate()?this._tokenizePayPal(e,n):void 0}.bind(this))}.bind(this)))},_tokenizePayPal:function(t,e){var n=this._buildOptions();"object"==typeof e.tokenizeRequest&&(n=Object.extend(n,e.tokenizeRequest)),t.tokenize(n,function(t,n){return t?void("CUSTOMER"!==t.type&&console.error("Error tokenizing:",t)):void("function"==typeof e.onSuccess&&e.onSuccess(n))}.bind(this))},_buildOptions:function(){var t={displayName:this.storeFrontName,amount:this.amount,currency:this.currency,useraction:"commit",flow:this._getFlow()};return this.locale&&(t.locale=this.locale),t},_getFlow:function(){var t;return t=this.singleUse===!0?"checkout":"vault",null!==$("gene_braintree_paypal_store_in_vault")&&this.onlyVaultOnVault&&"vault"==t&&!$("gene_braintree_paypal_store_in_vault").checked&&(t="checkout"),t}};
 
js/gene/braintree/2.2.0/express/abstract-min.js ADDED
@@ -0,0 +1 @@
 
1
+ var BraintreeExpressAbstract=Class.create();BraintreeExpressAbstract.prototype={initialize:function(e,t,o,s,a,n){this.clientToken=e||!1,this.storeFrontName=t,this.formKey=o,this.source=s,this.urls=a,this.config=n||{},this._init(),this.insertDom()},_init:function(){return!1},insertDom:function(){this.getModal()||$$("body").first().insert('<div id="pp-express-overlay"></div><div id="pp-express-modal"></div><div id="pp-express-container"></div>')},getOverlay:function(){return document.getElementById("pp-express-overlay")},getModal:function(){return document.getElementById("pp-express-modal")},hideModal:function(){this.getOverlay().style.display="none",this.getModal().style.display="none",this.getModal().innerHTML=""},showModal:function(){this.getModal().innerHTML="",this.getModal().classList.add("loading"),this.getOverlay().style.display="block",this.getModal().style.display="block"},initModal:function(e){"undefined"==typeof e.form_key&&(e.form_key=this.formKey),"undefined"==typeof e.source&&(e.source=this.source),this.showModal(),new Ajax.Request(this.urls.authUrl,{method:"POST",parameters:e,onSuccess:function(e){this.getModal().classList.remove("loading"),this.getModal().innerHTML=e.responseText,this.prepareCoupon(),this.ajaxHandler()}.bind(this),onFailure:function(){this.hideModal(),alert("object"==typeof Translator?Translator.translate("We were unable to complete the request. Please try again."):"We were unable to complete the request. Please try again.")}.bind(this)})},updateShipping:function(e){this._setLoading($("paypal-express-submit")),new Ajax.Request(this.urls.shippingSaveUrl,{method:"POST",parameters:{submit_shipping:!0,shipping_method:e},onSuccess:function(e){var t=this._getJson(e);this._unsetLoading($("paypal-express-submit")),this._updateTotals(t)}.bind(this),onFailure:function(){this._unsetLoading($("paypal-express-submit")),api.hideModal(),alert("object"==typeof Translator?Translator.translate("We were unable to complete the request. Please try again."):"We were unable to complete the request. Please try again.")}})},prepareCoupon:function(){$("paypal-express-coupon")&&$("paypal-express-coupon").observe("keypress",function(e){var t=e.which||e.keyCode;t==Event.KEY_RETURN&&(Event.stop(e),this.updateCoupon())}.bind(this))},updateCoupon:function(e){return $("paypal-express-coupon-error").hide(),!e&&$("paypal-express-coupon")&&(e=$("paypal-express-coupon").value),""==e?!1:(this._setLoading($("paypal-express-coupon-apply")),new Ajax.Request(this.urls.couponSaveUrl,{method:"POST",parameters:{coupon:e},onSuccess:function(e){var t=this._getJson(e);this._unsetLoading($("paypal-express-coupon-apply")),this._updateTotals(t),1==t.success?($("paypal-express-coupon-remove").show(),$("paypal-express-coupon-apply").hide()):t.message&&$("paypal-express-coupon-error").update(t.message).show()}.bind(this),onFailure:function(){this._unsetLoading($("paypal-express-coupon-submit")),api.hideModal(),alert("object"==typeof Translator?Translator.translate("We were unable to complete the request. Please try again."):"We were unable to complete the request. Please try again.")}}),!1)},removeCoupon:function(){$("paypal-express-coupon-error").hide(),this._setLoading($("paypal-express-coupon-remove")),new Ajax.Request(this.urls.couponSaveUrl,{method:"POST",parameters:{remove:!0},onSuccess:function(e){var t=this._getJson(e);this._unsetLoading($("paypal-express-coupon-remove")),this._updateTotals(t),1==t.success?($("paypal-express-coupon-remove").hide(),$("paypal-express-coupon-apply").show(),$("paypal-express-coupon").value="",$("paypal-express-coupon").focus()):t.message&&$("paypal-express-coupon-error").update(t.message).show()}.bind(this),onFailure:function(){this._unsetLoading($("paypal-express-coupon-submit")),api.hideModal(),alert("object"==typeof Translator?Translator.translate("We were unable to complete the request. Please try again."):"We were unable to complete the request. Please try again.")}})},_updateTotals:function(e){"undefined"!=typeof e.totals&&$("paypal-express-totals").update(e.totals)},_getJson:function(e){return"undefined"!=typeof e.responseJSON?e.responseJSON:"string"==typeof e.responseText?e.responseText.evalJSON():void 0},_setLoading:function(e){return e?(e.setAttribute("disabled","disabled"),void e.addClassName("loading")):!1},_unsetLoading:function(e){return e?(e.removeAttribute("disabled"),void e.removeClassName("loading")):!1},ajaxHandler:function(){var e=this.getModal().getElementsByTagName("form"),t=0;if(e.length>0)for(t=0;t<e.length;t++)Element.observe(e[t],"submit",function(e){return Event.stop(e),this.getModal().classList.add("loading"),this.getModal().innerHTML="",new Ajax.Request(e.target.getAttribute("action"),{method:"POST",parameters:$(e.target).serialize(!0),onSuccess:function(e){return"complete"==e.responseText?void(document.location=this.urls.successUrl):(this.getModal().classList.remove("loading"),this.getModal().innerHTML=e.responseText,void this.ajaxHandler())}.bind(this),onFailure:function(){this.hideModal(),alert("object"==typeof Translator?Translator.translate("We were unable to complete the request. Please try again."):"We were unable to complete the request. Please try again.")}.bind(this)}),!1}.bind(this))},validateForm:function(){if("object"==typeof productAddToCartForm&&productAddToCartForm.validator.validate()){if("object"==typeof productAddToCartFormOld&&productAddToCartFormOld.validator.validate())return!0;if("object"!=typeof productAddToCartFormOld)return!0}return"object"!=typeof productAddToCartForm&&"object"!=typeof productAddToCartFormOld},attachToButtons:function(e){console.warn("This method cannot be called directly.")}};
js/gene/braintree/2.2.0/express/paypal-min.js ADDED
@@ -0,0 +1 @@
 
1
+ var BraintreePayPalExpress=Class.create(BraintreeExpressAbstract,{vzeroPayPal:!1,_init:function(){this.vzeroPayPal=new vZeroPayPalButton(!1,"",!1,this.config.locale,!1,!1,this.urls.clientTokenUrl)},attachToButtons:function(t){var a={validate:this.validateForm,onSuccess:function(t){var a={paypal:JSON.stringify(t)};"undefined"!=typeof this.config.productId&&(a.product_id=this.config.productId,a.form_data=$("product_addtocart_form")?$("product_addtocart_form").serialize():$("pp_express_form").serialize()),this.initModal(a)}.bind(this),tokenizeRequest:{enableShippingAddress:!0}};t.each(function(t){t.up().addClassName("braintree-paypal-express-container")}),this.vzeroPayPal.attachPayPalButtonEvent(t,a)}});
js/gene/braintree/2.2.0/vzero-integration-min.js ADDED
@@ -0,0 +1 @@
 
1
+ var vZeroIntegration=Class.create();vZeroIntegration.prototype={initialize:function(e,t,i,a,n,r,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.paypalWrapperMarkUp=i||!1,this.paypalButtonClass=a||!1,this.submitButtonClass=this.paypalButtonClass,this.isOnepage=n||!1,this.config=r||{},this.submitAfterPayment=o||!1,this._methodSwitchTimeout=!1,this._originalSubmitFn=!1,this.kountEnvironment=!1,this.kountId=!1,document.observe("dom:loaded",function(){this.captureOriginalSubmitFn()&&this.observeSubmissionOverride(),this.prepareSubmitObserver(),this.preparePaymentMethodSwitchObserver()}.bind(this)),this.hostedFieldsGenerated=!1,this.isOnepage&&(this.observeAjaxRequests(),document.observe("dom:loaded",function(){this.initSavedPayPal(),this.initDefaultMethod(),null!==$("braintree-hosted-submit")&&this.initHostedFields()}.bind(this))),document.observe("dom:loaded",function(){this.initSavedMethods(),null!==$("braintree-hosted-submit")&&this.initHostedFields()}.bind(this)),this._deviceDataInit=!1,this.vzero.observeEvent(["onHandleAjaxRequest","integration.onInitSavedMethods"],this.initDeviceData,this),this.vzero.observeEvent("integration.onBeforeSubmit",function(){null!=$("braintree-device-data")&&$("braintree-device-data").writeAttribute("disabled",!1)},this),void this.vzero.fireEvent(this,"integration.onInit",{integration:this})))},initDeviceData:function(e,t){if(null!=$("credit-card-form")){var i=$("credit-card-form").up("form");if(void 0!=i&&0==i.select("#braintree-device-data").length){if(t._deviceDataInit===!0)return!1;t._deviceDataInit=!0;var a=new Element("input",{type:"hidden",name:"payment[device_data]",id:"braintree-device-data"});i.insert(a),t.populateDeviceData(a)}}},populateDeviceData:function(e){this.vzero.getClient(function(t){var i={client:t,kount:!0};this.vzeroPaypal!==!1&&(i.paypal=!0),braintree.dataCollector.create(i,function(t,i){return t?void("DATA_COLLECTOR_KOUNT_NOT_ENABLED"!=t.code&&"DATA_COLLECTOR_PAYPAL_NOT_ENABLED"!=t.code?console.error(t):(console.warn("A warning occurred whilst initialisation the Braintree data collector. This warning can be safely ignored."),console.warn(t))):(e.value=i.deviceData,e.writeAttribute("disabled",!1),void(this._deviceDataInit=!1))}.bind(this))}.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)),this.vzero.fireEvent(this,"integration.onInitSavedMethods")},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")})),this.vzero.fireEvent(this,"integration.onShowHideOtherMethod",{parentElement:e,targetElement:t})},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),this.vzero.fireEvent(this,"integration.onCheckSavedOther")},afterPaymentMethodSwitch:function(){return!0},initHostedFields:function(){this.vzero.hostedFields&&null!==$("braintree-hosted-submit")&&(void 0!==$("braintree-hosted-submit").up("form")?(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."))},validateHostedFields:function(){if(!this.vzero.usingSavedCard()&&this.vzero._hostedIntegration){var e=this.vzero._hostedIntegration.getState(),t=[],i={number:Translator.translate("Card Number"),expirationMonth:Translator.translate("Expiry Month"),expirationYear:Translator.translate("Expiry Year"),cvv:Translator.translate("CVV"),postalCode:Translator.translate("Postal Code")};if($H(e.fields).each(function(e){0==e[1].isValid&&t.push(i[e[0]]+" "+Translator.translate("is invalid."))}.bind(this)),t.length>0)return alert(Translator.translate("There are a number of errors present with the credit card form:")+"\n"+t.join("\n")),!1;if(this.vzero.cardType&&this.vzero.supportedCards&&-1==this.vzero.supportedCards.indexOf(this.vzero.cardType))return alert(Translator.translate("We're currently unable to process this card type, please try another card or payment method.")),!1}return!0},initDefaultMethod:function(){this.shouldAddPayPalButton(!1)&&(this.setLoading(),this.vzero.updateData(function(){this.resetLoading(),this.updatePayPalButton("add")}.bind(this))),this.afterPaymentMethodSwitch(),this.vzero.fireEvent(this,"integration.onInitDefaultMethod")},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(),this.afterPaymentMethodSwitch(),this.vzero.fireEvent(this,"integration.onObserveAjaxRequests")}.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))},captureOriginalSubmitFn:function(){return!1},observeSubmissionOverride:function(){setInterval(function(){this._originalSubmitFn&&this.prepareSubmitObserver()}.bind(this),500)},prepareSubmitObserver:function(){return!1},beforeSubmit:function(e){return this._beforeSubmit(e)},_beforeSubmit:function(e){this.vzero.fireEvent(this,"integration.onBeforeSubmit"),this.submitAfterPayment&&$("braintree-submit-after-payment")&&$("braintree-submit-after-payment").remove(),e()},afterSubmit:function(){return this.vzero.fireEvent(this,"integration.onAfterSubmit"),!1},submit:function(e,t,i,a){this.vzero._hostedFieldsTokenGenerated=!1,this.hostedFieldsGenerated=!1,this.shouldInterceptSubmit(e)&&("creditcard"!=e||"creditcard"==e&&this.validateHostedFields())&&(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.resetLoading(),this.afterSubmit(),this.enableDisableNonce(),this.vzero._hostedFieldsTokenGenerated=!0,this.hostedFieldsGenerated=!0,"function"==typeof t)var e=t();return this.setLoading(),e}.bind(this),onFailure:function(){return this.vzero._hostedFieldsTokenGenerated=!1,this.hostedFieldsGenerated=!1,alert(Translator.translate("We're unable to process your payment, please try another card or payment method.")),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 a&&a()))},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(),this.afterPaymentMethodSwitch(),this.vzero.fireEvent(this,"integration.onPaymentMethodSwitch",{method:e})}.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(){this.resetLoading();var e=$$(this.paypalButtonClass).first();return e?(e.stopObserving("click").observe("click",this.submitCheckout),this.updatePayPalButton("remove"),!0):this.submitCheckout()},getPayPalMarkUp:function(){return $("braintree-paypal-button").innerHTML},updatePayPalButton:function(e,t){if(this.paypalWrapperMarkUp===!1)return!1;if("refresh"==e)return!0;if(this.shouldAddPayPalButton(t)&&"remove"!=e||"add"==e)if(void 0!==$$(this.paypalButtonClass).first()){if($$(this.paypalButtonClass).first().hide(),void 0!==$$("#paypal-complete").first())return $$("#paypal-complete").first().show(),!0;$$(this.paypalButtonClass).first().insert({after:this.paypalWrapperMarkUp}),this.vzeroPaypal.addPayPalButton({validate:this.validateAll.bind(this),onSuccess:this.completePayPal.bind(this),onReady:this.paypalOnReady.bind(this)},this.getPayPalMarkUp(),"#paypal-container")}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").hide()},onReviewInit:function(){this.isOnepage||this.updatePayPalButton(),this.vzero.fireEvent(this,"integration.onReviewInit")},paypalOnReady:function(e){return!0},setLoading:function(){checkout.setLoadWaiting("payment")},resetLoading:function(){checkout.setLoadWaiting(!1)},enableDeviceData:function(){null!==$("device_data")&&$("device_data").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},disableCreditCardForm:function(){},enableCreditCardForm:function(){}};
js/gene/braintree/2.2.0/vzero-min.js ADDED
@@ -0,0 +1 @@
 
1
+ var vZero=Class.create();vZero.prototype={initialize:function(e,t,i,n,r,o,s,a,d){this.code=e,this.clientToken=t||!1,this.clientTokenUrl=d,this.threeDSecure=i,this.hostedFields=n,r&&(this.billingName=r),o&&(this.billingPostcode=o),this.billingCountryId=!1,s&&(this.quoteUrl=s),a&&(this.tokenizeUrl=a),this._hostedFieldsTokenGenerated=!1,this.acceptedCards=!1,this._hostedFieldsTimeout=!1,this._updateDataCallbacks=[],this._updateDataTimeout=null,this.client=!1,this.threeDSpecificCountries=!1,this.threeDCountries=[],this.threeDSecureFailedAction=0,this.supportedCards=[],this.cardType=!1,this.initEvents()},initEvents:function(){this.events={onBeforeUpdateData:[],onAfterUpdateData:[],onHandleAjaxRequest:[],integration:{onInit:[],onInitDefaultMethod:[],onInitSavedMethods:[],onShowHideOtherMethod:[],onCheckSavedOther:[],onPaymentMethodSwitch:[],onReviewInit:[],onBeforeSubmit:[],onAfterSubmit:[],onObserveAjaxRequests:[]}}},setKount:function(e,t){this.kountEnvironment=e,""!=t&&(this.kountId=t)},setSupportedCards:function(e){"string"==typeof e&&(e=e.split(",")),this.supportedCards=e},setThreeDCountries:function(e){"string"==typeof e&&(e=e.split(",")),this.threeDSpecificCountries=!0,this.threeDCountries=e},setThreeDFailedAction:function(e){this.threeDSecureFailedAction=e},observeEvent:function(e,t,i){Array.isArray(e)||(e=[e]),e.each(function(e){var n=this._resolveEvent(e);void 0===n?console.warn("Event for "+e+" does not exist."):n.push({fn:t,params:i})}.bind(this))},fireEvent:function(e,t,i){var n=this._resolveEvent(t);void 0!==n&&n.length>0&&n.each(function(t){if("function"==typeof t.fn){var arguments=[i];"object"==typeof t.params&&arguments.push(t.params),t.fn.apply(e,arguments)}})},_resolveEvent:function(e){return e.split(".").reduce(function(e,t){return e?e[t]:void 0},this.events)},getClientToken:function(e){return this.clientToken!==!1?e(this.clientToken):window.braintreeClientToken?e(window.braintreeClientToken):void new Ajax.Request(this.clientTokenUrl,{method:"get",onSuccess:function(t){if(t&&(t.responseJSON||t.responseText)){var i=this._parseTransportAsJson(t);if(1==i.success&&"string"==typeof i.client_token)return this.clientToken=i.client_token,window.braintreeClientToken=i.client_token,e(this.clientToken);console.error("We were unable to retrieve a client token from the server to initialize the Braintree flow."),i.error&&console.error(i.error)}}.bind(this),onFailure:function(){console.error("We were unable to retrieve a client token from the server to initialize the Braintree flow.")}.bind(this)})},getClient:function(e){this.client!==!1?"function"==typeof e&&e(this.client):this.getClientToken(function(t){braintree.client.create({authorization:t},function(t,i){return t?void console.error(t):(this.client=i,void e(this.client))}.bind(this))})},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)))},teardownHostedFields:function(e){"undefined"!=typeof this._hostedIntegration&&this._hostedIntegration!==!1?this._hostedIntegration.teardown(function(){this._hostedIntegration=!1,"function"==typeof e&&e()}.bind(this)):"function"==typeof e&&e()},setupHostedFieldsClient:function(){return $$('iframe[name^="braintree-"]').length>0?!1:(this._hostedIntegration=!1,this.checkSubmitAfterPayment(),void this.getClient(function(e){var t={client:e,styles:this.getHostedFieldsStyles(),fields:{number:{selector:"#card-number",placeholder:"0000 0000 0000 0000"},expirationMonth:{selector:"#expiration-month",placeholder:"MM"},expirationYear:{selector:"#expiration-year",placeholder:"YY"}}};null!==$("cvv")&&(t.fields.cvv={selector:"#cvv"}),braintree.hostedFields.create(t,function(e,t){if(e){if("HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME"==e.code)return;return void console.error(e)}return this.hostedFieldsOnReady(t)}.bind(this))}.bind(this)))},hostedFieldsOnReady:function(e){this._hostedIntegration=e,$$("#credit-card-form.loading").length&&$$("#credit-card-form.loading").first().removeClassName("loading"),this.checkSubmitAfterPayment(),e.on("cardTypeChange",this.hostedFieldsCardTypeChange.bind(this))},checkSubmitAfterPayment:function(){if(this.integration.submitAfterPayment){if(null==$("braintree-submit-after-payment")){var e=new Element("input",{type:"hidden",name:"payment[submit_after_payment]",value:1,id:"braintree-submit-after-payment"});$("payment_form_gene_braintree_creditcard").insert(e)}}else $("braintree-submit-after-payment")&&$("braintree-submit-after-payment").remove()},getHostedFieldsStyles:function(){return"function"==typeof this.integration.getHostedFieldsStyles?this.integration.getHostedFieldsStyles():{input:{"font-size":"14pt",color:"#3A3A3A"},":focus":{color:"black"},".valid":{color:"green"},".invalid":{color:"red"}}},hostedFieldsCardTypeChange:function(e){if("undefined"!=typeof e.cards){var t={visa:"VI","american-express":"AE","master-card":"MC",discover:"DI",jcb:"JCB",maestro:"ME"};void 0!==typeof t[e.cards[0].type]?(this.cardType=t[e.cards[0].type],this.updateCardType(!1,this.cardType),-1==this.supportedCards.indexOf(this.cardType)?this.showCardUnsupported():this.removeCardUnsupported()):(this.removeCardUnsupported(),this.cardType=!1,this.updateCardType(!1,"card"))}},showCardUnsupported:function(){if($$(".braintree-card-input-field").length>0){var e=$$(".braintree-card-input-field").first().up();if(0==e.select(".braintree-card-unsupported").length){var t=new Element("div",{"class":"braintree-card-unsupported"}).update(Translator.translate("We're currently unable to process this card type, please try another card or payment method."));e.insert(t)}}},removeCardUnsupported:function(){$$(".braintree-card-unsupported").length>0&&$$(".braintree-card-unsupported").each(function(e){e.remove()})},getBillingCountryId:function(){if(null==$("billing-address-select")||""==$("billing-address-select").value){var e=this.getBillingAddress();if("undefined"!=typeof e["billing[country_id]"])return e["billing[country_id]"]}return this.billingCountryId?this.billingCountryId:!1},shouldInvokeThreeDSecure:function(){if(this.threeDSpecificCountries&&this.threeDCountries.length>0){var e;if(e=this.getBillingCountryId())return-1!==this.threeDCountries.indexOf(e)}return this.threeDSecure},hostedFieldsNonceReceived:function(e,t){this.shouldInvokeThreeDSecure()?("function"==typeof this.integration.setLoading&&this.integration.setLoading(),this.verify3dSecureNonce(e,{onSuccess:function(e){this.updateNonce(e.nonce),"function"==typeof t.onSuccess&&t.onSuccess()}.bind(this),onFailure:function(){"function"==typeof t.onFailure&&t.onFailure()}.bind(this)})):(this.updateNonce(e),"function"==typeof t.onSuccess&&t.onSuccess())},updateNonce:function(e){$("creditcard-payment-nonce").value=e,$("creditcard-payment-nonce").setAttribute("value",e),"function"==typeof this.integration.resetLoading&&this.integration.resetLoading(),this._hostedFieldsTokenGenerated=!0},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")&&-1==e.message.indexOf("Unable to find element with selector")&&-1==e.message.indexOf("User did not enter a payment method")&&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},usingSavedThreeDCard:function(){return this.usingSavedCard()&&$$("#creditcard-saved-accounts input:checked[type=radio]").first().hasAttribute("data-threedsecure-nonce")},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(){if("string"==typeof this.billingPostcode)return this.billingPostcode;if("object"==typeof this.billingPostcode)return this.combineElementsValues(this.billingPostcode);var e=this.getBillingAddress();return"undefined"!=typeof e["billing[postcode]"]?e["billing[postcode]"]:null},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(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")}},observeAjaxRequests:function(e,t){return vZero.prototype.observingAjaxRequests?!1:(vZero.prototype.observingAjaxRequests=!0,Ajax.Responders.register({onComplete:function(i){return this.handleAjaxRequest(i.url,e,t)}.bind(this)}),void(window.jQuery&&jQuery(document).ajaxComplete(function(i,n,r){return this.handleAjaxRequest(r.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/")&&(this.fireEvent(this,"onHandleAjaxRequest",{url:e}),t?t(e):this.updateData())},updateData:function(e,t){this._updateDataCallbacks.push(e),clearTimeout(this._updateDataTimeout),this._updateDataTimeout=setTimeout(function(){var e=this._updateDataCallbacks;this._updateDataCallbacks=[],this.fireEvent(this,"onBeforeUpdateData",{params:t}),new Ajax.Request(this.quoteUrl,{method:"post",parameters:t,onSuccess:function(t){if(t&&(t.responseJSON||t.responseText)){var i=this._parseTransportAsJson(t);void 0!=i.billingName&&(this.billingName=i.billingName),void 0!=i.billingPostcode&&(this.billingPostcode=i.billingPostcode),void 0!=i.billingCountryId&&(this.billingCountryId=i.billingCountryId),void 0!=i.grandTotal&&(this.amount=i.grandTotal),void 0!=i.threeDSecure&&this.setThreeDSecure(i.threeDSecure),"undefined"!=typeof vzeroPaypal&&void 0!=i.grandTotal&&void 0!=i.currencyCode&&vzeroPaypal.setPricing(i.grandTotal,i.currencyCode),e.length>0&&e.each(function(e){e(i)}.bind(this)),this.fireEvent(this,"onAfterUpdateData",{response:i})}}.bind(this),onFailure:function(){}.bind(this)})}.bind(this),250)},tokenize3dSavedCards:function(e){if(this.threeDSecure)if(void 0!==$$("[data-token]").first()){var t=[];$$("[data-token]").each(function(e,i){t[i]=e.getAttribute("data-token")}),new Ajax.Request(this.tokenizeUrl,{method:"post",onSuccess:function(t){if(t&&(t.responseJSON||t.responseText)){var i=this._parseTransportAsJson(t);i.success&&$H(i.tokens).each(function(e){void 0!=$$('[data-token="'+e.key+'"]').first()&&$$('[data-token="'+e.key+'"]').first().setAttribute("data-threedsecure-nonce",e.value)}),e&&e(i)}}.bind(this),parameters:{tokens:Object.toJSON(t)}})}else e();else e()},verify3dSecureNonce:function(e,t){this.getClient(function(i){braintree.threeDSecure.create({client:i},function(i,n){if(i)return void console.error(i);var r={amount:this.amount,nonce:e,addFrame:function(e,t){$$("#three-d-modal .bt-modal-body").first().insert(t),$("three-d-modal").removeClassName("hidden")},removeFrame:function(){$$("#three-d-modal .bt-modal-body iframe").first().remove(),$("three-d-modal").addClassName("hidden")}.bind(this)};n.verifyCard(r,function(e,i){e?t.onFailure&&t.onFailure(i,e):i.liabilityShifted?t.onSuccess&&t.onSuccess(i):1==this.threeDSecureFailedAction?t.onFailure&&t.onFailure(i,Translator.translate("Your payment has failed 3D secure verification, please try an alternate payment method.")):t.onSuccess&&t.onSuccess(i)}.bind(this))}.bind(this))}.bind(this))},verify3dSecureVault:function(e){var t=$$("#creditcard-saved-accounts input:checked[type=radio]").first().getAttribute("data-threedsecure-nonce");t?this.verify3dSecureNonce(t,{onSuccess:function(t){$("creditcard-payment-nonce").removeAttribute("disabled"),$("creditcard-payment-nonce").value=t.nonce,$("creditcard-payment-nonce").setAttribute("value",t.nonce),"function"==typeof e.onSuccess&&e.onSuccess()},onFailure:function(t,i){alert(i),"function"==typeof e.onFailure?e.onFailure():checkout.setLoadWaiting(!1)}}):(alert("No payment nonce present."),"function"==typeof e.onFailure?e.onFailure():checkout.setLoadWaiting(!1))},processCard:function(e){var t=this.getBillingPostcode(),i={};t&&(i={billingAddress:{postalCode:t}}),this._hostedIntegration.tokenize(i,function(t,i){return t?("function"==typeof e.onFailure?e.onFailure():checkout.setLoadWaiting(!1),void("string"==typeof t.message&&alert(t.message))):this.hostedFieldsNonceReceived(i.nonce,e)}.bind(this))},shouldInterceptCreditCard:function(){return"0.00"!=this.amount},shouldInterceptPayPal:function(){return!0},process:function(e){return e=e||{},this._hostedFieldsTokenGenerated||this.usingSavedCard()&&!this.usingSavedThreeDCard()?void("function"==typeof e.onSuccess&&e.onSuccess()):this.usingSavedThreeDCard()?this.verify3dSecureVault(e):this.processCard(e)},creditCardLoaded:function(){return!1},paypalLoaded:function(){return!1},_parseTransportAsJson:function(transport){return transport.responseJSON&&"object"==typeof transport.responseJSON?transport.responseJSON:transport.responseText?"object"==typeof JSON&&"function"==typeof JSON.parse?JSON.parse(transport.responseText):eval("("+transport.responseText+")"):{}}},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,r=window.console=window.console||{};n--;)e=i[n],r[e]||(r[e]=t)}();
js/gene/braintree/2.2.0/vzero-paypal-min.js ADDED
@@ -0,0 +1 @@
 
1
+ var vZeroPayPalButton=Class.create();vZeroPayPalButton.prototype={initialize:function(t,e,n,i,o,r,a){this.clientToken=t||!1,this.clientTokenUrl=a,this.storeFrontName=e,this.singleUse=n,this.locale=i,this.amount=0,this.currency=!1,this.client=!1,this.onlyVaultOnVault=r||!1},getClientToken:function(t){return this.clientToken!==!1?t(this.clientToken):window.braintreeClientToken?t(window.braintreeClientToken):void new Ajax.Request(this.clientTokenUrl,{method:"get",onSuccess:function(e){if(e&&(e.responseJSON||e.responseText)){var n=this._parseTransportAsJson(e);if(1==n.success&&"string"==typeof n.client_token)return this.clientToken=n.client_token,window.braintreeClientToken=n.client_token,t(this.clientToken);console.error("We were unable to retrieve a client token from the server to initialize the Braintree flow."),n.error&&console.error(n.error)}}.bind(this),onFailure:function(){console.error("We were unable to retrieve a client token from the server to initialize the Braintree flow.")}.bind(this)})},getClient:function(t){this.client!==!1?"function"==typeof t&&t(this.client):this.getClientToken(function(e){braintree.client.create({authorization:e},function(e,n){return e?void console.log(e):(this.client=n,void t(this.client))}.bind(this))})},setPricing:function(t,e){this.amount=parseFloat(t),this.currency=e},rebuildButton:function(){return!1},addPayPalButton:function(t,e,n,i){var o;if(e=e||$("braintree-paypal-button").innerHTML,n=n||"#paypal-container",i=i||!1,o="string"==typeof n?$$(n).first():n,!o)return console.warn("Unable to locate container "+n+" for PayPal button."),!1;if(i?o.insert(e):o.update(e),!o.select(">button").length)return console.warn("Unable to find valid <button /> element within container."),!1;var r=o.select(">button").first();r.addClassName("braintree-paypal-loading"),r.setAttribute("disabled","disabled"),this.attachPayPalButtonEvent(r,t)},attachPayPalButtonEvent:function(t,e){this.getClient(function(n){braintree.paypal.create({client:n},function(n,i){return n?(console.error("Error creating PayPal:",n),e.onReady=!1,e.paypalErr=n):e.paypalErr=null,"function"==typeof e.onReady&&e.onReady(i),this._attachPayPalButtonEvent(t,i,e)}.bind(this))}.bind(this))},_attachPayPalButtonEvent:function(t,e,n){(t&&e||null!==n.paypalErr)&&(Array.isArray(t)||(t=[t]),t.each(function(t){t.removeClassName("braintree-paypal-loading"),t.removeAttribute("disabled"),Event.stopObserving(t,"click"),Event.observe(t,"click",function(t){return Event.stop(t),null!==n.paypalErr?void alert(Translator.translate("Paypal is not available ("+n.paypalErr.message+"). Please try an alternative payment method.")):"function"!=typeof n.validate?this._tokenizePayPal(e,n):n.validate()?this._tokenizePayPal(e,n):void 0}.bind(this))}.bind(this)))},_tokenizePayPal:function(t,e){var n=this._buildOptions();"object"==typeof e.tokenizeRequest&&(n=Object.extend(n,e.tokenizeRequest)),t.tokenize(n,function(t,n){return t?void("CUSTOMER"!==t.type&&console.error("Error tokenizing:",t)):void("function"==typeof e.onSuccess&&e.onSuccess(n))}.bind(this))},_buildOptions:function(){var t={displayName:this.storeFrontName,amount:this.amount,currency:this.currency,useraction:"commit",flow:this._getFlow()};return this.locale&&(t.locale=this.locale),t},_getFlow:function(){var t;return t=this.singleUse===!0?"checkout":"vault",null!==$("gene_braintree_paypal_store_in_vault")&&this.onlyVaultOnVault&&"vault"==t&&!$("gene_braintree_paypal_store_in_vault").checked&&(t="checkout"),t},_parseTransportAsJson:function(transport){return transport.responseJSON&&"object"==typeof transport.responseJSON?transport.responseJSON:transport.responseText?"object"==typeof JSON&&"function"==typeof JSON.parse?JSON.parse(transport.responseText):eval("("+transport.responseText+")"):{}}};
js/gene/braintree/config.codekit CHANGED
@@ -1,57 +1,57 @@
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": "19142",
4
  "files": {
5
- "\/2.1.7\/express\/abstract-min.js": {
6
  "fileType": 64,
7
  "ignore": 1,
8
  "ignoreWasSetByUser": 0,
9
- "inputAbbreviatedPath": "\/2.1.7\/express\/abstract-min.js",
10
- "outputAbbreviatedPath": "\/2.1.7\/express\/min\/abstract-min-min.js",
11
  "outputPathIsOutsideProject": 0,
12
  "outputPathIsSetByUser": 0,
13
  "outputStyle": 1,
14
  "syntaxCheckerStyle": 1
15
  },
16
- "\/2.1.7\/express\/paypal-min.js": {
17
  "fileType": 64,
18
  "ignore": 1,
19
  "ignoreWasSetByUser": 0,
20
- "inputAbbreviatedPath": "\/2.1.7\/express\/paypal-min.js",
21
- "outputAbbreviatedPath": "\/2.1.7\/express\/min\/paypal-min-min.js",
22
  "outputPathIsOutsideProject": 0,
23
  "outputPathIsSetByUser": 0,
24
  "outputStyle": 1,
25
  "syntaxCheckerStyle": 1
26
  },
27
- "\/2.1.7\/vzero-integration-min.js": {
28
  "fileType": 64,
29
  "ignore": 1,
30
  "ignoreWasSetByUser": 0,
31
- "inputAbbreviatedPath": "\/2.1.7\/vzero-integration-min.js",
32
- "outputAbbreviatedPath": "\/2.1.7\/min\/vzero-integration-min-min.js",
33
  "outputPathIsOutsideProject": 0,
34
  "outputPathIsSetByUser": 0,
35
  "outputStyle": 1,
36
  "syntaxCheckerStyle": 1
37
  },
38
- "\/2.1.7\/vzero-min.js": {
39
  "fileType": 64,
40
  "ignore": 1,
41
  "ignoreWasSetByUser": 0,
42
- "inputAbbreviatedPath": "\/2.1.7\/vzero-min.js",
43
- "outputAbbreviatedPath": "\/2.1.7\/min\/vzero-min-min.js",
44
  "outputPathIsOutsideProject": 0,
45
  "outputPathIsSetByUser": 0,
46
  "outputStyle": 1,
47
  "syntaxCheckerStyle": 1
48
  },
49
- "\/2.1.7\/vzero-paypal-min.js": {
50
  "fileType": 64,
51
- "ignore": 1,
52
  "ignoreWasSetByUser": 0,
53
- "inputAbbreviatedPath": "\/2.1.7\/vzero-paypal-min.js",
54
- "outputAbbreviatedPath": "\/2.1.7\/min\/vzero-paypal-min-min.js",
55
  "outputPathIsOutsideProject": 0,
56
  "outputPathIsSetByUser": 0,
57
  "outputStyle": 1,
@@ -62,60 +62,60 @@
62
  "ignore": 0,
63
  "ignoreWasSetByUser": 0,
64
  "inputAbbreviatedPath": "\/source\/express\/abstract.js",
65
- "outputAbbreviatedPath": "\/2.1.7\/express\/abstract-min.js",
66
  "outputPathIsOutsideProject": 0,
67
  "outputPathIsSetByUser": 1,
68
  "outputStyle": 1,
69
- "syntaxCheckerStyle": 0
70
  },
71
  "\/source\/express\/paypal.js": {
72
  "fileType": 64,
73
  "ignore": 0,
74
  "ignoreWasSetByUser": 0,
75
  "inputAbbreviatedPath": "\/source\/express\/paypal.js",
76
- "outputAbbreviatedPath": "\/2.1.7\/express\/paypal-min.js",
77
  "outputPathIsOutsideProject": 0,
78
  "outputPathIsSetByUser": 1,
79
  "outputStyle": 1,
80
- "syntaxCheckerStyle": 0
81
  },
82
  "\/source\/vzero-integration.js": {
83
  "fileType": 64,
84
  "ignore": 0,
85
  "ignoreWasSetByUser": 0,
86
  "inputAbbreviatedPath": "\/source\/vzero-integration.js",
87
- "outputAbbreviatedPath": "\/2.1.7\/vzero-integration-min.js",
88
  "outputPathIsOutsideProject": 0,
89
  "outputPathIsSetByUser": 1,
90
  "outputStyle": 1,
91
- "syntaxCheckerStyle": 0
92
  },
93
  "\/source\/vzero-paypal.js": {
94
  "fileType": 64,
95
  "ignore": 0,
96
  "ignoreWasSetByUser": 0,
97
  "inputAbbreviatedPath": "\/source\/vzero-paypal.js",
98
- "outputAbbreviatedPath": "\/2.1.7\/vzero-paypal-min.js",
99
  "outputPathIsOutsideProject": 0,
100
- "outputPathIsSetByUser": 1,
101
  "outputStyle": 1,
102
- "syntaxCheckerStyle": 0
103
  },
104
  "\/source\/vzero.js": {
105
  "fileType": 64,
106
  "ignore": 0,
107
  "ignoreWasSetByUser": 0,
108
  "inputAbbreviatedPath": "\/source\/vzero.js",
109
- "outputAbbreviatedPath": "\/2.1.7\/vzero-min.js",
110
  "outputPathIsOutsideProject": 0,
111
  "outputPathIsSetByUser": 1,
112
  "outputStyle": 1,
113
- "syntaxCheckerStyle": 0
114
  }
115
  },
116
  "hooks": [
117
  ],
118
- "lastSavedByUser": "David Macaulay",
119
  "manualImportLinks": {
120
  },
121
  "projectAttributes": {
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": "19127",
4
  "files": {
5
+ "\/2.2.0\/express\/abstract-min.js": {
6
  "fileType": 64,
7
  "ignore": 1,
8
  "ignoreWasSetByUser": 0,
9
+ "inputAbbreviatedPath": "\/2.2.0\/express\/abstract-min.js",
10
+ "outputAbbreviatedPath": "\/2.2.0\/express\/min\/abstract-min-min.js",
11
  "outputPathIsOutsideProject": 0,
12
  "outputPathIsSetByUser": 0,
13
  "outputStyle": 1,
14
  "syntaxCheckerStyle": 1
15
  },
16
+ "\/2.2.0\/express\/paypal-min.js": {
17
  "fileType": 64,
18
  "ignore": 1,
19
  "ignoreWasSetByUser": 0,
20
+ "inputAbbreviatedPath": "\/2.2.0\/express\/paypal-min.js",
21
+ "outputAbbreviatedPath": "\/2.2.0\/express\/min\/paypal-min-min.js",
22
  "outputPathIsOutsideProject": 0,
23
  "outputPathIsSetByUser": 0,
24
  "outputStyle": 1,
25
  "syntaxCheckerStyle": 1
26
  },
27
+ "\/2.2.0\/vzero-integration-min.js": {
28
  "fileType": 64,
29
  "ignore": 1,
30
  "ignoreWasSetByUser": 0,
31
+ "inputAbbreviatedPath": "\/2.2.0\/vzero-integration-min.js",
32
+ "outputAbbreviatedPath": "\/2.2.0\/min\/vzero-integration-min-min.js",
33
  "outputPathIsOutsideProject": 0,
34
  "outputPathIsSetByUser": 0,
35
  "outputStyle": 1,
36
  "syntaxCheckerStyle": 1
37
  },
38
+ "\/2.2.0\/vzero-min.js": {
39
  "fileType": 64,
40
  "ignore": 1,
41
  "ignoreWasSetByUser": 0,
42
+ "inputAbbreviatedPath": "\/2.2.0\/vzero-min.js",
43
+ "outputAbbreviatedPath": "\/2.2.0\/min\/vzero-min-min.js",
44
  "outputPathIsOutsideProject": 0,
45
  "outputPathIsSetByUser": 0,
46
  "outputStyle": 1,
47
  "syntaxCheckerStyle": 1
48
  },
49
+ "\/2.2.0\/vzero-paypal-min.js": {
50
  "fileType": 64,
51
+ "ignore": 0,
52
  "ignoreWasSetByUser": 0,
53
+ "inputAbbreviatedPath": "\/2.2.0\/vzero-paypal-min.js",
54
+ "outputAbbreviatedPath": "\/2.2.0\/min\/vzero-paypal-min-min.js",
55
  "outputPathIsOutsideProject": 0,
56
  "outputPathIsSetByUser": 0,
57
  "outputStyle": 1,
62
  "ignore": 0,
63
  "ignoreWasSetByUser": 0,
64
  "inputAbbreviatedPath": "\/source\/express\/abstract.js",
65
+ "outputAbbreviatedPath": "\/2.2.0\/express\/abstract-min.js",
66
  "outputPathIsOutsideProject": 0,
67
  "outputPathIsSetByUser": 1,
68
  "outputStyle": 1,
69
+ "syntaxCheckerStyle": 1
70
  },
71
  "\/source\/express\/paypal.js": {
72
  "fileType": 64,
73
  "ignore": 0,
74
  "ignoreWasSetByUser": 0,
75
  "inputAbbreviatedPath": "\/source\/express\/paypal.js",
76
+ "outputAbbreviatedPath": "\/2.2.0\/express\/paypal-min.js",
77
  "outputPathIsOutsideProject": 0,
78
  "outputPathIsSetByUser": 1,
79
  "outputStyle": 1,
80
+ "syntaxCheckerStyle": 1
81
  },
82
  "\/source\/vzero-integration.js": {
83
  "fileType": 64,
84
  "ignore": 0,
85
  "ignoreWasSetByUser": 0,
86
  "inputAbbreviatedPath": "\/source\/vzero-integration.js",
87
+ "outputAbbreviatedPath": "\/2.2.0\/vzero-integration-min.js",
88
  "outputPathIsOutsideProject": 0,
89
  "outputPathIsSetByUser": 1,
90
  "outputStyle": 1,
91
+ "syntaxCheckerStyle": 1
92
  },
93
  "\/source\/vzero-paypal.js": {
94
  "fileType": 64,
95
  "ignore": 0,
96
  "ignoreWasSetByUser": 0,
97
  "inputAbbreviatedPath": "\/source\/vzero-paypal.js",
98
+ "outputAbbreviatedPath": "\/source\/min\/vzero-paypal-min.js",
99
  "outputPathIsOutsideProject": 0,
100
+ "outputPathIsSetByUser": 0,
101
  "outputStyle": 1,
102
+ "syntaxCheckerStyle": 1
103
  },
104
  "\/source\/vzero.js": {
105
  "fileType": 64,
106
  "ignore": 0,
107
  "ignoreWasSetByUser": 0,
108
  "inputAbbreviatedPath": "\/source\/vzero.js",
109
+ "outputAbbreviatedPath": "\/2.2.0\/vzero-min.js",
110
  "outputPathIsOutsideProject": 0,
111
  "outputPathIsSetByUser": 1,
112
  "outputStyle": 1,
113
+ "syntaxCheckerStyle": 1
114
  }
115
  },
116
  "hooks": [
117
  ],
118
+ "lastSavedByUser": "Aidan Threadgold",
119
  "manualImportLinks": {
120
  },
121
  "projectAttributes": {
js/gene/braintree/express/abstract-min.js CHANGED
@@ -1 +1 @@
1
- var BraintreeExpressAbstract=Class.create();BraintreeExpressAbstract.prototype={initialize:function(e,t,o,s,a,n){this.clientToken=e,this.storeFrontName=t,this.formKey=o,this.source=s,this.urls=a,this.config=n||{},this._init(),this.insertDom()},_init:function(){return!1},insertDom:function(){this.getModal()||$$("body").first().insert('<div id="pp-express-overlay"></div><div id="pp-express-modal"></div><div id="pp-express-container"></div>')},getOverlay:function(){return document.getElementById("pp-express-overlay")},getModal:function(){return document.getElementById("pp-express-modal")},hideModal:function(){this.getOverlay().style.display="none",this.getModal().style.display="none",this.getModal().innerHTML=""},showModal:function(){this.getModal().innerHTML="",this.getModal().classList.add("loading"),this.getOverlay().style.display="block",this.getModal().style.display="block"},initModal:function(e){"undefined"==typeof e.form_key&&(e.form_key=this.formKey),"undefined"==typeof e.source&&(e.source=this.source),this.showModal(),new Ajax.Request(this.urls.authUrl,{method:"POST",parameters:e,onSuccess:function(e){this.getModal().classList.remove("loading"),this.getModal().innerHTML=e.responseText,this.prepareCoupon(),this.ajaxHandler()}.bind(this),onFailure:function(){this.hideModal(),alert("object"==typeof Translator?Translator.translate("We were unable to complete the request. Please try again."):"We were unable to complete the request. Please try again.")}.bind(this)})},updateShipping:function(e){this._setLoading($("paypal-express-submit")),new Ajax.Request(this.urls.shippingSaveUrl,{method:"POST",parameters:{submit_shipping:!0,shipping_method:e},onSuccess:function(e){var t=this._getJson(e);this._unsetLoading($("paypal-express-submit")),this._updateTotals(t)}.bind(this),onFailure:function(){this._unsetLoading($("paypal-express-submit")),api.hideModal(),alert("object"==typeof Translator?Translator.translate("We were unable to complete the request. Please try again."):"We were unable to complete the request. Please try again.")}})},prepareCoupon:function(){$("paypal-express-coupon")&&$("paypal-express-coupon").observe("keypress",function(e){var t=e.which||e.keyCode;t==Event.KEY_RETURN&&(Event.stop(e),this.updateCoupon())}.bind(this))},updateCoupon:function(e){return $("paypal-express-coupon-error").hide(),!e&&$("paypal-express-coupon")&&(e=$("paypal-express-coupon").value),""!=e&&(this._setLoading($("paypal-express-coupon-apply")),new Ajax.Request(this.urls.couponSaveUrl,{method:"POST",parameters:{coupon:e},onSuccess:function(e){var t=this._getJson(e);this._unsetLoading($("paypal-express-coupon-apply")),this._updateTotals(t),1==t.success?($("paypal-express-coupon-remove").show(),$("paypal-express-coupon-apply").hide()):t.message&&$("paypal-express-coupon-error").update(t.message).show()}.bind(this),onFailure:function(){this._unsetLoading($("paypal-express-coupon-submit")),api.hideModal(),alert("object"==typeof Translator?Translator.translate("We were unable to complete the request. Please try again."):"We were unable to complete the request. Please try again.")}}),!1)},removeCoupon:function(){$("paypal-express-coupon-error").hide(),this._setLoading($("paypal-express-coupon-remove")),new Ajax.Request(this.urls.couponSaveUrl,{method:"POST",parameters:{remove:!0},onSuccess:function(e){var t=this._getJson(e);this._unsetLoading($("paypal-express-coupon-remove")),this._updateTotals(t),1==t.success?($("paypal-express-coupon-remove").hide(),$("paypal-express-coupon-apply").show(),$("paypal-express-coupon").value="",$("paypal-express-coupon").focus()):t.message&&$("paypal-express-coupon-error").update(t.message).show()}.bind(this),onFailure:function(){this._unsetLoading($("paypal-express-coupon-submit")),api.hideModal(),alert("object"==typeof Translator?Translator.translate("We were unable to complete the request. Please try again."):"We were unable to complete the request. Please try again.")}})},_updateTotals:function(e){"undefined"!=typeof e.totals&&$("paypal-express-totals").update(e.totals)},_getJson:function(e){return"undefined"!=typeof e.responseJSON?e.responseJSON:"string"==typeof e.responseText?e.responseText.evalJSON():void 0},_setLoading:function(e){return!!e&&(e.setAttribute("disabled","disabled"),void e.addClassName("loading"))},_unsetLoading:function(e){return!!e&&(e.removeAttribute("disabled"),void e.removeClassName("loading"))},ajaxHandler:function(){var e=this.getModal().getElementsByTagName("form"),t=0;if(e.length>0)for(t=0;t<e.length;t++)Element.observe(e[t],"submit",function(e){return Event.stop(e),this.getModal().classList.add("loading"),this.getModal().innerHTML="",new Ajax.Request(e.target.getAttribute("action"),{method:"POST",parameters:$(e.target).serialize(!0),onSuccess:function(e){return"complete"==e.responseText?void(document.location=this.urls.successUrl):(this.getModal().classList.remove("loading"),this.getModal().innerHTML=e.responseText,void this.ajaxHandler())}.bind(this),onFailure:function(){this.hideModal(),alert("object"==typeof Translator?Translator.translate("We were unable to complete the request. Please try again."):"We were unable to complete the request. Please try again.")}.bind(this)}),!1}.bind(this))},validateForm:function(){if("object"==typeof productAddToCartForm&&productAddToCartForm.validator.validate()){if("object"==typeof productAddToCartFormOld&&productAddToCartFormOld.validator.validate())return!0;if("object"!=typeof productAddToCartFormOld)return!0}return"object"!=typeof productAddToCartForm&&"object"!=typeof productAddToCartFormOld},attachToButtons:function(e){console.warn("This method cannot be called directly.")}};
1
+ var BraintreeExpressAbstract=Class.create();BraintreeExpressAbstract.prototype={initialize:function(e,t,o,s,a,n){this.clientToken=e||!1,this.storeFrontName=t,this.formKey=o,this.source=s,this.urls=a,this.config=n||{},this._init(),this.insertDom()},_init:function(){return!1},insertDom:function(){this.getModal()||$$("body").first().insert('<div id="pp-express-overlay"></div><div id="pp-express-modal"></div><div id="pp-express-container"></div>')},getOverlay:function(){return document.getElementById("pp-express-overlay")},getModal:function(){return document.getElementById("pp-express-modal")},hideModal:function(){this.getOverlay().style.display="none",this.getModal().style.display="none",this.getModal().innerHTML=""},showModal:function(){this.getModal().innerHTML="",this.getModal().classList.add("loading"),this.getOverlay().style.display="block",this.getModal().style.display="block"},initModal:function(e){"undefined"==typeof e.form_key&&(e.form_key=this.formKey),"undefined"==typeof e.source&&(e.source=this.source),this.showModal(),new Ajax.Request(this.urls.authUrl,{method:"POST",parameters:e,onSuccess:function(e){this.getModal().classList.remove("loading"),this.getModal().innerHTML=e.responseText,this.prepareCoupon(),this.ajaxHandler()}.bind(this),onFailure:function(){this.hideModal(),alert("object"==typeof Translator?Translator.translate("We were unable to complete the request. Please try again."):"We were unable to complete the request. Please try again.")}.bind(this)})},updateShipping:function(e){this._setLoading($("paypal-express-submit")),new Ajax.Request(this.urls.shippingSaveUrl,{method:"POST",parameters:{submit_shipping:!0,shipping_method:e},onSuccess:function(e){var t=this._getJson(e);this._unsetLoading($("paypal-express-submit")),this._updateTotals(t)}.bind(this),onFailure:function(){this._unsetLoading($("paypal-express-submit")),api.hideModal(),alert("object"==typeof Translator?Translator.translate("We were unable to complete the request. Please try again."):"We were unable to complete the request. Please try again.")}})},prepareCoupon:function(){$("paypal-express-coupon")&&$("paypal-express-coupon").observe("keypress",function(e){var t=e.which||e.keyCode;t==Event.KEY_RETURN&&(Event.stop(e),this.updateCoupon())}.bind(this))},updateCoupon:function(e){return $("paypal-express-coupon-error").hide(),!e&&$("paypal-express-coupon")&&(e=$("paypal-express-coupon").value),""==e?!1:(this._setLoading($("paypal-express-coupon-apply")),new Ajax.Request(this.urls.couponSaveUrl,{method:"POST",parameters:{coupon:e},onSuccess:function(e){var t=this._getJson(e);this._unsetLoading($("paypal-express-coupon-apply")),this._updateTotals(t),1==t.success?($("paypal-express-coupon-remove").show(),$("paypal-express-coupon-apply").hide()):t.message&&$("paypal-express-coupon-error").update(t.message).show()}.bind(this),onFailure:function(){this._unsetLoading($("paypal-express-coupon-submit")),api.hideModal(),alert("object"==typeof Translator?Translator.translate("We were unable to complete the request. Please try again."):"We were unable to complete the request. Please try again.")}}),!1)},removeCoupon:function(){$("paypal-express-coupon-error").hide(),this._setLoading($("paypal-express-coupon-remove")),new Ajax.Request(this.urls.couponSaveUrl,{method:"POST",parameters:{remove:!0},onSuccess:function(e){var t=this._getJson(e);this._unsetLoading($("paypal-express-coupon-remove")),this._updateTotals(t),1==t.success?($("paypal-express-coupon-remove").hide(),$("paypal-express-coupon-apply").show(),$("paypal-express-coupon").value="",$("paypal-express-coupon").focus()):t.message&&$("paypal-express-coupon-error").update(t.message).show()}.bind(this),onFailure:function(){this._unsetLoading($("paypal-express-coupon-submit")),api.hideModal(),alert("object"==typeof Translator?Translator.translate("We were unable to complete the request. Please try again."):"We were unable to complete the request. Please try again.")}})},_updateTotals:function(e){"undefined"!=typeof e.totals&&$("paypal-express-totals").update(e.totals)},_getJson:function(e){return"undefined"!=typeof e.responseJSON?e.responseJSON:"string"==typeof e.responseText?e.responseText.evalJSON():void 0},_setLoading:function(e){return e?(e.setAttribute("disabled","disabled"),void e.addClassName("loading")):!1},_unsetLoading:function(e){return e?(e.removeAttribute("disabled"),void e.removeClassName("loading")):!1},ajaxHandler:function(){var e=this.getModal().getElementsByTagName("form"),t=0;if(e.length>0)for(t=0;t<e.length;t++)Element.observe(e[t],"submit",function(e){return Event.stop(e),this.getModal().classList.add("loading"),this.getModal().innerHTML="",new Ajax.Request(e.target.getAttribute("action"),{method:"POST",parameters:$(e.target).serialize(!0),onSuccess:function(e){return"complete"==e.responseText?void(document.location=this.urls.successUrl):(this.getModal().classList.remove("loading"),this.getModal().innerHTML=e.responseText,void this.ajaxHandler())}.bind(this),onFailure:function(){this.hideModal(),alert("object"==typeof Translator?Translator.translate("We were unable to complete the request. Please try again."):"We were unable to complete the request. Please try again.")}.bind(this)}),!1}.bind(this))},validateForm:function(){if("object"==typeof productAddToCartForm&&productAddToCartForm.validator.validate()){if("object"==typeof productAddToCartFormOld&&productAddToCartFormOld.validator.validate())return!0;if("object"!=typeof productAddToCartFormOld)return!0}return"object"!=typeof productAddToCartForm&&"object"!=typeof productAddToCartFormOld},attachToButtons:function(e){console.warn("This method cannot be called directly.")}};
js/gene/braintree/source/express/abstract.js CHANGED
@@ -3,7 +3,7 @@
3
  *
4
  * @class BraintreeExpressAbstract
5
  *
6
- * @author Dave Macaulay <dave@gene.co.uk>
7
  */
8
  var BraintreeExpressAbstract = Class.create();
9
  BraintreeExpressAbstract.prototype = {
@@ -14,11 +14,12 @@ BraintreeExpressAbstract.prototype = {
14
  * @param clientToken Client token generated from server
15
  * @param storeFrontName The store name to show within the PayPal modal window
16
  * @param formKey
 
17
  * @param urls
18
  * @param config
19
  */
20
  initialize: function (clientToken, storeFrontName, formKey, source, urls, config) {
21
- this.clientToken = clientToken;
22
  this.storeFrontName = storeFrontName;
23
  this.formKey = formKey;
24
  this.source = source;
3
  *
4
  * @class BraintreeExpressAbstract
5
  *
6
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
7
  */
8
  var BraintreeExpressAbstract = Class.create();
9
  BraintreeExpressAbstract.prototype = {
14
  * @param clientToken Client token generated from server
15
  * @param storeFrontName The store name to show within the PayPal modal window
16
  * @param formKey
17
+ * @param source
18
  * @param urls
19
  * @param config
20
  */
21
  initialize: function (clientToken, storeFrontName, formKey, source, urls, config) {
22
+ this.clientToken = clientToken || false;
23
  this.storeFrontName = storeFrontName;
24
  this.formKey = formKey;
25
  this.source = source;
js/gene/braintree/source/express/paypal.js CHANGED
@@ -8,10 +8,13 @@ var BraintreePayPalExpress = Class.create(BraintreeExpressAbstract, {
8
  */
9
  _init: function () {
10
  this.vzeroPayPal = new vZeroPayPalButton(
11
- this.config.token,
12
  '',
13
  false, /* Vault flow forced as the final amount can change */
14
- this.config.locale
 
 
 
15
  );
16
  },
17
 
8
  */
9
  _init: function () {
10
  this.vzeroPayPal = new vZeroPayPalButton(
11
+ false,
12
  '',
13
  false, /* Vault flow forced as the final amount can change */
14
+ this.config.locale,
15
+ false,
16
+ false,
17
+ this.urls.clientTokenUrl
18
  );
19
  },
20
 
js/gene/braintree/source/vzero-integration.js CHANGED
@@ -2,7 +2,7 @@
2
  * The integration class for the Default checkout
3
  *
4
  * @class vZeroIntegration
5
- * @author Dave Macaulay <dave@gene.co.uk>
6
  */
7
  var vZeroIntegration = Class.create();
8
  vZeroIntegration.prototype = {
@@ -323,7 +323,8 @@ vZeroIntegration.prototype = {
323
  'number': Translator.translate('Card Number'),
324
  'expirationMonth': Translator.translate('Expiry Month'),
325
  'expirationYear': Translator.translate('Expiry Year'),
326
- 'cvv': Translator.translate('CVV')
 
327
  };
328
 
329
  // Loop through each field and ensure it's validity
@@ -580,6 +581,10 @@ vZeroIntegration.prototype = {
580
  this.vzero._hostedFieldsTokenGenerated = false;
581
  this.hostedFieldsGenerated = false;
582
 
 
 
 
 
583
  this.resetLoading();
584
  this.afterSubmit();
585
  if (typeof failedCallback === 'function') {
@@ -744,7 +749,16 @@ vZeroIntegration.prototype = {
744
  */
745
  afterPayPalComplete: function () {
746
  this.resetLoading();
747
- return this.submitCheckout();
 
 
 
 
 
 
 
 
 
748
  },
749
 
750
  /**
2
  * The integration class for the Default checkout
3
  *
4
  * @class vZeroIntegration
5
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
6
  */
7
  var vZeroIntegration = Class.create();
8
  vZeroIntegration.prototype = {
323
  'number': Translator.translate('Card Number'),
324
  'expirationMonth': Translator.translate('Expiry Month'),
325
  'expirationYear': Translator.translate('Expiry Year'),
326
+ 'cvv': Translator.translate('CVV'),
327
+ 'postalCode': Translator.translate('Postal Code')
328
  };
329
 
330
  // Loop through each field and ensure it's validity
581
  this.vzero._hostedFieldsTokenGenerated = false;
582
  this.hostedFieldsGenerated = false;
583
 
584
+ alert(Translator.translate(
585
+ 'We\'re unable to process your payment, please try another card or payment method.'
586
+ ));
587
+
588
  this.resetLoading();
589
  this.afterSubmit();
590
  if (typeof failedCallback === 'function') {
749
  */
750
  afterPayPalComplete: function () {
751
  this.resetLoading();
752
+
753
+ // Re-show the original placeorder button if present; binding only our submit method to the element
754
+ var btn = $$(this.paypalButtonClass).first();
755
+ if (btn) {
756
+ btn.stopObserving('click').observe('click', this.submitCheckout);
757
+ this.updatePayPalButton('remove');
758
+ return true;
759
+ } else {
760
+ return this.submitCheckout();
761
+ }
762
  },
763
 
764
  /**
js/gene/braintree/source/vzero-paypal.js CHANGED
@@ -2,7 +2,7 @@
2
  * Separate class to handle functionality around the vZero PayPal button
3
  *
4
  * @class vZeroPayPalButton
5
- * @author Dave Macaulay <dave@gene.co.uk>
6
  */
7
  var vZeroPayPalButton = Class.create();
8
  vZeroPayPalButton.prototype = {
@@ -16,9 +16,11 @@ vZeroPayPalButton.prototype = {
16
  * @param locale The locale for the payment
17
  * @param futureSingleUse When using future payments should we process the transaction as a single payment?
18
  * @param onlyVaultOnVault Should we only show the Vault flow if the customer has opted into saving their details?
 
19
  */
20
- initialize: function (clientToken, storeFrontName, singleUse, locale, futureSingleUse, onlyVaultOnVault) {
21
- this.clientToken = clientToken;
 
22
  this.storeFrontName = storeFrontName;
23
  this.singleUse = singleUse;
24
  this.locale = locale;
@@ -32,6 +34,47 @@ vZeroPayPalButton.prototype = {
32
  this.onlyVaultOnVault = onlyVaultOnVault || false;
33
  },
34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  /**
36
  * Retrieve the client from the class, or initialize the client if not already present
37
  *
@@ -43,19 +86,22 @@ vZeroPayPalButton.prototype = {
43
  callbackFn(this.client);
44
  }
45
  } else {
46
- // Create a new braintree client instance
47
- braintree.client.create({
48
- authorization: this.clientToken
49
- }, function (clientErr, clientInstance) {
50
- if (clientErr) {
51
- // Handle error in client creation
52
- console.log(clientErr);
53
- return;
54
- }
 
 
55
 
56
- this.client = clientInstance;
57
- callbackFn(this.client);
58
- }.bind(this));
 
59
  }
60
  },
61
 
@@ -147,7 +193,10 @@ vZeroPayPalButton.prototype = {
147
  }, function (paypalErr, paypalInstance) {
148
  if (paypalErr) {
149
  console.error('Error creating PayPal:', paypalErr);
150
- return;
 
 
 
151
  }
152
 
153
  // Run the onReady callback
@@ -171,7 +220,7 @@ vZeroPayPalButton.prototype = {
171
  * @private
172
  */
173
  _attachPayPalButtonEvent: function (buttons, paypalInstance, options) {
174
- if (buttons && paypalInstance) {
175
 
176
  // Convert the buttons to an array and handle them all at once
177
  if (!Array.isArray(buttons)) {
@@ -189,6 +238,12 @@ vZeroPayPalButton.prototype = {
189
  // Observe the click event to fire the tokenization of PayPal (ie open the window)
190
  Event.observe(button, 'click', function (event) {
191
  Event.stop(event);
 
 
 
 
 
 
192
  if (typeof options.validate === 'function') {
193
  if (options.validate()) {
194
  // Fire the integration
@@ -288,5 +343,26 @@ vZeroPayPalButton.prototype = {
288
  }
289
 
290
  return flow;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
291
  }
292
  };
2
  * Separate class to handle functionality around the vZero PayPal button
3
  *
4
  * @class vZeroPayPalButton
5
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
6
  */
7
  var vZeroPayPalButton = Class.create();
8
  vZeroPayPalButton.prototype = {
16
  * @param locale The locale for the payment
17
  * @param futureSingleUse When using future payments should we process the transaction as a single payment?
18
  * @param onlyVaultOnVault Should we only show the Vault flow if the customer has opted into saving their details?
19
+ * @param clientTokenUrl URL to retrieve client token from
20
  */
21
+ initialize: function (clientToken, storeFrontName, singleUse, locale, futureSingleUse, onlyVaultOnVault, clientTokenUrl) {
22
+ this.clientToken = clientToken || false;
23
+ this.clientTokenUrl = clientTokenUrl;
24
  this.storeFrontName = storeFrontName;
25
  this.singleUse = singleUse;
26
  this.locale = locale;
34
  this.onlyVaultOnVault = onlyVaultOnVault || false;
35
  },
36
 
37
+ /**
38
+ * Retrieve the client token
39
+ *
40
+ * @param callbackFn
41
+ * @returns {*}
42
+ */
43
+ getClientToken: function (callbackFn) {
44
+ if (this.clientToken !== false) {
45
+ return callbackFn(this.clientToken);
46
+ } else if (window.braintreeClientToken) {
47
+ return callbackFn(window.braintreeClientToken);
48
+ } else {
49
+ new Ajax.Request(
50
+ this.clientTokenUrl,
51
+ {
52
+ method: 'get',
53
+ onSuccess: function (transport) {
54
+ // Verify we have some response text
55
+ if (transport && (transport.responseJSON || transport.responseText)) {
56
+ // Parse the response from the server
57
+ var response = this._parseTransportAsJson(transport);
58
+ if (response.success == true && typeof response.client_token === 'string') {
59
+ this.clientToken = response.client_token;
60
+ window.braintreeClientToken = response.client_token;
61
+ return callbackFn(this.clientToken);
62
+ } else {
63
+ console.error('We were unable to retrieve a client token from the server to initialize the Braintree flow.');
64
+ if (response.error) {
65
+ console.error(response.error);
66
+ }
67
+ }
68
+ }
69
+ }.bind(this),
70
+ onFailure: function () {
71
+ console.error('We were unable to retrieve a client token from the server to initialize the Braintree flow.');
72
+ }.bind(this)
73
+ }
74
+ );
75
+ }
76
+ },
77
+
78
  /**
79
  * Retrieve the client from the class, or initialize the client if not already present
80
  *
86
  callbackFn(this.client);
87
  }
88
  } else {
89
+ // Retrieve a client token
90
+ this.getClientToken(function (clientToken) {
91
+ // Create a new braintree client instance
92
+ braintree.client.create({
93
+ authorization: clientToken
94
+ }, function (clientErr, clientInstance) {
95
+ if (clientErr) {
96
+ // Handle error in client creation
97
+ console.log(clientErr);
98
+ return;
99
+ }
100
 
101
+ this.client = clientInstance;
102
+ callbackFn(this.client);
103
+ }.bind(this));
104
+ });
105
  }
106
  },
107
 
193
  }, function (paypalErr, paypalInstance) {
194
  if (paypalErr) {
195
  console.error('Error creating PayPal:', paypalErr);
196
+ options.onReady = false;
197
+ options.paypalErr = paypalErr;
198
+ } else {
199
+ options.paypalErr = null;
200
  }
201
 
202
  // Run the onReady callback
220
  * @private
221
  */
222
  _attachPayPalButtonEvent: function (buttons, paypalInstance, options) {
223
+ if (buttons && paypalInstance || options.paypalErr !== null) {
224
 
225
  // Convert the buttons to an array and handle them all at once
226
  if (!Array.isArray(buttons)) {
238
  // Observe the click event to fire the tokenization of PayPal (ie open the window)
239
  Event.observe(button, 'click', function (event) {
240
  Event.stop(event);
241
+
242
+ if (options.paypalErr !== null) {
243
+ alert(Translator.translate('Paypal is not available (' + options.paypalErr.message + '). Please try an alternative payment method.'));
244
+ return;
245
+ }
246
+
247
  if (typeof options.validate === 'function') {
248
  if (options.validate()) {
249
  // Fire the integration
343
  }
344
 
345
  return flow;
346
+ },
347
+
348
+ /**
349
+ * Parse a transports response into JSON
350
+ *
351
+ * @param transport
352
+ * @returns {*}
353
+ * @private
354
+ */
355
+ _parseTransportAsJson: function (transport) {
356
+ if (transport.responseJSON && typeof transport.responseJSON === 'object') {
357
+ return transport.responseJSON;
358
+ } else if (transport.responseText) {
359
+ if (typeof JSON === 'object' && typeof JSON.parse === 'function') {
360
+ return JSON.parse(transport.responseText);
361
+ } else {
362
+ return eval('(' + transport.responseText + ')');
363
+ }
364
+ }
365
+
366
+ return {};
367
  }
368
  };
js/gene/braintree/source/vzero.js CHANGED
@@ -2,7 +2,7 @@
2
  * Magento Braintree class to bridge the v.zero JS SDK and Magento
3
  *
4
  * @class vZero
5
- * @author Dave Macaulay <dave@gene.co.uk>
6
  */
7
  var vZero = Class.create();
8
  vZero.prototype = {
@@ -18,10 +18,12 @@ vZero.prototype = {
18
  * @param billingPostcode Billing postcode also needed to verify the card
19
  * @param quoteUrl The URL to update the quote totals
20
  * @param tokenizeUrl The URL to re-tokenize 3D secure cards
 
21
  */
22
- initialize: function (code, clientToken, threeDSecure, hostedFields, billingName, billingPostcode, quoteUrl, tokenizeUrl) {
23
  this.code = code;
24
- this.clientToken = clientToken;
 
25
  this.threeDSecure = threeDSecure;
26
  this.hostedFields = hostedFields; /* deprecated, hosted fields is the only option */
27
 
@@ -192,6 +194,47 @@ vZero.prototype = {
192
  }, this.events)
193
  },
194
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
  /**
196
  * Retrieve the client from the class, or initialize the client if not already present
197
  *
@@ -203,19 +246,22 @@ vZero.prototype = {
203
  callbackFn(this.client);
204
  }
205
  } else {
206
- // Create a new braintree client instance
207
- braintree.client.create({
208
- authorization: this.clientToken
209
- }, function (clientErr, clientInstance) {
210
- if (clientErr) {
211
- // Handle error in client creation
212
- console.error(clientErr);
213
- return;
214
- }
 
 
215
 
216
- this.client = clientInstance;
217
- callbackFn(this.client);
218
- }.bind(this));
 
219
  }
220
  },
221
 
@@ -298,6 +344,8 @@ vZero.prototype = {
298
 
299
  this._hostedIntegration = false;
300
 
 
 
301
  // Retrieve the client from the class
302
  this.getClient(function (clientInstance) {
303
  // Build our hosted fields options
@@ -328,9 +376,11 @@ vZero.prototype = {
328
  }
329
 
330
  // Detect if AVS is enabled, if so we need to display a postal code field
331
- var config = clientInstance.getConfiguration();
 
332
  if (typeof config.gatewayConfiguration.challenges === 'object'
333
  && config.gatewayConfiguration.challenges.indexOf('postal_code') !== -1
 
334
  ) {
335
  if ($$('.braintree-avs-postal-code').first() == undefined) {
336
  console.error('We\'ve detected you have AVS rules enabled, however the braintree-avs-postal-code field is not present in your Hosted Fields form. Please ensure you haven\'t overriden hostedfields.phtml and if you have please update it.');
@@ -340,7 +390,7 @@ vZero.prototype = {
340
  selector: "#postal-code"
341
  };
342
  }
343
- }
344
 
345
  // Create a new instance of hosted fields
346
  braintree.hostedFields.create(options, function (hostedFieldsErr, hostedFieldsInstance) {
@@ -375,19 +425,28 @@ vZero.prototype = {
375
  $$('#credit-card-form.loading').first().removeClassName('loading');
376
  }
377
 
 
 
 
 
 
 
 
 
 
 
378
  // Will this checkout submit the payment after the "payment" step. This is typically used in non one step checkouts
379
  // which contains a review step.
380
  if (this.integration.submitAfterPayment) {
381
- var input = new Element('input', {type: 'hidden', name: 'payment[submit_after_payment]', value: 1, id: 'braintree-submit-after-payment'});
382
- $('payment_form_gene_braintree_creditcard').insert(input);
 
 
383
  } else {
384
  if ($('braintree-submit-after-payment')) {
385
  $('braintree-submit-after-payment').remove();
386
  }
387
  }
388
-
389
- // Handle card type changes
390
- integration.on('cardTypeChange', this.hostedFieldsCardTypeChange.bind(this));
391
  },
392
 
393
  /**
@@ -686,22 +745,26 @@ vZero.prototype = {
686
  },
687
 
688
  /**
689
- * Return the billing name
690
  *
691
  * @returns {*}
692
  */
693
  getBillingPostcode: function () {
694
 
695
- // If billingName is an object we're wanting to grab the data from elements
696
- if (typeof this.billingPostcode == 'object') {
 
 
697
 
698
  // Combine them with a space
699
  return this.combineElementsValues(this.billingPostcode);
700
-
701
  } else {
 
 
 
 
702
 
703
- // Otherwise we can presume that the billing name is a string
704
- return this.billingPostcode;
705
  }
706
  },
707
 
@@ -906,7 +969,7 @@ vZero.prototype = {
906
  var callbacks = this._updateDataCallbacks;
907
  this._updateDataCallbacks = [];
908
 
909
- this.fireEvent(this, 'integration.onBeforeUpdateData', {params: params});
910
 
911
  // Make a new ajax request to the server
912
  new Ajax.Request(
@@ -1148,8 +1211,20 @@ vZero.prototype = {
1148
  */
1149
  processCard: function (options) {
1150
 
 
 
 
 
 
 
 
 
 
 
 
 
1151
  // Tokenize using hosted fields
1152
- this._hostedIntegration.tokenize(function (tokenizeErr, payload) {
1153
  if (tokenizeErr) {
1154
 
1155
  if (typeof options.onFailure === 'function') {
2
  * Magento Braintree class to bridge the v.zero JS SDK and Magento
3
  *
4
  * @class vZero
5
+ * @author Dave Macaulay <braintreesupport@gene.co.uk>
6
  */
7
  var vZero = Class.create();
8
  vZero.prototype = {
18
  * @param billingPostcode Billing postcode also needed to verify the card
19
  * @param quoteUrl The URL to update the quote totals
20
  * @param tokenizeUrl The URL to re-tokenize 3D secure cards
21
+ * @param clientTokenUrl Ajax end point to retrieve client token
22
  */
23
+ initialize: function (code, clientToken, threeDSecure, hostedFields, billingName, billingPostcode, quoteUrl, tokenizeUrl, clientTokenUrl) {
24
  this.code = code;
25
+ this.clientToken = clientToken || false;
26
+ this.clientTokenUrl = clientTokenUrl;
27
  this.threeDSecure = threeDSecure;
28
  this.hostedFields = hostedFields; /* deprecated, hosted fields is the only option */
29
 
194
  }, this.events)
195
  },
196
 
197
+ /**
198
+ * Retrieve the client token
199
+ *
200
+ * @param callbackFn
201
+ * @returns {*}
202
+ */
203
+ getClientToken: function (callbackFn) {
204
+ if (this.clientToken !== false) {
205
+ return callbackFn(this.clientToken);
206
+ } else if (window.braintreeClientToken) {
207
+ return callbackFn(window.braintreeClientToken);
208
+ } else {
209
+ new Ajax.Request(
210
+ this.clientTokenUrl,
211
+ {
212
+ method: 'get',
213
+ onSuccess: function (transport) {
214
+ // Verify we have some response text
215
+ if (transport && (transport.responseJSON || transport.responseText)) {
216
+ // Parse the response from the server
217
+ var response = this._parseTransportAsJson(transport);
218
+ if (response.success == true && typeof response.client_token === 'string') {
219
+ this.clientToken = response.client_token;
220
+ window.braintreeClientToken = response.client_token;
221
+ return callbackFn(this.clientToken);
222
+ } else {
223
+ console.error('We were unable to retrieve a client token from the server to initialize the Braintree flow.');
224
+ if (response.error) {
225
+ console.error(response.error);
226
+ }
227
+ }
228
+ }
229
+ }.bind(this),
230
+ onFailure: function () {
231
+ console.error('We were unable to retrieve a client token from the server to initialize the Braintree flow.');
232
+ }.bind(this)
233
+ }
234
+ );
235
+ }
236
+ },
237
+
238
  /**
239
  * Retrieve the client from the class, or initialize the client if not already present
240
  *
246
  callbackFn(this.client);
247
  }
248
  } else {
249
+ // Retrieve a client token
250
+ this.getClientToken(function (clientToken) {
251
+ // Create a new braintree client instance
252
+ braintree.client.create({
253
+ authorization: clientToken
254
+ }, function (clientErr, clientInstance) {
255
+ if (clientErr) {
256
+ // Handle error in client creation
257
+ console.error(clientErr);
258
+ return;
259
+ }
260
 
261
+ this.client = clientInstance;
262
+ callbackFn(this.client);
263
+ }.bind(this));
264
+ });
265
  }
266
  },
267
 
344
 
345
  this._hostedIntegration = false;
346
 
347
+ this.checkSubmitAfterPayment();
348
+
349
  // Retrieve the client from the class
350
  this.getClient(function (clientInstance) {
351
  // Build our hosted fields options
376
  }
377
 
378
  // Detect if AVS is enabled, if so we need to display a postal code field
379
+ // Don't show the field if we've got a billing address postcode
380
+ /*var config = clientInstance.getConfiguration();
381
  if (typeof config.gatewayConfiguration.challenges === 'object'
382
  && config.gatewayConfiguration.challenges.indexOf('postal_code') !== -1
383
+ && !this.getBillingPostcode()
384
  ) {
385
  if ($$('.braintree-avs-postal-code').first() == undefined) {
386
  console.error('We\'ve detected you have AVS rules enabled, however the braintree-avs-postal-code field is not present in your Hosted Fields form. Please ensure you haven\'t overriden hostedfields.phtml and if you have please update it.');
390
  selector: "#postal-code"
391
  };
392
  }
393
+ }*/
394
 
395
  // Create a new instance of hosted fields
396
  braintree.hostedFields.create(options, function (hostedFieldsErr, hostedFieldsInstance) {
425
  $$('#credit-card-form.loading').first().removeClassName('loading');
426
  }
427
 
428
+ this.checkSubmitAfterPayment();
429
+
430
+ // Handle card type changes
431
+ integration.on('cardTypeChange', this.hostedFieldsCardTypeChange.bind(this));
432
+ },
433
+
434
+ /**
435
+ * Check if the submit after payment should be present on the page
436
+ */
437
+ checkSubmitAfterPayment: function () {
438
  // Will this checkout submit the payment after the "payment" step. This is typically used in non one step checkouts
439
  // which contains a review step.
440
  if (this.integration.submitAfterPayment) {
441
+ if ($('braintree-submit-after-payment') == null) {
442
+ var input = new Element('input', {type: 'hidden', name: 'payment[submit_after_payment]', value: 1, id: 'braintree-submit-after-payment'});
443
+ $('payment_form_gene_braintree_creditcard').insert(input);
444
+ }
445
  } else {
446
  if ($('braintree-submit-after-payment')) {
447
  $('braintree-submit-after-payment').remove();
448
  }
449
  }
 
 
 
450
  },
451
 
452
  /**
745
  },
746
 
747
  /**
748
+ * Return the billing post code
749
  *
750
  * @returns {*}
751
  */
752
  getBillingPostcode: function () {
753
 
754
+ if (typeof this.billingPostcode == 'string') {
755
+ return this.billingPostcode;
756
+ } else if (typeof this.billingPostcode == 'object') {
757
+ // If billingName is an object we're wanting to grab the data from elements
758
 
759
  // Combine them with a space
760
  return this.combineElementsValues(this.billingPostcode);
 
761
  } else {
762
+ var billing = this.getBillingAddress();
763
+ if (typeof billing['billing[postcode]'] !== 'undefined') {
764
+ return billing['billing[postcode]'];
765
+ }
766
 
767
+ return null;
 
768
  }
769
  },
770
 
969
  var callbacks = this._updateDataCallbacks;
970
  this._updateDataCallbacks = [];
971
 
972
+ this.fireEvent(this, 'onBeforeUpdateData', {params: params});
973
 
974
  // Make a new ajax request to the server
975
  new Ajax.Request(
1211
  */
1212
  processCard: function (options) {
1213
 
1214
+ // Retrieve billing address postcode & pass to api (as of SDK 3.9.0)
1215
+ var postcode = this.getBillingPostcode(),
1216
+ opt = {};
1217
+
1218
+ if (postcode) {
1219
+ opt = {
1220
+ billingAddress: {
1221
+ postalCode: postcode
1222
+ }
1223
+ };
1224
+ }
1225
+
1226
  // Tokenize using hosted fields
1227
+ this._hostedIntegration.tokenize(opt, function (tokenizeErr, payload) {
1228
  if (tokenizeErr) {
1229
 
1230
  if (typeof options.onFailure === 'function') {
lib/Gene/Braintree/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit1cd38e0f29a1c6b6e1f3050b1abed83f::getLoader();
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit7455c3ad034c8ce201482929f9f6ebca::getLoader();
lib/Gene/Braintree/braintree/braintree_php/ACKNOWLEDGEMENTS.md ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ Acknowledgements
2
+ ----------------
3
+
4
+ The Braintree SDK uses code from the following libraries:
5
+
6
+ * [phpunit](https://github.com/sebastianbergmann/phpunit), BSD-3-Clause License
lib/Gene/Braintree/braintree/braintree_php/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ## 3.17.0
2
  * Add 'UsBankAccount' payment method
3
 
@@ -10,6 +30,8 @@
10
  * Add 'default_payment_method' option for Customer
11
 
12
  ## 3.14.0
 
 
13
  * Add OrderId to refund
14
  * Add 3DS Pass thru support
15
  * Expose IDs in resource collections
1
+ ## 3.21.1
2
+ * Add back in `options->three_d_secure` to transaction params that was accidentally removed in v3.14.0
3
+
4
+ ## 3.21.0
5
+ * Allow optional configuration of SSL version
6
+ * Replace `var_dump` with `print_r`. Thanks, @mnlg
7
+ * Add functionality to list all merchant accounts for a merchant with `merchantAccount->all`
8
+ * Stop sending account_description field from us bank accounts
9
+
10
+ ## 3.20.0
11
+ * Add option `skip_advanced_fraud_check` for transaction flows
12
+
13
+ ## 3.19.0
14
+ * Add multi-currency updates to merchants onboarded through Braintree Auth
15
+ * Raise an exception if fetching pages of results times out during a transaction search
16
+
17
+ ## 3.18.0
18
+ * Fix `UsBankAccount` support for `Customer`s
19
+ * Update `Grant` api to support options hash
20
+
21
  ## 3.17.0
22
  * Add 'UsBankAccount' payment method
23
 
30
  * Add 'default_payment_method' option for Customer
31
 
32
  ## 3.14.0
33
+ **Note: This version introduced an unintentional breaking change where the `options->three_d_secure` transaction parameter was changed to `options->threeDSecure`. Starting in v3.21.1, both case conventions are supported for backwards compatibility.**
34
+
35
  * Add OrderId to refund
36
  * Add 3DS Pass thru support
37
  * Expose IDs in resource collections
lib/Gene/Braintree/braintree/braintree_php/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Braintree PHP Client Library
2
 
3
  The Braintree PHP library provides integration access to the Braintree Gateway.
4
 
@@ -47,6 +47,15 @@ if ($result->success) {
47
  }
48
  ```
49
 
 
 
 
 
 
 
 
 
 
50
  ## HHVM Support
51
 
52
  The Braintree PHP library will run on HHVM >= 3.4.2.
@@ -68,10 +77,6 @@ The benefit of the `rake` tasks is that testing covers default `hhvm` and `php`
68
  phpunit tests/unit/
69
  ```
70
 
71
- ## Open Source Attribution
72
-
73
- A list of open source projects that help power Braintree can be found [here](https://www.braintreepayments.com/developers/open-source).
74
-
75
  ## License
76
 
77
  See the LICENSE file.
1
+ # Braintree PHP Server Library
2
 
3
  The Braintree PHP library provides integration access to the Braintree Gateway.
4
 
47
  }
48
  ```
49
 
50
+ Both PSR-0 and PSR-4 namespacing are supported. If you are using composer with `--classmap-authoritative` or
51
+ `--optimize-autoloader` enabled, you'll have to reference classes using PSR-4 namespacing:
52
+ ```php
53
+ Braintree\Configuration::environment('sandbox');
54
+ Braintree\Configuration::merchantId('your_merchant_id');
55
+ Braintree\Configuration::publicKey('your_public_key');
56
+ Braintree\Configuration::privateKey('your_private_key');
57
+ ```
58
+
59
  ## HHVM Support
60
 
61
  The Braintree PHP library will run on HHVM >= 3.4.2.
77
  phpunit tests/unit/
78
  ```
79
 
 
 
 
 
80
  ## License
81
 
82
  See the LICENSE file.
lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/AchMandate.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Braintree;
3
+
4
+ /**
5
+ * Braintree AchMandate module
6
+ * PHP Version 5
7
+ *
8
+ * @package Braintree
9
+ * @copyright 2015 Braintree, a division of PayPal, Inc.
10
+ *
11
+ * @property-read string $text
12
+ * @property-read string $acceptedAt
13
+ */
14
+ class AchMandate extends Base
15
+ {
16
+ /**
17
+ * create a printable representation of the object as:
18
+ * ClassName[property=value, property=value]
19
+ * @ignore
20
+ * @return string
21
+ */
22
+ public function __toString()
23
+ {
24
+ return __CLASS__ . '[' .
25
+ Util::attributesToString($this->_attributes) . ']';
26
+ }
27
+
28
+ /**
29
+ * sets instance properties from an array of values
30
+ *
31
+ * @ignore
32
+ * @access protected
33
+ * @param array $achAttribs array of achMandate data
34
+ * @return void
35
+ */
36
+ protected function _initialize($achAttribs)
37
+ {
38
+ // set the attributes
39
+ $this->_attributes = $achAttribs;
40
+ $date = new \DateTime($this->acceptedAt);
41
+ $this->_set('acceptedAt', $date);
42
+ }
43
+
44
+ /**
45
+ * factory method: returns an instance of AchMandate
46
+ * to the requesting method, with populated properties
47
+ * @ignore
48
+ * @return AchMandate
49
+ */
50
+ public static function factory($attributes)
51
+ {
52
+ $instance = new self();
53
+ $instance->_initialize($attributes);
54
+ return $instance;
55
+
56
+ }
57
+ }
58
+ class_alias('Braintree\AchMandate', 'Braintree_Mandate');
lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/Configuration.php CHANGED
@@ -27,6 +27,7 @@ class Configuration
27
  private $_proxyUser = null;
28
  private $_proxyPassword = null;
29
  private $_timeout = 60;
 
30
 
31
  /**
32
  * Braintree API version to use
@@ -127,6 +128,22 @@ class Configuration
127
  self::$global->setTimeout($value);
128
  }
129
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
  /**
131
  * Sets or gets the proxy host to use for connecting to Braintree
132
  *
@@ -373,6 +390,16 @@ class Configuration
373
  return $this->_timeout;
374
  }
375
 
 
 
 
 
 
 
 
 
 
 
376
  public function getAccessToken()
377
  {
378
  return $this->_accessToken;
27
  private $_proxyUser = null;
28
  private $_proxyPassword = null;
29
  private $_timeout = 60;
30
+ private $_sslVersion = null;
31
 
32
  /**
33
  * Braintree API version to use
128
  self::$global->setTimeout($value);
129
  }
130
 
131
+ /**
132
+ * Sets or gets the SSL version to use for making requests. See
133
+ * http://php.net/manual/en/function.curl-setopt.php for possible
134
+ * CURLOPT_SSLVERSION values.
135
+ *
136
+ * @param integer $value If provided, sets the SSL version
137
+ * @return integer The SSL version used for connecting to Braintree
138
+ */
139
+ public static function sslVersion($value=null)
140
+ {
141
+ if (empty($value)) {
142
+ return self::$global->getSslVersion();
143
+ }
144
+ self::$global->setSslVersion($value);
145
+ }
146
+
147
  /**
148
  * Sets or gets the proxy host to use for connecting to Braintree
149
  *
390
  return $this->_timeout;
391
  }
392
 
393
+ private function setSslVersion($value)
394
+ {
395
+ $this->_sslVersion = $value;
396
+ }
397
+
398
+ private function getSslVersion()
399
+ {
400
+ return $this->_sslVersion;
401
+ }
402
+
403
  public function getAccessToken()
404
  {
405
  return $this->_accessToken;
lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/Customer.php CHANGED
@@ -296,6 +296,14 @@ class Customer extends Base
296
  }
297
  $this->_set('venmoAccounts', $venmoAccountArray);
298
 
 
 
 
 
 
 
 
 
299
  $this->_set('paymentMethods', array_merge(
300
  $this->creditCards,
301
  $this->paypalAccounts,
@@ -303,7 +311,8 @@ class Customer extends Base
303
  $this->coinbaseAccounts,
304
  $this->androidPayCards,
305
  $this->amexExpressCheckoutCards,
306
- $this->venmoAccounts
 
307
  ));
308
  }
309
 
296
  }
297
  $this->_set('venmoAccounts', $venmoAccountArray);
298
 
299
+ $usBankAccountArray = array();
300
+ if (isset($customerAttribs['usBankAccounts'])) {
301
+ foreach ($customerAttribs['usBankAccounts'] AS $usBankAccount) {
302
+ $usBankAccountArray[] = UsBankAccount::factory($usBankAccount);
303
+ }
304
+ }
305
+ $this->_set('usBankAccounts', $usBankAccountArray);
306
+
307
  $this->_set('paymentMethods', array_merge(
308
  $this->creditCards,
309
  $this->paypalAccounts,
311
  $this->coinbaseAccounts,
312
  $this->androidPayCards,
313
  $this->amexExpressCheckoutCards,
314
+ $this->venmoAccounts,
315
+ $this->usBankAccounts
316
  ));
317
  }
318
 
lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/CustomerGateway.php CHANGED
@@ -152,7 +152,7 @@ class CustomerGateway
152
  'lastName', 'phone', 'website', 'deviceData',
153
  'deviceSessionId', 'fraudMerchantId', 'paymentMethodNonce',
154
  ['riskData' =>
155
- ['customer_browser', 'customer_ip']
156
  ],
157
  ['creditCard' => $creditCardSignature],
158
  ['customFields' => ['_anyKey_']],
152
  'lastName', 'phone', 'website', 'deviceData',
153
  'deviceSessionId', 'fraudMerchantId', 'paymentMethodNonce',
154
  ['riskData' =>
155
+ ['customerBrowser', 'customerIp', 'customer_browser', 'customer_ip']
156
  ],
157
  ['creditCard' => $creditCardSignature],
158
  ['customFields' => ['_anyKey_']],
lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/Error/Codes.php CHANGED
@@ -196,6 +196,12 @@ class Codes
196
  const MERCHANT_INCONSISTENT_COUNTRY = '93612';
197
  const MERCHANT_ACCOUNT_PAYMENT_METHODS_ARE_INVALID = '93613';
198
  const MERCHANT_PAYMENT_METHODS_ARE_NOT_ALLOWED = '93615';
 
 
 
 
 
 
199
 
200
  const MERCHANT_ACCOUNT_ID_FORMAT_IS_INVALID = '82603';
201
  const MERCHANT_ACCOUNT_ID_IS_IN_USE = '82604';
196
  const MERCHANT_INCONSISTENT_COUNTRY = '93612';
197
  const MERCHANT_ACCOUNT_PAYMENT_METHODS_ARE_INVALID = '93613';
198
  const MERCHANT_PAYMENT_METHODS_ARE_NOT_ALLOWED = '93615';
199
+ const MERCHANT_MERCHANT_ACCOUNT_EXISTS_FOR_CURRENCY = '93616';
200
+ const MERCHANT_CURRENCY_IS_REQUIRED = '93617';
201
+ const MERCHANT_CURRENCY_IS_INVALID = '93618';
202
+ const MERCHANT_NO_MERCHANT_ACCOUNTS = '93619';
203
+ const MERCHANT_MERCHANT_ACCOUNT_EXISTS_FOR_ID = '93620';
204
+ const MERCHANT_MERCHANT_ACCOUNT_NOT_AUTH_ONBOARDED = '93621';
205
 
206
  const MERCHANT_ACCOUNT_ID_FORMAT_IS_INVALID = '82603';
207
  const MERCHANT_ACCOUNT_ID_IS_IN_USE = '82604';
lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/Http.php CHANGED
@@ -109,6 +109,10 @@ class Http
109
  curl_setopt($curl, CURLOPT_URL, $url);
110
  curl_setopt($curl, CURLOPT_ENCODING, 'gzip');
111
 
 
 
 
 
112
  $headers = $this->_getHeaders($curl);
113
  $headers[] = 'User-Agent: Braintree PHP Library ' . Version::get();
114
  $headers[] = 'X-ApiVersion: ' . Configuration::API_VERSION;
109
  curl_setopt($curl, CURLOPT_URL, $url);
110
  curl_setopt($curl, CURLOPT_ENCODING, 'gzip');
111
 
112
+ if ($this->_config->sslVersion()) {
113
+ curl_setopt($curl, CURLOPT_SSLVERSION, $this->_config->sslVersion());
114
+ }
115
+
116
  $headers = $this->_getHeaders($curl);
117
  $headers[] = 'User-Agent: Braintree PHP Library ' . Version::get();
118
  $headers[] = 'X-ApiVersion: ' . Configuration::API_VERSION;
lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/MerchantAccountGateway.php CHANGED
@@ -55,6 +55,31 @@ class MerchantAccountGateway
55
  return $signature;
56
  }
57
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  public static function createSignature()
59
  {
60
  $addressSignature = ['streetAddress', 'postalCode', 'locality', 'region'];
@@ -137,6 +162,9 @@ class MerchantAccountGateway
137
 
138
  private function _verifyGatewayResponse($response)
139
  {
 
 
 
140
  if (isset($response['merchantAccount'])) {
141
  // return a populated instance of merchantAccount
142
  return new Result\Successful(
55
  return $signature;
56
  }
57
 
58
+ public function createForCurrency($attribs)
59
+ {
60
+ $response = $this->_http->post($this->_config->merchantPath() . '/merchant_accounts/create_for_currency', ['merchant_account' => $attribs]);
61
+ return $this->_verifyGatewayResponse($response);
62
+ }
63
+
64
+ public function all()
65
+ {
66
+ $pager = [
67
+ 'object' => $this,
68
+ 'method' => 'fetchMerchantAccounts',
69
+ ];
70
+ return new PaginatedCollection($pager);
71
+ }
72
+
73
+ public function fetchMerchantAccounts($page)
74
+ {
75
+ $response = $this->_http->get($this->_config->merchantPath() . '/merchant_accounts?page=' . $page);
76
+ $body = $response['merchantAccounts'];
77
+ $merchantAccounts = Util::extractattributeasarray($body, 'merchantAccount');
78
+ $totalItems = $body['totalItems'][0];
79
+ $pageSize = $body['pageSize'][0];
80
+ return new PaginatedResult($totalItems, $pageSize, $merchantAccounts);
81
+ }
82
+
83
  public static function createSignature()
84
  {
85
  $addressSignature = ['streetAddress', 'postalCode', 'locality', 'region'];
162
 
163
  private function _verifyGatewayResponse($response)
164
  {
165
+ if (isset($response['response'])) {
166
+ $response = $response['response'];
167
+ }
168
  if (isset($response['merchantAccount'])) {
169
  // return a populated instance of merchantAccount
170
  return new Result\Successful(
lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/PaginatedCollection.php ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Braintree;
3
+
4
+ use Iterator;
5
+
6
+ /**
7
+ * Braintree PaginatedCollection
8
+ * PaginatedCollection is a container object for paginated data
9
+ *
10
+ * retrieves and pages through large collections of results
11
+ *
12
+ * example:
13
+ * <code>
14
+ * $result = MerchantAccount::all();
15
+ *
16
+ * foreach($result as $merchantAccount) {
17
+ * print_r($merchantAccount->status);
18
+ * }
19
+ * </code>
20
+ *
21
+ * @package Braintree
22
+ * @subpackage Utility
23
+ * @copyright 2016 Braintree, a division of PayPal, Inc.
24
+ */
25
+ class PaginatedCollection implements Iterator
26
+ {
27
+ private $_pager;
28
+ private $_pageSize;
29
+ private $_currentPage;
30
+ private $_index;
31
+ private $_totalItems;
32
+ private $_items;
33
+
34
+ /**
35
+ * set up the paginated collection
36
+ *
37
+ * expects an array of an object and method to call on it
38
+ *
39
+ * @param array $pager
40
+ */
41
+ public function __construct($pager)
42
+ {
43
+ $this->_pager = $pager;
44
+ $this->_pageSize = 0;
45
+ $this->_currentPage = 0;
46
+ $this->_totalItems = 0;
47
+ $this->_index = 0;
48
+ }
49
+
50
+ /**
51
+ * returns the current item when iterating with foreach
52
+ */
53
+ public function current()
54
+ {
55
+ return $this->_items[($this->_index % $this->_pageSize)];
56
+ }
57
+
58
+ public function key()
59
+ {
60
+ return null;
61
+ }
62
+
63
+ /**
64
+ * advances to the next item in the collection when iterating with foreach
65
+ */
66
+ public function next()
67
+ {
68
+ ++$this->_index;
69
+ }
70
+
71
+ /**
72
+ * rewinds the collection to the first item when iterating with foreach
73
+ */
74
+ public function rewind()
75
+ {
76
+ $this->_index = 0;
77
+ $this->_currentPage = 0;
78
+ $this->_pageSize = 0;
79
+ $this->_totalItems = 0;
80
+ $this->_items = [];
81
+ }
82
+
83
+ /**
84
+ * returns whether the current item is valid when iterating with foreach
85
+ */
86
+ public function valid()
87
+ {
88
+ if ($this->_currentPage == 0 || $this->_index % $this->_pageSize == 0)
89
+ {
90
+ $this->_getNextPage();
91
+ }
92
+
93
+ return $this->_index < $this->_totalItems;
94
+ }
95
+
96
+ private function _getNextPage()
97
+ {
98
+ $this->_currentPage++;
99
+ $object = $this->_pager['object'];
100
+ $method = $this->_pager['method'];
101
+ $result = call_user_func(
102
+ [$object, $method],
103
+ $this->_currentPage
104
+ );
105
+
106
+ $this->_totalItems= $result->getTotalItems();
107
+ $this->_pageSize = $result->getPageSize();
108
+ $this->_items = $result->getCurrentPage();
109
+ }
110
+ }
111
+ class_alias('Braintree\PaginatedCollection', 'Braintree_PaginatedCollection');
lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/PaginatedResult.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Braintree;
3
+
4
+ class PaginatedResult
5
+ {
6
+ private $_totalItems;
7
+ private $_pageSize;
8
+ private $_currentPage;
9
+
10
+ public function __construct($totalItems, $pageSize, $currentPage)
11
+ {
12
+ $this->_totalItems = $totalItems;
13
+ $this->_pageSize = $pageSize;
14
+ $this->_currentPage = $currentPage;
15
+ }
16
+
17
+ public function getTotalItems()
18
+ {
19
+ return $this->_totalItems;
20
+ }
21
+
22
+ public function getPageSize()
23
+ {
24
+ return $this->_pageSize;
25
+ }
26
+
27
+ public function getCurrentPage()
28
+ {
29
+ return $this->_currentPage;
30
+ }
31
+ }
32
+ class_alias('Braintree\PaginatedResult', 'Braintree_PaginatedResult');
lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/PaymentInstrumentType.php CHANGED
@@ -10,5 +10,6 @@ class PaymentInstrumentType
10
  const APPLE_PAY_CARD = 'apple_pay_card';
11
  const ANDROID_PAY_CARD = 'android_pay_card';
12
  const VENMO_ACCOUNT = 'venmo_account';
 
13
  }
14
  class_alias('Braintree\PaymentInstrumentType', 'Braintree_PaymentInstrumentType');
10
  const APPLE_PAY_CARD = 'apple_pay_card';
11
  const ANDROID_PAY_CARD = 'android_pay_card';
12
  const VENMO_ACCOUNT = 'venmo_account';
13
+ const US_BANK_ACCOUNT = 'us_bank_account';
14
  }
15
  class_alias('Braintree\PaymentInstrumentType', 'Braintree_PaymentInstrumentType');
lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/PaymentMethod.php CHANGED
@@ -39,9 +39,9 @@ class PaymentMethod extends Base
39
  return Configuration::gateway()->paymentMethod()->update($token, $attribs);
40
  }
41
 
42
- public static function delete($token)
43
  {
44
- return Configuration::gateway()->paymentMethod()->delete($token);
45
  }
46
  }
47
  class_alias('Braintree\PaymentMethod', 'Braintree_PaymentMethod');
39
  return Configuration::gateway()->paymentMethod()->update($token, $attribs);
40
  }
41
 
42
+ public static function delete($token, $options=[])
43
  {
44
+ return Configuration::gateway()->paymentMethod()->delete($token, $options);
45
  }
46
  }
47
  class_alias('Braintree\PaymentMethod', 'Braintree_PaymentMethod');
lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/PaymentMethodGateway.php CHANGED
@@ -90,23 +90,28 @@ class PaymentMethodGateway
90
  return $this->_doUpdate('/payment_methods/any/' . $token, ['payment_method' => $attribs]);
91
  }
92
 
93
- public function delete($token)
94
  {
 
95
  $this->_validateId($token);
96
- $path = $this->_config->merchantPath() . '/payment_methods/any/' . $token;
97
- $this->_http->delete($path);
98
- return new Result\Successful();
 
 
99
  }
100
 
101
- public function grant($sharedPaymentMethodToken, $allowVaulting)
102
  {
 
 
 
 
 
103
  return $this->_doCreate(
104
  '/payment_methods/grant',
105
  [
106
- 'payment_method' => [
107
- 'shared_payment_method_token' => $sharedPaymentMethodToken,
108
- 'allow_vaulting' => $allowVaulting
109
- ]
110
  ]
111
  );
112
  }
@@ -172,6 +177,11 @@ class PaymentMethodGateway
172
  return $signature;
173
  }
174
 
 
 
 
 
 
175
  /**
176
  * sends the create request to the gateway
177
  *
@@ -204,6 +214,21 @@ class PaymentMethodGateway
204
  return $this->_verifyGatewayResponse($response);
205
  }
206
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207
  /**
208
  * generic method for validating incoming gateway responses
209
  *
90
  return $this->_doUpdate('/payment_methods/any/' . $token, ['payment_method' => $attribs]);
91
  }
92
 
93
+ public function delete($token, $options=[])
94
  {
95
+ Util::verifyKeys(self::deleteSignature(), $options);
96
  $this->_validateId($token);
97
+ $queryString = "";
98
+ if (!empty($options)) {
99
+ $queryString = "?" . http_build_query(Util::camelCaseToDelimiterArray($options, '_'));
100
+ }
101
+ return $this->_doDelete('/payment_methods/any/' . $token . $queryString);
102
  }
103
 
104
+ public function grant($sharedPaymentMethodToken, $attribs=[])
105
  {
106
+ if (is_bool($attribs) === true) {
107
+ $attribs = ['allow_vaulting' => $attribs];
108
+ }
109
+ $options = [ 'shared_payment_method_token' => $sharedPaymentMethodToken ];
110
+
111
  return $this->_doCreate(
112
  '/payment_methods/grant',
113
  [
114
+ 'payment_method' => array_merge($attribs, $options)
 
 
 
115
  ]
116
  );
117
  }
177
  return $signature;
178
  }
179
 
180
+ private static function deleteSignature()
181
+ {
182
+ return ['revokeAllGrants'];
183
+ }
184
+
185
  /**
186
  * sends the create request to the gateway
187
  *
214
  return $this->_verifyGatewayResponse($response);
215
  }
216
 
217
+
218
+ /**
219
+ * sends the delete request to the gateway
220
+ *
221
+ * @ignore
222
+ * @param string $subPath
223
+ * @return mixed
224
+ */
225
+ public function _doDelete($subPath)
226
+ {
227
+ $fullPath = $this->_config->merchantPath() . $subPath;
228
+ $this->_http->delete($fullPath);
229
+ return new Result\Successful();
230
+ }
231
+
232
  /**
233
  * generic method for validating incoming gateway responses
234
  *
lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/Transaction/UsBankAccountDetails.php CHANGED
@@ -2,6 +2,7 @@
2
  namespace Braintree\Transaction;
3
 
4
  use Braintree\Instance;
 
5
 
6
  /**
7
  * CreditCard details from a transaction
@@ -11,13 +12,14 @@ use Braintree\Instance;
11
  * @subpackage Transaction
12
  * @copyright 2015 Braintree, a division of PayPal, Inc.
13
  *
 
 
14
  * @property-read string $routingNumber
15
- * @property-read string $last4
16
  * @property-read string $accountType
17
- * @property-read string $accountDescription
18
  * @property-read string $accountHolderName
19
- * @property-read string $token
20
- * @property-read string $imageUrl
 
21
  */
22
  class UsBankAccountDetails extends Instance
23
  {
@@ -30,6 +32,10 @@ class UsBankAccountDetails extends Instance
30
  {
31
  parent::__construct($attributes);
32
 
 
 
 
 
33
  }
34
  }
35
  class_alias('Braintree\Transaction\UsBankAccountDetails', 'Braintree_Transaction_UsBankAccountDetails');
2
  namespace Braintree\Transaction;
3
 
4
  use Braintree\Instance;
5
+ use Braintree\AchMandate;
6
 
7
  /**
8
  * CreditCard details from a transaction
12
  * @subpackage Transaction
13
  * @copyright 2015 Braintree, a division of PayPal, Inc.
14
  *
15
+ * @property-read string $token
16
+ * @property-read string $imageUrl
17
  * @property-read string $routingNumber
 
18
  * @property-read string $accountType
 
19
  * @property-read string $accountHolderName
20
+ * @property-read string $last4
21
+ * @property-read string $bankName
22
+ * @property-read string $achMandate
23
  */
24
  class UsBankAccountDetails extends Instance
25
  {
32
  {
33
  parent::__construct($attributes);
34
 
35
+ $achMandate = isset($attributes['achMandate']) ?
36
+ AchMandate::factory($attributes['achMandate']) :
37
+ null;
38
+ $this->achMandate = $achMandate;
39
  }
40
  }
41
  class_alias('Braintree\Transaction\UsBankAccountDetails', 'Braintree_Transaction_UsBankAccountDetails');
lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/TransactionGateway.php CHANGED
@@ -131,7 +131,7 @@ class TransactionGateway
131
  'type',
132
  'venmoSdkPaymentMethodCode',
133
  ['riskData' =>
134
- ['customer_browser', 'customer_ip']
135
  ],
136
  ['creditCard' =>
137
  ['token', 'cardholderName', 'cvv', 'expirationDate', 'expirationMonth', 'expirationYear', 'number'],
@@ -171,9 +171,14 @@ class TransactionGateway
171
  'venmoSdkSession',
172
  'storeShippingAddressInVault',
173
  'payeeEmail',
 
174
  ['threeDSecure' =>
175
  ['required']
176
  ],
 
 
 
 
177
  ['paypal' =>
178
  [
179
  'payeeEmail',
@@ -195,7 +200,8 @@ class TransactionGateway
195
  ['customFields' => ['_anyKey_']],
196
  ['descriptor' => ['name', 'phone', 'url']],
197
  ['paypalAccount' => ['payeeEmail']],
198
- ['apple_pay_card' => ['number', 'cardholder_name', 'cryptogram', 'expiration_month', 'expiration_year']],
 
199
  ['industry' =>
200
  ['industryType',
201
  ['data' =>
@@ -340,10 +346,14 @@ class TransactionGateway
340
  $path = $this->_config->merchantPath() . '/transactions/advanced_search';
341
  $response = $this->_http->post($path, ['search' => $criteria]);
342
 
343
- return Util::extractattributeasarray(
344
- $response['creditCardTransactions'],
345
- 'transaction'
346
- );
 
 
 
 
347
  }
348
 
349
  /**
131
  'type',
132
  'venmoSdkPaymentMethodCode',
133
  ['riskData' =>
134
+ ['customerBrowser', 'customerIp', 'customer_browser', 'customer_ip']
135
  ],
136
  ['creditCard' =>
137
  ['token', 'cardholderName', 'cvv', 'expirationDate', 'expirationMonth', 'expirationYear', 'number'],
171
  'venmoSdkSession',
172
  'storeShippingAddressInVault',
173
  'payeeEmail',
174
+ 'skipAdvancedFraudChecking',
175
  ['threeDSecure' =>
176
  ['required']
177
  ],
178
+ # Included for backwards compatiblity. Remove in the next major version
179
+ ['three_d_secure' =>
180
+ ['required']
181
+ ],
182
  ['paypal' =>
183
  [
184
  'payeeEmail',
200
  ['customFields' => ['_anyKey_']],
201
  ['descriptor' => ['name', 'phone', 'url']],
202
  ['paypalAccount' => ['payeeEmail']],
203
+ ['apple_pay_card' => ['number', 'cardholder_name', 'cryptogram', 'expiration_month', 'expiration_year']], #backwards compatibility
204
+ ['applePayCard' => ['number', 'cardholderName', 'cryptogram', 'expirationMonth', 'expirationYear']],
205
  ['industry' =>
206
  ['industryType',
207
  ['data' =>
346
  $path = $this->_config->merchantPath() . '/transactions/advanced_search';
347
  $response = $this->_http->post($path, ['search' => $criteria]);
348
 
349
+ if (array_key_exists('creditCardTransactions', $response)) {
350
+ return Util::extractattributeasarray(
351
+ $response['creditCardTransactions'],
352
+ 'transaction'
353
+ );
354
+ } else {
355
+ throw new Exception\DownForMaintenance();
356
+ }
357
  }
358
 
359
  /**
lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/UsBankAccount.php CHANGED
@@ -23,6 +23,13 @@ namespace Braintree;
23
  * @property-read string $email
24
  * @property-read string $token
25
  * @property-read string $imageUrl
 
 
 
 
 
 
 
26
  */
27
  class UsBankAccount extends Base
28
  {
@@ -53,6 +60,11 @@ class UsBankAccount extends Base
53
  {
54
  // set the attributes
55
  $this->_attributes = $usBankAccountAttribs;
 
 
 
 
 
56
  }
57
 
58
  /**
23
  * @property-read string $email
24
  * @property-read string $token
25
  * @property-read string $imageUrl
26
+ * @property-read string $routingNumber
27
+ * @property-read string $accountType
28
+ * @property-read string $accountHolderName
29
+ * @property-read string $last4
30
+ * @property-read string $bankName
31
+ * @property-read string $achMandate
32
+ * @property-read string $default
33
  */
34
  class UsBankAccount extends Base
35
  {
60
  {
61
  // set the attributes
62
  $this->_attributes = $usBankAccountAttribs;
63
+
64
+ $achMandate = isset($usBankAccountAttribs['achMandate']) ?
65
+ AchMandate::factory($usBankAccountAttribs['achMandate']) :
66
+ null;
67
+ $this->_set('achMandate', $achMandate);
68
  }
69
 
70
  /**
lib/Gene/Braintree/braintree/braintree_php/lib/Braintree/Version.php CHANGED
@@ -13,8 +13,8 @@ class Version
13
  * class constants
14
  */
15
  const MAJOR = 3;
16
- const MINOR = 17;
17
- const TINY = 0;
18
 
19
  /**
20
  * @ignore
13
  * class constants
14
  */
15
  const MAJOR = 3;
16
+ const MINOR = 21;
17
+ const TINY = 1;
18
 
19
  /**
20
  * @ignore
lib/Gene/Braintree/braintree/braintree_php/tests/Helper.php CHANGED
@@ -124,6 +124,14 @@ class Helper
124
  return $response['threeDSecureVerification']['threeDSecureToken'];
125
  }
126
 
 
 
 
 
 
 
 
 
127
  public static function nowInEastern()
128
  {
129
  $eastern = new DateTimeZone('America/New_York');
@@ -139,6 +147,7 @@ class Helper
139
  public static function generateValidUsBankAccountNonce() {
140
  $client_token = json_decode(Helper::decodedClientToken(), true);
141
  $url = $client_token['braintree_api']['url'] . '/tokens';
 
142
 
143
  $curl = curl_init();
144
  curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
@@ -146,7 +155,7 @@ class Helper
146
 
147
  $headers[] = 'Content-Type: application/json';
148
  $headers[] = 'Braintree-Version: 2015-11-01';
149
- $headers[] = 'Authorization: Bearer integratexxxxxx_xxxxxx_xxxxxx_xxxxxx_xx1';
150
  curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
151
 
152
  $requestBody = [
@@ -158,12 +167,12 @@ class Helper
158
  'postal_code' => '94112'
159
  ],
160
  'account_type' => 'checking',
161
- 'routing_number' => '123456789',
162
  'account_number' => '567891234',
163
  'account_holder_name' => 'Dan Schulman',
164
  'account_description' => 'PayPal Checking - 1234',
165
  'ach_mandate' => [
166
- 'text' => ''
167
  ]
168
  ];
169
 
124
  return $response['threeDSecureVerification']['threeDSecureToken'];
125
  }
126
 
127
+ public static function generate3DSNonce($params)
128
+ {
129
+ $http = new Braintree\Http(Braintree\Configuration::$global);
130
+ $path = Braintree\Configuration::$global->merchantPath() . '/three_d_secure/create_nonce/' . self::threeDSecureMerchantAccountId();
131
+ $response = $http->post($path, $params);
132
+ return $response['paymentMethodNonce']['nonce'];
133
+ }
134
+
135
  public static function nowInEastern()
136
  {
137
  $eastern = new DateTimeZone('America/New_York');
147
  public static function generateValidUsBankAccountNonce() {
148
  $client_token = json_decode(Helper::decodedClientToken(), true);
149
  $url = $client_token['braintree_api']['url'] . '/tokens';
150
+ $token = $client_token['braintree_api']['access_token'];
151
 
152
  $curl = curl_init();
153
  curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
155
 
156
  $headers[] = 'Content-Type: application/json';
157
  $headers[] = 'Braintree-Version: 2015-11-01';
158
+ $headers[] = 'Authorization: Bearer ' . $token;
159
  curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
160
 
161
  $requestBody = [
167
  'postal_code' => '94112'
168
  ],
169
  'account_type' => 'checking',
170
+ 'routing_number' => '021000021',
171
  'account_number' => '567891234',
172
  'account_holder_name' => 'Dan Schulman',
173
  'account_description' => 'PayPal Checking - 1234',
174
  'ach_mandate' => [
175
+ 'text' => 'cl mandate text'
176
  ]
177
  ];
178
 
lib/Gene/Braintree/braintree/braintree_php/tests/integration/CustomerTest.php CHANGED
@@ -220,6 +220,26 @@ class CustomerTest extends Setup
220
  $this->assertNotNull($customer->paymentMethods[0]);
221
  }
222
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
223
  public function testCreate_withUnicode()
224
  {
225
  $result = Braintree\Customer::create([
@@ -654,6 +674,27 @@ class CustomerTest extends Setup
654
  $this->assertEquals('http://example.com', $customer->website);
655
  }
656
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
657
  public function testFind_throwsExceptionIfNotFound()
658
  {
659
  $this->setExpectedException('Braintree\Exception\NotFound');
220
  $this->assertNotNull($customer->paymentMethods[0]);
221
  }
222
 
223
+ public function testCreateCustomerWithUsBankAccount()
224
+ {
225
+ $nonce = Test\Helper::generateValidUsBankAccountNonce();
226
+ $result = Braintree\Customer::create(array(
227
+ 'paymentMethodNonce' => $nonce
228
+ ));
229
+ $this->assertTrue($result->success);
230
+ $customer = $result->customer;
231
+ $this->assertNotNull($customer->usBankAccounts[0]);
232
+ $this->assertNotNull($customer->paymentMethods[0]);
233
+ $usBankAccount = $customer->usBankAccounts[0];
234
+ $this->assertTrue($usBankAccount instanceof Braintree\UsBankAccount);
235
+ $this->assertNotNull($usBankAccount->token);
236
+ $this->assertEquals('Dan Schulman', $usBankAccount->accountHolderName);
237
+ $this->assertEquals('021000021', $usBankAccount->routingNumber);
238
+ $this->assertEquals('1234', $usBankAccount->last4);
239
+ $this->assertEquals('checking', $usBankAccount->accountType);
240
+ $this->assertRegexp('/CHASE/', $usBankAccount->bankName);
241
+ }
242
+
243
  public function testCreate_withUnicode()
244
  {
245
  $result = Braintree\Customer::create([
674
  $this->assertEquals('http://example.com', $customer->website);
675
  }
676
 
677
+ public function test_findUsBankAccountGivenPaymentMethodToken()
678
+ {
679
+ $nonce = Test\Helper::generateValidUsBankAccountNonce();
680
+ $result = Braintree\Customer::create(array(
681
+ 'paymentMethodNonce' => $nonce
682
+ ));
683
+ $this->assertTrue($result->success);
684
+
685
+ $customer = Braintree\Customer::find($result->customer->id);
686
+ $this->assertNotNull($customer->usBankAccounts[0]);
687
+ $this->assertNotNull($customer->paymentMethods[0]);
688
+ $usBankAccount = $customer->usBankAccounts[0];
689
+ $this->assertTrue($usBankAccount instanceof Braintree\UsBankAccount);
690
+ $this->assertNotNull($usBankAccount->token);
691
+ $this->assertEquals('Dan Schulman', $usBankAccount->accountHolderName);
692
+ $this->assertEquals('021000021', $usBankAccount->routingNumber);
693
+ $this->assertEquals('1234', $usBankAccount->last4);
694
+ $this->assertEquals('checking', $usBankAccount->accountType);
695
+ $this->assertRegexp('/CHASE/', $usBankAccount->bankName);
696
+ }
697
+
698
  public function testFind_throwsExceptionIfNotFound()
699
  {
700
  $this->setExpectedException('Braintree\Exception\NotFound');
lib/Gene/Braintree/braintree/braintree_php/tests/integration/HttpClientApi.php CHANGED
@@ -73,7 +73,7 @@ class HttpClientApi extends Braintree\Http
73
  $body = json_decode($response["body"]);
74
  return $body->creditCards[0]->nonce;
75
  } else {
76
- throw new Exception(var_dump($response));
77
  }
78
  }
79
 
@@ -98,7 +98,7 @@ class HttpClientApi extends Braintree\Http
98
  $body = json_decode($response["body"]);
99
  return $body->europeBankAccounts[0]->nonce;
100
  } else {
101
- throw new Exception(var_dump($response));
102
  }
103
  }
104
 
@@ -110,7 +110,7 @@ class HttpClientApi extends Braintree\Http
110
  $body = json_decode($response["body"], true);
111
  return $body["paypalAccounts"][0]["nonce"];
112
  } else {
113
- throw new Exception(var_dump($response));
114
  }
115
  }
116
  }
73
  $body = json_decode($response["body"]);
74
  return $body->creditCards[0]->nonce;
75
  } else {
76
+ throw new Exception(print_r($response, true));
77
  }
78
  }
79
 
98
  $body = json_decode($response["body"]);
99
  return $body->europeBankAccounts[0]->nonce;
100
  } else {
101
+ throw new Exception(print_r($response, true));
102
  }
103
  }
104
 
110
  $body = json_decode($response["body"], true);
111
  return $body["paypalAccounts"][0]["nonce"];
112
  } else {
113
+ throw new Exception(print_r($response, true));
114
  }
115
  }
116
  }
lib/Gene/Braintree/braintree/braintree_php/tests/integration/HttpTest.php CHANGED
@@ -36,6 +36,40 @@ class HttpTest extends Setup
36
  Braintree\Configuration::environment('development');
37
  }
38
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  public function testSslError()
40
  {
41
  try {
36
  Braintree\Configuration::environment('development');
37
  }
38
 
39
+ public function testSandboxSSLWithExplicitVersionSet()
40
+ {
41
+ try {
42
+ Braintree\Configuration::environment('sandbox');
43
+ Braintree\Configuration::sslVersion(6);
44
+ $this->setExpectedException('Braintree\Exception\Authentication');
45
+ $http = new Braintree\Http(Braintree\Configuration::$global);
46
+ $http->get('/');
47
+ } catch (Braintree\Exception $e) {
48
+ Braintree\Configuration::environment('development');
49
+ Braintree\Configuration::sslVersion(null);
50
+ throw $e;
51
+ }
52
+ Braintree\Configuration::environment('development');
53
+ Braintree\Configuration::sslVersion(null);
54
+ }
55
+
56
+ public function testSandboxSSLFailsWithIncompatibleSSLVersion()
57
+ {
58
+ try {
59
+ Braintree\Configuration::environment('sandbox');
60
+ Braintree\Configuration::sslVersion(3);
61
+ $this->setExpectedException('Braintree\Exception\SSLCertificate');
62
+ $http = new Braintree\Http(Braintree\Configuration::$global);
63
+ $http->get('/');
64
+ } catch (Braintree\Exception $e) {
65
+ Braintree\Configuration::environment('development');
66
+ Braintree\Configuration::sslVersion(null);
67
+ throw $e;
68
+ }
69
+ Braintree\Configuration::environment('development');
70
+ Braintree\Configuration::sslVersion(null);
71
+ }
72
+
73
  public function testSslError()
74
  {
75
  try {
lib/Gene/Braintree/braintree/braintree_php/tests/integration/MerchantAccountTest.php CHANGED
@@ -428,4 +428,204 @@ class MerchantAccountTest extends Setup
428
  $error = $result->errors->forKey("merchantAccount")->forKey("funding")->onAttribute("mobilePhone");
429
  $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_FUNDING_MOBILE_PHONE_IS_REQUIRED);
430
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
431
  }
428
  $error = $result->errors->forKey("merchantAccount")->forKey("funding")->onAttribute("mobilePhone");
429
  $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_FUNDING_MOBILE_PHONE_IS_REQUIRED);
430
  }
431
+
432
+ public function testCreateForCurrency()
433
+ {
434
+ $gateway = new Braintree\Gateway([
435
+ 'clientId' => 'client_id$development$signup_client_id',
436
+ 'clientSecret' => 'client_secret$development$signup_client_secret',
437
+ ]);
438
+ $result = $gateway->merchant()->create([
439
+ 'email' => 'name@email.com',
440
+ 'countryCodeAlpha3' => 'GBR',
441
+ 'paymentMethods' => ['credit_card', 'paypal'],
442
+ ]);
443
+
444
+ $this->assertEquals(true, $result->success);
445
+
446
+ $gateway = new Braintree\Gateway([
447
+ 'accessToken' => $result->credentials->accessToken,
448
+ ]);
449
+
450
+ $result = $gateway->merchantAccount()->createForCurrency([
451
+ 'currency' => "USD",
452
+ ]);
453
+
454
+ $this->assertEquals(true, $result->success);
455
+
456
+ $merchantAccount = $result->merchantAccount;
457
+ $this->assertEquals("USD", $merchantAccount->currencyIsoCode);
458
+ $this->assertEquals("USD", $merchantAccount->id);
459
+ }
460
+
461
+ public function testCreateForCurrencyWithDuplicateCurrency()
462
+ {
463
+ $gateway = new Braintree\Gateway([
464
+ 'clientId' => 'client_id$development$signup_client_id',
465
+ 'clientSecret' => 'client_secret$development$signup_client_secret',
466
+ ]);
467
+ $result = $gateway->merchant()->create([
468
+ 'email' => 'name@email.com',
469
+ 'countryCodeAlpha3' => 'GBR',
470
+ 'paymentMethods' => ['credit_card', 'paypal'],
471
+ ]);
472
+
473
+ $this->assertEquals(true, $result->success);
474
+
475
+ $gateway = new Braintree\Gateway([
476
+ 'accessToken' => $result->credentials->accessToken,
477
+ ]);
478
+
479
+ $merchantAccount = $result->merchant->merchantAccounts[0];
480
+ $result = $gateway->merchantAccount()->createForCurrency([
481
+ 'currency' => "GBP",
482
+ ]);
483
+
484
+ $this->assertEquals(false, $result->success);
485
+
486
+ $errors = $result->errors->forKey('merchant')->onAttribute('currency');
487
+ $this->assertEquals(Braintree\Error\Codes::MERCHANT_MERCHANT_ACCOUNT_EXISTS_FOR_CURRENCY, $errors[0]->code);
488
+ }
489
+
490
+ public function testCreateForCurrencyWithInvalidCurrency()
491
+ {
492
+ $gateway = new Braintree\Gateway([
493
+ 'clientId' => 'client_id$development$signup_client_id',
494
+ 'clientSecret' => 'client_secret$development$signup_client_secret',
495
+ ]);
496
+ $result = $gateway->merchant()->create([
497
+ 'email' => 'name@email.com',
498
+ 'countryCodeAlpha3' => 'GBR',
499
+ 'paymentMethods' => ['credit_card', 'paypal'],
500
+ ]);
501
+
502
+ $this->assertEquals(true, $result->success);
503
+
504
+ $gateway = new Braintree\Gateway([
505
+ 'accessToken' => $result->credentials->accessToken,
506
+ ]);
507
+
508
+ $result = $gateway->merchantAccount()->createForCurrency([
509
+ 'currency' => "FAKE_CURRENCY",
510
+ ]);
511
+
512
+ $this->assertEquals(false, $result->success);
513
+
514
+ $errors = $result->errors->forKey('merchant')->onAttribute('currency');
515
+ $this->assertEquals(Braintree\Error\Codes::MERCHANT_CURRENCY_IS_INVALID, $errors[0]->code);
516
+ }
517
+
518
+ public function testCreateForCurrencyWithoutCurrency()
519
+ {
520
+ $gateway = new Braintree\Gateway([
521
+ 'clientId' => 'client_id$development$signup_client_id',
522
+ 'clientSecret' => 'client_secret$development$signup_client_secret',
523
+ ]);
524
+ $result = $gateway->merchant()->create([
525
+ 'email' => 'name@email.com',
526
+ 'countryCodeAlpha3' => 'GBR',
527
+ 'paymentMethods' => ['credit_card', 'paypal'],
528
+ ]);
529
+
530
+ $this->assertEquals(true, $result->success);
531
+
532
+ $gateway = new Braintree\Gateway([
533
+ 'accessToken' => $result->credentials->accessToken,
534
+ ]);
535
+
536
+ $result = $gateway->merchantAccount()->createForCurrency([]);
537
+
538
+ $this->assertEquals(false, $result->success);
539
+
540
+ $errors = $result->errors->forKey('merchant')->onAttribute('currency');
541
+ $this->assertEquals(Braintree\Error\Codes::MERCHANT_CURRENCY_IS_REQUIRED, $errors[0]->code);
542
+ }
543
+
544
+ public function testCreateForCurrencyWithDuplicateId()
545
+ {
546
+ $gateway = new Braintree\Gateway([
547
+ 'clientId' => 'client_id$development$signup_client_id',
548
+ 'clientSecret' => 'client_secret$development$signup_client_secret',
549
+ ]);
550
+ $result = $gateway->merchant()->create([
551
+ 'email' => 'name@email.com',
552
+ 'countryCodeAlpha3' => 'GBR',
553
+ 'paymentMethods' => ['credit_card', 'paypal'],
554
+ ]);
555
+
556
+ $this->assertEquals(true, $result->success);
557
+
558
+ $gateway = new Braintree\Gateway([
559
+ 'accessToken' => $result->credentials->accessToken,
560
+ ]);
561
+
562
+ $merchantAccount = $result->merchant->merchantAccounts[0];
563
+ $result = $gateway->merchantAccount()->createForCurrency([
564
+ 'currency' => "USD",
565
+ 'id' => $merchantAccount->id,
566
+ ]);
567
+
568
+ $this->assertEquals(false, $result->success);
569
+
570
+ $errors = $result->errors->forKey('merchant')->onAttribute('id');
571
+ $this->assertEquals(Braintree\Error\Codes::MERCHANT_MERCHANT_ACCOUNT_EXISTS_FOR_ID, $errors[0]->code);
572
+ }
573
+
574
+ public function testAllReturnsAllMerchantAccounts()
575
+ {
576
+ $gateway = new Braintree\Gateway([
577
+ 'clientId' => 'client_id$development$integration_client_id',
578
+ 'clientSecret' => 'client_secret$development$integration_client_secret',
579
+ ]);
580
+
581
+ $code = Test\Braintree\OAuthTestHelper::createGrant($gateway, [
582
+ 'merchant_public_id' => 'integration_merchant_id',
583
+ 'scope' => 'read_write'
584
+ ]);
585
+
586
+ $credentials = $gateway->oauth()->createTokenFromCode([
587
+ 'code' => $code,
588
+ ]);
589
+
590
+ $gateway = new Braintree\Gateway([
591
+ 'accessToken' => $credentials->accessToken
592
+ ]);
593
+
594
+ $result = $gateway->merchantAccount()->all();
595
+ $merchantAccounts = [];
596
+ foreach($result as $ma) {
597
+ array_push($merchantAccounts, $ma);
598
+ }
599
+ $this->assertEquals(true, count($merchantAccounts) > 20);
600
+ }
601
+
602
+ public function testAllReturnsMerchantAccountWithCorrectAttributes()
603
+ {
604
+ $gateway = new Braintree\Gateway([
605
+ 'clientId' => 'client_id$development$integration_client_id',
606
+ 'clientSecret' => 'client_secret$development$integration_client_secret',
607
+ ]);
608
+
609
+ $result = $gateway->merchant()->create([
610
+ 'email' => 'name@email.com',
611
+ 'countryCodeAlpha3' => 'USA',
612
+ 'paymentMethods' => ['credit_card', 'paypal'],
613
+ ]);
614
+
615
+ $gateway = new Braintree\Gateway([
616
+ 'accessToken' => $result->credentials->accessToken,
617
+ ]);
618
+
619
+ $result = $gateway->merchantAccount()->all();
620
+ $merchantAccounts = [];
621
+ foreach($result as $ma) {
622
+ array_push($merchantAccounts, $ma);
623
+ }
624
+
625
+ $this->assertEquals(1, count($merchantAccounts));
626
+ $merchantAccount = $merchantAccounts[0];
627
+ $this->assertEquals("USD", $merchantAccount->currencyIsoCode);
628
+ $this->assertEquals(Braintree\MerchantAccount::STATUS_ACTIVE, $merchantAccount->status);
629
+ $this->assertTrue($merchantAccount->default);
630
+ }
631
  }
lib/Gene/Braintree/braintree/braintree_php/tests/integration/MerchantTest.php CHANGED
@@ -60,7 +60,7 @@ class MerchantTest extends Setup
60
  $this->assertEquals(Braintree\Error\Codes::MERCHANT_ACCOUNT_PAYMENT_METHODS_ARE_INVALID, $errors[0]->code);
61
  }
62
 
63
- public function testCreatePaypalOnlyMerchantThatAcceptsMultipleCurrencies()
64
  {
65
  $gateway = new Braintree\Gateway([
66
  'clientId' => 'client_id$development$signup_client_id',
@@ -69,12 +69,8 @@ class MerchantTest extends Setup
69
  $result = $gateway->merchant()->create([
70
  'email' => 'name@email.com',
71
  'countryCodeAlpha3' => 'USA',
72
- 'paymentMethods' => ['paypal'],
73
- 'currencies' => ['GBP', 'USD'],
74
- 'paypalAccount' => [
75
- 'clientId' => 'fake_client_id',
76
- 'clientSecret' => 'fake_client_secret',
77
- ]
78
  ]);
79
 
80
  $this->assertEquals(true, $result->success);
@@ -97,17 +93,7 @@ class MerchantTest extends Setup
97
  $this->assertEquals('GBP', $gbpMerchantAccount->currencyIsoCode);
98
  }
99
 
100
- private function getMerchantAccountForCurrency($merchantAccounts, $currency)
101
- {
102
- foreach($merchantAccounts as $merchantAccount) {
103
- if($merchantAccount->id == $currency) {
104
- return $merchantAccount;
105
- }
106
- }
107
- return null;
108
- }
109
-
110
- public function testCreatePaypalOnlyMerchantWithNoCurrenciesProvided()
111
  {
112
  $gateway = new Braintree\Gateway([
113
  'clientId' => 'client_id$development$signup_client_id',
@@ -115,12 +101,9 @@ class MerchantTest extends Setup
115
  ]);
116
  $result = $gateway->merchant()->create([
117
  'email' => 'name@email.com',
118
- 'countryCodeAlpha3' => 'JPN',
119
- 'paymentMethods' => ['paypal'],
120
- 'paypalAccount' => [
121
- 'clientId' => 'fake_client_id',
122
- 'clientSecret' => 'fake_client_secret',
123
- ]
124
  ]);
125
 
126
  $this->assertEquals(true, $result->success);
@@ -130,14 +113,20 @@ class MerchantTest extends Setup
130
  $this->assertNotNull($credentials->accessToken);
131
 
132
  $merchantAccounts = $merchant->merchantAccounts;
133
- $this->assertEquals(1, count($merchantAccounts));
134
 
135
- $jpyMerchantAccount = $merchantAccounts[0];
136
- $this->assertEquals(true, $jpyMerchantAccount->default);
137
- $this->assertEquals('JPY', $jpyMerchantAccount->currencyIsoCode);
 
 
 
 
 
 
138
  }
139
 
140
- public function testCreatePaypalOnlyMerchantWithUnsupportedCountryCodeProvided()
141
  {
142
  $gateway = new Braintree\Gateway([
143
  'clientId' => 'client_id$development$signup_client_id',
@@ -145,8 +134,9 @@ class MerchantTest extends Setup
145
  ]);
146
  $result = $gateway->merchant()->create([
147
  'email' => 'name@email.com',
148
- 'countryCodeAlpha3' => 'YEM',
149
  'paymentMethods' => ['paypal'],
 
150
  'paypalAccount' => [
151
  'clientId' => 'fake_client_id',
152
  'clientSecret' => 'fake_client_secret',
@@ -160,24 +150,39 @@ class MerchantTest extends Setup
160
  $this->assertNotNull($credentials->accessToken);
161
 
162
  $merchantAccounts = $merchant->merchantAccounts;
163
- $this->assertEquals(1, count($merchantAccounts));
164
 
165
- $usdMerchantAccount = $merchantAccounts[0];
 
166
  $this->assertEquals(true, $usdMerchantAccount->default);
167
  $this->assertEquals('USD', $usdMerchantAccount->currencyIsoCode);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
  }
169
 
170
- public function testCreateMultiCurrencyMerchantIgnoresCurrenciesIfNotInternalApplication()
171
  {
172
  $gateway = new Braintree\Gateway([
173
- 'clientId' => 'client_id$development$integration_client_id',
174
- 'clientSecret' => 'client_secret$development$integration_client_secret',
175
  ]);
176
  $result = $gateway->merchant()->create([
177
  'email' => 'name@email.com',
178
- 'countryCodeAlpha3' => 'USA',
179
  'paymentMethods' => ['paypal'],
180
- 'currencies' => ['GBP', 'USD'],
181
  'paypalAccount' => [
182
  'clientId' => 'fake_client_id',
183
  'clientSecret' => 'fake_client_secret',
@@ -192,9 +197,13 @@ class MerchantTest extends Setup
192
 
193
  $merchantAccounts = $merchant->merchantAccounts;
194
  $this->assertEquals(1, count($merchantAccounts));
 
 
 
 
195
  }
196
 
197
- public function testUnallowedPaymentMethodsForMultiCurrency()
198
  {
199
  $gateway = new Braintree\Gateway([
200
  'clientId' => 'client_id$development$signup_client_id',
@@ -202,18 +211,26 @@ class MerchantTest extends Setup
202
  ]);
203
  $result = $gateway->merchant()->create([
204
  'email' => 'name@email.com',
205
- 'countryCodeAlpha3' => 'USA',
206
- 'paymentMethods' => ['credit_card'],
207
- 'currencies' => ['GBP', 'USD'],
208
  'paypalAccount' => [
209
  'clientId' => 'fake_client_id',
210
  'clientSecret' => 'fake_client_secret',
211
  ]
212
  ]);
213
 
214
- $this->assertEquals(false, $result->success);
215
- $errors = $result->errors->forKey('merchant')->onAttribute('paymentMethods');
216
- $this->assertEquals(Braintree\Error\Codes::MERCHANT_PAYMENT_METHODS_ARE_NOT_ALLOWED, $errors[0]->code);
 
 
 
 
 
 
 
 
 
217
  }
218
 
219
  public function testInvalidCurrencyForMultiCurrency()
60
  $this->assertEquals(Braintree\Error\Codes::MERCHANT_ACCOUNT_PAYMENT_METHODS_ARE_INVALID, $errors[0]->code);
61
  }
62
 
63
+ public function testCreateUSMerchantThatAcceptsMultipleCurrencies()
64
  {
65
  $gateway = new Braintree\Gateway([
66
  'clientId' => 'client_id$development$signup_client_id',
69
  $result = $gateway->merchant()->create([
70
  'email' => 'name@email.com',
71
  'countryCodeAlpha3' => 'USA',
72
+ 'paymentMethods' => ['credit_card', 'paypal'],
73
+ 'currencies' => ['GBP', 'USD']
 
 
 
 
74
  ]);
75
 
76
  $this->assertEquals(true, $result->success);
93
  $this->assertEquals('GBP', $gbpMerchantAccount->currencyIsoCode);
94
  }
95
 
96
+ public function testCreateEUMerchantThatAcceptsMultipleCurrencies()
 
 
 
 
 
 
 
 
 
 
97
  {
98
  $gateway = new Braintree\Gateway([
99
  'clientId' => 'client_id$development$signup_client_id',
101
  ]);
102
  $result = $gateway->merchant()->create([
103
  'email' => 'name@email.com',
104
+ 'countryCodeAlpha3' => 'GBR',
105
+ 'paymentMethods' => ['credit_card', 'paypal'],
106
+ 'currencies' => ['GBP', 'USD']
 
 
 
107
  ]);
108
 
109
  $this->assertEquals(true, $result->success);
113
  $this->assertNotNull($credentials->accessToken);
114
 
115
  $merchantAccounts = $merchant->merchantAccounts;
116
+ $this->assertEquals(2, count($merchantAccounts));
117
 
118
+ $usdMerchantAccount = $this->getMerchantAccountForCurrency($merchantAccounts, 'USD');
119
+ $this->assertNotNull($usdMerchantAccount);
120
+ $this->assertEquals(false, $usdMerchantAccount->default);
121
+ $this->assertEquals('USD', $usdMerchantAccount->currencyIsoCode);
122
+
123
+ $gbpMerchantAccount = $this->getMerchantAccountForCurrency($merchantAccounts, 'GBP');
124
+ $this->assertNotNull($gbpMerchantAccount);
125
+ $this->assertEquals(true, $gbpMerchantAccount->default);
126
+ $this->assertEquals('GBP', $gbpMerchantAccount->currencyIsoCode);
127
  }
128
 
129
+ public function testCreatePaypalOnlyMerchantThatAcceptsMultipleCurrencies()
130
  {
131
  $gateway = new Braintree\Gateway([
132
  'clientId' => 'client_id$development$signup_client_id',
134
  ]);
135
  $result = $gateway->merchant()->create([
136
  'email' => 'name@email.com',
137
+ 'countryCodeAlpha3' => 'USA',
138
  'paymentMethods' => ['paypal'],
139
+ 'currencies' => ['GBP', 'USD'],
140
  'paypalAccount' => [
141
  'clientId' => 'fake_client_id',
142
  'clientSecret' => 'fake_client_secret',
150
  $this->assertNotNull($credentials->accessToken);
151
 
152
  $merchantAccounts = $merchant->merchantAccounts;
153
+ $this->assertEquals(2, count($merchantAccounts));
154
 
155
+ $usdMerchantAccount = $this->getMerchantAccountForCurrency($merchantAccounts, 'USD');
156
+ $this->assertNotNull($usdMerchantAccount);
157
  $this->assertEquals(true, $usdMerchantAccount->default);
158
  $this->assertEquals('USD', $usdMerchantAccount->currencyIsoCode);
159
+
160
+ $gbpMerchantAccount = $this->getMerchantAccountForCurrency($merchantAccounts, 'GBP');
161
+ $this->assertNotNull($gbpMerchantAccount);
162
+ $this->assertEquals(false, $gbpMerchantAccount->default);
163
+ $this->assertEquals('GBP', $gbpMerchantAccount->currencyIsoCode);
164
+ }
165
+
166
+ private function getMerchantAccountForCurrency($merchantAccounts, $currency)
167
+ {
168
+ foreach($merchantAccounts as $merchantAccount) {
169
+ if($merchantAccount->id == $currency) {
170
+ return $merchantAccount;
171
+ }
172
+ }
173
+ return null;
174
  }
175
 
176
+ public function testCreatePaypalOnlyMerchantWithNoCurrenciesProvided()
177
  {
178
  $gateway = new Braintree\Gateway([
179
+ 'clientId' => 'client_id$development$signup_client_id',
180
+ 'clientSecret' => 'client_secret$development$signup_client_secret',
181
  ]);
182
  $result = $gateway->merchant()->create([
183
  'email' => 'name@email.com',
184
+ 'countryCodeAlpha3' => 'JPN',
185
  'paymentMethods' => ['paypal'],
 
186
  'paypalAccount' => [
187
  'clientId' => 'fake_client_id',
188
  'clientSecret' => 'fake_client_secret',
197
 
198
  $merchantAccounts = $merchant->merchantAccounts;
199
  $this->assertEquals(1, count($merchantAccounts));
200
+
201
+ $jpyMerchantAccount = $merchantAccounts[0];
202
+ $this->assertEquals(true, $jpyMerchantAccount->default);
203
+ $this->assertEquals('JPY', $jpyMerchantAccount->currencyIsoCode);
204
  }
205
 
206
+ public function testCreatePaypalOnlyMerchantWithUnsupportedCountryCodeProvided()
207
  {
208
  $gateway = new Braintree\Gateway([
209
  'clientId' => 'client_id$development$signup_client_id',
211
  ]);
212
  $result = $gateway->merchant()->create([
213
  'email' => 'name@email.com',
214
+ 'countryCodeAlpha3' => 'YEM',
215
+ 'paymentMethods' => ['paypal'],
 
216
  'paypalAccount' => [
217
  'clientId' => 'fake_client_id',
218
  'clientSecret' => 'fake_client_secret',
219
  ]
220
  ]);
221
 
222
+ $this->assertEquals(true, $result->success);
223
+ $merchant = $result->merchant;
224
+ $this->assertNotNull($merchant->id);
225
+ $credentials = $result->credentials;
226
+ $this->assertNotNull($credentials->accessToken);
227
+
228
+ $merchantAccounts = $merchant->merchantAccounts;
229
+ $this->assertEquals(1, count($merchantAccounts));
230
+
231
+ $usdMerchantAccount = $merchantAccounts[0];
232
+ $this->assertEquals(true, $usdMerchantAccount->default);
233
+ $this->assertEquals('USD', $usdMerchantAccount->currencyIsoCode);
234
  }
235
 
236
  public function testInvalidCurrencyForMultiCurrency()
lib/Gene/Braintree/braintree/braintree_php/tests/integration/PaymentMethodNonceTest.php CHANGED
@@ -4,6 +4,7 @@ namespace Test\Integration;
4
  require_once dirname(__DIR__) . '/Setup.php';
5
 
6
  use Test\Setup;
 
7
  use Braintree;
8
 
9
  class PaymentMethodNonceTest extends Setup
@@ -33,11 +34,19 @@ class PaymentMethodNonceTest extends Setup
33
 
34
  public function testFind_exposesThreeDSecureInfo()
35
  {
36
- $nonce = Braintree\PaymentMethodNonce::find('threedsecurednonce');
37
- $info = $nonce->threeDSecureInfo;
 
 
 
 
 
 
 
 
38
 
39
- $this->assertEquals('threedsecurednonce', $nonce->nonce);
40
- $this->assertEquals('CreditCard', $nonce->type);
41
  $this->assertEquals('Y', $info->enrolled);
42
  $this->assertEquals('authenticate_successful', $info->status);
43
  $this->assertTrue($info->liabilityShifted);
4
  require_once dirname(__DIR__) . '/Setup.php';
5
 
6
  use Test\Setup;
7
+ use Test\Helper;
8
  use Braintree;
9
 
10
  class PaymentMethodNonceTest extends Setup
34
 
35
  public function testFind_exposesThreeDSecureInfo()
36
  {
37
+ $creditCard = [
38
+ 'creditCard' => [
39
+ 'number' => '4111111111111111',
40
+ 'expirationMonth' => '12',
41
+ 'expirationYear' => '2020'
42
+ ]
43
+ ];
44
+ $nonce = Helper::generate3DSNonce($creditCard);
45
+ $foundNonce = Braintree\PaymentMethodNonce::find($nonce);
46
+ $info = $foundNonce->threeDSecureInfo;
47
 
48
+ $this->assertEquals($nonce, $foundNonce->nonce);
49
+ $this->assertEquals('CreditCard', $foundNonce->type);
50
  $this->assertEquals('Y', $info->enrolled);
51
  $this->assertEquals('authenticate_successful', $info->status);
52
  $this->assertTrue($info->liabilityShifted);
lib/Gene/Braintree/braintree/braintree_php/tests/integration/PaymentMethodTest.php CHANGED
@@ -243,11 +243,11 @@ class PaymentMethodTest extends Setup
243
  ]);
244
 
245
  $usBankAccount = $result->paymentMethod;
246
- $this->assertEquals('123456789', $usBankAccount->routingNumber);
247
  $this->assertEquals('1234', $usBankAccount->last4);
248
  $this->assertEquals('checking', $usBankAccount->accountType);
249
- $this->assertEquals('PayPal Checking - 1234', $usBankAccount->accountDescription);
250
  $this->assertEquals('Dan Schulman', $usBankAccount->accountHolderName);
 
251
  }
252
 
253
  public function testCreate_fromAbstractPaymentMethodNonce()
@@ -374,6 +374,30 @@ class PaymentMethodTest extends Setup
374
  $this->assertEquals($secondToken, $card->token);
375
  }
376
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
377
  public function testCreate_respectsVerifyCardAndVerificationMerchantAccountIdWhenIncludedOutsideOfTheNonce()
378
  {
379
  $http = new HttpClientApi(Braintree\Configuration::$global);
@@ -739,11 +763,11 @@ class PaymentMethodTest extends Setup
739
 
740
  $foundUsBankAccount = Braintree\PaymentMethod::find($result->paymentMethod->token);
741
  $this->assertInstanceOf('Braintree\UsBankAccount', $foundUsBankAccount);
742
- $this->assertEquals('123456789', $foundUsBankAccount->routingNumber);
743
  $this->assertEquals('1234', $foundUsBankAccount->last4);
744
  $this->assertEquals('checking', $foundUsBankAccount->accountType);
745
- $this->assertEquals('PayPal Checking - 1234', $foundUsBankAccount->accountDescription);
746
  $this->assertEquals('Dan Schulman', $foundUsBankAccount->accountHolderName);
 
747
  }
748
 
749
  public function testFind_returnsApplePayCards()
@@ -1300,7 +1324,7 @@ class PaymentMethodTest extends Setup
1300
  ]);
1301
  $this->assertTrue($paypalAccountResult->success);
1302
 
1303
- Braintree\PaymentMethod::delete($paymentMethodToken);
1304
 
1305
  $this->setExpectedException('Braintree\Exception\NotFound');
1306
  Braintree\PaymentMethod::find($paymentMethodToken);
@@ -1344,7 +1368,7 @@ class PaymentMethodTest extends Setup
1344
  'accessToken' => $credentials->accessToken
1345
  ]);
1346
 
1347
- $grantResult = $grantingGateway->paymentMethod()->grant($creditCard->token, false);
1348
  $this->assertTrue($grantResult->success);
1349
 
1350
  $result = Braintree\Transaction::sale([
@@ -1398,7 +1422,7 @@ class PaymentMethodTest extends Setup
1398
  'accessToken' => $credentials->accessToken
1399
  ]);
1400
 
1401
- $grantResult = $grantingGateway->paymentMethod()->grant($creditCard->token, false);
1402
 
1403
  $customer = $partnerMerchantGateway->customer()->create([
1404
  'firstName' => 'Bob',
@@ -1449,7 +1473,7 @@ class PaymentMethodTest extends Setup
1449
  'accessToken' => $credentials->accessToken
1450
  ]);
1451
 
1452
- $grantResult = $grantingGateway->paymentMethod()->grant($creditCard->token, true);
1453
 
1454
  $customer = Braintree\Customer::create([
1455
  'firstName' => 'Bob',
243
  ]);
244
 
245
  $usBankAccount = $result->paymentMethod;
246
+ $this->assertEquals('021000021', $usBankAccount->routingNumber);
247
  $this->assertEquals('1234', $usBankAccount->last4);
248
  $this->assertEquals('checking', $usBankAccount->accountType);
 
249
  $this->assertEquals('Dan Schulman', $usBankAccount->accountHolderName);
250
+ $this->assertRegexp('/CHASE/', $usBankAccount->bankName);
251
  }
252
 
253
  public function testCreate_fromAbstractPaymentMethodNonce()
374
  $this->assertEquals($secondToken, $card->token);
375
  }
376
 
377
+ public function testCreateWithVerificationAmount()
378
+ {
379
+ $http = new HttpClientApi(Braintree\Configuration::$global);
380
+ $nonce = $http->nonce_for_new_card([
381
+ 'credit_card' => [
382
+ 'number' => '4000111111111115',
383
+ 'expirationMonth' => '11',
384
+ 'expirationYear' => '2099',
385
+ ]
386
+ ]);
387
+ $customer = Braintree\Customer::createNoValidate();
388
+ $result = Braintree\PaymentMethod::create([
389
+ 'paymentMethodNonce' => $nonce,
390
+ 'customerId' => $customer->id,
391
+ 'options' => [
392
+ 'verifyCard' => 'true',
393
+ 'verificationAmount' => '5.00',
394
+ ]
395
+ ]);
396
+
397
+ $this->assertFalse($result->success);
398
+ $this->assertEquals(Braintree\Result\CreditCardVerification::PROCESSOR_DECLINED, $result->creditCardVerification->status);
399
+ }
400
+
401
  public function testCreate_respectsVerifyCardAndVerificationMerchantAccountIdWhenIncludedOutsideOfTheNonce()
402
  {
403
  $http = new HttpClientApi(Braintree\Configuration::$global);
763
 
764
  $foundUsBankAccount = Braintree\PaymentMethod::find($result->paymentMethod->token);
765
  $this->assertInstanceOf('Braintree\UsBankAccount', $foundUsBankAccount);
766
+ $this->assertEquals('021000021', $foundUsBankAccount->routingNumber);
767
  $this->assertEquals('1234', $foundUsBankAccount->last4);
768
  $this->assertEquals('checking', $foundUsBankAccount->accountType);
 
769
  $this->assertEquals('Dan Schulman', $foundUsBankAccount->accountHolderName);
770
+ $this->assertRegExp('/CHASE/', $foundUsBankAccount->bankName);
771
  }
772
 
773
  public function testFind_returnsApplePayCards()
1324
  ]);
1325
  $this->assertTrue($paypalAccountResult->success);
1326
 
1327
+ Braintree\PaymentMethod::delete($paymentMethodToken, ['revokeAllGrants' => false]);
1328
 
1329
  $this->setExpectedException('Braintree\Exception\NotFound');
1330
  Braintree\PaymentMethod::find($paymentMethodToken);
1368
  'accessToken' => $credentials->accessToken
1369
  ]);
1370
 
1371
+ $grantResult = $grantingGateway->paymentMethod()->grant($creditCard->token);
1372
  $this->assertTrue($grantResult->success);
1373
 
1374
  $result = Braintree\Transaction::sale([
1422
  'accessToken' => $credentials->accessToken
1423
  ]);
1424
 
1425
+ $grantResult = $grantingGateway->paymentMethod()->grant($creditCard->token, ['allow_vaulting' => false]);
1426
 
1427
  $customer = $partnerMerchantGateway->customer()->create([
1428
  'firstName' => 'Bob',
1473
  'accessToken' => $credentials->accessToken
1474
  ]);
1475
 
1476
+ $grantResult = $grantingGateway->paymentMethod()->grant($creditCard->token, ['allow_vaulting' => true]);
1477
 
1478
  $customer = Braintree\Customer::create([
1479
  'firstName' => 'Bob',
lib/Gene/Braintree/braintree/braintree_php/tests/integration/TransactionTest.php CHANGED
@@ -171,11 +171,13 @@ class TransactionTest extends Setup
171
  $this->assertEquals(Braintree\Transaction::SETTLEMENT_PENDING, $transaction->status);
172
  $this->assertEquals(Braintree\Transaction::SALE, $transaction->type);
173
  $this->assertEquals('100.00', $transaction->amount);
174
- $this->assertEquals('123456789', $transaction->usBankAccount->routingNumber);
175
  $this->assertEquals('1234', $transaction->usBankAccount->last4);
176
  $this->assertEquals('checking', $transaction->usBankAccount->accountType);
177
- $this->assertEquals('PayPal Checking - 1234', $transaction->usBankAccount->accountDescription);
178
  $this->assertEquals('Dan Schulman', $transaction->usBankAccount->accountHolderName);
 
 
 
179
  }
180
 
181
  public function testSaleWithUsBankAccountNonceAndVaultedToken()
@@ -195,11 +197,12 @@ class TransactionTest extends Setup
195
  $this->assertEquals(Braintree\Transaction::SETTLEMENT_PENDING, $transaction->status);
196
  $this->assertEquals(Braintree\Transaction::SALE, $transaction->type);
197
  $this->assertEquals('100.00', $transaction->amount);
198
- $this->assertEquals('123456789', $transaction->usBankAccount->routingNumber);
199
  $this->assertEquals('1234', $transaction->usBankAccount->last4);
200
  $this->assertEquals('checking', $transaction->usBankAccount->accountType);
201
- $this->assertEquals('PayPal Checking - 1234', $transaction->usBankAccount->accountDescription);
202
  $this->assertEquals('Dan Schulman', $transaction->usBankAccount->accountHolderName);
 
 
203
 
204
  $result = Braintree\Transaction::sale([
205
  'amount' => '100.00',
@@ -215,11 +218,12 @@ class TransactionTest extends Setup
215
  $this->assertEquals(Braintree\Transaction::SETTLEMENT_PENDING, $transaction->status);
216
  $this->assertEquals(Braintree\Transaction::SALE, $transaction->type);
217
  $this->assertEquals('100.00', $transaction->amount);
218
- $this->assertEquals('123456789', $transaction->usBankAccount->routingNumber);
219
  $this->assertEquals('1234', $transaction->usBankAccount->last4);
220
  $this->assertEquals('checking', $transaction->usBankAccount->accountType);
221
- $this->assertEquals('PayPal Checking - 1234', $transaction->usBankAccount->accountDescription);
222
  $this->assertEquals('Dan Schulman', $transaction->usBankAccount->accountHolderName);
 
 
223
  }
224
 
225
  public function testSaleWithInvalidUsBankAccountNonce()
@@ -239,6 +243,22 @@ class TransactionTest extends Setup
239
  $this->assertEquals(Braintree\Error\Codes::TRANSACTION_PAYMENT_METHOD_NONCE_UNKNOWN, $baseErrors[0]->code);
240
  }
241
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
 
243
  public function testSettleAltPayTransaction()
244
  {
@@ -405,6 +425,21 @@ class TransactionTest extends Setup
405
  }
406
 
407
  public function testCreateTransactionUsingRawApplePayParams()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
408
  {
409
  $result = Braintree\Transaction::sale([
410
  'amount' => '1.02',
@@ -1924,6 +1959,7 @@ class TransactionTest extends Setup
1924
  $this->assertNotNull($transaction->paypalDetails->payerId);
1925
  $this->assertNotNull($transaction->paypalDetails->payerFirstName);
1926
  $this->assertNotNull($transaction->paypalDetails->payerLastName);
 
1927
  $this->assertNotNull($transaction->paypalDetails->sellerProtectionStatus);
1928
  $this->assertNotNull($transaction->paypalDetails->captureId);
1929
  $this->assertNotNull($transaction->paypalDetails->refundId);
@@ -2184,6 +2220,34 @@ class TransactionTest extends Setup
2184
  $this->assertEquals(Braintree\Transaction::THREE_D_SECURE, $result->transaction->gatewayRejectionReason);
2185
  }
2186
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2187
  public function testSale_withThreeDSecureToken()
2188
  {
2189
  $threeDSecureToken = Test\Helper::create3DSVerification(
@@ -4038,8 +4102,64 @@ class TransactionTest extends Setup
4038
  $result->transaction->facilitatorDetails->oauthApplicationName,
4039
  "PseudoShop"
4040
  );
 
 
4041
  }
4042
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4043
  public function testTransactionsCanBeCreatedWithSharedParams()
4044
  {
4045
  $partnerMerchantGateway = new Braintree\Gateway([
171
  $this->assertEquals(Braintree\Transaction::SETTLEMENT_PENDING, $transaction->status);
172
  $this->assertEquals(Braintree\Transaction::SALE, $transaction->type);
173
  $this->assertEquals('100.00', $transaction->amount);
174
+ $this->assertEquals('021000021', $transaction->usBankAccount->routingNumber);
175
  $this->assertEquals('1234', $transaction->usBankAccount->last4);
176
  $this->assertEquals('checking', $transaction->usBankAccount->accountType);
 
177
  $this->assertEquals('Dan Schulman', $transaction->usBankAccount->accountHolderName);
178
+ $this->assertRegExp('/CHASE/', $transaction->usBankAccount->bankName);
179
+ $this->assertEquals('cl mandate text', $transaction->usBankAccount->achMandate->text);
180
+ $this->assertEquals('DateTime', get_class($transaction->usBankAccount->achMandate->acceptedAt));
181
  }
182
 
183
  public function testSaleWithUsBankAccountNonceAndVaultedToken()
197
  $this->assertEquals(Braintree\Transaction::SETTLEMENT_PENDING, $transaction->status);
198
  $this->assertEquals(Braintree\Transaction::SALE, $transaction->type);
199
  $this->assertEquals('100.00', $transaction->amount);
200
+ $this->assertEquals('021000021', $transaction->usBankAccount->routingNumber);
201
  $this->assertEquals('1234', $transaction->usBankAccount->last4);
202
  $this->assertEquals('checking', $transaction->usBankAccount->accountType);
 
203
  $this->assertEquals('Dan Schulman', $transaction->usBankAccount->accountHolderName);
204
+ $this->assertEquals('cl mandate text', $transaction->usBankAccount->achMandate->text);
205
+ $this->assertEquals('DateTime', get_class($transaction->usBankAccount->achMandate->acceptedAt));
206
 
207
  $result = Braintree\Transaction::sale([
208
  'amount' => '100.00',
218
  $this->assertEquals(Braintree\Transaction::SETTLEMENT_PENDING, $transaction->status);
219
  $this->assertEquals(Braintree\Transaction::SALE, $transaction->type);
220
  $this->assertEquals('100.00', $transaction->amount);
221
+ $this->assertEquals('021000021', $transaction->usBankAccount->routingNumber);
222
  $this->assertEquals('1234', $transaction->usBankAccount->last4);
223
  $this->assertEquals('checking', $transaction->usBankAccount->accountType);
 
224
  $this->assertEquals('Dan Schulman', $transaction->usBankAccount->accountHolderName);
225
+ $this->assertEquals('cl mandate text', $transaction->usBankAccount->achMandate->text);
226
+ $this->assertEquals('DateTime', get_class($transaction->usBankAccount->achMandate->acceptedAt));
227
  }
228
 
229
  public function testSaleWithInvalidUsBankAccountNonce()
243
  $this->assertEquals(Braintree\Error\Codes::TRANSACTION_PAYMENT_METHOD_NONCE_UNKNOWN, $baseErrors[0]->code);
244
  }
245
 
246
+ public function testSaleAndSkipAdvancedFraudChecking()
247
+ {
248
+ $result = Braintree\Transaction::sale([
249
+ 'amount' => Braintree\Test\TransactionAmounts::$authorize,
250
+ 'creditCard' => [
251
+ 'number' => Braintree\Test\CreditCardNumbers::$visa,
252
+ 'expirationDate' => '05/2009',
253
+ ],
254
+ 'options' => [
255
+ 'skipAdvancedFraudChecking' => true
256
+ ]
257
+ ]);
258
+ $this->assertTrue($result->success);
259
+ $transaction = $result->transaction;
260
+ $this->assertNull($transaction->riskData->id);
261
+ }
262
 
263
  public function testSettleAltPayTransaction()
264
  {
425
  }
426
 
427
  public function testCreateTransactionUsingRawApplePayParams()
428
+ {
429
+ $result = Braintree\Transaction::sale([
430
+ 'amount' => '1.02',
431
+ 'applePayCard' => [
432
+ 'number' => "370295001292109",
433
+ 'cardholderName' => "JANE SMITH",
434
+ 'cryptogram' => "AAAAAAAA/COBt84dnIEcwAA3gAAGhgEDoLABAAhAgAABAAAALnNCLw==",
435
+ 'expirationMonth' => "10",
436
+ 'expirationYear' => "17"
437
+ ]
438
+ ]);
439
+ $this->assertTrue($result->success);
440
+ }
441
+
442
+ public function testCreateTransactionUsingRawApplePayParamsInSnakeCaseForBackwardsCompatibility()
443
  {
444
  $result = Braintree\Transaction::sale([
445
  'amount' => '1.02',
1959
  $this->assertNotNull($transaction->paypalDetails->payerId);
1960
  $this->assertNotNull($transaction->paypalDetails->payerFirstName);
1961
  $this->assertNotNull($transaction->paypalDetails->payerLastName);
1962
+ $this->assertNotNull($transaction->paypalDetails->payerStatus);
1963
  $this->assertNotNull($transaction->paypalDetails->sellerProtectionStatus);
1964
  $this->assertNotNull($transaction->paypalDetails->captureId);
1965
  $this->assertNotNull($transaction->paypalDetails->refundId);
2220
  $this->assertEquals(Braintree\Transaction::THREE_D_SECURE, $result->transaction->gatewayRejectionReason);
2221
  }
2222
 
2223
+ public function testSale_withThreeDSecureOptionRequiredInSnakeCase()
2224
+ {
2225
+ $http = new HttpClientApi(Braintree\Configuration::$global);
2226
+ $nonce = $http->nonce_for_new_card([
2227
+ "creditCard" => [
2228
+ "number" => "4111111111111111",
2229
+ "expirationMonth" => "11",
2230
+ "expirationYear" => "2099"
2231
+ ]
2232
+ ]);
2233
+
2234
+ $result = Braintree\Transaction::sale([
2235
+ 'merchantAccountId' => Test\Helper::threeDSecureMerchantAccountId(),
2236
+ 'amount' => '100.00',
2237
+ 'creditCard' => [
2238
+ 'number' => '4111111111111111',
2239
+ 'expirationDate' => '05/09'
2240
+ ],
2241
+ 'options' => [
2242
+ 'three_d_secure' => [
2243
+ 'required' => true
2244
+ ]
2245
+ ]
2246
+ ]);
2247
+ $this->assertFalse($result->success);
2248
+ $this->assertEquals(Braintree\Transaction::THREE_D_SECURE, $result->transaction->gatewayRejectionReason);
2249
+ }
2250
+
2251
  public function testSale_withThreeDSecureToken()
2252
  {
2253
  $threeDSecureToken = Test\Helper::create3DSVerification(
4102
  $result->transaction->facilitatorDetails->oauthApplicationName,
4103
  "PseudoShop"
4104
  );
4105
+
4106
+ $this->assertNull($result->transaction->billing["postalCode"]);
4107
  }
4108
 
4109
+ public function testBillingPostalCodeIsReturnedWhenRequestedOnTransactionsCreatedViaNonceGranting()
4110
+ {
4111
+ $partnerMerchantGateway = new Braintree\Gateway([
4112
+ 'environment' => 'development',
4113
+ 'merchantId' => 'integration_merchant_public_id',
4114
+ 'publicKey' => 'oauth_app_partner_user_public_key',
4115
+ 'privateKey' => 'oauth_app_partner_user_private_key'
4116
+ ]);
4117
+
4118
+ $customer = $partnerMerchantGateway->customer()->create([
4119
+ 'firstName' => 'Joe',
4120
+ 'lastName' => 'Brown'
4121
+ ])->customer;
4122
+ $creditCard = $partnerMerchantGateway->creditCard()->create([
4123
+ 'customerId' => $customer->id,
4124
+ 'cardholderName' => 'Adam Davis',
4125
+ 'number' => '4111111111111111',
4126
+ 'expirationDate' => '05/2009',
4127
+ 'billingAddress' => [
4128
+ 'firstName' => 'Adam',
4129
+ 'lastName' => 'Davis',
4130
+ 'postalCode' => '95131'
4131
+ ]
4132
+ ])->creditCard;
4133
+
4134
+ $oauthAppGateway = new Braintree\Gateway([
4135
+ 'clientId' => 'client_id$development$integration_client_id',
4136
+ 'clientSecret' => 'client_secret$development$integration_client_secret'
4137
+ ]);
4138
+
4139
+ $code = Test\Braintree\OAuthTestHelper::createGrant($oauthAppGateway, [
4140
+ 'merchant_public_id' => 'integration_merchant_id',
4141
+ 'scope' => 'grant_payment_method'
4142
+ ]);
4143
+
4144
+ $credentials = $oauthAppGateway->oauth()->createTokenFromCode([
4145
+ 'code' => $code,
4146
+ ]);
4147
+
4148
+ $grantingGateway = new Braintree\Gateway([
4149
+ 'accessToken' => $credentials->accessToken
4150
+ ]);
4151
+
4152
+ $grantResult = $grantingGateway->paymentMethod()->grant($creditCard->token, ['allow_vaulting' => false, 'include_billing_postal_code' => true]);
4153
+
4154
+ $result = Braintree\Transaction::sale([
4155
+ 'amount' => '100.00',
4156
+ 'paymentMethodNonce' => $grantResult->paymentMethodNonce->nonce
4157
+ ]);
4158
+
4159
+ $this->assertEquals($result->transaction->billing["postalCode"], "95131");
4160
+ }
4161
+
4162
+
4163
  public function testTransactionsCanBeCreatedWithSharedParams()
4164
  {
4165
  $partnerMerchantGateway = new Braintree\Gateway([
lib/Gene/Braintree/braintree/braintree_php/tests/integration/UsBankAccountTest.php CHANGED
@@ -24,11 +24,14 @@ class UsBankAccountAccountTest extends Setup
24
 
25
  $foundUsBankAccount = $result->paymentMethod;
26
  $this->assertInstanceOf('Braintree\UsBankAccount', $foundUsBankAccount);
27
- $this->assertEquals('123456789', $foundUsBankAccount->routingNumber);
28
  $this->assertEquals('1234', $foundUsBankAccount->last4);
29
  $this->assertEquals('checking', $foundUsBankAccount->accountType);
30
- $this->assertEquals('PayPal Checking - 1234', $foundUsBankAccount->accountDescription);
31
  $this->assertEquals('Dan Schulman', $foundUsBankAccount->accountHolderName);
 
 
 
 
32
  }
33
 
34
  public function testFind()
@@ -44,11 +47,14 @@ class UsBankAccountAccountTest extends Setup
44
 
45
  $foundUsBankAccount= Braintree\UsBankAccount::find($result->paymentMethod->token);
46
  $this->assertInstanceOf('Braintree\UsBankAccount', $foundUsBankAccount);
47
- $this->assertEquals('123456789', $foundUsBankAccount->routingNumber);
48
  $this->assertEquals('1234', $foundUsBankAccount->last4);
49
  $this->assertEquals('checking', $foundUsBankAccount->accountType);
50
- $this->assertEquals('PayPal Checking - 1234', $foundUsBankAccount->accountDescription);
51
  $this->assertEquals('Dan Schulman', $foundUsBankAccount->accountHolderName);
 
 
 
 
52
  }
53
 
54
  public function testFind_throwsIfCannotBeFound()
@@ -78,10 +84,12 @@ class UsBankAccountAccountTest extends Setup
78
  $this->assertEquals(Braintree\Transaction::SETTLEMENT_PENDING, $transaction->status);
79
  $this->assertEquals(Braintree\Transaction::SALE, $transaction->type);
80
  $this->assertEquals('100.00', $transaction->amount);
81
- $this->assertEquals('123456789', $transaction->usBankAccount->routingNumber);
82
  $this->assertEquals('1234', $transaction->usBankAccount->last4);
83
  $this->assertEquals('checking', $transaction->usBankAccount->accountType);
84
- $this->assertEquals('PayPal Checking - 1234', $transaction->usBankAccount->accountDescription);
85
  $this->assertEquals('Dan Schulman', $transaction->usBankAccount->accountHolderName);
 
 
 
86
  }
87
  }
24
 
25
  $foundUsBankAccount = $result->paymentMethod;
26
  $this->assertInstanceOf('Braintree\UsBankAccount', $foundUsBankAccount);
27
+ $this->assertEquals('021000021', $foundUsBankAccount->routingNumber);
28
  $this->assertEquals('1234', $foundUsBankAccount->last4);
29
  $this->assertEquals('checking', $foundUsBankAccount->accountType);
 
30
  $this->assertEquals('Dan Schulman', $foundUsBankAccount->accountHolderName);
31
+ $this->assertRegExp('/CHASE/', $foundUsBankAccount->bankName);
32
+ $this->assertEquals('cl mandate text', $foundUsBankAccount->achMandate->text);
33
+ $this->assertEquals('DateTime', get_class($foundUsBankAccount->achMandate->acceptedAt));
34
+ $this->assertEquals(true, $foundUsBankAccount->default);
35
  }
36
 
37
  public function testFind()
47
 
48
  $foundUsBankAccount= Braintree\UsBankAccount::find($result->paymentMethod->token);
49
  $this->assertInstanceOf('Braintree\UsBankAccount', $foundUsBankAccount);
50
+ $this->assertEquals('021000021', $foundUsBankAccount->routingNumber);
51
  $this->assertEquals('1234', $foundUsBankAccount->last4);
52
  $this->assertEquals('checking', $foundUsBankAccount->accountType);
 
53
  $this->assertEquals('Dan Schulman', $foundUsBankAccount->accountHolderName);
54
+ $this->assertRegExp('/CHASE/', $foundUsBankAccount->bankName);
55
+ $this->assertEquals('cl mandate text', $foundUsBankAccount->achMandate->text);
56
+ $this->assertEquals('DateTime', get_class($foundUsBankAccount->achMandate->acceptedAt));
57
+ $this->assertEquals(true, $foundUsBankAccount->default);
58
  }
59
 
60
  public function testFind_throwsIfCannotBeFound()
84
  $this->assertEquals(Braintree\Transaction::SETTLEMENT_PENDING, $transaction->status);
85
  $this->assertEquals(Braintree\Transaction::SALE, $transaction->type);
86
  $this->assertEquals('100.00', $transaction->amount);
87
+ $this->assertEquals('021000021', $transaction->usBankAccount->routingNumber);
88
  $this->assertEquals('1234', $transaction->usBankAccount->last4);
89
  $this->assertEquals('checking', $transaction->usBankAccount->accountType);
 
90
  $this->assertEquals('Dan Schulman', $transaction->usBankAccount->accountHolderName);
91
+ $this->assertRegExp('/CHASE/', $transaction->usBankAccount->bankName);
92
+ $this->assertEquals('cl mandate text', $transaction->usBankAccount->achMandate->text);
93
+ $this->assertEquals('DateTime', get_class($transaction->usBankAccount->achMandate->acceptedAt));
94
  }
95
  }
lib/Gene/Braintree/braintree/braintree_php/tests/unit/ConfigurationTest.php CHANGED
@@ -253,11 +253,23 @@ class ConfigurationTest extends Setup
253
  $this->assertEquals(60, $this->config->timeout());
254
  }
255
 
 
 
 
 
 
 
 
 
 
 
 
 
256
  /**
257
  * @expectedException Braintree\Exception\Configuration
258
  * @expectedExceptionMessage environment needs to be set
259
  */
260
- public function testValidateEmptyEnvironment()
261
  {
262
  //Braintree\Configuration::environment('development');
263
  Braintree\Configuration::merchantId('integration_merchant_id');
@@ -266,11 +278,24 @@ class ConfigurationTest extends Setup
266
 
267
  Braintree\Configuration::$global->assertHasAccessTokenOrKeys();
268
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
269
  /**
270
  * @expectedException Braintree\Exception\Configuration
271
  * @expectedExceptionMessage merchantId needs to be set
272
  */
273
- public function testMerchantId()
274
  {
275
  Braintree\Configuration::environment('development');
276
  //Braintree\Configuration::merchantId('integration_merchant_id');
@@ -279,11 +304,24 @@ class ConfigurationTest extends Setup
279
 
280
  Braintree\Configuration::$global->assertHasAccessTokenOrKeys();
281
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
282
  /**
283
  * @expectedException Braintree\Exception\Configuration
284
  * @expectedExceptionMessage publicKey needs to be set
285
  */
286
- public function testPublicKey()
287
  {
288
  Braintree\Configuration::environment('development');
289
  Braintree\Configuration::merchantId('integration_merchant_id');
@@ -292,11 +330,24 @@ class ConfigurationTest extends Setup
292
 
293
  Braintree\Configuration::$global->assertHasAccessTokenOrKeys();
294
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
295
  /**
296
  * @expectedException Braintree\Exception\Configuration
297
  * @expectedExceptionMessage privateKey needs to be set
298
  */
299
- public function testPrivateKey()
300
  {
301
  Braintree\Configuration::environment('development');
302
  Braintree\Configuration::merchantId('integration_merchant_id');
@@ -305,6 +356,19 @@ class ConfigurationTest extends Setup
305
 
306
  Braintree\Configuration::$global->assertHasAccessTokenOrKeys();
307
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
308
 
309
  public function testValidWithOAuthClientCredentials()
310
  {
253
  $this->assertEquals(60, $this->config->timeout());
254
  }
255
 
256
+ function testSslVersion()
257
+ {
258
+ $this->config->sslVersion(6);
259
+
260
+ $this->assertEquals(6, $this->config->sslVersion());
261
+ }
262
+
263
+ function testSslVersionDefaultsToNull()
264
+ {
265
+ $this->assertEquals(null, $this->config->sslVersion());
266
+ }
267
+
268
  /**
269
  * @expectedException Braintree\Exception\Configuration
270
  * @expectedExceptionMessage environment needs to be set
271
  */
272
+ public function testValidateAbsentEnvironment()
273
  {
274
  //Braintree\Configuration::environment('development');
275
  Braintree\Configuration::merchantId('integration_merchant_id');
278
 
279
  Braintree\Configuration::$global->assertHasAccessTokenOrKeys();
280
  }
281
+ /**
282
+ * @expectedException Braintree\Exception\Configuration
283
+ * @expectedExceptionMessage environment needs to be set
284
+ */
285
+ public function testValidateEmptyStringEnvironment()
286
+ {
287
+ Braintree\Configuration::environment('');
288
+ Braintree\Configuration::merchantId('integration_merchant_id');
289
+ Braintree\Configuration::publicKey('integration_public_key');
290
+ Braintree\Configuration::privateKey('integration_private_key');
291
+
292
+ Braintree\Configuration::$global->assertHasAccessTokenOrKeys();
293
+ }
294
  /**
295
  * @expectedException Braintree\Exception\Configuration
296
  * @expectedExceptionMessage merchantId needs to be set
297
  */
298
+ public function testAbsentMerchantId()
299
  {
300
  Braintree\Configuration::environment('development');
301
  //Braintree\Configuration::merchantId('integration_merchant_id');
304
 
305
  Braintree\Configuration::$global->assertHasAccessTokenOrKeys();
306
  }
307
+ /**
308
+ * @expectedException Braintree\Exception\Configuration
309
+ * @expectedExceptionMessage merchantId needs to be set
310
+ */
311
+ public function testEmptyStringMerchantId()
312
+ {
313
+ Braintree\Configuration::environment('development');
314
+ Braintree\Configuration::merchantId('');
315
+ Braintree\Configuration::publicKey('integration_public_key');
316
+ Braintree\Configuration::privateKey('integration_private_key');
317
+
318
+ Braintree\Configuration::$global->assertHasAccessTokenOrKeys();
319
+ }
320
  /**
321
  * @expectedException Braintree\Exception\Configuration
322
  * @expectedExceptionMessage publicKey needs to be set
323
  */
324
+ public function testAbsentPublicKey()
325
  {
326
  Braintree\Configuration::environment('development');
327
  Braintree\Configuration::merchantId('integration_merchant_id');
330
 
331
  Braintree\Configuration::$global->assertHasAccessTokenOrKeys();
332
  }
333
+ /**
334
+ * @expectedException Braintree\Exception\Configuration
335
+ * @expectedExceptionMessage publicKey needs to be set
336
+ */
337
+ public function testEmptyStringPublicKey()
338
+ {
339
+ Braintree\Configuration::environment('development');
340
+ Braintree\Configuration::merchantId('integration_merchant_id');
341
+ Braintree\Configuration::publicKey('');
342
+ Braintree\Configuration::privateKey('integration_private_key');
343
+
344
+ Braintree\Configuration::$global->assertHasAccessTokenOrKeys();
345
+ }
346
  /**
347
  * @expectedException Braintree\Exception\Configuration
348
  * @expectedExceptionMessage privateKey needs to be set
349
  */
350
+ public function testAbsentPrivateKey()
351
  {
352
  Braintree\Configuration::environment('development');
353
  Braintree\Configuration::merchantId('integration_merchant_id');
356
 
357
  Braintree\Configuration::$global->assertHasAccessTokenOrKeys();
358
  }
359
+ /**
360
+ * @expectedException Braintree\Exception\Configuration
361
+ * @expectedExceptionMessage privateKey needs to be set
362
+ */
363
+ public function testEmptyStringPrivateKey()
364
+ {
365
+ Braintree\Configuration::environment('development');
366
+ Braintree\Configuration::merchantId('integration_merchant_id');
367
+ Braintree\Configuration::publicKey('integration_public_key');
368
+ Braintree\Configuration::privateKey('');
369
+
370
+ Braintree\Configuration::$global->assertHasAccessTokenOrKeys();
371
+ }
372
 
373
  public function testValidWithOAuthClientCredentials()
374
  {
lib/Gene/Braintree/braintree/braintree_php/tests/unit/PaymentMethodTest.php CHANGED
@@ -57,4 +57,44 @@ class PaymentMethodTest extends Setup
57
  $this->setExpectedException('InvalidArgumentException');
58
  Braintree\PaymentMethod::find('\t');
59
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  }
57
  $this->setExpectedException('InvalidArgumentException');
58
  Braintree\PaymentMethod::find('\t');
59
  }
60
+
61
+ public function testDeleteWithRevokeAllGrantsAsTrue()
62
+ {
63
+ $paymentMethodGateway = $this->mockPaymentMethodGatewayDoDelete();
64
+ $expectedURL = "/payment_methods/any/some_token?revoke_all_grants=1";
65
+ $paymentMethodGateway->expects($this->once())->method('_doDelete')->with($this->equalTo($expectedURL));
66
+ $paymentMethodGateway->delete("some_token", ['revokeAllGrants' => true]);
67
+ }
68
+
69
+ public function testDeleteWithRevokeAllGrantsAsFalse()
70
+ {
71
+ $paymentMethodGateway = $this->mockPaymentMethodGatewayDoDelete();
72
+ $expectedURL = "/payment_methods/any/some_token?revoke_all_grants=0";
73
+ $paymentMethodGateway->expects($this->once())->method('_doDelete')->with($this->equalTo($expectedURL));
74
+ $paymentMethodGateway->delete("some_token", ['revokeAllGrants' => false]);
75
+ }
76
+
77
+ public function testDeleteWithoutRevokeAllGrantsOption()
78
+ {
79
+ $paymentMethodGateway = $this->mockPaymentMethodGatewayDoDelete();
80
+ $expectedURL = "/payment_methods/any/some_token";
81
+ $paymentMethodGateway->expects($this->once())->method('_doDelete')->with($this->equalTo($expectedURL));
82
+ $paymentMethodGateway->delete("some_token");
83
+ }
84
+
85
+ public function testDeleteWithInvalidOption()
86
+ {
87
+ $paymentMethodGateway = $this->mockPaymentMethodGatewayDoDelete();
88
+ $this->setExpectedException('InvalidArgumentException');
89
+ $paymentMethodGateway->expects($this->never())->method('_doDelete');
90
+ $paymentMethodGateway->delete("some_token", ['invalidKey' => false]);
91
+ }
92
+
93
+ private function mockPaymentMethodGatewayDoDelete()
94
+ {
95
+ return $this->getMockBuilder('Braintree\PaymentMethodGateway')
96
+ ->setConstructorArgs(array(Braintree\Configuration::gateway()))
97
+ ->setMethods(array('_doDelete'))
98
+ ->getMock();
99
+ }
100
  }
lib/Gene/Braintree/braintree/braintree_php/tests/unit/TransactionTest.php CHANGED
@@ -23,28 +23,98 @@ class TransactionTest extends Setup
23
  $t->foo;
24
  }
25
 
26
- public function testCloneTransaction_RaisesErrorOnInvalidProperty()
27
- {
28
  $this->setExpectedException('InvalidArgumentException');
29
- Braintree\Transaction::cloneTransaction('an id', ['amount' => '123.45', 'invalidProperty' => 'foo']);
30
- }
31
 
32
- public function testErrorsWhenFindWithBlankString()
33
- {
34
  $this->setExpectedException('InvalidArgumentException');
35
  Braintree\Transaction::find('');
36
- }
37
 
38
- public function testErrorsWhenFindWithWhitespaceString()
39
- {
40
  $this->setExpectedException('InvalidArgumentException');
41
  Braintree\Transaction::find('\t');
42
- }
43
 
44
  public function testInitializationWithoutArguments()
45
  {
46
  $transaction = Braintree\Transaction::factory([]);
47
-
48
  $this->assertTrue($transaction instanceof Braintree\Transaction);
49
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  }
23
  $t->foo;
24
  }
25
 
26
+ public function testCloneTransaction_RaisesErrorOnInvalidProperty()
27
+ {
28
  $this->setExpectedException('InvalidArgumentException');
29
+ Braintree\Transaction::cloneTransaction('an id', ['amount' => '123.45', 'invalidProperty' => 'foo']);
30
+ }
31
 
32
+ public function testErrorsWhenFindWithBlankString()
33
+ {
34
  $this->setExpectedException('InvalidArgumentException');
35
  Braintree\Transaction::find('');
36
+ }
37
 
38
+ public function testErrorsWhenFindWithWhitespaceString()
39
+ {
40
  $this->setExpectedException('InvalidArgumentException');
41
  Braintree\Transaction::find('\t');
42
+ }
43
 
44
  public function testInitializationWithoutArguments()
45
  {
46
  $transaction = Braintree\Transaction::factory([]);
 
47
  $this->assertTrue($transaction instanceof Braintree\Transaction);
48
  }
49
+
50
+ public function testSaleWithSkipAdvancedFraudCheckingValueAsTrue()
51
+ {
52
+ $transactionGateway = $this->mockTransactionGatewayDoCreate();
53
+ $transactionGateway
54
+ ->expects($this->once())
55
+ ->method('_doCreate')
56
+ ->will($this->returnCallback(function($path, $params) {
57
+ $this->assertTrue($params["transaction"]["options"]["skipAdvancedFraudChecking"]);
58
+ }));
59
+ $transactionGateway->sale([
60
+ 'amount' => Braintree\Test\TransactionAmounts::$authorize,
61
+ 'creditCard' => [
62
+ 'number' => Braintree\Test\CreditCardNumbers::$visa,
63
+ 'expirationDate' => '05/2009',
64
+ ],
65
+ 'options' => [
66
+ 'skipAdvancedFraudChecking' => true
67
+ ]
68
+ ]);
69
+ }
70
+
71
+ public function testSaleWithSkipAdvancedFraudCheckingValueAsFalse()
72
+ {
73
+ $transactionGateway = $this->mockTransactionGatewayDoCreate();
74
+ $transactionGateway
75
+ ->expects($this->once())
76
+ ->method('_doCreate')
77
+ ->will($this->returnCallback(function($path, $params) {
78
+ $this->assertFalse($params["transaction"]["options"]["skipAdvancedFraudChecking"]);
79
+ }));
80
+ $transactionGateway->sale([
81
+ 'amount' => Braintree\Test\TransactionAmounts::$authorize,
82
+ 'creditCard' => [
83
+ 'number' => Braintree\Test\CreditCardNumbers::$visa,
84
+ 'expirationDate' => '05/2009',
85
+ ],
86
+ 'options' => [
87
+ 'skipAdvancedFraudChecking' => false
88
+ ]
89
+ ]);
90
+ }
91
+
92
+ public function testSaleWithoutSkipAdvancedFraudCheckingOption()
93
+ {
94
+ $transactionGateway = $this->mockTransactionGatewayDoCreate();
95
+ $transactionGateway
96
+ ->expects($this->once())
97
+ ->method('_doCreate')
98
+ ->will($this->returnCallback(function($path, $params) {
99
+ $this->assertArrayNotHasKey("skipAdvancedFraudChecking", $params["transaction"]["options"]);
100
+ }));
101
+ $transactionGateway->sale([
102
+ 'amount' => Braintree\Test\TransactionAmounts::$authorize,
103
+ 'creditCard' => [
104
+ 'number' => Braintree\Test\CreditCardNumbers::$visa,
105
+ 'expirationDate' => '05/2009',
106
+ ],
107
+ 'options' => [
108
+ 'submitForSettlement' => true
109
+ ]
110
+ ]);
111
+ }
112
+
113
+ private function mockTransactionGatewayDoCreate()
114
+ {
115
+ return $this->getMockBuilder('Braintree\TransactionGateway')
116
+ ->setConstructorArgs(array(Braintree\Configuration::gateway()))
117
+ ->setMethods(array('_doCreate'))
118
+ ->getMock();
119
+ }
120
  }
lib/Gene/Braintree/braintree/braintree_php/tests/unit/UsBankAccount.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Test\Unit;
3
+
4
+ require_once dirname(__DIR__) . '/Setup.php';
5
+
6
+ use DateTime;
7
+ use Test\Setup;
8
+ use Braintree;
9
+
10
+ class UsBankAccountTest extends Setup
11
+ {
12
+
13
+ public function testIsDefault()
14
+ {
15
+ $usBankAccount = Braintree\UsBankAccount::factory(['default' => true]);
16
+ $this->assertTrue($usBankAccount->isDefault());
17
+
18
+ $usBankAccount = Braintree\UsBankAccount::factory(['default' => false]);
19
+ $this->assertFalse($usBankAccount->isDefault());
20
+ }
21
+ }
lib/Gene/Braintree/braintree/braintree_php/tests/unit/WebhookNotificationTest.php CHANGED
@@ -303,7 +303,6 @@ class WebhookNotificationTest extends Setup
303
  $this->assertEquals('123456789', $transaction->usBankAccount->routingNumber);
304
  $this->assertEquals('1234', $transaction->usBankAccount->last4);
305
  $this->assertEquals('checking', $transaction->usBankAccount->accountType);
306
- $this->assertEquals('PayPal Checking - 1234', $transaction->usBankAccount->accountDescription);
307
  $this->assertEquals('Dan Schulman', $transaction->usBankAccount->accountHolderName);
308
  }
309
 
@@ -327,7 +326,6 @@ class WebhookNotificationTest extends Setup
327
  $this->assertEquals('123456789', $transaction->usBankAccount->routingNumber);
328
  $this->assertEquals('1234', $transaction->usBankAccount->last4);
329
  $this->assertEquals('checking', $transaction->usBankAccount->accountType);
330
- $this->assertEquals('PayPal Checking - 1234', $transaction->usBankAccount->accountDescription);
331
  $this->assertEquals('Dan Schulman', $transaction->usBankAccount->accountHolderName);
332
  }
333
 
303
  $this->assertEquals('123456789', $transaction->usBankAccount->routingNumber);
304
  $this->assertEquals('1234', $transaction->usBankAccount->last4);
305
  $this->assertEquals('checking', $transaction->usBankAccount->accountType);
 
306
  $this->assertEquals('Dan Schulman', $transaction->usBankAccount->accountHolderName);
307
  }
308
 
326
  $this->assertEquals('123456789', $transaction->usBankAccount->routingNumber);
327
  $this->assertEquals('1234', $transaction->usBankAccount->last4);
328
  $this->assertEquals('checking', $transaction->usBankAccount->accountType);
 
329
  $this->assertEquals('Dan Schulman', $transaction->usBankAccount->accountHolderName);
330
  }
331
 
lib/Gene/Braintree/composer/ClassLoader.php CHANGED
@@ -53,8 +53,8 @@ class ClassLoader
53
 
54
  private $useIncludePath = false;
55
  private $classMap = array();
56
-
57
  private $classMapAuthoritative = false;
 
58
 
59
  public function getPrefixes()
60
  {
@@ -322,20 +322,20 @@ class ClassLoader
322
  if (isset($this->classMap[$class])) {
323
  return $this->classMap[$class];
324
  }
325
- if ($this->classMapAuthoritative) {
326
  return false;
327
  }
328
 
329
  $file = $this->findFileWithExtension($class, '.php');
330
 
331
  // Search for Hack files if we are running on HHVM
332
- if ($file === null && defined('HHVM_VERSION')) {
333
  $file = $this->findFileWithExtension($class, '.hh');
334
  }
335
 
336
- if ($file === null) {
337
  // Remember that this class does not exist.
338
- return $this->classMap[$class] = false;
339
  }
340
 
341
  return $file;
@@ -399,6 +399,8 @@ class ClassLoader
399
  if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
400
  return $file;
401
  }
 
 
402
  }
403
  }
404
 
53
 
54
  private $useIncludePath = false;
55
  private $classMap = array();
 
56
  private $classMapAuthoritative = false;
57
+ private $missingClasses = array();
58
 
59
  public function getPrefixes()
60
  {
322
  if (isset($this->classMap[$class])) {
323
  return $this->classMap[$class];
324
  }
325
+ if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
326
  return false;
327
  }
328
 
329
  $file = $this->findFileWithExtension($class, '.php');
330
 
331
  // Search for Hack files if we are running on HHVM
332
+ if (false === $file && defined('HHVM_VERSION')) {
333
  $file = $this->findFileWithExtension($class, '.hh');
334
  }
335
 
336
+ if (false === $file) {
337
  // Remember that this class does not exist.
338
+ $this->missingClasses[$class] = true;
339
  }
340
 
341
  return $file;
399
  if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
400
  return $file;
401
  }
402
+
403
+ return false;
404
  }
405
  }
406
 
lib/Gene/Braintree/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit1cd38e0f29a1c6b6e1f3050b1abed83f
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit1cd38e0f29a1c6b6e1f3050b1abed83f
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit1cd38e0f29a1c6b6e1f3050b1abed83f', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit1cd38e0f29a1c6b6e1f3050b1abed83f', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInit1cd38e0f29a1c6b6e1f3050b1abed83f::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit7455c3ad034c8ce201482929f9f6ebca
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit7455c3ad034c8ce201482929f9f6ebca', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit7455c3ad034c8ce201482929f9f6ebca', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInit7455c3ad034c8ce201482929f9f6ebca::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
lib/Gene/Braintree/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit1cd38e0f29a1c6b6e1f3050b1abed83f
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'B' =>
@@ -33,9 +33,9 @@ class ComposerStaticInit1cd38e0f29a1c6b6e1f3050b1abed83f
33
  public static function getInitializer(ClassLoader $loader)
34
  {
35
  return \Closure::bind(function () use ($loader) {
36
- $loader->prefixLengthsPsr4 = ComposerStaticInit1cd38e0f29a1c6b6e1f3050b1abed83f::$prefixLengthsPsr4;
37
- $loader->prefixDirsPsr4 = ComposerStaticInit1cd38e0f29a1c6b6e1f3050b1abed83f::$prefixDirsPsr4;
38
- $loader->prefixesPsr0 = ComposerStaticInit1cd38e0f29a1c6b6e1f3050b1abed83f::$prefixesPsr0;
39
 
40
  }, null, ClassLoader::class);
41
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit7455c3ad034c8ce201482929f9f6ebca
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'B' =>
33
  public static function getInitializer(ClassLoader $loader)
34
  {
35
  return \Closure::bind(function () use ($loader) {
36
+ $loader->prefixLengthsPsr4 = ComposerStaticInit7455c3ad034c8ce201482929f9f6ebca::$prefixLengthsPsr4;
37
+ $loader->prefixDirsPsr4 = ComposerStaticInit7455c3ad034c8ce201482929f9f6ebca::$prefixDirsPsr4;
38
+ $loader->prefixesPsr0 = ComposerStaticInit7455c3ad034c8ce201482929f9f6ebca::$prefixesPsr0;
39
 
40
  }, null, ClassLoader::class);
41
  }
lib/Gene/Braintree/composer/installed.json CHANGED
@@ -1,17 +1,17 @@
1
  [
2
  {
3
  "name": "braintree/braintree_php",
4
- "version": "3.17.0",
5
- "version_normalized": "3.17.0.0",
6
  "source": {
7
  "type": "git",
8
  "url": "https://github.com/braintree/braintree_php.git",
9
- "reference": "a51a36eade9988928aa49e36e23a5abb68a32251"
10
  },
11
  "dist": {
12
  "type": "zip",
13
- "url": "https://api.github.com/repos/braintree/braintree_php/zipball/a51a36eade9988928aa49e36e23a5abb68a32251",
14
- "reference": "a51a36eade9988928aa49e36e23a5abb68a32251",
15
  "shasum": ""
16
  },
17
  "require": {
@@ -25,7 +25,7 @@
25
  "require-dev": {
26
  "phpunit/phpunit": "3.7.*"
27
  },
28
- "time": "2016-10-13 19:16:51",
29
  "type": "library",
30
  "installation-source": "dist",
31
  "autoload": {
1
  [
2
  {
3
  "name": "braintree/braintree_php",
4
+ "version": "3.21.1",
5
+ "version_normalized": "3.21.1.0",
6
  "source": {
7
  "type": "git",
8
  "url": "https://github.com/braintree/braintree_php.git",
9
+ "reference": "fcfabf9170925cdac0ff97b72dc9e7ab44c88263"
10
  },
11
  "dist": {
12
  "type": "zip",
13
+ "url": "https://api.github.com/repos/braintree/braintree_php/zipball/fcfabf9170925cdac0ff97b72dc9e7ab44c88263",
14
+ "reference": "fcfabf9170925cdac0ff97b72dc9e7ab44c88263",
15
  "shasum": ""
16
  },
17
  "require": {
25
  "require-dev": {
26
  "phpunit/phpunit": "3.7.*"
27
  },
28
+ "time": "2017-01-17 19:40:39",
29
  "type": "library",
30
  "installation-source": "dist",
31
  "autoload": {
lib/Gene/composer.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "require" : {
3
- "braintree/braintree_php" : "3.17.0"
4
  },
5
  "config": {
6
  "vendor-dir": "Braintree"
1
  {
2
  "require" : {
3
+ "braintree/braintree_php" : "3.21.1"
4
  },
5
  "config": {
6
  "vendor-dir": "Braintree"
lib/Gene/composer.lock CHANGED
@@ -4,21 +4,21 @@
4
  "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
5
  "This file is @generated automatically"
6
  ],
7
- "hash": "f39b9e8fb5b344fdce96725859f949c2",
8
- "content-hash": "7c2609ef270ab7ee4cd0428128c29f7b",
9
  "packages": [
10
  {
11
  "name": "braintree/braintree_php",
12
- "version": "3.17.0",
13
  "source": {
14
  "type": "git",
15
  "url": "https://github.com/braintree/braintree_php.git",
16
- "reference": "a51a36eade9988928aa49e36e23a5abb68a32251"
17
  },
18
  "dist": {
19
  "type": "zip",
20
- "url": "https://api.github.com/repos/braintree/braintree_php/zipball/a51a36eade9988928aa49e36e23a5abb68a32251",
21
- "reference": "a51a36eade9988928aa49e36e23a5abb68a32251",
22
  "shasum": ""
23
  },
24
  "require": {
@@ -52,7 +52,7 @@
52
  }
53
  ],
54
  "description": "Braintree PHP Client Library",
55
- "time": "2016-10-13 19:16:51"
56
  }
57
  ],
58
  "packages-dev": [],
4
  "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
5
  "This file is @generated automatically"
6
  ],
7
+ "hash": "4e1b9ba54380bd961271bc0a7e42477c",
8
+ "content-hash": "e674f875f4c7073cbe328db2587ba92d",
9
  "packages": [
10
  {
11
  "name": "braintree/braintree_php",
12
+ "version": "3.21.1",
13
  "source": {
14
  "type": "git",
15
  "url": "https://github.com/braintree/braintree_php.git",
16
+ "reference": "fcfabf9170925cdac0ff97b72dc9e7ab44c88263"
17
  },
18
  "dist": {
19
  "type": "zip",
20
+ "url": "https://api.github.com/repos/braintree/braintree_php/zipball/fcfabf9170925cdac0ff97b72dc9e7ab44c88263",
21
+ "reference": "fcfabf9170925cdac0ff97b72dc9e7ab44c88263",
22
  "shasum": ""
23
  },
24
  "require": {
52
  }
53
  ],
54
  "description": "Braintree PHP Client Library",
55
+ "time": "2017-01-17 19:40:39"
56
  }
57
  ],
58
  "packages-dev": [],
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Gene_Braintree</name>
4
- <version>2.1.7</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/mit-license.php">MIT License</license>
7
  <channel>community</channel>
@@ -35,10 +35,10 @@
35
  &lt;li&gt;Settlement reporting&lt;/li&gt;&#xD;
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>support@gene.co.uk</email></author></authors>
39
- <date>2016-11-16</date>
40
- <time>10:06:36</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="9a7b4dac33799961712b98094e4fd6ff"/><file name="Currency.php" hash="5855bb4e1eff5c095b07666baaa9e0e0"/><dir name="Kount"><file name="Ens.php" hash="56ef3f1e4da9d09b6bc8d0814a882358"/></dir><file name="Migration.php" hash="e967c3a0e07d510c6aac12c88a27a098"/><file name="Moduleversion.php" hash="b74179be6853486ad2801c29c0ea830d"/><file name="Version.php" hash="9b12af242a8e96018554b35cd3a51a4d"/></dir><file name="Migration.php" hash="e3c31756ea93ed40322583b5afb10cc1"/></dir></dir></dir><file name="Assets.php" hash="46f74f685b6077a63b483368a6291217"/><dir name="Cart"><file name="Totals.php" hash="55d1ce06bc84c9229f4f245e5aee8edd"/></dir><dir name="Creditcard"><file name="Info.php" hash="1d069fc769a1478532634978ce550aa6"/><file name="Saved.php" hash="2d0a3c3543d8eecc7c94a50cea7810d9"/><file name="Threedsecure.php" hash="7848d4ecac743be985f328fa969318bf"/></dir><file name="Creditcard.php" hash="2fae0e3085a4c479e9a7dedde9fa95da"/><dir name="Express"><file name="Abstract.php" hash="c3ff5b1586e939154fe3ba305f3d22cd"/><file name="Button.php" hash="476caeaca95f24e07be4737c932a6301"/><file name="Checkout.php" hash="dd0a143b74c5b3c8fab8463e6b6e4ee1"/><file name="Setup.php" hash="694c8c7c44a7670070f379af373d711f"/></dir><file name="Info.php" hash="8891038708e60a3e1974e007c2a32de1"/><file name="Js.php" hash="ba30f0430bde2c45a6ed7fe5a35be676"/><dir name="Paypal"><file name="Info.php" hash="be437bd72ca057fc641ce8ce79f475cc"/><file name="Saved.php" hash="6a99ef8a384d7ab8f4537e995867ec85"/></dir><file name="Paypal.php" hash="c861ed7a3206fef5324eaab752b7e9b6"/><dir name="Saved"><file name="Edit.php" hash="ae2d80ecab7cdda39b18054b057f2dc5"/></dir><file name="Saved.php" hash="782f17589219da087e57035a1c0b9a4a"/></dir><dir name="Helper"><file name="Data.php" hash="257e98f11463d1d3a2f0c9d73e801b05"/></dir><dir name="Model"><file name="Debug.php" hash="f3360f71e2346881f93424792ed9f209"/><dir name="Entity"><file name="Setup.php" hash="c580e73ec53ac455698ee6b0ff005e39"/></dir><dir name="Express"><file name="Assets.php" hash="9618a73154cb1083f8511fc7dc9c2d81"/></dir><dir name="Kount"><file name="Ens.php" hash="3f672b000d43363406b1df7e2b52f620"/><file name="Rest.php" hash="5dfb5265a431da0210cb87dba023b7b6"/></dir><file name="Migration.php" hash="595f2f2d03b78ab057436609c8a73261"/><file name="Observer.php" hash="3d8c428e753d9335b2c9e748273924e9"/><dir name="Paymentmethod"><file name="Abstract.php" hash="d6c2a980770c401b5f311329198e2050"/><file name="Creditcard.php" hash="4dba0a50b5df53efcafd1eed3289f1ff"/><dir name="Legacy"><file name="Creditcard.php" hash="d31335cd41e72c54eccbe608e7257e02"/><file name="Paypal.php" hash="f929b4917e09007b226e6387bf4e1a22"/></dir><file name="Paypal.php" hash="b62caf908bd3845405ff62c1b96f960f"/></dir><file name="Saved.php" hash="3c9318122fbe56bdb915c837d834f392"/><dir name="Source"><file name="Cctype.php" hash="d76aa6c3a4bd798e3a47695f579d21d4"/><dir name="Creditcard"><file name="CaptureAction.php" hash="d39ff81be4b54620410ceeda7f960f0f"/><file name="FormIntegration.php" hash="9788f349430e0d48c9e13c262da3fe06"/><file name="PaymentAction.php" hash="d6e997ae4f6ed57129bf4d5da06a0a82"/></dir><file name="Environment.php" hash="5c2f5ce4d6d9f6f178102b90ec15aa2c"/><dir name="Paypal"><file name="CaptureAction.php" hash="0dd0c6da578aee4b7508f78cab982176"/><file name="Locale.php" hash="adc0ab30619eb3a34d8f5fe1087b07b0"/><file name="PaymentAction.php" hash="ab430eaf7ced39e9d6fd80ad0a7f6b3c"/><file name="Paymenttype.php" hash="48225fa7b3f5e54d81711397dd5bd96b"/></dir></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Currency.php" hash="73cb15b1de303e88c487db4c585ef94e"/></dir><dir name="Source"><dir name="Payment"><file name="Liabilityaction.php" hash="62350b96b2f77b4e37d9530d3b9e030a"/><file name="Threedsecurecountries.php" hash="d6c636f1e83676acd385312142221037"/></dir></dir></dir></dir><dir name="Wrapper"><file name="Braintree.php" hash="0ed9bf0ed1331d824563ab6a868ec886"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Braintree"><file name="MigrationController.php" hash="84323fa4665ece605f6b8e906d0edd40"/></dir><file name="BraintreeController.php" hash="d7ece21342a7b4b37ee41ea0e7ff20ad"/></dir><file name="CheckoutController.php" hash="a38e423b0434f232f1cff247243f0509"/><file name="ExpressController.php" hash="a3f14acd6834cbaae440e3a67fa09290"/><dir name="Kount"><file name="EnsController.php" hash="1db795afa1df901c37bbe48a3f01db2f"/></dir><file name="SavedController.php" hash="083777b1536e8dda604107af9f0081a9"/></dir><dir name="etc"><file name="adminhtml.xml" hash="c9c940beffa0ec19e4a1499a66f7fd12"/><file name="config.xml" hash="f0f7c0a069363d0449be089990e57301"/><file name="jstranslator.xml" hash="48c491259929e52f281b6c57fd57cdb2"/><file name="system.xml" hash="ac50230b723d17f85caeb304a13aac6d"/></dir><dir name="sql"><dir name="gene_braintree_setup"><file name="install-0.1.0.php" hash="503f428384f687d3f55a19ea57450212"/><file name="upgrade-1.0.5.4-2.0.0.php" hash="62d37c35ba39a77ea14cad842f143393"/><file name="upgrade-2.0.0-2.0.1.php" hash="a08927707bb43a5c22b3b6ce3dd7a3c7"/><file name="upgrade-2.0.4-2.1.0.php" hash="e1b31c2459ea0aaebb679e456bab3ec1"/></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="e7bbfbb01591403dfa486606c4c515a8"/></dir></dir><dir name="template"><dir name="gene"><dir name="braintree"><file name="assets.phtml" hash="091137e3400224911cbaa157fa11cf65"/><dir name="creditcard"><file name="hostedfields.phtml" hash="d46038a8f81ff6f02d1651f030c8f56c"/><file name="info.phtml" hash="2ae1e397b3a633dd305bc26c7b9c1065"/><file name="saved.phtml" hash="579ec8ca726de3b5bea8600663d1e61f"/><file name="threedsecure.phtml" hash="ee8ad689afde041c39dd92ffa5274883"/></dir><dir name="customer"><file name="edit.phtml" hash="ed8a9533f07fbfa36ec78623afd1a04d"/><file name="methods.phtml" hash="794ad8cb20314d1657a746b365c82540"/><file name="saved.phtml" hash="0457b0fa38f9db788133e54f359baa63"/></dir><dir name="express"><file name="button.phtml" hash="ef1c839a8f1a190610fcfce46bd78efd"/><file name="cart.phtml" hash="e695ba86a3e1c157d131193834a4d34d"/><file name="catalog.phtml" hash="8dea3debbcd26d3359b5618ffd37f71f"/><file name="error.phtml" hash="0ec2ea2f9b909d9f0543e5df83eea055"/><file name="shipping_details.phtml" hash="0bb6ceafaac0ba522278df310d6136e2"/></dir><dir name="js"><file name="aheadworks.phtml" hash="e03a075e174246c88ffb7f53c5be6e7b"/><file name="amasty.phtml" hash="f5cdae19e5a5f5a1cbc836406611dd80"/><file name="awesomecheckout.phtml" hash="92e14252435c4c314d28d5278544ca0e"/><file name="default.phtml" hash="02f8fb813c635972b2a88ea858ffbe4f"/><file name="fancycheckout.phtml" hash="f603bcd50dea98dbb45c1ec8b692314c"/><file name="firecheckout.phtml" hash="6ee998383f1c88132e3dea9e8aeaf3e1"/><file name="fme.phtml" hash="111a6f7c7f39aa5adc59694978779731"/><file name="idev.phtml" hash="22e15682c66a3a744c7ed08bfe761e54"/><file name="iwd.phtml" hash="05aefd0a2af552a494f1796082f4af96"/><file name="magestore.phtml" hash="3b5454efb603731334ac17a6760e774a"/><file name="multishipping.phtml" hash="c9e11fbc30e52e6354c8d7a5d9dff0ac"/><file name="oye.phtml" hash="939d2a614a14f98b6bf425c7fbcc762b"/><file name="setup.phtml" hash="5f997e0274a8b104be6d38a5be88899d"/><file name="unicode.phtml" hash="18ee47529b28c6eaa40597eded2e6a37"/></dir><dir name="paypal"><file name="info.phtml" hash="5149b273730121e4dec3c3179820f747"/><file name="saved.phtml" hash="3dd56f96bcdd14be594d355ae8fff329"/></dir><file name="paypal.phtml" hash="d12c20e5fb76f31270a5d47061e42715"/></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="9a73d141d32d69198e2cc945f2358ff2"/></dir></dir><dir name="template"><dir name="gene"><dir name="braintree"><file name="assets.phtml" hash="091137e3400224911cbaa157fa11cf65"/><dir name="creditcard"><file name="hostedfields.phtml" hash="bae55f7d398540acdf2a892d01a6791f"/><file name="info.phtml" hash="958d514582e3de1f91f5e0f7a7169b47"/><file name="saved.phtml" hash="ca27adb601aebf97cd25a892082a8663"/></dir><file name="js.phtml" hash="848bb7c614bee8cdd8c344dca3705e39"/><dir name="paypal"><file name="info.phtml" hash="0485ea82dc9cc8ebea092b378672f1cd"/><file name="saved.phtml" hash="779ca8e907d7d463eafce58dfaf94f0c"/></dir><file name="paypal.phtml" hash="f81578f64c8a30560299bd993d8e996d"/><dir name="system"><dir name="config"><file name="migration.phtml" hash="8ef2a5e5561d7909d065c987ded5e592"/></dir></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"><dir name="2.1.7"><dir name="express"><file name="abstract-min.js" hash="8b9af774fc6a9f0610f4f80ac218f1ef"/><file name="paypal-min.js" hash="e3b9915b23745df357a0ecb4bf44f21c"/></dir><file name="vzero-integration-min.js" hash="91899cabe64b45a49f0de5f26e89de53"/><file name="vzero-min.js" hash="91b0b87333d33c546b04b43e7a2f7c90"/><file name="vzero-paypal-min.js" hash="33cda474d266cb596c4b85f057d47134"/></dir><file name="config.codekit" hash="d04d8f36eefe3cef4143f02398f1eeb4"/><dir name="express"><file name="abstract-min.js" hash="8b9af774fc6a9f0610f4f80ac218f1ef"/></dir><dir name="source"><dir name="express"><file name="abstract.js" hash="f057fd97081c785c43751cd1b07c4d42"/><file name="paypal.js" hash="38b2ff510eaea8a3d82e15628f2ee768"/></dir><file name="vzero-integration.js" hash="655e21a89168874aeadf13181de51e21"/><file name="vzero-paypal.js" hash="d670587d88f396ba8111d5386905bc39"/><file name="vzero.js" hash="894b0eb7d438383524ab4cb38ad9bfc1"/></dir></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="paypal-loading.gif" hash="078a2daf55245b227c09a7bed86750c6"/><file name="paypal.png" hash="40d5f74305e565bd14aef19bcf696541"/></dir><file name="loader.gif" hash="f48ee069890b16455c3ddcacee9b5f75"/><file name="loader-white.gif" hash="1fc0e911558e8dfe77cfdfafa0d38f88"/></dir></dir><dir name="css"><dir name="gene"><dir name="braintree"><dir name="account"><file name="account.less" hash="ddf6bf208f290316300ab20682f34473"/></dir><file name="account.css" hash="73bb46f85320b2f2b4de9beb6c0e0bd6"/><file name="aheadworks.css" hash="dad2e3821b6453c45bedd9505b603beb"/><file name="amasty.css" hash="668d36c51696f2070c38c7d04e8639b4"/><file name="awesomecheckout.css" hash="91a3d2833ef956df6c502b67e9986f23"/><file name="config.codekit" hash="506bfad608130ba1ce130508695d54d9"/><dir name="core"><file name="_general.less" hash="5848708373d8ed5eda5e5b23c3e4e05c"/><file name="_hostedfields.less" hash="d613b23ee1731345334aa423bf14c6db"/><file name="_paypal.less" hash="df0239894dfef5c905bea44938ee4658"/><file name="_saved.less" hash="66ec8d894e336f9934a1e54972c4b220"/></dir><file name="default.css" hash="8e0c5ce4cfc8592b580c8d9c27ac0f86"/><file name="express.css" hash="1c9eb3b9abb7e798b65701b2815d2e07"/><file name="express.less" hash="29acfc18e38f300972f27cfd44ca41c2"/><file name="fancycheckout.css" hash="523b1606fcd5a893bc5a06de83085137"/><file name="firecheckout.css" hash="c338590a06f2ff2b4bc3861cefb76559"/><file name="fme.css" hash="b9b5d0153c42b6f3335f1edd007acc56"/><file name="idev.css" hash="2f7011c36839ddda6dafa97a3253c0e7"/><dir name="integrations"><file name="aheadworks.less" hash="09b0304383e198885f030119c15641f7"/><file name="amasty.less" hash="4cdf236e1d44112205750cefa11448b4"/><file name="awesomecheckout.less" hash="e774da637a5c6bbdb2e5decc998afae1"/><file name="default.less" hash="d366d4560ed1ce3e9e120309e56bec2f"/><file name="fancycheckout.less" hash="18281c460bb32da164964abe585b092b"/><file name="firecheckout.less" hash="459704b8b6efca52fcee7c335b3ad625"/><file name="fme.less" hash="580ed66608560fcd1195246c22e3559c"/><file name="idev.less" hash="47485cc963e16d12e673c06cd9efe4b1"/><file name="iwd.less" hash="5081477c7946e0f5cf8cc4198895ca11"/><file name="magestore.less" hash="0af5cd105be3995dc2044d33f990bbb5"/><file name="oye.less" hash="06a0f79190b16dfbce3aec6d14f07461"/><file name="unicode.less" hash="1416abe9a38965d9aead022b238f7d4f"/></dir><file name="iwd.css" hash="4dea034fd87559f406a21760f0205101"/><file name="magestore.css" hash="752dfb740303b5e1e2f1d2ab0aa5bdb4"/><file name="oye.css" hash="741399c67a2a822af7f17e428c6cba82"/><file name="unicode.css" hash="d048a04807172d1fe974a9e938a98fb6"/><file name=".DS_Store" hash="1405352d803d5c88cf3ec19a82f173d0"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="css"><dir name="gene"><dir name="braintree"><file name="adminhtml.css" hash="affb40183f3620e4ee157daf613dc2a9"/><file name="adminhtml.less" hash="b3a4d504055c85d872c5b9544d192840"/><file name="config.codekit" hash="00c3aa866faad2384b4042057d6eaeec"/><file name="migration.css" hash="158e143a99028313d6ad6f6612112dd4"/><file name="migration.less" hash="bbf09530cf530f78f4a7c3229194c5ff"/><file name=".DS_Store" hash="63617e9dd9988a3d3773937a3f7e2f9a"/></dir></dir></dir><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"/><dir name="migration"><file name="braintree.png" hash="396d721824a86b169ce0055090ce9766"/><file name="gene-logo.png" hash="16efb1b148acc59c46c84a21d726b6e9"/><file name="loader.gif" hash="66b9100930b8e58d46acf2e13d41f7ea"/></dir></dir><file name="loader.gif" hash="f48ee069890b16455c3ddcacee9b5f75"/></dir></dir></dir></dir></dir></target><target name="magelib"><dir name="Gene"><dir name="Braintree"><file name="autoload.php" hash="e991881d055b037b316776d6332e7f72"/><dir name="braintree"><dir name="braintree_php"><file name="CHANGELOG.md" hash="06dc0857eec40e158267c271b2042845"/><file name="LICENSE" hash="5ba90c75203e338c9479ed8237839feb"/><file name="README.md" hash="e5c49652ce9f9857af6a1c3f02841bfa"/><file name="Rakefile" hash="3ca648a6b2c78b0546bf36323998036e"/><file name="ci.sh" hash="8abad344d97531d13613833d1d081954"/><file name="composer.json" hash="7f925434c3334ed83d7f73f15d937985"/><dir name="lib"><dir name="Braintree"><file name="AccountUpdaterDailyReport.php" hash="e1bb254f0dc2482190b2a3cf57ca8ecc"/><file name="AddOn.php" hash="82925560fd6d09575150d03851132999"/><file name="AddOnGateway.php" hash="71f1cf435ad4a0f846cbdb61f54582b6"/><file name="Address.php" hash="38b64d0235e498f761d871446670c9d3"/><file name="AddressGateway.php" hash="1b8889c596f9a10ec351f2cc2a59fabe"/><file name="AmexExpressCheckoutCard.php" hash="a4b48e18f08686aa5aaeec4849ff54a6"/><file name="AndroidPayCard.php" hash="5b9412761d364c39313925a0b1aa5308"/><file name="ApplePayCard.php" hash="4879b7885a3a3f549a3cc661b1f3a145"/><file name="Base.php" hash="33edbe8c326501ef64e6701e25ce8eb4"/><file name="ClientToken.php" hash="81e2f643f912c8943560008d2fa7869d"/><file name="ClientTokenGateway.php" hash="46c9885e3c3f40cc60d98dd94ccfa849"/><file name="CoinbaseAccount.php" hash="00d363870a777a39b89924092b8aba7f"/><file name="Collection.php" hash="18bed88fe994bab06d91c4f11f9e5e62"/><file name="Configuration.php" hash="9af3f355124c7bcfcb1022553d2680dc"/><file name="CredentialsParser.php" hash="76aea512fec3932cf3311ba96e855728"/><file name="CreditCard.php" hash="7510387703f315770542ae280ed908b9"/><file name="CreditCardGateway.php" hash="3afc61390565f93f227797c180623340"/><file name="CreditCardVerification.php" hash="b06ad08b7120572732498d2035a25952"/><file name="CreditCardVerificationGateway.php" hash="38a299c6e9a500fbf7e962e39f34e4bf"/><file name="CreditCardVerificationSearch.php" hash="93e08c9a258af84003700013d497cd82"/><file name="Customer.php" hash="b0d3236dcb0f4a421431e8d7b64bdfad"/><file name="CustomerGateway.php" hash="632a4aa892bbc99d84987ee4e235d577"/><file name="CustomerSearch.php" hash="8e8d024b951a4baa458556d4281fe988"/><file name="Descriptor.php" hash="97dc19a001fb6845c0c0eb0ee396f9bf"/><file name="Digest.php" hash="3105cc8f66a176f636b8f5a1075638a0"/><file name="Disbursement.php" hash="851eb18f89594984838ce1c59f8e6d8c"/><file name="DisbursementDetails.php" hash="ebe67e4dfb543f2b81f2f6de6de4bdfa"/><file name="Discount.php" hash="ba59054dd8d42d600c6dfb5813267150"/><file name="DiscountGateway.php" hash="8c354a122a23e3ad2136905e1c9b1d95"/><dir name="Dispute"><file name="TransactionDetails.php" hash="b56e01778ab14aaef2a5a9f8bc85d695"/></dir><file name="Dispute.php" hash="b374f0814c6c237cba252093ad37ee82"/><file name="EqualityNode.php" hash="62715d694920f751dfa270ee6234eb43"/><dir name="Error"><file name="Codes.php" hash="17409bb5360708c3a011ccb474b92ded"/><file name="ErrorCollection.php" hash="5bfc2fecced63c0acca329760619ff38"/><file name="Validation.php" hash="177a09214e3832293dd74a6cde911c48"/><file name="ValidationErrorCollection.php" hash="a7d24a31592d1e664245bbc7d0bca60a"/></dir><file name="EuropeBankAccount.php" hash="1652f5c0400e3704de4077a5b9e6e714"/><dir name="Exception"><file name="Authentication.php" hash="5db82263dddde988ddb228c840156bb9"/><file name="Authorization.php" hash="d76c984a4699f10844f58d2f8bcec5d6"/><file name="Configuration.php" hash="225dfca2a3fcb48620e971a03acc6213"/><file name="DownForMaintenance.php" hash="60ec727ae01bef4a7a9242d55be70d67"/><file name="ForgedQueryString.php" hash="b0a150c17296046e3777879256f5fcea"/><file name="InvalidChallenge.php" hash="d825f5fc7acf8dd0e92dc886e7351721"/><file name="InvalidSignature.php" hash="a627af00c19b01a92fe01d432e3296d9"/><file name="NotFound.php" hash="9f28a7c11a5388c85de2f050f5a2a68d"/><file name="SSLCaFileNotFound.php" hash="c4b9474a14791ca4bd40f94e55428ecb"/><file name="SSLCertificate.php" hash="96dcb90043e9ce3668ef68568b932d77"/><file name="ServerError.php" hash="a095932cac27c6ebf707b217efb3d2b1"/><file name="TestOperationPerformedInProduction.php" hash="156421e2ccb2ac69c051516b1d6a6707"/><file name="Timeout.php" hash="834026b48d9a2317bf9e487174158be4"/><file name="TooManyRequests.php" hash="0e6d904113c3d8a3a60136e1ea5db00f"/><file name="Unexpected.php" hash="f09fd761eb5909327d02f1fa2a2dd894"/><file name="UpgradeRequired.php" hash="6cd48333f93a0a96ddd58654e5f27f85"/><file name="ValidationsFailed.php" hash="b7b129ec4b3d72d27947e8b11b6ebca2"/></dir><file name="Exception.php" hash="29a1f3a94ed378d93879d5d64858fbaf"/><file name="FacilitatorDetails.php" hash="7a25557b06c663197d1aea39bd93e776"/><file name="Gateway.php" hash="116919442d2d4699d05ab272a3711485"/><file name="Http.php" hash="3440f599ee47ba57a6f08958763af14e"/><file name="Instance.php" hash="64573829ba050b6d291d082b50382e46"/><file name="IsNode.php" hash="783c6ad65c6030a12ad52253cd5bc1a8"/><file name="KeyValueNode.php" hash="6668a312a6aaaddbdcfc940775ed5820"/><file name="Merchant.php" hash="b1f8444fc109708a43017d6cda9536a2"/><dir name="MerchantAccount"><file name="AddressDetails.php" hash="540f9e79b8df5da5267835dd01db45c1"/><file name="BusinessDetails.php" hash="ca8a0dc16bce3fff5831fd22652b2f6b"/><file name="FundingDetails.php" hash="9ba992a0dda1be9a0cf8bd8b53ea33be"/><file name="IndividualDetails.php" hash="4855a6aa64b35ecab7bada4e3e0fc0c3"/></dir><file name="MerchantAccount.php" hash="a4ba2e530164c06b8e50ef8ff10f76f2"/><file name="MerchantAccountGateway.php" hash="c966aa6a8a5700e60993dec8833f36de"/><file name="MerchantGateway.php" hash="e9d0fc529b7a32f7080201991deb29d1"/><file name="Modification.php" hash="5df7d89d7365e9edf7235f09b9b7ced4"/><file name="MultipleValueNode.php" hash="2555632262d8b7d81a69739817e1887d"/><file name="MultipleValueOrTextNode.php" hash="9d4a49bc8051d47fd820da2ffef03936"/><file name="OAuthCredentials.php" hash="4a6991039aff0d1c9917c02f9548b4a3"/><file name="OAuthGateway.php" hash="b7c38d9a61fa4cfc749efcdb5dfcf7c9"/><file name="OAuthResult.php" hash="ea859d4da557c860e8f36793f66455e4"/><file name="PartialMatchNode.php" hash="084258b5f9f39a493ca6b02e7019a101"/><file name="PartnerMerchant.php" hash="0659cebbbba2d128c263f6785ece7cbf"/><file name="PayPalAccount.php" hash="7a1654759201f54bb1a58d08362ddc28"/><file name="PayPalAccountGateway.php" hash="865826f46ce0af80404dea0c51632bd5"/><file name="PaymentInstrumentType.php" hash="ce15f765f0cec73a04c9debda3052d6d"/><file name="PaymentMethod.php" hash="e94336d5fdde2d03747551b09fc5831f"/><file name="PaymentMethodGateway.php" hash="4830027d7105f881700fc4bc52dbe43f"/><file name="PaymentMethodNonce.php" hash="6ab72220362afa9ec1e9e1fe1da049b6"/><file name="PaymentMethodNonceGateway.php" hash="393c1736d0290d0b0e8d9732692c475c"/><file name="Plan.php" hash="fcf369071d74d273604fc63ea2548f2b"/><file name="PlanGateway.php" hash="8713f672e916f26460b06a156b511e32"/><file name="RangeNode.php" hash="a3f74af2c4811a68c9f31ca136cc1c82"/><file name="ResourceCollection.php" hash="d52323710fbe909cc96e0b09509c57d5"/><dir name="Result"><file name="CreditCardVerification.php" hash="80274f1df14aff2fc83153f899084146"/><file name="Error.php" hash="1a43f4387b95e960023899356dfa971e"/><file name="Successful.php" hash="a07de8d191e4c425ea139e585b662245"/></dir><file name="RiskData.php" hash="61de70d88d4b40168e54cea84d2afc70"/><file name="SettlementBatchSummary.php" hash="73a3b6b583b5a852b3d1437b2d62ec5f"/><file name="SettlementBatchSummaryGateway.php" hash="d66b1708f32d1bcc4d738bf39df649b7"/><file name="SignatureService.php" hash="566a5d18567a513f4a527ebf3c8cd410"/><dir name="Subscription"><file name="StatusDetails.php" hash="cfec6a5f756091d72642b2505c2cc523"/></dir><file name="Subscription.php" hash="12477b5b2174c2af515a241b1ca0c494"/><file name="SubscriptionGateway.php" hash="43d59eb14e8426de39b86af042d48e11"/><file name="SubscriptionSearch.php" hash="e97a9a2a7187058082afab7701f37b1a"/><dir name="Test"><file name="CreditCardNumbers.php" hash="7265dd0e237fdc2ed6549218852734ee"/><file name="MerchantAccount.php" hash="072dd9f4c532d59b4d29cf1573046969"/><file name="Nonces.php" hash="ed136a194d09fd372b904b67c22ce14d"/><file name="Transaction.php" hash="37136a4a49213b808e05e6072ea47745"/><file name="TransactionAmounts.php" hash="d3ee44240274fcc671cb40f24c7f6887"/><file name="VenmoSdk.php" hash="33de614daaf4dad09f1165d74d08cdb0"/></dir><file name="TestingGateway.php" hash="3ec7fe4a5a11f2db91b5ecaa6ab6d1c1"/><file name="TextNode.php" hash="da1cc61af2896b945552318d67bd2a46"/><file name="ThreeDSecureInfo.php" hash="8cbb2a63c256368123cb01f2e2a2a194"/><dir name="Transaction"><file name="AddressDetails.php" hash="080b64d3fcf6f61759b227e570de6faf"/><file name="AmexExpressCheckoutCardDetails.php" hash="c4cde5f34ebe934e7a712cb1a75c1170"/><file name="AndroidPayCardDetails.php" hash="708a09910991517ad4507d0f1a82f8c7"/><file name="ApplePayCardDetails.php" hash="26093a57a1f0525210f3295a5a6b834c"/><file name="CoinbaseDetails.php" hash="ebd00610e9cfe1b67e6f3ff518f142c8"/><file name="CreditCardDetails.php" hash="81f0a10e1b56af0b06d2fa858ee56287"/><file name="CustomerDetails.php" hash="76e163794fd2e32d70ece5a780a80ef6"/><file name="EuropeBankAccountDetails.php" hash="440f492270d7f50d2eeb7f3c93e48ffe"/><file name="PayPalDetails.php" hash="4e38ea53a13980378d44b8f512f92411"/><file name="StatusDetails.php" hash="2914ad7f3b8a8244694f95949660b99e"/><file name="SubscriptionDetails.php" hash="009ba167870d9d3558d9186401c970e6"/><file name="UsBankAccountDetails.php" hash="ac74d6fdcfa4b9253c6efe7c4d57f2db"/><file name="VenmoAccountDetails.php" hash="097e98658fe058a4e82c50129dd6a72f"/></dir><file name="Transaction.php" hash="a98cf6120ea3ac199db9b7547eeece28"/><file name="TransactionGateway.php" hash="f06999aa9248851f2c5f4061fc48fe45"/><file name="TransactionSearch.php" hash="634b7a51905a41c1f037f186b53b540e"/><file name="TransparentRedirect.php" hash="63a525df15682ecf4511cdaf3154c954"/><file name="TransparentRedirectGateway.php" hash="9a56b5d98c562316e346bcedf0f04bfd"/><file name="UnknownPaymentMethod.php" hash="f3731d70766ae5ecab1017fa33d06b7f"/><file name="UsBankAccount.php" hash="eed3e14a2b88f10cbc33734b5347e00e"/><file name="UsBankAccountGateway.php" hash="4d0082aac6cfe4b04e9bf1adf976c02b"/><file name="Util.php" hash="bd31461e0b7a67d5686d325fe32c5350"/><file name="VenmoAccount.php" hash="fa0f15888eda08545321eb20178fe4ac"/><file name="Version.php" hash="aada06398ac1c7993d4b10f7bd6f75bd"/><file name="WebhookNotification.php" hash="bbe5859def86dbde4298e09470cccacc"/><file name="WebhookTesting.php" hash="4fa3fb7c1c4591a30cb073cbd4c2ec5a"/><dir name="Xml"><file name="Generator.php" hash="b7b28436de76fc7b5ca13e556963d28e"/><file name="Parser.php" hash="29fbccf32c05e9dcf07bb3a40ea119c9"/></dir><file name="Xml.php" hash="e60971869ae63c3f258eac082ff9a3bf"/></dir><file name="Braintree.php" hash="e6dbb615b697b7641d9b81b8811a9d52"/><file name="autoload.php" hash="700bd7dbe39f8d89d925ccbb33651898"/><dir name="ssl"><file name="api_braintreegateway_com.ca.crt" hash="d1155107b085a1ee04dd13a634b00c42"/></dir></dir><file name="phpunit.xml.dist" hash="80635d87e10eb5bf1a4ba767d168eba8"/><dir name="tests"><dir name="Braintree"><file name="CreditCardDefaults.php" hash="caceb16d3b2fc21f7dc2bf6244000485"/><dir name="CreditCardNumbers"><file name="CardTypeIndicators.php" hash="fca486e18deed295d0d9961b19e71c6e"/></dir><file name="OAuthTestHelper.php" hash="7678b026a2d19450150999999a0cddcc"/></dir><file name="Helper.php" hash="d16f5164eb17af1eec938f07a975f93f"/><file name="SanityTest.php" hash="e75fcbab2870381b960a0583fb9d3ce3"/><file name="Setup.php" hash="d21ea963b4103c6f082aff93a97d75b9"/><dir name="integration"><file name="AddOnsTest.php" hash="6caa89249c72d7746cb1de6ef1460079"/><file name="AddressTest.php" hash="b78f498609625e2d2f5eadf5c07dc303"/><file name="ClientTokenTest.php" hash="83d93f7812082bcbdf0099652b98b183"/><file name="CreditCardTest.php" hash="c2c5eb3bd53c701ce5a259da11b7743f"/><file name="CreditCardVerificationAdvancedSearchTest.php" hash="1b741a14706c14fe27b6383f37989ea8"/><file name="CreditCardVerificationTest.php" hash="7f29467a7f84a029fc4ccb36b52b5ced"/><file name="CustomerAdvancedSearchTest.php" hash="f1657f3ef6992d7ab2dfddb60e88f5ce"/><file name="CustomerTest.php" hash="9636390eeb312e02f0ddaeab79c1d1ff"/><file name="DisbursementTest.php" hash="26505b6c688c23f52617aff41d301020"/><file name="DiscountTest.php" hash="0fc13502d1323679af95ca7e0a5a2622"/><dir name="Error"><file name="ErrorCollectionTest.php" hash="f72638e7a4ce876ee83740f11986a3a8"/><file name="ValidationErrorCollectionTest.php" hash="3db5c126101fd5878d0862af5afb921a"/></dir><file name="EuropeBankAccountTest.php" hash="1fa1e38472ea992c558f20284d50fea3"/><file name="HttpClientApi.php" hash="6f76f301d78ae0b01e080e25c3c9d666"/><file name="HttpTest.php" hash="1a9d8ad93330b4032480c7db7bc1e385"/><file name="MerchantAccountTest.php" hash="023a6ec18b9ecc4996c1d7af5df217ba"/><file name="MerchantTest.php" hash="6be39a24c21307e95c8d18b2f3cbbf09"/><file name="MultipleValueNodeTest.php" hash="1b21f6431b0dc593f18d887ed88a30f3"/><file name="OAuthTest.php" hash="cf09acef408069c6131ede44f0004cd3"/><file name="PayPalAccountTest.php" hash="8bfdfdcb1e08687d25bf80260051d820"/><file name="PaymentMethodNonceTest.php" hash="7cc2cdb6c6e72fc1750ee09f134e22c9"/><file name="PaymentMethodTest.php" hash="e29e0b1ec325c15a7723d59761a344c3"/><file name="PlanTest.php" hash="bbc260c8a0cd36869f0de96c4639cb2a"/><dir name="Result"><file name="ErrorTest.php" hash="3ff0aedd05f5868c8e28bb7f2f98f8f8"/></dir><file name="SettlementBatchSummaryTest.php" hash="86e8847f6cdf4c6120b473e7bdafc196"/><file name="SubscriptionHelper.php" hash="0d717139be147a5d72f16cd4ff465d22"/><file name="SubscriptionSearchTest.php" hash="712536a2484872abf8b6b3003e67c0bd"/><file name="SubscriptionTest.php" hash="1e4ff49856af4942dc14c199764ee82c"/><file name="TestTransactionTest.php" hash="27cce6bf160d8777358332eb9d7a7eae"/><file name="TextNodeTest.php" hash="6f8afc0387144088127d65ce3e926cba"/><file name="TransactionAdvancedSearchTest.php" hash="430d532eec84d163a6b9e5d7170156f0"/><file name="TransactionTest.php" hash="ddc9cd18c3062019edfa82a4ede798b9"/><file name="TransparentRedirectTest.php" hash="632073911d63ec46fedc0007b8e1d96c"/><file name="UsBankAccountTest.php" hash="87a1b99e82b385fb1fcc9f0ac214057d"/></dir><dir name="unit"><file name="AddOnTest.php" hash="1e9ca24b1d1076d838868b46f3b8db31"/><file name="AddressTest.php" hash="971b65131de89d97627d5fce6d23948f"/><file name="BraintreeTest.php" hash="d5661eb2e0d23eec624cc039bc209baa"/><dir name="ClientApi"><file name="ClientTokenTest.php" hash="ecd06e8aa6238f1a2b4af69d0e8de798"/></dir><file name="ConfigurationTest.php" hash="e8a6feb7044965075a99fcb57eeac625"/><file name="CreditCardTest.php" hash="aff6920d4a64f82c25947a0aad622491"/><file name="CreditCardVerificationTest.php" hash="aadef2854162a79ec7f974a4511c74dc"/><file name="CustomerTest.php" hash="b34959a82a0a9ac2f917086135e30ec3"/><file name="DigestTest.php" hash="91a198a97d0469223d9cda1c032c82cf"/><file name="DisbursementDetailsTest.php" hash="5417ff00d8780050cd3468e891a46f7c"/><file name="DisbursementTest.php" hash="7df421883c72e00553827d5c0e7816d7"/><file name="DiscountTest.php" hash="cda7b5ba54e11c4b0ed852e146236d6d"/><file name="GatewayTest.php" hash="182a77395c8c791754f8f9fd70f1561a"/><file name="InstanceTest.php" hash="fc35293e35840a740e44da14929f13ce"/><file name="MerchantAccountTest.php" hash="2938575dc44d37d494519750e7699c0c"/><file name="MultipleValueNodeTest.php" hash="0821a1e0ea469210e4cd7ac2dcdd2f3a"/><file name="MultipleValueOrTextNodeTest.php" hash="cb82ba391dbd216a413da9777f50a4d7"/><file name="OAuthTest.php" hash="450ee30874c358112731fb39e0c7a898"/><file name="PayPalAccountTest.php" hash="5d5ed45062b3f4fddf38a95fda7fcec0"/><file name="PaymentMethodTest.php" hash="81db0a16f1c77a2bade9e008816c7691"/><file name="RangeNodeTest.php" hash="c1aef8c246c603736ed5a7000a150f4a"/><file name="ResourceCollectionTest.php" hash="5b22b79a4e50f486c2f3e9e268cf9d80"/><dir name="Result"><file name="ErrorTest.php" hash="bfa4fbcb181cd8a7fbc05c86f617899b"/><file name="SuccessfulTest.php" hash="a809212d472948c166915eb901f641d7"/></dir><file name="SanityTest.php" hash="80485b716aba99b6eba814c73466994b"/><file name="SubscriptionSearchTest.php" hash="60408ca6fa6249a0edabc6e0d5ffc637"/><file name="SubscriptionTest.php" hash="b53934d3cd0d20df7edac1d658e66f0a"/><file name="TextNodeTest.php" hash="5bce91e12b012a3d55f3478721d85060"/><file name="TransactionTest.php" hash="a9452fffc9b6399540f7cd575f179d80"/><file name="TransparentRedirectTest.php" hash="5a3c18b3b30ddaaedd82b146aaa0b2a1"/><file name="UnknownPaymentMethodTest.php" hash="99dba90eebaee849d207d8c8eaf1146c"/><file name="UtilTest.php" hash="e7a45f618244339912f1e57687d28c29"/><file name="WebhookNotificationTest.php" hash="367564d0667c80354881e4e185b87127"/><file name="Xml_GeneratorTest.php" hash="c83aeb1546ab2d4165d6ea970b66aed3"/><file name="Xml_ParserTest.php" hash="00bd1b07f1b34df846e70efc0788bcc3"/></dir></dir><file name=".gitignore" hash="bfbaaa10ed6adceb1ea6602d629c0273"/></dir></dir><dir name="composer"><file name="ClassLoader.php" hash="c67ebce5ff31e99311ceb750202adf2e"/><file name="LICENSE" hash="9b01fc9e0129adc080344653fbcbbc0f"/><file name="autoload_classmap.php" hash="8645d3a4e3ad87e7cf4d88a46717aab4"/><file name="autoload_namespaces.php" hash="6bcb68a8ffccb365c563b6de56eb356f"/><file name="autoload_psr4.php" hash="b8019895be4802f81f71a93ef6245399"/><file name="autoload_real.php" hash="45569e6f98c3747a3f2f331b764ed50f"/><file name="autoload_static.php" hash="40ab82695bb09efa8c888979f369175a"/><file name="installed.json" hash="b53f52e83f1cda64d0660f05eb3a15ac"/></dir></dir><file name="composer.json" hash="f39b9e8fb5b344fdce96725859f949c2"/><file name="composer.lock" hash="b967b686cc6409d06b61da171b17ae28"/></dir></target><target name="magelocale"><dir><dir name="en_US"><file name="Gene_Braintree.csv" hash="428b924149c6eea93a8a45101a67f125"/></dir></dir></target></contents>
42
  <compatible/>
43
- <dependencies><required><php><min>5.4.0</min><max>6.0.0</max></php><package><name></name><channel>connect.magentocommerce.com/core</channel><min></min><max></max></package></required></dependencies>
44
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Gene_Braintree</name>
4
+ <version>2.2.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/mit-license.php">MIT License</license>
7
  <channel>community</channel>
35
  &lt;li&gt;Settlement reporting&lt;/li&gt;&#xD;
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>braintreesupport@gene.co.uk</email></author><author><name>Aidan Threadgold</name><user>aidan</user><email>braintreesupport@gene.co.uk</email></author></authors>
39
+ <date>2017-02-28</date>
40
+ <time>15:04:32</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="e2024506f6c46c664a42d66cf436e330"/><file name="Search.php" hash="1d9c9d0776985ecf7c52c7fbf450a0ee"/></dir><file name="Transactions.php" hash="c9e69c06c0913c4c107ecd5f9779accc"/></dir><dir name="System"><dir name="Config"><dir name="Braintree"><file name="Config.php" hash="26e6ea67ef9c29f9a00b9bd2c8f47495"/><file name="Currency.php" hash="b8572fc0ea2adcf12413a792bec153fb"/><dir name="Kount"><file name="Ens.php" hash="4294005eb64b6611bed5e221c49c5675"/></dir><file name="Migration.php" hash="1af41286649103666832f945b6240d0c"/><file name="Moduleversion.php" hash="37bcc567e00daaf57495e6d5e2498c88"/><file name="Version.php" hash="48ae70a66162f3ec9de1e7eecba1ce5b"/></dir><file name="Migration.php" hash="82116f7906f494a0ca394383bb1e9d1d"/></dir></dir></dir><file name="Assets.php" hash="38e39c4819d5a3738677006a36ed4f47"/><dir name="Cart"><file name="Totals.php" hash="417cc77edc3d0aac2b5cc955c1299526"/></dir><dir name="Creditcard"><file name="Info.php" hash="99930c1b567b6dd5ded01c5b7fa8b19b"/><file name="Saved.php" hash="a16afbd8f6a2f148d6f1152504e80ce4"/><file name="Threedsecure.php" hash="2ee86a86bd6e31620dfaf2597107587f"/></dir><file name="Creditcard.php" hash="f69f4370e3e0ec364b8f1ae36cbbfbe1"/><dir name="Express"><file name="Abstract.php" hash="6a4523be696942e3350e076cefd2e39d"/><file name="Button.php" hash="8cbc68b059233e362fd03e7b42d0ed24"/><file name="Checkout.php" hash="0e1d05e9b0104a5d8a8c7316b63c9a0e"/><file name="Setup.php" hash="b0906d4959f65b49a21cbf2361099114"/></dir><file name="Info.php" hash="339837c7b720cee7867eb2482f2afbf1"/><file name="Js.php" hash="b8f300020d64746c39a2370471ab3b04"/><dir name="Paypal"><file name="Info.php" hash="56f381c3831a4f5d5cba6fbc22e22403"/><file name="Saved.php" hash="34322614bce7960eb137f3c1064d82a9"/></dir><file name="Paypal.php" hash="2d98fafead1ff436d29f894c510490a6"/><dir name="Saved"><file name="Edit.php" hash="8435869f3203552ee94686dd7a31fc3c"/></dir><file name="Saved.php" hash="16b94a918a769c5ee40e04e11cf5e5ce"/></dir><dir name="Helper"><file name="Data.php" hash="2a5f12fa2563e1ad95ffb619280323f1"/></dir><dir name="Model"><file name="Debug.php" hash="def0bb8a4a81ab812b1eacb45cc6dfeb"/><dir name="Entity"><file name="Setup.php" hash="635cecee786603580f3a181d806a2a95"/></dir><dir name="Express"><file name="Assets.php" hash="685ce30f45192866e75cca1e3482c0e1"/></dir><dir name="Kount"><file name="Ens.php" hash="7e7ce829f67b46da8bc02017e1143a8e"/><file name="Rest.php" hash="d84d024815a368606862c4a9e09e4ead"/></dir><file name="Migration.php" hash="f101140c4cb2a44413524b7556b7b187"/><file name="Observer.php" hash="d5738b4d66e66c70efac4afb0f5211cc"/><dir name="Paymentmethod"><file name="Abstract.php" hash="63a17ac17be14c7f9e251e458a09c5e8"/><file name="Creditcard.php" hash="0a6fcabeaea4618c29fc500e8a430a43"/><dir name="Legacy"><file name="Creditcard.php" hash="f6562520c6e6c6293432d5a6e8a52fcf"/><file name="Paypal.php" hash="523f226b7cb22d63e64f7c3a35282d61"/></dir><file name="Paypal.php" hash="f1bd0856b13add50e5a49565890194db"/></dir><file name="Saved.php" hash="92218b46f9268236d43181191bbc7e5f"/><dir name="Source"><file name="Cctype.php" hash="39e9b599a38be7905703a73112df3477"/><dir name="Creditcard"><file name="CaptureAction.php" hash="0f4bb6fac73483d905ec9aaba9fdd78d"/><file name="FormIntegration.php" hash="3476e9c690b462659578fc312cd197c2"/><file name="PaymentAction.php" hash="26af4610be51bc5304643bd7e1beca86"/></dir><file name="Environment.php" hash="ba8e544c8453ac9bc63378069adc0a1f"/><dir name="Paypal"><file name="CaptureAction.php" hash="e943b7f4b2313d5233340caeee3dd82c"/><file name="Locale.php" hash="c92adaba54645a08f46ca79065df6b30"/><file name="PaymentAction.php" hash="ab430eaf7ced39e9d6fd80ad0a7f6b3c"/><file name="Paymenttype.php" hash="03801e13c7e107df9b7d92b6a783bd08"/></dir></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Currency.php" hash="800b0c7446500a822f407180edd554e5"/></dir><dir name="Source"><dir name="Payment"><file name="Liabilityaction.php" hash="14e040429a02891062da8c8f2672c7da"/><file name="Threedsecurecountries.php" hash="c376fec93cd7b3dce37866d523f67291"/></dir></dir></dir></dir><dir name="Wrapper"><file name="Braintree.php" hash="8ff7d0f1a48f0da3ba3c09c467bd40ff"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Braintree"><file name="MigrationController.php" hash="d77efeca5e316e60ffc983090792ca22"/></dir><file name="BraintreeController.php" hash="025316f7cdd56399e73d70889c64e00b"/></dir><file name="CheckoutController.php" hash="cca953164d0f8d350ed4f0dc9532666b"/><file name="ExpressController.php" hash="4bc513ebd1d585b7e3c80bc543fb42de"/><dir name="Kount"><file name="EnsController.php" hash="0c4809d0a06f8fd760f517ca3d9a81e8"/></dir><file name="SavedController.php" hash="563069cf87a78ec2340fe0f006b40b55"/></dir><dir name="etc"><file name="adminhtml.xml" hash="c9c940beffa0ec19e4a1499a66f7fd12"/><file name="config.xml" hash="18d4da67e7fc65ffdd52ce189b9add3f"/><file name="jstranslator.xml" hash="48c491259929e52f281b6c57fd57cdb2"/><file name="system.xml" hash="6e1b3e2107b4af26dd84f87cb723e300"/></dir><dir name="sql"><dir name="gene_braintree_setup"><file name="install-0.1.0.php" hash="503f428384f687d3f55a19ea57450212"/><file name="upgrade-1.0.5.4-2.0.0.php" hash="62d37c35ba39a77ea14cad842f143393"/><file name="upgrade-2.0.0-2.0.1.php" hash="a08927707bb43a5c22b3b6ce3dd7a3c7"/><file name="upgrade-2.0.4-2.1.0.php" hash="e1b31c2459ea0aaebb679e456bab3ec1"/></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="efc70be92d3a9628b39ebf164a73e392"/></dir></dir><dir name="template"><dir name="gene"><dir name="braintree"><file name="assets.phtml" hash="c26e31c4b8b97b006c4564b9d01c3132"/><dir name="creditcard"><file name="hostedfields.phtml" hash="d46038a8f81ff6f02d1651f030c8f56c"/><file name="info.phtml" hash="2ae1e397b3a633dd305bc26c7b9c1065"/><file name="saved.phtml" hash="579ec8ca726de3b5bea8600663d1e61f"/><file name="threedsecure.phtml" hash="ee8ad689afde041c39dd92ffa5274883"/></dir><dir name="customer"><file name="edit.phtml" hash="ed8a9533f07fbfa36ec78623afd1a04d"/><file name="methods.phtml" hash="794ad8cb20314d1657a746b365c82540"/><file name="saved.phtml" hash="0457b0fa38f9db788133e54f359baa63"/></dir><dir name="express"><file name="button.phtml" hash="ef1c839a8f1a190610fcfce46bd78efd"/><file name="cart.phtml" hash="f87048b38789330e82dfd372d6c34d85"/><file name="catalog.phtml" hash="09a4b2a4a9f7726e619ed88e1603d4f5"/><file name="error.phtml" hash="0ec2ea2f9b909d9f0543e5df83eea055"/><file name="shipping_details.phtml" hash="0bb6ceafaac0ba522278df310d6136e2"/></dir><dir name="js"><file name="aheadworks.phtml" hash="e73f82ad7c97d8144b23f7d8ca1bafce"/><file name="amasty.phtml" hash="eab081dc7bdde7f9b35aee5c1317dc57"/><file name="awesomecheckout.phtml" hash="2b8d75d9d4da9034befcbca17af94f14"/><file name="default.phtml" hash="a915ec45ae6ae4c9d008bfafb9dca4b7"/><file name="fancycheckout.phtml" hash="e5d0c97d81eba20722be50dd0e043d00"/><file name="firecheckout.phtml" hash="ffa4875e7f28f8a085324af39b56deb7"/><file name="fme.phtml" hash="ba086c547a51ddfa04d6cb2a12dcaedd"/><file name="idev.phtml" hash="22e15682c66a3a744c7ed08bfe761e54"/><file name="iwd.phtml" hash="64f7d0871cc44ce8e27c95917a842abd"/><file name="magestore.phtml" hash="6bcfd8265785666caf6d8950b5de98b7"/><file name="multishipping.phtml" hash="ac85df744448f72eb5344a893473163b"/><file name="oye.phtml" hash="301d6e3accf1194af4e4e59d3b20d980"/><file name="setup.phtml" hash="02af79516d1e6471b522c57329ecadbd"/><file name="unicode.phtml" hash="3215252d38085705addff6ba1b5c70b9"/></dir><dir name="paypal"><file name="info.phtml" hash="5149b273730121e4dec3c3179820f747"/><file name="saved.phtml" hash="3dd56f96bcdd14be594d355ae8fff329"/></dir><file name="paypal.phtml" hash="d12c20e5fb76f31270a5d47061e42715"/></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="198b1716337695e9cbe384dd56dc7c9a"/></dir></dir><dir name="template"><dir name="gene"><dir name="braintree"><file name="assets.phtml" hash="c26e31c4b8b97b006c4564b9d01c3132"/><dir name="creditcard"><file name="hostedfields.phtml" hash="bae55f7d398540acdf2a892d01a6791f"/><file name="info.phtml" hash="958d514582e3de1f91f5e0f7a7169b47"/><file name="saved.phtml" hash="ca27adb601aebf97cd25a892082a8663"/></dir><file name="js.phtml" hash="9ecf15c0578bb46c83750aad88995365"/><dir name="paypal"><file name="info.phtml" hash="0485ea82dc9cc8ebea092b378672f1cd"/><file name="saved.phtml" hash="779ca8e907d7d463eafce58dfaf94f0c"/></dir><file name="paypal.phtml" hash="f81578f64c8a30560299bd993d8e996d"/><dir name="system"><dir name="config"><file name="migration.phtml" hash="8ef2a5e5561d7909d065c987ded5e592"/></dir></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"><dir name="2.2.0"><dir name="express"><file name="abstract-min.js" hash="f070c9dd599ee1e71012860686c61b5f"/><file name="paypal-min.js" hash="f06da879536b4bb41de6c51fc2e35d8b"/></dir><file name="vzero-integration-min.js" hash="56a6ce991dc61bd019167e0ac110e96f"/><file name="vzero-min.js" hash="d5ae002b2bed0dd9a4f0e6ce2af66c76"/><file name="vzero-paypal-min.js" hash="9e9ad3a381ea1dc008c717c809e5b738"/></dir><file name="config.codekit" hash="f5428eee0759594efaede2f889c99e49"/><dir name="express"><file name="abstract-min.js" hash="f070c9dd599ee1e71012860686c61b5f"/></dir><dir name="source"><dir name="express"><file name="abstract.js" hash="06efa5d85c72677e0c8c463153852d8f"/><file name="paypal.js" hash="839155e7b83c5415d5ef685590382065"/></dir><file name="vzero-integration.js" hash="a576f868a568befc6efec40d735f6312"/><file name="vzero-paypal.js" hash="adf539ed24b76c6cda6c21b9486621f2"/><file name="vzero.js" hash="19f346645d4c2af3c78ba8796e258760"/></dir><file name=".DS_Store" hash="6aaa72fe80cd46a3dfcd890682fbdca4"/></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="paypal-loading.gif" hash="078a2daf55245b227c09a7bed86750c6"/><file name="paypal.png" hash="40d5f74305e565bd14aef19bcf696541"/></dir><file name="loader.gif" hash="f48ee069890b16455c3ddcacee9b5f75"/><file name="loader-white.gif" hash="1fc0e911558e8dfe77cfdfafa0d38f88"/></dir></dir><dir name="css"><dir name="gene"><dir name="braintree"><dir name="account"><file name="account.less" hash="ddf6bf208f290316300ab20682f34473"/></dir><file name="account.css" hash="73bb46f85320b2f2b4de9beb6c0e0bd6"/><file name="aheadworks.css" hash="dad2e3821b6453c45bedd9505b603beb"/><file name="amasty.css" hash="668d36c51696f2070c38c7d04e8639b4"/><file name="awesomecheckout.css" hash="91a3d2833ef956df6c502b67e9986f23"/><file name="config.codekit" hash="506bfad608130ba1ce130508695d54d9"/><dir name="core"><file name="_general.less" hash="5848708373d8ed5eda5e5b23c3e4e05c"/><file name="_hostedfields.less" hash="d613b23ee1731345334aa423bf14c6db"/><file name="_paypal.less" hash="df0239894dfef5c905bea44938ee4658"/><file name="_saved.less" hash="66ec8d894e336f9934a1e54972c4b220"/></dir><file name="default.css" hash="8e0c5ce4cfc8592b580c8d9c27ac0f86"/><file name="express.css" hash="1c9eb3b9abb7e798b65701b2815d2e07"/><file name="express.less" hash="29acfc18e38f300972f27cfd44ca41c2"/><file name="fancycheckout.css" hash="523b1606fcd5a893bc5a06de83085137"/><file name="firecheckout.css" hash="c338590a06f2ff2b4bc3861cefb76559"/><file name="fme.css" hash="b9b5d0153c42b6f3335f1edd007acc56"/><file name="idev.css" hash="2f7011c36839ddda6dafa97a3253c0e7"/><dir name="integrations"><file name="aheadworks.less" hash="09b0304383e198885f030119c15641f7"/><file name="amasty.less" hash="4cdf236e1d44112205750cefa11448b4"/><file name="awesomecheckout.less" hash="e774da637a5c6bbdb2e5decc998afae1"/><file name="default.less" hash="d366d4560ed1ce3e9e120309e56bec2f"/><file name="fancycheckout.less" hash="18281c460bb32da164964abe585b092b"/><file name="firecheckout.less" hash="459704b8b6efca52fcee7c335b3ad625"/><file name="fme.less" hash="580ed66608560fcd1195246c22e3559c"/><file name="idev.less" hash="47485cc963e16d12e673c06cd9efe4b1"/><file name="iwd.less" hash="5081477c7946e0f5cf8cc4198895ca11"/><file name="magestore.less" hash="0af5cd105be3995dc2044d33f990bbb5"/><file name="oye.less" hash="06a0f79190b16dfbce3aec6d14f07461"/><file name="unicode.less" hash="1416abe9a38965d9aead022b238f7d4f"/></dir><file name="iwd.css" hash="4dea034fd87559f406a21760f0205101"/><file name="magestore.css" hash="752dfb740303b5e1e2f1d2ab0aa5bdb4"/><file name="oye.css" hash="741399c67a2a822af7f17e428c6cba82"/><file name="unicode.css" hash="d048a04807172d1fe974a9e938a98fb6"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="css"><dir name="gene"><dir name="braintree"><file name="adminhtml.css" hash="affb40183f3620e4ee157daf613dc2a9"/><file name="adminhtml.less" hash="b3a4d504055c85d872c5b9544d192840"/><file name="config.codekit" hash="00c3aa866faad2384b4042057d6eaeec"/><file name="migration.css" hash="158e143a99028313d6ad6f6612112dd4"/><file name="migration.less" hash="bbf09530cf530f78f4a7c3229194c5ff"/></dir></dir></dir><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"/><dir name="migration"><file name="braintree.png" hash="396d721824a86b169ce0055090ce9766"/><file name="gene-logo.png" hash="16efb1b148acc59c46c84a21d726b6e9"/><file name="loader.gif" hash="66b9100930b8e58d46acf2e13d41f7ea"/></dir></dir><file name="loader.gif" hash="f48ee069890b16455c3ddcacee9b5f75"/></dir></dir></dir></dir></dir></target><target name="magelib"><dir name="Gene"><dir name="Braintree"><file name="autoload.php" hash="0824e423dd4320ea4c10ec031e717a3b"/><dir name="braintree"><dir name="braintree_php"><file name="ACKNOWLEDGEMENTS.md" hash="6644e244fa241d0a8ad6ffe93fb3d2c9"/><file name="CHANGELOG.md" hash="94915a29d90ed7208fe0635924b332d1"/><file name="LICENSE" hash="5ba90c75203e338c9479ed8237839feb"/><file name="README.md" hash="314b0b80c311971792186c3cddaab946"/><file name="Rakefile" hash="3ca648a6b2c78b0546bf36323998036e"/><file name="ci.sh" hash="8abad344d97531d13613833d1d081954"/><file name="composer.json" hash="7f925434c3334ed83d7f73f15d937985"/><dir name="lib"><dir name="Braintree"><file name="AccountUpdaterDailyReport.php" hash="e1bb254f0dc2482190b2a3cf57ca8ecc"/><file name="AchMandate.php" hash="07f92282743ccd19eb4947fca1e33dcb"/><file name="AddOn.php" hash="82925560fd6d09575150d03851132999"/><file name="AddOnGateway.php" hash="71f1cf435ad4a0f846cbdb61f54582b6"/><file name="Address.php" hash="38b64d0235e498f761d871446670c9d3"/><file name="AddressGateway.php" hash="1b8889c596f9a10ec351f2cc2a59fabe"/><file name="AmexExpressCheckoutCard.php" hash="a4b48e18f08686aa5aaeec4849ff54a6"/><file name="AndroidPayCard.php" hash="5b9412761d364c39313925a0b1aa5308"/><file name="ApplePayCard.php" hash="4879b7885a3a3f549a3cc661b1f3a145"/><file name="Base.php" hash="33edbe8c326501ef64e6701e25ce8eb4"/><file name="ClientToken.php" hash="81e2f643f912c8943560008d2fa7869d"/><file name="ClientTokenGateway.php" hash="46c9885e3c3f40cc60d98dd94ccfa849"/><file name="CoinbaseAccount.php" hash="00d363870a777a39b89924092b8aba7f"/><file name="Collection.php" hash="18bed88fe994bab06d91c4f11f9e5e62"/><file name="Configuration.php" hash="c72a69f0cb652551f5e1ee4ecdfac6ab"/><file name="CredentialsParser.php" hash="76aea512fec3932cf3311ba96e855728"/><file name="CreditCard.php" hash="7510387703f315770542ae280ed908b9"/><file name="CreditCardGateway.php" hash="3afc61390565f93f227797c180623340"/><file name="CreditCardVerification.php" hash="b06ad08b7120572732498d2035a25952"/><file name="CreditCardVerificationGateway.php" hash="38a299c6e9a500fbf7e962e39f34e4bf"/><file name="CreditCardVerificationSearch.php" hash="93e08c9a258af84003700013d497cd82"/><file name="Customer.php" hash="e47b289a690dca6bc4284e211173ac28"/><file name="CustomerGateway.php" hash="f43b44778f62e4d935bdcaecddf59dba"/><file name="CustomerSearch.php" hash="8e8d024b951a4baa458556d4281fe988"/><file name="Descriptor.php" hash="97dc19a001fb6845c0c0eb0ee396f9bf"/><file name="Digest.php" hash="3105cc8f66a176f636b8f5a1075638a0"/><file name="Disbursement.php" hash="851eb18f89594984838ce1c59f8e6d8c"/><file name="DisbursementDetails.php" hash="ebe67e4dfb543f2b81f2f6de6de4bdfa"/><file name="Discount.php" hash="ba59054dd8d42d600c6dfb5813267150"/><file name="DiscountGateway.php" hash="8c354a122a23e3ad2136905e1c9b1d95"/><dir name="Dispute"><file name="TransactionDetails.php" hash="b56e01778ab14aaef2a5a9f8bc85d695"/></dir><file name="Dispute.php" hash="b374f0814c6c237cba252093ad37ee82"/><file name="EqualityNode.php" hash="62715d694920f751dfa270ee6234eb43"/><dir name="Error"><file name="Codes.php" hash="7d725c6215b97a70f339487c733137d9"/><file name="ErrorCollection.php" hash="5bfc2fecced63c0acca329760619ff38"/><file name="Validation.php" hash="177a09214e3832293dd74a6cde911c48"/><file name="ValidationErrorCollection.php" hash="a7d24a31592d1e664245bbc7d0bca60a"/></dir><file name="EuropeBankAccount.php" hash="1652f5c0400e3704de4077a5b9e6e714"/><dir name="Exception"><file name="Authentication.php" hash="5db82263dddde988ddb228c840156bb9"/><file name="Authorization.php" hash="d76c984a4699f10844f58d2f8bcec5d6"/><file name="Configuration.php" hash="225dfca2a3fcb48620e971a03acc6213"/><file name="DownForMaintenance.php" hash="60ec727ae01bef4a7a9242d55be70d67"/><file name="ForgedQueryString.php" hash="b0a150c17296046e3777879256f5fcea"/><file name="InvalidChallenge.php" hash="d825f5fc7acf8dd0e92dc886e7351721"/><file name="InvalidSignature.php" hash="a627af00c19b01a92fe01d432e3296d9"/><file name="NotFound.php" hash="9f28a7c11a5388c85de2f050f5a2a68d"/><file name="SSLCaFileNotFound.php" hash="c4b9474a14791ca4bd40f94e55428ecb"/><file name="SSLCertificate.php" hash="96dcb90043e9ce3668ef68568b932d77"/><file name="ServerError.php" hash="a095932cac27c6ebf707b217efb3d2b1"/><file name="TestOperationPerformedInProduction.php" hash="156421e2ccb2ac69c051516b1d6a6707"/><file name="Timeout.php" hash="834026b48d9a2317bf9e487174158be4"/><file name="TooManyRequests.php" hash="0e6d904113c3d8a3a60136e1ea5db00f"/><file name="Unexpected.php" hash="f09fd761eb5909327d02f1fa2a2dd894"/><file name="UpgradeRequired.php" hash="6cd48333f93a0a96ddd58654e5f27f85"/><file name="ValidationsFailed.php" hash="b7b129ec4b3d72d27947e8b11b6ebca2"/></dir><file name="Exception.php" hash="29a1f3a94ed378d93879d5d64858fbaf"/><file name="FacilitatorDetails.php" hash="7a25557b06c663197d1aea39bd93e776"/><file name="Gateway.php" hash="116919442d2d4699d05ab272a3711485"/><file name="Http.php" hash="9f1a9b22adb939654afae9385f899070"/><file name="Instance.php" hash="64573829ba050b6d291d082b50382e46"/><file name="IsNode.php" hash="783c6ad65c6030a12ad52253cd5bc1a8"/><file name="KeyValueNode.php" hash="6668a312a6aaaddbdcfc940775ed5820"/><file name="Merchant.php" hash="b1f8444fc109708a43017d6cda9536a2"/><dir name="MerchantAccount"><file name="AddressDetails.php" hash="540f9e79b8df5da5267835dd01db45c1"/><file name="BusinessDetails.php" hash="ca8a0dc16bce3fff5831fd22652b2f6b"/><file name="FundingDetails.php" hash="9ba992a0dda1be9a0cf8bd8b53ea33be"/><file name="IndividualDetails.php" hash="4855a6aa64b35ecab7bada4e3e0fc0c3"/></dir><file name="MerchantAccount.php" hash="a4ba2e530164c06b8e50ef8ff10f76f2"/><file name="MerchantAccountGateway.php" hash="ad62343cbbdb3e0d9732edfb7255d26c"/><file name="MerchantGateway.php" hash="e9d0fc529b7a32f7080201991deb29d1"/><file name="Modification.php" hash="5df7d89d7365e9edf7235f09b9b7ced4"/><file name="MultipleValueNode.php" hash="2555632262d8b7d81a69739817e1887d"/><file name="MultipleValueOrTextNode.php" hash="9d4a49bc8051d47fd820da2ffef03936"/><file name="OAuthCredentials.php" hash="4a6991039aff0d1c9917c02f9548b4a3"/><file name="OAuthGateway.php" hash="b7c38d9a61fa4cfc749efcdb5dfcf7c9"/><file name="OAuthResult.php" hash="ea859d4da557c860e8f36793f66455e4"/><file name="PaginatedCollection.php" hash="e3994e548e10d19d616ace9d1685b629"/><file name="PaginatedResult.php" hash="821bdf0de25d98df7054af24c33b1ce4"/><file name="PartialMatchNode.php" hash="084258b5f9f39a493ca6b02e7019a101"/><file name="PartnerMerchant.php" hash="0659cebbbba2d128c263f6785ece7cbf"/><file name="PayPalAccount.php" hash="7a1654759201f54bb1a58d08362ddc28"/><file name="PayPalAccountGateway.php" hash="865826f46ce0af80404dea0c51632bd5"/><file name="PaymentInstrumentType.php" hash="6f252e25608ab343f0a0e763bcbaeff3"/><file name="PaymentMethod.php" hash="8c1997f1ad7b449a87f8b483e59640e6"/><file name="PaymentMethodGateway.php" hash="5e30db2abc14e2f290339d8a8da62149"/><file name="PaymentMethodNonce.php" hash="6ab72220362afa9ec1e9e1fe1da049b6"/><file name="PaymentMethodNonceGateway.php" hash="393c1736d0290d0b0e8d9732692c475c"/><file name="Plan.php" hash="fcf369071d74d273604fc63ea2548f2b"/><file name="PlanGateway.php" hash="8713f672e916f26460b06a156b511e32"/><file name="RangeNode.php" hash="a3f74af2c4811a68c9f31ca136cc1c82"/><file name="ResourceCollection.php" hash="d52323710fbe909cc96e0b09509c57d5"/><dir name="Result"><file name="CreditCardVerification.php" hash="80274f1df14aff2fc83153f899084146"/><file name="Error.php" hash="1a43f4387b95e960023899356dfa971e"/><file name="Successful.php" hash="a07de8d191e4c425ea139e585b662245"/></dir><file name="RiskData.php" hash="61de70d88d4b40168e54cea84d2afc70"/><file name="SettlementBatchSummary.php" hash="73a3b6b583b5a852b3d1437b2d62ec5f"/><file name="SettlementBatchSummaryGateway.php" hash="d66b1708f32d1bcc4d738bf39df649b7"/><file name="SignatureService.php" hash="566a5d18567a513f4a527ebf3c8cd410"/><dir name="Subscription"><file name="StatusDetails.php" hash="cfec6a5f756091d72642b2505c2cc523"/></dir><file name="Subscription.php" hash="12477b5b2174c2af515a241b1ca0c494"/><file name="SubscriptionGateway.php" hash="43d59eb14e8426de39b86af042d48e11"/><file name="SubscriptionSearch.php" hash="e97a9a2a7187058082afab7701f37b1a"/><dir name="Test"><file name="CreditCardNumbers.php" hash="7265dd0e237fdc2ed6549218852734ee"/><file name="MerchantAccount.php" hash="072dd9f4c532d59b4d29cf1573046969"/><file name="Nonces.php" hash="ed136a194d09fd372b904b67c22ce14d"/><file name="Transaction.php" hash="37136a4a49213b808e05e6072ea47745"/><file name="TransactionAmounts.php" hash="d3ee44240274fcc671cb40f24c7f6887"/><file name="VenmoSdk.php" hash="33de614daaf4dad09f1165d74d08cdb0"/></dir><file name="TestingGateway.php" hash="3ec7fe4a5a11f2db91b5ecaa6ab6d1c1"/><file name="TextNode.php" hash="da1cc61af2896b945552318d67bd2a46"/><file name="ThreeDSecureInfo.php" hash="8cbb2a63c256368123cb01f2e2a2a194"/><dir name="Transaction"><file name="AddressDetails.php" hash="080b64d3fcf6f61759b227e570de6faf"/><file name="AmexExpressCheckoutCardDetails.php" hash="c4cde5f34ebe934e7a712cb1a75c1170"/><file name="AndroidPayCardDetails.php" hash="708a09910991517ad4507d0f1a82f8c7"/><file name="ApplePayCardDetails.php" hash="26093a57a1f0525210f3295a5a6b834c"/><file name="CoinbaseDetails.php" hash="ebd00610e9cfe1b67e6f3ff518f142c8"/><file name="CreditCardDetails.php" hash="81f0a10e1b56af0b06d2fa858ee56287"/><file name="CustomerDetails.php" hash="76e163794fd2e32d70ece5a780a80ef6"/><file name="EuropeBankAccountDetails.php" hash="440f492270d7f50d2eeb7f3c93e48ffe"/><file name="PayPalDetails.php" hash="4e38ea53a13980378d44b8f512f92411"/><file name="StatusDetails.php" hash="2914ad7f3b8a8244694f95949660b99e"/><file name="SubscriptionDetails.php" hash="009ba167870d9d3558d9186401c970e6"/><file name="UsBankAccountDetails.php" hash="cfe4cb0223b694fd55ab237c1e0850c8"/><file name="VenmoAccountDetails.php" hash="097e98658fe058a4e82c50129dd6a72f"/></dir><file name="Transaction.php" hash="a98cf6120ea3ac199db9b7547eeece28"/><file name="TransactionGateway.php" hash="c00ca40272eb7fd48747805b304b516e"/><file name="TransactionSearch.php" hash="634b7a51905a41c1f037f186b53b540e"/><file name="TransparentRedirect.php" hash="63a525df15682ecf4511cdaf3154c954"/><file name="TransparentRedirectGateway.php" hash="9a56b5d98c562316e346bcedf0f04bfd"/><file name="UnknownPaymentMethod.php" hash="f3731d70766ae5ecab1017fa33d06b7f"/><file name="UsBankAccount.php" hash="c09e1b0bf897de4cfd425ae5419762dd"/><file name="UsBankAccountGateway.php" hash="4d0082aac6cfe4b04e9bf1adf976c02b"/><file name="Util.php" hash="bd31461e0b7a67d5686d325fe32c5350"/><file name="VenmoAccount.php" hash="fa0f15888eda08545321eb20178fe4ac"/><file name="Version.php" hash="aa9240e5d3a44afd012a25d150d8c7ca"/><file name="WebhookNotification.php" hash="bbe5859def86dbde4298e09470cccacc"/><file name="WebhookTesting.php" hash="4fa3fb7c1c4591a30cb073cbd4c2ec5a"/><dir name="Xml"><file name="Generator.php" hash="b7b28436de76fc7b5ca13e556963d28e"/><file name="Parser.php" hash="29fbccf32c05e9dcf07bb3a40ea119c9"/></dir><file name="Xml.php" hash="e60971869ae63c3f258eac082ff9a3bf"/></dir><file name="Braintree.php" hash="e6dbb615b697b7641d9b81b8811a9d52"/><file name="autoload.php" hash="700bd7dbe39f8d89d925ccbb33651898"/><dir name="ssl"><file name="api_braintreegateway_com.ca.crt" hash="d1155107b085a1ee04dd13a634b00c42"/></dir></dir><file name="phpunit.xml.dist" hash="80635d87e10eb5bf1a4ba767d168eba8"/><dir name="tests"><dir name="Braintree"><file name="CreditCardDefaults.php" hash="caceb16d3b2fc21f7dc2bf6244000485"/><dir name="CreditCardNumbers"><file name="CardTypeIndicators.php" hash="fca486e18deed295d0d9961b19e71c6e"/></dir><file name="OAuthTestHelper.php" hash="7678b026a2d19450150999999a0cddcc"/></dir><file name="Helper.php" hash="458d8183e29b07bde23b47a483ed70a2"/><file name="SanityTest.php" hash="e75fcbab2870381b960a0583fb9d3ce3"/><file name="Setup.php" hash="d21ea963b4103c6f082aff93a97d75b9"/><dir name="integration"><file name="AddOnsTest.php" hash="6caa89249c72d7746cb1de6ef1460079"/><file name="AddressTest.php" hash="b78f498609625e2d2f5eadf5c07dc303"/><file name="ClientTokenTest.php" hash="83d93f7812082bcbdf0099652b98b183"/><file name="CreditCardTest.php" hash="c2c5eb3bd53c701ce5a259da11b7743f"/><file name="CreditCardVerificationAdvancedSearchTest.php" hash="1b741a14706c14fe27b6383f37989ea8"/><file name="CreditCardVerificationTest.php" hash="7f29467a7f84a029fc4ccb36b52b5ced"/><file name="CustomerAdvancedSearchTest.php" hash="f1657f3ef6992d7ab2dfddb60e88f5ce"/><file name="CustomerTest.php" hash="1eeee472f6d3690f292033dc25f91385"/><file name="DisbursementTest.php" hash="26505b6c688c23f52617aff41d301020"/><file name="DiscountTest.php" hash="0fc13502d1323679af95ca7e0a5a2622"/><dir name="Error"><file name="ErrorCollectionTest.php" hash="f72638e7a4ce876ee83740f11986a3a8"/><file name="ValidationErrorCollectionTest.php" hash="3db5c126101fd5878d0862af5afb921a"/></dir><file name="EuropeBankAccountTest.php" hash="1fa1e38472ea992c558f20284d50fea3"/><file name="HttpClientApi.php" hash="a9789c276b44a7be39bf548edce2cf4e"/><file name="HttpTest.php" hash="7314e935b3a7c65224da0e531d3d68a7"/><file name="MerchantAccountTest.php" hash="e3d8386f473255bf7a1c9e29aa094620"/><file name="MerchantTest.php" hash="e8bca1018153fe1361155fb420fe90be"/><file name="MultipleValueNodeTest.php" hash="1b21f6431b0dc593f18d887ed88a30f3"/><file name="OAuthTest.php" hash="cf09acef408069c6131ede44f0004cd3"/><file name="PayPalAccountTest.php" hash="8bfdfdcb1e08687d25bf80260051d820"/><file name="PaymentMethodNonceTest.php" hash="38d982daa6ccd6d2a8d1ac63c50a24de"/><file name="PaymentMethodTest.php" hash="d39288ef3dfb6bff033a83dd42579eaf"/><file name="PlanTest.php" hash="bbc260c8a0cd36869f0de96c4639cb2a"/><dir name="Result"><file name="ErrorTest.php" hash="3ff0aedd05f5868c8e28bb7f2f98f8f8"/></dir><file name="SettlementBatchSummaryTest.php" hash="86e8847f6cdf4c6120b473e7bdafc196"/><file name="SubscriptionHelper.php" hash="0d717139be147a5d72f16cd4ff465d22"/><file name="SubscriptionSearchTest.php" hash="712536a2484872abf8b6b3003e67c0bd"/><file name="SubscriptionTest.php" hash="1e4ff49856af4942dc14c199764ee82c"/><file name="TestTransactionTest.php" hash="27cce6bf160d8777358332eb9d7a7eae"/><file name="TextNodeTest.php" hash="6f8afc0387144088127d65ce3e926cba"/><file name="TransactionAdvancedSearchTest.php" hash="430d532eec84d163a6b9e5d7170156f0"/><file name="TransactionTest.php" hash="0c630c8c5595195235dceeb3f0faa040"/><file name="TransparentRedirectTest.php" hash="632073911d63ec46fedc0007b8e1d96c"/><file name="UsBankAccountTest.php" hash="1993f0ead117306c880aa8201de33603"/></dir><dir name="unit"><file name="AddOnTest.php" hash="1e9ca24b1d1076d838868b46f3b8db31"/><file name="AddressTest.php" hash="971b65131de89d97627d5fce6d23948f"/><file name="BraintreeTest.php" hash="d5661eb2e0d23eec624cc039bc209baa"/><dir name="ClientApi"><file name="ClientTokenTest.php" hash="ecd06e8aa6238f1a2b4af69d0e8de798"/></dir><file name="ConfigurationTest.php" hash="58966c22e0020ad59cc021b3bbaee4b8"/><file name="CreditCardTest.php" hash="aff6920d4a64f82c25947a0aad622491"/><file name="CreditCardVerificationTest.php" hash="aadef2854162a79ec7f974a4511c74dc"/><file name="CustomerTest.php" hash="b34959a82a0a9ac2f917086135e30ec3"/><file name="DigestTest.php" hash="91a198a97d0469223d9cda1c032c82cf"/><file name="DisbursementDetailsTest.php" hash="5417ff00d8780050cd3468e891a46f7c"/><file name="DisbursementTest.php" hash="7df421883c72e00553827d5c0e7816d7"/><file name="DiscountTest.php" hash="cda7b5ba54e11c4b0ed852e146236d6d"/><file name="GatewayTest.php" hash="182a77395c8c791754f8f9fd70f1561a"/><file name="InstanceTest.php" hash="fc35293e35840a740e44da14929f13ce"/><file name="MerchantAccountTest.php" hash="2938575dc44d37d494519750e7699c0c"/><file name="MultipleValueNodeTest.php" hash="0821a1e0ea469210e4cd7ac2dcdd2f3a"/><file name="MultipleValueOrTextNodeTest.php" hash="cb82ba391dbd216a413da9777f50a4d7"/><file name="OAuthTest.php" hash="450ee30874c358112731fb39e0c7a898"/><file name="PayPalAccountTest.php" hash="5d5ed45062b3f4fddf38a95fda7fcec0"/><file name="PaymentMethodTest.php" hash="0e9f7c0a994001e1a0a3743104d5531c"/><file name="RangeNodeTest.php" hash="c1aef8c246c603736ed5a7000a150f4a"/><file name="ResourceCollectionTest.php" hash="5b22b79a4e50f486c2f3e9e268cf9d80"/><dir name="Result"><file name="ErrorTest.php" hash="bfa4fbcb181cd8a7fbc05c86f617899b"/><file name="SuccessfulTest.php" hash="a809212d472948c166915eb901f641d7"/></dir><file name="SanityTest.php" hash="80485b716aba99b6eba814c73466994b"/><file name="SubscriptionSearchTest.php" hash="60408ca6fa6249a0edabc6e0d5ffc637"/><file name="SubscriptionTest.php" hash="b53934d3cd0d20df7edac1d658e66f0a"/><file name="TextNodeTest.php" hash="5bce91e12b012a3d55f3478721d85060"/><file name="TransactionTest.php" hash="f92992f2c1adaecd54054e7a290f483c"/><file name="TransparentRedirectTest.php" hash="5a3c18b3b30ddaaedd82b146aaa0b2a1"/><file name="UnknownPaymentMethodTest.php" hash="99dba90eebaee849d207d8c8eaf1146c"/><file name="UsBankAccount.php" hash="d857b03b7cb6ce038a4ba78b6fa6088c"/><file name="UtilTest.php" hash="e7a45f618244339912f1e57687d28c29"/><file name="WebhookNotificationTest.php" hash="fdc7475d981ff891b1bcadf4c0d086e6"/><file name="Xml_GeneratorTest.php" hash="c83aeb1546ab2d4165d6ea970b66aed3"/><file name="Xml_ParserTest.php" hash="00bd1b07f1b34df846e70efc0788bcc3"/></dir></dir><file name=".gitignore" hash="bfbaaa10ed6adceb1ea6602d629c0273"/></dir></dir><dir name="composer"><file name="ClassLoader.php" hash="bf6c4758ae060fd8f3e3a88e6c24ac3c"/><file name="LICENSE" hash="9b01fc9e0129adc080344653fbcbbc0f"/><file name="autoload_classmap.php" hash="8645d3a4e3ad87e7cf4d88a46717aab4"/><file name="autoload_namespaces.php" hash="6bcb68a8ffccb365c563b6de56eb356f"/><file name="autoload_psr4.php" hash="b8019895be4802f81f71a93ef6245399"/><file name="autoload_real.php" hash="2a2b1f976d9f7f2ddc961fe21555455e"/><file name="autoload_static.php" hash="df2695436329076c2574a584a6935e29"/><file name="installed.json" hash="d65bf034ce31c590b95a82d726f70479"/></dir></dir><file name="composer.json" hash="4e1b9ba54380bd961271bc0a7e42477c"/><file name="composer.lock" hash="5f8cf9244d4d916641c6cc86f53ba17a"/></dir></target><target name="magelocale"><dir><dir name="en_US"><file name="Gene_Braintree.csv" hash="428b924149c6eea93a8a45101a67f125"/></dir></dir></target></contents>
42
  <compatible/>
43
+ <dependencies><required><php><min>5.4.0</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/.DS_Store DELETED
Binary file