Gene_Braintree - Version 2.0.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.0.0
Comparing to
See all releases


Code changes from version 1.0.5.4 to 2.0.0

Files changed (263) hide show
  1. app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Braintree/Config.php +7 -1
  2. app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Braintree/Currency.php +20 -5
  3. app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Braintree/Kount/Ens.php +22 -0
  4. app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Braintree/Moduleversion.php +1 -1
  5. app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Migration.php +37 -0
  6. app/code/community/Gene/Braintree/Block/Creditcard.php +73 -26
  7. app/code/community/Gene/Braintree/Block/Creditcard/Saved.php +53 -0
  8. app/code/community/Gene/Braintree/Block/Express/Button.php +118 -0
  9. app/code/community/Gene/Braintree/Block/Express/Checkout.php +39 -0
  10. app/code/community/Gene/Braintree/Block/Js.php +2 -1
  11. app/code/community/Gene/Braintree/Block/Paypal.php +13 -1
  12. app/code/community/Gene/Braintree/Block/Paypal/Saved.php +53 -0
  13. app/code/community/Gene/Braintree/Block/Saved/Edit.php +127 -0
  14. app/code/community/Gene/Braintree/Helper/Data.php +102 -0
  15. app/code/community/Gene/Braintree/Model/Entity/Setup.php +53 -0
  16. app/code/community/Gene/Braintree/Model/Kount/Ens.php +343 -0
  17. app/code/community/Gene/Braintree/Model/Kount/Rest.php +163 -0
  18. app/code/community/Gene/Braintree/Model/Migration.php +359 -0
  19. app/code/community/Gene/Braintree/Model/Observer.php +75 -5
  20. app/code/community/Gene/Braintree/Model/Paymentmethod/Abstract.php +256 -4
  21. app/code/community/Gene/Braintree/Model/Paymentmethod/Creditcard.php +126 -196
  22. app/code/community/Gene/Braintree/Model/Paymentmethod/Legacy/Creditcard.php +28 -0
  23. app/code/community/Gene/Braintree/Model/Paymentmethod/Legacy/Paypal.php +28 -0
  24. app/code/community/Gene/Braintree/Model/Paymentmethod/Paypal.php +145 -47
  25. app/code/community/Gene/Braintree/Model/Saved.php +29 -10
  26. app/code/community/Gene/Braintree/Model/Source/Creditcard/CaptureAction.php +0 -1
  27. app/code/community/Gene/Braintree/Model/Source/Creditcard/FormIntegration.php +12 -7
  28. app/code/community/Gene/Braintree/Model/Source/Creditcard/PaymentAction.php +0 -1
  29. app/code/community/Gene/Braintree/Model/Source/Environment.php +5 -2
  30. app/code/community/Gene/Braintree/Model/Source/Paypal/CaptureAction.php +34 -0
  31. app/code/community/Gene/Braintree/Model/Source/Paypal/PaymentAction.php +25 -0
  32. app/code/community/Gene/Braintree/Model/Source/Paypal/Paymenttype.php +2 -2
  33. app/code/community/Gene/Braintree/Model/Wrapper/Braintree.php +269 -182
  34. app/code/community/Gene/Braintree/controllers/Adminhtml/Braintree/MigrationController.php +82 -0
  35. app/code/community/Gene/Braintree/controllers/Adminhtml/BraintreeController.php +31 -10
  36. app/code/community/Gene/Braintree/controllers/CheckoutController.php +25 -5
  37. app/code/community/Gene/Braintree/controllers/ExpressController.php +330 -0
  38. app/code/community/Gene/Braintree/controllers/Kount/EnsController.php +95 -0
  39. app/code/community/Gene/Braintree/controllers/SavedController.php +130 -18
  40. app/code/community/Gene/Braintree/etc/config.xml +63 -3
  41. app/code/community/Gene/Braintree/etc/system.xml +292 -41
  42. app/code/community/Gene/Braintree/sql/gene_braintree_setup/install-0.1.0.php +1 -0
  43. app/code/community/Gene/Braintree/sql/gene_braintree_setup/upgrade-1.0.5.4-2.0.0.php +75 -0
  44. app/design/adminhtml/default/default/layout/gene/braintree.xml +22 -1
  45. app/design/adminhtml/default/default/template/gene/braintree/creditcard.phtml +4 -0
  46. app/design/adminhtml/default/default/template/gene/braintree/creditcard/hostedfields.phtml +7 -1
  47. app/design/adminhtml/default/default/template/gene/braintree/creditcard/saved.phtml +33 -0
  48. app/design/adminhtml/default/default/template/gene/braintree/js.phtml +23 -2
  49. app/design/adminhtml/default/default/template/gene/braintree/paypal.phtml +9 -0
  50. app/design/adminhtml/default/default/template/gene/braintree/paypal/saved.phtml +28 -0
  51. app/design/adminhtml/default/default/template/gene/braintree/system/config/migration.phtml +119 -0
  52. app/design/frontend/base/default/layout/gene/braintree.xml +95 -42
  53. app/design/frontend/base/default/template/gene/braintree/creditcard.phtml +15 -37
  54. app/design/frontend/base/default/template/gene/braintree/creditcard/hostedfields.phtml +25 -37
  55. app/design/frontend/base/default/template/gene/braintree/creditcard/saved.phtml +37 -0
  56. app/design/frontend/base/default/template/gene/braintree/customer/edit.phtml +160 -0
  57. app/design/frontend/base/default/template/gene/braintree/customer/methods.phtml +15 -5
  58. app/design/frontend/base/default/template/gene/braintree/customer/saved.phtml +33 -31
  59. app/design/frontend/base/default/template/gene/braintree/express/cart.phtml +62 -0
  60. app/design/frontend/base/default/template/gene/braintree/express/catalog.phtml +44 -0
  61. app/design/frontend/base/default/template/gene/braintree/express/error.phtml +4 -0
  62. app/design/frontend/base/default/template/gene/braintree/express/shipping_details.phtml +46 -0
  63. app/design/frontend/base/default/template/gene/braintree/js/aheadworks.phtml +1 -1
  64. app/design/frontend/base/default/template/gene/braintree/js/amasty.phtml +1 -1
  65. app/design/frontend/base/default/template/gene/braintree/js/default.phtml +1 -1
  66. app/design/frontend/base/default/template/gene/braintree/js/firecheckout.phtml +1 -1
  67. app/design/frontend/base/default/template/gene/braintree/js/fme.phtml +1 -2
  68. app/design/frontend/base/default/template/gene/braintree/js/idev.phtml +2 -2
  69. app/design/frontend/base/default/template/gene/braintree/js/iwd.phtml +1 -1
  70. app/design/frontend/base/default/template/gene/braintree/js/magestore.phtml +1 -1
  71. app/design/frontend/base/default/template/gene/braintree/js/multishipping.phtml +87 -13
  72. app/design/frontend/base/default/template/gene/braintree/js/oye.phtml +1 -1
  73. app/design/frontend/base/default/template/gene/braintree/js/setup.phtml +10 -0
  74. app/design/frontend/base/default/template/gene/braintree/js/unicode.phtml +1 -1
  75. app/design/frontend/base/default/template/gene/braintree/paypal.phtml +1 -30
  76. app/design/frontend/base/default/template/gene/braintree/paypal/saved.phtml +30 -0
  77. app/locale/en_US/Gene_Braintree.csv +16 -1
  78. js/gene/braintree/config.codekit +15 -4
  79. js/gene/braintree/express.js +314 -0
  80. js/gene/braintree/vzero-0.7-min.js +1 -2
  81. js/gene/braintree/vzero-0.7-min.js.map +1 -1
  82. js/gene/braintree/vzero-0.7.js +262 -182
  83. lib/Braintree/Test/Nonces.php +0 -33
  84. lib/{Braintree.php → Gene/Braintree.php} +4 -0
  85. lib/{Braintree → Gene/Braintree}/AddOn.php +0 -0
  86. lib/{Braintree → Gene/Braintree}/AddOnGateway.php +0 -0
  87. lib/{Braintree → Gene/Braintree}/Address.php +0 -0
  88. lib/{Braintree → Gene/Braintree}/AddressGateway.php +0 -0
  89. lib/{Braintree → Gene/Braintree}/AndroidPayCard.php +1 -0
  90. lib/{Braintree → Gene/Braintree}/ApplePayCard.php +1 -0
  91. lib/{Braintree → Gene/Braintree}/Base.php +0 -0
  92. lib/{Braintree → Gene/Braintree}/ClientToken.php +0 -0
  93. lib/{Braintree → Gene/Braintree}/ClientTokenGateway.php +10 -7
  94. lib/{Braintree → Gene/Braintree}/CoinbaseAccount.php +0 -0
  95. lib/{Braintree → Gene/Braintree}/Collection.php +0 -0
  96. lib/{Braintree → Gene/Braintree}/Configuration.php +1 -10
  97. lib/{Braintree → Gene/Braintree}/CredentialsParser.php +0 -0
  98. lib/{Braintree → Gene/Braintree}/CreditCard.php +0 -0
  99. lib/{Braintree → Gene/Braintree}/CreditCardGateway.php +0 -0
  100. lib/{Braintree → Gene/Braintree}/CreditCardVerification.php +0 -0
  101. lib/{Braintree → Gene/Braintree}/CreditCardVerificationGateway.php +0 -0
  102. lib/{Braintree → Gene/Braintree}/CreditCardVerificationSearch.php +0 -0
  103. lib/{Braintree → Gene/Braintree}/Customer.php +0 -0
  104. lib/{Braintree → Gene/Braintree}/CustomerGateway.php +6 -6
  105. lib/{Braintree → Gene/Braintree}/CustomerSearch.php +0 -0
  106. lib/{Braintree → Gene/Braintree}/Descriptor.php +0 -0
  107. lib/{Braintree → Gene/Braintree}/Digest.php +0 -0
  108. lib/{Braintree → Gene/Braintree}/Disbursement.php +0 -0
  109. lib/{Braintree → Gene/Braintree}/DisbursementDetails.php +0 -0
  110. lib/{Braintree → Gene/Braintree}/Discount.php +0 -0
  111. lib/{Braintree → Gene/Braintree}/DiscountGateway.php +0 -0
  112. lib/{Braintree → Gene/Braintree}/Dispute.php +0 -0
  113. lib/{Braintree → Gene/Braintree}/Dispute/TransactionDetails.php +0 -0
  114. lib/{Braintree → Gene/Braintree}/EqualityNode.php +0 -0
  115. lib/{Braintree → Gene/Braintree}/Error/Codes.php +0 -0
  116. lib/{Braintree → Gene/Braintree}/Error/ErrorCollection.php +0 -0
  117. lib/{Braintree → Gene/Braintree}/Error/Validation.php +0 -0
  118. lib/{Braintree → Gene/Braintree}/Error/ValidationErrorCollection.php +0 -0
  119. lib/Gene/Braintree/EuropeBankAccount.php +64 -0
  120. lib/{Braintree → Gene/Braintree}/Exception.php +0 -0
  121. lib/{Braintree → Gene/Braintree}/Exception/Authentication.php +0 -0
  122. lib/{Braintree → Gene/Braintree}/Exception/Authorization.php +0 -0
  123. lib/{Braintree → Gene/Braintree}/Exception/Configuration.php +0 -0
  124. lib/{Braintree → Gene/Braintree}/Exception/DownForMaintenance.php +0 -0
  125. lib/{Braintree → Gene/Braintree}/Exception/ForgedQueryString.php +0 -0
  126. lib/{Braintree → Gene/Braintree}/Exception/InvalidChallenge.php +0 -0
  127. lib/{Braintree → Gene/Braintree}/Exception/InvalidSignature.php +0 -0
  128. lib/{Braintree → Gene/Braintree}/Exception/NotFound.php +0 -0
  129. lib/{Braintree → Gene/Braintree}/Exception/SSLCaFileNotFound.php +0 -0
  130. lib/{Braintree → Gene/Braintree}/Exception/SSLCertificate.php +0 -0
  131. lib/{Braintree → Gene/Braintree}/Exception/ServerError.php +0 -0
  132. lib/Gene/Braintree/Exception/TestOperationPerformedInProduction.php +11 -0
  133. lib/{Braintree → Gene/Braintree}/Exception/Unexpected.php +0 -0
  134. lib/{Braintree → Gene/Braintree}/Exception/UpgradeRequired.php +0 -0
  135. lib/{Braintree → Gene/Braintree}/Exception/ValidationsFailed.php +0 -0
  136. lib/{Braintree → Gene/Braintree}/Gateway.php +27 -18
  137. lib/{Braintree → Gene/Braintree}/Http.php +0 -0
  138. lib/{Braintree → Gene/Braintree}/Instance.php +0 -0
  139. lib/{Braintree → Gene/Braintree}/IsNode.php +0 -0
  140. lib/{Braintree → Gene/Braintree}/KeyValueNode.php +0 -0
  141. lib/{Braintree → Gene/Braintree}/Merchant.php +0 -0
  142. lib/{Braintree → Gene/Braintree}/MerchantAccount.php +0 -0
  143. lib/{Braintree → Gene/Braintree}/MerchantAccount/AddressDetails.php +0 -0
  144. lib/{Braintree → Gene/Braintree}/MerchantAccount/BusinessDetails.php +0 -0
  145. lib/{Braintree → Gene/Braintree}/MerchantAccount/FundingDetails.php +0 -0
  146. lib/{Braintree → Gene/Braintree}/MerchantAccount/IndividualDetails.php +0 -0
  147. lib/{Braintree → Gene/Braintree}/MerchantAccountGateway.php +0 -0
  148. lib/{Braintree → Gene/Braintree}/MerchantGateway.php +0 -0
  149. lib/{Braintree → Gene/Braintree}/Modification.php +0 -0
  150. lib/{Braintree → Gene/Braintree}/MultipleValueNode.php +0 -0
  151. lib/{Braintree → Gene/Braintree}/MultipleValueOrTextNode.php +0 -0
  152. lib/{Braintree → Gene/Braintree}/OAuthCredentials.php +0 -0
  153. lib/{Braintree → Gene/Braintree}/OAuthGateway.php +3 -3
  154. lib/{Braintree → Gene/Braintree}/PartialMatchNode.php +0 -0
  155. lib/{Braintree → Gene/Braintree}/PartnerMerchant.php +0 -0
  156. lib/{Braintree → Gene/Braintree}/PayPalAccount.php +0 -0
  157. lib/{Braintree → Gene/Braintree}/PayPalAccountGateway.php +0 -0
  158. lib/{Braintree → Gene/Braintree}/PaymentInstrumentType.php +0 -0
  159. lib/{Braintree → Gene/Braintree}/PaymentMethod.php +0 -0
  160. lib/{Braintree → Gene/Braintree}/PaymentMethodGateway.php +8 -0
  161. lib/{Braintree → Gene/Braintree}/PaymentMethodNonce.php +0 -0
  162. lib/{Braintree → Gene/Braintree}/PaymentMethodNonceGateway.php +0 -0
  163. lib/{Braintree → Gene/Braintree}/Plan.php +0 -0
  164. lib/{Braintree → Gene/Braintree}/PlanGateway.php +0 -0
  165. lib/{Braintree → Gene/Braintree}/RangeNode.php +0 -0
  166. lib/{Braintree → Gene/Braintree}/ResourceCollection.php +0 -0
  167. lib/{Braintree → Gene/Braintree}/Result/CreditCardVerification.php +0 -0
  168. lib/{Braintree → Gene/Braintree}/Result/Error.php +0 -0
  169. lib/{Braintree → Gene/Braintree}/Result/Successful.php +0 -0
  170. lib/{Braintree → Gene/Braintree}/RiskData.php +0 -0
  171. lib/{Braintree → Gene/Braintree}/SettlementBatchSummary.php +0 -0
  172. lib/{Braintree → Gene/Braintree}/SettlementBatchSummaryGateway.php +0 -0
  173. lib/{Braintree → Gene/Braintree}/SignatureService.php +0 -0
  174. lib/{Braintree → Gene/Braintree}/Subscription.php +0 -0
  175. lib/{Braintree → Gene/Braintree}/Subscription/StatusDetails.php +0 -0
  176. lib/{Braintree → Gene/Braintree}/SubscriptionGateway.php +0 -0
  177. lib/{Braintree → Gene/Braintree}/SubscriptionSearch.php +0 -0
  178. lib/{Braintree → Gene/Braintree}/Test/CreditCardNumbers.php +0 -0
  179. lib/{Braintree → Gene/Braintree}/Test/MerchantAccount.php +0 -0
  180. lib/Gene/Braintree/Test/Nonces.php +65 -0
  181. lib/Gene/Braintree/Test/Transaction.php +51 -0
  182. lib/{Braintree → Gene/Braintree}/Test/TransactionAmounts.php +0 -0
  183. lib/{Braintree → Gene/Braintree}/Test/VenmoSdk.php +0 -0
  184. lib/Gene/Braintree/TestingGateway.php +49 -0
  185. lib/{Braintree → Gene/Braintree}/TextNode.php +0 -0
  186. lib/{Braintree → Gene/Braintree}/ThreeDSecureInfo.php +0 -0
  187. lib/{Braintree → Gene/Braintree}/Transaction.php +10 -0
  188. lib/{Braintree → Gene/Braintree}/Transaction/AddressDetails.php +0 -0
  189. lib/{Braintree → Gene/Braintree}/Transaction/AndroidPayCardDetails.php +1 -0
  190. lib/{Braintree → Gene/Braintree}/Transaction/ApplePayCardDetails.php +1 -0
  191. lib/{Braintree → Gene/Braintree}/Transaction/CoinbaseDetails.php +0 -0
  192. lib/{Braintree → Gene/Braintree}/Transaction/CreditCardDetails.php +0 -0
  193. lib/{Braintree → Gene/Braintree}/Transaction/CustomerDetails.php +0 -0
  194. lib/Gene/Braintree/Transaction/EuropeBankAccountDetails.php +21 -0
  195. lib/{Braintree → Gene/Braintree}/Transaction/PayPalDetails.php +3 -0
  196. lib/{Braintree → Gene/Braintree}/Transaction/StatusDetails.php +0 -0
  197. lib/{Braintree → Gene/Braintree}/Transaction/SubscriptionDetails.php +0 -0
  198. lib/{Braintree → Gene/Braintree}/TransactionGateway.php +11 -1
  199. lib/{Braintree → Gene/Braintree}/TransactionSearch.php +1 -0
  200. lib/{Braintree → Gene/Braintree}/TransparentRedirect.php +0 -0
  201. lib/{Braintree → Gene/Braintree}/TransparentRedirectGateway.php +0 -0
  202. lib/{Braintree → Gene/Braintree}/UnknownPaymentMethod.php +0 -0
  203. lib/{Braintree → Gene/Braintree}/Util.php +0 -0
  204. lib/{Braintree → Gene/Braintree}/Version.php +1 -1
  205. lib/{Braintree → Gene/Braintree}/WebhookNotification.php +0 -0
  206. lib/{Braintree → Gene/Braintree}/WebhookTesting.php +0 -0
  207. lib/{Braintree → Gene/Braintree}/Xml.php +0 -0
  208. lib/{Braintree → Gene/Braintree}/Xml/Generator.php +0 -0
  209. lib/{Braintree → Gene/Braintree}/Xml/Parser.php +0 -0
  210. lib/{ssl → Gene/ssl}/api_braintreegateway_com.ca.crt +0 -0
  211. lib/{ssl → Gene/ssl}/sandbox_braintreegateway_com.ca.crt +0 -0
  212. package.xml +27 -27
  213. skin/{frontend/base/default/images → adminhtml/default/default/css}/gene/braintree/.DS_Store +0 -0
  214. skin/adminhtml/default/default/css/gene/braintree/adminhtml.css +130 -0
  215. skin/adminhtml/default/default/css/gene/braintree/adminhtml.less +131 -0
  216. skin/adminhtml/default/default/css/gene/braintree/config.codekit +880 -0
  217. skin/adminhtml/default/default/css/gene/braintree/migration.css +187 -0
  218. skin/adminhtml/default/default/css/gene/braintree/migration.less +218 -0
  219. skin/adminhtml/default/default/images/gene/braintree/AE.png +0 -0
  220. skin/adminhtml/default/default/images/gene/braintree/DI.png +0 -0
  221. skin/adminhtml/default/default/images/gene/braintree/JCB.png +0 -0
  222. skin/adminhtml/default/default/images/gene/braintree/MC.png +0 -0
  223. skin/adminhtml/default/default/images/gene/braintree/ME.png +0 -0
  224. skin/adminhtml/default/default/images/gene/braintree/PP.png +0 -0
  225. skin/adminhtml/default/default/images/gene/braintree/VI.png +0 -0
  226. skin/adminhtml/default/default/images/gene/braintree/card.png +0 -0
  227. skin/adminhtml/default/default/images/gene/braintree/migration/braintree.png +0 -0
  228. skin/adminhtml/default/default/images/gene/braintree/migration/gene-logo.png +0 -0
  229. skin/adminhtml/default/default/images/gene/braintree/migration/loader.gif +0 -0
  230. skin/adminhtml/default/default/images/gene/loader.gif +0 -0
  231. {app/code/community/Gene/Braintree/Model → skin/frontend/base/default/css/gene/braintree}/.DS_Store +0 -0
  232. skin/frontend/base/default/css/gene/braintree/account.css +37 -0
  233. skin/frontend/base/default/css/gene/braintree/account/account.less +61 -0
  234. skin/frontend/base/default/css/gene/braintree/aheadworks.css +241 -97
  235. skin/frontend/base/default/css/gene/braintree/amasty.css +190 -107
  236. skin/frontend/base/default/css/gene/braintree/config.codekit +1230 -0
  237. skin/frontend/base/default/css/gene/braintree/core/_general.less +5 -0
  238. skin/frontend/base/default/css/gene/braintree/core/_hostedfields.less +90 -0
  239. skin/frontend/base/default/css/gene/braintree/core/_paypal.less +39 -0
  240. skin/frontend/base/default/css/gene/braintree/core/_saved.less +57 -0
  241. skin/frontend/base/default/css/gene/braintree/default.css +192 -95
  242. skin/frontend/base/default/css/gene/braintree/express.css +119 -0
  243. skin/frontend/base/default/css/gene/braintree/firecheckout.css +190 -96
  244. skin/frontend/base/default/css/gene/braintree/fme.css +188 -107
  245. skin/frontend/base/default/css/gene/braintree/idev.css +236 -95
  246. skin/frontend/base/default/css/gene/braintree/integrations/aheadworks.less +75 -0
  247. skin/frontend/base/default/css/gene/braintree/integrations/amasty.less +24 -0
  248. skin/frontend/base/default/css/gene/braintree/integrations/default.less +26 -0
  249. skin/frontend/base/default/css/gene/braintree/integrations/firecheckout.less +24 -0
  250. skin/frontend/base/default/css/gene/braintree/integrations/fme.less +22 -0
  251. skin/frontend/base/default/css/gene/braintree/integrations/idev.less +68 -0
  252. skin/frontend/base/default/css/gene/braintree/integrations/iwd.less +66 -0
  253. skin/frontend/base/default/css/gene/braintree/integrations/magestore.less +203 -0
  254. skin/frontend/base/default/css/gene/braintree/integrations/oye.less +84 -0
  255. skin/frontend/base/default/css/gene/braintree/integrations/unicode.less +42 -0
  256. skin/frontend/base/default/css/gene/braintree/iwd.css +231 -92
  257. skin/frontend/base/default/css/gene/braintree/magestore.css +342 -94
  258. skin/frontend/base/default/css/gene/braintree/oye.css +236 -88
  259. skin/frontend/base/default/css/gene/braintree/unicode.css +209 -107
  260. skin/frontend/base/default/images/gene/braintree/paypal-loading.gif +0 -0
  261. skin/frontend/base/default/images/gene/braintree/paypal.png +0 -0
  262. skin/frontend/base/default/images/gene/loader-white.gif +0 -0
  263. skin/frontend/base/default/images/gene/loader.gif +0 -0
app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Braintree/Config.php CHANGED
@@ -16,7 +16,6 @@ class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Config
16
  */
17
  public function render(Varien_Data_Form_Element_Abstract $element)
18
  {
19
- $useContainerId = $element->getData('use_container_id');
20
  return sprintf('<tr id="row_%s">
21
  <td class="label">
22
  <strong id="%s">%s</strong>
@@ -48,6 +47,9 @@ function checkConfig() {
48
  // Clear any timeout already set
49
  clearTimeout(configTimeout);
50
 
 
 
 
51
  // Defined the configTimeout
52
  configTimeout = setTimeout(function() {
53
  // Make the request
@@ -55,6 +57,10 @@ function checkConfig() {
55
  "' . Mage::helper('adminhtml')->getUrl('adminhtml/braintree/validateConfig') . '",
56
  {
57
  method: "post",
 
 
 
 
58
  onSuccess: function(transport){
59
  $(\'row_payment_gene_braintree_valid_config\').down(\'td.value\').innerHTML = transport.responseText;
60
  },
16
  */
17
  public function render(Varien_Data_Form_Element_Abstract $element)
18
  {
 
19
  return sprintf('<tr id="row_%s">
20
  <td class="label">
21
  <strong id="%s">%s</strong>
47
  // Clear any timeout already set
48
  clearTimeout(configTimeout);
49
 
50
+ // Place a loading gif into the config area
51
+ $(\'row_payment_gene_braintree_valid_config\').down(\'td.value\').innerHTML = \'<div style="line-height: 18px;margin: 6px 0;"><img src="' . $this->getSkinUrl('images/gene/loader.gif') . '" height="18" style="float: left;margin-right: 8px;" /> '. $this->__('Validating Credentials...') . '</center>\';
52
+
53
  // Defined the configTimeout
54
  configTimeout = setTimeout(function() {
55
  // Make the request
57
  "' . Mage::helper('adminhtml')->getUrl('adminhtml/braintree/validateConfig') . '",
58
  {
59
  method: "post",
60
+ onCreate: function (response) {
61
+ // Disable the annoying loading modal
62
+ Ajax.Responders.unregister(varienLoaderHandler.handler);
63
+ },
64
  onSuccess: function(transport){
65
  $(\'row_payment_gene_braintree_valid_config\').down(\'td.value\').innerHTML = transport.responseText;
66
  },
app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Braintree/Currency.php CHANGED
@@ -9,7 +9,7 @@ class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Currency
9
  extends Mage_Adminhtml_Block_System_Config_Form_Field
10
  {
11
  /**
12
- * Enter description here...
13
  *
14
  * @param Varien_Data_Form_Element_Abstract $element
15
  * @return string
@@ -25,11 +25,26 @@ class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Currency
25
  */
26
  private function getCurrencyTableHtml(Varien_Data_Form_Element_Abstract $element)
27
  {
28
- // Store ID = scope ID
29
- $storeId = Mage::getSingleton('adminhtml/config_data')->getScopeId();
30
 
31
- // Retrieve the currencies
32
- $currencies = Mage::app()->getStore($storeId)->getAvailableCurrencyCodes();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
  // Retrieve the values
35
  $values = $element->getValue();
9
  extends Mage_Adminhtml_Block_System_Config_Form_Field
10
  {
11
  /**
12
+ * Return the currency table HTML for the element
13
  *
14
  * @param Varien_Data_Form_Element_Abstract $element
15
  * @return string
25
  */
26
  private function getCurrencyTableHtml(Varien_Data_Form_Element_Abstract $element)
27
  {
28
+ $currencies = array();
 
29
 
30
+ /* @var $adminConfigData Mage_Adminhtml_Model_Config_Data */
31
+ $adminConfigData = Mage::getSingleton('adminhtml/config_data');
32
+
33
+ // Determine the available currencies for the current scope
34
+ if ($adminConfigData->getScope() == 'default') {
35
+ $currencies = Mage::app()->getStore(0)->getAvailableCurrencyCodes();
36
+ } else if ($adminConfigData->getScope() == 'websites') {
37
+ /* @var $website Mage_Core_Model_Website */
38
+ $website = Mage::getModel('core/website')->load($adminConfigData->getWebsite(), 'code');
39
+ if ($website->getId()) {
40
+ /* @var $store Mage_Core_Model_Store */
41
+ foreach ($website->getStores() as $store) {
42
+ $currencies = array_merge($currencies, $store->getAvailableCurrencyCodes());
43
+ }
44
+ }
45
+ } else if ($adminConfigData->getScope() == 'stores') {
46
+ $currencies = Mage::app()->getStore($adminConfigData->getStore())->getAvailableCurrencyCodes();
47
+ }
48
 
49
  // Retrieve the values
50
  $values = $element->getValue();
app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Braintree/Kount/Ens.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
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
+ {
10
+ /**
11
+ * Return the ENS URL
12
+ *
13
+ * @param \Varien_Data_Form_Element_Abstract $element
14
+ *
15
+ * @return string
16
+ */
17
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
18
+ {
19
+ $url = $this->getUrl('braintree/kount_ens/', array('_secure' => true));
20
+ return substr($url, 0, (strpos($url, "kount_ens/") + 10));
21
+ }
22
+ }
app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Braintree/Moduleversion.php CHANGED
@@ -65,7 +65,7 @@ document.observe("dom:loaded", function() {
65
  },
66
  onSuccess: function(transport) {
67
  try {
68
- json = eval(\'(\' + transport.responseText + \')\');
69
  } catch(e){}
70
 
71
  // Is there a message to be displayed to the user?
65
  },
66
  onSuccess: function(transport) {
67
  try {
68
+ var json = eval(\'(\' + transport.responseText + \')\');
69
  } catch(e){}
70
 
71
  // Is there a message to be displayed to the user?
app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Migration.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
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
+ {
10
+
11
+
12
+ /**
13
+ * Only render the block if the migration should run
14
+ *
15
+ * @return string
16
+ */
17
+ public function _toHtml()
18
+ {
19
+ if ($this->_runMigration()) {
20
+ return parent::_toHtml();
21
+ }
22
+
23
+ return '';
24
+ }
25
+
26
+ /**
27
+ * The migration should only run if the Braintree Payments module is installed, the migration hasn't already been ran
28
+ * and the Gene Braintree extension isn't configured
29
+ *
30
+ * @return bool
31
+ */
32
+ protected function _runMigration()
33
+ {
34
+ return Mage::app()->getRequest()->getParam('section') == 'payment'
35
+ && Mage::helper('gene_braintree')->shouldRunMigration();
36
+ }
37
+ }
app/code/community/Gene/Braintree/Block/Creditcard.php CHANGED
@@ -7,16 +7,11 @@
7
  */
8
  class Gene_Braintree_Block_Creditcard extends Mage_Payment_Block_Form_Cc
9
  {
10
- /**
11
- * Store our saved details
12
- */
13
- private $_savedDetails = false;
14
-
15
  /**
16
  * We can use the same token twice
17
  * @var bool
18
  */
19
- private $token = false;
20
 
21
  /**
22
  * Set the template
@@ -25,12 +20,8 @@ class Gene_Braintree_Block_Creditcard extends Mage_Payment_Block_Form_Cc
25
  {
26
  parent::_construct();
27
 
28
- // Utilise a differente template if we're using Hosted Fields
29
- if(Mage::getModel('gene_braintree/paymentmethod_creditcard')->getConfigData('form_integration') == Gene_Braintree_Model_Source_Creditcard_FormIntegration::INTEGRATION_HOSTED) {
30
- $this->setTemplate('gene/braintree/creditcard/hostedfields.phtml');
31
- } else {
32
- $this->setTemplate('gene/braintree/creditcard.phtml');
33
- }
34
  }
35
 
36
  /**
@@ -51,16 +42,6 @@ class Gene_Braintree_Block_Creditcard extends Mage_Payment_Block_Form_Cc
51
  return false;
52
  }
53
 
54
- /**
55
- * is 3D secure enabled?
56
- *
57
- * @return mixed
58
- */
59
- protected function is3DEnabled()
60
- {
61
- return Mage::getModel('gene_braintree/paymentmethod_creditcard')->is3DEnabled();
62
- }
63
-
64
  /**
65
  * Does this customer have saved accounts?
66
  *
@@ -68,7 +49,7 @@ class Gene_Braintree_Block_Creditcard extends Mage_Payment_Block_Form_Cc
68
  */
69
  public function hasSavedDetails()
70
  {
71
- if(Mage::getSingleton('customer/session')->isLoggedIn()) {
72
  if ($this->getSavedDetails()) {
73
  return sizeof($this->getSavedDetails());
74
  }
@@ -89,6 +70,28 @@ class Gene_Braintree_Block_Creditcard extends Mage_Payment_Block_Form_Cc
89
  return $this->_savedDetails;
90
  }
91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  /**
93
  * Return the original CC types
94
  *
@@ -159,10 +162,54 @@ class Gene_Braintree_Block_Creditcard extends Mage_Payment_Block_Form_Cc
159
  */
160
  protected function getClientToken()
161
  {
162
- if(!$this->token) {
163
- $this->token = Mage::getSingleton('gene_braintree/wrapper_braintree')->init()->generateToken();
164
  }
165
- return $this->token;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
166
  }
167
 
168
  }
7
  */
8
  class Gene_Braintree_Block_Creditcard extends Mage_Payment_Block_Form_Cc
9
  {
 
 
 
 
 
10
  /**
11
  * We can use the same token twice
12
  * @var bool
13
  */
14
+ protected $_token = false;
15
 
16
  /**
17
  * Set the template
20
  {
21
  parent::_construct();
22
 
23
+ // The system now only supports Hosted Fields
24
+ $this->setTemplate('gene/braintree/creditcard/hostedfields.phtml');
 
 
 
 
25
  }
26
 
27
  /**
42
  return false;
43
  }
44
 
 
 
 
 
 
 
 
 
 
 
45
  /**
46
  * Does this customer have saved accounts?
47
  *
49
  */
50
  public function hasSavedDetails()
51
  {
52
+ if (Mage::getSingleton('customer/session')->isLoggedIn() || Mage::app()->getStore()->isAdmin()) {
53
  if ($this->getSavedDetails()) {
54
  return sizeof($this->getSavedDetails());
55
  }
70
  return $this->_savedDetails;
71
  }
72
 
73
+ /**
74
+ * Get the saved child HTML
75
+ *
76
+ * @return string
77
+ */
78
+ public function getSavedChildHtml()
79
+ {
80
+ $html = $this->getChildHtml('saved', false);
81
+ $this->unsetChild('saved');
82
+ return $html;
83
+ }
84
+
85
+ /**
86
+ * is 3D secure enabled?
87
+ *
88
+ * @return mixed
89
+ */
90
+ protected function is3DEnabled()
91
+ {
92
+ return Mage::getModel('gene_braintree/paymentmethod_creditcard')->is3DEnabled();
93
+ }
94
+
95
  /**
96
  * Return the original CC types
97
  *
162
  */
163
  protected function getClientToken()
164
  {
165
+ if(!$this->_token) {
166
+ $this->_token = Mage::getSingleton('gene_braintree/wrapper_braintree')->init()->generateToken();
167
  }
168
+ return $this->_token;
169
+ }
170
+
171
+ /**
172
+ * Config setting to show accepted cards on the checkout
173
+ * @return boolean
174
+ */
175
+ protected function showAcceptedCards()
176
+ {
177
+ return Mage::getModel('gene_braintree/paymentmethod_creditcard')->getConfigData('display_cctypes');
178
+ }
179
+
180
+ /**
181
+ * Allowed payment cards
182
+ * @return array
183
+ */
184
+ protected function getAllowedCards()
185
+ {
186
+ $allowed = explode(",", Mage::getModel('gene_braintree/paymentmethod_creditcard')->getConfigData('cctypes'));
187
+ $cards = array();
188
+
189
+ foreach (Mage::getSingleton('payment/config')->getCcTypes() as $code => $name) {
190
+ if (in_array($code, $allowed) && $code != 'OT') {
191
+ $cards[] = array(
192
+ 'value' => $code,
193
+ 'label' => $name
194
+ );
195
+ }
196
+ }
197
+
198
+ return $cards;
199
+ }
200
+
201
+ /**
202
+ * Hosted fields descriptor
203
+ *
204
+ * @return string
205
+ */
206
+ protected function getHostedDescriptor()
207
+ {
208
+ if( Mage::getModel('gene_braintree/paymentmethod_creditcard')->getConfigData('form_integration') == Gene_Braintree_Model_Source_Creditcard_FormIntegration::INTEGRATION_HOSTED ) {
209
+ return Mage::getModel('gene_braintree/paymentmethod_creditcard')->getConfigData('hostedfields_descriptor');
210
+ }
211
+
212
+ return false;
213
  }
214
 
215
  }
app/code/community/Gene/Braintree/Block/Creditcard/Saved.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
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
+ {
10
+ /**
11
+ * @var array
12
+ */
13
+ protected $_savedDetails;
14
+
15
+ /**
16
+ * Set the template
17
+ */
18
+ protected function _construct()
19
+ {
20
+ parent::_construct();
21
+
22
+ $this->setTemplate('gene/braintree/creditcard/saved.phtml');
23
+ }
24
+
25
+ /**
26
+ * Does this customer have saved accounts?
27
+ *
28
+ * @return mixed
29
+ */
30
+ public function hasSavedDetails()
31
+ {
32
+ if (Mage::getSingleton('customer/session')->isLoggedIn() || Mage::app()->getStore()->isAdmin()) {
33
+ if ($this->getSavedDetails()) {
34
+ return sizeof($this->getSavedDetails());
35
+ }
36
+ }
37
+ return false;
38
+ }
39
+
40
+ /**
41
+ * Return the saved accounts
42
+ *
43
+ * @return array
44
+ */
45
+ public function getSavedDetails()
46
+ {
47
+ if (!$this->_savedDetails) {
48
+ $this->_savedDetails = Mage::getSingleton('gene_braintree/saved')->getSavedMethodsByType(Gene_Braintree_Model_Saved::SAVED_CREDITCARD_ID);
49
+ }
50
+ return $this->_savedDetails;
51
+ }
52
+
53
+ }
app/code/community/Gene/Braintree/Block/Express/Button.php ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class Gene_Braintree_Block_Express_Button
4
+ *
5
+ * @author Aidan Threadgold <aidan@gene.co.uk>
6
+ */
7
+ class Gene_Braintree_Block_Express_Button extends Mage_Core_Block_Template
8
+ {
9
+ /**
10
+ * Braintree token
11
+ * @var string
12
+ */
13
+ protected $_token = null;
14
+
15
+ /**
16
+ * Generate braintree token
17
+ */
18
+ protected function _construct()
19
+ {
20
+ parent::_construct();
21
+ $this->_token = Mage::getModel('gene_braintree/wrapper_braintree')->init()->generateToken();
22
+ }
23
+
24
+ /**
25
+ * Get braintree token
26
+ * @return string
27
+ */
28
+ public function getToken()
29
+ {
30
+ return $this->_token;
31
+ }
32
+
33
+ /**
34
+ * Is the express mode enabled
35
+ * @return bool
36
+ */
37
+ public function isEnabled()
38
+ {
39
+ if( Mage::getStoreConfig('payment/gene_braintree_paypal/express_active') ) {
40
+ return true;
41
+ }
42
+
43
+ return false;
44
+ }
45
+
46
+ public function isEnabledPdp()
47
+ {
48
+ if( Mage::getStoreConfig('payment/gene_braintree_paypal/express_pdp') ) {
49
+ return true;
50
+ }
51
+
52
+ return false;
53
+ }
54
+
55
+ public function isEnabledCart()
56
+ {
57
+ if( Mage::getStoreConfig('payment/gene_braintree_paypal/express_cart') ) {
58
+ return true;
59
+ }
60
+
61
+ return false;
62
+ }
63
+
64
+
65
+
66
+ /**
67
+ * Get store currency code.
68
+ * @return string
69
+ */
70
+ public function getStoreCurrency()
71
+ {
72
+ return Mage::app()->getStore()->getCurrentCurrencyCode();
73
+ }
74
+
75
+ /**
76
+ * Get the store locale.
77
+ * @return string
78
+ */
79
+ public function getStoreLocale()
80
+ {
81
+ return Mage::app()->getLocale()->getLocaleCode();;
82
+ }
83
+
84
+ /**
85
+ * Get the current product
86
+ * @return mixed
87
+ */
88
+ public function getProduct()
89
+ {
90
+ return Mage::registry('current_product');
91
+ }
92
+
93
+ /**
94
+ * Registry entry to determine if block has been instantiated yet
95
+ * @return bool
96
+ */
97
+ public function hasBeenSetup()
98
+ {
99
+ if( Mage::registry('gene_braintree_btn_loaded') ) {
100
+ return true;
101
+ }
102
+ return false;
103
+ }
104
+
105
+ /**
106
+ * Registry entry to mark this block as instantiated
107
+ * @param string $html
108
+ * @return string
109
+ */
110
+ public function _afterToHtml($html)
111
+ {
112
+ if( !$this->hasBeenSetup() ) {
113
+ Mage::register('gene_braintree_btn_loaded', true);
114
+ }
115
+
116
+ return $html;
117
+ }
118
+ }
app/code/community/Gene/Braintree/Block/Express/Checkout.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
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
+ {
10
+ /**
11
+ * Are there any available shipping rates?
12
+ *
13
+ * @return bool
14
+ */
15
+ protected function hasShippingRates()
16
+ {
17
+ // There are no shipping rates if the quote is virtual
18
+ if ($this->getQuote()->isVirtual()) {
19
+ return false;
20
+ }
21
+
22
+ if (count($this->getShippingRates()) > 0) {
23
+ return true;
24
+ }
25
+
26
+ return false;
27
+ }
28
+
29
+ /**
30
+ * Retrieve the quote
31
+ *
32
+ * @return Mage_Sales_Model_Quote
33
+ */
34
+ public function getQuote()
35
+ {
36
+ return $this->getData('quote');
37
+ }
38
+
39
+ }
app/code/community/Gene/Braintree/Block/Js.php CHANGED
@@ -61,12 +61,13 @@ class Gene_Braintree_Block_Js extends Mage_Core_Block_Template
61
 
62
  /**
63
  * Is the system set to use hosted fields for credit card processing?
 
64
  *
65
  * @return bool
66
  */
67
  protected function isHostedFields()
68
  {
69
- return var_export(Mage::getModel('gene_braintree/paymentmethod_creditcard')->getConfigData('form_integration') == Gene_Braintree_Model_Source_Creditcard_FormIntegration::INTEGRATION_HOSTED, true);
70
  }
71
 
72
  /**
61
 
62
  /**
63
  * Is the system set to use hosted fields for credit card processing?
64
+ * Hosted Fields is currently the only integration option
65
  *
66
  * @return bool
67
  */
68
  protected function isHostedFields()
69
  {
70
+ return 'true';
71
  }
72
 
73
  /**
app/code/community/Gene/Braintree/Block/Paypal.php CHANGED
@@ -54,7 +54,7 @@ class Gene_Braintree_Block_Paypal extends Mage_Payment_Block_Form
54
  */
55
  public function hasSavedDetails()
56
  {
57
- if(Mage::getSingleton('customer/session')->isLoggedIn()) {
58
  if($this->getSavedDetails()) {
59
  return sizeof($this->getSavedDetails());
60
  }
@@ -75,6 +75,18 @@ class Gene_Braintree_Block_Paypal extends Mage_Payment_Block_Form
75
  return $this->_savedDetails;
76
  }
77
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  /**
79
  * Is the vault enabled? Meaning we can save PayPal
80
  *
54
  */
55
  public function hasSavedDetails()
56
  {
57
+ if(Mage::getSingleton('customer/session')->isLoggedIn() || Mage::app()->getStore()->isAdmin()) {
58
  if($this->getSavedDetails()) {
59
  return sizeof($this->getSavedDetails());
60
  }
75
  return $this->_savedDetails;
76
  }
77
 
78
+ /**
79
+ * Get the saved child HTML
80
+ *
81
+ * @return string
82
+ */
83
+ public function getSavedChildHtml()
84
+ {
85
+ $html = $this->getChildHtml('saved', false);
86
+ $this->unsetChild('saved');
87
+ return $html;
88
+ }
89
+
90
  /**
91
  * Is the vault enabled? Meaning we can save PayPal
92
  *
app/code/community/Gene/Braintree/Block/Paypal/Saved.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
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
+ {
10
+ /**
11
+ * @var array
12
+ */
13
+ protected $_savedDetails;
14
+
15
+ /**
16
+ * Set the template
17
+ */
18
+ protected function _construct()
19
+ {
20
+ parent::_construct();
21
+
22
+ $this->setTemplate('gene/braintree/paypal/saved.phtml');
23
+ }
24
+
25
+ /**
26
+ * Does this customer have saved accounts?
27
+ *
28
+ * @return mixed
29
+ */
30
+ public function hasSavedDetails()
31
+ {
32
+ if (Mage::getSingleton('customer/session')->isLoggedIn() || Mage::app()->getStore()->isAdmin()) {
33
+ if ($this->getSavedDetails()) {
34
+ return sizeof($this->getSavedDetails());
35
+ }
36
+ }
37
+ return false;
38
+ }
39
+
40
+ /**
41
+ * Return the saved accounts
42
+ *
43
+ * @return array
44
+ */
45
+ public function getSavedDetails()
46
+ {
47
+ if (!$this->_savedDetails) {
48
+ $this->_savedDetails = Mage::getSingleton('gene_braintree/saved')->getSavedMethodsByType(Gene_Braintree_Model_Saved::SAVED_PAYPAL_ID);
49
+ }
50
+ return $this->_savedDetails;
51
+ }
52
+
53
+ }
app/code/community/Gene/Braintree/Block/Saved/Edit.php ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
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
+ {
10
+ /**
11
+ * @var null
12
+ */
13
+ protected $_address = null;
14
+
15
+ /**
16
+ * Set the _address to null after the parent has initialized
17
+ */
18
+ protected function _prepareLayout()
19
+ {
20
+ parent::_prepareLayout();
21
+ $this->_address = null;
22
+ }
23
+
24
+ /**
25
+ * Return the currently viewed payment method
26
+ *
27
+ * @return mixed
28
+ */
29
+ public function getPaymentMethod()
30
+ {
31
+ return Mage::registry('current_payment_method');
32
+ }
33
+
34
+ /**
35
+ * Return the save URL
36
+ *
37
+ * @return string
38
+ */
39
+ public function getSaveUrl()
40
+ {
41
+ return $this->getUrl('*/*/save', array('_secure' => true));
42
+ }
43
+
44
+ /**
45
+ * Return the back URL
46
+ *
47
+ * @return string
48
+ */
49
+ public function getBackUrl()
50
+ {
51
+ return $this->getUrl('*/*/index', array('_secure' => true));
52
+ }
53
+
54
+ /**
55
+ * Return the Braintree address as a Magento address
56
+ *
57
+ * @return \Mage_Customer_Model_Address|null
58
+ */
59
+ public function getAddress()
60
+ {
61
+ if (is_null($this->_address)) {
62
+ $paymentMethod = $this->getPaymentMethod();
63
+ if (isset($paymentMethod->billingAddress)) {
64
+ /* @var $billingAddress Braintree_Address */
65
+ $billingAddress = $paymentMethod->billingAddress;
66
+ $this->_address = Mage::helper('gene_braintree')->convertToMagentoAddress($billingAddress);
67
+ }
68
+ }
69
+
70
+ return $this->_address;
71
+ }
72
+
73
+ /**
74
+ * Return the correct title
75
+ *
76
+ * @return string
77
+ */
78
+ public function getTitle()
79
+ {
80
+ return $this->__('Edit Payment Method');
81
+ }
82
+
83
+ /**
84
+ * Retrieve credit card expire months
85
+ *
86
+ * @return array
87
+ */
88
+ public function getCcMonths()
89
+ {
90
+ $months = $this->getData('cc_months');
91
+ if (is_null($months)) {
92
+ $months[0] = $this->__('Month');
93
+ $months = array_merge($months, Mage::getSingleton('payment/config')->getMonths());
94
+ $this->setData('cc_months', $months);
95
+ }
96
+
97
+ return $months;
98
+ }
99
+
100
+ /**
101
+ * Retrieve credit card expire years
102
+ *
103
+ * @return array
104
+ */
105
+ public function getCcYears()
106
+ {
107
+ $years = $this->getData('cc_years');
108
+ if (is_null($years)) {
109
+ $years = Mage::getSingleton('payment/config')->getYears();
110
+ $years = array(0 => $this->__('Year')) + $years;
111
+ $this->setData('cc_years', $years);
112
+ }
113
+
114
+ return $years;
115
+ }
116
+
117
+ /**
118
+ * Return the country ID
119
+ *
120
+ * @return mixed
121
+ */
122
+ public function getCountryId()
123
+ {
124
+ return $this->getAddress()->getCountry();
125
+ }
126
+
127
+ }
app/code/community/Gene/Braintree/Helper/Data.php CHANGED
@@ -7,6 +7,11 @@
7
  */
8
  class Gene_Braintree_Helper_Data extends Mage_Core_Helper_Abstract
9
  {
 
 
 
 
 
10
  /**
11
  * Return all of the possible statuses as an array
12
  *
@@ -45,4 +50,101 @@ class Gene_Braintree_Helper_Data extends Mage_Core_Helper_Abstract
45
  // Suppress errors from formatting the price, as we may have EUR12,00 etc
46
  return @number_format($price, 2, '.', '');
47
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  }
7
  */
8
  class Gene_Braintree_Helper_Data extends Mage_Core_Helper_Abstract
9
  {
10
+ /**
11
+ * Store if the migration has ran in the system config
12
+ */
13
+ const MIGRATION_COMPLETE = 'payment/gene_braintree/migration_ran';
14
+
15
  /**
16
  * Return all of the possible statuses as an array
17
  *
50
  // Suppress errors from formatting the price, as we may have EUR12,00 etc
51
  return @number_format($price, 2, '.', '');
52
  }
53
+
54
+ /**
55
+ * Convert a Braintree address into a Magento address
56
+ *
57
+ * @param $address
58
+ *
59
+ * @return \Mage_Customer_Model_Address
60
+ */
61
+ public function convertToMagentoAddress($address)
62
+ {
63
+ $addressModel = Mage::getModel('customer/address');
64
+
65
+ $addressModel->addData(array(
66
+ 'firstname' => $address->firstName,
67
+ 'lastname' => $address->lastName,
68
+ 'street' => $address->streetAddress . (isset($address->extendedAddress) ? "\n" . $address->extendedAddress : ''),
69
+ 'city' => $address->locality,
70
+ 'postcode' => $address->postalCode,
71
+ 'country' => $address->countryCodeAlpha2
72
+ ));
73
+
74
+ if (isset($address->region)) {
75
+ $addressModel->setData('region_code', $address->region);
76
+ }
77
+
78
+ if (isset($address->company)) {
79
+ $addressModel->setData('company', $address->company);
80
+ }
81
+
82
+ return $addressModel;
83
+ }
84
+
85
+ /**
86
+ * Convert a Magento address into a Braintree address
87
+ *
88
+ * @param $address
89
+ *
90
+ * @return array
91
+ */
92
+ public function convertToBraintreeAddress($address)
93
+ {
94
+ if (is_object($address)) {
95
+ // Build up the initial array
96
+ $return = array(
97
+ 'firstName' => $address->getFirstname(),
98
+ 'lastName' => $address->getLastname(),
99
+ 'streetAddress' => $address->getStreet1(),
100
+ 'locality' => $address->getCity(),
101
+ 'postalCode' => $address->getPostcode(),
102
+ 'countryCodeAlpha2' => $address->getCountry()
103
+ );
104
+
105
+ // Any extended address?
106
+ if ($address->getStreet2()) {
107
+ $return['extendedAddress'] = $address->getStreet2();
108
+ }
109
+
110
+ // Region
111
+ if ($address->getRegion()) {
112
+ $return['region'] = $address->getRegionCode();
113
+ }
114
+
115
+ // Check to see if we have a company
116
+ if ($address->getCompany()) {
117
+ $return['company'] = $address->getCompany();
118
+ }
119
+
120
+ return $return;
121
+ }
122
+ }
123
+
124
+ /**
125
+ * Can we update information in Kount for a payment?
126
+ *
127
+ * kount_ens_update is set when an ENS update is received from Kount
128
+ *
129
+ * @return bool
130
+ */
131
+ public function canUpdateKount()
132
+ {
133
+ return !Mage::registry('kount_ens_update')
134
+ && Mage::getStoreConfig('payment/gene_braintree_creditcard/kount_merchant_id')
135
+ && Mage::getStoreConfig('payment/gene_braintree_creditcard/kount_api_key');
136
+ }
137
+
138
+ /**
139
+ * Should the system run the migration tool?
140
+ *
141
+ * @return bool
142
+ */
143
+ public function shouldRunMigration()
144
+ {
145
+ return Mage::helper('core')->isModuleEnabled('Braintree_Payments')
146
+ && !Mage::getStoreConfigFlag(self::MIGRATION_COMPLETE)
147
+ && !Mage::getStoreConfig('payment/gene_braintree/merchant_id')
148
+ && !Mage::getStoreConfig('payment/gene_braintree/sandbox_merchant_id');
149
+ }
150
  }
app/code/community/Gene/Braintree/Model/Entity/Setup.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
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
+ {
10
+ /**
11
+ * As Mage::getStoreConfig isn't initialized properly in upgrade scripts we have to directly query the database for
12
+ * the correct values.
13
+ *
14
+ * This doesn't have support for website level configuration settings, as they're not used in the upgrade script.
15
+ *
16
+ * @param $path
17
+ * @param int $storeId
18
+ *
19
+ * @return null|string
20
+ */
21
+ public function getStoreConfig($path, $storeId = 0)
22
+ {
23
+ if ($storeId instanceof Mage_Core_Model_Store) {
24
+ $storeId = $storeId->getId();
25
+ }
26
+
27
+ $resource = Mage::getModel('core/resource');
28
+ $dbRead = $resource->getConnection('core_read');
29
+ $table = $resource->getTableName('core/config_data');
30
+
31
+ // Select the config data directly from the database
32
+ if ($storeId === 0) {
33
+ $select = $dbRead->select()
34
+ ->from($table, 'value')
35
+ ->where('path = ?', $path)
36
+ ->where('scope = ?', 'default')
37
+ ->where('scope_id = ?', 0);
38
+ } else {
39
+ $select = $dbRead->select()
40
+ ->from($table, 'value')
41
+ ->where('path = ?', $path)
42
+ ->where('scope = ?', 'stores')
43
+ ->where('scope_id = ?', $storeId);
44
+ }
45
+
46
+ $result = $dbRead->fetchOne($select);
47
+ if ($result) {
48
+ return $result;
49
+ }
50
+
51
+ return null;
52
+ }
53
+ }
app/code/community/Gene/Braintree/Model/Kount/Ens.php ADDED
@@ -0,0 +1,343 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
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
+ {
10
+ const RESPONSE_DECLINE = 'D';
11
+ const RESPONSE_APPROVE = 'A';
12
+ const RESPONSE_REVIEW = 'R';
13
+ const RESPONSE_ESCALATE = 'E';
14
+
15
+ /**
16
+ * Process an event
17
+ *
18
+ * @param $event
19
+ *
20
+ * @return bool
21
+ */
22
+ public function processEvent($event)
23
+ {
24
+ switch ($event['name']) {
25
+ case 'WORKFLOW_STATUS_EDIT':
26
+ return $this->_workflowStatusEdit($event);
27
+ break;
28
+ }
29
+
30
+ // If we don't support the event, assume it was a success
31
+ return true;
32
+ }
33
+
34
+ /**
35
+ * Event handler for a workflow status edit
36
+ *
37
+ * @param $event
38
+ *
39
+ * @return bool
40
+ */
41
+ protected function _workflowStatusEdit($event)
42
+ {
43
+ if (($incrementId = $this->_getOrderIncrementId($event))
44
+ && ($kountTransactionId = $this->_getKountTransactionId($event)))
45
+ {
46
+ $order = Mage::getModel('sales/order')->load($incrementId, 'increment_id');
47
+ if ($order->getId()) {
48
+ $payment = $order->getPayment();
49
+
50
+ // Ensure we're modifying the order with the same Kount transaction ID
51
+ if ($payment->getAdditionalInformation('kount_id') == $kountTransactionId) {
52
+
53
+ // Was the previous status review or escalate?
54
+ if ($event['old_value'] == self::RESPONSE_REVIEW || $event['old_value'] == self::RESPONSE_ESCALATE) {
55
+
56
+ // Is the new value approve or decline?
57
+ if ($event['new_value'] == self::RESPONSE_APPROVE) {
58
+ return $this->_approveOrder($order);
59
+ } else if ($event['new_value'] == self::RESPONSE_DECLINE) {
60
+ return $this->_declineOrder($order);
61
+ }
62
+ }
63
+ }
64
+ }
65
+ }
66
+
67
+ return false;
68
+ }
69
+
70
+ /**
71
+ * Approve an order from Kount
72
+ *
73
+ * @param \Mage_Sales_Model_Order $order
74
+ *
75
+ * @return bool
76
+ */
77
+ protected function _approveOrder(Mage_Sales_Model_Order $order)
78
+ {
79
+ // Ensure the status has not moved from it's payment review state
80
+ if ($order->getStatus() == Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW) {
81
+
82
+ // Inform the system that this update is occurring from an ENS update
83
+ Mage::register('kount_ens_update', true);
84
+
85
+ $captured = 0;
86
+ /* @var $invoice Mage_Sales_Model_Order_Invoice */
87
+ foreach ($order->getInvoiceCollection() as $invoice) {
88
+
89
+ try {
90
+ // Is the invoice pending?
91
+ if ($invoice->canCapture()) {
92
+
93
+ // The Braintree module won't attempt to capture money twice if it's settling etc
94
+ $invoice->capture();
95
+ $invoice->getOrder()->setIsInProcess(true);
96
+ Mage::getModel('core/resource_transaction')
97
+ ->addObject($invoice)
98
+ ->addObject($invoice->getOrder())
99
+ ->save();
100
+
101
+ ++$captured;
102
+ }
103
+ } catch (Exception $e) {
104
+ Gene_Braintree_Model_Debug::log('Approved Kount transaction failed to be captured in Magento: ' . $e->getMessage());
105
+ Gene_Braintree_Model_Debug::log($e);
106
+ return false;
107
+ }
108
+
109
+ }
110
+
111
+ Mage::unregister('kount_ens_update');
112
+
113
+ // The operation was only a success if one or more invoices are captured
114
+ if ($captured > 0) {
115
+ $order->addStatusHistoryComment('Order approved through Kount, pending invoice(s) captured.')->save();
116
+ return true;
117
+ }
118
+
119
+ }
120
+
121
+ return false;
122
+ }
123
+
124
+ /**
125
+ * Decline an order in Magento
126
+ *
127
+ * If the payment is only voidable, we void the invoice cancelling the order. If the payment has settled we create
128
+ * a credit memo and close the order that way.
129
+ *
130
+ * @param \Mage_Sales_Model_Order $order
131
+ *
132
+ * @return bool
133
+ */
134
+ protected function _declineOrder(Mage_Sales_Model_Order $order)
135
+ {
136
+ // Ensure the status has not moved from it's payment review state
137
+ if ($order->getStatus() == Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW) {
138
+
139
+ // Inform the system that this update is occurring from an ENS update
140
+ Mage::register('kount_ens_update', true);
141
+
142
+ // Retrieve the Braintree ID
143
+ $braintreeId = $order->getPayment()->getCcTransId();
144
+
145
+ try {
146
+ /* @var $wrapper Gene_Braintree_Model_Wrapper_Braintree */
147
+ $wrapper = Mage::getModel('gene_braintree/wrapper_braintree');
148
+ $wrapper->init($order->getStoreId());
149
+
150
+ $transaction = Braintree_Transaction::find($braintreeId);
151
+ if ($transaction->id) {
152
+
153
+ // If the transaction is yet to settle we can void the transaction in Braintree
154
+ if ($transaction->status == Braintree_Transaction::AUTHORIZED || $transaction->status == Braintree_Transaction::SUBMITTED_FOR_SETTLEMENT) {
155
+ return $this->_voidOrder($order);
156
+ } else if ($transaction->status == Braintree_Transaction::SETTLED) {
157
+ return $this->_refundOrder($order);
158
+ }
159
+ }
160
+ } catch (Exception $e) {
161
+ Gene_Braintree_Model_Debug::log('Declined Kount transaction failed to be declined in Magento: ' . $e->getMessage());
162
+ Gene_Braintree_Model_Debug::log($e);
163
+ return false;
164
+ }
165
+
166
+ }
167
+
168
+ return false;
169
+ }
170
+
171
+ /**
172
+ * Void an order
173
+ *
174
+ * @param \Mage_Sales_Model_Order $order
175
+ *
176
+ * @return bool
177
+ */
178
+ protected function _voidOrder(Mage_Sales_Model_Order $order)
179
+ {
180
+ // Void transaction
181
+ $voided = 0;
182
+
183
+ /* @var $invoice Mage_Sales_Model_Order_Invoice */
184
+ foreach ($order->getInvoiceCollection() as $invoice) {
185
+
186
+ try {
187
+ // Void and cancel the invoice, voiding forces the authorization to be dropped
188
+ $invoice->void();
189
+
190
+ Mage::getModel('core/resource_transaction')
191
+ ->addObject($invoice)
192
+ ->addObject($invoice->getOrder())
193
+ ->save();
194
+
195
+ } catch (Exception $e) {
196
+ Gene_Braintree_Model_Debug::log('Declined Kount transaction failed to be voided in Magento: ' . $e->getMessage());
197
+ Gene_Braintree_Model_Debug::log($e);
198
+ return false;
199
+ }
200
+
201
+ ++$voided;
202
+ }
203
+
204
+ Mage::unregister('kount_ens_update');
205
+
206
+ if ($voided > 0) {
207
+ $order->setState(Mage_Sales_Model_Order::STATE_CANCELED);
208
+ $order->addStatusHistoryComment('Order declined in Kount, order voided in Magento', Mage_Sales_Model_Order::STATE_CANCELED)->save();
209
+ return true;
210
+ }
211
+
212
+ return false;
213
+ }
214
+
215
+ /**
216
+ * Refund an order
217
+ *
218
+ * @param \Mage_Sales_Model_Order $order
219
+ *
220
+ * @return bool
221
+ */
222
+ protected function _refundOrder(Mage_Sales_Model_Order $order)
223
+ {
224
+ // Otherwise we will have to process a credit memo
225
+ $refunded = 0;
226
+
227
+ /* @var $service Mage_Sales_Model_Service_Order */
228
+ $service = Mage::getModel('sales/service_order', $order);
229
+
230
+ /* @var $invoice Mage_Sales_Model_Order_Invoice */
231
+ foreach ($order->getInvoiceCollection() as $invoice) {
232
+
233
+ try {
234
+ // The invoice might not be marked as paid yet, however if the transaction has settled we have to credit memo
235
+ if ($invoice->getState() != Mage_Sales_Model_Order_Invoice::STATE_PAID) {
236
+ // "Pay" the invoice
237
+ $invoice->pay();
238
+ }
239
+
240
+ if ($invoice->canRefund()) {
241
+ // Build up a credit memo for the invoice, and capture it online
242
+ $creditmemo = $service->prepareInvoiceCreditmemo($invoice);
243
+ $creditmemo->setRefundRequested(true)
244
+ ->setOfflineRequested(false) // Process the refund online
245
+ ->register();
246
+
247
+ Mage::getModel('core/resource_transaction')
248
+ ->addObject($creditmemo)
249
+ ->addObject($creditmemo->getOrder())
250
+ ->addObject($creditmemo->getInvoice())
251
+ ->save();
252
+
253
+ ++$refunded;
254
+ }
255
+ } catch (Exception $e) {
256
+ Gene_Braintree_Model_Debug::log('Declined Kount transaction failed to be refunded in Magento: ' . $e->getMessage());
257
+ Gene_Braintree_Model_Debug::log($e);
258
+ return false;
259
+ }
260
+
261
+ }
262
+
263
+ Mage::unregister('kount_ens_update');
264
+
265
+ if ($refunded > 0) {
266
+ $order->addStatusHistoryComment('Order declined in Kount, order refunded via Credit Memo in Magento')->save();
267
+ return true;
268
+ }
269
+
270
+ return false;
271
+ }
272
+
273
+ /**
274
+ * Retrieve the Kount transaction ID from the ENS request
275
+ *
276
+ * @param $event
277
+ *
278
+ * @return null
279
+ */
280
+ protected function _getKountTransactionId($event)
281
+ {
282
+ if (isset($event['key']['_value'])) {
283
+ return $event['key']['_value'];
284
+ }
285
+
286
+ return null;
287
+ }
288
+
289
+ /**
290
+ * Retrieve the order increment ID
291
+ *
292
+ * @param $event
293
+ *
294
+ * @return mixed
295
+ */
296
+ protected function _getOrderIncrementId($event)
297
+ {
298
+ if (isset($event['key']['_attribute']['order_number'])) {
299
+ return $event['key']['_attribute']['order_number'];
300
+ }
301
+
302
+ return null;
303
+ }
304
+
305
+ /**
306
+ * Is the IP a valid ENS server?
307
+ *
308
+ * @param $ip
309
+ *
310
+ * @return bool
311
+ */
312
+ public function isValidEnsIp($ip)
313
+ {
314
+ $validIps = array('64.128.91.251', '209.81.12.251', '192.168.47.1');
315
+ return in_array($ip, $validIps);
316
+ }
317
+
318
+ /**
319
+ * Validate that the Kount merchant ID is set upon one of the stores
320
+ *
321
+ * @param $merchantId
322
+ *
323
+ * @return bool
324
+ */
325
+ public function validateStoreForMerchantId($merchantId)
326
+ {
327
+ // Build up an array of all store ID's
328
+ $storeIds = array_keys(Mage::app()->getStores());
329
+
330
+ // Add the admin store, to be checked first
331
+ array_unshift($storeIds, 0);
332
+
333
+ // Iterate through each store, check if the merchant ID matches
334
+ foreach ($storeIds as $storeId) {
335
+ $storeMerchantId = Mage::getStoreConfig('payment/gene_braintree_creditcard/kount_merchant_id', $storeId);
336
+ if (intval($storeMerchantId) == intval($merchantId)) {
337
+ return true;
338
+ }
339
+ }
340
+
341
+ return false;
342
+ }
343
+ }
app/code/community/Gene/Braintree/Model/Kount/Rest.php ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
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
+ {
10
+ const TEST_URL = 'https://api.test.kount.net/rpc/v1';
11
+ const PRODUCTION_URL = 'https://api.kount.net/rpc/v1';
12
+
13
+ /**
14
+ * Update the order status in Kount
15
+ *
16
+ * @param \Mage_Sales_Model_Order $order
17
+ * @param $status
18
+ * @param bool|false $note
19
+ *
20
+ * @return bool
21
+ * @throws \Exception
22
+ */
23
+ public function updateOrderStatus(Mage_Sales_Model_Order $order, $status, $note = false)
24
+ {
25
+ if ($note == false) {
26
+ $note = Mage::helper('gene_braintree')->__('Order status updated by Braintree from Magento.');
27
+ }
28
+
29
+ // Retrieve the transaction ID from the additional information
30
+ $transactionId = $order->getPayment()->getAdditionalInformation('kount_id');
31
+
32
+ $request = array(
33
+ 'status[' . $transactionId . ']' => $status,
34
+ 'note[' . $transactionId . ']' => $note
35
+ );
36
+
37
+ try {
38
+ $response = $this->_makeRequest('orders/status', $request);
39
+ if (isset($response['status']) && $response['status'] == 'ok') {
40
+ if (isset($response['count']['success']) && $response['count']['success'] == 1) {
41
+ $order->addStatusHistoryComment('Kount has been successfully updated to status: ' . $status . '.');
42
+ return true;
43
+ } else {
44
+ $order->addStatusHistoryComment('An issue has occured whilst trying to update the Kount order status: ' . implode(', ', $response['errors']));
45
+ }
46
+ } else {
47
+ $order->addStatusHistoryComment('Unable to update Kount order status.');
48
+ }
49
+ } catch (Exception $e) {
50
+ $order->addStatusHistoryComment('An exception was thrown whilst trying to update the Kount order status, please consult your developer to check the logs.');
51
+ }
52
+
53
+ return false;
54
+ }
55
+
56
+ /**
57
+ * Mark an order in Kount as refunded
58
+ *
59
+ * @param \Mage_Sales_Model_Order $order
60
+ *
61
+ * @return bool
62
+ */
63
+ public function updateOrderRefund(Mage_Sales_Model_Order $order)
64
+ {
65
+ // Retrieve the transaction ID from the additional information
66
+ $transactionId = $order->getPayment()->getAdditionalInformation('kount_id');
67
+
68
+ $request = array(
69
+ 'rfcb[' . $transactionId . ']' => 'R'
70
+ );
71
+
72
+ try {
73
+ $response = $this->_makeRequest('orders/rfcb', $request);
74
+ if (isset($response['status']) && $response['status'] == 'ok') {
75
+ if (isset($response['count']['success']) && $response['count']['success'] == 1) {
76
+ $order->addStatusHistoryComment('Kount has been successfully updated with the new refunded status.');
77
+ return true;
78
+ } else {
79
+ $order->addStatusHistoryComment('An issue has occurred whilst trying to update Kount with the refund status: ' . implode(', ', $response['errors']));
80
+ }
81
+ } else {
82
+ $order->addStatusHistoryComment('Unable to update Kount refund status.');
83
+ }
84
+ } catch (Exception $e) {
85
+ $order->addStatusHistoryComment('An exception was thrown whilst trying to update the Kount refund status, please consult your developer to check the logs.');
86
+ }
87
+
88
+ return false;
89
+ }
90
+
91
+ /**
92
+ * Make a request to the Kount API
93
+ *
94
+ * @param $action
95
+ * @param $payload
96
+ *
97
+ * @return bool|\Zend_Http_Response
98
+ * @throws \Exception
99
+ * @throws \Zend_Http_Client_Exception
100
+ */
101
+ protected function _makeRequest($action, $payload)
102
+ {
103
+ $url = $this->_getApiUrl($action);
104
+
105
+ $request = new Varien_Http_Client();
106
+ $request->setUri($url);
107
+
108
+ // Authenticate with the REST Api using our API key
109
+ $request->setHeaders('X-Kount-Api-Key', $this->_getApiKey());
110
+
111
+ // Set the request parameters
112
+ $request->setParameterPost($payload);
113
+
114
+ try {
115
+ $response = $request->request(Zend_Http_Client::POST);
116
+ if ($response) {
117
+ $response = Mage::helper('core')->jsonDecode($response->getBody());
118
+ if (is_array($response)) {
119
+ return $response;
120
+ }
121
+ }
122
+ } catch (Exception $e) {
123
+ Gene_Braintree_Model_Debug::log('Communication error with Kount:');
124
+ Gene_Braintree_Model_Debug::log($e);
125
+ throw $e;
126
+ }
127
+
128
+ return false;
129
+ }
130
+
131
+ /**
132
+ * Build up the API URL for a specific action
133
+ *
134
+ * @param bool|false $action
135
+ *
136
+ * @return string
137
+ */
138
+ protected function _getApiUrl($action = false)
139
+ {
140
+ // If the system isn't set assume sandbox
141
+ $url = self::TEST_URL;
142
+
143
+ if (Mage::getStoreConfig('payment/gene_braintree_creditcard/kount_environment') == Gene_Braintree_Model_Source_Environment::PRODUCTION) {
144
+ $url = self::PRODUCTION_URL;
145
+ }
146
+
147
+ if ($action !== false) {
148
+ $url .= '/' . ltrim($action, '/') . '.json';
149
+ }
150
+
151
+ return $url;
152
+ }
153
+
154
+ /**
155
+ * Return the API key
156
+ *
157
+ * @return mixed
158
+ */
159
+ protected function _getApiKey()
160
+ {
161
+ return Mage::getStoreConfig('payment/gene_braintree_creditcard/kount_api_key');
162
+ }
163
+ }
app/code/community/Gene/Braintree/Model/Migration.php ADDED
@@ -0,0 +1,359 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
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
+ {
10
+ /**
11
+ * Should we run the configuration migration?
12
+ *
13
+ * @param $bool
14
+ *
15
+ * @return \Varien_Object
16
+ */
17
+ public function setRunConfiguration($bool)
18
+ {
19
+ return $this->setData('run_configuration', $bool);
20
+ }
21
+
22
+ /**
23
+ * Should we run the customer data migration?
24
+ *
25
+ * @param $bool
26
+ *
27
+ * @return \Varien_Object
28
+ */
29
+ public function setRunCustomerData($bool)
30
+ {
31
+ return $this->setData('run_customer_data', $bool);
32
+ }
33
+
34
+ /**
35
+ * Should we disable the legacy module?
36
+ *
37
+ * @param $bool
38
+ * @param $deleteLegacy bool
39
+ *
40
+ * @return \Varien_Object
41
+ */
42
+ public function setDisableLegacy($bool, $deleteLegacy = false)
43
+ {
44
+ $this->setData('disable_legacy', $bool);
45
+ $this->setData('delete_legacy', $deleteLegacy);
46
+ }
47
+
48
+ /**
49
+ * Process the migration, building up a results object
50
+ *
51
+ * @return \Varien_Object
52
+ */
53
+ public function process()
54
+ {
55
+ $result = new Varien_Object();
56
+
57
+ if ($this->getData('run_configuration')) {
58
+ $result->setConfiguration($this->_runConfiguration());
59
+ }
60
+
61
+ if ($this->getData('run_customer_data')) {
62
+ $result->setCustomerData($this->_runCustomerData());
63
+ }
64
+
65
+ if ($this->getData('disable_legacy')) {
66
+ if ($this->getData('delete_legacy')) {
67
+ $result->setDeleteLegacy($this->_deleteLegacy());
68
+ } else {
69
+ $result->setDisableLegacy($this->_disableLegacy());
70
+ }
71
+ }
72
+
73
+ // Update the configuration to log that the migration is complete
74
+ $config = Mage::getConfig();
75
+ $config->saveConfig(Gene_Braintree_Helper_Data::MIGRATION_COMPLETE, 1);
76
+ $config->cleanCache();
77
+
78
+ return $result;
79
+ }
80
+
81
+ /**
82
+ * Migrate the configuration from the older module
83
+ *
84
+ * @return bool
85
+ */
86
+ protected function _runConfiguration()
87
+ {
88
+ // The mapping from the Braintree_Payments configuration into the Gene_Braintree configuration
89
+ $configurationMapping = array(
90
+ 'environment' => 'gene_braintree/environment'
91
+ );
92
+
93
+ // Sandbox details go into their own fields
94
+ if (Mage::getStoreConfig('payment/braintree/environment') == Braintree_Payments_Model_Source_Environment::ENVIRONMENT_SANDBOX) {
95
+ $configurationMapping = array_merge($configurationMapping, array(
96
+ 'merchant_id' => 'gene_braintree/sandbox_merchant_id',
97
+ 'merchant_account_id' => 'gene_braintree/sandbox_merchant_account_id',
98
+ 'public_key' => 'gene_braintree/sandbox_public_key',
99
+ 'private_key' => 'gene_braintree/sandbox_private_key'
100
+ ));
101
+ } else {
102
+ $configurationMapping = array_merge($configurationMapping, array(
103
+ 'merchant_id' => 'gene_braintree/merchant_id',
104
+ 'merchant_account_id' => 'gene_braintree/merchant_account_id',
105
+ 'public_key' => 'gene_braintree/public_key',
106
+ 'private_key' => 'gene_braintree/private_key'
107
+ ));
108
+ }
109
+
110
+ $configurationMapping = array_merge($configurationMapping, array(
111
+ /* PayPal */
112
+ 'paypal_active' => 'gene_braintree_paypal/active',
113
+ 'paypal_title' => 'gene_braintree_paypal/title',
114
+ 'paypal_sort_order' => 'gene_braintree_paypal/sort_order',
115
+ 'paypal_payment_action' => 'gene_braintree_paypal/payment_action',
116
+ 'paypal_order_status' => 'gene_braintree_paypal/order_status',
117
+ 'paypal_allowspecific' => 'gene_braintree_paypal/allowspecific',
118
+ 'paypal_specificcountry' => 'gene_braintree_paypal/specificcountry',
119
+ 'shortcut_shopping_cart' => 'gene_braintree_paypal/express_cart',
120
+
121
+ /* Credit Card */
122
+ 'active' => 'gene_braintree_creditcard/active',
123
+ 'title' => 'gene_braintree_creditcard/title',
124
+ 'sort_order' => 'gene_braintree_creditcard/sort_order',
125
+ 'payment_action' => 'gene_braintree_creditcard/payment_action',
126
+ 'capture_action' => 'gene_braintree_creditcard/capture_action',
127
+ 'order_status' => 'gene_braintree_creditcard/order_status',
128
+ 'use_vault' => 'gene_braintree_creditcard/use_vault',
129
+ 'useccv' => 'gene_braintree_creditcard/useccv',
130
+ 'cctypes' => 'gene_braintree_creditcard/cctypes',
131
+ 'three_d_secure' => 'gene_braintree_creditcard/threedsecure',
132
+ 'kount_id' => 'gene_braintree_creditcard/kount_merchant_id',
133
+ 'kount_environment' => 'gene_braintree_creditcard/kount_environment',
134
+ 'allowspecific' => 'gene_braintree_creditcard/allowspecific',
135
+ 'specificcountry' => 'gene_braintree_creditcard/specificcountry'
136
+ ));
137
+
138
+ /* @var $resource Mage_Core_Model_Resource */
139
+ $resource = Mage::getModel('core/resource');
140
+ $dbRead = $resource->getConnection('core_read');
141
+
142
+ // Retrieve the entire config
143
+ $config = Mage::getConfig();
144
+ $config->cleanCache();
145
+
146
+ // Retrieve all of the store ID's including the default
147
+ $stores = Mage::getResourceModel('core/store_collection');
148
+
149
+ /* @var $store Mage_Core_Model_Store */
150
+ foreach ($stores as $store) {
151
+
152
+ // Iterate through each field within a store updating it on the store view if it exists
153
+ foreach ($configurationMapping as $legacyKey => $newKey)
154
+ {
155
+ // Convert the aliases into the full paths
156
+ $legacyKey = 'payment/braintree/' . $legacyKey;
157
+ $newKey = 'payment/' . $newKey;
158
+
159
+ // Attempt to load the config directly on the store
160
+ $readConfigData = $dbRead->select()
161
+ ->from($resource->getTableName('core/config_data'), 'value')
162
+ ->where('scope = ?', 'stores')
163
+ ->where('scope_id = ?', $store->getId())
164
+ ->where('path = ?', $legacyKey);
165
+
166
+ $value = $dbRead->fetchOne($readConfigData);
167
+
168
+ // If the data loads, we know this is set specifically on a store view
169
+ if ($value !== false) {
170
+ $config->saveConfig($newKey, $store->getConfig($legacyKey), 'stores', $store->getId());
171
+ }
172
+ }
173
+ }
174
+
175
+ // Retrieve all of the website ID's
176
+ $websites = Mage::getResourceModel('core/website_collection');
177
+
178
+ /* @var $website Mage_Core_Model_Website */
179
+ foreach ($websites as $website) {
180
+
181
+ // Iterate through each field within a store updating it on the store view if it exists
182
+ foreach ($configurationMapping as $legacyKey => $newKey)
183
+ {
184
+ // Convert the aliases into the full paths
185
+ $legacyKey = 'payment/braintree/' . $legacyKey;
186
+ $newKey = 'payment/' . $newKey;
187
+
188
+ // Attempt to load the config directly on the store
189
+ $readConfigData = $dbRead->select()
190
+ ->from($resource->getTableName('core/config_data'), 'value')
191
+ ->where('scope = ?', 'websites')
192
+ ->where('scope_id = ?', $website->getId())
193
+ ->where('path = ?', $legacyKey);
194
+
195
+ $value = $dbRead->fetchOne($readConfigData);
196
+
197
+ // If the data loads, we know this is set specifically on a store view
198
+ if ($value !== false) {
199
+ $config->saveConfig($newKey, $website->getConfig($legacyKey), 'websites', $website->getId());
200
+ }
201
+ }
202
+ }
203
+
204
+ // Finally update the default configuration data
205
+ foreach ($configurationMapping as $legacyKey => $newKey)
206
+ {
207
+ // Convert the aliases into the full paths
208
+ $legacyKey = 'payment/braintree/' . $legacyKey;
209
+ $newKey = 'payment/' . $newKey;
210
+
211
+ if ($value = Mage::getStoreConfig($legacyKey, 0)) {
212
+ $config->saveConfig($newKey, $value, 'default', 0);
213
+ }
214
+ }
215
+
216
+ // Clean the cache
217
+ $config->cleanCache();
218
+
219
+ return true;
220
+ }
221
+
222
+ /**
223
+ * Update customer accounts attribute braintree_customer_id with an MD5 of customer data, as per the Braintree_Payments
224
+ * module
225
+ *
226
+ * @return int
227
+ */
228
+ protected function _runCustomerData()
229
+ {
230
+ // Retrieve all of the customers
231
+ /* @var $customers Mage_Customer_Model_Resource_Customer_Collection */
232
+ $customers = Mage::getResourceModel('customer/customer_collection');
233
+ $entityTypeId = $customers->getEntity()->getEntityType()->getId();
234
+
235
+ // Grab the braintree_customer_id attribute
236
+ $attribute = $customers->getAttribute('braintree_customer_id');
237
+ if ($attribute->getId()) {
238
+ $updatedCount = 0;
239
+ $tableUpdates = array();
240
+ foreach ($customers as $customer)
241
+ {
242
+ if (!$customer->getData('braintree_customer_id')) {
243
+ $tableUpdates[] = array(
244
+ 'entity_type_id' => $entityTypeId,
245
+ 'attribute_id' => $attribute->getId(),
246
+ 'entity_id' => $customer->getId(),
247
+ 'value' => md5($customer->getId() . '-' . $customer->getEmail())
248
+ );
249
+ ++$updatedCount;
250
+ }
251
+ }
252
+
253
+ // Retrieve the table we need to update
254
+ $updateTable = $customers->getTable('customer_entity_' . $attribute->getBackendType());
255
+
256
+ $resource = Mage::getModel('core/resource');
257
+ /* @var $dbWrite Magento_Db_Adapter_Pdo_Mysql */
258
+ $dbWrite = $resource->getConnection('core_write');
259
+
260
+ // Insert the new rows into the database
261
+ $dbWrite->insertOnDuplicate($updateTable, $tableUpdates);
262
+
263
+ return $updatedCount;
264
+ }
265
+
266
+ return false;
267
+ }
268
+
269
+ /**
270
+ * Delete the legacy module from the merchants store
271
+ *
272
+ * @return bool
273
+ */
274
+ protected function _deleteLegacy()
275
+ {
276
+ // The legacy files that need to be removed
277
+ $legacyFiles = array(
278
+ 'app/code/local/Braintree/',
279
+ 'app/design/adminhtml/default/default/layout/braintree.xml',
280
+ 'app/design/adminhtml/default/default/template/braintree/',
281
+ 'app/design/frontend/base/default/layout/braintree.xml',
282
+ 'app/design/frontend/base/default/template/braintree/',
283
+ 'app/etc/modules/Braintree_Payments.xml',
284
+ 'app/locale/en_US/Braintree_Payments.csv',
285
+ 'js/braintree/',
286
+ 'lib/Braintree/',
287
+ 'lib/Braintree.php',
288
+ 'lib/ssl/',
289
+ 'shell/braintreeIds.php',
290
+ 'skin/frontend/base/default/braintree/',
291
+ 'var/package/Braintree_Payments-2.0.0.xml'
292
+ );
293
+
294
+ // If we know the document root, we can remove these files
295
+ if (isset($_SERVER['DOCUMENT_ROOT'])) {
296
+
297
+ // Iterate through removing the directories, and unlinking the files
298
+ foreach ($legacyFiles as $legacyFile)
299
+ {
300
+ $file = $_SERVER['DOCUMENT_ROOT'] . DS . $legacyFile;
301
+ if (is_dir($file)) {
302
+ $this->_rmDir($file);
303
+ } else if (is_file($file)) {
304
+ @unlink($file);
305
+ }
306
+ }
307
+ }
308
+
309
+ $resource = Mage::getModel('core/resource');
310
+ /* @var $dbWrite Magento_Db_Adapter_Pdo_Mysql */
311
+ $dbWrite = $resource->getConnection('core_write');
312
+
313
+ // Delete the system configuration values
314
+ $dbWrite->delete($resource->getTableName('core/config_data'), 'path LIKE "payment/braintree/%" OR path LIKE "payment/braintree_paypal/%"');
315
+
316
+ return true;
317
+ }
318
+
319
+ /**
320
+ * Remove a directory recursively
321
+ *
322
+ * @param $dir
323
+ */
324
+ protected function _rmDir($dir)
325
+ {
326
+ foreach (glob($dir . '/' . '*') as $file) {
327
+ if (is_dir($file)) {
328
+ $this->_rmDir($file);
329
+ } else {
330
+ @unlink($file);
331
+ }
332
+ }
333
+ @rmdir($dir);
334
+ }
335
+
336
+ /**
337
+ * Disable the legacy modules
338
+ *
339
+ * @return bool
340
+ * @throws \Zend_Db_Adapter_Exception
341
+ */
342
+ protected function _disableLegacy()
343
+ {
344
+ $resource = Mage::getModel('core/resource');
345
+ /* @var $dbWrite Magento_Db_Adapter_Pdo_Mysql */
346
+ $dbWrite = $resource->getConnection('core_write');
347
+
348
+ // Update all the paths to be disabled
349
+ $dbWrite->update(
350
+ $resource->getTableName('core/config_data'),
351
+ array('value' => 0),
352
+ 'path = "payment/braintree/paypal_active" OR path = "payment/braintree/active" OR path = "payment/braintree_paypal/active"'
353
+ );
354
+
355
+ Mage::getConfig()->cleanCache();
356
+
357
+ return true;
358
+ }
359
+ }
app/code/community/Gene/Braintree/Model/Observer.php CHANGED
@@ -106,10 +106,10 @@ class Gene_Braintree_Model_Observer
106
  $order = $shipment->getOrder();
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();
@@ -140,6 +140,30 @@ class Gene_Braintree_Model_Observer
140
  return $this;
141
  }
142
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  /**
144
  * Should we capture the payment?
145
  *
@@ -147,7 +171,7 @@ class Gene_Braintree_Model_Observer
147
  *
148
  * @return bool
149
  */
150
- private function shouldCaptureShipment($order)
151
  {
152
  // Check the store configuration settings are set to capture shipment
153
  if(Mage::getStoreConfig(Gene_Braintree_Model_Source_Creditcard_PaymentAction::PAYMENT_ACTION_XML_PATH, $order->getStoreId()) == Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE
@@ -173,17 +197,63 @@ class Gene_Braintree_Model_Observer
173
 
174
  // Verify the SSL folder exists
175
  if(!is_dir($compilerPath . '/..' . $directory)) {
176
- mkdir($compilerPath . '/..' . $directory);
177
  }
178
 
179
  // Loop through each certificate and check whether it's in the includes directory, if not copy it!
180
  foreach($certificates as $file) {
181
  if(!file_exists($compilerPath . '/..' . $directory . $file)) {
182
- copy(Mage::getBaseDir('lib') . $directory . $file, $compilerPath . '/..' . $directory . $file);
183
  }
184
  }
185
  }
186
 
187
  return $this;
188
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
189
  }
106
  $order = $shipment->getOrder();
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();
140
  return $this;
141
  }
142
 
143
+ /**
144
+ * Add in the saved block
145
+ *
146
+ * @param \Varien_Event_Observer $observer
147
+ */
148
+ public function addSavedChild(Varien_Event_Observer $observer)
149
+ {
150
+ $block = $observer->getEvent()->getBlock();
151
+
152
+ // Add the child block of saved to the credit card form
153
+ if ($block instanceof Gene_Braintree_Block_Creditcard) {
154
+ $saved = $block->getLayout()->createBlock('gene_braintree/creditcard_saved');
155
+ $saved->setMethod($block->getMethod());
156
+ $block->setChild('saved', $saved);
157
+ }
158
+
159
+ // Add the child block of saved to the PayPal payment method form
160
+ if ($block instanceof Gene_Braintree_Block_Paypal) {
161
+ $saved = $block->getLayout()->createBlock('gene_braintree/paypal_saved');
162
+ $saved->setMethod($block->getMethod());
163
+ $block->setChild('saved', $saved);
164
+ }
165
+ }
166
+
167
  /**
168
  * Should we capture the payment?
169
  *
171
  *
172
  * @return bool
173
  */
174
+ protected function _shouldCaptureShipment($order)
175
  {
176
  // Check the store configuration settings are set to capture shipment
177
  if(Mage::getStoreConfig(Gene_Braintree_Model_Source_Creditcard_PaymentAction::PAYMENT_ACTION_XML_PATH, $order->getStoreId()) == Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE
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
  }
210
 
211
  return $this;
212
  }
213
+
214
+ /**
215
+ * Unregister the original token from the request
216
+ *
217
+ * @return $this
218
+ */
219
+ public function resetMultishipping()
220
+ {
221
+ Mage::unregister(Gene_Braintree_Model_Paymentmethod_Abstract::BRAINTREE_ORIGINAL_TOKEN);
222
+
223
+ return $this;
224
+ }
225
+
226
+ /**
227
+ * Handle multi shipping orders
228
+ *
229
+ * @param \Varien_Event_Observer $observer
230
+ *
231
+ * @return $this
232
+ */
233
+ public function handleMultishipping(Varien_Event_Observer $observer)
234
+ {
235
+ /* @var $order Mage_Sales_Model_Order */
236
+ $order = $observer->getEvent()->getOrder();
237
+
238
+ // Let the payment method know the transaction is a multi shipping transaction
239
+ // Braintree don't allow multiple transactions from one authorization, however they do allow the vaulting
240
+ // of the initial transaction, then using the token from that transaction to take repeat payments.
241
+ // Due to this the payment method needs to be aware if it's expecting to take multiple transactions from one
242
+ // authorization.
243
+ $order->getPayment()->setMultiShipping(true);
244
+
245
+ return $this;
246
+ }
247
+
248
+ /**
249
+ * Add the include path to the Gene/Braintree library folder
250
+ *
251
+ * @return $this
252
+ */
253
+ public function addIncludePath()
254
+ {
255
+ set_include_path(BP . DS . 'lib' . DS . 'Gene' . PS . get_include_path());
256
+
257
+ return $this;
258
+ }
259
  }
app/code/community/Gene/Braintree/Model/Paymentmethod/Abstract.php CHANGED
@@ -13,6 +13,8 @@ abstract class Gene_Braintree_Model_Paymentmethod_Abstract extends Mage_Payment_
13
  const ADVANCED_FRAUD_REVIEW = 'Review';
14
  const ADVANCED_FRAUD_DECLINE = 'Decline';
15
 
 
 
16
  /**
17
  * Verify that the module has been setup
18
  *
@@ -78,18 +80,27 @@ abstract class Gene_Braintree_Model_Paymentmethod_Abstract extends Mage_Payment_
78
  protected function handleFraud($result, Varien_Object $payment)
79
  {
80
  // Verify we have risk data
81
- if(isset($result->transaction) && isset($result->transaction->riskData) && isset($result->transaction->riskData->decision)) {
 
 
 
 
 
 
 
 
82
 
83
  // If the decision is to review the payment mark the payment as such
84
- if($result->transaction->riskData->decision == self::ADVANCED_FRAUD_REVIEW || $result->transaction->riskData->decision == self::ADVANCED_FRAUD_DECLINE) {
85
 
86
  // Mark the payment as pending
87
  $payment->setIsTransactionPending(true);
88
 
89
  // If the payment got marked as fraud/decline, we mark it as fraud
90
- if($result->transaction->riskData->decision == self::ADVANCED_FRAUD_DECLINE) {
91
  $payment->setIsFraudDetected(true);
92
  }
 
93
  }
94
  }
95
 
@@ -147,13 +158,16 @@ abstract class Gene_Braintree_Model_Paymentmethod_Abstract extends Mage_Payment_
147
  // Pass over the transaction ID
148
  $payment->getCreditmemo()->setRefundTransactionId($result->transaction->id);
149
 
150
- // Only close the transaction once the
151
  if($transaction->amount == $refundAmount) {
152
 
153
  $payment->setIsTransactionClosed(1);
154
 
155
  // Mark the invoice as canceled if the invoice was completely refunded
156
  $invoice->setState(Mage_Sales_Model_Order_Invoice::STATE_CANCELED);
 
 
 
157
  }
158
 
159
  } else {
@@ -184,4 +198,242 @@ abstract class Gene_Braintree_Model_Paymentmethod_Abstract extends Mage_Payment_
184
  $creditmemo->setTransactionId($creditmemo->getRefundTransactionId());
185
  return $this;
186
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
  }
13
  const ADVANCED_FRAUD_REVIEW = 'Review';
14
  const ADVANCED_FRAUD_DECLINE = 'Decline';
15
 
16
+ const BRAINTREE_ORIGINAL_TOKEN = 'gene_braintree_original_token';
17
+
18
  /**
19
  * Verify that the module has been setup
20
  *
80
  protected function handleFraud($result, Varien_Object $payment)
81
  {
82
  // Verify we have risk data
83
+ if (isset($result->transaction) && isset($result->transaction->riskData) && isset($result->transaction->riskData->decision)) {
84
+
85
+ // If the merchant has specified the merchant and website ID we can update the payments status
86
+ if (Mage::helper('gene_braintree')->canUpdateKount() && isset($result->transaction->riskData->id)) {
87
+
88
+ // Update the payment with the require information
89
+ $payment->setAdditionalInformation('kount_id', $result->transaction->riskData->id);
90
+ $payment->save();
91
+ }
92
 
93
  // If the decision is to review the payment mark the payment as such
94
+ if ($result->transaction->riskData->decision == self::ADVANCED_FRAUD_REVIEW || $result->transaction->riskData->decision == self::ADVANCED_FRAUD_DECLINE) {
95
 
96
  // Mark the payment as pending
97
  $payment->setIsTransactionPending(true);
98
 
99
  // If the payment got marked as fraud/decline, we mark it as fraud
100
+ if ($result->transaction->riskData->decision == self::ADVANCED_FRAUD_DECLINE) {
101
  $payment->setIsFraudDetected(true);
102
  }
103
+
104
  }
105
  }
106
 
158
  // Pass over the transaction ID
159
  $payment->getCreditmemo()->setRefundTransactionId($result->transaction->id);
160
 
161
+ // Only close the transaction once the transaction amount meets the refund amount
162
  if($transaction->amount == $refundAmount) {
163
 
164
  $payment->setIsTransactionClosed(1);
165
 
166
  // Mark the invoice as canceled if the invoice was completely refunded
167
  $invoice->setState(Mage_Sales_Model_Order_Invoice::STATE_CANCELED);
168
+
169
+ // Only update Kount to say the transaction is refunded if the whole transaction is refunded
170
+ $this->_updateKountRefund($payment);
171
  }
172
 
173
  } else {
198
  $creditmemo->setTransactionId($creditmemo->getRefundTransactionId());
199
  return $this;
200
  }
201
+
202
+ /**
203
+ * Capture the payment on the checkout page
204
+ *
205
+ * @param Varien_Object $payment
206
+ * @param float $amount
207
+ *
208
+ * @return Mage_Payment_Model_Abstract
209
+ */
210
+ protected function _captureAuthorized(Varien_Object $payment, $amount)
211
+ {
212
+ // Has the payment already been authorized?
213
+ if ($payment->getCcTransId()) {
214
+
215
+ // Convert the capture amount to the correct currency
216
+ $captureAmount = $this->_getWrapper()->getCaptureAmount($payment->getOrder(), $amount);
217
+
218
+ // Check to see if the transaction has already been captured
219
+ $lastTransactionId = $payment->getLastTransId();
220
+ if ($lastTransactionId) {
221
+ try {
222
+ $this->_getWrapper()->init($payment->getOrder()->getStoreId());
223
+ $transaction = Braintree_Transaction::find($lastTransactionId);
224
+
225
+ // Has the transaction already been settled? or submitted for the settlement?
226
+ if (isset($transaction->id) && ($transaction->status == Braintree_Transaction::SUBMITTED_FOR_SETTLEMENT || $transaction->status == Braintree_Transaction::SETTLED)) {
227
+ // Do the capture amounts match?
228
+ if ($captureAmount == $transaction->amount) {
229
+ // We can just approve the invoice
230
+ $this->_updateKountStatus($payment, 'A');
231
+ $payment->setStatus(self::STATUS_APPROVED);
232
+ return $this;
233
+ }
234
+ }
235
+ } catch (Exception $e) {
236
+ // Unable to load transaction, so process as below
237
+ }
238
+ }
239
+
240
+ // Has the authorization already been settled? Partial invoicing
241
+ if ($this->authorizationUsed($payment)) {
242
+
243
+ // Set the token as false
244
+ $token = false;
245
+
246
+ // Was the original payment created with a token?
247
+ if($additionalInfoToken = $payment->getAdditionalInformation('token')) {
248
+
249
+ try {
250
+ // Init the environment
251
+ $this->_getWrapper()->init($payment->getOrder()->getStoreId());
252
+
253
+ // Attempt to find the token
254
+ Braintree_PaymentMethod::find($additionalInfoToken);
255
+
256
+ // Set the token if a success
257
+ $token = $additionalInfoToken;
258
+
259
+ } catch (Exception $e) {
260
+ $token = false;
261
+ }
262
+
263
+ }
264
+
265
+ // If we managed to find a token use that for the capture
266
+ if ($token) {
267
+
268
+ // Stop processing the rest of the method
269
+ // We pass $amount instead of $captureAmount as the authorize function contains the conversion
270
+ $this->_authorize($payment, $amount, true, $token);
271
+ return $this;
272
+
273
+ } else {
274
+
275
+ // Attempt to clone the transaction
276
+ $result = $this->_getWrapper()->init($payment->getOrder()->getStoreId())->cloneTransaction($lastTransactionId, $captureAmount);
277
+ }
278
+
279
+ } else {
280
+
281
+ // Init the environment
282
+ $result = $this->_getWrapper()->init($payment->getOrder()->getStoreId())->submitForSettlement($payment->getCcTransId(), $captureAmount);
283
+
284
+ // Log the result
285
+ Gene_Braintree_Model_Debug::log(array('capture:submitForSettlement' => $result));
286
+ }
287
+
288
+ if($result->success) {
289
+ $this->_updateKountStatus($payment, 'A');
290
+ $this->_processSuccessResult($payment, $result, $amount);
291
+ } else if($result->errors->deepSize() > 0) {
292
+
293
+ // Clean up
294
+ Gene_Braintree_Model_Wrapper_Braintree::cleanUp();
295
+
296
+ Mage::throwException($this->_getWrapper()->parseErrors($result->errors->deepAll()));
297
+ } else {
298
+
299
+ // Clean up
300
+ Gene_Braintree_Model_Wrapper_Braintree::cleanUp();
301
+
302
+ Mage::throwException($result->transaction->processorSettlementResponseCode.': '.$result->transaction->processorSettlementResponseText);
303
+ }
304
+
305
+ } else {
306
+ // Otherwise we need to do an auth & capture at once
307
+ $this->_authorize($payment, $amount, true);
308
+ }
309
+
310
+ return $this;
311
+ }
312
+
313
+ /**
314
+ * If we're doing authorize, has the payment already got more than one transaction?
315
+ *
316
+ * @param \Varien_Object $payment
317
+ *
318
+ * @return int
319
+ */
320
+ public function authorizationUsed(Varien_Object $payment)
321
+ {
322
+ $collection = Mage::getModel('sales/order_payment_transaction')
323
+ ->getCollection()
324
+ ->addFieldToFilter('payment_id', $payment->getId())
325
+ ->addFieldToFilter('txn_type', Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE);
326
+
327
+ return $collection->getSize();
328
+ }
329
+
330
+ /**
331
+ * Update the order status within Kount
332
+ *
333
+ * @param \Varien_Object $payment
334
+ * @param string $status
335
+ *
336
+ * @return $this
337
+ */
338
+ protected function _updateKountStatus(Varien_Object $payment, $status = 'A')
339
+ {
340
+ if (Mage::helper('gene_braintree')->canUpdateKount() && ($kountId = $payment->getAdditionalInformation('kount_id'))) {
341
+ $kountRest = Mage::getModel('gene_braintree/kount_rest');
342
+ $kountRest->updateOrderStatus($payment->getOrder(), $status);
343
+ }
344
+
345
+ return $this;
346
+ }
347
+
348
+ /**
349
+ * Update Kount when an order is refunded
350
+ *
351
+ * @param \Varien_Object $payment
352
+ *
353
+ * @return $this
354
+ */
355
+ protected function _updateKountRefund(Varien_Object $payment)
356
+ {
357
+ if (Mage::helper('gene_braintree')->canUpdateKount() && ($kountId = $payment->getAdditionalInformation('kount_id'))) {
358
+ $kountRest = Mage::getModel('gene_braintree/kount_rest');
359
+ $kountRest->updateOrderRefund($payment->getOrder());
360
+ }
361
+
362
+ return $this;
363
+ }
364
+
365
+ /**
366
+ * Dispatch the event for the sale array
367
+ *
368
+ * @param $event
369
+ * @param $saleArray
370
+ * @param $payment
371
+ *
372
+ * @return mixed
373
+ */
374
+ protected function _dispatchSaleArrayEvent($event, $saleArray, $payment)
375
+ {
376
+ // Pass the sale array into a varien object
377
+ $request = new Varien_Object();
378
+ $request->setData('sale_array', $saleArray);
379
+
380
+ // Dispatch event for modifying the sale array
381
+ Mage::dispatchEvent($event, array('payment' => $payment, 'request' => $request));
382
+
383
+ // Pull the saleArray back out
384
+ $saleArray = $request->getData('sale_array');
385
+
386
+ // Log the initial sale array, no protected data is included
387
+ Gene_Braintree_Model_Debug::log(array('_authorize:saleArray' => $saleArray));
388
+
389
+ return $saleArray;
390
+ }
391
+
392
+ /**
393
+ * Process a failed payment
394
+ *
395
+ * @param $message
396
+ * @param bool|false $log
397
+ * @param bool|false $result
398
+ *
399
+ * @return $this
400
+ * @throws \Mage_Core_Exception
401
+ */
402
+ protected function _processFailedResult($message, $log = false, $result = false)
403
+ {
404
+ // Clean up from any other operations that have occured
405
+ Gene_Braintree_Model_Wrapper_Braintree::cleanUp();
406
+
407
+ if ($log !== false) {
408
+ Gene_Braintree_Model_Debug::log($log);
409
+ }
410
+
411
+ Mage::throwException($message);
412
+
413
+ return $this;
414
+ }
415
+
416
+ /**
417
+ * Return the token generated from the initial transaction
418
+ *
419
+ * @return mixed
420
+ */
421
+ protected function _getOriginalToken()
422
+ {
423
+ return Mage::registry(self::BRAINTREE_ORIGINAL_TOKEN);
424
+ }
425
+
426
+ /**
427
+ * Set the original token
428
+ *
429
+ * @param $token
430
+ *
431
+ * @return $this
432
+ */
433
+ protected function _setOriginalToken($token)
434
+ {
435
+ Mage::register(self::BRAINTREE_ORIGINAL_TOKEN, $token);
436
+
437
+ return $this;
438
+ }
439
  }
app/code/community/Gene/Braintree/Model/Paymentmethod/Creditcard.php CHANGED
@@ -37,7 +37,7 @@ class Gene_Braintree_Model_Paymentmethod_Creditcard extends Gene_Braintree_Model
37
  protected $_canVoid = true;
38
  protected $_canUseInternal = true;
39
  protected $_canUseCheckout = true;
40
- protected $_canUseForMultishipping = false;
41
  protected $_isInitializeNeeded = false;
42
  protected $_canFetchTransactionInfo = false;
43
  protected $_canReviewPayment = false;
@@ -64,6 +64,7 @@ class Gene_Braintree_Model_Paymentmethod_Creditcard extends Gene_Braintree_Model
64
  return $this;
65
  }
66
 
 
67
  /**
68
  * Determine whether or not the vault is enabled, can be modified by numerous events
69
  *
@@ -131,11 +132,22 @@ class Gene_Braintree_Model_Paymentmethod_Creditcard extends Gene_Braintree_Model
131
  * Should we save this method in the database?
132
  *
133
  * @param \Varien_Object $payment
 
134
  *
135
  * @return mixed
136
  */
137
- public function shouldSaveMethod($payment)
138
  {
 
 
 
 
 
 
 
 
 
 
139
  // Retrieve whether or not we should save the card from the info instance
140
  $saveCard = $this->getInfoInstance()->getAdditionalInformation('save_card');
141
 
@@ -221,123 +233,50 @@ class Gene_Braintree_Model_Paymentmethod_Creditcard extends Gene_Braintree_Model
221
  // Init the environment
222
  $this->_getWrapper()->init();
223
 
 
 
 
224
  // Attempt to create the sale
225
  try {
226
 
227
- // Check to see whether we're using a payment method token?
228
- if($this->getPaymentMethodToken() && !in_array($this->getPaymentMethodToken(), array('other', 'threedsecure'))) {
229
-
230
- // Build our payment array
231
- $paymentArray = array(
232
- 'paymentMethodToken' => $this->getPaymentMethodToken(),
233
- );
234
-
235
- unset($paymentArray['cvv']);
236
-
237
- } else {
238
-
239
- // Build our payment array with a nonce
240
- $paymentArray = array(
241
- 'paymentMethodNonce' => $this->getPaymentMethodNonce()
242
- );
243
-
244
- }
245
-
246
- // The 3D secure variable
247
- $threeDSecure = $this->is3DEnabled();
248
-
249
- // If the user is using a stored card with 3D secure, enable it in the request and remove CVV
250
- if ($this->getPaymentMethodToken() && $this->getPaymentMethodToken() == 'threedsecure') {
251
-
252
- // If we're using 3D secure token card don't send CVV
253
- unset($paymentArray['cvv']);
254
-
255
- // Force 3D secure on
256
- $threeDSecure = true;
257
-
258
- } elseif ($this->getPaymentMethodToken() && $this->getPaymentMethodToken() != 'other') {
259
-
260
- // Force 3D secure off
261
- $threeDSecure = false;
262
- }
263
-
264
- // If a token is present in the request use that
265
- if($token) {
266
-
267
- // Remove this unneeded data
268
- unset($paymentArray['paymentMethodNonce'], $paymentArray['cvv']);
269
-
270
- // Send the token as the payment array
271
- $paymentArray['paymentMethodToken'] = $token;
272
- }
273
-
274
- // Retrieve the amount we should capture
275
- $amount = $this->_getWrapper()->getCaptureAmount($payment->getOrder(), $amount);
276
-
277
  // Build up the sale array
278
  $saleArray = $this->_getWrapper()->buildSale(
279
  $amount,
280
- $paymentArray,
281
  $payment->getOrder(),
282
  $shouldCapture,
283
  $this->getInfoInstance()->getAdditionalInformation('device_data'),
284
  $this->shouldSaveMethod($payment),
285
- $threeDSecure
286
  );
287
 
288
- // Pass the sale array into a varien object
289
- $request = new Varien_Object();
290
- $request->setData('sale_array', $saleArray);
291
-
292
- // Dispatch event for modifying the sale array
293
- Mage::dispatchEvent('gene_braintree_creditcard_sale_array', array('payment' => $payment, 'request' => $request));
294
-
295
- // Pull the saleArray back out
296
- $saleArray = $request->getData('sale_array');
297
-
298
- // Log the initial sale array, no protected data is included
299
- Gene_Braintree_Model_Debug::log(array('_authorize:saleArray' => $saleArray));
300
-
301
  // Attempt to create the sale
302
  $result = $this->_getWrapper()->makeSale(
303
- $saleArray
304
  );
305
 
306
  } catch (Exception $e) {
307
 
308
- // Dispatch an event for when a payment fails
309
  Mage::dispatchEvent('gene_braintree_creditcard_failed_exception', array('payment' => $payment, 'exception' => $e));
310
 
311
- // If there's an error
312
- Gene_Braintree_Model_Debug::log($e);
313
-
314
- // Clean up
315
- Gene_Braintree_Model_Wrapper_Braintree::cleanUp();
316
 
317
- Mage::throwException(
318
- $this->_getHelper()->__('There was an issue whilst trying to process your card payment, please try again or another method.')
319
- );
320
  }
321
 
322
  // Log the initial sale array, no protected data is included
323
  Gene_Braintree_Model_Debug::log(array('_authorize:result' => $result));
324
 
325
  // If the transaction was 3Ds but doesn't contain a 3Ds response
326
- if(($this->is3DEnabled() && isset($saleArray['options']['three_d_secure']['required']) && $saleArray['options']['three_d_secure']['required'] == true) && (!isset($result->transaction->threeDSecureInfo) || (isset($result->transaction->threeDSecureInfo) && is_null($result->transaction->threeDSecureInfo)))) {
327
 
328
- // Clean up
329
- Gene_Braintree_Model_Wrapper_Braintree::cleanUp();
330
 
331
- // Inform the user that their payment didn't go through 3Ds and thus failed
332
- Mage::throwException($this->_getHelper()->__('This transaction must be passed through 3D secure, please try again or consider using an alternate payment method.'));
333
  }
334
 
335
  // If the sale has failed
336
  if ($result->success != true) {
337
 
338
- // Clean up
339
- Gene_Braintree_Model_Wrapper_Braintree::cleanUp();
340
-
341
  // Dispatch an event for when a payment fails
342
  Mage::dispatchEvent('gene_braintree_creditcard_failed', array('payment' => $payment, 'result' => $result));
343
 
@@ -347,25 +286,20 @@ class Gene_Braintree_Model_Paymentmethod_Creditcard extends Gene_Braintree_Model
347
  // Return a custom response for processor declined messages
348
  if($result->transaction->status == Braintree_Transaction::PROCESSOR_DECLINED) {
349
 
350
- Mage::throwException($this->_getHelper()->__('Your transaction has been declined, please try another payment method or contacting your issuing bank.'));
351
 
352
  } else if($result->transaction->status == Braintree_Transaction::GATEWAY_REJECTED
353
  && isset($result->transaction->gatewayRejectionReason)
354
  && $result->transaction->gatewayRejectionReason == Braintree_Transaction::THREE_D_SECURE)
355
  {
356
-
357
  // An event for when 3D secure fails
358
  Mage::dispatchEvent('gene_braintree_creditcard_failed_threed', array('payment' => $payment, 'result' => $result));
359
 
360
- // Log it
361
- Gene_Braintree_Model_Debug::log('Transaction failed with 3D secure');
362
-
363
- // Politely inform the user
364
- Mage::throwException($this->_getHelper()->__('Your card has failed 3D secure validation, please try again or consider using an alternate payment method.'));
365
  }
366
  }
367
 
368
- Mage::throwException($this->_getHelper()->__('%s. Please try again or attempt refreshing the page.', $this->_getWrapper()->parseMessage($result->message)));
369
  }
370
 
371
  $this->_processSuccessResult($payment, $result, $amount);
@@ -374,122 +308,102 @@ class Gene_Braintree_Model_Paymentmethod_Creditcard extends Gene_Braintree_Model
374
  }
375
 
376
  /**
377
- * Authorize the requested amount
378
- *
379
- * @param Varien_Object $payment
380
- * @param float $amount
381
- *
382
- * @return Mage_Payment_Model_Abstract|void
383
- * @throws Mage_Core_Exception
384
- */
385
- public function authorize(Varien_Object $payment, $amount)
386
- {
387
- $this->_authorize($payment, $amount, false);
388
- }
389
-
390
- /**
391
- * Process capturing of a payment
392
  *
393
- * @param Varien_Object $payment
394
- * @param float $amount
395
  *
396
- * @return Mage_Payment_Model_Abstract|void
397
  */
398
- public function capture(Varien_Object $payment, $amount)
399
  {
400
- // Has the payment already been authorized?
401
- if ($payment->getCcTransId()) {
402
-
403
- // Convert the capture amount to the correct currency
404
- $captureAmount = $this->_getWrapper()->getCaptureAmount($payment->getOrder(), $amount);
405
 
406
- // Has the authorization already been settled? Partial invoicing
407
- if($this->authorizationUsed($payment)) {
408
-
409
- // Set the token as false
410
- $token = false;
411
-
412
- // Was the original payment created with a token?
413
- if($additionalInfoToken = $payment->getAdditionalInformation('token')) {
414
-
415
- try {
416
- // Init the environment
417
- $this->_getWrapper()->init($payment->getOrder()->getStoreId());
418
-
419
- // Attempt to find the token
420
- Braintree_PaymentMethod::find($additionalInfoToken);
421
-
422
- // Set the token if a success
423
- $token = $additionalInfoToken;
424
-
425
- } catch (Exception $e) {
426
- $token = false;
427
- }
428
 
429
- }
 
430
 
431
- // If we managed to find a token use that for the capture
432
- if($token) {
 
433
 
434
- // Stop processing the rest of the method
435
- // We pass $amount instead of $captureAmount as the authorize function contains the conversion
436
- $this->_authorize($payment, $amount, true, $token);
437
- return $this;
438
 
439
- } else {
 
440
 
441
- // Attempt to clone the transaction
442
- $result = $this->_getWrapper()->init($payment->getOrder()->getStoreId())->cloneTransaction($payment->getLastTransId(), $captureAmount);
443
- }
444
 
445
- } else {
 
446
 
447
- // Init the environment
448
- $result = $this->_getWrapper()->init($payment->getOrder()->getStoreId())->submitForSettlement($payment->getCcTransId(), $captureAmount);
449
 
450
- // Log the result
451
- Gene_Braintree_Model_Debug::log(array('capture:submitForSettlement' => $result));
452
- }
453
 
454
- if($result->success) {
455
- $this->_processSuccessResult($payment, $result, $amount);
456
- } else if($result->errors->deepSize() > 0) {
457
 
458
- // Clean up
459
- Gene_Braintree_Model_Wrapper_Braintree::cleanUp();
460
 
461
- Mage::throwException($this->_getWrapper()->parseErrors($result->errors->deepAll()));
462
- } else {
 
463
 
464
- // Clean up
465
- Gene_Braintree_Model_Wrapper_Braintree::cleanUp();
466
 
467
- Mage::throwException($result->transaction->processorSettlementResponseCode.': '.$result->transaction->processorSettlementResponseText);
468
- }
 
 
 
 
 
 
 
 
 
469
 
470
- } else {
471
- // Otherwise we need to do an auth & capture at once
472
- $this->_authorize($payment, $amount, true);
 
473
  }
474
 
475
- return $this;
476
  }
477
 
478
  /**
479
- * If we're doing authorize, has the payment already got more than one transaction?
480
  *
481
  * @param \Varien_Object $payment
 
482
  *
483
- * @return int
484
  */
485
- public function authorizationUsed(Varien_Object $payment)
486
  {
487
- $collection = Mage::getModel('sales/order_payment_transaction')
488
- ->getCollection()
489
- ->addFieldToFilter('payment_id', $payment->getId())
490
- ->addFieldToFilter('txn_type', Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE);
491
 
492
- return $collection->getSize();
 
 
 
 
 
 
 
 
 
 
493
  }
494
 
495
  /**
@@ -511,23 +425,25 @@ class Gene_Braintree_Model_Paymentmethod_Creditcard extends Gene_Braintree_Model
511
  // Load the transaction from Braintree
512
  $transaction = Braintree_Transaction::find($transactionId);
513
 
514
- // If the transaction hasn't yet settled we can't do partial refunds
515
- if ($transaction->status !== Braintree_Transaction::AUTHORIZED || $transaction->status !== Braintree_Transaction::SUBMITTED_FOR_SETTLEMENT) {
516
- Mage::throwException($this->_getHelper()->__('You can only void authorized/submitted for settlement payments, please setup a credit memo if you wish to refund this order.'));
517
- }
518
 
519
- // Swap between refund and void
520
- $result = Braintree_Transaction::void($transactionId);
521
 
522
- // If it's a success close the transaction
523
- if ($result->success) {
524
- $payment->setIsTransactionClosed(1);
525
- } else {
526
- if($result->errors->deepSize() > 0) {
527
- Mage::throwException($this->_getWrapper()->parseErrors($result->errors->deepAll()));
528
  } else {
529
- Mage::throwException('Unknown');
 
 
 
 
530
  }
 
 
 
531
  }
532
 
533
  } catch (Exception $e) {
@@ -578,21 +494,25 @@ class Gene_Braintree_Model_Paymentmethod_Creditcard extends Gene_Braintree_Model
578
  'processorAuthorizationCode',
579
  'processorResponseCode',
580
  'processorResponseText',
581
- 'threeDSecure'
 
 
582
  );
583
 
584
  // Handle any fraud response from Braintree
585
  $this->handleFraud($result, $payment);
586
 
587
  // If 3D secure is enabled, presume it's passed
588
- if($this->is3DEnabled()) {
589
  $additionalInfo['threeDSecure'] = Mage::helper('gene_braintree')->__('Passed');
590
  }
591
 
592
  // Iterate through and pull out any data we want
593
- foreach($storeFields as $storeField) {
594
- if(!empty($result->transaction->{$storeField})) {
595
  $additionalInfo[$storeField] = $result->transaction->{$storeField};
 
 
596
  }
597
  }
598
 
@@ -603,6 +523,16 @@ class Gene_Braintree_Model_Paymentmethod_Creditcard extends Gene_Braintree_Model
603
 
604
  if (isset($result->transaction->creditCard['token']) && $result->transaction->creditCard['token']) {
605
  $payment->setAdditionalInformation('token', $result->transaction->creditCard['token']);
 
 
 
 
 
 
 
 
 
 
606
  }
607
 
608
  return $payment;
37
  protected $_canVoid = true;
38
  protected $_canUseInternal = true;
39
  protected $_canUseCheckout = true;
40
+ protected $_canUseForMultishipping = true;
41
  protected $_isInitializeNeeded = false;
42
  protected $_canFetchTransactionInfo = false;
43
  protected $_canReviewPayment = false;
64
  return $this;
65
  }
66
 
67
+
68
  /**
69
  * Determine whether or not the vault is enabled, can be modified by numerous events
70
  *
132
  * Should we save this method in the database?
133
  *
134
  * @param \Varien_Object $payment
135
+ * @param $skipMultishipping
136
  *
137
  * @return mixed
138
  */
139
+ public function shouldSaveMethod($payment, $skipMultishipping = false)
140
  {
141
+ if ($skipMultishipping === false) {
142
+ // We must always save the method for multi shipping requests
143
+ if ($payment->getMultiShipping() && !$this->_getOriginalToken()) {
144
+ return true;
145
+ } else if ($this->_getOriginalToken()) {
146
+ // If we have an original token, there is no need to save the same payment method again
147
+ return false;
148
+ }
149
+ }
150
+
151
  // Retrieve whether or not we should save the card from the info instance
152
  $saveCard = $this->getInfoInstance()->getAdditionalInformation('save_card');
153
 
233
  // Init the environment
234
  $this->_getWrapper()->init();
235
 
236
+ // Retrieve the amount we should capture
237
+ $amount = $this->_getWrapper()->getCaptureAmount($payment->getOrder(), $amount);
238
+
239
  // Attempt to create the sale
240
  try {
241
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
  // Build up the sale array
243
  $saleArray = $this->_getWrapper()->buildSale(
244
  $amount,
245
+ $this->_buildPaymentRequest($token),
246
  $payment->getOrder(),
247
  $shouldCapture,
248
  $this->getInfoInstance()->getAdditionalInformation('device_data'),
249
  $this->shouldSaveMethod($payment),
250
+ $this->_is3DEnabled()
251
  );
252
 
 
 
 
 
 
 
 
 
 
 
 
 
 
253
  // Attempt to create the sale
254
  $result = $this->_getWrapper()->makeSale(
255
+ $this->_dispatchSaleArrayEvent('gene_braintree_creditcard_sale_array', $saleArray, $payment)
256
  );
257
 
258
  } catch (Exception $e) {
259
 
260
+ // Handle an exception being thrown
261
  Mage::dispatchEvent('gene_braintree_creditcard_failed_exception', array('payment' => $payment, 'exception' => $e));
262
 
263
+ return $this->_processFailedResult($this->_getHelper()->__('There was an issue whilst trying to process your card payment, please try again or another method.'), $e);
 
 
 
 
264
 
 
 
 
265
  }
266
 
267
  // Log the initial sale array, no protected data is included
268
  Gene_Braintree_Model_Debug::log(array('_authorize:result' => $result));
269
 
270
  // If the transaction was 3Ds but doesn't contain a 3Ds response
271
+ if (($this->is3DEnabled() && isset($saleArray['options']['three_d_secure']['required']) && $saleArray['options']['three_d_secure']['required'] == true) && (!isset($result->transaction->threeDSecureInfo) || (isset($result->transaction->threeDSecureInfo) && is_null($result->transaction->threeDSecureInfo)))) {
272
 
273
+ return $this->_processFailedResult($this->_getHelper()->__('This transaction must be passed through 3D secure, please try again or consider using an alternate payment method.'), false, $result);
 
274
 
 
 
275
  }
276
 
277
  // If the sale has failed
278
  if ($result->success != true) {
279
 
 
 
 
280
  // Dispatch an event for when a payment fails
281
  Mage::dispatchEvent('gene_braintree_creditcard_failed', array('payment' => $payment, 'result' => $result));
282
 
286
  // Return a custom response for processor declined messages
287
  if($result->transaction->status == Braintree_Transaction::PROCESSOR_DECLINED) {
288
 
289
+ return $this->_processFailedResult($this->_getHelper()->__('Your transaction has been declined, please try another payment method or contacting your issuing bank.'), false, $result);
290
 
291
  } else if($result->transaction->status == Braintree_Transaction::GATEWAY_REJECTED
292
  && isset($result->transaction->gatewayRejectionReason)
293
  && $result->transaction->gatewayRejectionReason == Braintree_Transaction::THREE_D_SECURE)
294
  {
 
295
  // An event for when 3D secure fails
296
  Mage::dispatchEvent('gene_braintree_creditcard_failed_threed', array('payment' => $payment, 'result' => $result));
297
 
298
+ return $this->_processFailedResult($this->_getHelper()->__('Your card has failed 3D secure validation, please try again or consider using an alternate payment method.'), 'Transaction failed with 3D secure', false, $result);
 
 
 
 
299
  }
300
  }
301
 
302
+ return $this->_processFailedResult($this->_getHelper()->__('%s. Please try again or attempt refreshing the page.', $this->_getWrapper()->parseMessage($result->message)), $result);
303
  }
304
 
305
  $this->_processSuccessResult($payment, $result, $amount);
308
  }
309
 
310
  /**
311
+ * Build up the payment request
 
 
 
 
 
 
 
 
 
 
 
 
 
 
312
  *
313
+ * @param $token
 
314
  *
315
+ * @return array
316
  */
317
+ protected function _buildPaymentRequest($token)
318
  {
319
+ $paymentArray = array();
 
 
 
 
320
 
321
+ // If we have an original token use that for the subsequent requests
322
+ if ($originalToken = $this->_getOriginalToken()) {
323
+ $paymentArray['paymentMethodToken'] = $originalToken;
324
+ return $paymentArray;
325
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
326
 
327
+ // Check to see whether we're using a payment method token?
328
+ if($this->getPaymentMethodToken() && !in_array($this->getPaymentMethodToken(), array('other', 'threedsecure'))) {
329
 
330
+ // Build our payment array
331
+ $paymentArray['paymentMethodToken'] = $this->getPaymentMethodToken();
332
+ unset($paymentArray['cvv']);
333
 
334
+ } else {
 
 
 
335
 
336
+ // Build our payment array with a nonce
337
+ $paymentArray['paymentMethodNonce'] = $this->getPaymentMethodNonce();
338
 
339
+ }
 
 
340
 
341
+ // If the user is using a stored card with 3D secure, enable it in the request and remove CVV
342
+ if ($this->getPaymentMethodToken() && $this->getPaymentMethodToken() == 'threedsecure') {
343
 
344
+ // If we're using 3D secure token card don't send CVV
345
+ unset($paymentArray['cvv']);
346
 
347
+ }
 
 
348
 
349
+ // If a token is present in the request use that
350
+ if ($token) {
 
351
 
352
+ // Remove this unneeded data
353
+ unset($paymentArray['paymentMethodNonce'], $paymentArray['cvv']);
354
 
355
+ // Send the token as the payment array
356
+ $paymentArray['paymentMethodToken'] = $token;
357
+ }
358
 
359
+ return $paymentArray;
360
+ }
361
 
362
+ /**
363
+ * Is 3D secure enabled based on the current data?
364
+ *
365
+ * @return bool
366
+ */
367
+ protected function _is3DEnabled()
368
+ {
369
+ // If we're creating the transaction from an original token we cannot use 3Ds currently
370
+ if ($this->_getOriginalToken()) {
371
+ return false;
372
+ }
373
 
374
+ if ($this->getPaymentMethodToken() && $this->getPaymentMethodToken() == 'threedsecure') {
375
+ return true;
376
+ } elseif ($this->getPaymentMethodToken() && $this->getPaymentMethodToken() != 'other') {
377
+ return false;
378
  }
379
 
380
+ return $this->is3DEnabled();
381
  }
382
 
383
  /**
384
+ * Authorize the requested amount
385
  *
386
  * @param \Varien_Object $payment
387
+ * @param float $amount
388
  *
389
+ * @return \Gene_Braintree_Model_Paymentmethod_Creditcard
390
  */
391
+ public function authorize(Varien_Object $payment, $amount)
392
  {
393
+ return $this->_authorize($payment, $amount, false);
394
+ }
 
 
395
 
396
+ /**
397
+ * Process capturing of a payment
398
+ *
399
+ * @param \Varien_Object $payment
400
+ * @param float $amount
401
+ *
402
+ * @return \Mage_Payment_Model_Abstract
403
+ */
404
+ public function capture(Varien_Object $payment, $amount)
405
+ {
406
+ return $this->_captureAuthorized($payment, $amount);
407
  }
408
 
409
  /**
425
  // Load the transaction from Braintree
426
  $transaction = Braintree_Transaction::find($transactionId);
427
 
428
+ // We can only void authorized and submitted for settlement transactions
429
+ if ($transaction->status == Braintree_Transaction::AUTHORIZED || $transaction->status == Braintree_Transaction::SUBMITTED_FOR_SETTLEMENT) {
 
 
430
 
431
+ // Swap between refund and void
432
+ $result = Braintree_Transaction::void($transactionId);
433
 
434
+ // If it's a success close the transaction
435
+ if ($result->success) {
436
+ $payment->setIsTransactionClosed(1);
 
 
 
437
  } else {
438
+ if ($result->errors->deepSize() > 0) {
439
+ Mage::throwException($this->_getWrapper()->parseErrors($result->errors->deepAll()));
440
+ } else {
441
+ Mage::throwException('Unknown');
442
+ }
443
  }
444
+
445
+ } else {
446
+ Mage::throwException($this->_getHelper()->__('You can only void authorized/submitted for settlement payments, please setup a credit memo if you wish to refund this order.'));
447
  }
448
 
449
  } catch (Exception $e) {
494
  'processorAuthorizationCode',
495
  'processorResponseCode',
496
  'processorResponseText',
497
+ 'threeDSecure',
498
+ 'kount_id',
499
+ 'kount_session_id'
500
  );
501
 
502
  // Handle any fraud response from Braintree
503
  $this->handleFraud($result, $payment);
504
 
505
  // If 3D secure is enabled, presume it's passed
506
+ if ($this->_is3DEnabled()) {
507
  $additionalInfo['threeDSecure'] = Mage::helper('gene_braintree')->__('Passed');
508
  }
509
 
510
  // Iterate through and pull out any data we want
511
+ foreach ($storeFields as $storeField) {
512
+ if (isset($result->transaction->{$storeField}) && !empty($result->transaction->{$storeField})) {
513
  $additionalInfo[$storeField] = $result->transaction->{$storeField};
514
+ } else if ($value = $payment->getAdditionalInformation($storeField)) {
515
+ $additionalInfo[$storeField] = $value;
516
  }
517
  }
518
 
523
 
524
  if (isset($result->transaction->creditCard['token']) && $result->transaction->creditCard['token']) {
525
  $payment->setAdditionalInformation('token', $result->transaction->creditCard['token']);
526
+
527
+ // If the transaction is part of a multi shipping transaction store the token for the next order
528
+ if ($payment->getMultiShipping() && !$this->_getOriginalToken()) {
529
+ $this->_setOriginalToken($result->transaction->creditCard['token']);
530
+
531
+ // If we shouldn't have this method saved, add it into the session to be removed once the request is complete
532
+ if (!$this->shouldSaveMethod($payment, true)) {
533
+ Mage::getSingleton('checkout/session')->setTemporaryPaymentToken($result->transaction->creditCard['token']);
534
+ }
535
+ }
536
  }
537
 
538
  return $payment;
app/code/community/Gene/Braintree/Model/Paymentmethod/Legacy/Creditcard.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
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
+ {
10
+ /**
11
+ * Set the code
12
+ *
13
+ * @var string
14
+ */
15
+ protected $_code = 'braintree';
16
+
17
+ /**
18
+ * This method is never available and only used by the RocketWeb orders
19
+ *
20
+ * @param null $quote
21
+ *
22
+ * @return bool
23
+ */
24
+ public function isAvailable($quote = null)
25
+ {
26
+ return false;
27
+ }
28
+ }
app/code/community/Gene/Braintree/Model/Paymentmethod/Legacy/Paypal.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
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
+ {
10
+ /**
11
+ * Set the code
12
+ *
13
+ * @var string
14
+ */
15
+ protected $_code = 'braintree_paypal';
16
+
17
+ /**
18
+ * This method is never available and only used by the RocketWeb orders
19
+ *
20
+ * @param null $quote
21
+ *
22
+ * @return bool
23
+ */
24
+ public function isAvailable($quote = null)
25
+ {
26
+ return false;
27
+ }
28
+ }
app/code/community/Gene/Braintree/Model/Paymentmethod/Paypal.php CHANGED
@@ -29,21 +29,53 @@ class Gene_Braintree_Model_Paymentmethod_Paypal extends Gene_Braintree_Model_Pay
29
  */
30
  protected $_isGateway = false;
31
  protected $_canOrder = false;
32
- protected $_canAuthorize = false;
33
  protected $_canCapture = true;
34
  protected $_canCapturePartial = false;
35
  protected $_canRefund = true;
36
  protected $_canRefundInvoicePartial = true;
37
  protected $_canVoid = false;
38
- protected $_canUseInternal = false;
39
  protected $_canUseCheckout = true;
40
- protected $_canUseForMultishipping = false;
41
  protected $_isInitializeNeeded = false;
42
  protected $_canFetchTransactionInfo = false;
43
  protected $_canReviewPayment = false;
44
  protected $_canCreateBillingAgreement = false;
45
  protected $_canManageRecurringProfiles = false;
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  /**
48
  * Place Braintree specific data into the additional information of the payment instance object
49
  *
@@ -103,11 +135,22 @@ class Gene_Braintree_Model_Paymentmethod_Paypal extends Gene_Braintree_Model_Pay
103
  * Should we save this method in the database?
104
  *
105
  * @param \Varien_Object $payment
 
106
  *
107
  * @return mixed
108
  */
109
- public function shouldSaveMethod($payment)
110
  {
 
 
 
 
 
 
 
 
 
 
111
  // Retrieve whether or not we should save the card from the info instance
112
  $savePaypal = $this->getInfoInstance()->getAdditionalInformation('save_paypal');
113
 
@@ -144,18 +187,27 @@ class Gene_Braintree_Model_Paymentmethod_Paypal extends Gene_Braintree_Model_Pay
144
  }
145
 
146
  /**
147
- * Capture the payment on the checkout page
148
  *
149
- * @param Varien_Object $payment
150
- * @param float $amount
 
 
151
  *
152
- * @return Mage_Payment_Model_Abstract
 
153
  */
154
- public function capture(Varien_Object $payment, $amount)
155
  {
156
  // Confirm that we have a nonce from Braintree
157
  // We cannot utilise the validate() function as these checks need to happen at the capture point
158
- if(!$this->getPaymentMethodToken() && !$this->getPaymentMethodNonce()) {
 
 
 
 
 
 
159
  Mage::throwException(
160
  $this->_getHelper()->__('There has been an issue processing your PayPal payment, please try again.')
161
  );
@@ -164,59 +216,33 @@ class Gene_Braintree_Model_Paymentmethod_Paypal extends Gene_Braintree_Model_Pay
164
  // Init the environment
165
  $this->_getWrapper()->init();
166
 
167
- if($this->getPaymentMethodToken() && $this->getPaymentMethodToken() != 'other') {
168
- $paymentArray = array(
169
- 'paymentMethodToken' => $this->getPaymentMethodToken()
170
- );
171
- } else {
172
- $paymentArray = array(
173
- 'paymentMethodNonce' => $this->getPaymentMethodNonce()
174
- );
175
- }
176
-
177
  // Retrieve the amount we should capture
178
  $amount = $this->_getWrapper()->getCaptureAmount($payment->getOrder(), $amount);
179
 
180
  // Attempt to create the sale
181
  try {
182
- // Build the array for the sale
 
183
  $saleArray = $this->_getWrapper()->buildSale(
184
  $amount,
185
- $paymentArray,
186
  $payment->getOrder(),
187
- true,
188
  $this->getInfoInstance()->getAdditionalInformation('device_data'),
189
  $this->shouldSaveMethod($payment)
190
  );
191
 
192
- // Pass the sale array into a varien object
193
- $request = new Varien_Object();
194
- $request->setData('sale_array', $saleArray);
195
-
196
- // Dispatch event for modifying the sale array
197
- Mage::dispatchEvent('gene_braintree_paypal_sale_array', array('payment' => $payment, 'request' => $request));
198
-
199
- // Pull the saleArray back out
200
- $saleArray = $request->getData('sale_array');
201
-
202
- // Log the initial sale array, no protected data is included
203
- Gene_Braintree_Model_Debug::log(array('saleArray' => $saleArray));
204
-
205
- // Attempt to create the sale
206
  $result = $this->_getWrapper()->makeSale(
207
- $saleArray
208
  );
 
209
  } catch (Exception $e) {
210
 
211
  // Dispatch an event for when a payment fails
212
  Mage::dispatchEvent('gene_braintree_paypal_failed_exception', array('payment' => $payment, 'exception' => $e));
213
 
214
- // If there's an error
215
- Gene_Braintree_Model_Debug::log($e);
216
-
217
- Mage::throwException(
218
- $this->_getHelper()->__('We were unable to complete your purchase through PayPal, please try again or an alternative payment method.')
219
- );
220
  }
221
 
222
  // Log the result
@@ -228,15 +254,77 @@ class Gene_Braintree_Model_Paymentmethod_Paypal extends Gene_Braintree_Model_Pay
228
  // Dispatch an event for when a payment fails
229
  Mage::dispatchEvent('gene_braintree_paypal_failed', array('payment' => $payment, 'result' => $result));
230
 
231
- Mage::throwException($this->_getHelper()->__('%s. Please try again or attempt refreshing the page.', $result->message));
232
  }
233
 
234
- // Finish of the order
235
  $this->_processSuccessResult($payment, $result, $amount);
236
 
237
  return $this;
238
  }
239
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
240
  /**
241
  * Process a successful result from the sale request
242
  *
@@ -260,7 +348,7 @@ class Gene_Braintree_Model_Paymentmethod_Paypal extends Gene_Braintree_Model_Pay
260
  ->setAmount($amount)
261
  ->setShouldCloseParentTransaction(false);
262
 
263
- // Set the additioanl information about the customers PayPal account
264
  $payment->setAdditionalInformation(
265
  array(
266
  'paypal_email' => $result->transaction->paypal['payerEmail'],
@@ -275,6 +363,16 @@ class Gene_Braintree_Model_Paymentmethod_Paypal extends Gene_Braintree_Model_Pay
275
  // Store the PayPal token if we have one
276
  if (isset($result->transaction->paypal['token']) && !empty($result->transaction->paypal['token'])) {
277
  $payment->setAdditionalInformation('token', $result->transaction->paypal['token']);
 
 
 
 
 
 
 
 
 
 
278
  }
279
 
280
  return $payment;
29
  */
30
  protected $_isGateway = false;
31
  protected $_canOrder = false;
32
+ protected $_canAuthorize = true;
33
  protected $_canCapture = true;
34
  protected $_canCapturePartial = false;
35
  protected $_canRefund = true;
36
  protected $_canRefundInvoicePartial = true;
37
  protected $_canVoid = false;
38
+ protected $_canUseInternal = true;
39
  protected $_canUseCheckout = true;
40
+ protected $_canUseForMultishipping = true;
41
  protected $_isInitializeNeeded = false;
42
  protected $_canFetchTransactionInfo = false;
43
  protected $_canReviewPayment = false;
44
  protected $_canCreateBillingAgreement = false;
45
  protected $_canManageRecurringProfiles = false;
46
 
47
+ /**
48
+ * Verify that the module has been setup
49
+ *
50
+ * @param null $quote
51
+ *
52
+ * @return bool
53
+ */
54
+ public function isAvailable($quote = null)
55
+ {
56
+ // Check Magento's internal methods allow us to run
57
+ if(parent::isAvailable($quote)) {
58
+
59
+ // Validate the configuration is okay
60
+ if ($this->_getWrapper()->validateCredentialsOnce()) {
61
+
62
+ // This method is only active in the admin if the vault is enabled
63
+ if (Mage::app()->getStore()->isAdmin() && $this->isVaultEnabled()) {
64
+ return true;
65
+ } else if (Mage::app()->getStore()->isAdmin()) {
66
+ return false;
67
+ }
68
+
69
+ return true;
70
+ }
71
+
72
+ } else {
73
+
74
+ // Otherwise it's a no
75
+ return false;
76
+ }
77
+ }
78
+
79
  /**
80
  * Place Braintree specific data into the additional information of the payment instance object
81
  *
135
  * Should we save this method in the database?
136
  *
137
  * @param \Varien_Object $payment
138
+ * @param $skipMultishipping
139
  *
140
  * @return mixed
141
  */
142
+ public function shouldSaveMethod($payment, $skipMultishipping = false)
143
  {
144
+ if ($skipMultishipping === false) {
145
+ // We must always save the method for multi shipping requests
146
+ if ($payment->getMultiShipping() && !$this->_getOriginalToken()) {
147
+ return true;
148
+ } else if ($this->_getOriginalToken()) {
149
+ // If we have an original token, there is no need to save the same payment method again
150
+ return false;
151
+ }
152
+ }
153
+
154
  // Retrieve whether or not we should save the card from the info instance
155
  $savePaypal = $this->getInfoInstance()->getAdditionalInformation('save_paypal');
156
 
187
  }
188
 
189
  /**
190
+ * Psuedo _authorize function so we can pass in extra data
191
  *
192
+ * @param \Varien_Object $payment
193
+ * @param $amount
194
+ * @param bool|false $shouldCapture
195
+ * @param bool|false $token
196
  *
197
+ * @return $this
198
+ * @throws \Mage_Core_Exception
199
  */
200
+ protected function _authorize(Varien_Object $payment, $amount, $shouldCapture = false, $token = false)
201
  {
202
  // Confirm that we have a nonce from Braintree
203
  // We cannot utilise the validate() function as these checks need to happen at the capture point
204
+ if (!$this->getPaymentMethodNonce()) {
205
+ if (!$this->getPaymentMethodToken()) {
206
+ Mage::throwException(
207
+ $this->_getHelper()->__('There has been an issue processing your PayPal payment, please try again.')
208
+ );
209
+ }
210
+ } else if (!$this->getPaymentMethodNonce()) {
211
  Mage::throwException(
212
  $this->_getHelper()->__('There has been an issue processing your PayPal payment, please try again.')
213
  );
216
  // Init the environment
217
  $this->_getWrapper()->init();
218
 
 
 
 
 
 
 
 
 
 
 
219
  // Retrieve the amount we should capture
220
  $amount = $this->_getWrapper()->getCaptureAmount($payment->getOrder(), $amount);
221
 
222
  // Attempt to create the sale
223
  try {
224
+
225
+ // Build up the sale array
226
  $saleArray = $this->_getWrapper()->buildSale(
227
  $amount,
228
+ $this->_buildPaymentRequest($token),
229
  $payment->getOrder(),
230
+ $shouldCapture,
231
  $this->getInfoInstance()->getAdditionalInformation('device_data'),
232
  $this->shouldSaveMethod($payment)
233
  );
234
 
235
+ // Attempt to make the sale, firstly dispatching an event
 
 
 
 
 
 
 
 
 
 
 
 
 
236
  $result = $this->_getWrapper()->makeSale(
237
+ $this->_dispatchSaleArrayEvent('gene_braintree_paypal_sale_array', $saleArray, $payment)
238
  );
239
+
240
  } catch (Exception $e) {
241
 
242
  // Dispatch an event for when a payment fails
243
  Mage::dispatchEvent('gene_braintree_paypal_failed_exception', array('payment' => $payment, 'exception' => $e));
244
 
245
+ return $this->_processFailedResult($this->_getHelper()->__('We were unable to complete your purchase through PayPal, please try again or an alternative payment method.'), $e);
 
 
 
 
 
246
  }
247
 
248
  // Log the result
254
  // Dispatch an event for when a payment fails
255
  Mage::dispatchEvent('gene_braintree_paypal_failed', array('payment' => $payment, 'result' => $result));
256
 
257
+ return $this->_processFailedResult($this->_getHelper()->__('%s. Please try again or attempt refreshing the page.', rtrim($result->message, '.')));
258
  }
259
 
 
260
  $this->_processSuccessResult($payment, $result, $amount);
261
 
262
  return $this;
263
  }
264
 
265
+ /**
266
+ * Build up the payment request
267
+ *
268
+ * @param $token
269
+ *
270
+ * @return array
271
+ */
272
+ protected function _buildPaymentRequest($token)
273
+ {
274
+ // Build our payment array with either our token, or nonce
275
+ $paymentArray = array();
276
+
277
+ // If we have an original token use that for the subsequent requests
278
+ if ($originalToken = $this->_getOriginalToken()) {
279
+ $paymentArray['paymentMethodToken'] = $originalToken;
280
+ return $paymentArray;
281
+ }
282
+
283
+ if ($this->getPaymentMethodToken() && $this->getPaymentMethodToken() != 'other') {
284
+ $paymentArray['paymentMethodToken'] = $this->getPaymentMethodToken();
285
+ } else {
286
+ $paymentArray['paymentMethodNonce'] = $this->getPaymentMethodNonce();
287
+ }
288
+
289
+ // If a token is present in the request use that
290
+ if ($token) {
291
+
292
+ // Remove this unneeded data
293
+ unset($paymentArray['paymentMethodNonce']);
294
+
295
+ // Send the token as the payment array
296
+ $paymentArray['paymentMethodToken'] = $token;
297
+ }
298
+
299
+ return $paymentArray;
300
+ }
301
+
302
+ /**
303
+ * Authorize the requested amount
304
+ *
305
+ * @param \Varien_Object $payment
306
+ * @param float $amount
307
+ *
308
+ * @return \Gene_Braintree_Model_Paymentmethod_Paypal
309
+ */
310
+ public function authorize(Varien_Object $payment, $amount)
311
+ {
312
+ return $this->_authorize($payment, $amount, false);
313
+ }
314
+
315
+ /**
316
+ * Process capturing of a payment
317
+ *
318
+ * @param \Varien_Object $payment
319
+ * @param float $amount
320
+ *
321
+ * @return \Mage_Payment_Model_Abstract
322
+ */
323
+ public function capture(Varien_Object $payment, $amount)
324
+ {
325
+ return $this->_captureAuthorized($payment, $amount);
326
+ }
327
+
328
  /**
329
  * Process a successful result from the sale request
330
  *
348
  ->setAmount($amount)
349
  ->setShouldCloseParentTransaction(false);
350
 
351
+ // Set the additional information about the customers PayPal account
352
  $payment->setAdditionalInformation(
353
  array(
354
  'paypal_email' => $result->transaction->paypal['payerEmail'],
363
  // Store the PayPal token if we have one
364
  if (isset($result->transaction->paypal['token']) && !empty($result->transaction->paypal['token'])) {
365
  $payment->setAdditionalInformation('token', $result->transaction->paypal['token']);
366
+
367
+ // If the transaction is part of a multi shipping transaction store the token for the next order
368
+ if ($payment->getMultiShipping() && !$this->_getOriginalToken()) {
369
+ $this->_setOriginalToken($result->transaction->paypal['token']);
370
+
371
+ // If we shouldn't have this method saved, add it into the session to be removed once the request is complete
372
+ if (!$this->shouldSaveMethod($payment, true)) {
373
+ Mage::getSingleton('checkout/session')->setTemporaryPaymentToken($result->transaction->paypal['token']);
374
+ }
375
+ }
376
  }
377
 
378
  return $payment;
app/code/community/Gene/Braintree/Model/Saved.php CHANGED
@@ -13,7 +13,10 @@ class Gene_Braintree_Model_Saved extends Mage_Core_Model_Abstract
13
  const SAVED_PAYPAL_ID = 1;
14
  const SAVED_CREDITCARD_ID = 2;
15
 
16
- private $savedAccounts = false;
 
 
 
17
 
18
  /**
19
  * Get the current customers saved cards
@@ -22,13 +25,10 @@ class Gene_Braintree_Model_Saved extends Mage_Core_Model_Abstract
22
  */
23
  public function getCustomerSavedPaymentMethods()
24
  {
25
- // Grab an instance of the customers session
26
- $customerSession = Mage::getSingleton('customer/session');
27
 
28
- // You can only store cards if you're logged in
29
- if($customerSession->isLoggedIn() && $customerSession->getCustomer()->getBraintreeCustomerId()) {
30
-
31
- if(!$this->savedAccounts) {
32
 
33
  // Grab a new instance of the wrapper
34
  $wrapper = Mage::getModel('gene_braintree/wrapper_braintree');
@@ -37,7 +37,7 @@ class Gene_Braintree_Model_Saved extends Mage_Core_Model_Abstract
37
  $wrapper->init();
38
 
39
  // Try and load the customer from Braintrees side
40
- if ($customer = $wrapper->getCustomer($customerSession->getCustomer()->getBraintreeCustomerId())) {
41
 
42
  // Assign them into our model
43
  $object = new Varien_Object();
@@ -45,18 +45,37 @@ class Gene_Braintree_Model_Saved extends Mage_Core_Model_Abstract
45
 
46
  Mage::dispatchEvent('gene_braintree_get_saved_methods', array('object' => $object));
47
 
48
- $this->savedAccounts = $object->getSavedAccounts();
49
  }
50
 
51
  }
52
 
53
- return $this->savedAccounts;
54
 
55
  }
56
 
57
  return false;
58
  }
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  /**
61
  * Return a boolean value on whether the customer has a certain type of payment method
62
  *
13
  const SAVED_PAYPAL_ID = 1;
14
  const SAVED_CREDITCARD_ID = 2;
15
 
16
+ /**
17
+ * @var bool|array
18
+ */
19
+ protected $_savedAccounts = false;
20
 
21
  /**
22
  * Get the current customers saved cards
25
  */
26
  public function getCustomerSavedPaymentMethods()
27
  {
28
+ // Do we have a valid customer?
29
+ if ($customer = $this->getCustomer()) {
30
 
31
+ if(!$this->_savedAccounts) {
 
 
 
32
 
33
  // Grab a new instance of the wrapper
34
  $wrapper = Mage::getModel('gene_braintree/wrapper_braintree');
37
  $wrapper->init();
38
 
39
  // Try and load the customer from Braintrees side
40
+ if ($customer = $wrapper->getCustomer($customer->getBraintreeCustomerId())) {
41
 
42
  // Assign them into our model
43
  $object = new Varien_Object();
45
 
46
  Mage::dispatchEvent('gene_braintree_get_saved_methods', array('object' => $object));
47
 
48
+ $this->_savedAccounts = $object->getSavedAccounts();
49
  }
50
 
51
  }
52
 
53
+ return $this->_savedAccounts;
54
 
55
  }
56
 
57
  return false;
58
  }
59
 
60
+ /**
61
+ * Return the current customer, if the session is an admin session use the admin quote
62
+ *
63
+ * @return bool|\Mage_Customer_Model_Customer
64
+ */
65
+ public function getCustomer()
66
+ {
67
+ if (Mage::app()->getStore()->isAdmin()) {
68
+ $adminQuote = Mage::getSingleton('adminhtml/session_quote');
69
+ if ($customer = $adminQuote->getCustomer()) {
70
+ return $customer;
71
+ }
72
+ } else if (Mage::getSingleton('customer/session')->isLoggedIn()) {
73
+ return Mage::getSingleton('customer/session')->getCustomer();
74
+ }
75
+
76
+ return false;
77
+ }
78
+
79
  /**
80
  * Return a boolean value on whether the customer has a certain type of payment method
81
  *
app/code/community/Gene/Braintree/Model/Source/Creditcard/CaptureAction.php CHANGED
@@ -7,7 +7,6 @@
7
  */
8
  class Gene_Braintree_Model_Source_Creditcard_CaptureAction
9
  {
10
-
11
  const CAPTURE_ACTION_XML_PATH = 'payment/gene_braintree_creditcard/capture_action';
12
 
13
  const CAPTURE_INVOICE = 'invoice';
7
  */
8
  class Gene_Braintree_Model_Source_Creditcard_CaptureAction
9
  {
 
10
  const CAPTURE_ACTION_XML_PATH = 'payment/gene_braintree_creditcard/capture_action';
11
 
12
  const CAPTURE_INVOICE = 'invoice';
app/code/community/Gene/Braintree/Model/Source/Creditcard/FormIntegration.php CHANGED
@@ -7,28 +7,33 @@
7
  */
8
  class Gene_Braintree_Model_Source_Creditcard_FormIntegration
9
  {
10
-
11
  const INTEGRATION_ACTION_XML_PATH = 'payment/gene_braintree_creditcard/form_integration';
12
 
 
 
 
 
 
 
13
  const INTEGRATION_DEFAULT = 'default';
 
 
 
 
14
  const INTEGRATION_HOSTED = 'hosted';
15
 
16
  /**
17
- * Possible actions on order place
18
  *
19
  * @return array
20
  */
21
  public function toOptionArray()
22
  {
23
  return array(
24
- array(
25
- 'value' => self::INTEGRATION_DEFAULT,
26
- 'label' => Mage::helper('gene_braintree')->__('Default')
27
- ),
28
  array(
29
  'value' => self::INTEGRATION_HOSTED,
30
  'label' => Mage::helper('gene_braintree')->__('Hosted Fields')
31
- ),
32
  );
33
  }
34
  }
7
  */
8
  class Gene_Braintree_Model_Source_Creditcard_FormIntegration
9
  {
 
10
  const INTEGRATION_ACTION_XML_PATH = 'payment/gene_braintree_creditcard/form_integration';
11
 
12
+ /**
13
+ * Default presents security risks for exploited Magento sites. Hosted Fields ensures security regardless of the
14
+ * stores own security.
15
+ *
16
+ * @deprecated deprecated since version 2.0.0, use hosted fields
17
+ */
18
  const INTEGRATION_DEFAULT = 'default';
19
+
20
+ /**
21
+ * https://www.braintreepayments.com/en-gb/products-and-features/custom-ui/hosted-fields
22
+ */
23
  const INTEGRATION_HOSTED = 'hosted';
24
 
25
  /**
26
+ * Possible integrations for the credit card form
27
  *
28
  * @return array
29
  */
30
  public function toOptionArray()
31
  {
32
  return array(
 
 
 
 
33
  array(
34
  'value' => self::INTEGRATION_HOSTED,
35
  'label' => Mage::helper('gene_braintree')->__('Hosted Fields')
36
+ )
37
  );
38
  }
39
  }
app/code/community/Gene/Braintree/Model/Source/Creditcard/PaymentAction.php CHANGED
@@ -7,7 +7,6 @@
7
  */
8
  class Gene_Braintree_Model_Source_Creditcard_PaymentAction
9
  {
10
-
11
  const PAYMENT_ACTION_XML_PATH = 'payment/gene_braintree_creditcard/payment_action';
12
 
13
  /**
7
  */
8
  class Gene_Braintree_Model_Source_Creditcard_PaymentAction
9
  {
 
10
  const PAYMENT_ACTION_XML_PATH = 'payment/gene_braintree_creditcard/payment_action';
11
 
12
  /**
app/code/community/Gene/Braintree/Model/Source/Environment.php CHANGED
@@ -7,6 +7,9 @@
7
  */
8
  class Gene_Braintree_Model_Source_Environment
9
  {
 
 
 
10
  /**
11
  * Display both sandbox and production values
12
  *
@@ -16,11 +19,11 @@ class Gene_Braintree_Model_Source_Environment
16
  {
17
  return array(
18
  array(
19
- 'value' => 'sandbox',
20
  'label' => Mage::helper('gene_braintree')->__('Sandbox'),
21
  ),
22
  array(
23
- 'value' => 'production',
24
  'label' => Mage::helper('gene_braintree')->__('Production')
25
  )
26
  );
7
  */
8
  class Gene_Braintree_Model_Source_Environment
9
  {
10
+ const SANDBOX = 'sandbox';
11
+ const PRODUCTION = 'production';
12
+
13
  /**
14
  * Display both sandbox and production values
15
  *
19
  {
20
  return array(
21
  array(
22
+ 'value' => self::SANDBOX,
23
  'label' => Mage::helper('gene_braintree')->__('Sandbox'),
24
  ),
25
  array(
26
+ 'value' => self::PRODUCTION,
27
  'label' => Mage::helper('gene_braintree')->__('Production')
28
  )
29
  );
app/code/community/Gene/Braintree/Model/Source/Paypal/CaptureAction.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
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
+ {
10
+
11
+ const CAPTURE_ACTION_XML_PATH = 'payment/gene_braintree_creditcard/capture_action';
12
+
13
+ const CAPTURE_INVOICE = 'invoice';
14
+ const CAPTURE_SHIPMENT = 'shipment';
15
+
16
+ /**
17
+ * Possible actions on order place
18
+ *
19
+ * @return array
20
+ */
21
+ public function toOptionArray()
22
+ {
23
+ return array(
24
+ array(
25
+ 'value' => self::CAPTURE_INVOICE,
26
+ 'label' => Mage::helper('gene_braintree')->__('Invoice')
27
+ ),
28
+ array(
29
+ 'value' => self::CAPTURE_SHIPMENT,
30
+ 'label' => Mage::helper('gene_braintree')->__('Shipment')
31
+ ),
32
+ );
33
+ }
34
+ }
app/code/community/Gene/Braintree/Model/Source/Paypal/PaymentAction.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Gene_Braintree_Model_Source_Paypal_PaymentAction
3
+ {
4
+
5
+ const PAYMENT_ACTION_XML_PATH = 'payment/gene_braintree_paypal/payment_action';
6
+
7
+ /**
8
+ * Possible actions on order place
9
+ *
10
+ * @return array
11
+ */
12
+ public function toOptionArray()
13
+ {
14
+ return array(
15
+ array(
16
+ 'value' => Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE,
17
+ 'label' => Mage::helper('gene_braintree')->__('Authorize')
18
+ ),
19
+ array(
20
+ 'value' => Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE_CAPTURE,
21
+ 'label' => Mage::helper('gene_braintree')->__('Authorize & Capture')
22
+ ),
23
+ );
24
+ }
25
+ }
app/code/community/Gene/Braintree/Model/Source/Paypal/Paymenttype.php CHANGED
@@ -21,11 +21,11 @@ class Gene_Braintree_Model_Source_Paypal_Paymenttype
21
  return array(
22
  array(
23
  'value' => self::GENE_BRAINTREE_PAYPAL_SINGLE_PAYMENT,
24
- 'label' => Mage::helper('gene_braintree')->__('Single Payment'),
25
  ),
26
  array(
27
  'value' => self::GENE_BRAINTREE_PAYPAL_FUTURE_PAYMENTS,
28
- 'label' => Mage::helper('gene_braintree')->__('Future Payments')
29
  )
30
  );
31
  }
21
  return array(
22
  array(
23
  'value' => self::GENE_BRAINTREE_PAYPAL_SINGLE_PAYMENT,
24
+ 'label' => Mage::helper('gene_braintree')->__('Checkout'),
25
  ),
26
  array(
27
  'value' => self::GENE_BRAINTREE_PAYPAL_FUTURE_PAYMENTS,
28
+ 'label' => Mage::helper('gene_braintree')->__('Vault')
29
  )
30
  );
31
  }
app/code/community/Gene/Braintree/Model/Wrapper/Braintree.php CHANGED
@@ -14,61 +14,74 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
14
  CONST BRAINTREE_PUBLIC_KEY_PATH = 'payment/gene_braintree/public_key';
15
  CONST BRAINTREE_PRIVATE_KEY_PATH = 'payment/gene_braintree/private_key';
16
 
 
 
 
 
 
17
  const BRAINTREE_MULTI_CURRENCY = 'payment/gene_braintree/multi_currency_enable';
18
  const BRAINTREE_MULTI_CURRENCY_MAPPING = 'payment/gene_braintree/multi_currency_mapping';
19
 
 
 
 
 
 
20
  /**
21
  * Store the customer
22
  *
23
  * @var Braintree_Customer
24
  */
25
- private $customer;
26
 
27
  /**
28
  * Store the Braintree ID
29
  *
30
  * @var int
31
  */
32
- private $braintreeId;
33
 
34
  /**
35
  * Used to track whether the payment methods are available
36
  *
37
  * @var bool
38
  */
39
- private $validated = null;
40
-
41
- /**
42
- * If we're using a mapped currency we need to charge the grand total, instead of the base
43
- *
44
- * @var bool
45
- */
46
- private $mappedCurrency = false;
47
 
48
  /**
49
  * Store whether or not we've init the environment yet
50
  *
51
  * @var bool
52
  */
53
- private $init = false;
54
 
55
  /**
56
  * Setup the environment
57
  *
 
 
58
  * @return $this
59
  */
60
  public function init($store = null)
61
  {
62
- if(!$this->init) {
63
 
64
  // Setup the various configuration variables
65
- Braintree_Configuration::environment(Mage::getStoreConfig(self::BRAINTREE_ENVIRONMENT_PATH, $store));
66
- Braintree_Configuration::merchantId(Mage::getStoreConfig(self::BRAINTREE_MERCHANT_ID_PATH, $store));
67
- Braintree_Configuration::publicKey(Mage::getStoreConfig(self::BRAINTREE_PUBLIC_KEY_PATH, $store));
68
- Braintree_Configuration::privateKey(Mage::getStoreConfig(self::BRAINTREE_PRIVATE_KEY_PATH, $store));
 
 
 
 
 
 
 
 
69
 
70
  // Set our flag
71
- $this->init = true;
72
  }
73
 
74
  return $this;
@@ -98,6 +111,7 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
98
  $this->init();
99
 
100
  $result = Braintree_PaymentMethodNonce::create($paymentMethodToken);
 
101
  return $result->paymentMethodNonce->nonce;
102
  }
103
 
@@ -111,15 +125,15 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
111
  public function getCustomer($braintreeCustomerId)
112
  {
113
  // Try and load it from the customer
114
- if(!$this->customer && !isset($this->customer[$braintreeCustomerId])) {
115
  try {
116
- $this->customer[$braintreeCustomerId] = Braintree_Customer::find($braintreeCustomerId);
117
  } catch (Exception $e) {
118
  return false;
119
  }
120
  }
121
 
122
- return $this->customer[$braintreeCustomerId];
123
  }
124
 
125
  /**
@@ -131,7 +145,7 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
131
  {
132
  try {
133
  // Check to see that we can generate a braintree ID
134
- if($braintreeId = $this->getBraintreeId()) {
135
 
136
  // Proxy this request to the other method which has caching
137
  return $this->getCustomer($braintreeId);
@@ -168,7 +182,7 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
168
  $customerId = Mage::getSingleton('customer/session')->getCustomer()->getBraintreeCustomerId();
169
 
170
  // Detect which type of payment method we've got here
171
- if($paymentMethod instanceof Braintree_PayPalAccount) {
172
 
173
  // Grab the customer
174
  $customer = $this->getCustomer($customerId);
@@ -177,11 +191,11 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
177
  $customerTokens = array();
178
 
179
  // Check the customer has PayPal Accounts
180
- if(isset($customer->paypalAccounts)) {
181
 
182
  /* @var $payPalAccount Braintree_PayPalAccount */
183
- foreach($customer->paypalAccounts as $payPalAccount) {
184
- if(isset($payPalAccount->token)) {
185
  $customerTokens[] = $payPalAccount->token;
186
  }
187
  }
@@ -190,13 +204,13 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
190
  }
191
 
192
  // Check to see if this customer account contains this token
193
- if(in_array($paymentMethod->token, $customerTokens)) {
194
  return true;
195
  }
196
 
197
  return false;
198
 
199
- } else if(isset($paymentMethod->customerId) && $paymentMethod->customerId == $customerId) {
200
 
201
  return true;
202
  }
@@ -212,7 +226,7 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
212
  protected function getBraintreeId()
213
  {
214
  // Some basic caching
215
- if(!$this->braintreeId) {
216
 
217
  // Is the customer already logged in
218
  if (Mage::getSingleton('customer/session')->isLoggedIn()) {
@@ -222,30 +236,30 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
222
 
223
  // Determine whether they have a braintree customer ID already
224
  if ($brainteeId = $customer->getBraintreeCustomerId()) {
225
- $this->braintreeId = $customer->getBraintreeCustomerId();
226
  } else {
227
  // If not let's create them one
228
- $this->braintreeId = $this->buildCustomerId();
229
- $customer->setBraintreeCustomerId($this->braintreeId)->save();
230
  }
231
 
232
  } else {
233
  if ((Mage::getSingleton('checkout/type_onepage')->getCheckoutMethod() == 'login_in' || Mage::getSingleton('checkout/type_onepage')->getCheckoutMethod() == Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER)) {
234
 
235
  // Check to see if we've already generated an ID
236
- if($braintreeId = Mage::getSingleton('checkout/session')->getBraintreeCustomerId()) {
237
- $this->braintreeId = $braintreeId;
238
  } else {
239
  // If the user plans to register let's build them an ID and store it in their session
240
- $this->braintreeId = $this->buildCustomerId();
241
- Mage::getSingleton('checkout/session')->setBraintreeCustomerId($this->braintreeId);
242
  }
243
  }
244
  }
245
 
246
  }
247
 
248
- return $this->braintreeId;
249
  }
250
 
251
  /**
@@ -258,7 +272,7 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
258
  protected function getAdminConfigValue($path)
259
  {
260
  // If we have the getConfigDataValue use that
261
- if(method_exists('Mage_Adminhtml_Model_Config_Data','getConfigDataValue')) {
262
  return Mage::getSingleton('adminhtml/config_data')->getConfigDataValue($path);
263
  }
264
 
@@ -293,14 +307,26 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
293
  {
294
  // Try to init the environment
295
  try {
296
- if(!$alreadyInit) {
297
 
298
  // If we're within the admin we want to grab these values from whichever store we're modifying
299
- if(Mage::app()->getStore()->isAdmin()) {
300
- Braintree_Configuration::environment($this->getAdminConfigValue(self::BRAINTREE_ENVIRONMENT_PATH));
301
- Braintree_Configuration::merchantId($this->getAdminConfigValue(self::BRAINTREE_MERCHANT_ID_PATH));
302
- Braintree_Configuration::publicKey($this->getAdminConfigValue(self::BRAINTREE_PUBLIC_KEY_PATH));
303
- Braintree_Configuration::privateKey($this->getAdminConfigValue(self::BRAINTREE_PRIVATE_KEY_PATH));
 
 
 
 
 
 
 
 
 
 
 
 
304
  } else {
305
  $this->init();
306
  }
@@ -312,12 +338,14 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
312
  } catch (Exception $e) {
313
 
314
  // Do we want to rethrow the exception?
315
- if($throwException) {
316
  throw $e;
317
  }
318
 
 
 
319
  // Otherwise give the user a little bit more information
320
- if($prettyResponse) {
321
  return '<span style="color: red;font-weight: bold;" id="braintree-valid-config">' . Mage::helper('gene_braintree')->__('Invalid Credentials') . '</span><br />' . Mage::helper('gene_braintree')->__('Payments cannot be processed until this is resolved, due to this the methods will be hidden within the checkout');
322
  }
323
 
@@ -326,9 +354,16 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
326
  }
327
 
328
  // Check to see if we've been passed the merchant account ID?
329
- if(!$merchantAccountId) {
330
- if(Mage::app()->getStore()->isAdmin()) {
331
- $merchantAccountId = $this->getAdminConfigValue(self::BRAINTREE_MERCHANT_ACCOUNT_ID_PATH);
 
 
 
 
 
 
 
332
  } else {
333
  $merchantAccountId = $this->getMerchantAccountId();
334
  }
@@ -340,12 +375,14 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
340
  } catch (Exception $e) {
341
 
342
  // Do we want to rethrow the exception?
343
- if($throwException) {
344
  throw $e;
345
  }
346
 
 
 
347
  // Otherwise do we want a pretty response?
348
- if($prettyResponse) {
349
  return '<span style="color: orange;font-weight: bold;" id="braintree-valid-config">' . Mage::helper('gene_braintree')->__('Invalid Merchant Account ID') . '</span><br />' . Mage::helper('gene_braintree')->__('Payments cannot be processed until this is resolved. We cannot find your merchant account ID associated with the other credentials you\'ve provided, please update this field');
350
  }
351
 
@@ -353,9 +390,12 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
353
  return false;
354
  }
355
 
356
- if($prettyResponse) {
 
 
357
  return '<span style="color: green;font-weight: bold;" id="braintree-valid-config">' . Mage::helper('gene_braintree')->__('Valid Credentials') . '</span><br />' . Mage::helper('gene_braintree')->__('You\'re ready to accept payments via Braintree');
358
  }
 
359
  return true;
360
  }
361
 
@@ -367,55 +407,49 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
367
  public function validateCredentialsOnce()
368
  {
369
  // Check to see if it's been validated yet
370
- if(is_null($this->validated)) {
371
 
372
  // Check the Braintree lib version is above 2.32, as this is when 3D secure appeared
373
  if (Braintree_Version::get() < 2.32) {
374
- $this->validated = false;
375
  } else {
376
 
377
  // Check that the module is fully setup
378
- if (!Mage::getStoreConfig(Gene_Braintree_Model_Wrapper_Braintree::BRAINTREE_ENVIRONMENT_PATH)
379
- || !Mage::getStoreConfig(Gene_Braintree_Model_Wrapper_Braintree::BRAINTREE_MERCHANT_ID_PATH)
380
- || !Mage::getStoreConfig(Gene_Braintree_Model_Wrapper_Braintree::BRAINTREE_PUBLIC_KEY_PATH)
381
- || !Mage::getStoreConfig(Gene_Braintree_Model_Wrapper_Braintree::BRAINTREE_PRIVATE_KEY_PATH)
382
- ) {
383
  // If not the payment methods aren't available
384
- $this->validated = false;
385
 
386
  } else {
387
-
388
- // Attempt to validate credentials
389
- try {
390
-
391
- // Passing true will cause the system to rethrow exceptions
392
- if(Mage::getModel('gene_braintree/wrapper_braintree')->validateCredentials(false, false, false, true)) {
393
-
394
- // Mark our flag as true
395
- $this->validated = true;
396
-
397
- } else {
398
-
399
- // Mark our flag as false, this shouldn't even return false it should always throw an
400
- // Exception but just in case
401
- $this->validated = false;
402
- }
403
-
404
- } catch (Exception $e) {
405
-
406
- // If it fails log it
407
- Gene_Braintree_Model_Debug::log('CRITICAL ERROR: The system was unable to connect to Braintree, error is below');
408
- Gene_Braintree_Model_Debug::log($e);
409
-
410
- // If the validateCredentials throws an exception it has failed
411
- $this->validated = false;
412
- }
413
-
414
  }
415
  }
416
  }
417
 
418
- return $this->validated;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
419
  }
420
 
421
  /**
@@ -430,20 +464,20 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
430
  {
431
  // Create the payment method with this data
432
  $paymentMethodCreate = array(
433
- 'customerId' => $this->getBraintreeId(),
434
  'paymentMethodNonce' => $nonce,
435
- 'options' => array(
436
- 'verifyCard' => true,
437
  'verificationMerchantAccountId' => $this->getMerchantAccountId()
438
  )
439
  );
440
 
441
- if($customerId = $this->getBraintreeId()) {
442
  $paymentMethodCreate['customerId'] = $this->getBraintreeId();
443
  }
444
 
445
  // Include billing address information into the payment method
446
- if($billingAddress) {
447
 
448
  // Add in the billing address
449
  $paymentMethodCreate['billingAddress'] = $billingAddress;
@@ -474,18 +508,18 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
474
  public function storeInGuestVault($nonce, $billingAddress = false)
475
  {
476
  $guestCustomerCreate = array(
477
- 'id' => $this->getBraintreeId(),
478
  'creditCard' => array(
479
  'paymentMethodNonce' => $nonce,
480
- 'options' => array(
481
- 'verifyCard' => true,
482
  'verificationMerchantAccountId' => $this->getMerchantAccountId()
483
  )
484
  )
485
  );
486
 
487
  // Include billing address information into the customer
488
- if($billingAddress) {
489
 
490
  // Add in the billing address
491
  $guestCustomerCreate['creditCard']['cardholderName'] = $billingAddress['firstName'] . ' ' . $billingAddress['lastName'];
@@ -496,13 +530,13 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
496
  $guestCustomerCreate['lastName'] = $billingAddress['lastName'];
497
 
498
  // Conditionally copy over these fields
499
- if(isset($billingAddress['email']) && !empty($billingAddress['email'])) {
500
  $guestCustomerCreate['email'] = $billingAddress['email'];
501
  }
502
- if(isset($billingAddress['company']) && !empty($billingAddress['company'])) {
503
  $guestCustomerCreate['company'] = $billingAddress['company'];
504
  }
505
- if(isset($billingAddress['phone']) && !empty($billingAddress['phone'])) {
506
  $guestCustomerCreate['phone'] = $billingAddress['phone'];
507
  }
508
 
@@ -527,7 +561,7 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
527
  Mage::dispatchEvent('gene_braintree_cleanup');
528
 
529
  // If a guest customer was created during the checkout we can remove them now
530
- if($guestCustomerId = Mage::getSingleton('checkout/session')->getGuestBraintreeCustomerId()) {
531
  $wrapper = Mage::getSingleton('gene_braintree/wrapper_braintree');
532
  $wrapper->init()->deleteCustomer($guestCustomerId);
533
  Mage::getSingleton('checkout/session')->unsGuestBraintreeCustomerId();
@@ -535,26 +569,28 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
535
  }
536
 
537
  // Remove the temporary payment method
538
- if($token = Mage::getSingleton('checkout/session')->getTemporaryPaymentToken()) {
539
  $wrapper = Mage::getSingleton('gene_braintree/wrapper_braintree');
540
  $wrapper->init()->deletePaymentMethod($token);
541
  Mage::getSingleton('checkout/session')->unsTemporaryPaymentToken();
542
  }
543
 
 
 
544
  return false;
545
  }
546
 
547
  /**
548
  * Build up the sale request
549
  *
550
- * @param $amount
551
- * @param array $paymentDataArray
552
  * @param Mage_Sales_Model_Order $order
553
- * @param bool $submitForSettlement
554
- * @param bool $deviceData
555
- * @param bool $storeInVault
556
- * @param bool $threeDSecure
557
- * @param array $extra
558
  *
559
  * @return array
560
  *
@@ -569,7 +605,8 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
569
  $storeInVault = false,
570
  $threeDSecure = false,
571
  $extra = array()
572
- ) {
 
573
  // Check we always have an ID
574
  if (!$order->getIncrementId()) {
575
  Mage::throwException('Your order has become invalid, please try refreshing.');
@@ -579,9 +616,9 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
579
  $createdMethod = false;
580
 
581
  // Are we storing in the vault, from a guest customer account?
582
- if($storeInVault && Mage::getSingleton('checkout/session')->getGuestBraintreeCustomerId() && ($token = Mage::getSingleton('checkout/session')->getGuestPaymentToken())) {
583
 
584
- if($this->checkPaymentMethod($token)) {
585
 
586
  // Remove this from the session so it doesn't get deleted at the end of checkout
587
  Mage::getSingleton('checkout/session')->unsGuestBraintreeCustomerId();
@@ -599,32 +636,44 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
599
  } else {
600
  // If the method doesn't exist, clear the token and re-build the sale
601
  Mage::getSingleton('checkout/session')->unsGuestPaymentToken();
 
602
  return $this->buildSale($amount, $paymentDataArray, $order, $submitForSettlement, $deviceData, $storeInVault, $threeDSecure, $extra);
603
  }
604
 
605
- } else if($storeInVault && $this->checkIsCustomer() && isset($paymentDataArray['paymentMethodNonce'])) {
606
  // If the user is already a customer and wants to store in the vault we've gotta do something a bit special
607
 
608
  // Do we already have a saved token in the session?
609
- if($token = Mage::getSingleton('checkout/session')->getTemporaryPaymentToken()) {
610
 
611
- if($this->checkPaymentMethod($token)) {
612
 
613
- // Remove this from the session so it doesn't get deleted at the end of checkout
614
- Mage::getSingleton('checkout/session')->unsTemporaryPaymentToken();
615
 
616
- // We no longer need this nonce
617
- unset($paymentDataArray['paymentMethodNonce']);
618
 
619
- // Instead use the token
620
- $paymentDataArray['paymentMethodToken'] = $token;
621
 
622
- // Create a flag for other methods
623
- $createdMethod = true;
 
 
 
 
 
 
 
 
 
 
624
 
625
  } else {
626
  // If the method doesn't exist, clear the token and re-build the sale
627
  Mage::getSingleton('checkout/session')->unsTemporaryPaymentToken();
 
628
  return $this->buildSale($amount, $paymentDataArray, $order, $submitForSettlement, $deviceData, $storeInVault, $threeDSecure, $extra);
629
  }
630
 
@@ -674,33 +723,34 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
674
 
675
  // Build up the initial request parameters
676
  $request = array(
677
- 'amount' => $amount,
678
- 'orderId' => $order->getIncrementId(),
679
- 'merchantAccountId' => $this->getMerchantAccountId($order),
680
- 'channel' => 'MagentoVZero',
681
- 'options' => array(
682
  'submitForSettlement' => $submitForSettlement,
683
  'storeInVault' => $storeInVault
684
  )
685
  );
686
 
687
  // Input the allowed payment method info
688
- $allowedPaymentInfo = array('paymentMethodNonce','paymentMethodToken','token','cvv');
689
- foreach($paymentDataArray as $key => $value) {
690
- if(in_array($key, $allowedPaymentInfo)) {
691
- if($key == 'cvv') {
692
  $request['creditCard']['cvv'] = $value;
693
  } else {
694
  $request[$key] = $value;
695
  }
696
  } else {
697
- Mage::throwException($key.' is not allowed within $paymentDataArray');
698
  }
699
  }
700
 
701
  // Include the customer if we're creating a new one
702
- if(!$this->checkIsCustomer() && (Mage::getSingleton('customer/session')->isLoggedIn() ||
703
- (Mage::getSingleton('checkout/type_onepage')->getCheckoutMethod() == 'login_in' || Mage::getSingleton('checkout/type_onepage')->getCheckoutMethod() == Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER))) {
 
704
  $request['customer'] = $this->buildCustomer($order);
705
  } else {
706
  // If the customer exists but we aren't using the vault we want to pass a customer object with no ID
@@ -723,12 +773,19 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
723
  }
724
 
725
  // Is 3D secure enabled?
726
- if($threeDSecure !== false && !$createdMethod) {
727
  $request['options']['three_d_secure']['required'] = true;
728
  }
729
 
 
 
 
 
 
 
 
730
  // Any extra information we want to supply
731
- if(!empty($extra) && is_array($extra)) {
732
  $request = array_merge($request, $extra);
733
  }
734
 
@@ -747,7 +804,7 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
747
  try {
748
  // Attempt to load the temporary payment method
749
  $paymentMethod = Braintree_PaymentMethod::find($token);
750
- if(isset($paymentMethod->token) && $paymentMethod->token == $token) {
751
  return true;
752
  }
753
  } catch (Exception $e) {
@@ -793,7 +850,7 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
793
  */
794
  private function buildCustomerId()
795
  {
796
- return md5(uniqid('braintree_',true));
797
  }
798
 
799
  /**
@@ -805,17 +862,17 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
805
  */
806
  public function convertBillingAddress($address)
807
  {
808
- if($address instanceof Mage_Sales_Model_Order_Address || $address instanceof Mage_Sales_Model_Quote_Address || $address instanceof Mage_Customer_Model_Address) {
809
  return $this->buildAddress($address);
810
  }
811
 
812
  // Otherwise we're most likely dealing with a raw request
813
- if(is_array($address)) {
814
 
815
  // Is the user using a saved address?
816
- if($addressId = Mage::app()->getRequest()->getParam('billing_address_id', false)) {
817
  $savedAddress = Mage::getModel('customer/address')->load($addressId);
818
- if($savedAddress->getId()) {
819
  return $this->buildAddress($savedAddress);
820
  }
821
  }
@@ -829,7 +886,7 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
829
  $addressForm->setEntity($addressObject);
830
 
831
  // Emulate request object
832
- $addressData = $addressForm->extractData($addressForm->prepareRequest($address));
833
  $addressObject->addData($addressData);
834
 
835
  return $this->buildAddress($addressObject);
@@ -847,32 +904,7 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
847
  */
848
  private function buildAddress($address)
849
  {
850
- // Build up the initial array
851
- $return = array(
852
- 'firstName' => $address->getFirstname(),
853
- 'lastName' => $address->getLastname(),
854
- 'streetAddress' => $address->getStreet1(),
855
- 'locality' => $address->getCity(),
856
- 'postalCode' => $address->getPostcode(),
857
- 'countryCodeAlpha2' => $address->getCountry()
858
- );
859
-
860
- // Any extended address?
861
- if ($address->getStreet2()) {
862
- $return['extendedAddress'] = $address->getStreet2();
863
- }
864
-
865
- // Region
866
- if ($address->getRegion()) {
867
- $return['region'] = $address->getRegionCode();
868
- }
869
-
870
- // Check to see if we have a company
871
- if ($address->getCompany()) {
872
- $return['company'] = $address->getCompany();
873
- }
874
-
875
- return $return;
876
  }
877
 
878
  /**
@@ -885,14 +917,23 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
885
  public function getMerchantAccountId(Mage_Sales_Model_Order $order = null)
886
  {
887
  // If multi-currency is enabled use the mapped merchant account ID
888
- if($currencyCode = $this->hasMappedCurrencyCode($order)) {
889
 
890
  // Return the mapped currency code
891
  return $currencyCode;
892
  }
893
 
 
 
 
 
 
 
 
 
 
894
  // Otherwise return the one from the store
895
- return Mage::getStoreConfig(self::BRAINTREE_MERCHANT_ACCOUNT_ID_PATH, ($order ? $order->getStoreId() : null));
896
  }
897
 
898
  /**
@@ -905,19 +946,19 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
905
  public function hasMappedCurrencyCode(Mage_Sales_Model_Order $order = null)
906
  {
907
  // If multi-currency is enabled use the mapped merchant account ID
908
- if($this->currencyMappingEnabled($order)) {
909
 
910
  // Retrieve the mapping from the config
911
  $mapping = Mage::helper('core')->jsonDecode(Mage::getStoreConfig(self::BRAINTREE_MULTI_CURRENCY_MAPPING, ($order ? $order->getStoreId() : false)));
912
 
913
  // Verify it decoded correctly
914
- if(is_array($mapping) && !empty($mapping)) {
915
 
916
  // If we haven't been given an order use the quote currency code
917
  $currency = (!$order ? $this->getQuote()->getQuoteCurrencyCode() : $order->getOrderCurrencyCode());
918
 
919
  // Verify we have a mapping value for this currency
920
- if(isset($mapping[$currency]) && !empty($mapping[$currency])) {
921
 
922
  // These should never have spaces in so make sure we trim it
923
  return trim($mapping[$currency]);
@@ -949,7 +990,7 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
949
  public function getQuote()
950
  {
951
  // If we're within the admin return the admin quote
952
- if(Mage::app()->getStore()->isAdmin()) {
953
  return Mage::getSingleton('adminhtml/session_quote')->getQuote();
954
  }
955
 
@@ -968,10 +1009,10 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
968
  public function getCaptureAmount(Mage_Sales_Model_Order $order = null, $amount)
969
  {
970
  // If we've got a mapped currency code the amount is going to change
971
- if($this->hasMappedCurrencyCode($order)) {
972
 
973
  // If we don't have an order yet get the quote capture amount
974
- if($order === null) {
975
  return $this->convertCaptureAmount($this->getQuote()->getBaseCurrencyCode(), $this->getQuote()->getQuoteCurrencyCode(), $amount);
976
  }
977
 
@@ -1015,18 +1056,18 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
1015
  );
1016
 
1017
  // Shall we include the customer ID?
1018
- if($includeId) {
1019
  $customer['id'] = $this->getBraintreeId();
1020
  }
1021
 
1022
  // Handle empty data with alternatives
1023
- if(empty($customer['firstName'])) {
1024
  $customer['firstName'] = $order->getBillingAddress()->getFirstname();
1025
  }
1026
- if(empty($customer['lastName'])) {
1027
  $customer['lastName'] = $order->getBillingAddress()->getLastname();
1028
  }
1029
- if(empty($customer['email'])) {
1030
  $customer['email'] = $order->getBillingAddress()->getEmail();
1031
  }
1032
 
@@ -1109,7 +1150,7 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
1109
  public function parseErrors($braintreeErrors)
1110
  {
1111
  $errors = array();
1112
- foreach($braintreeErrors as $error) {
1113
  $errors[] = $error->code . ': ' . $this->parseMessage($error->message);
1114
  }
1115
 
@@ -1128,4 +1169,50 @@ class Gene_Braintree_Model_Wrapper_Braintree extends Mage_Core_Model_Abstract
1128
  return str_replace('nonce', 'token', $string);
1129
  }
1130
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1131
  }
14
  CONST BRAINTREE_PUBLIC_KEY_PATH = 'payment/gene_braintree/public_key';
15
  CONST BRAINTREE_PRIVATE_KEY_PATH = 'payment/gene_braintree/private_key';
16
 
17
+ CONST BRAINTREE_SANDBOX_MERCHANT_ID_PATH = 'payment/gene_braintree/sandbox_merchant_id';
18
+ CONST BRAINTREE_SANDBOX_MERCHANT_ACCOUNT_ID_PATH = 'payment/gene_braintree/sandbox_merchant_account_id';
19
+ CONST BRAINTREE_SANDBOX_PUBLIC_KEY_PATH = 'payment/gene_braintree/sandbox_public_key';
20
+ CONST BRAINTREE_SANDBOX_PRIVATE_KEY_PATH = 'payment/gene_braintree/sandbox_private_key';
21
+
22
  const BRAINTREE_MULTI_CURRENCY = 'payment/gene_braintree/multi_currency_enable';
23
  const BRAINTREE_MULTI_CURRENCY_MAPPING = 'payment/gene_braintree/multi_currency_mapping';
24
 
25
+ /**
26
+ * Store whether or not the system has recently connected to the Braintree API successfully
27
+ */
28
+ const BRAINTREE_API_CONFIG_STATUS = 'payment/gene_braintree/api_config_status';
29
+
30
  /**
31
  * Store the customer
32
  *
33
  * @var Braintree_Customer
34
  */
35
+ protected $_customer;
36
 
37
  /**
38
  * Store the Braintree ID
39
  *
40
  * @var int
41
  */
42
+ protected $_braintreeId;
43
 
44
  /**
45
  * Used to track whether the payment methods are available
46
  *
47
  * @var bool
48
  */
49
+ protected $_validated = null;
 
 
 
 
 
 
 
50
 
51
  /**
52
  * Store whether or not we've init the environment yet
53
  *
54
  * @var bool
55
  */
56
+ protected $init = false;
57
 
58
  /**
59
  * Setup the environment
60
  *
61
+ * @param null $store
62
+ *
63
  * @return $this
64
  */
65
  public function init($store = null)
66
  {
67
+ if (!$this->init) {
68
 
69
  // Setup the various configuration variables
70
+ $environment = Mage::getStoreConfig(self::BRAINTREE_ENVIRONMENT_PATH, $store);
71
+ Braintree_Configuration::environment($environment);
72
+
73
+ if ($environment == Gene_Braintree_Model_Source_Environment::PRODUCTION) {
74
+ Braintree_Configuration::merchantId(Mage::getStoreConfig(self::BRAINTREE_MERCHANT_ID_PATH, $store));
75
+ Braintree_Configuration::publicKey(Mage::getStoreConfig(self::BRAINTREE_PUBLIC_KEY_PATH, $store));
76
+ Braintree_Configuration::privateKey(Mage::getStoreConfig(self::BRAINTREE_PRIVATE_KEY_PATH, $store));
77
+ } else {
78
+ Braintree_Configuration::merchantId(Mage::getStoreConfig(self::BRAINTREE_SANDBOX_MERCHANT_ID_PATH, $store));
79
+ Braintree_Configuration::publicKey(Mage::getStoreConfig(self::BRAINTREE_SANDBOX_PUBLIC_KEY_PATH, $store));
80
+ Braintree_Configuration::privateKey(Mage::getStoreConfig(self::BRAINTREE_SANDBOX_PRIVATE_KEY_PATH, $store));
81
+ }
82
 
83
  // Set our flag
84
+ $this->_init = true;
85
  }
86
 
87
  return $this;
111
  $this->init();
112
 
113
  $result = Braintree_PaymentMethodNonce::create($paymentMethodToken);
114
+
115
  return $result->paymentMethodNonce->nonce;
116
  }
117
 
125
  public function getCustomer($braintreeCustomerId)
126
  {
127
  // Try and load it from the customer
128
+ if (!$this->_customer && !isset($this->_customer[$braintreeCustomerId])) {
129
  try {
130
+ $this->_customer[$braintreeCustomerId] = Braintree_Customer::find($braintreeCustomerId);
131
  } catch (Exception $e) {
132
  return false;
133
  }
134
  }
135
 
136
+ return $this->_customer[$braintreeCustomerId];
137
  }
138
 
139
  /**
145
  {
146
  try {
147
  // Check to see that we can generate a braintree ID
148
+ if ($braintreeId = $this->getBraintreeId()) {
149
 
150
  // Proxy this request to the other method which has caching
151
  return $this->getCustomer($braintreeId);
182
  $customerId = Mage::getSingleton('customer/session')->getCustomer()->getBraintreeCustomerId();
183
 
184
  // Detect which type of payment method we've got here
185
+ if ($paymentMethod instanceof Braintree_PayPalAccount) {
186
 
187
  // Grab the customer
188
  $customer = $this->getCustomer($customerId);
191
  $customerTokens = array();
192
 
193
  // Check the customer has PayPal Accounts
194
+ if (isset($customer->paypalAccounts)) {
195
 
196
  /* @var $payPalAccount Braintree_PayPalAccount */
197
+ foreach ($customer->paypalAccounts as $payPalAccount) {
198
+ if (isset($payPalAccount->token)) {
199
  $customerTokens[] = $payPalAccount->token;
200
  }
201
  }
204
  }
205
 
206
  // Check to see if this customer account contains this token
207
+ if (in_array($paymentMethod->token, $customerTokens)) {
208
  return true;
209
  }
210
 
211
  return false;
212
 
213
+ } else if (isset($paymentMethod->customerId) && $paymentMethod->customerId == $customerId) {
214
 
215
  return true;
216
  }
226
  protected function getBraintreeId()
227
  {
228
  // Some basic caching
229
+ if (!$this->_braintreeId) {
230
 
231
  // Is the customer already logged in
232
  if (Mage::getSingleton('customer/session')->isLoggedIn()) {
236
 
237
  // Determine whether they have a braintree customer ID already
238
  if ($brainteeId = $customer->getBraintreeCustomerId()) {
239
+ $this->_braintreeId = $customer->getBraintreeCustomerId();
240
  } else {
241
  // If not let's create them one
242
+ $this->_braintreeId = $this->buildCustomerId();
243
+ $customer->setBraintreeCustomerId($this->_braintreeId)->save();
244
  }
245
 
246
  } else {
247
  if ((Mage::getSingleton('checkout/type_onepage')->getCheckoutMethod() == 'login_in' || Mage::getSingleton('checkout/type_onepage')->getCheckoutMethod() == Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER)) {
248
 
249
  // Check to see if we've already generated an ID
250
+ if ($braintreeId = Mage::getSingleton('checkout/session')->getBraintreeCustomerId()) {
251
+ $this->_braintreeId = $braintreeId;
252
  } else {
253
  // If the user plans to register let's build them an ID and store it in their session
254
+ $this->_braintreeId = $this->buildCustomerId();
255
+ Mage::getSingleton('checkout/session')->setBraintreeCustomerId($this->_braintreeId);
256
  }
257
  }
258
  }
259
 
260
  }
261
 
262
+ return $this->_braintreeId;
263
  }
264
 
265
  /**
272
  protected function getAdminConfigValue($path)
273
  {
274
  // If we have the getConfigDataValue use that
275
+ if (method_exists('Mage_Adminhtml_Model_Config_Data', 'getConfigDataValue')) {
276
  return Mage::getSingleton('adminhtml/config_data')->getConfigDataValue($path);
277
  }
278
 
307
  {
308
  // Try to init the environment
309
  try {
310
+ if (!$alreadyInit) {
311
 
312
  // If we're within the admin we want to grab these values from whichever store we're modifying
313
+ if (Mage::app()->getStore()->isAdmin()) {
314
+ // Setup the various configuration variables
315
+ $environment = $this->getAdminConfigValue(self::BRAINTREE_ENVIRONMENT_PATH);
316
+ Braintree_Configuration::environment($environment);
317
+
318
+ // Change logic based on environment
319
+ if ($environment == Gene_Braintree_Model_Source_Environment::PRODUCTION) {
320
+ Braintree_Configuration::merchantId($this->getAdminConfigValue(self::BRAINTREE_MERCHANT_ID_PATH));
321
+ Braintree_Configuration::publicKey($this->getAdminConfigValue(self::BRAINTREE_PUBLIC_KEY_PATH));
322
+ Braintree_Configuration::privateKey($this->getAdminConfigValue(self::BRAINTREE_PRIVATE_KEY_PATH));
323
+ } else if ($environment == Gene_Braintree_Model_Source_Environment::SANDBOX) {
324
+ Braintree_Configuration::merchantId($this->getAdminConfigValue(self::BRAINTREE_SANDBOX_MERCHANT_ID_PATH));
325
+ Braintree_Configuration::publicKey($this->getAdminConfigValue(self::BRAINTREE_SANDBOX_PUBLIC_KEY_PATH));
326
+ Braintree_Configuration::privateKey($this->getAdminConfigValue(self::BRAINTREE_SANDBOX_PRIVATE_KEY_PATH));
327
+ } else {
328
+ return $this->_updateApiStatus(false);
329
+ }
330
  } else {
331
  $this->init();
332
  }
338
  } catch (Exception $e) {
339
 
340
  // Do we want to rethrow the exception?
341
+ if ($throwException) {
342
  throw $e;
343
  }
344
 
345
+ $this->_updateApiStatus(false);
346
+
347
  // Otherwise give the user a little bit more information
348
+ if ($prettyResponse) {
349
  return '<span style="color: red;font-weight: bold;" id="braintree-valid-config">' . Mage::helper('gene_braintree')->__('Invalid Credentials') . '</span><br />' . Mage::helper('gene_braintree')->__('Payments cannot be processed until this is resolved, due to this the methods will be hidden within the checkout');
350
  }
351
 
354
  }
355
 
356
  // Check to see if we've been passed the merchant account ID?
357
+ if (!$merchantAccountId) {
358
+ if (Mage::app()->getStore()->isAdmin()) {
359
+ // Setup the various configuration variables
360
+ $environment = $this->getAdminConfigValue(self::BRAINTREE_ENVIRONMENT_PATH);
361
+
362
+ if ($environment == Gene_Braintree_Model_Source_Environment::PRODUCTION) {
363
+ $merchantAccountId = $this->getAdminConfigValue(self::BRAINTREE_MERCHANT_ACCOUNT_ID_PATH);
364
+ } else {
365
+ $merchantAccountId = $this->getAdminConfigValue(self::BRAINTREE_SANDBOX_MERCHANT_ACCOUNT_ID_PATH);
366
+ }
367
  } else {
368
  $merchantAccountId = $this->getMerchantAccountId();
369
  }
375
  } catch (Exception $e) {
376
 
377
  // Do we want to rethrow the exception?
378
+ if ($throwException) {
379
  throw $e;
380
  }
381
 
382
+ $this->_updateApiStatus(false);
383
+
384
  // Otherwise do we want a pretty response?
385
+ if ($prettyResponse) {
386
  return '<span style="color: orange;font-weight: bold;" id="braintree-valid-config">' . Mage::helper('gene_braintree')->__('Invalid Merchant Account ID') . '</span><br />' . Mage::helper('gene_braintree')->__('Payments cannot be processed until this is resolved. We cannot find your merchant account ID associated with the other credentials you\'ve provided, please update this field');
387
  }
388
 
390
  return false;
391
  }
392
 
393
+ $this->_updateApiStatus(true);
394
+
395
+ if ($prettyResponse) {
396
  return '<span style="color: green;font-weight: bold;" id="braintree-valid-config">' . Mage::helper('gene_braintree')->__('Valid Credentials') . '</span><br />' . Mage::helper('gene_braintree')->__('You\'re ready to accept payments via Braintree');
397
  }
398
+
399
  return true;
400
  }
401
 
407
  public function validateCredentialsOnce()
408
  {
409
  // Check to see if it's been validated yet
410
+ if (is_null($this->_validated)) {
411
 
412
  // Check the Braintree lib version is above 2.32, as this is when 3D secure appeared
413
  if (Braintree_Version::get() < 2.32) {
414
+ $this->_validated = false;
415
  } else {
416
 
417
  // Check that the module is fully setup
418
+ if (!$this->_validateConfiguration()) {
 
 
 
 
419
  // If not the payment methods aren't available
420
+ $this->_validated = false;
421
 
422
  } else {
423
+ // Check to see if the connection is valid
424
+ $this->_validated = $this->_getApiStatus();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
425
  }
426
  }
427
  }
428
 
429
+ return $this->_validated;
430
+ }
431
+
432
+ /**
433
+ * Validate if the configuration is setup correctly
434
+ *
435
+ * @return bool
436
+ */
437
+ protected function _validateConfiguration()
438
+ {
439
+ // Retrieve the environment
440
+ $environment = Mage::getStoreConfig(self::BRAINTREE_ENVIRONMENT_PATH);
441
+
442
+ if ($environment == Gene_Braintree_Model_Source_Environment::PRODUCTION) {
443
+ return Mage::getStoreConfig(Gene_Braintree_Model_Wrapper_Braintree::BRAINTREE_MERCHANT_ID_PATH)
444
+ && Mage::getStoreConfig(Gene_Braintree_Model_Wrapper_Braintree::BRAINTREE_PUBLIC_KEY_PATH)
445
+ && Mage::getStoreConfig(Gene_Braintree_Model_Wrapper_Braintree::BRAINTREE_PRIVATE_KEY_PATH);
446
+ } else if ($environment == Gene_Braintree_Model_Source_Environment::SANDBOX) {
447
+ return Mage::getStoreConfig(Gene_Braintree_Model_Wrapper_Braintree::BRAINTREE_SANDBOX_MERCHANT_ID_PATH)
448
+ && Mage::getStoreConfig(Gene_Braintree_Model_Wrapper_Braintree::BRAINTREE_SANDBOX_PUBLIC_KEY_PATH)
449
+ && Mage::getStoreConfig(Gene_Braintree_Model_Wrapper_Braintree::BRAINTREE_SANDBOX_PRIVATE_KEY_PATH);
450
+ }
451
+
452
+ return false;
453
  }
454
 
455
  /**
464
  {
465
  // Create the payment method with this data
466
  $paymentMethodCreate = array(
467
+ 'customerId' => $this->getBraintreeId(),
468
  'paymentMethodNonce' => $nonce,
469
+ 'options' => array(
470
+ 'verifyCard' => true,
471
  'verificationMerchantAccountId' => $this->getMerchantAccountId()
472
  )
473
  );
474
 
475
+ if ($customerId = $this->getBraintreeId()) {
476
  $paymentMethodCreate['customerId'] = $this->getBraintreeId();
477
  }
478
 
479
  // Include billing address information into the payment method
480
+ if ($billingAddress) {
481
 
482
  // Add in the billing address
483
  $paymentMethodCreate['billingAddress'] = $billingAddress;
508
  public function storeInGuestVault($nonce, $billingAddress = false)
509
  {
510
  $guestCustomerCreate = array(
511
+ 'id' => $this->getBraintreeId(),
512
  'creditCard' => array(
513
  'paymentMethodNonce' => $nonce,
514
+ 'options' => array(
515
+ 'verifyCard' => true,
516
  'verificationMerchantAccountId' => $this->getMerchantAccountId()
517
  )
518
  )
519
  );
520
 
521
  // Include billing address information into the customer
522
+ if ($billingAddress) {
523
 
524
  // Add in the billing address
525
  $guestCustomerCreate['creditCard']['cardholderName'] = $billingAddress['firstName'] . ' ' . $billingAddress['lastName'];
530
  $guestCustomerCreate['lastName'] = $billingAddress['lastName'];
531
 
532
  // Conditionally copy over these fields
533
+ if (isset($billingAddress['email']) && !empty($billingAddress['email'])) {
534
  $guestCustomerCreate['email'] = $billingAddress['email'];
535
  }
536
+ if (isset($billingAddress['company']) && !empty($billingAddress['company'])) {
537
  $guestCustomerCreate['company'] = $billingAddress['company'];
538
  }
539
+ if (isset($billingAddress['phone']) && !empty($billingAddress['phone'])) {
540
  $guestCustomerCreate['phone'] = $billingAddress['phone'];
541
  }
542
 
561
  Mage::dispatchEvent('gene_braintree_cleanup');
562
 
563
  // If a guest customer was created during the checkout we can remove them now
564
+ if ($guestCustomerId = Mage::getSingleton('checkout/session')->getGuestBraintreeCustomerId()) {
565
  $wrapper = Mage::getSingleton('gene_braintree/wrapper_braintree');
566
  $wrapper->init()->deleteCustomer($guestCustomerId);
567
  Mage::getSingleton('checkout/session')->unsGuestBraintreeCustomerId();
569
  }
570
 
571
  // Remove the temporary payment method
572
+ if ($token = Mage::getSingleton('checkout/session')->getTemporaryPaymentToken()) {
573
  $wrapper = Mage::getSingleton('gene_braintree/wrapper_braintree');
574
  $wrapper->init()->deletePaymentMethod($token);
575
  Mage::getSingleton('checkout/session')->unsTemporaryPaymentToken();
576
  }
577
 
578
+ Mage::getSingleton('checkout/session')->unsVaultedNonce();
579
+
580
  return false;
581
  }
582
 
583
  /**
584
  * Build up the sale request
585
  *
586
+ * @param $amount
587
+ * @param array $paymentDataArray
588
  * @param Mage_Sales_Model_Order $order
589
+ * @param bool $submitForSettlement
590
+ * @param bool $deviceData
591
+ * @param bool $storeInVault
592
+ * @param bool $threeDSecure
593
+ * @param array $extra
594
  *
595
  * @return array
596
  *
605
  $storeInVault = false,
606
  $threeDSecure = false,
607
  $extra = array()
608
+ )
609
+ {
610
  // Check we always have an ID
611
  if (!$order->getIncrementId()) {
612
  Mage::throwException('Your order has become invalid, please try refreshing.');
616
  $createdMethod = false;
617
 
618
  // Are we storing in the vault, from a guest customer account?
619
+ if ($storeInVault && Mage::getSingleton('checkout/session')->getGuestBraintreeCustomerId() && ($token = Mage::getSingleton('checkout/session')->getGuestPaymentToken())) {
620
 
621
+ if ($this->checkPaymentMethod($token)) {
622
 
623
  // Remove this from the session so it doesn't get deleted at the end of checkout
624
  Mage::getSingleton('checkout/session')->unsGuestBraintreeCustomerId();
636
  } else {
637
  // If the method doesn't exist, clear the token and re-build the sale
638
  Mage::getSingleton('checkout/session')->unsGuestPaymentToken();
639
+
640
  return $this->buildSale($amount, $paymentDataArray, $order, $submitForSettlement, $deviceData, $storeInVault, $threeDSecure, $extra);
641
  }
642
 
643
+ } else if ($storeInVault && $this->checkIsCustomer() && isset($paymentDataArray['paymentMethodNonce'])) {
644
  // If the user is already a customer and wants to store in the vault we've gotta do something a bit special
645
 
646
  // Do we already have a saved token in the session?
647
+ if ($token = Mage::getSingleton('checkout/session')->getTemporaryPaymentToken()) {
648
 
649
+ if ($this->checkPaymentMethod($token)) {
650
 
651
+ // Is the submitted nonce different?
652
+ if (Mage::getSingleton('checkout/session')->getVaultedNonce() == $paymentDataArray['paymentMethodNonce']) {
653
 
654
+ // Remove this from the session so it doesn't get deleted at the end of checkout
655
+ Mage::getSingleton('checkout/session')->unsTemporaryPaymentToken();
656
 
657
+ // We no longer need this nonce
658
+ unset($paymentDataArray['paymentMethodNonce']);
659
 
660
+ // Instead use the token
661
+ $paymentDataArray['paymentMethodToken'] = $token;
662
+
663
+ // Create a flag for other methods
664
+ $createdMethod = true;
665
+
666
+ } else {
667
+
668
+ // Store it again with the 3Ds information
669
+ $storeInVault = true;
670
+
671
+ }
672
 
673
  } else {
674
  // If the method doesn't exist, clear the token and re-build the sale
675
  Mage::getSingleton('checkout/session')->unsTemporaryPaymentToken();
676
+
677
  return $this->buildSale($amount, $paymentDataArray, $order, $submitForSettlement, $deviceData, $storeInVault, $threeDSecure, $extra);
678
  }
679
 
723
 
724
  // Build up the initial request parameters
725
  $request = array(
726
+ 'amount' => $amount,
727
+ 'orderId' => $order->getIncrementId(),
728
+ 'merchantAccountId' => $this->getMerchantAccountId($order),
729
+ 'channel' => 'MagentoVZero',
730
+ 'options' => array(
731
  'submitForSettlement' => $submitForSettlement,
732
  'storeInVault' => $storeInVault
733
  )
734
  );
735
 
736
  // Input the allowed payment method info
737
+ $allowedPaymentInfo = array('paymentMethodNonce', 'paymentMethodToken', 'token', 'cvv');
738
+ foreach ($paymentDataArray as $key => $value) {
739
+ if (in_array($key, $allowedPaymentInfo)) {
740
+ if ($key == 'cvv') {
741
  $request['creditCard']['cvv'] = $value;
742
  } else {
743
  $request[$key] = $value;
744
  }
745
  } else {
746
+ Mage::throwException($key . ' is not allowed within $paymentDataArray');
747
  }
748
  }
749
 
750
  // Include the customer if we're creating a new one
751
+ if (!$this->checkIsCustomer() && (Mage::getSingleton('customer/session')->isLoggedIn() ||
752
+ (Mage::getSingleton('checkout/type_onepage')->getCheckoutMethod() == 'login_in' || Mage::getSingleton('checkout/type_onepage')->getCheckoutMethod() == Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER))
753
+ ) {
754
  $request['customer'] = $this->buildCustomer($order);
755
  } else {
756
  // If the customer exists but we aren't using the vault we want to pass a customer object with no ID
773
  }
774
 
775
  // Is 3D secure enabled?
776
+ if ($threeDSecure !== false && !$createdMethod) {
777
  $request['options']['three_d_secure']['required'] = true;
778
  }
779
 
780
+ // Include level 2 data if the user has provided a VAT ID
781
+ if ($order->getBillingAddress()->getVatId()) {
782
+ $request['taxAmount'] = $order->getTaxAmount();
783
+ $request['taxExempt'] = true;
784
+ $request['purchaseOrderNumber'] = $order->getIncrementId();
785
+ }
786
+
787
  // Any extra information we want to supply
788
+ if (!empty($extra) && is_array($extra)) {
789
  $request = array_merge($request, $extra);
790
  }
791
 
804
  try {
805
  // Attempt to load the temporary payment method
806
  $paymentMethod = Braintree_PaymentMethod::find($token);
807
+ if (isset($paymentMethod->token) && $paymentMethod->token == $token) {
808
  return true;
809
  }
810
  } catch (Exception $e) {
850
  */
851
  private function buildCustomerId()
852
  {
853
+ return md5(uniqid('braintree_', true));
854
  }
855
 
856
  /**
862
  */
863
  public function convertBillingAddress($address)
864
  {
865
+ if ($address instanceof Mage_Sales_Model_Order_Address || $address instanceof Mage_Sales_Model_Quote_Address || $address instanceof Mage_Customer_Model_Address) {
866
  return $this->buildAddress($address);
867
  }
868
 
869
  // Otherwise we're most likely dealing with a raw request
870
+ if (is_array($address)) {
871
 
872
  // Is the user using a saved address?
873
+ if ($addressId = Mage::app()->getRequest()->getParam('billing_address_id', false)) {
874
  $savedAddress = Mage::getModel('customer/address')->load($addressId);
875
+ if ($savedAddress->getId()) {
876
  return $this->buildAddress($savedAddress);
877
  }
878
  }
886
  $addressForm->setEntity($addressObject);
887
 
888
  // Emulate request object
889
+ $addressData = $addressForm->extractData($addressForm->prepareRequest($address));
890
  $addressObject->addData($addressData);
891
 
892
  return $this->buildAddress($addressObject);
904
  */
905
  private function buildAddress($address)
906
  {
907
+ return Mage::helper('gene_braintree')->convertToBraintreeAddress($address);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
908
  }
909
 
910
  /**
917
  public function getMerchantAccountId(Mage_Sales_Model_Order $order = null)
918
  {
919
  // If multi-currency is enabled use the mapped merchant account ID
920
+ if ($currencyCode = $this->hasMappedCurrencyCode($order)) {
921
 
922
  // Return the mapped currency code
923
  return $currencyCode;
924
  }
925
 
926
+ $environment = Mage::getStoreConfig(self::BRAINTREE_ENVIRONMENT_PATH, ($order ? $order->getStoreId() : null));
927
+ if ($environment == Gene_Braintree_Model_Source_Environment::PRODUCTION) {
928
+ $merchantAccountIdPath = self::BRAINTREE_MERCHANT_ACCOUNT_ID_PATH;
929
+ } else if ($environment == Gene_Braintree_Model_Source_Environment::SANDBOX) {
930
+ $merchantAccountIdPath = self::BRAINTREE_SANDBOX_MERCHANT_ACCOUNT_ID_PATH;
931
+ } else {
932
+ return false;
933
+ }
934
+
935
  // Otherwise return the one from the store
936
+ return Mage::getStoreConfig($merchantAccountIdPath, ($order ? $order->getStoreId() : null));
937
  }
938
 
939
  /**
946
  public function hasMappedCurrencyCode(Mage_Sales_Model_Order $order = null)
947
  {
948
  // If multi-currency is enabled use the mapped merchant account ID
949
+ if ($this->currencyMappingEnabled($order)) {
950
 
951
  // Retrieve the mapping from the config
952
  $mapping = Mage::helper('core')->jsonDecode(Mage::getStoreConfig(self::BRAINTREE_MULTI_CURRENCY_MAPPING, ($order ? $order->getStoreId() : false)));
953
 
954
  // Verify it decoded correctly
955
+ if (is_array($mapping) && !empty($mapping)) {
956
 
957
  // If we haven't been given an order use the quote currency code
958
  $currency = (!$order ? $this->getQuote()->getQuoteCurrencyCode() : $order->getOrderCurrencyCode());
959
 
960
  // Verify we have a mapping value for this currency
961
+ if (isset($mapping[$currency]) && !empty($mapping[$currency])) {
962
 
963
  // These should never have spaces in so make sure we trim it
964
  return trim($mapping[$currency]);
990
  public function getQuote()
991
  {
992
  // If we're within the admin return the admin quote
993
+ if (Mage::app()->getStore()->isAdmin()) {
994
  return Mage::getSingleton('adminhtml/session_quote')->getQuote();
995
  }
996
 
1009
  public function getCaptureAmount(Mage_Sales_Model_Order $order = null, $amount)
1010
  {
1011
  // If we've got a mapped currency code the amount is going to change
1012
+ if ($this->hasMappedCurrencyCode($order)) {
1013
 
1014
  // If we don't have an order yet get the quote capture amount
1015
+ if ($order === null) {
1016
  return $this->convertCaptureAmount($this->getQuote()->getBaseCurrencyCode(), $this->getQuote()->getQuoteCurrencyCode(), $amount);
1017
  }
1018
 
1056
  );
1057
 
1058
  // Shall we include the customer ID?
1059
+ if ($includeId) {
1060
  $customer['id'] = $this->getBraintreeId();
1061
  }
1062
 
1063
  // Handle empty data with alternatives
1064
+ if (empty($customer['firstName'])) {
1065
  $customer['firstName'] = $order->getBillingAddress()->getFirstname();
1066
  }
1067
+ if (empty($customer['lastName'])) {
1068
  $customer['lastName'] = $order->getBillingAddress()->getLastname();
1069
  }
1070
+ if (empty($customer['email'])) {
1071
  $customer['email'] = $order->getBillingAddress()->getEmail();
1072
  }
1073
 
1150
  public function parseErrors($braintreeErrors)
1151
  {
1152
  $errors = array();
1153
+ foreach ($braintreeErrors as $error) {
1154
  $errors[] = $error->code . ': ' . $this->parseMessage($error->message);
1155
  }
1156
 
1169
  return str_replace('nonce', 'token', $string);
1170
  }
1171
 
1172
+ /**
1173
+ * Update the API status in the config
1174
+ *
1175
+ * @param $status
1176
+ * @param $storeId
1177
+ *
1178
+ * @return mixed
1179
+ */
1180
+ protected function _updateApiStatus($status, $storeId = 0)
1181
+ {
1182
+ $apiStatus = Mage::getModel('core/variable')->setStoreId($storeId)->loadByCode(self::BRAINTREE_API_CONFIG_STATUS);
1183
+ if ($apiStatus->getId()) {
1184
+ $apiStatus->setPlainValue($status)->save();
1185
+ } else {
1186
+ Mage::getModel('core/variable')->setData(array(
1187
+ 'code' => self::BRAINTREE_API_CONFIG_STATUS,
1188
+ 'name' => self::BRAINTREE_API_CONFIG_STATUS,
1189
+ 'store_id' => $storeId,
1190
+ 'plain_value' => $status
1191
+ ))->save();
1192
+ }
1193
+
1194
+ return $status;
1195
+ }
1196
+
1197
+ /**
1198
+ * Get the API status from the core variable system
1199
+ *
1200
+ * @param bool|false $storeId
1201
+ *
1202
+ * @return bool|string
1203
+ * @throws \Exception
1204
+ */
1205
+ protected function _getApiStatus($storeId = false)
1206
+ {
1207
+ if ($storeId === false) {
1208
+ $storeId = Mage::app()->getStore()->getId();
1209
+ }
1210
+ $apiStatus = Mage::getModel('core/variable')->setStoreId($storeId)->loadByCode(self::BRAINTREE_API_CONFIG_STATUS)->getValue('text');
1211
+ if (!$apiStatus) {
1212
+ return $this->validateCredentials();
1213
+ }
1214
+
1215
+ return (bool) $apiStatus;
1216
+ }
1217
+
1218
  }
app/code/community/Gene/Braintree/controllers/Adminhtml/Braintree/MigrationController.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
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
+ {
10
+ /**
11
+ * Run the migration based on the users choice
12
+ *
13
+ * @return $this
14
+ */
15
+ public function runAction()
16
+ {
17
+ // If the system shouldn't run the migration don't allow this controller to initialize
18
+ if (!Mage::helper('gene_braintree')->shouldRunMigration()) {
19
+ $this->norouteAction();
20
+ return $this;
21
+ }
22
+
23
+ $actions = $this->getRequest()->getParam('migration');
24
+
25
+ /* @var $migration Gene_Braintree_Model_Migration */
26
+ $migration = Mage::getModel('gene_braintree/migration');
27
+
28
+ // Pass the users choices through to the migration model
29
+ $migration->setRunConfiguration(
30
+ (isset($actions['configuration-settings']) && $actions['configuration-settings'] == 'on')
31
+ );
32
+ $migration->setRunCustomerData(
33
+ (isset($actions['customer-data']) && $actions['customer-data'] == 'on')
34
+ );
35
+ $migration->setDisableLegacy(
36
+ (isset($actions['disable-legacy']) && $actions['disable-legacy'] == 'on'),
37
+ (isset($actions['remove-legacy']) && $actions['remove-legacy'] == 'on')
38
+ );
39
+
40
+ // Run the migration process
41
+ $result = $migration->process();
42
+
43
+ // Add a success message into the session
44
+ $this->_getSession()->addSuccess(Mage::helper('gene_braintree')->__('We have successfully migrated you from the Braintree Payments extension to the new Gene Braintree extension.'));
45
+
46
+ // Return a JSON response to the browser
47
+ return $this->_returnJson(array_merge(array(
48
+ 'success' => true
49
+ ), $result->debug()));
50
+ }
51
+
52
+ /**
53
+ * Cancelling the migration will ensure it doesn't appear again
54
+ *
55
+ * @return \Gene_Braintree_Adminhtml_Braintree_MigrationController
56
+ */
57
+ public function cancelAction()
58
+ {
59
+ // Update the configuration to log that the migration is complete
60
+ $config = Mage::getConfig();
61
+ $config->saveConfig(Gene_Braintree_Helper_Data::MIGRATION_COMPLETE, 1);
62
+ $config->cleanCache();
63
+
64
+ return $this->_returnJson(array('success' => true));
65
+ }
66
+
67
+ /**
68
+ * Return JSON to the browser
69
+ *
70
+ * @param $array
71
+ *
72
+ * @return $this
73
+ */
74
+ protected function _returnJson($array)
75
+ {
76
+ $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($array));
77
+ $this->getResponse()->setHeader('Content-type', 'application/json');
78
+
79
+ return $this;
80
+ }
81
+
82
+ }
app/code/community/Gene/Braintree/controllers/Adminhtml/BraintreeController.php CHANGED
@@ -7,7 +7,6 @@
7
  */
8
  class Gene_Braintree_Adminhtml_BraintreeController extends Mage_Adminhtml_Controller_Action
9
  {
10
-
11
  /**
12
  * Settlement report from Braintree
13
  */
@@ -28,7 +27,7 @@ class Gene_Braintree_Adminhtml_BraintreeController extends Mage_Adminhtml_Contro
28
  *
29
  * @return bool
30
  */
31
- private function _prepareExport($type = 'csv')
32
  {
33
  // Validate the search query session is set
34
  if($searchQuery = Mage::getSingleton('adminhtml/session')->getBraintreeSearchQuery()) {
@@ -73,6 +72,9 @@ class Gene_Braintree_Adminhtml_BraintreeController extends Mage_Adminhtml_Contro
73
  // Grab the post data from the request
74
  $postData = Mage::app()->getRequest()->getPost();
75
 
 
 
 
76
  // Check the form contains the valid data we need
77
  if(isset($postData['groups']['gene_braintree']['fields'])) {
78
 
@@ -80,18 +82,37 @@ class Gene_Braintree_Adminhtml_BraintreeController extends Mage_Adminhtml_Contro
80
  $braintreeConfig = $postData['groups']['gene_braintree']['fields'];
81
 
82
  // Validate the required variables are set before trying to access them
83
- if(isset($braintreeConfig['environment']) && isset($braintreeConfig['merchant_id']) && isset($braintreeConfig['public_key']) && isset($braintreeConfig['private_key'])) {
84
-
85
- // Setup the various configuration variables
86
- Braintree_Configuration::environment($braintreeConfig['environment']['value']);
87
- Braintree_Configuration::merchantId($braintreeConfig['merchant_id']['value']);
88
- Braintree_Configuration::publicKey($braintreeConfig['public_key']['value']);
89
- Braintree_Configuration::privateKey($braintreeConfig['private_key']['value']);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  }
91
  }
92
 
93
  // Do the validation within the wrapper
94
- Mage::app()->getResponse()->setBody(Mage::getModel('gene_braintree/wrapper_braintree')->validateCredentials(true, true, (isset($braintreeConfig['merchant_account_id']['value']) ? $braintreeConfig['merchant_account_id']['value'] : false)));
 
 
 
 
95
  }
96
 
97
  }
7
  */
8
  class Gene_Braintree_Adminhtml_BraintreeController extends Mage_Adminhtml_Controller_Action
9
  {
 
10
  /**
11
  * Settlement report from Braintree
12
  */
27
  *
28
  * @return bool
29
  */
30
+ protected function _prepareExport($type = 'csv')
31
  {
32
  // Validate the search query session is set
33
  if($searchQuery = Mage::getSingleton('adminhtml/session')->getBraintreeSearchQuery()) {
72
  // Grab the post data from the request
73
  $postData = Mage::app()->getRequest()->getPost();
74
 
75
+ // Assign the merchant account ID to false
76
+ $merchantAccountId = false;
77
+
78
  // Check the form contains the valid data we need
79
  if(isset($postData['groups']['gene_braintree']['fields'])) {
80
 
82
  $braintreeConfig = $postData['groups']['gene_braintree']['fields'];
83
 
84
  // Validate the required variables are set before trying to access them
85
+ if(isset($braintreeConfig['environment']) ) {
86
+
87
+ // Required fields to validate
88
+ if( $braintreeConfig['environment']['value'] == 'production' && isset($braintreeConfig['merchant_id']) && isset($braintreeConfig['public_key']) && isset($braintreeConfig['private_key']) ||
89
+ $braintreeConfig['environment']['value'] == 'sandbox' && isset($braintreeConfig['sandbox_merchant_id']) && isset($braintreeConfig['sandbox_public_key']) && isset($braintreeConfig['sandbox_private_key']) ) {
90
+
91
+ // Setup the various configuration variables
92
+ Braintree_Configuration::environment($braintreeConfig['environment']['value']);
93
+
94
+ // Production keys
95
+ if ($braintreeConfig['environment']['value'] == 'production') {
96
+ Braintree_Configuration::merchantId($braintreeConfig['merchant_id']['value']);
97
+ Braintree_Configuration::publicKey($braintreeConfig['public_key']['value']);
98
+ Braintree_Configuration::privateKey($braintreeConfig['private_key']['value']);
99
+ $merchantAccountId = (isset($braintreeConfig['merchant_account_id']['value']) ? $braintreeConfig['merchant_account_id']['value'] : false);
100
+ } else if ($braintreeConfig['environment']['value'] == 'sandbox') {
101
+ Braintree_Configuration::merchantId($braintreeConfig['sandbox_merchant_id']['value']);
102
+ Braintree_Configuration::publicKey($braintreeConfig['sandbox_public_key']['value']);
103
+ Braintree_Configuration::privateKey($braintreeConfig['sandbox_private_key']['value']);
104
+ $merchantAccountId = (isset($braintreeConfig['sandbox_merchant_account_id']['value']) ? $braintreeConfig['sandbox_merchant_account_id']['value'] : false);
105
+ }
106
+ }
107
  }
108
  }
109
 
110
  // Do the validation within the wrapper
111
+ Mage::app()->getResponse()->setBody(Mage::getModel('gene_braintree/wrapper_braintree')->validateCredentials(
112
+ true,
113
+ true,
114
+ $merchantAccountId
115
+ ));
116
  }
117
 
118
  }
app/code/community/Gene/Braintree/controllers/CheckoutController.php CHANGED
@@ -36,12 +36,22 @@ class Gene_Braintree_CheckoutController extends Mage_Core_Controller_Front_Actio
36
 
37
  }
38
 
 
 
 
 
 
 
 
 
 
 
39
  // Build up our JSON response
40
  $jsonResponse = array(
41
  'billingName' => $billingName,
42
  'billingPostcode' => $billingPostcode,
43
- 'grandTotal' => Mage::helper('gene_braintree')->formatPrice($quote->getGrandTotal()),
44
- 'currencyCode' => $quote->getQuoteCurrencyCode(),
45
  'threeDSecure' => Mage::getSingleton('gene_braintree/paymentmethod_creditcard')->is3DEnabled()
46
  );
47
 
@@ -87,25 +97,35 @@ class Gene_Braintree_CheckoutController extends Mage_Core_Controller_Front_Actio
87
  public function vaultToNonceAction()
88
  {
89
  // Check we have a nonce in the request
90
- if($nonce = $this->getRequest()->getParam('nonce')) {
91
 
92
  // Retrieve the billing address
93
- if(!$this->getRequest()->getParam('billing')) {
94
  return $this->_returnJson(array(
95
  'success' => false,
96
  'error' => 'Billing address is not present'
97
  ));
98
  }
99
 
 
 
 
 
 
 
 
100
  // Create a new payment method in the vault
101
  $wrapper = Mage::getSingleton('gene_braintree/wrapper_braintree');
102
  $wrapper->init();
103
 
104
  // Retrieve and convert the billing address
105
- $billingAddress = $wrapper->convertBillingAddress($this->getRequest()->getParam('billing'));
106
 
107
  $token = false;
108
 
 
 
 
109
  try {
110
  if ($wrapper->checkIsCustomer()) {
111
  $response = $wrapper->storeInVault($nonce, $billingAddress);
36
 
37
  }
38
 
39
+ // Currency mapping
40
+ if(Mage::getSingleton('gene_braintree/wrapper_braintree')->hasMappedCurrencyCode()) {
41
+ $grandTotal = $quote->getGrandTotal();
42
+ $currencyCode = $quote->getQuoteCurrencyCode();
43
+ }
44
+ else {
45
+ $grandTotal = $quote->getBaseGrandTotal();
46
+ $currencyCode = $quote->getBaseCurrencyCode();
47
+ }
48
+
49
  // Build up our JSON response
50
  $jsonResponse = array(
51
  'billingName' => $billingName,
52
  'billingPostcode' => $billingPostcode,
53
+ 'grandTotal' => Mage::helper('gene_braintree')->formatPrice( $grandTotal ),
54
+ 'currencyCode' => $currencyCode,
55
  'threeDSecure' => Mage::getSingleton('gene_braintree/paymentmethod_creditcard')->is3DEnabled()
56
  );
57
 
97
  public function vaultToNonceAction()
98
  {
99
  // Check we have a nonce in the request
100
+ if ($nonce = $this->getRequest()->getParam('nonce')) {
101
 
102
  // Retrieve the billing address
103
+ if (!$this->getRequest()->getParam('billing')) {
104
  return $this->_returnJson(array(
105
  'success' => false,
106
  'error' => 'Billing address is not present'
107
  ));
108
  }
109
 
110
+ // Pull the billing address from the multishipping experience
111
+ if ($this->getRequest()->getParam('billing') == 'multishipping') {
112
+ $billing = Mage::getSingleton('checkout/type_multishipping')->getQuote()->getBillingAddress();
113
+ } else {
114
+ $billing = $this->getRequest()->getParam('billing');
115
+ }
116
+
117
  // Create a new payment method in the vault
118
  $wrapper = Mage::getSingleton('gene_braintree/wrapper_braintree');
119
  $wrapper->init();
120
 
121
  // Retrieve and convert the billing address
122
+ $billingAddress = $wrapper->convertBillingAddress($billing);
123
 
124
  $token = false;
125
 
126
+ // Store the vaulted nonce in the session
127
+ Mage::getSingleton('checkout/session')->setVaultedNonce($nonce);
128
+
129
  try {
130
  if ($wrapper->checkIsCustomer()) {
131
  $response = $wrapper->storeInVault($nonce, $billingAddress);
app/code/community/Gene/Braintree/controllers/ExpressController.php ADDED
@@ -0,0 +1,330 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
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
+ {
10
+
11
+ /**
12
+ * @var Mage_Sales_Model_Quote
13
+ */
14
+ protected $_quote;
15
+
16
+ /**
17
+ * Prevent access if disabled
18
+ */
19
+ public function preDispatch()
20
+ {
21
+ if (!Mage::getStoreConfig('payment/gene_braintree_paypal/express_active')) {
22
+ $this->setFlag('', 'no-dispatch', true);
23
+
24
+ return;
25
+ }
26
+
27
+ parent::preDispatch();
28
+ }
29
+
30
+ /**
31
+ * Load the quote based on the session data or create a new one
32
+ *
33
+ * @return Mage_Sales_Model_Quote
34
+ */
35
+ protected function _getQuote()
36
+ {
37
+ if ($this->_quote) {
38
+ return $this->_quote;
39
+ }
40
+
41
+ // Use the cart quote
42
+ if (Mage::getSingleton('core/session')->getBraintreeExpressSource() == 'cart') {
43
+ $this->_quote = Mage::getSingleton('checkout/session')->getQuote();
44
+ } // Create the quote a'new
45
+ else {
46
+ $store = Mage::app()->getStore();
47
+ $this->_quote = Mage::getModel('sales/quote')->setStoreId($store->getId());
48
+ $quoteId = Mage::getSingleton('core/session')->getBraintreeExpressQuote();
49
+
50
+ if ($quoteId) {
51
+ $this->_quote = $this->_quote->load($quoteId);
52
+ } else {
53
+ $this->_quote->reserveOrderId();
54
+ }
55
+ }
56
+
57
+ return $this->_quote;
58
+ }
59
+
60
+ /**
61
+ * Set up the quote based on Paypal's response.
62
+ *
63
+ * @return Mage_Core_Controller_Varien_Action|void
64
+ * @throws Exception
65
+ */
66
+ public function authorizationAction()
67
+ {
68
+ parse_str($this->getRequest()->getParam('form_data'), $formData);
69
+
70
+ // Validate form key
71
+ if (Mage::getSingleton('core/session')->getFormKey() != $formData['form_key']) {
72
+ Mage::getSingleton('core/session')->addError(Mage::helper('gene_braintree')->__('We were unable to start the express checkout.'));
73
+
74
+ return $this->_redirect("braintree/express/error");
75
+ }
76
+
77
+ // Clean up
78
+ Mage::getSingleton('core/session')->setBraintreeExpressQuote(null);
79
+ Mage::getSingleton('core/session')->setBraintreeNonce(null);
80
+
81
+ // Where the user came from - product or cart page
82
+ if (!isset($formData['source'])) {
83
+ $formData['source'] = "product";
84
+ }
85
+ Mage::getSingleton('core/session')->setBraintreeExpressSource($formData['source']);
86
+
87
+ $paypal = json_decode($this->getRequest()->getParam('paypal'), true);
88
+ // Check for a valid nonce
89
+ if (!isset($paypal['nonce']) || empty($paypal['nonce'])) {
90
+ Mage::getSingleton('core/session')->addError(Mage::helper('gene_braintree')->__('We were unable to process the response from PayPal. Please try again.'));
91
+
92
+ return $this->_redirect("braintree/express/error");
93
+ }
94
+
95
+ // Check paypal sent an address
96
+ if (!isset($paypal['details']['shippingAddress']) || !isset($paypal['details']['email'])) {
97
+ Mage::getSingleton('core/session')->addError(Mage::helper('gene_braintree')->__('Please provide a shipping address.'));
98
+
99
+ return $this->_redirect("braintree/express/error");
100
+ }
101
+
102
+ Mage::getModel('core/session')->setBraintreeNonce($paypal['nonce']);
103
+ $paypalData = $paypal['details'];
104
+ $quote = $this->_getQuote();
105
+
106
+ // Pass the customer into the quote
107
+ if (Mage::getSingleton('customer/session')->isLoggedIn()) {
108
+ $quote->setCustomer(Mage::getSingleton('customer/session')->getCustomer());
109
+ } else {
110
+ // Save the email address
111
+ $quote->setCustomerEmail($paypalData['email']);
112
+ }
113
+
114
+ // Is this express checkout request coming from the product page?
115
+ if (isset($formData['product']) && isset($formData['qty'])) {
116
+ $product = Mage::getModel('catalog/product')->load($formData['product']);
117
+ if (!$product->getId()) {
118
+ Mage::getSingleton('core/session')->addError(Mage::helper('gene_braintree')->__('We\'re unable to load that product.'));
119
+
120
+ return $this->_redirect("braintree/express/error");
121
+ }
122
+
123
+ // Build up the add request
124
+ $request = new Varien_Object($formData);
125
+
126
+ // Attempt to add the product into the quote
127
+ try {
128
+ $quote->addProduct($product, $request);
129
+ } catch (Exception $e) {
130
+ Mage::getSingleton('core/session')->addError(Mage::helper('gene_braintree')->__('Sorry, we were unable to process your request. Please try again.'));
131
+
132
+ return $this->_redirect("braintree/express/error");
133
+ }
134
+ }
135
+
136
+ // Build the address
137
+ list($firstName, $lastName) = explode(" ", $paypalData['shippingAddress']['recipientName'], 2);
138
+
139
+ $address = Mage::getModel('sales/quote_address');
140
+ $address->setFirstname($firstName)
141
+ ->setLastname($lastName)
142
+ ->setStreet($paypalData['shippingAddress']['extendedAddress'] . ' ' . $paypalData['shippingAddress']['streetAddress'])
143
+ ->setCity($paypalData['shippingAddress']['locality'])
144
+ ->setCountryId($paypalData['shippingAddress']['countryCodeAlpha2'])
145
+ ->setPostcode($paypalData['shippingAddress']['postalCode'])
146
+ ->setTelephone('0000000000');
147
+
148
+ // Check if the region is needed
149
+ if (Mage::helper('directory')->isRegionRequired($address->getCountryId())) {
150
+ $region = Mage::getModel('directory/region')->loadbyCode($paypalData['shippingAddress']['region'], $address->getCountryId());
151
+ $regionId = $region->getRegionId();
152
+
153
+ if (empty($regionId)) {
154
+ Mage::getSingleton('core/session')->addError(Mage::helper('gene_braintree')->__('We were unable to process the country.'));
155
+
156
+ return $this->_redirect("braintree/express/error");
157
+ }
158
+
159
+ $address->setRegionId($region->getRegionId());
160
+ }
161
+
162
+ // Save the addresses
163
+ $quote->setShippingAddress($address);
164
+ $quote->setBillingAddress($address);
165
+
166
+ // Store quote id in session
167
+ $quote->save();
168
+ Mage::getSingleton('core/session')->setBraintreeExpressQuote($quote->getId());
169
+
170
+ // redirect to choose shipping method
171
+ return $this->_redirect("braintree/express/shipping");
172
+ }
173
+
174
+ /**
175
+ * Display shipping methods for the user to select.
176
+ *
177
+ * @return Mage_Core_Controller_Varien_Action
178
+ * @throws Exception
179
+ */
180
+ public function shippingAction()
181
+ {
182
+ $quote = $this->_getQuote();
183
+ $quote->setTotalsCollectedFlag(false)->collectTotals()->save();
184
+
185
+ // collect shipping rates
186
+ $quote->getShippingAddress()->removeAllShippingRates();
187
+ $quote->getShippingAddress()->setCollectShippingRates(true)->collectShippingRates();
188
+
189
+ // Get the shipping rates
190
+ $shippingRates = $quote->getShippingAddress()->getShippingRatesCollection();
191
+
192
+ // Save the shipping method
193
+ $submitShipping = $this->getRequest()->getParam('submit_shipping');
194
+ if (!empty($submitShipping)) {
195
+
196
+ // If the quote is virtual process the order without a shipping method
197
+ if ($quote->isVirtual()) {
198
+ return $this->_redirect("braintree/express/process");
199
+ }
200
+
201
+ // Check the shipping rate we want to use is available
202
+ $method = $this->getRequest()->getParam('shipping_method');
203
+ if (!empty($method) && $quote->getShippingAddress()->getShippingRateByCode($method)) {
204
+ $quote->getShippingAddress()->setShippingMethod($method);
205
+ $quote->setTotalsCollectedFlag(false)->collectTotals()->save();
206
+
207
+ // Redirect to confirm payment
208
+ return $this->_redirect("braintree/express/process");
209
+ }
210
+
211
+ // Missing a valid shipping method
212
+ Mage::getSingleton('core/session')->addWarning(Mage::helper('gene_braintree')->__('Please select a shipping method.'));
213
+ }
214
+
215
+ // Recollect the totals
216
+ $quote->setTotalsCollectedFlag(false)->collectTotals();
217
+
218
+ // Build up the totals block
219
+ /* @var $totals Mage_Checkout_Block_Cart_Totals */
220
+ $totals = $this->getLayout()->createBlock('checkout/cart_totals')
221
+ ->setTemplate('checkout/cart/totals.phtml')
222
+ ->setCustomQuote($this->_getQuote());
223
+
224
+ // View to select shipping method
225
+ $block = $this->getLayout()->createBlock('gene_braintree/express_checkout')
226
+ ->setChild('totals', $totals)
227
+ ->setTemplate('gene/braintree/express/shipping_details.phtml')
228
+ ->setShippingRates($shippingRates)
229
+ ->setQuote($quote);
230
+
231
+ $this->getResponse()->setBody($block->toHtml());
232
+ }
233
+
234
+ /**
235
+ * Saving a shipping action will update the quote and then provide new totals
236
+ *
237
+ * @return \Mage_Core_Controller_Varien_Action|string
238
+ */
239
+ public function saveShippingAction()
240
+ {
241
+ $quote = $this->_getQuote();
242
+ $quote->setTotalsCollectedFlag(false)->collectTotals()->save();
243
+
244
+ // collect shipping rates
245
+ $quote->getShippingAddress()->removeAllShippingRates();
246
+ $quote->getShippingAddress()->setCollectShippingRates(true)->collectShippingRates();
247
+
248
+ // Save the shipping method
249
+ $submitShipping = $this->getRequest()->getParam('submit_shipping');
250
+ if (!empty($submitShipping)) {
251
+
252
+ // Check the shipping rate we want to use is available
253
+ $method = $this->getRequest()->getParam('shipping_method');
254
+ if (!empty($method) && $quote->getShippingAddress()->getShippingRateByCode($method)) {
255
+ $quote->getShippingAddress()->setShippingMethod($method);
256
+ $quote->setTotalsCollectedFlag(false)->collectTotals()->save();
257
+ }
258
+ }
259
+
260
+ // Build up the totals block
261
+ /* @var $totals Mage_Checkout_Block_Cart_Totals */
262
+ $totals = $this->getLayout()->createBlock('checkout/cart_totals')
263
+ ->setTemplate('checkout/cart/totals.phtml')
264
+ ->setCustomQuote($this->_getQuote());
265
+
266
+ // Set the body in the response
267
+ $this->getResponse()->setBody($totals->toHtml());
268
+ }
269
+
270
+ /**
271
+ * Take the payment.
272
+ */
273
+ public function processAction()
274
+ {
275
+ $quote = $this->_getQuote();
276
+ $quote->setTotalsCollectedFlag(false)->collectTotals()->save();
277
+
278
+ // Set payment method
279
+ $paymentMethod = $quote->getPayment();
280
+ $paymentMethod->setMethod('gene_braintree_paypal');
281
+ $paymentMethod->setAdditionalInformation('payment_method_nonce', Mage::getModel('core/session')->getBraintreeNonce());
282
+ $quote->setPayment($paymentMethod);
283
+
284
+ // Convert quote to order
285
+ $convert = Mage::getSingleton('sales/convert_quote');
286
+
287
+ /* @var $order Mage_Sales_Model_Order */
288
+ $order = $convert->toOrder($quote);
289
+ $order->setShippingAddress($convert->addressToOrderAddress($quote->getShippingAddress()));
290
+ $order->setBillingAddress($convert->addressToOrderAddress($quote->getBillingAddress()));
291
+ $order->setPayment($convert->paymentToOrderPayment($quote->getPayment()));
292
+
293
+ // Add the items
294
+ foreach ($quote->getAllItems() as $item) {
295
+ $order->addItem($convert->itemToOrderItem($item));
296
+ }
297
+
298
+ // Set the order as complete
299
+ $service = Mage::getModel('sales/service_quote', $order->getQuote());
300
+ $service->submitAll();
301
+ $order = $service->getOrder();
302
+
303
+ // Send the new order email
304
+ $order->sendNewOrderEmail();
305
+
306
+ // Cleanup
307
+ Mage::getSingleton('core/session')->setBraintreeExpressQuote(null);
308
+ Mage::getSingleton('core/session')->setBraintreeNonce(null);
309
+ Mage::getSingleton('core/session')->setBraintreeExpressSource(null);
310
+
311
+ // Redirect to thank you page
312
+ Mage::getSingleton('checkout/session')->setLastSuccessQuoteId($quote->getId());
313
+ Mage::getSingleton('checkout/session')->setLastQuoteId($quote->getId());
314
+ Mage::getSingleton('checkout/session')->setLastOrderId($order->getId());
315
+ $this->getResponse()->setBody('complete');
316
+ }
317
+
318
+ /**
319
+ * Display order summary.
320
+ */
321
+ public function errorAction()
322
+ {
323
+ // View to select shipping method
324
+ $block = $this->getLayout()->createBlock('gene_braintree/express_checkout')
325
+ ->setTemplate('gene/braintree/express/error.phtml');
326
+
327
+ $this->getResponse()->setBody($block->toHtml());
328
+ }
329
+
330
+ }
app/code/community/Gene/Braintree/controllers/Kount/EnsController.php ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
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
+ {
10
+ /**
11
+ * Handle an incoming ENS request
12
+ *
13
+ * @return \Zend_Controller_Response_Abstract
14
+ * @throws \Mage_Core_Exception
15
+ */
16
+ public function indexAction()
17
+ {
18
+ /* @var $ens Gene_Braintree_Model_Kount_Ens */
19
+ $ens = Mage::getModel('gene_braintree/kount_ens');
20
+
21
+ /* @var $http Mage_Core_Helper_Http */
22
+ $http = Mage::helper('core/http');
23
+
24
+ // Validate the IP address of the request
25
+ if (!$ens->isValidEnsIp($http->getRemoteAddr())) {
26
+ Gene_Braintree_Model_Debug::log('Invalid IP for ENS request: ' . $http->getRemoteAddr());
27
+ Mage::throwException('Invalid ENS request.');
28
+ }
29
+
30
+ // Retrieve the XML sent in the HTTP POST request to the ResponseHandler
31
+ $request = (isset($GLOBALS['HTTP_RAW_POST_DATA']) ? $GLOBALS['HTTP_RAW_POST_DATA'] : file_get_contents('php://input'));
32
+ if (!$request || strlen($request) == 0) {
33
+ Mage::throwException('Invalid ENS request.');
34
+ }
35
+
36
+ // Log the ENS requests for later debugging
37
+ Gene_Braintree_Model_Debug::log('Kount ENS Request:');
38
+ Gene_Braintree_Model_Debug::log($request);
39
+
40
+ try {
41
+ // Parse the request into an array
42
+ $xmlParser = new Mage_Xml_Parser();
43
+ $events = $xmlParser->loadXML($request)->xmlToArray();
44
+
45
+ // Ensure the events contain a value, and a merchant attribute
46
+ if (!isset($events['events']['_value']) || !isset($events['events']['_attribute']['merchant'])) {
47
+ Mage::throwException('Invalid ENS XML.');
48
+ }
49
+
50
+ // Validate the merchant ID against the Magento settings
51
+ if (!$ens->validateStoreForMerchantId($events['events']['_attribute']['merchant'])) {
52
+ Mage::throwException('Invalid Merchant ID provided.');
53
+ }
54
+
55
+ } catch (Exception $e) {
56
+ Gene_Braintree_Model_Debug::log('Unable to parse ENS request into an array');
57
+ Gene_Braintree_Model_Debug::log($e);
58
+ Mage::throwException('Unable to parse ENS request into an array: ' . $e->getMessage());
59
+ }
60
+
61
+ $totalSuccess = 0;
62
+ $totalFailed = 0;
63
+
64
+ // Are we processing a single event?
65
+ if (isset($events['events']['_value']['event']['name'])) {
66
+ if ($ens->processEvent($events['events']['_value']['event'])) {
67
+ ++$totalSuccess;
68
+ } else {
69
+ ++$totalFailed;
70
+ }
71
+ } else {
72
+ // Or are there multiple events within the request?
73
+ foreach ($events['events']['_value']['event'] as $event) {
74
+ if ($ens->processEvent($event)) {
75
+ ++$totalSuccess;
76
+ } else {
77
+ ++$totalFailed;
78
+ }
79
+ }
80
+ }
81
+
82
+ // Build an XML response for the ENS request
83
+ $xmlResponse = <<<EXML
84
+ <?xml version="1.0" encoding="UTF-8"?>
85
+ <eventResponse successes="$totalSuccess" failures="$totalFailed">
86
+ </eventResponse>
87
+ EXML;
88
+
89
+ // Send the response
90
+ return $this->getResponse()
91
+ ->clearHeaders()
92
+ ->setHeader('Content-Type', 'text/xml')
93
+ ->setBody($xmlResponse);
94
+ }
95
+ }
app/code/community/Gene/Braintree/controllers/SavedController.php CHANGED
@@ -32,6 +32,8 @@ class Gene_Braintree_SavedController extends Mage_Core_Controller_Front_Action
32
 
33
  /**
34
  * Show the listing page of saved payment information
 
 
35
  */
36
  public function indexAction()
37
  {
@@ -42,7 +44,7 @@ class Gene_Braintree_SavedController extends Mage_Core_Controller_Front_Action
42
 
43
  $this->getLayout()->getBlock('head')->setTitle($this->__('Saved Payment Information'));
44
 
45
- $this->renderLayout();
46
  }
47
 
48
  /**
@@ -54,39 +56,149 @@ class Gene_Braintree_SavedController extends Mage_Core_Controller_Front_Action
54
  */
55
  public function removeAction()
56
  {
57
- // Check we've recieved a payment ID
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  $token = $this->getRequest()->getParam('id');
59
- if(!$token) {
60
- $this->_getSession()->addError('Please select a saved payment entry to remove.');
61
- return $this->_redirectReferer();
 
 
62
  }
63
 
64
  // Grab a new instance of the wrapper
65
- $wrapper = Mage::getModel('gene_braintree/wrapper_braintree');
66
 
67
- // Init the braintree wrapper
68
  $wrapper->init();
69
 
70
  // Load the payment method from Braintree
71
  try {
72
  $paymentMethod = Braintree_PaymentMethod::find($token);
73
  } catch (Exception $e) {
74
- $this->_getSession()->addError('The requested payment method cannot be found.');
75
- return $this->_redirectReferer();
 
 
76
  }
77
 
78
  // Check that this is the users payment method, we have to use a custom method as Braintree don't return the PayPal customer ID
79
- if(!$wrapper->customerOwnsMethod($paymentMethod)) {
80
- $this->_getSession()->addError('You do not have permission to modify this payment method.');
81
- return $this->_redirectReferer();
82
- }
83
 
84
- // Remove the payment method
85
- Braintree_PaymentMethod::delete($token);
 
86
 
87
- // Inform the user of the great news
88
- $this->_getSession()->addSuccess('Saved payment has been successfully deleted.');
89
- return $this->_redirectReferer();
90
  }
91
 
92
  }
32
 
33
  /**
34
  * Show the listing page of saved payment information
35
+ *
36
+ * @return \Mage_Core_Controller_Varien_Action
37
  */
38
  public function indexAction()
39
  {
44
 
45
  $this->getLayout()->getBlock('head')->setTitle($this->__('Saved Payment Information'));
46
 
47
+ return $this->renderLayout();
48
  }
49
 
50
  /**
56
  */
57
  public function removeAction()
58
  {
59
+ // Init the payment method
60
+ $paymentMethod = $this->_initPaymentMethod();
61
+
62
+ // Method returns false if a redirect is going to occur
63
+ if ($paymentMethod === false) {
64
+ return false;
65
+ }
66
+
67
+ // Remove the payment method
68
+ Braintree_PaymentMethod::delete($paymentMethod->token);
69
+
70
+ // Inform the user of the great news
71
+ $this->_getSession()->addSuccess($this->__('Saved payment has been successfully deleted.'));
72
+
73
+ return $this->_redirectReferer();
74
+ }
75
+
76
+ /**
77
+ * Allow a user to edit details of a payment method
78
+ *
79
+ * @return bool|\Mage_Core_Controller_Varien_Action
80
+ */
81
+ public function editAction()
82
+ {
83
+ // Init the payment method
84
+ $paymentMethod = $this->_initPaymentMethod();
85
+
86
+ // Method returns false if a redirect is going to occur
87
+ if ($paymentMethod === false) {
88
+ return false;
89
+ }
90
+
91
+ // Store the payment method in the registry
92
+ Mage::register('current_payment_method', $paymentMethod);
93
+
94
+ $this->loadLayout();
95
+
96
+ $navigationBlock = $this->getLayout()->getBlock('customer_account_navigation');
97
+ if ($navigationBlock) {
98
+ $navigationBlock->setActive('braintree/saved');
99
+ }
100
+
101
+ $this->_initLayoutMessages('customer/session');
102
+ $this->_initLayoutMessages('catalog/session');
103
+
104
+ $this->getLayout()->getBlock('head')->setTitle($this->__('Edit Payment Method'));
105
+
106
+ return $this->renderLayout();
107
+ }
108
+
109
+ /**
110
+ * Saving the payment methods update
111
+ *
112
+ * @return bool|\Mage_Core_Controller_Varien_Action
113
+ */
114
+ public function saveAction()
115
+ {
116
+ // Init the payment method
117
+ $paymentMethod = $this->_initPaymentMethod();
118
+
119
+ // Method returns false if a redirect is going to occur
120
+ if ($paymentMethod === false) {
121
+ return false;
122
+ }
123
+
124
+ // Build up our billing address array
125
+ $billing = $this->getRequest()->getParam('billing');
126
+ $billing['firstname'] = $this->getRequest()->getParam('firstname');
127
+ $billing['middlename'] = $this->getRequest()->getParam('middlename');
128
+ $billing['lastname'] = $this->getRequest()->getParam('lastname');
129
+
130
+ // Create the Braintree address array
131
+ $address = Mage::getModel('customer/address')->addData($billing);
132
+ $braintreeAddress = Mage::helper('gene_braintree')->convertToBraintreeAddress($address);
133
+
134
+ // Retrieve the new payment information
135
+ $payment = $this->getRequest()->getParam('payment');
136
+
137
+ // Build up the array of updates we're wanting to complete
138
+ $updateMethod = array(
139
+ 'billingAddress' => $braintreeAddress,
140
+ 'expirationMonth' => $payment['cc_exp_month'],
141
+ 'expirationYear' => $payment['cc_exp_year']
142
+ );
143
+
144
+ try {
145
+ // Update the payment method
146
+ $result = Braintree_PaymentMethod::update($this->getRequest()->getParam('id'), $updateMethod);
147
+ if ($result->success == true) {
148
+ $this->_getSession()->addSuccess($this->__('The payment method has been updated successfully.'));
149
+ return $this->_redirect('*/*/index');
150
+ } else {
151
+ $this->_getSession()->addSuccess($this->__('An error has occurred whilst updating your payment method: ' . $result->message));
152
+ return $this->_redirect('*/*/index');
153
+ }
154
+ } catch (Exception $e) {
155
+ $this->_getSession()->addError($this->__('An error has occurred whilst trying to update the payment method: %s', $e->getMessage()));
156
+ return $this->_redirect('*/*/index');
157
+ }
158
+
159
+ }
160
+
161
+ /**
162
+ * Init the payment method
163
+ *
164
+ * @return \Mage_Core_Controller_Varien_Action|object
165
+ */
166
+ protected function _initPaymentMethod()
167
+ {
168
+ // Check we've received a payment ID
169
  $token = $this->getRequest()->getParam('id');
170
+ if (!$token) {
171
+ $this->_getSession()->addError($this->__('You have to select a saved payment method to conduct this action.'));
172
+
173
+ $this->_redirect('braintree/saved/index');
174
+ return false;
175
  }
176
 
177
  // Grab a new instance of the wrapper
178
+ $wrapper = Mage::getSingleton('gene_braintree/wrapper_braintree');
179
 
180
+ // Init the Braintree wrapper
181
  $wrapper->init();
182
 
183
  // Load the payment method from Braintree
184
  try {
185
  $paymentMethod = Braintree_PaymentMethod::find($token);
186
  } catch (Exception $e) {
187
+ $this->_getSession()->addError($this->__('The requested payment method cannot be found.'));
188
+
189
+ $this->_redirectReferer();
190
+ return false;
191
  }
192
 
193
  // Check that this is the users payment method, we have to use a custom method as Braintree don't return the PayPal customer ID
194
+ if (!$wrapper->customerOwnsMethod($paymentMethod)) {
195
+ $this->_getSession()->addError($this->__('You do not have permission to modify this payment method.'));
 
 
196
 
197
+ $this->_redirectReferer();
198
+ return false;
199
+ }
200
 
201
+ return $paymentMethod;
 
 
202
  }
203
 
204
  }
app/code/community/Gene/Braintree/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Gene_Braintree>
5
- <version>1.0.5.4</version>
6
  </Gene_Braintree>
7
  </modules>
8
  <global>
@@ -36,7 +36,7 @@
36
  <gene_braintree_setup>
37
  <setup>
38
  <module>Gene_Braintree</module>
39
- <class>Mage_Eav_Model_Entity_Setup</class>
40
  </setup>
41
  </gene_braintree_setup>
42
  </resources>
@@ -52,6 +52,20 @@
52
  </types>
53
  </cc>
54
  </payment>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  </global>
56
 
57
  <!-- Default values for the system configuration pages -->
@@ -66,6 +80,7 @@
66
  <!-- PayPal method -->
67
  <gene_braintree_paypal>
68
  <active>0</active>
 
69
  <model>gene_braintree/paymentmethod_paypal</model>
70
  <order_status>processing</order_status>
71
  <payment_action>authorize_capture</payment_action>
@@ -86,7 +101,7 @@
86
  <title>Credit Card (Braintree)</title>
87
  <environment>sandbox</environment>
88
  <allowspecific>0</allowspecific>
89
- <form_integration>default</form_integration>
90
  <use_vault>0</use_vault>
91
  <threedsecure>0</threedsecure>
92
  <threedsecure_threshold>0</threedsecure_threshold>
@@ -94,9 +109,14 @@
94
  </gene_braintree_creditcard>
95
 
96
  </payment>
 
97
  </default>
98
 
99
  <frontend>
 
 
 
 
100
  <layout>
101
  <updates>
102
  <gene_braintree module="Gene_Braintree">
@@ -145,6 +165,36 @@
145
  </gene_braintree_detect_checkout>
146
  </observers>
147
  </controller_action_layout_load_before>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  </events>
149
  </frontend>
150
 
@@ -187,6 +237,16 @@
187
  </check_compilation>
188
  </observers>
189
  </controller_action_postdispatch>
 
 
 
 
 
 
 
 
 
 
190
  </events>
191
  </adminhtml>
192
 
2
  <config>
3
  <modules>
4
  <Gene_Braintree>
5
+ <version>2.0.0</version>
6
  </Gene_Braintree>
7
  </modules>
8
  <global>
36
  <gene_braintree_setup>
37
  <setup>
38
  <module>Gene_Braintree</module>
39
+ <class>Gene_Braintree_Model_Entity_Setup</class>
40
  </setup>
41
  </gene_braintree_setup>
42
  </resources>
52
  </types>
53
  </cc>
54
  </payment>
55
+
56
+ <events>
57
+ <!-- Add an include path for the Braintree SDK -->
58
+ <controller_front_init_before>
59
+ <observers>
60
+ <gene_braintree_include_path>
61
+ <type>singleton</type>
62
+ <class>gene_braintree/observer</class>
63
+ <method>addIncludePath</method>
64
+ </gene_braintree_include_path>
65
+ </observers>
66
+ </controller_front_init_before>
67
+ </events>
68
+
69
  </global>
70
 
71
  <!-- Default values for the system configuration pages -->
80
  <!-- PayPal method -->
81
  <gene_braintree_paypal>
82
  <active>0</active>
83
+ <express_active>1</express_active>
84
  <model>gene_braintree/paymentmethod_paypal</model>
85
  <order_status>processing</order_status>
86
  <payment_action>authorize_capture</payment_action>
101
  <title>Credit Card (Braintree)</title>
102
  <environment>sandbox</environment>
103
  <allowspecific>0</allowspecific>
104
+ <form_integration>hosted</form_integration>
105
  <use_vault>0</use_vault>
106
  <threedsecure>0</threedsecure>
107
  <threedsecure_threshold>0</threedsecure_threshold>
109
  </gene_braintree_creditcard>
110
 
111
  </payment>
112
+
113
  </default>
114
 
115
  <frontend>
116
+ <secure_url>
117
+ <braintree>/braintree/saved/</braintree>
118
+ </secure_url>
119
+
120
  <layout>
121
  <updates>
122
  <gene_braintree module="Gene_Braintree">
165
  </gene_braintree_detect_checkout>
166
  </observers>
167
  </controller_action_layout_load_before>
168
+
169
+ <core_block_abstract_to_html_before>
170
+ <observers>
171
+ <gene_braintree_saved_child>
172
+ <type>singleton</type>
173
+ <class>gene_braintree/observer</class>
174
+ <method>addSavedChild</method>
175
+ </gene_braintree_saved_child>
176
+ </observers>
177
+ </core_block_abstract_to_html_before>
178
+
179
+ <controller_action_predispatch_checkout_multishipping_overviewPost>
180
+ <observers>
181
+ <gene_braintree_reset_multishipping>
182
+ <type>singleton</type>
183
+ <class>gene_braintree/observer</class>
184
+ <method>resetMultishipping</method>
185
+ </gene_braintree_reset_multishipping>
186
+ </observers>
187
+ </controller_action_predispatch_checkout_multishipping_overviewPost>
188
+
189
+ <checkout_type_multishipping_create_orders_single>
190
+ <observers>
191
+ <gene_braintree_multishipping>
192
+ <type>singleton</type>
193
+ <class>gene_braintree/observer</class>
194
+ <method>handleMultishipping</method>
195
+ </gene_braintree_multishipping>
196
+ </observers>
197
+ </checkout_type_multishipping_create_orders_single>
198
  </events>
199
  </frontend>
200
 
237
  </check_compilation>
238
  </observers>
239
  </controller_action_postdispatch>
240
+
241
+ <core_block_abstract_to_html_before>
242
+ <observers>
243
+ <gene_braintree_saved_child>
244
+ <type>singleton</type>
245
+ <class>gene_braintree/observer</class>
246
+ <method>addSavedChild</method>
247
+ </gene_braintree_saved_child>
248
+ </observers>
249
+ </core_block_abstract_to_html_before>
250
  </events>
251
  </adminhtml>
252
 
app/code/community/Gene/Braintree/etc/system.xml CHANGED
@@ -62,6 +62,9 @@
62
  <show_in_website>1</show_in_website>
63
  <show_in_store>0</show_in_store>
64
  <frontend_class>validate-config</frontend_class>
 
 
 
65
  </merchant_id>
66
 
67
  <merchant_account_id translate="label">
@@ -76,6 +79,9 @@
76
  If you're accepting different currencies across multiple store views/websites you'll need to adjust your merchant account ID in the correct scope, if you're using the Magento currency switcher you'll need to enable the section below.<br />
77
  <a href="https://articles.braintreepayments.com/control-panel/important-gateway-credentials#merchant-account-id" target="_blank">Find out more about merchant accounts.</a>
78
  ]]></comment>
 
 
 
79
  </merchant_account_id>
80
 
81
  <public_key translate="label">
@@ -86,6 +92,9 @@
86
  <show_in_website>1</show_in_website>
87
  <show_in_store>0</show_in_store>
88
  <frontend_class>validate-config</frontend_class>
 
 
 
89
  </public_key>
90
 
91
  <private_key translate="label">
@@ -96,8 +105,67 @@
96
  <show_in_website>1</show_in_website>
97
  <show_in_store>0</show_in_store>
98
  <frontend_class>validate-config</frontend_class>
 
 
 
99
  </private_key>
100
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  <valid_config translate="label">
102
  <label />
103
  <frontend_model>gene_braintree/adminhtml_system_config_braintree_config</frontend_model>
@@ -113,7 +181,7 @@
113
  <sort_order>60</sort_order>
114
  <show_in_default>1</show_in_default>
115
  <show_in_website>1</show_in_website>
116
- <show_in_store>0</show_in_store>
117
  </multi_currency_heading>
118
 
119
  <multi_currency_enable>
@@ -123,7 +191,7 @@
123
  <sort_order>65</sort_order>
124
  <show_in_default>1</show_in_default>
125
  <show_in_website>1</show_in_website>
126
- <show_in_store>0</show_in_store>
127
  <comment><![CDATA[
128
  If you're using the Magento built in currency switcher you'll need to activate this section to ensure the customers payment goes into your correct merchant account. If you use store views for separate countries you do not need this feature enabled. <br /><strong>Note:</strong> The invoices will still show up as your base currency, but the customer will be charged in their selected currency for the correct amount.
129
  ]]></comment>
@@ -136,7 +204,7 @@
136
  <sort_order>70</sort_order>
137
  <show_in_default>1</show_in_default>
138
  <show_in_website>1</show_in_website>
139
- <show_in_store>0</show_in_store>
140
  <depends>
141
  <multi_currency_enable>1</multi_currency_enable>
142
  </depends>
@@ -183,7 +251,7 @@
183
  <label>Enabled</label>
184
  <frontend_type>select</frontend_type>
185
  <source_model>adminhtml/system_config_source_yesno</source_model>
186
- <sort_order>1</sort_order>
187
  <show_in_default>1</show_in_default>
188
  <show_in_website>1</show_in_website>
189
  <show_in_store>0</show_in_store>
@@ -192,26 +260,113 @@
192
  <title translate="label">
193
  <label>Title</label>
194
  <frontend_type>text</frontend_type>
195
- <sort_order>2</sort_order>
196
  <show_in_default>1</show_in_default>
197
  <show_in_website>1</show_in_website>
198
  <show_in_store>1</show_in_store>
199
  </title>
200
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  <capture_heading translate="label">
202
  <label>Capture</label>
203
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
204
- <sort_order>5</sort_order>
205
  <show_in_default>1</show_in_default>
206
  <show_in_website>1</show_in_website>
207
  <show_in_store>1</show_in_store>
208
  </capture_heading>
209
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
  <order_status translate="label">
211
  <label>Complete Order Status</label>
212
  <frontend_type>select</frontend_type>
213
  <source_model>adminhtml/system_config_source_order_status_processing</source_model>
214
- <sort_order>10</sort_order>
215
  <show_in_default>1</show_in_default>
216
  <show_in_website>1</show_in_website>
217
  <show_in_store>1</show_in_store>
@@ -220,7 +375,7 @@
220
  <features_heading translate="label">
221
  <label>Features</label>
222
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
223
- <sort_order>70</sort_order>
224
  <show_in_default>1</show_in_default>
225
  <show_in_website>1</show_in_website>
226
  <show_in_store>1</show_in_store>
@@ -230,34 +385,22 @@
230
  <label>Payment Type</label>
231
  <frontend_type>select</frontend_type>
232
  <source_model>gene_braintree/source_paypal_paymenttype</source_model>
233
- <sort_order>75</sort_order>
234
  <show_in_default>1</show_in_default>
235
  <show_in_website>1</show_in_website>
236
  <show_in_store>1</show_in_store>
237
  <comment><![CDATA[
238
- <strong>Single Payment</strong> - Will only require the customer to sign in, we will only be able to take a single payment<br />
239
- <strong>Future Payments</strong> - Allows us to save the customers PayPal account for later purchases and use with the Vault
 
240
  ]]></comment>
241
  </payment_type>
242
 
243
- <locale translate="label comment">
244
- <label>Locale</label>
245
- <frontend_type>select</frontend_type>
246
- <source_model>gene_braintree/source_paypal_locale</source_model>
247
- <sort_order>80</sort_order>
248
- <show_in_default>1</show_in_default>
249
- <show_in_website>1</show_in_website>
250
- <show_in_store>1</show_in_store>
251
- <comment><![CDATA[
252
- The locale for the PayPal popup window
253
- ]]></comment>
254
- </locale>
255
-
256
  <use_vault translate="label comment">
257
  <label>Enable Vault</label>
258
  <frontend_type>select</frontend_type>
259
  <source_model>adminhtml/system_config_source_yesno</source_model>
260
- <sort_order>80</sort_order>
261
  <show_in_default>1</show_in_default>
262
  <show_in_website>1</show_in_website>
263
  <show_in_store>1</show_in_store>
@@ -269,10 +412,43 @@
269
  ]]></comment>
270
  </use_vault>
271
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
272
  <display_heading translate="label">
273
  <label>Display</label>
274
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
275
- <sort_order>100</sort_order>
276
  <show_in_default>1</show_in_default>
277
  <show_in_website>1</show_in_website>
278
  <show_in_store>1</show_in_store>
@@ -281,7 +457,7 @@
281
  <sort_order translate="label">
282
  <label>Sort Order</label>
283
  <frontend_type>text</frontend_type>
284
- <sort_order>150</sort_order>
285
  <show_in_default>1</show_in_default>
286
  <show_in_website>1</show_in_website>
287
  <show_in_store>1</show_in_store>
@@ -385,11 +561,26 @@
385
  <show_in_website>1</show_in_website>
386
  <show_in_store>1</show_in_store>
387
  <comment><![CDATA[
388
- <strong>Default</strong> - Our standard integration utilising Braintree's custom integration solution. Allows clever card type detection alongside full styling capabilities.<br />
389
- <strong>Hosted Fields</strong> - Hosted Fields are small, transparent iframes that replace the sensitive credit card inputs in your checkout flow - helping you meet the latest data security requirements while ensuring your customization doesn't suffer. <a href="https://www.braintreepayments.com/features/hosted-fields">Find out more</a>
390
  ]]></comment>
391
  </form_integration>
392
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
393
  <features_heading translate="label">
394
  <label>Features</label>
395
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
@@ -453,18 +644,6 @@
453
  ]]></comment>
454
  </useccv>
455
 
456
- <kount_merchant_id translate="label comment">
457
- <label>Kount Merchant ID</label>
458
- <frontend_type>text</frontend_type>
459
- <sort_order>79</sort_order>
460
- <show_in_default>1</show_in_default>
461
- <show_in_website>1</show_in_website>
462
- <show_in_store>1</show_in_store>
463
- <comment><![CDATA[
464
- Braintree offers a direct integration with Kount, our partner for providing advanced fraud detection technology. To use this feature, you must be processing at least 2500 transactions per month, and you’ll be subject to additional fees from Kount for their services. To get started, contact accounts@braintreepayments.com. You can view more information <a href="https://developers.braintreepayments.com/javascript+php/guides/fraud-tools">here</a>.
465
- ]]></comment>
466
- </kount_merchant_id>
467
-
468
  <cctypes translate="label">
469
  <label>Credit Card Types</label>
470
  <frontend_type>multiselect</frontend_type>
@@ -475,6 +654,19 @@
475
  <show_in_store>0</show_in_store>
476
  </cctypes>
477
 
 
 
 
 
 
 
 
 
 
 
 
 
 
478
  <allowspecific translate="label">
479
  <label>Payment from Applicable Countries</label>
480
  <frontend_type>allowspecific</frontend_type>
@@ -510,6 +702,65 @@
510
  <!--]]></comment>-->
511
  <!--</dynamic_descriptors>-->
512
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
513
  <display_heading translate="label">
514
  <label>Display</label>
515
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
62
  <show_in_website>1</show_in_website>
63
  <show_in_store>0</show_in_store>
64
  <frontend_class>validate-config</frontend_class>
65
+ <depends>
66
+ <environment>production</environment>
67
+ </depends>
68
  </merchant_id>
69
 
70
  <merchant_account_id translate="label">
79
  If you're accepting different currencies across multiple store views/websites you'll need to adjust your merchant account ID in the correct scope, if you're using the Magento currency switcher you'll need to enable the section below.<br />
80
  <a href="https://articles.braintreepayments.com/control-panel/important-gateway-credentials#merchant-account-id" target="_blank">Find out more about merchant accounts.</a>
81
  ]]></comment>
82
+ <depends>
83
+ <environment>production</environment>
84
+ </depends>
85
  </merchant_account_id>
86
 
87
  <public_key translate="label">
92
  <show_in_website>1</show_in_website>
93
  <show_in_store>0</show_in_store>
94
  <frontend_class>validate-config</frontend_class>
95
+ <depends>
96
+ <environment>production</environment>
97
+ </depends>
98
  </public_key>
99
 
100
  <private_key translate="label">
105
  <show_in_website>1</show_in_website>
106
  <show_in_store>0</show_in_store>
107
  <frontend_class>validate-config</frontend_class>
108
+ <depends>
109
+ <environment>production</environment>
110
+ </depends>
111
  </private_key>
112
 
113
+ <sandbox_merchant_id translate="label">
114
+ <label>Sandbox Merchant ID</label>
115
+ <frontend_type>text</frontend_type>
116
+ <sort_order>35</sort_order>
117
+ <show_in_default>1</show_in_default>
118
+ <show_in_website>1</show_in_website>
119
+ <show_in_store>0</show_in_store>
120
+ <frontend_class>validate-config</frontend_class>
121
+ <depends>
122
+ <environment>sandbox</environment>
123
+ </depends>
124
+ </sandbox_merchant_id>
125
+
126
+ <sandbox_merchant_account_id translate="label">
127
+ <label>Sandbox Merchant Account ID</label>
128
+ <frontend_type>text</frontend_type>
129
+ <sort_order>40</sort_order>
130
+ <show_in_default>1</show_in_default>
131
+ <show_in_website>1</show_in_website>
132
+ <show_in_store>1</show_in_store>
133
+ <frontend_class>validate-config</frontend_class>
134
+ <comment><![CDATA[
135
+ If you're accepting different currencies across multiple store views/websites you'll need to adjust your merchant account ID in the correct scope, if you're using the Magento currency switcher you'll need to enable the section below.<br />
136
+ <a href="https://articles.braintreepayments.com/control-panel/important-gateway-credentials#merchant-account-id" target="_blank">Find out more about merchant accounts.</a>
137
+ ]]></comment>
138
+ <depends>
139
+ <environment>sandbox</environment>
140
+ </depends>
141
+ </sandbox_merchant_account_id>
142
+
143
+ <sandbox_public_key translate="label">
144
+ <label>Sandbox Public Key</label>
145
+ <frontend_type>text</frontend_type>
146
+ <sort_order>45</sort_order>
147
+ <show_in_default>1</show_in_default>
148
+ <show_in_website>1</show_in_website>
149
+ <show_in_store>0</show_in_store>
150
+ <frontend_class>validate-config</frontend_class>
151
+ <depends>
152
+ <environment>sandbox</environment>
153
+ </depends>
154
+ </sandbox_public_key>
155
+
156
+ <sandbox_private_key translate="label">
157
+ <label>Sandbox Private Key</label>
158
+ <frontend_type>text</frontend_type>
159
+ <sort_order>50</sort_order>
160
+ <show_in_default>1</show_in_default>
161
+ <show_in_website>1</show_in_website>
162
+ <show_in_store>0</show_in_store>
163
+ <frontend_class>validate-config</frontend_class>
164
+ <depends>
165
+ <environment>sandbox</environment>
166
+ </depends>
167
+ </sandbox_private_key>
168
+
169
  <valid_config translate="label">
170
  <label />
171
  <frontend_model>gene_braintree/adminhtml_system_config_braintree_config</frontend_model>
181
  <sort_order>60</sort_order>
182
  <show_in_default>1</show_in_default>
183
  <show_in_website>1</show_in_website>
184
+ <show_in_store>1</show_in_store>
185
  </multi_currency_heading>
186
 
187
  <multi_currency_enable>
191
  <sort_order>65</sort_order>
192
  <show_in_default>1</show_in_default>
193
  <show_in_website>1</show_in_website>
194
+ <show_in_store>1</show_in_store>
195
  <comment><![CDATA[
196
  If you're using the Magento built in currency switcher you'll need to activate this section to ensure the customers payment goes into your correct merchant account. If you use store views for separate countries you do not need this feature enabled. <br /><strong>Note:</strong> The invoices will still show up as your base currency, but the customer will be charged in their selected currency for the correct amount.
197
  ]]></comment>
204
  <sort_order>70</sort_order>
205
  <show_in_default>1</show_in_default>
206
  <show_in_website>1</show_in_website>
207
+ <show_in_store>1</show_in_store>
208
  <depends>
209
  <multi_currency_enable>1</multi_currency_enable>
210
  </depends>
251
  <label>Enabled</label>
252
  <frontend_type>select</frontend_type>
253
  <source_model>adminhtml/system_config_source_yesno</source_model>
254
+ <sort_order>10</sort_order>
255
  <show_in_default>1</show_in_default>
256
  <show_in_website>1</show_in_website>
257
  <show_in_store>0</show_in_store>
260
  <title translate="label">
261
  <label>Title</label>
262
  <frontend_type>text</frontend_type>
263
+ <sort_order>30</sort_order>
264
  <show_in_default>1</show_in_default>
265
  <show_in_website>1</show_in_website>
266
  <show_in_store>1</show_in_store>
267
  </title>
268
 
269
+
270
+ <express_heading translate="label">
271
+ <label>Paypal Express</label>
272
+ <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
273
+ <sort_order>40</sort_order>
274
+ <show_in_default>1</show_in_default>
275
+ <show_in_website>1</show_in_website>
276
+ <show_in_store>1</show_in_store>
277
+ </express_heading>
278
+
279
+ <express_active translate="label">
280
+ <label>Enable Express Checkout</label>
281
+ <frontend_type>select</frontend_type>
282
+ <source_model>adminhtml/system_config_source_yesno</source_model>
283
+ <sort_order>50</sort_order>
284
+ <show_in_default>1</show_in_default>
285
+ <show_in_website>1</show_in_website>
286
+ <show_in_store>1</show_in_store>
287
+ <comment>
288
+ <![CDATA[
289
+ PayPal Express functionality allows customers to checkout directly with PayPal instead of using the default checkout.
290
+ ]]>
291
+ </comment>
292
+ </express_active>
293
+
294
+ <express_cart>
295
+ <label>Enable in Cart</label>
296
+ <frontend_type>select</frontend_type>
297
+ <source_model>adminhtml/system_config_source_yesno</source_model>
298
+ <sort_order>60</sort_order>
299
+ <show_in_default>1</show_in_default>
300
+ <show_in_website>1</show_in_website>
301
+ <show_in_store>1</show_in_store>
302
+ <depends><express_active>1</express_active></depends>
303
+ <comment>
304
+ <![CDATA[
305
+ Allow customers to complete their order via PayPal express, this will complete the entire quote.
306
+ ]]>
307
+ </comment>
308
+ </express_cart>
309
+
310
+ <express_pdp>
311
+ <label>Enable on Product Page</label>
312
+ <frontend_type>select</frontend_type>
313
+ <source_model>adminhtml/system_config_source_yesno</source_model>
314
+ <sort_order>70</sort_order>
315
+ <show_in_default>1</show_in_default>
316
+ <show_in_website>1</show_in_website>
317
+ <show_in_store>1</show_in_store>
318
+ <depends><express_active>1</express_active></depends>
319
+ <comment>
320
+ <![CDATA[
321
+ Allow customers to checkout directly from the product page using PayPal express. This will allow them to only checkout with the currently viewed item.
322
+ ]]>
323
+ </comment>
324
+ </express_pdp>
325
+
326
  <capture_heading translate="label">
327
  <label>Capture</label>
328
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
329
+ <sort_order>80</sort_order>
330
  <show_in_default>1</show_in_default>
331
  <show_in_website>1</show_in_website>
332
  <show_in_store>1</show_in_store>
333
  </capture_heading>
334
 
335
+ <payment_action translate="label comment">
336
+ <label>Payment Action</label>
337
+ <frontend_type>select</frontend_type>
338
+ <source_model>gene_braintree/source_paypal_paymentAction</source_model>
339
+ <sort_order>90</sort_order>
340
+ <show_in_default>1</show_in_default>
341
+ <show_in_website>1</show_in_website>
342
+ <show_in_store>0</show_in_store>
343
+ <comment><![CDATA[
344
+ <strong>Authorize</strong> - Will only auth the payment and store a token, the transaction will not be settled.<br />
345
+ <strong>Authorize & Capture</strong> - We will instantly settle the transaction within the checkout.
346
+ ]]></comment>
347
+ </payment_action>
348
+
349
+ <capture_action translate="label comment">
350
+ <label>Capture Action</label>
351
+ <frontend_type>select</frontend_type>
352
+ <source_model>gene_braintree/source_paypal_captureAction</source_model>
353
+ <sort_order>100</sort_order>
354
+ <show_in_default>1</show_in_default>
355
+ <show_in_website>1</show_in_website>
356
+ <show_in_store>0</show_in_store>
357
+ <comment><![CDATA[
358
+ If you're just authorizing transactions you can define at what point they should be submitted for settlement.
359
+ ]]></comment>
360
+ <depends>
361
+ <payment_action>authorize</payment_action>
362
+ </depends>
363
+ </capture_action>
364
+
365
  <order_status translate="label">
366
  <label>Complete Order Status</label>
367
  <frontend_type>select</frontend_type>
368
  <source_model>adminhtml/system_config_source_order_status_processing</source_model>
369
+ <sort_order>110</sort_order>
370
  <show_in_default>1</show_in_default>
371
  <show_in_website>1</show_in_website>
372
  <show_in_store>1</show_in_store>
375
  <features_heading translate="label">
376
  <label>Features</label>
377
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
378
+ <sort_order>120</sort_order>
379
  <show_in_default>1</show_in_default>
380
  <show_in_website>1</show_in_website>
381
  <show_in_store>1</show_in_store>
385
  <label>Payment Type</label>
386
  <frontend_type>select</frontend_type>
387
  <source_model>gene_braintree/source_paypal_paymenttype</source_model>
388
+ <sort_order>130</sort_order>
389
  <show_in_default>1</show_in_default>
390
  <show_in_website>1</show_in_website>
391
  <show_in_store>1</show_in_store>
392
  <comment><![CDATA[
393
+ <strong>Checkout</strong> - Will only require the customer to sign in, we will only be able to take a single payment.<br />
394
+ <strong>Vault</strong> - Allows us to save the customers PayPal account for later purchases and use with the Vault.<br />
395
+ <a href="https://developers.braintreepayments.com/guides/paypal/overview/javascript/v2#vault-vs.-checkout" target="_blank">View more information</a>
396
  ]]></comment>
397
  </payment_type>
398
 
 
 
 
 
 
 
 
 
 
 
 
 
 
399
  <use_vault translate="label comment">
400
  <label>Enable Vault</label>
401
  <frontend_type>select</frontend_type>
402
  <source_model>adminhtml/system_config_source_yesno</source_model>
403
+ <sort_order>140</sort_order>
404
  <show_in_default>1</show_in_default>
405
  <show_in_website>1</show_in_website>
406
  <show_in_store>1</show_in_store>
412
  ]]></comment>
413
  </use_vault>
414
 
415
+ <locale translate="label comment">
416
+ <label>Locale</label>
417
+ <frontend_type>select</frontend_type>
418
+ <source_model>gene_braintree/source_paypal_locale</source_model>
419
+ <sort_order>150</sort_order>
420
+ <show_in_default>1</show_in_default>
421
+ <show_in_website>1</show_in_website>
422
+ <show_in_store>1</show_in_store>
423
+ <comment><![CDATA[
424
+ The locale for the PayPal popup window
425
+ ]]></comment>
426
+ </locale>
427
+
428
+ <allowspecific translate="label">
429
+ <label>Payment from Applicable Countries</label>
430
+ <frontend_type>allowspecific</frontend_type>
431
+ <sort_order>155</sort_order>
432
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
433
+ <show_in_default>1</show_in_default>
434
+ <show_in_website>1</show_in_website>
435
+ <show_in_store>0</show_in_store>
436
+ </allowspecific>
437
+
438
+ <specificcountry translate="label">
439
+ <label>Payment from Specific Countries</label>
440
+ <frontend_type>multiselect</frontend_type>
441
+ <sort_order>160</sort_order>
442
+ <source_model>adminhtml/system_config_source_country</source_model>
443
+ <show_in_default>1</show_in_default>
444
+ <show_in_website>1</show_in_website>
445
+ <show_in_store>0</show_in_store>
446
+ </specificcountry>
447
+
448
  <display_heading translate="label">
449
  <label>Display</label>
450
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
451
+ <sort_order>165</sort_order>
452
  <show_in_default>1</show_in_default>
453
  <show_in_website>1</show_in_website>
454
  <show_in_store>1</show_in_store>
457
  <sort_order translate="label">
458
  <label>Sort Order</label>
459
  <frontend_type>text</frontend_type>
460
+ <sort_order>170</sort_order>
461
  <show_in_default>1</show_in_default>
462
  <show_in_website>1</show_in_website>
463
  <show_in_store>1</show_in_store>
561
  <show_in_website>1</show_in_website>
562
  <show_in_store>1</show_in_store>
563
  <comment><![CDATA[
564
+ <strong>Hosted Fields</strong> - Hosted Fields are small, transparent iframes that replace the sensitive credit card inputs in your checkout flow - helping you meet the latest data security requirements while ensuring your customization doesn't suffer. <a href="https://www.braintreepayments.com/features/hosted-fields">Find out more</a><br />
565
+ Currently the module does not support any other integrations provided by Braintree.
566
  ]]></comment>
567
  </form_integration>
568
 
569
+ <hostedfields_descriptor>
570
+ <label>Hosted Fields Descriptor</label>
571
+ <show_in_default>1</show_in_default>
572
+ <show_in_website>1</show_in_website>
573
+ <show_in_store>1</show_in_store>
574
+ <sort_order>41</sort_order>
575
+ <frontend_type>textarea</frontend_type>
576
+ <comment><![CDATA[
577
+ Display a message above the card details section on the checkout.
578
+ ]]></comment>
579
+ <depends>
580
+ <form_integration>hosted</form_integration>
581
+ </depends>
582
+ </hostedfields_descriptor>
583
+
584
  <features_heading translate="label">
585
  <label>Features</label>
586
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
644
  ]]></comment>
645
  </useccv>
646
 
 
 
 
 
 
 
 
 
 
 
 
 
647
  <cctypes translate="label">
648
  <label>Credit Card Types</label>
649
  <frontend_type>multiselect</frontend_type>
654
  <show_in_store>0</show_in_store>
655
  </cctypes>
656
 
657
+ <display_cctypes translate="label comment">
658
+ <label>Display Card Types</label>
659
+ <frontend_type>select</frontend_type>
660
+ <source_model>adminhtml/system_config_source_yesno</source_model>
661
+ <sort_order>86</sort_order>
662
+ <show_in_default>1</show_in_default>
663
+ <show_in_website>1</show_in_website>
664
+ <show_in_store>1</show_in_store>
665
+ <comment><![CDATA[
666
+ Display the accepted card types on the checkout.
667
+ ]]></comment>
668
+ </display_cctypes>
669
+
670
  <allowspecific translate="label">
671
  <label>Payment from Applicable Countries</label>
672
  <frontend_type>allowspecific</frontend_type>
702
  <!--]]></comment>-->
703
  <!--</dynamic_descriptors>-->
704
 
705
+ <kount translate="label">
706
+ <label>Kount</label>
707
+ <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
708
+ <sort_order>120</sort_order>
709
+ <show_in_default>1</show_in_default>
710
+ <show_in_website>1</show_in_website>
711
+ <show_in_store>1</show_in_store>
712
+ </kount>
713
+
714
+ <kount_merchant_id translate="label comment">
715
+ <label>Kount Merchant ID</label>
716
+ <frontend_type>text</frontend_type>
717
+ <sort_order>125</sort_order>
718
+ <show_in_default>1</show_in_default>
719
+ <show_in_website>1</show_in_website>
720
+ <show_in_store>1</show_in_store>
721
+ <comment><![CDATA[
722
+ Braintree offers a direct integration with Kount, our partner for providing advanced fraud detection technology. To use this feature, you must be processing at least 2500 transactions per month, and you’ll be subject to additional fees from Kount for their services. To get started, contact accounts@braintreepayments.com. You can view more information <a href="https://developers.braintreepayments.com/javascript+php/guides/fraud-tools">here</a>.
723
+ ]]></comment>
724
+ </kount_merchant_id>
725
+
726
+ <kount_environment translate="label comment">
727
+ <label>Environment</label>
728
+ <frontend_type>select</frontend_type>
729
+ <source_model>gene_braintree/source_environment</source_model>
730
+ <sort_order>130</sort_order>
731
+ <show_in_default>1</show_in_default>
732
+ <show_in_website>1</show_in_website>
733
+ <show_in_store>1</show_in_store>
734
+ <comment><![CDATA[
735
+ Please specify which Kount environment you're using.
736
+ ]]></comment>
737
+ </kount_environment>
738
+
739
+ <kount_api_key translate="label comment">
740
+ <label>API Key</label>
741
+ <frontend_type>text</frontend_type>
742
+ <sort_order>135</sort_order>
743
+ <show_in_default>1</show_in_default>
744
+ <show_in_website>1</show_in_website>
745
+ <show_in_store>1</show_in_store>
746
+ <comment><![CDATA[
747
+ Your Kount API authentication token. This can be located through the Kount AWC panel, via Admin > API Keys. Please ensure it has all permissions.
748
+ ]]></comment>
749
+ </kount_api_key>
750
+
751
+ <kount_ens_url translate="label comment">
752
+ <label>Event Notification System (ENS) URL</label>
753
+ <frontend_type>text</frontend_type>
754
+ <frontend_model>gene_braintree/adminhtml_system_config_braintree_kount_ens</frontend_model>
755
+ <sort_order>140</sort_order>
756
+ <show_in_default>1</show_in_default>
757
+ <show_in_website>1</show_in_website>
758
+ <show_in_store>1</show_in_store>
759
+ <comment><![CDATA[
760
+ This is the ENS URL you will need to add into your website in the Kount AWC control panel. This URL must be publicly accessible for the ENS to function correctly. You'll need to add this ENS URL to the 'OPT-IN' website.
761
+ ]]></comment>
762
+ </kount_ens_url>
763
+
764
  <display_heading translate="label">
765
  <label>Display</label>
766
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
app/code/community/Gene/Braintree/sql/gene_braintree_setup/install-0.1.0.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
 
 
3
  $installer = $this;
4
  $installer->startSetup();
5
 
1
  <?php
2
 
3
+ /* @var $installer Gene_Braintree_Model_Entity_Setup */
4
  $installer = $this;
5
  $installer->startSetup();
6
 
app/code/community/Gene/Braintree/sql/gene_braintree_setup/upgrade-1.0.5.4-2.0.0.php ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* @var $installer Gene_Braintree_Model_Entity_Setup */
4
+ $installer = $this;
5
+ $installer->startSetup();
6
+
7
+ // The config paths that need to be transferred to sandbox
8
+ $transferConfig = array(
9
+ Gene_Braintree_Model_Wrapper_Braintree::BRAINTREE_MERCHANT_ACCOUNT_ID_PATH => Gene_Braintree_Model_Wrapper_Braintree::BRAINTREE_SANDBOX_MERCHANT_ACCOUNT_ID_PATH,
10
+ Gene_Braintree_Model_Wrapper_Braintree::BRAINTREE_PUBLIC_KEY_PATH => Gene_Braintree_Model_Wrapper_Braintree::BRAINTREE_SANDBOX_PUBLIC_KEY_PATH,
11
+ Gene_Braintree_Model_Wrapper_Braintree::BRAINTREE_PRIVATE_KEY_PATH => Gene_Braintree_Model_Wrapper_Braintree::BRAINTREE_SANDBOX_PRIVATE_KEY_PATH,
12
+ Gene_Braintree_Model_Wrapper_Braintree::BRAINTREE_MERCHANT_ID_PATH => Gene_Braintree_Model_Wrapper_Braintree::BRAINTREE_SANDBOX_MERCHANT_ID_PATH
13
+ );
14
+
15
+ // Update values on the default scope
16
+ if ($this->getStoreConfig(Gene_Braintree_Model_Wrapper_Braintree::BRAINTREE_ENVIRONMENT_PATH) == 'sandbox') {
17
+
18
+ // Transfer the settings into the new sandbox fields
19
+ foreach ($transferConfig as $productionPath => $sandboxPath) {
20
+ Mage::getConfig()->saveConfig(
21
+ $sandboxPath,
22
+ $this->getStoreConfig($productionPath),
23
+ 'default',
24
+ 0
25
+ );
26
+ }
27
+
28
+ // Move anyone using the default integration over to Hosted Fields
29
+ if ($this->getStoreConfig(Gene_Braintree_Model_Source_Creditcard_FormIntegration::INTEGRATION_ACTION_XML_PATH) == Gene_Braintree_Model_Source_Creditcard_FormIntegration::INTEGRATION_DEFAULT) {
30
+ Mage::getConfig()->saveConfig(
31
+ Gene_Braintree_Model_Source_Creditcard_FormIntegration::INTEGRATION_ACTION_XML_PATH,
32
+ Gene_Braintree_Model_Source_Creditcard_FormIntegration::INTEGRATION_HOSTED,
33
+ 'default',
34
+ 0
35
+ );
36
+ }
37
+ }
38
+
39
+ // Loop through the stores and ensure they're all up to date
40
+ $stores = Mage::getModel('core/store')->getCollection();
41
+ foreach ($stores as $store) {
42
+
43
+ // Check to see if this store is in sandbox mode
44
+ if ($this->getStoreConfig(Gene_Braintree_Model_Wrapper_Braintree::BRAINTREE_ENVIRONMENT_PATH, $store) == 'sandbox') {
45
+
46
+ // Transfer the settings into the new sandbox fields
47
+ foreach ($transferConfig as $productionPath => $sandboxPath) {
48
+
49
+ // Only update those values which aren't inheriting correctly from default
50
+ if ($this->getStoreConfig($sandboxPath, $store) != $this->getStoreConfig($productionPath, $store)) {
51
+ Mage::getConfig()->saveConfig(
52
+ $sandboxPath,
53
+ $this->getStoreConfig($productionPath, $store),
54
+ 'stores',
55
+ $store->getId()
56
+ );
57
+ }
58
+ }
59
+ }
60
+
61
+ // Move anyone using the default integration over to Hosted Fields
62
+ if ($this->getStoreConfig(Gene_Braintree_Model_Source_Creditcard_FormIntegration::INTEGRATION_ACTION_XML_PATH, $store) == Gene_Braintree_Model_Source_Creditcard_FormIntegration::INTEGRATION_DEFAULT) {
63
+ Mage::getConfig()->saveConfig(
64
+ Gene_Braintree_Model_Source_Creditcard_FormIntegration::INTEGRATION_ACTION_XML_PATH,
65
+ Gene_Braintree_Model_Source_Creditcard_FormIntegration::INTEGRATION_HOSTED,
66
+ 'stores',
67
+ $store->getId()
68
+ );
69
+ }
70
+ }
71
+
72
+ // Clean the cache
73
+ Mage::getConfig()->cleanCache();
74
+
75
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/gene/braintree.xml CHANGED
@@ -1,6 +1,7 @@
1
  <?xml version="1.0"?>
2
  <layout version="0.1.0">
3
 
 
4
  <adminhtml_braintree_transactions>
5
  <reference name="content">
6
  <block type="gene_braintree/adminhtml_report_transactions" name="gene.braintree.report.transactions"
@@ -12,14 +13,34 @@
12
  </reference>
13
  </adminhtml_braintree_transactions>
14
 
 
15
  <adminhtml_sales_order_create_index>
16
  <reference name="head">
17
- <action method="addJs"><file>gene/braintree/braintree-0.1.js</file></action>
18
  <action method="addJs"><file>gene/braintree/vzero-0.7-min.js</file></action>
 
 
 
 
 
 
 
 
19
  </reference>
20
  <reference name="before_body_end">
21
  <block type="gene_braintree/js" name="gene_braintree_js" template="gene/braintree/js.phtml" />
22
  </reference>
23
  </adminhtml_sales_order_create_index>
24
 
 
 
 
 
 
 
 
 
 
 
 
25
  </layout>
1
  <?xml version="1.0"?>
2
  <layout version="0.1.0">
3
 
4
+ <!-- Admin settlement report -->
5
  <adminhtml_braintree_transactions>
6
  <reference name="content">
7
  <block type="gene_braintree/adminhtml_report_transactions" name="gene.braintree.report.transactions"
13
  </reference>
14
  </adminhtml_braintree_transactions>
15
 
16
+ <!-- Additions to the admin sales order creation process -->
17
  <adminhtml_sales_order_create_index>
18
  <reference name="head">
19
+ <action method="addCss"><file>css/gene/braintree/adminhtml.css</file></action>
20
  <action method="addJs"><file>gene/braintree/vzero-0.7-min.js</file></action>
21
+
22
+ <!-- If Braintree_Payments is enabled remove the JS -->
23
+ <action method="removeItem"><type>js</type><name>braintree/braintree-1.3.4.js</name></action>
24
+ </reference>
25
+ <reference name="js">
26
+ <block type="core/text" name="braintree-js">
27
+ <action method="setText"><text><![CDATA[<script src="https://js.braintreegateway.com/js/braintree-2.23.0.min.js"></script>]]></text></action>
28
+ </block>
29
  </reference>
30
  <reference name="before_body_end">
31
  <block type="gene_braintree/js" name="gene_braintree_js" template="gene/braintree/js.phtml" />
32
  </reference>
33
  </adminhtml_sales_order_create_index>
34
 
35
+ <!-- Include our migration wizard on the system config page -->
36
+ <adminhtml_system_config_edit>
37
+ <reference name="head">
38
+ <action method="addCss"><file>css/gene/braintree/migration.css</file></action>
39
+ </reference>
40
+ <reference name="before_body_end">
41
+ <block type="gene_braintree/adminhtml_system_config_migration" name="gene.braintree.system.config.migration"
42
+ template="gene/braintree/system/config/migration.phtml" />
43
+ </reference>
44
+ </adminhtml_system_config_edit>
45
+
46
  </layout>
app/design/adminhtml/default/default/template/gene/braintree/creditcard.phtml CHANGED
@@ -4,6 +4,8 @@ $_code = $this->getMethodCode()
4
  ?>
5
  <div id="payment_form_<?php echo $_code ?>" style="display:none;" class="form-list">
6
 
 
 
7
  <div id="credit-card-form">
8
  <ul class="form-list">
9
  <li>
@@ -99,6 +101,8 @@ $_code = $this->getMethodCode()
99
 
100
  // Only needed for 3DS transactions but still helpful
101
  vzero.setAmount('<?php echo Mage::getSingleton('checkout/cart')->getQuote()->collectTotals()->getGrandTotal(); ?>');
 
 
102
  }
103
 
104
  </script>
4
  ?>
5
  <div id="payment_form_<?php echo $_code ?>" style="display:none;" class="form-list">
6
 
7
+ <?php echo $this->getSavedChildHtml(); ?>
8
+
9
  <div id="credit-card-form">
10
  <ul class="form-list">
11
  <li>
101
 
102
  // Only needed for 3DS transactions but still helpful
103
  vzero.setAmount('<?php echo Mage::getSingleton('checkout/cart')->getQuote()->collectTotals()->getGrandTotal(); ?>');
104
+
105
+ vzero.creditCardLoaded();
106
  }
107
 
108
  </script>
app/design/adminhtml/default/default/template/gene/braintree/creditcard/hostedfields.phtml CHANGED
@@ -4,7 +4,13 @@ $_code = $this->getMethodCode()
4
  ?>
5
  <div id="payment_form_<?php echo $_code ?>" style="display:none;" class="form-list">
6
 
7
- <div id="credit-card-form"<?php echo ($this->hasSavedDetails() && $this->getMethod()->isVaultEnabled() ? ' style="display: none;"' : ''); ?>>
 
 
 
 
 
 
8
  <ul class="form-list braintree-hostedfield">
9
  <li>
10
  <label for="card-number"><?php echo $this->__('Card Number'); ?></label>
4
  ?>
5
  <div id="payment_form_<?php echo $_code ?>" style="display:none;" class="form-list">
6
 
7
+ <?php echo $this->getSavedChildHtml(); ?>
8
+
9
+ <div id="credit-card-form"<?php echo ($this->hasSavedDetails() && $this->getMethod()->isVaultEnabled() ? ' style="display: none;"' : ''); ?> class="loading">
10
+ <div class="credit-card-loading">
11
+ <img src="<?php echo $this->getSkinUrl('images/gene/loader.gif'); ?>" />
12
+ <p><?php echo $this->__('Loading Payment Method'); ?></p>
13
+ </div>
14
  <ul class="form-list braintree-hostedfield">
15
  <li>
16
  <label for="card-number"><?php echo $this->__('Card Number'); ?></label>
app/design/adminhtml/default/default/template/gene/braintree/creditcard/saved.phtml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if($this->hasSavedDetails() && $this->getMethod()->isVaultEnabled()): ?>
2
+
3
+ <label><strong><?php echo $this->__('Saved Cards'); ?></strong></label><br />
4
+ <p style="padding-left: 0;" class="saved-cards-intro"><?php echo $this->__('The customer has the following cards linked with their account.'); ?></p>
5
+ <table cellspacing="0" cellpadding="0" id="creditcard-saved-accounts">
6
+ <?php
7
+ $count = 0;
8
+ foreach($this->getSavedDetails() as $savedDetail):
9
+ ?>
10
+ <tr valign="middle">
11
+ <td width="20">
12
+ <input type="radio" name="payment[card_payment_method_token]" id="<?php echo $savedDetail->token; ?>" value="<?php echo $savedDetail->token; ?>"<?php echo ($count == 0 ? ' checked="checked"' : ''); ?>/>
13
+ </td>
14
+ <td>
15
+ <label for="<?php echo $savedDetail->token; ?>">
16
+ <img src="<?php echo $this->getSkinUrl('images/gene/braintree/' . Gene_Braintree_Block_Creditcard::getCardIcon($savedDetail->cardType)) ?>" align="left" />
17
+ <span class="saved-card-info">
18
+ <span class="saved-card-number">&nbsp;&nbsp; xxxx - xxxx - xxxx - <?php echo $savedDetail->last4; ?></span>
19
+ <span class="saved-expiry-date"><em><?php echo $this->__('Expires:'); ?></em> <?php echo $savedDetail->expirationMonth; ?>/<?php echo $savedDetail->expirationYear; ?></span>
20
+ </span>
21
+ </label>
22
+ </td>
23
+ </tr>
24
+ <?php
25
+ ++$count;
26
+ endforeach; ?>
27
+ <tr valign="middle" class="other-row">
28
+ <td width="20"><input type="radio" name="payment[card_payment_method_token]" id="other-creditcard" value="other" /></td>
29
+ <td><label for="other-creditcard"><?php echo $this->__('New Credit Card'); ?></label></td>
30
+ </tr>
31
+ </table>
32
+
33
+ <?php endif; ?>
app/design/adminhtml/default/default/template/gene/braintree/js.phtml CHANGED
@@ -19,7 +19,17 @@
19
  */
20
  updateData: function(callback, params) {
21
  callback();
22
- }
 
 
 
 
 
 
 
 
 
 
23
  });
24
 
25
  vZeroIntegration.addMethods({
@@ -69,11 +79,13 @@
69
  // On dom load init hosted fields if it's enabled
70
  document.observe("dom:loaded", function () {
71
  vzeroIntegration.paymentMethodSwitch();
 
72
  }.bind(this));
73
 
74
  // Intercept any area of the checkout being updated
75
  this.vzero.observeAjaxRequests(function() {
76
  vzeroIntegration.paymentMethodSwitch();
 
77
  });
78
 
79
  },
@@ -99,6 +111,15 @@
99
  return paymentSwitchOriginal.apply(this, arguments);
100
  };
101
 
 
 
 
 
 
 
 
 
 
102
  // Re-assign payment switch method
103
  payment.switchMethod = order.switchPaymentMethod.bind(order);
104
 
@@ -134,7 +155,7 @@
134
  // stop Magento's card_validation ajax from running
135
  AdminOrder.prototype._getPaymentDataOriginal = AdminOrder.prototype.getPaymentData;
136
  AdminOrder.prototype.getPaymentData = function(currentMethod) {
137
- return (currentMethod == 'gene_braintree_creditcard') ? false : this._getPaymentDataOriginal(currentMethod);
138
  };
139
  //]]>
140
  </script>
19
  */
20
  updateData: function(callback, params) {
21
  callback();
22
+ },
23
+
24
+ /**
25
+ * If the order value is 0 we don't need to intercept
26
+ *
27
+ * @returns {boolean}
28
+ */
29
+ shouldInterceptCreditCard: function() {
30
+ return $('p_method_free') == null || ($('p_method_free') != null && !$('p_method_free').checked);
31
+ },
32
+
33
  });
34
 
35
  vZeroIntegration.addMethods({
79
  // On dom load init hosted fields if it's enabled
80
  document.observe("dom:loaded", function () {
81
  vzeroIntegration.paymentMethodSwitch();
82
+ vzeroIntegration.initSavedMethods();
83
  }.bind(this));
84
 
85
  // Intercept any area of the checkout being updated
86
  this.vzero.observeAjaxRequests(function() {
87
  vzeroIntegration.paymentMethodSwitch();
88
+ vzeroIntegration.initSavedMethods();
89
  });
90
 
91
  },
111
  return paymentSwitchOriginal.apply(this, arguments);
112
  };
113
 
114
+ // Attach an event for when the system is updated the areas
115
+ var loadAreaResponseHandlerOriginal = AdminOrder.prototype.loadAreaResponseHandler;
116
+ AdminOrder.prototype.loadAreaResponseHandler = function (response) {
117
+ var result = loadAreaResponseHandlerOriginal.apply(this, arguments);
118
+ vzeroIntegration.paymentMethodSwitch();
119
+ vzeroIntegration.initSavedMethods();
120
+ return result;
121
+ };
122
+
123
  // Re-assign payment switch method
124
  payment.switchMethod = order.switchPaymentMethod.bind(order);
125
 
155
  // stop Magento's card_validation ajax from running
156
  AdminOrder.prototype._getPaymentDataOriginal = AdminOrder.prototype.getPaymentData;
157
  AdminOrder.prototype.getPaymentData = function(currentMethod) {
158
+ return (currentMethod == 'gene_braintree_creditcard' || currentMethod == 'gene_braintree_paypal') ? false : this._getPaymentDataOriginal(currentMethod);
159
  };
160
  //]]>
161
  </script>
app/design/adminhtml/default/default/template/gene/braintree/paypal.phtml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* @var $this Gene_Braintree_Block_Paypal */
3
+ $_code = $this->getMethodCode()
4
+ ?>
5
+ <div id="payment_form_<?php echo $_code ?>" style="display:none;" class="form-list">
6
+
7
+ <?php echo $this->getSavedChildHtml(); ?>
8
+
9
+ </div>
app/design/adminhtml/default/default/template/gene/braintree/paypal/saved.phtml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <label><strong><?php echo $this->__('Linked Accounts'); ?></strong></label>
2
+ <?php if($this->hasSavedDetails()): ?>
3
+
4
+ <p><?php echo $this->__('The customer has the following linked PayPal accounts.'); ?></p>
5
+ <table width="100%" cellspacing="0" cellpadding="0" id="paypal-saved-accounts">
6
+ <tbody>
7
+ <?php
8
+ $count = 0;
9
+ foreach($this->getSavedDetails() as $savedDetail):
10
+ ?>
11
+ <tr valign="middle">
12
+ <td width="20"><input type="radio" name="payment[paypal_payment_method_token]" id="<?php echo $savedDetail->token; ?>" value="<?php echo $savedDetail->token; ?>"<?php echo ($count == 0 ? ' checked="checked"' : ''); ?>/></td>
13
+ <td valign="middle">
14
+ <label for="<?php echo $savedDetail->token; ?>" style="line-height: 48px;">
15
+ <img src="<?php echo $this->getSkinUrl('images/gene/braintree/PP.png') ?>" align="left" />
16
+ <span class="saved-paypal-email"><?php echo $savedDetail->email; ?></span>
17
+ </label>
18
+ </td>
19
+ </tr>
20
+ <?php
21
+ ++$count;
22
+ endforeach; ?>
23
+ </tbody>
24
+ </table>
25
+
26
+ <?php else: ?>
27
+ <p><?php echo $this->__('This customer has not linked any PayPal accounts with your Magento store. Customers are only able to link PayPal accounts through the front-end checkout of your store.'); ?></p>
28
+ <?php endif; ?>
app/design/adminhtml/default/default/template/gene/braintree/system/config/migration.phtml ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="braintree-migration-overlay"></div>
2
+ <div id="braintree-migration">
3
+ <div class="braintree-migration-header">
4
+ <div class="braintree-migration-logos">
5
+ <div class="braintree-migration-braintree-logo"></div>
6
+ <div class="braintree-migration-plus">+</div>
7
+ <div class="braintree-migration-gene-logo"></div>
8
+ </div>
9
+ <div class="braintree-migration-heading">
10
+ <h2><?php echo $this->__('Migration Wizard'); ?></h2>
11
+ </div>
12
+ </div>
13
+ <div class="braintree-migration-main">
14
+ <div class="braintree-migration-loading">
15
+ <h3><?php echo $this->__('Please wait whilst we run the migration...'); ?></h3>
16
+ <p><?php echo $this->__('For larger stores this may take a few minutes, please refrain from navigating away from this page.'); ?></p>
17
+ </div>
18
+ <form action="<?php echo Mage::helper('adminhtml')->getUrl('adminhtml/braintree_migration/run'); ?>" class="braintree-migration-content" method="post">
19
+ <?php echo $this->getBlockHtml('formkey'); ?>
20
+ <p><?php echo $this->__('We’ve detected that you have another Braintree module installed. This wizard enables you to easily import your settings and saved customer data into the Gene extension. It also gives you the option to remove the old modules code so you’re not running legacy code.'); ?></p>
21
+ <p><?php echo $this->__('Please select which actions you’d like to undertake below <em>(we\'ve checked our reccomended settings)</em>:'); ?></p>
22
+
23
+ <ul class="braintree-migration-options">
24
+ <li>
25
+ <input type="checkbox" id="configuration-settings" name="migration[configuration-settings]" checked="checked">
26
+ <label for="configuration-settings">
27
+ <?php echo $this->__('Import Configuration Settings'); ?>
28
+ <span><?php echo $this->__('This will import all merchant settings, and enable any methods at are already enabled in the previous module.'); ?></span>
29
+ </label>
30
+ </li>
31
+ <li>
32
+ <input type="checkbox" id="customer-data" name="migration[customer-data]" checked="checked">
33
+ <label for="customer-data">
34
+ <?php echo $this->__('Import Saved Customer Data'); ?>
35
+ <span><?php echo $this->__('This will ensure that any customer data previously saved by customers will be displayed with the new module.'); ?></span>
36
+ </label>
37
+ </li>
38
+ <li>
39
+ <input type="checkbox" id="disable-legacy" name="migration[disable-legacy]" checked="checked">
40
+ <label for="disable-legacy">
41
+ <?php echo $this->__('Disable Legacy Braintree Module'); ?>
42
+ <span><input type="checkbox" id="remove-legacy" name="migration[remove-legacy]"> <?php echo $this->__('Remove all legacy module files. <strong>This step is not reversible, it will remove all legacy files and config settings.</strong>'); ?></span>
43
+ </label>
44
+ </li>
45
+ </ul>
46
+
47
+ <div class="braintree-migration-buttons">
48
+ <button type="button" class="gene-migration-button gene-migration-cancel"><?php echo $this->__('Cancel'); ?></button>
49
+ <button type="submit" class="gene-migration-button gene-migration-run"><?php echo $this->__('Run Migration'); ?></button>
50
+ </div>
51
+ </form>
52
+ </div>
53
+ </div>
54
+
55
+ <script type="text/javascript">
56
+ // On load add our active classes
57
+ document.observe("dom:loaded", function() {
58
+ $('braintree-migration-overlay').addClassName('active');
59
+ $('braintree-migration').addClassName('active');
60
+ });
61
+
62
+ // Migration submit action
63
+ Element.observe($$('.braintree-migration-content').first(), 'submit', function (event) {
64
+ Event.stop(event);
65
+ var form = Event.element(event),
66
+ action = form.readAttribute('action');
67
+
68
+ // Set the class name to loading to change the UI
69
+ $('braintree-migration').addClassName('loading');
70
+
71
+ // Create an ajax request to the server
72
+ new Ajax.Request(
73
+ action,
74
+ {
75
+ method: 'post',
76
+ parameters: form.serialize(true),
77
+ onSuccess: function (transport) {
78
+ if (transport && transport.responseJSON) {
79
+ if (transport.responseJSON.success == true) {
80
+ // The migration was a success, reload the page
81
+ return location.reload();
82
+ }
83
+ }
84
+ }.bind(this),
85
+ onFailure: function () {
86
+ alert('<?php $this->__('An issue has occurred whilst running the migration, please contact a member of support.'); ?>');
87
+ }
88
+ }
89
+ );
90
+ });
91
+
92
+ // Cancel action
93
+ Element.observe($$('.gene-migration-cancel').first(), 'click', function (event) {
94
+ Event.stop(event);
95
+
96
+ // Show a loading state
97
+ $$('.braintree-migration-loading h3').first().hide();
98
+ $$('.braintree-migration-loading p').first().hide();
99
+ $('braintree-migration').addClassName('loading');
100
+
101
+ new Ajax.Request(
102
+ '<?php echo Mage::helper('adminhtml')->getUrl('adminhtml/braintree_migration/cancel'); ?>',
103
+ {
104
+ method: 'get',
105
+ onSuccess: function (transport) {
106
+ if (transport && transport.responseJSON) {
107
+ if (transport.responseJSON.success == true) {
108
+ $('braintree-migration-overlay').hide();
109
+ $('braintree-migration').hide();
110
+ }
111
+ }
112
+ },
113
+ onFailure: function () {
114
+ alert('<?php $this->__('An issue has occurred whilst cancelling the migration, please contact a member of support.'); ?>');
115
+ }
116
+ }
117
+ );
118
+ });
119
+ </script>
app/design/frontend/base/default/layout/gene/braintree.xml CHANGED
@@ -1,48 +1,43 @@
1
  <?xml version="1.0"?>
2
  <layout version="0.1.0">
3
 
4
- <checkout_onepage_index>
 
5
  <reference name="head">
6
- <action method="addJs"><file>gene/braintree/braintree-0.1.js</file></action>
 
 
7
  <action method="addJs"><file>gene/braintree/vzero-0.7-min.js</file></action>
8
- <action method="addCss"><file>css/gene/braintree/default.css</file></action>
 
9
  </reference>
10
  <reference name="before_body_end">
11
  <block type="gene_braintree/js" name="gene_braintree_setup" template="gene/braintree/js/setup.phtml" />
12
- <block type="gene_braintree/js" name="gene_braintree_js" template="gene/braintree/js/default.phtml" />
13
-
14
- <!-- Set the payment form ID for the fraud prevention -->
15
- <block type="gene_braintree/js" name="gene_braintree_data" template="gene/braintree/js/data.phtml">
16
- <action method="setData">
17
- <key>payment_form_id</key>
18
- <value>co-payment-form</value>
19
- </action>
20
- </block>
21
  </reference>
22
- </checkout_onepage_index>
23
 
24
- <checkout_multishipping_billing>
 
 
25
  <reference name="head">
26
- <action method="addJs"><file>gene/braintree/braintree-0.1.js</file></action>
27
- <action method="addJs"><file>gene/braintree/vzero-0.7-min.js</file></action>
28
  <action method="addCss"><file>css/gene/braintree/default.css</file></action>
29
  </reference>
30
  <reference name="before_body_end">
31
- <block type="gene_braintree/js" name="gene_braintree_setup" template="gene/braintree/js/setup.phtml" />
32
- <block type="gene_braintree/js" name="gene_braintree_js" template="gene/braintree/js/multishipping.phtml" />
33
 
34
  <!-- Set the payment form ID for the fraud prevention -->
35
  <block type="gene_braintree/js" name="gene_braintree_data" template="gene/braintree/js/data.phtml">
36
  <action method="setData">
37
  <key>payment_form_id</key>
38
- <value>multishipping-billing-form</value>
39
  </action>
40
  </block>
41
  </reference>
42
- </checkout_multishipping_billing>
43
 
44
  <!-- We have to use a customized version of the js.phtml file for Amasty's checkout solution -->
45
  <amasty_onestep_checkout>
 
46
  <reference name="head">
47
  <action method="removeItem"><type>skin_css</type><name>css/gene/braintree/default.css</name></action>
48
  <action method="addCss"><file>css/gene/braintree/amasty.css</file></action>
@@ -63,13 +58,11 @@
63
 
64
  <!-- Need to include the standard resources for the onestepcheckout.com solution -->
65
  <idev_onestepcheckout_index>
 
66
  <reference name="head">
67
- <action method="addJs"><file>gene/braintree/braintree-0.1.js</file></action>
68
- <action method="addJs"><file>gene/braintree/vzero-0.7-min.js</file></action>
69
  <action method="addCss"><file>css/gene/braintree/idev.css</file></action>
70
  </reference>
71
  <reference name="before_body_end">
72
- <block type="gene_braintree/js" name="gene_braintree_setup" template="gene/braintree/js/setup.phtml" />
73
  <block type="gene_braintree/js" name="gene_braintree_js" template="gene/braintree/js/idev.phtml" />
74
 
75
  <!-- We include device data at the end of the larger form -->
@@ -84,13 +77,11 @@
84
 
85
  <!-- Add in support for Magestores's one step checkout solution -->
86
  <magestore_onestepcheckout_index>
 
87
  <reference name="head">
88
- <action method="addJs"><file>gene/braintree/braintree-0.1.js</file></action>
89
- <action method="addJs"><file>gene/braintree/vzero-0.7-min.js</file></action>
90
  <action method="addCss"><file>css/gene/braintree/magestore.css</file></action>
91
  </reference>
92
  <reference name="before_body_end">
93
- <block type="gene_braintree/js" name="gene_braintree_setup" template="gene/braintree/js/setup.phtml" />
94
  <block type="gene_braintree/js" name="gene_braintree_js" template="gene/braintree/js/magestore.phtml" />
95
 
96
  <!-- We include device data at the end of the larger form -->
@@ -105,13 +96,11 @@
105
 
106
  <!-- Add in support for the Aheadworks one step checkout solution -->
107
  <aw_onestepcheckout_index_index>
 
108
  <reference name="head">
109
- <action method="addJs"><file>gene/braintree/braintree-0.1.js</file></action>
110
- <action method="addJs"><file>gene/braintree/vzero-0.7-min.js</file></action>
111
  <action method="addCss"><file>css/gene/braintree/aheadworks.css</file></action>
112
  </reference>
113
  <reference name="before_body_end">
114
- <block type="gene_braintree/js" name="gene_braintree_setup" template="gene/braintree/js/setup.phtml" />
115
  <block type="gene_braintree/js" name="gene_braintree_js" template="gene/braintree/js/aheadworks.phtml" />
116
 
117
  <!-- We include device data at the end of the larger form -->
@@ -126,13 +115,14 @@
126
 
127
  <!-- Add in support for IWD's one step checkout solution -->
128
  <opc_index_index>
 
129
  <reference name="head">
130
- <action method="addJs"><file>gene/braintree/braintree-0.1.js</file></action>
131
- <action method="addJs"><file>gene/braintree/vzero-0.7-min.js</file></action>
132
  <action method="addCss"><file>css/gene/braintree/iwd.css</file></action>
 
 
 
133
  </reference>
134
  <reference name="before_body_end">
135
- <block type="gene_braintree/js" name="gene_braintree_setup" template="gene/braintree/js/setup.phtml" />
136
  <block type="gene_braintree/js" name="gene_braintree_js" template="gene/braintree/js/iwd.phtml" />
137
 
138
  <!-- We include device data at the end of the larger form -->
@@ -147,13 +137,14 @@
147
 
148
  <!-- Add in support for Fire Checkouts solution -->
149
  <firecheckout_index_index>
 
150
  <reference name="head">
151
- <action method="addJs"><file>gene/braintree/braintree-0.1.js</file></action>
152
- <action method="addJs"><file>gene/braintree/vzero-0.7-min.js</file></action>
153
  <action method="addCss"><file>css/gene/braintree/firecheckout.css</file></action>
 
 
 
154
  </reference>
155
  <reference name="before_body_end">
156
- <block type="gene_braintree/js" name="gene_braintree_setup" template="gene/braintree/js/setup.phtml" />
157
  <block type="gene_braintree/js" name="gene_braintree_js" template="gene/braintree/js/firecheckout.phtml" />
158
 
159
  <!-- We include device data at the end of the larger form -->
@@ -168,14 +159,15 @@
168
 
169
  <!-- Add in support for Unicodes OP solution -->
170
  <unicode_onestep_checkout>
 
171
  <reference name="head">
172
  <action method="removeItem"><type>skin_css</type><name>css/gene/braintree/default.css</name></action>
173
- <action method="addJs"><file>gene/braintree/braintree-0.1.js</file></action>
174
- <action method="addJs"><file>gene/braintree/vzero-0.7-min.js</file></action>
175
  <action method="addCss"><file>css/gene/braintree/unicode.css</file></action>
 
 
 
176
  </reference>
177
  <reference name="before_body_end">
178
- <block type="gene_braintree/js" name="gene_braintree_setup" template="gene/braintree/js/setup.phtml" />
179
  <block type="gene_braintree/js" name="gene_braintree_js" template="gene/braintree/js/unicode.phtml" />
180
 
181
  <!-- We include device data at the end of the larger form -->
@@ -190,12 +182,12 @@
190
 
191
  <!-- Add in support for the Oye one step checkout -->
192
  <oye_onestep_checkout>
 
193
  <reference name="head">
194
  <action method="removeItem"><type>skin_css</type><name>css/gene/braintree/default.css</name></action>
195
  <action method="addCss"><file>css/gene/braintree/oye.css</file></action>
196
  </reference>
197
  <reference name="before_body_end">
198
- <block type="gene_braintree/js" name="gene_braintree_setup" template="gene/braintree/js/setup.phtml" />
199
  <block type="gene_braintree/js" name="gene_braintree_js" template="gene/braintree/js/oye.phtml" />
200
 
201
  <!-- We include device data at the end of the larger form -->
@@ -210,13 +202,11 @@
210
 
211
  <!-- Add in support for the FME QuickCheckout -->
212
  <checkout_onestep_index>
 
213
  <reference name="head">
214
- <action method="addJs"><file>gene/braintree/braintree-0.1.js</file></action>
215
- <action method="addJs"><file>gene/braintree/vzero-0.7-min.js</file></action>
216
  <action method="addCss"><file>css/gene/braintree/fme.css</file></action>
217
  </reference>
218
  <reference name="before_body_end">
219
- <block type="gene_braintree/js" name="gene_braintree_setup" template="gene/braintree/js/setup.phtml" />
220
  <block type="gene_braintree/js" name="gene_braintree_js" template="gene/braintree/js/fme.phtml" />
221
 
222
  <!-- We include device data at the end of the larger form -->
@@ -229,6 +219,25 @@
229
  </reference>
230
  </checkout_onestep_index>
231
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
232
  <checkout_onepage_paymentmethod>
233
  <reference name="root">
234
  <block type="core/text_list" name="additional" as="additional">
@@ -251,6 +260,9 @@
251
  <label>Saved Payment Information</label>
252
  <update handle="customer_account"/>
253
  <!-- Mage_Customer -->
 
 
 
254
  <reference name="root">
255
  <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
256
  </reference>
@@ -261,4 +273,45 @@
261
  </reference>
262
  </braintree_saved_index>
263
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
264
  </layout>
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
+ <block type="core/text" name="braintree-js">
8
+ <action method="setText"><text><![CDATA[<script src="https://js.braintreegateway.com/js/braintree-2.23.0.min.js"></script>]]></text></action>
9
+ </block>
10
  <action method="addJs"><file>gene/braintree/vzero-0.7-min.js</file></action>
11
+ <!-- If Braintree_Payments is enabled remove their JS -->
12
+ <action method="removeItem"><type>js</type><name>braintree/braintree-1.3.4.js</name></action>
13
  </reference>
14
  <reference name="before_body_end">
15
  <block type="gene_braintree/js" name="gene_braintree_setup" template="gene/braintree/js/setup.phtml" />
 
 
 
 
 
 
 
 
 
16
  </reference>
17
+ </gene_braintree_assets>
18
 
19
+ <!-- Default onepage checkout integration -->
20
+ <checkout_onepage_index>
21
+ <update handle="gene_braintree_assets" />
22
  <reference name="head">
 
 
23
  <action method="addCss"><file>css/gene/braintree/default.css</file></action>
24
  </reference>
25
  <reference name="before_body_end">
26
+ <block type="gene_braintree/js" name="gene_braintree_js" template="gene/braintree/js/default.phtml" />
 
27
 
28
  <!-- Set the payment form ID for the fraud prevention -->
29
  <block type="gene_braintree/js" name="gene_braintree_data" template="gene/braintree/js/data.phtml">
30
  <action method="setData">
31
  <key>payment_form_id</key>
32
+ <value>co-payment-form</value>
33
  </action>
34
  </block>
35
  </reference>
36
+ </checkout_onepage_index>
37
 
38
  <!-- We have to use a customized version of the js.phtml file for Amasty's checkout solution -->
39
  <amasty_onestep_checkout>
40
+ <update handle="gene_braintree_assets" />
41
  <reference name="head">
42
  <action method="removeItem"><type>skin_css</type><name>css/gene/braintree/default.css</name></action>
43
  <action method="addCss"><file>css/gene/braintree/amasty.css</file></action>
58
 
59
  <!-- Need to include the standard resources for the onestepcheckout.com solution -->
60
  <idev_onestepcheckout_index>
61
+ <update handle="gene_braintree_assets" />
62
  <reference name="head">
 
 
63
  <action method="addCss"><file>css/gene/braintree/idev.css</file></action>
64
  </reference>
65
  <reference name="before_body_end">
 
66
  <block type="gene_braintree/js" name="gene_braintree_js" template="gene/braintree/js/idev.phtml" />
67
 
68
  <!-- We include device data at the end of the larger form -->
77
 
78
  <!-- Add in support for Magestores's one step checkout solution -->
79
  <magestore_onestepcheckout_index>
80
+ <update handle="gene_braintree_assets" />
81
  <reference name="head">
 
 
82
  <action method="addCss"><file>css/gene/braintree/magestore.css</file></action>
83
  </reference>
84
  <reference name="before_body_end">
 
85
  <block type="gene_braintree/js" name="gene_braintree_js" template="gene/braintree/js/magestore.phtml" />
86
 
87
  <!-- We include device data at the end of the larger form -->
96
 
97
  <!-- Add in support for the Aheadworks one step checkout solution -->
98
  <aw_onestepcheckout_index_index>
99
+ <update handle="gene_braintree_assets" />
100
  <reference name="head">
 
 
101
  <action method="addCss"><file>css/gene/braintree/aheadworks.css</file></action>
102
  </reference>
103
  <reference name="before_body_end">
 
104
  <block type="gene_braintree/js" name="gene_braintree_js" template="gene/braintree/js/aheadworks.phtml" />
105
 
106
  <!-- We include device data at the end of the larger form -->
115
 
116
  <!-- Add in support for IWD's one step checkout solution -->
117
  <opc_index_index>
118
+ <update handle="gene_braintree_assets" />
119
  <reference name="head">
 
 
120
  <action method="addCss"><file>css/gene/braintree/iwd.css</file></action>
121
+
122
+ <!-- If Braintree_Payments is enabled remove their JS -->
123
+ <action method="removeItem"><type>js</type><name>braintree/braintree-1.3.4.js</name></action>
124
  </reference>
125
  <reference name="before_body_end">
 
126
  <block type="gene_braintree/js" name="gene_braintree_js" template="gene/braintree/js/iwd.phtml" />
127
 
128
  <!-- We include device data at the end of the larger form -->
137
 
138
  <!-- Add in support for Fire Checkouts solution -->
139
  <firecheckout_index_index>
140
+ <update handle="gene_braintree_assets" />
141
  <reference name="head">
 
 
142
  <action method="addCss"><file>css/gene/braintree/firecheckout.css</file></action>
143
+
144
+ <!-- If Braintree_Payments is enabled remove their JS -->
145
+ <action method="removeItem"><type>js</type><name>braintree/braintree-1.3.4.js</name></action>
146
  </reference>
147
  <reference name="before_body_end">
 
148
  <block type="gene_braintree/js" name="gene_braintree_js" template="gene/braintree/js/firecheckout.phtml" />
149
 
150
  <!-- We include device data at the end of the larger form -->
159
 
160
  <!-- Add in support for Unicodes OP solution -->
161
  <unicode_onestep_checkout>
162
+ <update handle="gene_braintree_assets" />
163
  <reference name="head">
164
  <action method="removeItem"><type>skin_css</type><name>css/gene/braintree/default.css</name></action>
 
 
165
  <action method="addCss"><file>css/gene/braintree/unicode.css</file></action>
166
+
167
+ <!-- If Braintree_Payments is enabled remove their JS -->
168
+ <action method="removeItem"><type>js</type><name>braintree/braintree-1.3.4.js</name></action>
169
  </reference>
170
  <reference name="before_body_end">
 
171
  <block type="gene_braintree/js" name="gene_braintree_js" template="gene/braintree/js/unicode.phtml" />
172
 
173
  <!-- We include device data at the end of the larger form -->
182
 
183
  <!-- Add in support for the Oye one step checkout -->
184
  <oye_onestep_checkout>
185
+ <update handle="gene_braintree_assets" />
186
  <reference name="head">
187
  <action method="removeItem"><type>skin_css</type><name>css/gene/braintree/default.css</name></action>
188
  <action method="addCss"><file>css/gene/braintree/oye.css</file></action>
189
  </reference>
190
  <reference name="before_body_end">
 
191
  <block type="gene_braintree/js" name="gene_braintree_js" template="gene/braintree/js/oye.phtml" />
192
 
193
  <!-- We include device data at the end of the larger form -->
202
 
203
  <!-- Add in support for the FME QuickCheckout -->
204
  <checkout_onestep_index>
205
+ <update handle="gene_braintree_assets" />
206
  <reference name="head">
 
 
207
  <action method="addCss"><file>css/gene/braintree/fme.css</file></action>
208
  </reference>
209
  <reference name="before_body_end">
 
210
  <block type="gene_braintree/js" name="gene_braintree_js" template="gene/braintree/js/fme.phtml" />
211
 
212
  <!-- We include device data at the end of the larger form -->
219
  </reference>
220
  </checkout_onestep_index>
221
 
222
+ <!-- Add in support for Magento's mutli shipping checkout -->
223
+ <checkout_multishipping_billing>
224
+ <update handle="gene_braintree_assets" />
225
+ <reference name="head">
226
+ <action method="addCss"><file>css/gene/braintree/default.css</file></action>
227
+ </reference>
228
+ <reference name="before_body_end">
229
+ <block type="gene_braintree/js" name="gene_braintree_js" template="gene/braintree/js/multishipping.phtml" />
230
+
231
+ <!-- Set the payment form ID for the fraud prevention -->
232
+ <block type="gene_braintree/js" name="gene_braintree_data" template="gene/braintree/js/data.phtml">
233
+ <action method="setData">
234
+ <key>payment_form_id</key>
235
+ <value>multishipping-billing-form</value>
236
+ </action>
237
+ </block>
238
+ </reference>
239
+ </checkout_multishipping_billing>
240
+
241
  <checkout_onepage_paymentmethod>
242
  <reference name="root">
243
  <block type="core/text_list" name="additional" as="additional">
260
  <label>Saved Payment Information</label>
261
  <update handle="customer_account"/>
262
  <!-- Mage_Customer -->
263
+ <reference name="head">
264
+ <action method="addCss"><file>css/gene/braintree/account.css</file></action>
265
+ </reference>
266
  <reference name="root">
267
  <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
268
  </reference>
273
  </reference>
274
  </braintree_saved_index>
275
 
276
+ <braintree_saved_edit translate="label">
277
+ <label>Saved Payment Information</label>
278
+ <update handle="customer_account"/>
279
+ <!-- Mage_Customer -->
280
+ <reference name="head">
281
+ <action method="addCss"><file>css/gene/braintree/account.css</file></action>
282
+ </reference>
283
+ <reference name="root">
284
+ <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
285
+ </reference>
286
+ <reference name="my.account.wrapper">
287
+ <block type="gene_braintree/saved_edit" name="gene_braintree_saved_payment_edit" template="gene/braintree/customer/edit.phtml" />
288
+ </reference>
289
+ </braintree_saved_edit>
290
+
291
+ <!-- Express Checkout through product pages -->
292
+ <catalog_product_view>
293
+ <update handle="gene_braintree_assets" />
294
+ <reference name="head">
295
+ <action method="addJs"><file>gene/braintree/express.js</file></action>
296
+ <action method="addCss"><file>css/gene/braintree/default.css</file></action>
297
+ <action method="addCss"><file>css/gene/braintree/express.css</file></action>
298
+ </reference>
299
+ <reference name="before_body_end">
300
+ <block type="gene_braintree/express_button" name="gene_braintree_express_catalog_button" template="gene/braintree/express/catalog.phtml" />
301
+ </reference>
302
+ </catalog_product_view>
303
+
304
+ <!-- Express checkout through the cart page -->
305
+ <checkout_cart_index>
306
+ <update handle="gene_braintree_assets" />
307
+ <reference name="head">
308
+ <action method="addJs"><file>gene/braintree/express.js</file></action>
309
+ <action method="addCss"><file>css/gene/braintree/default.css</file></action>
310
+ <action method="addCss"><file>css/gene/braintree/express.css</file></action>
311
+ </reference>
312
+ <reference name="before_body_end">
313
+ <block type="gene_braintree/express_button" name="gene_braintree_express_cart_button" template="gene/braintree/express/cart.phtml" />
314
+ </reference>
315
+ </checkout_cart_index>
316
+
317
  </layout>
app/design/frontend/base/default/template/gene/braintree/creditcard.phtml CHANGED
@@ -4,46 +4,24 @@ $_code = $this->getMethodCode()
4
  ?>
5
  <div id="payment_form_<?php echo $_code ?>" style="display:none;" class="form-list">
6
 
7
- <?php if($this->hasSavedDetails() && $this->getMethod()->isVaultEnabled()): ?>
8
-
9
- <label><?php echo $this->__('Saved Cards'); ?></label><br />
10
- <p style="padding-left: 0;" class="saved-cards-intro"><?php echo $this->__('The following credit cards accounts are currently linked with your account.'); ?></p>
11
- <table cellspacing="0" cellpadding="0" id="creditcard-saved-accounts">
12
- <?php
13
- $count = 0;
14
- foreach($this->getSavedDetails() as $savedDetail):
15
- ?>
16
- <tr valign="middle">
17
- <td width="20">
18
- <?php if($this->getMethod()->is3DEnabled()): ?>
19
- <input type="radio" name="payment[card_payment_method_token]" id="<?php echo $savedDetail->token; ?>" data-token="<?php echo $savedDetail->token; ?>" data-threedsecure-nonce="<?php echo $this->getMethod()->getThreeDSecureVaultNonce($savedDetail->token); ?>" value="threedsecure"<?php echo ($count == 0 ? ' checked="checked"' : ''); ?>/>
20
- <?php else: ?>
21
- <input type="radio" name="payment[card_payment_method_token]" id="<?php echo $savedDetail->token; ?>" value="<?php echo $savedDetail->token; ?>"<?php echo ($count == 0 ? ' checked="checked"' : ''); ?>/>
22
- <?php endif; ?>
23
- </td>
24
- <td>
25
- <label for="<?php echo $savedDetail->token; ?>">
26
- <img src="<?php echo $this->getSkinUrl('images/gene/braintree/' . $this->getCardIcon($savedDetail->cardType)) ?>" align="left" />
27
- <span class="saved-card-info">
28
- <span class="saved-card-number">&nbsp;&nbsp; xxxx - xxxx - xxxx - <?php echo $savedDetail->last4; ?></span>
29
- <span class="saved-expiry-date"><em><?php echo $this->__('Expires:'); ?></em> <?php echo $savedDetail->expirationMonth; ?>/<?php echo $savedDetail->expirationYear; ?></span>
30
- </span>
31
- </label>
32
- </td>
33
- </tr>
34
- <?php
35
- ++$count;
36
- endforeach; ?>
37
- <tr valign="middle" class="other-row">
38
- <td width="20"><input type="radio" name="payment[card_payment_method_token]" id="other-creditcard" value="other" /></td>
39
- <td><label for="other-creditcard"><?php echo $this->__('New Credit Card'); ?></label></td>
40
- </tr>
41
- </table>
42
-
43
- <?php endif; ?>
44
 
45
  <div id="credit-card-form"<?php echo ($this->hasSavedDetails() && $this->getMethod()->isVaultEnabled() ? ' style="display: none;"' : ''); ?>>
46
  <ul class="form-list">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  <li>
48
  <label for="<?php echo $_code ?>_cc_number" class="required"><em>*</em><?php echo $this->__('Credit Card Number') ?></label>
49
  <div class="input-box card-number">
4
  ?>
5
  <div id="payment_form_<?php echo $_code ?>" style="display:none;" class="form-list">
6
 
7
+ <?php echo $this->getSavedChildHtml(); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
  <div id="credit-card-form"<?php echo ($this->hasSavedDetails() && $this->getMethod()->isVaultEnabled() ? ' style="display: none;"' : ''); ?>>
10
  <ul class="form-list">
11
+
12
+ <?php if($this->showAcceptedCards()): ?>
13
+ <li id="braintree-accepted-cards">
14
+ <label for="<?php echo $_code ?>_cc_number">
15
+ <?php echo $this->__('We Accept'); ?>
16
+ <div>
17
+ <?php foreach($this->getAllowedCards() as $card): ?>
18
+ <img src="<?php echo $this->getSkinUrl('images/gene/braintree/' . $card['value'] . '.png') ?>" alt="<?php echo $card['label']; ?>" />
19
+ <?php endforeach; ?>
20
+ </div>
21
+ </label>
22
+ </li>
23
+ <?php endif; ?>
24
+
25
  <li>
26
  <label for="<?php echo $_code ?>_cc_number" class="required"><em>*</em><?php echo $this->__('Credit Card Number') ?></label>
27
  <div class="input-box card-number">
app/design/frontend/base/default/template/gene/braintree/creditcard/hostedfields.phtml CHANGED
@@ -4,46 +4,34 @@ $_code = $this->getMethodCode()
4
  ?>
5
  <div id="payment_form_<?php echo $_code ?>" style="display:none;" class="form-list">
6
 
7
- <?php if($this->hasSavedDetails() && $this->getMethod()->isVaultEnabled()): ?>
8
 
9
- <label><?php echo $this->__('Saved Cards'); ?></label><br />
10
- <p style="padding-left: 0;" class="saved-cards-intro"><?php echo $this->__('The following credit cards accounts are currently linked with your account.'); ?></p>
11
- <table cellspacing="0" cellpadding="0" id="creditcard-saved-accounts">
12
- <?php
13
- $count = 0;
14
- foreach($this->getSavedDetails() as $savedDetail):
15
- ?>
16
- <tr valign="middle">
17
- <td width="20">
18
- <?php if($this->getMethod()->is3DEnabled()): ?>
19
- <input type="radio" name="payment[card_payment_method_token]" id="<?php echo $savedDetail->token; ?>" data-token="<?php echo $savedDetail->token; ?>" data-threedsecure-nonce="<?php echo $this->getMethod()->getThreeDSecureVaultNonce($savedDetail->token); ?>" value="threedsecure"<?php echo ($count == 0 ? ' checked="checked"' : ''); ?>/>
20
- <?php else: ?>
21
- <input type="radio" name="payment[card_payment_method_token]" id="<?php echo $savedDetail->token; ?>" value="<?php echo $savedDetail->token; ?>"<?php echo ($count == 0 ? ' checked="checked"' : ''); ?>/>
22
- <?php endif; ?>
23
- </td>
24
- <td>
25
- <label for="<?php echo $savedDetail->token; ?>">
26
- <img src="<?php echo $this->getSkinUrl('images/gene/braintree/' . $this->getCardIcon($savedDetail->cardType)) ?>" align="left" />
27
- <span class="saved-card-info">
28
- <span class="saved-card-number">xxxx - xxxx - xxxx - <?php echo $savedDetail->last4; ?></span>
29
- <span class="saved-expiry-date"><em><?php echo $this->__('Expires:'); ?></em> <?php echo $savedDetail->expirationMonth; ?>/<?php echo $savedDetail->expirationYear; ?></span>
30
- </span>
31
- </label>
32
- </td>
33
- </tr>
34
- <?php
35
- ++$count;
36
- endforeach; ?>
37
- <tr valign="middle" class="other-row">
38
- <td width="20"><input type="radio" name="payment[card_payment_method_token]" id="other-creditcard" value="other" /></td>
39
- <td><label for="other-creditcard"><?php echo $this->__('New Credit Card'); ?></label></td>
40
- </tr>
41
- </table>
42
 
43
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
 
45
- <div id="credit-card-form"<?php echo ($this->hasSavedDetails() && $this->getMethod()->isVaultEnabled() ? ' style="display: none;"' : ''); ?>>
46
- <ul class="form-list braintree-hostedfield">
47
  <li>
48
  <label for="card-number"><?php echo $this->__('Card Number'); ?></label>
49
  <div class="card-input braintree-card-input-field">
4
  ?>
5
  <div id="payment_form_<?php echo $_code ?>" style="display:none;" class="form-list">
6
 
7
+ <?php echo $this->getSavedChildHtml(); ?>
8
 
9
+ <div id="credit-card-form"<?php echo ($this->hasSavedDetails() && $this->getMethod()->isVaultEnabled() ? ' style="display: none;"' : ''); ?> class="loading">
10
+ <div class="credit-card-loading">
11
+ <img src="<?php echo $this->getSkinUrl('images/gene/loader.gif'); ?>" />
12
+ <p><?php echo $this->__('Loading Payment Method'); ?></p>
13
+ </div>
14
+ <ul class="form-list braintree-hostedfield">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
+ <?php if($this->getHostedDescriptor()): ?>
17
+ <li>
18
+ <p><?php echo $this->escapeHtml( $this->getHostedDescriptor() ); ?></p>
19
+ </li>
20
+ <?php endif; ?>
21
+
22
+ <?php if($this->showAcceptedCards()): ?>
23
+ <li id="braintree-accepted-cards">
24
+ <label for="card-number">
25
+ <?php echo $this->__('We Accept'); ?>
26
+ <div>
27
+ <?php foreach($this->getAllowedCards() as $card): ?>
28
+ <img src="<?php echo $this->getSkinUrl('images/gene/braintree/' . $card['value'] . '.png') ?>" alt="<?php echo $card['label']; ?>" />
29
+ <?php endforeach; ?>
30
+ </div>
31
+ </label>
32
+ </li>
33
+ <?php endif; ?>
34
 
 
 
35
  <li>
36
  <label for="card-number"><?php echo $this->__('Card Number'); ?></label>
37
  <div class="card-input braintree-card-input-field">
app/design/frontend/base/default/template/gene/braintree/creditcard/saved.phtml ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if($this->hasSavedDetails() && $this->getMethod()->isVaultEnabled()): ?>
2
+
3
+ <label><?php echo $this->__('Saved Cards'); ?></label><br />
4
+ <p style="padding-left: 0;" class="saved-cards-intro"><?php echo $this->__('The following credit cards accounts are currently linked with your account.'); ?></p>
5
+ <table cellspacing="0" cellpadding="0" id="creditcard-saved-accounts">
6
+ <?php
7
+ $count = 0;
8
+ foreach($this->getSavedDetails() as $savedDetail):
9
+ ?>
10
+ <tr valign="middle">
11
+ <td width="20">
12
+ <?php if($this->getMethod()->is3DEnabled()): ?>
13
+ <input type="radio" name="payment[card_payment_method_token]" id="<?php echo $savedDetail->token; ?>" data-token="<?php echo $savedDetail->token; ?>" data-threedsecure-nonce="<?php echo $this->getMethod()->getThreeDSecureVaultNonce($savedDetail->token); ?>" value="threedsecure"<?php echo ($count == 0 ? ' checked="checked"' : ''); ?>/>
14
+ <?php else: ?>
15
+ <input type="radio" name="payment[card_payment_method_token]" id="<?php echo $savedDetail->token; ?>" value="<?php echo $savedDetail->token; ?>"<?php echo ($count == 0 ? ' checked="checked"' : ''); ?>/>
16
+ <?php endif; ?>
17
+ </td>
18
+ <td>
19
+ <label for="<?php echo $savedDetail->token; ?>">
20
+ <img src="<?php echo $this->getSkinUrl('images/gene/braintree/' . Gene_Braintree_Block_Creditcard::getCardIcon($savedDetail->cardType)) ?>" align="left" />
21
+ <span class="saved-card-info">
22
+ <span class="saved-card-number">&nbsp;&nbsp; xxxx - xxxx - xxxx - <?php echo $savedDetail->last4; ?></span>
23
+ <span class="saved-expiry-date"><em><?php echo $this->__('Expires:'); ?></em> <?php echo $savedDetail->expirationMonth; ?>/<?php echo $savedDetail->expirationYear; ?></span>
24
+ </span>
25
+ </label>
26
+ </td>
27
+ </tr>
28
+ <?php
29
+ ++$count;
30
+ endforeach; ?>
31
+ <tr valign="middle" class="other-row">
32
+ <td width="20"><input type="radio" name="payment[card_payment_method_token]" id="other-creditcard" value="other" /></td>
33
+ <td><label for="other-creditcard"><?php echo $this->__('New Credit Card'); ?></label></td>
34
+ </tr>
35
+ </table>
36
+
37
+ <?php endif; ?>
app/design/frontend/base/default/template/gene/braintree/customer/edit.phtml ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_ccExpMonth = $this->getPaymentMethod()->expirationMonth;
3
+ $_ccExpYear = $this->getPaymentMethod()->expirationYear;
4
+ $_code = 'gene_braintree_creditcard';
5
+ ?>
6
+ <?php if($this->getTitle()): ?>
7
+ <div class="page-title">
8
+ <h1><?php echo $this->getTitle() ?></h1>
9
+ </div>
10
+ <?php endif; ?>
11
+ <?php echo $this->getMessagesBlock()->toHtml() ?>
12
+ <form action="<?php echo $this->getSaveUrl() ?>" method="post" id="form-validate" class="gene-braintree-edit-form">
13
+ <input type="hidden" name="id" value="<?php echo $this->getPaymentMethod()->token; ?>" />
14
+ <div class="fieldset">
15
+ <h2 class="legend"><?php echo $this->__('Payment Information') ?></h2>
16
+ <ul class="form-list">
17
+ <li class="fields">
18
+ <div class="field">
19
+ <label><?php echo $this->__('Card Number') ?></label>
20
+ <div class="input-box card-number">
21
+ <img align="left" src="<?php echo $this->getSkinUrl('images/gene/braintree/' . Gene_Braintree_Block_Creditcard::getCardIcon($this->getPaymentMethod()->cardType)); ?>" /> <?php echo $this->getPaymentMethod()->bin; ?>******<?php echo $this->getPaymentMethod()->last4; ?>
22
+ </div>
23
+ </div>
24
+ <div class="field">
25
+ <label><?php echo $this->__('Expiry Date') ?></label>
26
+ <div class="input-box expiry-date">
27
+ <div class="v-fix">
28
+ <select id="<?php echo $_code ?>_expiration" name="payment[cc_exp_month]" data-genebraintree-name="expiration_month" class="month validate-cc-exp required-entry">
29
+ <?php foreach ($this->getCcMonths() as $k=>$v): ?>
30
+ <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccExpMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
31
+ <?php endforeach ?>
32
+ </select>
33
+ </div>
34
+ <div class="v-fix">
35
+ <select id="<?php echo $_code ?>_expiration_yr" name="payment[cc_exp_year]" data-genebraintree-name="expiration_year" class="year required-entry">
36
+ <?php foreach ($this->getCcYears() as $k=>$v): ?>
37
+ <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccExpYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
38
+ <?php endforeach ?>
39
+ </select>
40
+ </div>
41
+ </div>
42
+ </div>
43
+ <?php /*
44
+ CVV field is not stored in Braintree's vault so there is currently no need for a customer to update it
45
+ <div class="field">
46
+ <label><?php echo $this->__('CVV') ?></label>
47
+ <div class="input-box cvv-field">
48
+ <div class="v-fix">
49
+ <input type="text" name="cvv" title="<?php echo Mage::helper('core')->quoteEscape($this->__('CVV')) ?>" class="input-text" id="cvv" />
50
+ </div>
51
+ <a href="#" class="cvv-what-is-this" id="toggle-braintree-tool-tip"><?php echo $this->__('What is this?') ?></a>
52
+ </div>
53
+ <div class="tool-tip" id="braintree-tool-tip" style="display:none;">
54
+ <div class="btn-close"><a href="#" id="braintree-tool-tip-close" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Close')) ?>"><?php echo $this->__('Close') ?></a></div>
55
+ <div class="tool-tip-content"><img src="<?php echo $this->getSkinUrl('images/cvv.gif') ?>" alt="<?php echo Mage::helper('core')->quoteEscape($this->__('Card Verification Number Visual Reference')) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Card Verification Number Visual Reference')) ?>" /></div>
56
+ </div>
57
+ </div>
58
+ */ ?>
59
+ </li>
60
+ </ul>
61
+ </div>
62
+ <div class="fieldset">
63
+ <?php echo $this->getBlockHtml('formkey')?>
64
+ <h2 class="legend"><?php echo $this->__('Contact Information') ?></h2>
65
+ <ul class="form-list">
66
+ <li class="fields">
67
+ <?php echo $this->getNameBlockHtml() ?>
68
+ </li>
69
+ <li class="wide">
70
+ <label for="company"><?php echo $this->__('Company') ?></label>
71
+ <div class="input-box">
72
+ <input type="text" name="billing[company]" id="company" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Company')) ?>" value="<?php echo $this->escapeHtml($this->getAddress()->getCompany()) ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('company') ?>" />
73
+ </div>
74
+ </li>
75
+ </ul>
76
+ </div>
77
+ <div class="fieldset">
78
+ <h2 class="legend"><?php echo $this->__('Address') ?></h2>
79
+ <ul class="form-list">
80
+ <?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
81
+ <li class="wide">
82
+ <label for="street_1" class="required"><em>*</em><?php echo $this->__('Street Address') ?></label>
83
+ <div class="input-box">
84
+ <input type="text" name="billing[street][]" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet(1)) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Street Address')) ?>" id="street_1" class="input-text <?php echo $_streetValidationClass ?>" />
85
+ </div>
86
+ </li>
87
+ <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
88
+ <?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
89
+ <li class="wide">
90
+ <div class="input-box">
91
+ <input type="text" name="billing[street][]" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet($_i)) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Street Address %s', $_i)) ?>" id="street_<?php echo $_i ?>" class="input-text <?php echo $_streetValidationClass ?>" />
92
+ </div>
93
+ </li>
94
+ <?php endfor; ?>
95
+ <li class="fields">
96
+ <div class="field">
97
+ <label for="city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
98
+ <div class="input-box">
99
+ <input type="text" name="billing[city]" value="<?php echo $this->escapeHtml($this->getAddress()->getCity()) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('City')) ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('city') ?>" id="city" />
100
+ </div>
101
+ </div>
102
+ <div class="field">
103
+ <label for="region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
104
+ <div class="input-box">
105
+ <select id="region_id" name="billing[region_id]" title="<?php echo Mage::helper('core')->quoteEscape($this->__('State/Province')) ?>" class="validate-select" style="display:none;">
106
+ <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
107
+ </select>
108
+ <script type="text/javascript">
109
+ //<![CDATA[
110
+ $('region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
111
+ //]]>
112
+ </script>
113
+ <input type="text" id="region" name="billing[region]" value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('State/Province')) ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('region') ?>" />
114
+ </div>
115
+ </div>
116
+ </li>
117
+ <li class="fields">
118
+ <div class="field">
119
+ <label for="zip" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
120
+ <div class="input-box">
121
+ <input type="text" name="billing[postcode]" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Zip/Postal Code')) ?>" id="zip" class="input-text validate-zip-international <?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>" />
122
+ </div>
123
+ </div>
124
+ <div class="field">
125
+ <label for="country" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
126
+ <div class="input-box">
127
+ <?php echo $this->getCountryHtmlSelect(null, 'billing[country_id]') ?>
128
+ </div>
129
+ </div>
130
+ </li>
131
+ </ul>
132
+ </div>
133
+ <div class="buttons-set">
134
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
135
+ <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
136
+ <button data-action="save-customer-address" type="submit" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Save Address')) ?>" class="button"><span><span><?php echo $this->__('Save Address') ?></span></span></button>
137
+ </div>
138
+ </form>
139
+ <script type="text/javascript">
140
+ //<![CDATA[
141
+ var dataForm = new VarienForm('form-validate', true);
142
+ new RegionUpdater('country', 'region', 'region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'zip');
143
+
144
+ if ($('toggle-braintree-tool-tip')) {
145
+ $('toggle-braintree-tool-tip').observe('click', toggleCvvToolTip);
146
+ }
147
+ function toggleCvvToolTip(event){
148
+ if($('braintree-tool-tip')){
149
+ $('braintree-tool-tip').setStyle({
150
+ top: (Event.pointerY(event)-560)+'px'
151
+ })
152
+ $('braintree-tool-tip').toggle();
153
+ }
154
+ Event.stop(event);
155
+ }
156
+ if($('braintree-tool-tip-close')){
157
+ Event.observe($('braintree-tool-tip-close'), 'click', toggleCvvToolTip);
158
+ }
159
+ //]]>
160
+ </script>
app/design/frontend/base/default/template/gene/braintree/customer/methods.phtml CHANGED
@@ -3,18 +3,28 @@
3
  <table width="100%">
4
  <?php foreach($savedDetails as $savedDetail): ?>
5
  <tr>
6
- <td width="60">
7
  <img src="<?php echo $this->getSkinUrl('images/gene/braintree/' . Gene_Braintree_Block_Creditcard::getCardIcon((isset($savedDetail->cardType) ? $savedDetail->cardType : 'paypal'))); ?>" />
8
  </td>
9
  <td>
10
  <?php if(isset($savedDetail->cardType)): ?>
11
- xxxx - xxxx - xxxx - <?php echo $savedDetail->last4; ?> &nbsp;&nbsp;&nbsp; <em><?php echo $this->__('Expires:'); ?></em> <?php echo $savedDetail->expirationMonth; ?>/<?php echo $savedDetail->expirationYear; ?>
 
 
 
 
 
12
  <?php else: ?>
13
- <?php echo $savedDetail->email; ?>
 
 
14
  <?php endif; ?>
15
  </td>
16
- <td>
17
- <a href="<?php echo $this->getUrl('*/*/remove', array('id' => $savedDetail->token)); ?>" onclick="if(!confirm('<?php echo $this->__('Are you sure you want to remove this payment method?'); ?>')) { return false }"><?php echo $this->__('Remove'); ?></a>
 
 
 
18
  </td>
19
  </tr>
20
  <?php endforeach; ?>
3
  <table width="100%">
4
  <?php foreach($savedDetails as $savedDetail): ?>
5
  <tr>
6
+ <td width="64">
7
  <img src="<?php echo $this->getSkinUrl('images/gene/braintree/' . Gene_Braintree_Block_Creditcard::getCardIcon((isset($savedDetail->cardType) ? $savedDetail->cardType : 'paypal'))); ?>" />
8
  </td>
9
  <td>
10
  <?php if(isset($savedDetail->cardType)): ?>
11
+ <span class="payment-method-card-number">
12
+ <?php echo $savedDetail->bin; ?>******<?php echo $savedDetail->last4; ?>
13
+ </span>
14
+ <span class="payment-method-expiry-date">
15
+ <em><?php echo $this->__('Expires:'); ?></em> <?php echo $savedDetail->expirationMonth; ?>/<?php echo $savedDetail->expirationYear; ?>
16
+ </span>
17
  <?php else: ?>
18
+ <span class="payment-method-paypal-email">
19
+ <?php echo $savedDetail->email; ?>
20
+ </span>
21
  <?php endif; ?>
22
  </td>
23
+ <td class="method-options align-right">
24
+ <?php if(isset($savedDetail->cardType)): ?>
25
+ <a href="<?php echo $this->getUrl('*/*/edit', array('id' => $savedDetail->token)); ?>"><?php echo $this->__('Edit'); ?></a>
26
+ <?php endif; ?>
27
+ <a href="<?php echo $this->getUrl('*/*/remove', array('id' => $savedDetail->token)); ?>" onclick="return confirm('<?php echo $this->__('Are you sure you want to remove this payment method?'); ?>');"><?php echo $this->__('Remove'); ?></a>
28
  </td>
29
  </tr>
30
  <?php endforeach; ?>
app/design/frontend/base/default/template/gene/braintree/customer/saved.phtml CHANGED
@@ -1,34 +1,36 @@
1
- <div class="page-title">
2
- <h1><?php echo $this->__('Saved Payment Information') ?></h1>
3
- </div>
4
-
5
- <?php echo $this->getMessagesBlock()->toHtml() ?>
6
-
7
- <div class="fieldset">
8
-
9
- <?php if($this->hasSavedDetails()): ?>
10
-
11
- <p><?php echo $this->__('You\'re able to use any of the listed payment methods below when purchasing through our checkout, you\'re able to add new payment methods within the checkout.'); ?></p>
12
-
13
- <div class="col2-set">
14
-
15
- <?php if($this->hasSavedDetails(Gene_Braintree_Model_Saved::SAVED_CREDITCARD_ID)): ?>
16
- <div class="col-1">
17
- <h2 class="legend"><?php echo $this->__('Cards') ?></h2>
18
- <?php echo $this->getChild('methods')->setType(Gene_Braintree_Model_Saved::SAVED_CREDITCARD_ID)->toHtml(); ?>
19
- </div>
20
- <?php endif; ?>
21
-
22
- <?php if($this->hasSavedDetails(Gene_Braintree_Model_Saved::SAVED_PAYPAL_ID)): ?>
23
- <div class="col-1">
24
- <h2 class="legend"><?php echo $this->__('PayPal') ?></h2>
25
- <?php echo $this->getChild('methods')->setType(Gene_Braintree_Model_Saved::SAVED_PAYPAL_ID)->toHtml(); ?>
 
 
 
26
  </div>
27
- <?php endif; ?>
28
-
29
- </div>
30
 
31
- <?php else: ?>
32
- <p><?php echo $this->__('You currently have no saved payment information, you can save a payment method when making a purchase.'); ?></p>
33
- <?php endif; ?>
 
34
  </div>
1
+ <div id="braintree-saved-payments">
2
+ <div class="page-title">
3
+ <h1><?php echo $this->__('Saved Payment Information') ?></h1>
4
+ </div>
5
+
6
+ <?php echo $this->getMessagesBlock()->toHtml() ?>
7
+
8
+ <div class="fieldset">
9
+
10
+ <?php if($this->hasSavedDetails()): ?>
11
+
12
+ <p><?php echo $this->__('You\'re able to use any of the listed payment methods below when purchasing through our checkout, you\'re able to add new payment methods within the checkout.'); ?></p>
13
+
14
+ <form action="" method="post">
15
+ <div class="payment-methods-container">
16
+ <?php if($this->hasSavedDetails(Gene_Braintree_Model_Saved::SAVED_CREDITCARD_ID)): ?>
17
+ <div class="payment-methods">
18
+ <h2 class="legend"><?php echo $this->__('Credit Cards') ?></h2>
19
+ <?php echo $this->getChild('methods')->setType(Gene_Braintree_Model_Saved::SAVED_CREDITCARD_ID)->toHtml(); ?>
20
+ </div>
21
+ <?php endif; ?>
22
+
23
+ <?php if($this->hasSavedDetails(Gene_Braintree_Model_Saved::SAVED_PAYPAL_ID)): ?>
24
+ <div class="payment-methods">
25
+ <h2 class="legend"><?php echo $this->__('PayPal') ?></h2>
26
+ <?php echo $this->getChild('methods')->setType(Gene_Braintree_Model_Saved::SAVED_PAYPAL_ID)->toHtml(); ?>
27
+ </div>
28
+ <?php endif; ?>
29
  </div>
30
+ </form>
 
 
31
 
32
+ <?php else: ?>
33
+ <p><?php echo $this->__('You currently have no saved payment information, you can save a payment method when making a purchase.'); ?></p>
34
+ <?php endif; ?>
35
+ </div>
36
  </div>
app/design/frontend/base/default/template/gene/braintree/express/cart.phtml ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * @var Gene_Braintree_Block_Express_Button $this
4
+ */
5
+ ?>
6
+
7
+
8
+ <?php if( !$this->isEnabled() || !$this->isEnabledCart() ) return; ?>
9
+
10
+ <?php /* Check if this block has already been setup, so we don't have multuple divs */
11
+ if( !$this->hasBeenSetup() ): ?>
12
+ <div id="pp-express-overlay"></div>
13
+ <div id="pp-express-modal"></div>
14
+ <div id="pp-express-container"></div>
15
+
16
+ <!-- Form to pass formkey over to controllers -->
17
+ <form id="pp_express_form">
18
+ <input type="hidden" name="source" value="cart" />
19
+ <?php echo $this->getBlockHtml('formkey') ?>
20
+ </form>
21
+ <?php endif; ?>
22
+
23
+ <script type="text/javascript">
24
+ if (typeof Translator !== 'object' && typeof Translate == 'object') {
25
+ var Translator = new Translate([]);
26
+ }
27
+
28
+ if (typeof Translator === 'object') {
29
+ Translator.add({
30
+ "We were unable to complete the request. Please try again.": "<?php echo $this->__('We were unable to complete the request. Please try again.'); ?>",
31
+ "Checkout with PayPal": "<?php echo $this->__("Checkout with PayPal"); ?>"
32
+ })
33
+ }
34
+
35
+ Event.observe(window, 'load', function() {
36
+ if (typeof ppExpress === 'object') {
37
+ ppExpress.addBtn({
38
+ token: '<?php echo $this->getToken(); ?>',
39
+ currency: '<?php echo $this->getStoreCurrency(); ?>',
40
+ priceFormat: <?php echo Mage::helper('core')->jsonEncode(Mage::app()->getLocale()->getJsPriceFormat()); ?>,
41
+ locale: '<?php echo strtolower($this->getStoreLocale()); ?>',
42
+ authUrl: '<?php echo $this->getUrl('braintree/express/authorization') ?>',
43
+ shippingSaveUrl:'<?php echo $this->getUrl('braintree/express/saveShipping') ?>',
44
+ successUrl: '<?php echo $this->getUrl("checkout/onepage/success"); ?>',
45
+ buyButtonPlacement: function() {
46
+ var placement = document.getElementsByClassName("checkout-types");
47
+ if (placement.length <= 0) {
48
+ return false;
49
+ }
50
+
51
+ for(var i=0; i < placement.length; i++) {
52
+ if( placement[i].classList.contains("top") ) {
53
+ return placement[i];
54
+ }
55
+ }
56
+
57
+ return false;
58
+ }
59
+ });
60
+ }
61
+ });
62
+ </script>
app/design/frontend/base/default/template/gene/braintree/express/catalog.phtml ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * @var Gene_Braintree_Block_Express_Button $this
4
+ */
5
+ ?>
6
+
7
+ <?php if( !$this->isEnabled() || !$this->isEnabledPdp()) return; ?>
8
+
9
+ <?php /* Check if this block has already been setup, so we don't have multuple divs */
10
+ if( !$this->hasBeenSetup() ): ?>
11
+ <div id="pp-express-overlay"></div>
12
+ <div id="pp-express-modal"></div>
13
+ <div id="pp-express-container"></div>
14
+ <?php endif; ?>
15
+
16
+ <script type="text/javascript">
17
+ <?php if( !$this->hasBeenSetup() ): ?>
18
+ if (typeof Translator !== 'object' && typeof Translate == 'object') {
19
+ var Translator = new Translate([]);
20
+ }
21
+
22
+ if (typeof Translator === 'object') {
23
+ Translator.add({
24
+ "We were unable to complete the request. Please try again.": "<?php echo $this->__('We were unable to complete the request. Please try again.'); ?>",
25
+ "Checkout with PayPal": "<?php echo $this->__("Checkout with PayPal"); ?>"
26
+ })
27
+ }
28
+ <?php endif; ?>
29
+
30
+ Event.observe(window, 'load', function() {
31
+ if (typeof ppExpress === 'object') {
32
+ ppExpress.addBtn({
33
+ token: '<?php echo $this->getToken(); ?>',
34
+ currency: '<?php echo $this->getStoreCurrency(); ?>',
35
+ priceFormat: <?php echo Mage::helper('core')->jsonEncode(Mage::app()->getLocale()->getJsPriceFormat()); ?>,
36
+ locale: '<?php echo strtolower($this->getStoreLocale()); ?>',
37
+ productId: <?php echo (int) $this->getProduct()->getId(); ?>,
38
+ authUrl: '<?php echo $this->getUrl('braintree/express/authorization') ?>',
39
+ shippingSaveUrl:'<?php echo $this->getUrl('braintree/express/saveShipping') ?>',
40
+ successUrl: '<?php echo $this->getUrl("checkout/onepage/success"); ?>',
41
+ });
42
+ }
43
+ });
44
+ </script>
app/design/frontend/base/default/template/gene/braintree/express/error.phtml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <div class="item-row"><strong><?php echo $this->__('Your Order'); ?></strong></div>
2
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
3
+
4
+ <button type="button" onclick="document.location=document.location;" class="button"><?php echo $this->__('Close'); ?></button>
app/design/frontend/base/default/template/gene/braintree/express/shipping_details.phtml ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* @var $this Gene_Braintree_Block_Express_Checkout */
3
+ ?>
4
+ <form action="<?php echo $this->getUrl('braintree/express/shipping') ?>" method="post">
5
+ <input type="hidden" name="submit_shipping" value="1" />
6
+
7
+ <div class="item-row"><strong><?php echo $this->__('Your Order'); ?></strong></div>
8
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
9
+
10
+ <?php foreach($this->getQuote()->getAllVisibleItems() as $item): ?>
11
+ <div class="product-row item-row">
12
+ <div class="product-image"><img src="<?php echo Mage::helper('catalog/image')->init($item->getProduct(), 'thumbnail'); ?>" /></div>
13
+ <div class="product-info">
14
+ <h2 class="product-name"><?php echo $item->getProduct()->getName(); ?></h2>
15
+ <div class="product-qty"><?php echo $this->__('Quantity:'); ?> <?php echo $item->getQty(); ?></div>
16
+ </div>
17
+ </div>
18
+ <?php endforeach; ?>
19
+
20
+ <?php if ($this->hasShippingRates()): ?>
21
+ <div class="shipping-row item-row">
22
+ <strong><?php echo $this->__('Shipping method:'); ?></strong>
23
+
24
+ <?php foreach($this->getShippingRates() as $_rate): ?>
25
+ <label class="item-subrow">
26
+ <input type="radio" name="shipping_method" value="<?php echo $_rate->getCode(); ?>" onchange="ppExpress.updateShipping('<?php echo $_rate->getCode(); ?>')" />
27
+
28
+ <?php echo $_rate->getMethodTitle(); ?> &#8211;
29
+ <strong><?php echo Mage::helper('core')->currency($_rate->getPrice(), true, false); ?></strong>
30
+ </label>
31
+ <?php endforeach; ?>
32
+
33
+ </div>
34
+ <div class="item-row" id="paypal-express-totals">
35
+ <?php echo $this->getChildHtml('totals'); ?>
36
+ </div>
37
+
38
+ <button type="submit" class="button"><?php echo $this->__('Place Order'); ?></button>
39
+ <?php else: ?>
40
+ <p><?php echo $this->__('There are no shipping methods available for your address.'); ?></p>
41
+ <p><?php echo $this->__('Please repeat the process, selecting an address that we\'re able to deliver to.'); ?></p>
42
+ <br /><br />
43
+ <?php endif; ?>
44
+
45
+ <div><button type="button" class="button2" onclick="ppExpress.hideModal();"><?php echo $this->__('Cancel'); ?></button></div>
46
+ </form>
app/design/frontend/base/default/template/gene/braintree/js/aheadworks.phtml CHANGED
@@ -137,7 +137,7 @@
137
  new vZeroIntegration(
138
  (window.vzero || false),
139
  (window.vzeroPaypal || false),
140
- '<div id="paypal-complete"><label id="paypal-label"><?php echo $this->__('Complete checkout with'); ?> </label><div id="paypal-container"></div></div>',
141
  '#aw-onestepcheckout-place-order-button',
142
  true,
143
  {
137
  new vZeroIntegration(
138
  (window.vzero || false),
139
  (window.vzeroPaypal || false),
140
+ '<div id="paypal-complete"><div id="paypal-container"></div></div>',
141
  '#aw-onestepcheckout-place-order-button',
142
  true,
143
  {
app/design/frontend/base/default/template/gene/braintree/js/amasty.phtml CHANGED
@@ -110,7 +110,7 @@
110
  new vZeroIntegration(
111
  (window.vzero || false),
112
  (window.vzeroPaypal || false),
113
- '<div id="paypal-complete"><label id="paypal-label"><?php echo $this->__('Complete checkout with'); ?></label><div id="paypal-container"></div></div>',
114
  '.amscheckout-submit',
115
  true,
116
  {
110
  new vZeroIntegration(
111
  (window.vzero || false),
112
  (window.vzeroPaypal || false),
113
+ '<div id="paypal-complete"><div id="paypal-container"></div></div>',
114
  '.amscheckout-submit',
115
  true,
116
  {
app/design/frontend/base/default/template/gene/braintree/js/default.phtml CHANGED
@@ -111,7 +111,7 @@
111
  new vZeroIntegration(
112
  (window.vzero || false),
113
  (window.vzeroPaypal || false),
114
- '<div id="paypal-complete"><label id="paypal-label"><?php echo $this->__('Complete checkout with'); ?> </label><div id="paypal-container"></div></div>',
115
  '#review-buttons-container button'
116
  );
117
 
111
  new vZeroIntegration(
112
  (window.vzero || false),
113
  (window.vzeroPaypal || false),
114
+ '<div id="paypal-complete"><div id="paypal-container"></div></div>',
115
  '#review-buttons-container button'
116
  );
117
 
app/design/frontend/base/default/template/gene/braintree/js/firecheckout.phtml CHANGED
@@ -78,7 +78,7 @@
78
  new vZeroIntegration(
79
  (window.vzero || false),
80
  (window.vzeroPaypal || false),
81
- '<div id="paypal-complete"><div id="paypal-container"></div><label id="paypal-label"><?php echo $this->__('Complete checkout with'); ?> </label></div>',
82
  '#review-buttons-container .btn-checkout',
83
  true,
84
  {
78
  new vZeroIntegration(
79
  (window.vzero || false),
80
  (window.vzeroPaypal || false),
81
+ '<div id="paypal-complete"><div id="paypal-container"></div></div>',
82
  '#review-buttons-container .btn-checkout',
83
  true,
84
  {
app/design/frontend/base/default/template/gene/braintree/js/fme.phtml CHANGED
@@ -12,7 +12,6 @@
12
 
13
  /**
14
  * Validate the entire checkout
15
- * Annoyingly IWD hasn't already wrapped this in a function
16
  */
17
  validateAll: function() {
18
  var validation = new Validation(review.form);
@@ -81,7 +80,7 @@
81
  new vZeroIntegration(
82
  (window.vzero || false),
83
  (window.vzeroPaypal || false),
84
- '<div id="paypal-complete"><div id="paypal-container"></div><label id="paypal-label"><?php echo $this->__('Complete checkout with'); ?> </label></div>',
85
  '#review-buttons-container .input_button',
86
  true,
87
  {
12
 
13
  /**
14
  * Validate the entire checkout
 
15
  */
16
  validateAll: function() {
17
  var validation = new Validation(review.form);
80
  new vZeroIntegration(
81
  (window.vzero || false),
82
  (window.vzeroPaypal || false),
83
+ '<div id="paypal-complete"><div id="paypal-container"></div></div>',
84
  '#review-buttons-container .input_button',
85
  true,
86
  {
app/design/frontend/base/default/template/gene/braintree/js/idev.phtml CHANGED
@@ -98,7 +98,7 @@
98
  var _integration = new vZeroIntegration(
99
  (window.vzero || false),
100
  (window.vzeroPaypal || false),
101
- '<div id="paypal-complete"><div id="paypal-container"></div><label id="paypal-label"><?php echo $this->__('Complete checkout with'); ?> </label></div>',
102
  '#onestepcheckout-place-order',
103
  true,
104
  {
@@ -129,7 +129,7 @@
129
  _integration.prepareSubmitObserver();
130
 
131
  // Detect if we've overriden the function
132
- if(!/braintreeOverride/.match($('onestepcheckout-form').submit.toString())) {
133
 
134
  // Re-fire the event
135
  return $('onestepcheckout-place-order').click();
98
  var _integration = new vZeroIntegration(
99
  (window.vzero || false),
100
  (window.vzeroPaypal || false),
101
+ '<div id="paypal-complete"><div id="paypal-container"></div></div>',
102
  '#onestepcheckout-place-order',
103
  true,
104
  {
129
  _integration.prepareSubmitObserver();
130
 
131
  // Detect if we've overriden the function
132
+ if(/braintreeOverride/.match($('onestepcheckout-form').submit.toString())) {
133
 
134
  // Re-fire the event
135
  return $('onestepcheckout-place-order').click();
app/design/frontend/base/default/template/gene/braintree/js/iwd.phtml CHANGED
@@ -178,7 +178,7 @@
178
  new vZeroIntegration(
179
  (window.vzero || false),
180
  (window.vzeroPaypal || false),
181
- '<div id="paypal-complete"><label id="paypal-label"><?php echo $this->__('Complete checkout with'); ?> </label><div id="paypal-container"></div></div>',
182
  '.opc-btn-checkout',
183
  true,
184
  {
178
  new vZeroIntegration(
179
  (window.vzero || false),
180
  (window.vzeroPaypal || false),
181
+ '<div id="paypal-complete"><div id="paypal-container"></div></div>',
182
  '.opc-btn-checkout',
183
  true,
184
  {
app/design/frontend/base/default/template/gene/braintree/js/magestore.phtml CHANGED
@@ -123,7 +123,7 @@
123
  new vZeroIntegration(
124
  (window.vzero || false),
125
  (window.vzeroPaypal || false),
126
- '<div id="paypal-complete"><label id="paypal-label"><?php echo $this->__('Complete checkout with'); ?> </label><div id="paypal-container"></div></div>',
127
  '#onestepcheckout-button-place-order',
128
  true
129
  );
123
  new vZeroIntegration(
124
  (window.vzero || false),
125
  (window.vzeroPaypal || false),
126
+ '<div id="paypal-complete"><div id="paypal-container"></div></div>',
127
  '#onestepcheckout-button-place-order',
128
  true
129
  );
app/design/frontend/base/default/template/gene/braintree/js/multishipping.phtml CHANGED
@@ -9,25 +9,32 @@
9
 
10
  vZeroIntegration.addMethods({
11
 
 
 
 
12
  setLoading: function () {
13
-
 
14
  },
15
-
16
  resetLoading: function () {
17
-
 
18
  },
19
 
20
  /**
21
  * Attach an observer to the submit action of the checkout to tokenize the card details
22
  */
23
- prepareSubmitObserver: function () {
24
 
25
  // Store a pointer to the vZero integration
26
  var vzeroIntegration = this;
27
 
28
  // Observe the click event
29
  var _originalSubmitEvent = $('multishipping-billing-form').submit;
30
- $('multishipping-billing-form').submit = function braintreeOverride() {
 
 
 
31
 
32
  if (vzeroIntegration.shouldInterceptSubmit('creditcard')) {
33
 
@@ -45,20 +52,18 @@
45
  },
46
 
47
  /**
48
- * Replace the PayPal button at the correct time
49
- *
50
- * This should be overridden within each checkouts .phtml file
51
- * vZeroIntegration.prototype.preparePaymentMethodSwitchObserver = function() {}
52
  */
53
  preparePaymentMethodSwitchObserver: function() {
 
54
  // Store a pointer to the vZero integration
55
  var vzeroIntegration = this;
56
 
57
  // Store the original payment method
58
- var paymentSwitchOriginal = payment.switchMethod;
59
 
60
  // Intercept the save function
61
- payment.switchMethod = function (method) {
62
 
63
  // Run our method switch function
64
  vzeroIntegration.paymentMethodSwitch(method);
@@ -66,6 +71,74 @@
66
  // Run the original function
67
  return paymentSwitchOriginal.apply(this, arguments);
68
  };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  }
70
 
71
  });
@@ -78,8 +151,9 @@
78
  new vZeroIntegration(
79
  (window.vzero || false),
80
  (window.vzeroPaypal || false),
81
- '<div id="paypal-complete"><label id="paypal-label"><?php echo $this->__('Complete checkout with'); ?> </label><div id="paypal-container"></div></div>',
82
- '#review-buttons-container button'
 
83
  );
84
 
85
  </script>
9
 
10
  vZeroIntegration.addMethods({
11
 
12
+ /**
13
+ * Multi shipping doesn't have ajax states
14
+ **/
15
  setLoading: function () {
16
+ $('payment-continue').setAttribute('disabled','disabled');
17
+ $('payment-continue').addClassName('loading');
18
  },
 
19
  resetLoading: function () {
20
+ $('payment-continue').removeAttribute('disabled');
21
+ $('payment-continue').removeClassName('loading');
22
  },
23
 
24
  /**
25
  * Attach an observer to the submit action of the checkout to tokenize the card details
26
  */
27
+ prepareSubmitObserver: function() {
28
 
29
  // Store a pointer to the vZero integration
30
  var vzeroIntegration = this;
31
 
32
  // Observe the click event
33
  var _originalSubmitEvent = $('multishipping-billing-form').submit;
34
+ $('multishipping-billing-form').onsubmit = function braintreeOverride(event) {
35
+
36
+ // Stop the event
37
+ Event.stop(event);
38
 
39
  if (vzeroIntegration.shouldInterceptSubmit('creditcard')) {
40
 
52
  },
53
 
54
  /**
55
+ * Attach an event to insert the PayPal button on the review step of the checkout
 
 
 
56
  */
57
  preparePaymentMethodSwitchObserver: function() {
58
+
59
  // Store a pointer to the vZero integration
60
  var vzeroIntegration = this;
61
 
62
  // Store the original payment method
63
+ var paymentSwitchOriginal = paymentForm.prototype.switchMethod;
64
 
65
  // Intercept the save function
66
+ paymentForm.prototype.switchMethod = function (method) {
67
 
68
  // Run our method switch function
69
  vzeroIntegration.paymentMethodSwitch(method);
71
  // Run the original function
72
  return paymentSwitchOriginal.apply(this, arguments);
73
  };
74
+
75
+ },
76
+
77
+ /**
78
+ * Hide or show the "other" method for both PayPal & Credit Card
79
+ *
80
+ * @param parentElement
81
+ * @param targetElement
82
+ */
83
+ showHideOtherMethod: function (parentElement, targetElement) {
84
+
85
+ // Has the user selected other?
86
+ if ($$(parentElement + ' input:checked[type=radio]').first() !== undefined && $$(parentElement + ' input:checked[type=radio]').first().value == 'other') {
87
+
88
+ if ($$(targetElement).first() !== undefined) {
89
+
90
+ // Show the credit card form
91
+ $$(targetElement).first().show();
92
+
93
+ // Enable the credit card form all the elements in the credit card form
94
+ $$(targetElement + ' input, ' + targetElement + ' select').each(function (formElement) {
95
+ formElement.removeAttribute('disabled');
96
+ });
97
+
98
+ // Do we need to re-initialize hosted fields?
99
+ if (this.vzero.hostedFields) {
100
+ this.initHostedFields();
101
+ }
102
+
103
+ }
104
+
105
+ } else if ($$(parentElement + ' input:checked[type=radio]').first() !== undefined) {
106
+
107
+ if ($$(targetElement).first() !== undefined) {
108
+
109
+ // Hide the new credit card form
110
+ $$(targetElement).first().hide();
111
+
112
+ // Disable all the elements in the credit card form
113
+ $$(targetElement + ' input, ' + targetElement + ' select').each(function (formElement) {
114
+ formElement.setAttribute('disabled', 'disabled');
115
+ });
116
+
117
+ // Tear down hosted fields
118
+ if (this.vzero.hostedFields) {
119
+ this.vzero.teardownHostedFields();
120
+ $('credit-card-form').addClassName('loading');
121
+ }
122
+
123
+ }
124
+
125
+ }
126
+ },
127
+
128
+ /**
129
+ * Let the back-end system know the customer is using multi shipping
130
+ */
131
+ getBillingAddress: function () {
132
+ return {
133
+ billing: 'multishipping'
134
+ };
135
+ },
136
+
137
+ /**
138
+ * Submit the payment
139
+ */
140
+ submitCheckout: function () {
141
+ return $('multishipping-billing-form').submit();
142
  }
143
 
144
  });
151
  new vZeroIntegration(
152
  (window.vzero || false),
153
  (window.vzeroPaypal || false),
154
+ '<div id="paypal-complete"><div id="paypal-container"></div></div>',
155
+ '.buttons-set button#payment-continue',
156
+ true
157
  );
158
 
159
  </script>
app/design/frontend/base/default/template/gene/braintree/js/oye.phtml CHANGED
@@ -117,7 +117,7 @@
117
  var integration = new vZeroIntegration(
118
  (window.vzero || false),
119
  (window.vzeroPaypal || false),
120
- '<div id="paypal-complete"><div id="paypal-container"></div><label id="paypal-label"><?php echo $this->__('Complete checkout with'); ?> </label></div>',
121
  '#review-buttons-container .btn-checkout',
122
  true,
123
  {
117
  var integration = new vZeroIntegration(
118
  (window.vzero || false),
119
  (window.vzeroPaypal || false),
120
+ '<div id="paypal-complete"><div id="paypal-container"></div></div>',
121
  '#review-buttons-container .btn-checkout',
122
  true,
123
  {
app/design/frontend/base/default/template/gene/braintree/js/setup.phtml CHANGED
@@ -40,6 +40,16 @@
40
 
41
  </script>
42
 
 
 
 
 
 
 
 
 
 
 
43
  <?php
44
  /**
45
  * We always want to hide the logged in aspect of the PayPal button, only ever display the button
40
 
41
  </script>
42
 
43
+ <script type="text/html" id="braintree-paypal-button">
44
+ <button type="button" name="braintree-paypal-button" class="braintree-paypal-button">
45
+ <span>
46
+ <span>
47
+ <?php echo $this->__('Checkout with'); ?>
48
+ </span>
49
+ </span>
50
+ </button>
51
+ </script>
52
+
53
  <?php
54
  /**
55
  * We always want to hide the logged in aspect of the PayPal button, only ever display the button
app/design/frontend/base/default/template/gene/braintree/js/unicode.phtml CHANGED
@@ -74,7 +74,7 @@
74
  new vZeroIntegration(
75
  (window.vzero || false),
76
  (window.vzeroPaypal || false),
77
- '<div id="paypal-complete"><label id="paypal-label"><?php echo $this->__('Complete checkout with'); ?> </label><div id="paypal-container"></div></div>',
78
  '#opcheckout-place-order-button',
79
  true,
80
  {
74
  new vZeroIntegration(
75
  (window.vzero || false),
76
  (window.vzeroPaypal || false),
77
+ '<div id="paypal-complete"><div id="paypal-container"></div></div>',
78
  '#opcheckout-place-order-button',
79
  true,
80
  {
app/design/frontend/base/default/template/gene/braintree/paypal.phtml CHANGED
@@ -3,36 +3,7 @@
3
  ?>
4
  <div class="form-list" id="payment_form_<?php echo $this->getMethodCode() ?>" style="display: none;">
5
 
6
- <?php if($this->hasSavedDetails() && $this->getMethod()->isVaultEnabled()): ?>
7
-
8
- <label><?php echo $this->__('Linked Accounts'); ?></label>
9
- <p><?php echo $this->__('The following PayPal accounts are currently linked with your account.'); ?></p>
10
- <table width="100%" cellspacing="0" cellpadding="0" id="paypal-saved-accounts">
11
- <tbody>
12
- <?php
13
- $count = 0;
14
- foreach($this->getSavedDetails() as $savedDetail):
15
- ?>
16
- <tr valign="middle">
17
- <td width="20"><input type="radio" name="payment[paypal_payment_method_token]" id="<?php echo $savedDetail->token; ?>" value="<?php echo $savedDetail->token; ?>"<?php echo ($count == 0 ? ' checked="checked"' : ''); ?>/></td>
18
- <td valign="middle">
19
- <label for="<?php echo $savedDetail->token; ?>" style="line-height: 48px;">
20
- <img src="<?php echo $this->getSkinUrl('images/gene/braintree/PP.png') ?>" align="left" />
21
- <span class="saved-paypal-email"><?php echo $savedDetail->email; ?></span>
22
- </label>
23
- </td>
24
- </tr>
25
- <?php
26
- ++$count;
27
- endforeach; ?>
28
- <tr valign="middle" class="other-row">
29
- <td width="20"><input type="radio" name="payment[paypal_payment_method_token]" id="other-paypal" value="other" /></td>
30
- <td><label for="other-paypal"><?php echo $this->__('New PayPal Account'); ?></label></td>
31
- </tr>
32
- </tbody>
33
- </table>
34
-
35
- <?php endif; ?>
36
 
37
  <div class="paypal-info"<?php echo ($this->hasSavedDetails() && $this->getMethod()->isVaultEnabled() ? ' style="display: none;"' : ''); ?>>
38
  <p><?php echo $this->__('You will complete your payment via PayPal after the order review step.'); ?></p>
3
  ?>
4
  <div class="form-list" id="payment_form_<?php echo $this->getMethodCode() ?>" style="display: none;">
5
 
6
+ <?php echo $this->getSavedChildHtml(); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
  <div class="paypal-info"<?php echo ($this->hasSavedDetails() && $this->getMethod()->isVaultEnabled() ? ' style="display: none;"' : ''); ?>>
9
  <p><?php echo $this->__('You will complete your payment via PayPal after the order review step.'); ?></p>
app/design/frontend/base/default/template/gene/braintree/paypal/saved.phtml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if($this->hasSavedDetails() && $this->getMethod()->isVaultEnabled()): ?>
2
+
3
+ <label><?php echo $this->__('Linked Accounts'); ?></label>
4
+ <p><?php echo $this->__('The following PayPal accounts are currently linked with your account.'); ?></p>
5
+ <table width="100%" cellspacing="0" cellpadding="0" id="paypal-saved-accounts">
6
+ <tbody>
7
+ <?php
8
+ $count = 0;
9
+ foreach($this->getSavedDetails() as $savedDetail):
10
+ ?>
11
+ <tr valign="middle">
12
+ <td width="20"><input type="radio" name="payment[paypal_payment_method_token]" id="<?php echo $savedDetail->token; ?>" value="<?php echo $savedDetail->token; ?>"<?php echo ($count == 0 ? ' checked="checked"' : ''); ?>/></td>
13
+ <td valign="middle">
14
+ <label for="<?php echo $savedDetail->token; ?>" style="line-height: 48px;">
15
+ <img src="<?php echo $this->getSkinUrl('images/gene/braintree/PP.png') ?>" align="left" />
16
+ <span class="saved-paypal-email"><?php echo $savedDetail->email; ?></span>
17
+ </label>
18
+ </td>
19
+ </tr>
20
+ <?php
21
+ ++$count;
22
+ endforeach; ?>
23
+ <tr valign="middle" class="other-row">
24
+ <td width="20"><input type="radio" name="payment[paypal_payment_method_token]" id="other-paypal" value="other" /></td>
25
+ <td><label for="other-paypal"><?php echo $this->__('New PayPal Account'); ?></label></td>
26
+ </tr>
27
+ </tbody>
28
+ </table>
29
+
30
+ <?php endif; ?>
app/locale/en_US/Gene_Braintree.csv CHANGED
@@ -118,4 +118,19 @@
118
  "Save this card for future use","Save this card for future use"
119
  "Sadly, we're unable to accept this type of card, please try another.","Sadly, we're unable to accept this type of card, please try another."
120
  "We cannot detect the card type for this card number, please try re-entering your card details.","We cannot detect the card type for this card number, please try re-entering your card details."
121
- "We cannot match this card number to any of our accepted payment methods, please try re-entering your details.","We cannot match this card number to any of our accepted payment methods, please try re-entering your details."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  "Save this card for future use","Save this card for future use"
119
  "Sadly, we're unable to accept this type of card, please try another.","Sadly, we're unable to accept this type of card, please try another."
120
  "We cannot detect the card type for this card number, please try re-entering your card details.","We cannot detect the card type for this card number, please try re-entering your card details."
121
+ "We cannot match this card number to any of our accepted payment methods, please try re-entering your details.","We cannot match this card number to any of our accepted payment methods, please try re-entering your details."
122
+ "We were unable to start the express checkout.","We were unable to start the express checkout."
123
+ "We were unable to process the response from PayPal. Please try again.","We were unable to process the response from PayPal. Please try again."
124
+ "Please provide a shipping address.","Please provide a shipping address."
125
+ "Sorry, we were unable to process your request. Please try again.","Sorry, we were unable to process your request. Please try again."
126
+ "We were unable to process the country.","We were unable to process the country."
127
+ "Please select a shipping method.","Please select a shipping method."
128
+ "Your Order","Your Order"
129
+ "Shipping method:","Shipping method:"
130
+ "Grand total:","Grand total:"
131
+ "Place Order","Place Order"
132
+ "Cancel","Cancel"
133
+ "Close","Close"
134
+ "We were unable to complete the request. Please try again.","We were unable to complete the request. Please try again."
135
+ "Buy Now","Buy Now"
136
+ "Checkout with PayPal","Checkout with PayPal"
js/gene/braintree/config.codekit CHANGED
@@ -4,8 +4,8 @@
4
  "files": {
5
  "\/braintree-0.1.js": {
6
  "fileType": 64,
7
- "ignore": 1,
8
- "ignoreWasSetByUser": 1,
9
  "inputAbbreviatedPath": "\/braintree-0.1.js",
10
  "outputAbbreviatedPath": "\/min\/braintree-0.1-min.js",
11
  "outputPathIsOutsideProject": 0,
@@ -13,6 +13,17 @@
13
  "outputStyle": 1,
14
  "syntaxCheckerStyle": 1
15
  },
 
 
 
 
 
 
 
 
 
 
 
16
  "\/vzero-0.7-min.js": {
17
  "fileType": 64,
18
  "ignore": 1,
@@ -32,7 +43,7 @@
32
  "outputAbbreviatedPath": "\/vzero-0.7-min.js",
33
  "outputPathIsOutsideProject": 0,
34
  "outputPathIsSetByUser": 1,
35
- "outputStyle": 2,
36
  "syntaxCheckerStyle": 0
37
  }
38
  },
@@ -45,7 +56,7 @@
45
  "bowerAbbreviatedPath": "",
46
  "displayValue": "braintree",
47
  "displayValueWasSetByUser": 0,
48
- "iconImageName": "compass_darkGray"
49
  },
50
  "projectSettings": {
51
  "alwaysUseExternalServer": 0,
4
  "files": {
5
  "\/braintree-0.1.js": {
6
  "fileType": 64,
7
+ "ignore": 0,
8
+ "ignoreWasSetByUser": 0,
9
  "inputAbbreviatedPath": "\/braintree-0.1.js",
10
  "outputAbbreviatedPath": "\/min\/braintree-0.1-min.js",
11
  "outputPathIsOutsideProject": 0,
13
  "outputStyle": 1,
14
  "syntaxCheckerStyle": 1
15
  },
16
+ "\/express.js": {
17
+ "fileType": 64,
18
+ "ignore": 1,
19
+ "ignoreWasSetByUser": 1,
20
+ "inputAbbreviatedPath": "\/express.js",
21
+ "outputAbbreviatedPath": "\/min\/express-min.js",
22
+ "outputPathIsOutsideProject": 0,
23
+ "outputPathIsSetByUser": 0,
24
+ "outputStyle": 1,
25
+ "syntaxCheckerStyle": 1
26
+ },
27
  "\/vzero-0.7-min.js": {
28
  "fileType": 64,
29
  "ignore": 1,
43
  "outputAbbreviatedPath": "\/vzero-0.7-min.js",
44
  "outputPathIsOutsideProject": 0,
45
  "outputPathIsSetByUser": 1,
46
+ "outputStyle": 1,
47
  "syntaxCheckerStyle": 0
48
  }
49
  },
56
  "bowerAbbreviatedPath": "",
57
  "displayValue": "braintree",
58
  "displayValueWasSetByUser": 0,
59
+ "iconImageName": "brackets_gray"
60
  },
61
  "projectSettings": {
62
  "alwaysUseExternalServer": 0,
js/gene/braintree/express.js ADDED
@@ -0,0 +1,314 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Express paypal button for the Braintree module
3
+ *
4
+ * @author Aidan Threadgold <aidan@gene.co.uk>
5
+ */
6
+ var ppExpress = (function() {
7
+
8
+ var config;
9
+
10
+ /**
11
+ * Hold the paypal integration object
12
+ */
13
+ var paypalIntegration;
14
+
15
+ /**
16
+ * API to return
17
+ */
18
+ var api = {
19
+ addBtn: function(secondConfig) {
20
+
21
+ /**
22
+ * Required config keys
23
+ */
24
+ config = {
25
+ /**
26
+ * Braintree token
27
+ */
28
+ token: null,
29
+
30
+ /**
31
+ * Currency code
32
+ */
33
+ currency: null,
34
+
35
+ /**
36
+ * Locale code
37
+ */
38
+ locale: null,
39
+
40
+ /**
41
+ * Magento price format json
42
+ */
43
+ priceFormat: null,
44
+
45
+ /**
46
+ * Product ID
47
+ */
48
+ productId: null,
49
+
50
+ /**
51
+ * Url to the braintree authorization action within the express controller
52
+ */
53
+ authUrl: null,
54
+
55
+ /**
56
+ * Url to redirect to on successful order
57
+ */
58
+ successUrl: null,
59
+
60
+ /**
61
+ * Buy button will validate product add form if it's present
62
+ */
63
+ validateProductForm: true,
64
+
65
+ /**
66
+ * Optional
67
+ * Buy now button element
68
+ * @returns {Element}
69
+ */
70
+ buyButton: function() {
71
+ var button = document.createElement('button');
72
+ button.innerHTML = typeof Translator === "object" ? Translator.translate("Checkout with PayPal") : "Checkout with PayPal";
73
+ button.className = "button pp-express-buy-btn";
74
+
75
+ return button;
76
+ },
77
+
78
+ /**
79
+ * Optional
80
+ * Dom element to append the buy now button to
81
+ * @returns {*}
82
+ */
83
+ buyButtonPlacement: function() {
84
+ var placement = document.getElementsByClassName("add-to-cart");
85
+ if (placement.length > 0) {
86
+ placement = placement[0];
87
+ return placement;
88
+ }
89
+
90
+ return false;
91
+ }
92
+ };
93
+
94
+ config = $H(config).merge(secondConfig);
95
+ for(var key in config) {
96
+ if( config[key] === null ) {
97
+ console.error('Invalid value for ' + key);
98
+ return false;
99
+ }
100
+ }
101
+
102
+ initBraintree(config);
103
+ initDom(config);
104
+ return true;
105
+ },
106
+
107
+ /**
108
+ * Get modal's overlay element
109
+ * @returns {Element}
110
+ */
111
+ getOverlay: function() {
112
+ return document.getElementById('pp-express-overlay');
113
+ },
114
+
115
+ /**
116
+ * Get the modal element
117
+ * @returns {Element}
118
+ */
119
+ getModal: function() {
120
+ return document.getElementById('pp-express-modal');
121
+ },
122
+
123
+ /**
124
+ * Hide the modal
125
+ */
126
+ hideModal: function() {
127
+ this.getOverlay().style.display = 'none';
128
+ this.getModal().style.display = 'none';
129
+
130
+ this.getModal().innerHTML = '';
131
+ },
132
+
133
+ /**
134
+ * Show the modal
135
+ */
136
+ showModal: function() {
137
+ this.getModal().innerHTML = '';
138
+ this.getModal().classList.add('loading');
139
+
140
+ this.getOverlay().style.display = 'block';
141
+ this.getModal().style.display = 'block';
142
+ },
143
+
144
+ /**
145
+ * Update the grand total display within the modal
146
+ */
147
+ updateShipping: function(method) {
148
+ new Ajax.Request(config.get('shippingSaveUrl'), {
149
+ method: 'POST',
150
+ parameters: {
151
+ 'submit_shipping': true,
152
+ 'shipping_method': method
153
+ },
154
+
155
+ onSuccess: function (data) {
156
+ $('paypal-express-totals').update(data.responseText);
157
+ },
158
+
159
+ onFailure: function () {
160
+ api.hideModal();
161
+ alert( typeof Translator === "object" ? Translator.translate("We were unable to complete the request. Please try again.") : "We were unable to complete the request. Please try again." );
162
+ }
163
+ });
164
+ }
165
+ };
166
+
167
+ /**
168
+ * Setup braintree
169
+ */
170
+ function initBraintree(config) {
171
+ braintree.setup(config.get('token'), "custom", {
172
+ paypal: {
173
+ container: "pp-express-container",
174
+ singleUse: false,
175
+ currency: config.get('currency'),
176
+ locale: config.get('locale'),
177
+ enableShippingAddress: true,
178
+ headless: true
179
+ },
180
+
181
+ onReady: function (integration) {
182
+ paypalIntegration = integration;
183
+ },
184
+
185
+ onPaymentMethodReceived: function (obj) {
186
+ api.showModal();
187
+
188
+ /* Build the order */
189
+ new Ajax.Request(config.get('authUrl'), {
190
+ method: 'POST',
191
+ parameters: {
192
+ 'paypal': JSON.stringify(obj),
193
+ 'product_id': config.get('productId'),
194
+ 'form_data': $('product_addtocart_form') ? $('product_addtocart_form').serialize() : $('pp_express_form').serialize()
195
+ },
196
+
197
+ onSuccess: function (data) {
198
+ api.getModal().classList.remove('loading');
199
+ api.getModal().innerHTML = data.responseText;
200
+ ajaxHandler();
201
+ },
202
+
203
+ onFailure: function () {
204
+ api.hideModal();
205
+ alert( typeof Translator === "object" ? Translator.translate("We were unable to complete the request. Please try again.") : "We were unable to complete the request. Please try again." );
206
+ }
207
+ });
208
+
209
+ }
210
+ });
211
+ }
212
+
213
+ /**
214
+ * Attach an event to forms loaded through ajax to submit them again as ajax
215
+ * */
216
+ function ajaxHandler() {
217
+ var forms = api.getModal().getElementsByTagName('form'),
218
+ i = 0;
219
+
220
+ if (forms.length > 0) {
221
+ for (i = 0; i < forms.length; i++) {
222
+ forms[i].addEventListener('submit', function (e) {
223
+ e.preventDefault();
224
+
225
+ api.getModal().classList.add('loading');
226
+ api.getModal().innerHTML = '';
227
+
228
+ new Ajax.Request(this.getAttribute('action'), {
229
+ method: 'POST',
230
+ parameters: $(this).serialize(true),
231
+
232
+ onSuccess: function (data) {
233
+ if (data.responseText == 'complete') {
234
+ document.location = config.get('successUrl');
235
+ return;
236
+ }
237
+
238
+ api.getModal().classList.remove('loading');
239
+ api.getModal().innerHTML = data.responseText;
240
+ ajaxHandler();
241
+ },
242
+
243
+ onFailure: function () {
244
+ api.hideModal();
245
+ alert( typeof Translator === "object" ? Translator.translate("We were unable to complete the request. Please try again.") : "We were unable to complete the request. Please try again." );
246
+ }
247
+ });
248
+
249
+ return false;
250
+ });
251
+ }
252
+ }
253
+ }
254
+
255
+ /**
256
+ * Add the buy button and modal events
257
+ */
258
+ function initDom(config) {
259
+ /* Hide the overlay on click */
260
+ api.getOverlay().addEventListener('click', function () {
261
+ api.hideModal();
262
+ });
263
+
264
+ /* Append the buy button container next the cart button */
265
+ var placement = config.get('buyButtonPlacement')(),
266
+ buyButton = config.get('buyButton')();
267
+
268
+ if( !placement ) {
269
+ console.error("Invalid Braintree PayPal express placement element");
270
+ return;
271
+ }
272
+
273
+ if( !buyButton ) {
274
+ console.error("Invalid Braintree PayPal button element");
275
+ return;
276
+ }
277
+
278
+ buyButton.addEventListener('click', function (event) {
279
+ event.preventDefault();
280
+
281
+ /* Validate product options and start the paypal flow */
282
+ if (validateForm()) {
283
+ paypalIntegration.paypal.initAuthFlow();
284
+ }
285
+ }, false);
286
+
287
+ placement.appendChild(buyButton);
288
+ }
289
+
290
+ /**
291
+ * Validate the form
292
+ *
293
+ * @returns {boolean}
294
+ */
295
+ function validateForm()
296
+ {
297
+ if (config.get("validateProductForm") === false) {
298
+ return true;
299
+ }
300
+
301
+ // Validate the product add to cart form
302
+ if (typeof productAddToCartForm === 'object' && productAddToCartForm.validator.validate()) {
303
+ if (typeof productAddToCartFormOld === 'object' && productAddToCartFormOld.validator.validate()) {
304
+ return true;
305
+ } else if (typeof productAddToCartFormOld !== 'object') {
306
+ return true;
307
+ }
308
+ }
309
+
310
+ return (typeof productAddToCartForm !== 'object' && typeof productAddToCartFormOld !== 'object');
311
+ }
312
+
313
+ return api;
314
+ })();
js/gene/braintree/vzero-0.7-min.js CHANGED
@@ -1,2 +1 @@
1
- var vZero=Class.create();vZero.prototype={initialize:function(e,t,i,n,a,s,o,r,d){this.code=e,this.clientToken=t,this.threeDSecure=i,this.hostedFields=n,a&&(this.billingName=a),s&&(this.billingPostcode=s),o&&(this.quoteUrl=o),r&&(this.tokenizeUrl=r),d&&(this.vaultToNonceUrl=d),this._hostedFieldsTokenGenerated=!1,this.acceptedCards=!1,this.closeMethod=!1,this._hostedFieldsTimeout=!1,this._updateDataXhr=!1,this._updateDataCallbacks=[],this._updateDataParams={},this._vaultToNonceXhr=!1},init:function(){this.client=new braintree.api.Client({clientToken:this.clientToken})},initHostedFields:function(e){return $$('iframe[name^="braintree-"]').length>0?!1:null===$("braintree-hosted-submit")?!1:(this.integration=e,this._hostedFieldsTokenGenerated=!1,clearTimeout(this._hostedFieldsTimeout),void(this._hostedFieldsTimeout=setTimeout(function(){if(this._hostedIntegration!==!1)try{this._hostedIntegration.teardown(function(){this._hostedIntegration=!1,this.setupHostedFieldsClient()}.bind(this))}catch(e){this.setupHostedFieldsClient()}else this.setupHostedFieldsClient()}.bind(this),50)))},setupHostedFieldsClient:function(){if($$('iframe[name^="braintree-"]').length>0)return!1;this._hostedIntegration=!1;var e={id:this.integration.form,hostedFields:{styles:{input:{"font-size":"14pt",color:"#3A3A3A"},":focus":{color:"black"},".valid":{color:"green"},".invalid":{color:"red"}},number:{selector:"#card-number",placeholder:"0000 0000 0000 0000"},expirationMonth:{selector:"#expiration-month",placeholder:"MM"},expirationYear:{selector:"#expiration-year",placeholder:"YY"},onFieldEvent:this.hostedFieldsOnFieldEvent.bind(this)},onReady:function(e){this._hostedIntegration=e}.bind(this),onPaymentMethodReceived:this.hostedFieldsPaymentMethodReceived.bind(this),onError:this.hostedFieldsError.bind(this)};null!==$("cvv")&&(e.hostedFields.cvv={selector:"#cvv"}),braintree.setup(this.clientToken,"custom",e)},hostedFieldsOnFieldEvent:function(e){if("fieldStateChange"===e.type&&e.card){var t={visa:"VI","american-express":"AE","master-card":"MC",discover:"DI",jcb:"JCB",maestro:"ME"};void 0!==typeof t[e.card.type]?this.updateCardType(!1,t[e.card.type]):this.updateCardType(!1,"card")}},vaultToNonce:function(nonce,callback){var parameters=this.getBillingAddress();parameters.nonce=nonce,new Ajax.Request(this.vaultToNonceUrl,{method:"post",parameters:parameters,onSuccess:function(transport){if(transport&&transport.responseText){try{response=eval("("+transport.responseText+")")}catch(e){response={}}response.success&&response.nonce?callback(response.nonce):("function"==typeof this.integration.resetLoading&&this.integration.resetLoading(),response.error?alert(response.error):alert("Something wen't wrong and we're currently unable to take your payment."))}}.bind(this),onFailure:function(){"function"==typeof this.integration.resetLoading&&this.integration.resetLoading(),alert("Something wen't wrong and we're currently unable to take your payment.")}.bind(this)})},hostedFieldsPaymentMethodReceived:function(e){this.threeDSecure?("function"==typeof this.integration.setLoading&&this.integration.setLoading(),this.updateData(function(){this.vaultToNonce(e.nonce,function(e){"function"==typeof this.integration.resetLoading&&this.integration.resetLoading(),this.verify3dSecureNonce(e,{onSuccess:function(e){this.hostedFieldsNonceReceived(e.nonce)}.bind(this),onFailure:function(e,t){alert(t)}.bind(this)})}.bind(this))}.bind(this))):this.hostedFieldsNonceReceived(e.nonce)},hostedFieldsNonceReceived:function(e){$("creditcard-payment-nonce").value=e,$("creditcard-payment-nonce").setAttribute("value",e),"function"==typeof this.integration.resetLoading&&this.integration.resetLoading(),this._hostedFieldsTokenGenerated=!0,"function"==typeof this.integration.afterHostedFieldsNonceReceived&&this.integration.afterHostedFieldsNonceReceived(e)},hostedFieldsError:function(e){return"function"==typeof this.integration.resetLoading&&this.integration.resetLoading(),"undefined"!=typeof e.message&&-1==e.message.indexOf("Cannot place two elements in")&&alert(e.message),this._hostedFieldsTokenGenerated=!1,"function"==typeof this.integration.afterHostedFieldsError&&this.integration.afterHostedFieldsError(e.message),!1},usingSavedCard:function(){return void 0!=$("creditcard-saved-accounts")&&void 0!=$$("#creditcard-saved-accounts input:checked[type=radio]").first()&&"other"!==$$("#creditcard-saved-accounts input:checked[type=radio]").first().value},setThreeDSecure:function(e){this.threeDSecure=e},setAmount:function(e){this.amount=parseFloat(e)},setBillingName:function(e){this.billingName=e},getBillingName:function(){return"object"==typeof this.billingName?this.combineElementsValues(this.billingName):this.billingName},setBillingPostcode:function(e){this.billingPostcode=e},getBillingPostcode:function(){return"object"==typeof this.billingPostcode?this.combineElementsValues(this.billingPostcode):this.billingPostcode},setAcceptedCards:function(e){this.acceptedCards=e},getBillingAddress:function(){if("function"==typeof this.integration.getBillingAddress)return this.integration.getBillingAddress();var e={};return null!==$("co-billing-form")?e="FORM"==$("co-billing-form").tagName?$("co-billing-form").serialize(!0):this.extractBilling($("co-billing-form").up("form").serialize(!0)):null!==$("billing:firstname")&&(e=this.extractBilling($("billing:firstname").up("form").serialize(!0))),e?e:void 0},extractBilling:function(e){var t={};return $H(e).each(function(e){0==e.key.indexOf("billing")&&-1==e.key.indexOf("password")&&(t[e.key]=e.value)}),t},getAcceptedCards:function(){return this.acceptedCards},combineElementsValues:function(e,t){t||(t=" ");var i=[];return e.each(function(e,t){void 0!==$(e)&&(i[t]=$(e).value)}),i.join(t)},updateCardType:function(e,t){if(t||(t=this.getCardType(e)),void 0!=$("gene_braintree_creditcard_cc_type")&&("card"==t?$("gene_braintree_creditcard_cc_type").value="":$("gene_braintree_creditcard_cc_type").value=t),void 0!=$("card-type-image")){var i=$("card-type-image").src.substring(0,$("card-type-image").src.lastIndexOf("/"));$("card-type-image").setAttribute("src",i+"/"+t+".png")}},observeCardType:function(){void 0!==$$('[data-genebraintree-name="number"]').first()&&(Element.observe($$('[data-genebraintree-name="number"]').first(),"keyup",function(){vzero.updateCardType(this.value)}),$$('[data-genebraintree-name="number"]').first().oninput=function(){var e=this.value.split(" ").join("");e.length>0&&(e=e.match(new RegExp(".{1,4}","g")).join(" ")),this.value=e})},observeAjaxRequests:function(e,t){Ajax.Responders.register({onComplete:function(i){return this.handleAjaxRequest(i.url,e,t)}.bind(this)}),window.jQuery&&jQuery(document).ajaxComplete(function(i,n,a){return this.handleAjaxRequest(a.url,e,t)}.bind(this))},handleAjaxRequest:function(e,t,i){if("undefined"!=typeof i&&i instanceof Array&&i.length>0){var n=!1;if(i.each(function(t){e&&-1!=e.indexOf(t)&&(n=!0)}),n===!0)return!1}e&&-1==e.indexOf("braintree")&&(t?t(e):this.updateData())},updateData:function(callback,params){this._updateDataCallbacks.push(callback),this._updateDataParams=params,this._updateDataXhr!==!1&&this._updateDataXhr.transport.abort(),this._updateDataXhr=new Ajax.Request(this.quoteUrl,{method:"post",parameters:this._updateDataParams,onSuccess:function(transport){if(transport&&transport.responseText){try{response=eval("("+transport.responseText+")")}catch(e){response={}}void 0!=response.billingName&&(this.billingName=response.billingName),void 0!=response.billingPostcode&&(this.billingPostcode=response.billingPostcode),void 0!=response.grandTotal&&(this.amount=response.grandTotal),void 0!=response.threeDSecure&&this.setThreeDSecure(response.threeDSecure),"undefined"!=typeof vzeroPaypal&&void 0!=response.grandTotal&&void 0!=response.currencyCode&&vzeroPaypal.setPricing(response.grandTotal,response.currencyCode),this._updateDataParams={},this._updateDataXhr=!1,this._updateDataCallbacks.length&&(this._updateDataCallbacks.each(function(e){e(response)}.bind(this)),this._updateDataCallbacks=[])}}.bind(this),onFailure:function(){this._updateDataParams={},this._updateDataXhr=!1,this._updateDataCallbacks=[]}.bind(this)})},close3dSecureMethod:function(e){this.closeMethod=e},tokenize3dSavedCards:function(callback){if(this.threeDSecure)if(void 0!==$$("[data-token]").first()){var tokens=[];$$("[data-token]").each(function(e,t){tokens[t]=e.getAttribute("data-token")}),new Ajax.Request(this.tokenizeUrl,{method:"post",onSuccess:function(transport){if(transport&&transport.responseText){try{response=eval("("+transport.responseText+")")}catch(e){response={}}response.success&&$H(response.tokens).each(function(e){void 0!=$$('[data-token="'+e.key+'"]').first()&&$$('[data-token="'+e.key+'"]').first().setAttribute("data-threedsecure-nonce",e.value)}),callback&&callback(response)}}.bind(this),parameters:{tokens:Object.toJSON(tokens)}})}else callback();else callback()},onUserClose3ds:function(){this._hostedFieldsTokenGenerated=!1,this.closeMethod?this.closeMethod():checkout.setLoadWaiting(!1)},verify3dSecureNonce:function(e,t){var i={amount:this.amount,creditCard:e,onUserClose:this.onUserClose3ds.bind(this)};this.client.verify3DS(i,function(e,i){e?t.onFailure&&t.onFailure(i,e.message):t.onSuccess&&t.onSuccess(i)})},verify3dSecure:function(e){var t={amount:this.amount,creditCard:{number:$$('[data-genebraintree-name="number"]').first().value,expirationMonth:$$('[data-genebraintree-name="expiration_month"]').first().value,expirationYear:$$('[data-genebraintree-name="expiration_year"]').first().value,cardholderName:this.getBillingName()},onUserClose:this.onUserClose3ds.bind(this)};void 0!=$$('[data-genebraintree-name="cvv"]').first()&&(t.creditCard.cvv=$$('[data-genebraintree-name="cvv"]').first().value),""!=this.getBillingPostcode()&&(t.creditCard.billingAddress={postalCode:this.getBillingPostcode()}),this.client.verify3DS(t,function(t,i){t?(alert(t.message),e.onFailure?e.onFailure():checkout.setLoadWaiting(!1)):($("creditcard-payment-nonce").value=i.nonce,$("creditcard-payment-nonce").setAttribute("value",i.nonce),e.onSuccess&&e.onSuccess())})},verify3dSecureVault:function(e){var t=$$("#creditcard-saved-accounts input:checked[type=radio]").first().getAttribute("data-threedsecure-nonce");t?this.client.verify3DS({amount:this.amount,creditCard:t},function(t,i){t?(alert(t.message),e.onFailure?e.onFailure():checkout.setLoadWaiting(!1)):($("creditcard-payment-nonce").removeAttribute("disabled"),$("creditcard-payment-nonce").value=i.nonce,$("creditcard-payment-nonce").setAttribute("value",i.nonce),e.onSuccess&&e.onSuccess())}):(alert("No payment nonce present."),e.onFailure?e.onFailure():checkout.setLoadWaiting(!1))},processCard:function(e){var t={number:$$('[data-genebraintree-name="number"]').first().value,cardholderName:this.getBillingName(),expirationMonth:$$('[data-genebraintree-name="expiration_month"]').first().value,expirationYear:$$('[data-genebraintree-name="expiration_year"]').first().value};void 0!=$$('[data-genebraintree-name="cvv"]').first()&&(t.cvv=$$('[data-genebraintree-name="cvv"]').first().value),""!=this.getBillingPostcode()&&(t.billingAddress={postalCode:this.getBillingPostcode()}),this.client.tokenizeCard(t,function(t,i){if(t){for(var n=0;n<t.length;n++)alert(t[n].code+" "+t[n].message);e.onFailure?e.onFailure():checkout.setLoadWaiting(!1)}else $("creditcard-payment-nonce").value=i,$("creditcard-payment-nonce").setAttribute("value",i),e.onSuccess&&e.onSuccess()})},shouldInterceptCreditCard:function(){return!0},shouldInterceptPayPal:function(){return!0},getCardType:function(e){if(e){if(null!=e.match(/^4/))return"VI";if(null!=e.match(/^(34|37)/))return"AE";if(null!=e.match(/^5[1-5]/))return"MC";if(null!=e.match(/^6011/))return"DI";if(null!=e.match(/^(?:2131|1800|35)/))return"JCB";if(null!=e.match(/^(5018|5020|5038|6304|67[0-9]{2})/))return"ME"}return"card"},process:function(e){e=e||{},this._hostedFieldsTokenGenerated?e.onSuccess&&e.onSuccess():this.usingSavedCard()&&$$("#creditcard-saved-accounts input:checked[type=radio]").first().hasAttribute("data-threedsecure-nonce")?this.verify3dSecureVault(e):this.usingSavedCard()?e.onSuccess&&e.onSuccess():1==this.threeDSecure?this.verify3dSecure(e):this.processCard(e)},creditCardLoaded:function(){return!1},paypalLoaded:function(){return!1}};var vZeroPayPalButton=Class.create();vZeroPayPalButton.prototype={initialize:function(e,t,i,n,a){this.clientToken=e,this.storeFrontName=t,this.singleUse=i,this.locale=n,this.futureSingleUse=a,this._paypalOptions={},this._paypalIntegration=!1,this._rebuildTimer=!1,this._rebuildCount=0},setPricing:function(e,t){this.amount=parseFloat(e),this.currency=t,this.rebuildButton()},rebuildButton:function(){if(clearTimeout(this._rebuildTimer),this._paypalIntegration!==!1)try{this._paypalIntegration.teardown(function(){this._paypalIntegration=!1,this.addPayPalButton(this._paypalOptions)}.bind(this))}catch(e){if("Cannot teardown integration more than once"==e.message)this._paypalIntegration=!1,this.addPayPalButton(this._paypalOptions);else{if(this._rebuildCount>=10)return!1;this._rebuildTimer=setTimeout(function(){++this._rebuildCount,this.rebuildButton()}.bind(this),200)}}},addPayPalButton:function(e){if(null===$("paypal-container"))return!1;this._paypalOptions=e,this._paypalIntegration=!1;var t={container:"paypal-container",paymentMethodNonceInputField:"paypal-payment-nonce",displayName:this.storeFrontName,onPaymentMethodReceived:function(t){"function"==typeof e.onSuccess?e.onSuccess(t):(payment.switchMethod("gene_braintree_paypal"),$("paypal-payment-nonce").removeAttribute("disabled"),$("paypal-complete").remove(),window.review&&review.save())},onUnsupported:function(){alert("You need to link your PayPal account with your Braintree account in your Braintree control panel to utilise the PayPal functionality of this extension.")},onReady:function(t){this._paypalIntegration=t,"function"==typeof e.onReady&&e.onReady(t)}.bind(this)};this.locale&&(t.locale=this.locale),1==this.singleUse?(t.singleUse=!0,t.amount=this.amount,t.currency=this.currency):1==this.futureSingleUse?t.singleUse=!0:t.singleUse=!1,braintree.setup(this.clientToken,"paypal",t)},closePayPalWindow:function(e){}};var vZeroIntegration=Class.create();vZeroIntegration.prototype={initialize:function(e,t,i,n,a,s,o){return vZeroIntegration.prototype.loaded?(console.error("Your checkout is including the Braintree resources multiple times, please resolve this."),!1):(vZeroIntegration.prototype.loaded=!0,this.vzero=e||!1,this.vzeroPaypal=t||!1,this.vzero===!1&&this.vzeroPaypal===!1?(console.warn("The vzero and vzeroPaypal objects are not initiated."),!1):(this.paypalMarkUp=i||!1,this.paypalButtonClass=n||!1,this.isOnepage=a||!1,this.config=s||{},this._methodSwitchTimeout=!1,this._hostedFieldsInit=!1,document.observe("dom:loaded",function(){this.prepareSubmitObserver(),this.preparePaymentMethodSwitchObserver()}.bind(this)),this.hostedFieldsGenerated=!1,this.vzero.close3dSecureMethod(function(){this.vzero._hostedFieldsValidationRunning=!1,this.vzero.tokenize3dSavedCards(function(){this.threeDTokenizationComplete()}.bind(this))}.bind(this)),this.isOnepage&&(this.vzero.observeCardType(),this.observeAjaxRequests(),document.observe("dom:loaded",function(){this.initSavedPayPal(),this.initDefaultMethod(),null!==$("braintree-hosted-submit")&&this.initHostedFields()}.bind(this))),void document.observe("dom:loaded",function(){this.initSavedMethods()}.bind(this))))},initSavedMethods:function(){$$('#creditcard-saved-accounts input[type="radio"], #paypal-saved-accounts input[type="radio"]').each(function(e){var t="",i="";void 0!==e.up("#creditcard-saved-accounts")?(t="#creditcard-saved-accounts",i="#credit-card-form"):void 0!==e.up("#paypal-saved-accounts")&&(t="#paypal-saved-accounts",i=".paypal-info"),$(e).stopObserving("change").observe("change",function(e){return this.showHideOtherMethod(t,i)}.bind(this))}.bind(this))},showHideOtherMethod:function(e,t){void 0!==$$(e+" input:checked[type=radio]").first()&&"other"==$$(e+" input:checked[type=radio]").first().value?void 0!==$$(t).first()&&($$(t).first().show(),$$(t+" input, "+t+" select").each(function(e){e.removeAttribute("disabled")})):void 0!==$$(e+" input:checked[type=radio]").first()&&void 0!==$$(t).first()&&($$(t).first().hide(),$$(t+" input, "+t+" select").each(function(e){e.setAttribute("disabled","disabled")}))},checkSavedOther:function(){var e="",t="";"gene_braintree_creditcard"==this.getPaymentMethod()?(e="#creditcard-saved-accounts",t="#credit-card-form"):"gene_braintree_paypal"==this.getPaymentMethod()&&(e="#paypal-saved-accounts",t=".paypal-info"),void 0!==$$(e).first()&&this.showHideOtherMethod(e,t)},initHostedFields:function(){this.vzero.hostedFields&&null!==$("braintree-hosted-submit")&&(void 0!==$("braintree-hosted-submit").up("form")?(this._hostedFieldsInit=!0,this.form=$("braintree-hosted-submit").up("form"),this.vzero.initHostedFields(this)):console.error("Hosted Fields cannot be initialized as we're unable to locate the parent form."))},afterHostedFieldsNonceReceived:function(e){return this.resetLoading(),this.vzero._hostedFieldsTokenGenerated=!0,this.hostedFieldsGenerated=!0,this.isOnepage?this.submitCheckout():this.submitPayment()},afterHostedFieldsError:function(e){return this.vzero._hostedFieldsTokenGenerated=!1,this.hostedFieldsGenerated=!1,!1},initDefaultMethod:function(){this.shouldAddPayPalButton(!1)&&(this.setLoading(),this.vzero.updateData(function(){this.resetLoading(),this.updatePayPalButton("add")}.bind(this)))},observeAjaxRequests:function(){this.vzero.observeAjaxRequests(function(){this.vzero.updateData(function(){this.isOnepage&&(this.initSavedPayPal(),this.rebuildPayPalButton(),this.checkSavedOther(),this.vzero.hostedFields&&this.initHostedFields()),this.initSavedMethods()}.bind(this))}.bind(this),"undefined"!=typeof this.config.ignoreAjax?this.config.ignoreAjax:!1)},rebuildPayPalButton:function(){null==$("paypal-container")&&this.updatePayPalButton()},initSavedPayPal:function(){void 0!==$$("#paypal-saved-accounts input[type=radio]").first()&&$("paypal-saved-accounts").on("change","input[type=radio]",function(e){this.updatePayPalButton(!1,"gene_braintree_paypal")}.bind(this))},prepareSubmitObserver:function(){return!1},beforeSubmit:function(e){return this._beforeSubmit(e)},_beforeSubmit:function(e){if(this.hostedFieldsGenerated===!1&&this.vzero.hostedFields&&(void 0===$$("#creditcard-saved-accounts input:checked[type=radio]").first()||void 0!==$$("#creditcard-saved-accounts input:checked[type=radio]").first()&&"other"==$$("#creditcard-saved-accounts input:checked[type=radio]").first().value)){var t=$("braintree-hosted-submit").down("button");t.removeAttribute("disabled"),t.click()}else e()},afterSubmit:function(){return!1},submit:function(e,t,i,n){this.shouldInterceptSubmit(e)&&(this.validateAll()?(this.setLoading(),this.beforeSubmit(function(){void 0!=$$('[data-genebraintree-name="number"]').first()&&this.vzero.updateCardType($$('[data-genebraintree-name="number"]').first().value),this.vzero.updateData(function(){this.updateBilling(),this.vzero.process({onSuccess:function(){if(this.enableDeviceData(),this.disableCreditCardForm(),this.resetLoading(),this.afterSubmit(),this.enableDisableNonce(),this.vzero._hostedFieldsTokenGenerated=!1,this.hostedFieldsGenerated=!1,"function"==typeof t)var e=t();return this.setLoading(),this.enableCreditCardForm(),e}.bind(this),onFailure:function(){return this.vzero._hostedFieldsTokenGenerated=!1,this.hostedFieldsGenerated=!1,this.resetLoading(),this.afterSubmit(),"function"==typeof i?i():void 0}.bind(this)})}.bind(this),this.getUpdateDataParams())}.bind(this))):(this.vzero._hostedFieldsTokenGenerated=!1,this.hostedFieldsGenerated=!1,this.resetLoading(),"function"==typeof n&&n()))},submitCheckout:function(){window.review&&review.save()},submitPayment:function(){payment.save&&payment.save()},enableDisableNonce:function(){"gene_braintree_creditcard"==this.getPaymentMethod()?(null!==$("creditcard-payment-nonce")&&$("creditcard-payment-nonce").removeAttribute("disabled"),null!==$("paypal-payment-nonce")&&$("paypal-payment-nonce").setAttribute("disabled","disabled")):"gene_braintree_paypal"==this.getPaymentMethod()&&(null!==$("creditcard-payment-nonce")&&$("creditcard-payment-nonce").setAttribute("disabled","disabled"),null!==$("paypal-payment-nonce")&&$("paypal-payment-nonce").removeAttribute("disabled"))},preparePaymentMethodSwitchObserver:function(){return this.defaultPaymentMethodSwitch()},defaultPaymentMethodSwitch:function(){var e=this,t=Payment.prototype.switchMethod;Payment.prototype.switchMethod=function(i){return e.paymentMethodSwitch(i),t.apply(this,arguments)}},paymentMethodSwitch:function(e){clearTimeout(this._methodSwitchTimeout),this._methodSwitchTimeout=setTimeout(function(){this.shouldAddPayPalButton(e)?this.updatePayPalButton("add",e):this.updatePayPalButton("remove",e),"gene_braintree_creditcard"==(e?e:this.getPaymentMethod())&&this.initHostedFields(),this.checkSavedOther()}.bind(this),50)},completePayPal:function(e){return this.enableDisableNonce(),this.enableDeviceData(),e.nonce&&null!==$("paypal-payment-nonce")?($("paypal-payment-nonce").value=e.nonce,$("paypal-payment-nonce").setAttribute("value",e.nonce)):console.warn("Unable to update PayPal nonce, please verify that the nonce input field has the ID: paypal-payment-nonce"),this.afterPayPalComplete(),!1},afterPayPalComplete:function(){return this.resetLoading(),this.submitCheckout()},updatePayPalButton:function(e,t){if(this.paypalMarkUp===!1)return!1;if("refresh"==e)return this.updatePayPalButton("remove"),this.updatePayPalButton("add"),!0;if(this.shouldAddPayPalButton(t)&&"remove"!=e||"add"==e)if(void 0!==$$(this.paypalButtonClass).first()){if(void 0!==$$("#paypal-complete").first()&&$$("#paypal-complete").first().visible())return!0;$$(this.paypalButtonClass).first().hide(),$$(this.paypalButtonClass).first().insert({after:this.paypalMarkUp});var i={onSuccess:this.completePayPal.bind(this),onReady:this.paypalOnReady.bind(this)};this.vzeroPaypal.addPayPalButton(i)}else console.warn("We're unable to find the element "+this.paypalButtonClass+". Please check your integration.");else void 0!==$$(this.paypalButtonClass).first()&&$$(this.paypalButtonClass).first().show(),void 0!==$$("#paypal-complete").first()&&$("paypal-complete").remove()},paypalOnReady:function(e){null!=$("braintree-paypal-button")&&$("braintree-paypal-button").stopObserving("click").on("click",function(e){return this.validateAll()?void 0:(Event.stop(e),!1)}.bind(this))},setLoading:function(){checkout.setLoadWaiting("payment")},resetLoading:function(){checkout.setLoadWaiting(!1)},enableDeviceData:function(){null!==$("device_data")&&($("device_data").setAttribute("name","payment[device_data]"),$("device_data").removeAttribute("disabled"))},disableCreditCardForm:function(){$$("#credit-card-form input, #credit-card-form select").each(function(e){"creditcard-payment-nonce"!=e.id&&"gene_braintree_creditcard_store_in_vault"!=e.id&&e.setAttribute("disabled","disabled")})},enableCreditCardForm:function(){$$("#credit-card-form input, #credit-card-form select").each(function(e){e.removeAttribute("disabled")})},updateBilling:function(){(null!==$("billing-address-select")&&""==$("billing-address-select").value||null===$("billing-address-select"))&&(null!==$("billing:firstname")&&null!==$("billing:lastname")&&this.vzero.setBillingName($("billing:firstname").value+" "+$("billing:lastname").value),null!==$("billing:postcode")&&this.vzero.setBillingPostcode($("billing:postcode").value))},getUpdateDataParams:function(){var e={};return null!==$("billing-address-select")&&""!=$("billing-address-select").value&&(e.addressId=$("billing-address-select").value),e},getPaymentMethod:function(){return payment.currentMethod},shouldInterceptSubmit:function(e){switch(e){case"creditcard":return"gene_braintree_creditcard"==this.getPaymentMethod()&&this.vzero.shouldInterceptCreditCard();break;case"paypal":return"gene_braintree_paypal"==this.getPaymentMethod()&&this.vzero.shouldInterceptCreditCard()}return!1},shouldAddPayPalButton:function(e){return"gene_braintree_paypal"==(e?e:this.getPaymentMethod())&&null===$("paypal-saved-accounts")||"gene_braintree_paypal"==(e?e:this.getPaymentMethod())&&void 0!==$$("#paypal-saved-accounts input:checked[type=radio]").first()&&"other"==$$("#paypal-saved-accounts input:checked[type=radio]").first().value},threeDTokenizationComplete:function(){this.resetLoading()},validateAll:function(){return!0}},function(){for(var e,t=function(){},i=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","markTimeline","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],n=i.length,a=window.console=window.console||{};n--;)e=i[n],a[e]||(a[e]=t)}();
2
- //# sourceMappingURL=./vzero-0.7-min.js.map
1
+ var vZero=Class.create();vZero.prototype={initialize:function(e,t,i,n,a,o,s,r,d){this.code=e,this.clientToken=t,this.threeDSecure=i,this.hostedFields=n,a&&(this.billingName=a),o&&(this.billingPostcode=o),s&&(this.quoteUrl=s),r&&(this.tokenizeUrl=r),d&&(this.vaultToNonceUrl=d),this._hostedFieldsTokenGenerated=!1,this.acceptedCards=!1,this.closeMethod=!1,this._hostedFieldsTimeout=!1,this._updateDataXhr=!1,this._updateDataCallbacks=[],this._updateDataParams={},this._vaultToNonceXhr=!1},init:function(){this.client=new braintree.api.Client({clientToken:this.clientToken})},initHostedFields:function(e){return $$('iframe[name^="braintree-"]').length>0?!1:null===$("braintree-hosted-submit")?!1:(this.integration=e,this._hostedFieldsTokenGenerated=!1,clearTimeout(this._hostedFieldsTimeout),void(this._hostedFieldsTimeout=setTimeout(function(){if(this._hostedIntegration!==!1)try{this._hostedIntegration.teardown(function(){this._hostedIntegration=!1,this.setupHostedFieldsClient()}.bind(this))}catch(e){this.setupHostedFieldsClient()}else this.setupHostedFieldsClient()}.bind(this),50)))},teardownHostedFields:function(e){this._hostedIntegration!==!1?this._hostedIntegration.teardown(function(){this._hostedIntegration=!1,"function"==typeof e&&e()}.bind(this)):"function"==typeof e&&e()},setupHostedFieldsClient:function(){if($$('iframe[name^="braintree-"]').length>0)return!1;this._hostedIntegration=!1;var e={id:this.integration.form,hostedFields:{styles:this.getHostedFieldsStyles(),number:{selector:"#card-number",placeholder:"0000 0000 0000 0000"},expirationMonth:{selector:"#expiration-month",placeholder:"MM"},expirationYear:{selector:"#expiration-year",placeholder:"YY"},onFieldEvent:this.hostedFieldsOnFieldEvent.bind(this)},onReady:function(e){this._hostedIntegration=e,$$("#credit-card-form.loading").length&&$$("#credit-card-form.loading").first().removeClassName("loading")}.bind(this),onPaymentMethodReceived:this.hostedFieldsPaymentMethodReceived.bind(this),onError:this.hostedFieldsError.bind(this)};null!==$("cvv")&&(e.hostedFields.cvv={selector:"#cvv"}),braintree.setup(this.clientToken,"custom",e)},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"}}},hostedFieldsOnFieldEvent:function(e){if("fieldStateChange"===e.type&&e.card){var t={visa:"VI","american-express":"AE","master-card":"MC",discover:"DI",jcb:"JCB",maestro:"ME"};void 0!==typeof t[e.card.type]?this.updateCardType(!1,t[e.card.type]):this.updateCardType(!1,"card")}},vaultToNonce:function(nonce,callback){var parameters=this.getBillingAddress();parameters.nonce=nonce,new Ajax.Request(this.vaultToNonceUrl,{method:"post",parameters:parameters,onSuccess:function(transport){if(transport&&transport.responseText){var response;try{response=eval("("+transport.responseText+")")}catch(e){response={}}response.success&&response.nonce?callback(response.nonce):("function"==typeof this.integration.resetLoading&&this.integration.resetLoading(),response.error?alert(response.error):alert("Something wen't wrong and we're currently unable to take your payment."))}}.bind(this),onFailure:function(){"function"==typeof this.integration.resetLoading&&this.integration.resetLoading(),alert("Something wen't wrong and we're currently unable to take your payment.")}.bind(this)})},hostedFieldsPaymentMethodReceived:function(e){this.threeDSecure?("function"==typeof this.integration.setLoading&&this.integration.setLoading(),this.updateData(function(){this.vaultToNonce(e.nonce,function(e){"function"==typeof this.integration.resetLoading&&this.integration.resetLoading(),this.verify3dSecureNonce(e,{onSuccess:function(e){this.hostedFieldsNonceReceived(e.nonce)}.bind(this),onFailure:function(e,t){alert(t)}.bind(this)})}.bind(this))}.bind(this))):this.hostedFieldsNonceReceived(e.nonce)},hostedFieldsNonceReceived:function(e){$("creditcard-payment-nonce").value=e,$("creditcard-payment-nonce").setAttribute("value",e),"function"==typeof this.integration.resetLoading&&this.integration.resetLoading(),this._hostedFieldsTokenGenerated=!0,"function"==typeof this.integration.afterHostedFieldsNonceReceived&&this.integration.afterHostedFieldsNonceReceived(e)},hostedFieldsError:function(e){return"function"==typeof this.integration.resetLoading&&this.integration.resetLoading(),"undefined"!=typeof e.message&&-1==e.message.indexOf("Cannot place two elements in")&&alert(e.message),this._hostedFieldsTokenGenerated=!1,"function"==typeof this.integration.afterHostedFieldsError&&this.integration.afterHostedFieldsError(e.message),!1},usingSavedCard:function(){return void 0!=$("creditcard-saved-accounts")&&void 0!=$$("#creditcard-saved-accounts input:checked[type=radio]").first()&&"other"!==$$("#creditcard-saved-accounts input:checked[type=radio]").first().value},setThreeDSecure:function(e){this.threeDSecure=e},setAmount:function(e){this.amount=parseFloat(e)},setBillingName:function(e){this.billingName=e},getBillingName:function(){return"object"==typeof this.billingName?this.combineElementsValues(this.billingName):this.billingName},setBillingPostcode:function(e){this.billingPostcode=e},getBillingPostcode:function(){return"object"==typeof this.billingPostcode?this.combineElementsValues(this.billingPostcode):this.billingPostcode},setAcceptedCards:function(e){this.acceptedCards=e},getBillingAddress:function(){if("function"==typeof this.integration.getBillingAddress)return this.integration.getBillingAddress();var e={};return null!==$("co-billing-form")?e="FORM"==$("co-billing-form").tagName?$("co-billing-form").serialize(!0):this.extractBilling($("co-billing-form").up("form").serialize(!0)):null!==$("billing:firstname")&&(e=this.extractBilling($("billing:firstname").up("form").serialize(!0))),e?e:void 0},extractBilling:function(e){var t={};return $H(e).each(function(e){0==e.key.indexOf("billing")&&-1==e.key.indexOf("password")&&(t[e.key]=e.value)}),t},getAcceptedCards:function(){return this.acceptedCards},combineElementsValues:function(e,t){t||(t=" ");var i=[];return e.each(function(e,t){void 0!==$(e)&&(i[t]=$(e).value)}),i.join(t)},updateCardType:function(e,t){if(t||(t=this.getCardType(e)),void 0!=$("gene_braintree_creditcard_cc_type")&&("card"==t?$("gene_braintree_creditcard_cc_type").value="":$("gene_braintree_creditcard_cc_type").value=t),void 0!=$("card-type-image")){var i=$("card-type-image").src.substring(0,$("card-type-image").src.lastIndexOf("/"));$("card-type-image").setAttribute("src",i+"/"+t+".png")}},observeCardType:function(){void 0!==$$('[data-genebraintree-name="number"]').first()&&(Element.observe($$('[data-genebraintree-name="number"]').first(),"keyup",function(){vzero.updateCardType(this.value)}),$$('[data-genebraintree-name="number"]').first().oninput=function(){var e=this.value.split(" ").join("");e.length>0&&(e=e.match(new RegExp(".{1,4}","g")).join(" ")),this.value=e})},observeAjaxRequests:function(e,t){Ajax.Responders.register({onComplete:function(i){return this.handleAjaxRequest(i.url,e,t)}.bind(this)}),window.jQuery&&jQuery(document).ajaxComplete(function(i,n,a){return this.handleAjaxRequest(a.url,e,t)}.bind(this))},handleAjaxRequest:function(e,t,i){if("undefined"!=typeof i&&i instanceof Array&&i.length>0){var n=!1;if(i.each(function(t){e&&-1!=e.indexOf(t)&&(n=!0)}),n===!0)return!1}e&&-1==e.indexOf("/braintree/")&&(t?t(e):this.updateData())},updateData:function(e,t){this._updateDataCallbacks.push(e),this._updateDataParams=t,this._updateDataXhr!==!1&&this._updateDataXhr.transport.abort(),this._updateDataXhr=new Ajax.Request(this.quoteUrl,{method:"post",parameters:this._updateDataParams,onSuccess:function(e){if(e&&(e.responseJSON||e.responseText)){var t;e.responseJSON&&"object"==typeof e.responseJSON?t=e.responseJSON:e.responseText&&(t=JSON.decode(e.responseText)),void 0!=t.billingName&&(this.billingName=t.billingName),void 0!=t.billingPostcode&&(this.billingPostcode=t.billingPostcode),void 0!=t.grandTotal&&(this.amount=t.grandTotal),void 0!=t.threeDSecure&&this.setThreeDSecure(t.threeDSecure),"undefined"!=typeof vzeroPaypal&&void 0!=t.grandTotal&&void 0!=t.currencyCode&&vzeroPaypal.setPricing(t.grandTotal,t.currencyCode),this._updateDataParams={},this._updateDataXhr=!1,this._updateDataCallbacks.length&&(this._updateDataCallbacks.each(function(e){e(t)}.bind(this)),this._updateDataCallbacks=[])}}.bind(this),onFailure:function(){this._updateDataParams={},this._updateDataXhr=!1,this._updateDataCallbacks=[]}.bind(this)})},close3dSecureMethod:function(e){this.closeMethod=e},tokenize3dSavedCards:function(callback){if(this.threeDSecure)if(void 0!==$$("[data-token]").first()){var tokens=[];$$("[data-token]").each(function(e,t){tokens[t]=e.getAttribute("data-token")}),new Ajax.Request(this.tokenizeUrl,{method:"post",onSuccess:function(transport){if(transport&&transport.responseText){try{response=eval("("+transport.responseText+")")}catch(e){response={}}response.success&&$H(response.tokens).each(function(e){void 0!=$$('[data-token="'+e.key+'"]').first()&&$$('[data-token="'+e.key+'"]').first().setAttribute("data-threedsecure-nonce",e.value)}),callback&&callback(response)}}.bind(this),parameters:{tokens:Object.toJSON(tokens)}})}else callback();else callback()},onUserClose3ds:function(){this._hostedFieldsTokenGenerated=!1,this.closeMethod?this.closeMethod():checkout.setLoadWaiting(!1)},verify3dSecureNonce:function(e,t){var i={amount:this.amount,creditCard:e,onUserClose:this.onUserClose3ds.bind(this)};this.client.verify3DS(i,function(e,i){e?t.onFailure&&t.onFailure(i,e.message):t.onSuccess&&t.onSuccess(i)})},verify3dSecure:function(e){var t={amount:this.amount,creditCard:{number:$$('[data-genebraintree-name="number"]').first().value,expirationMonth:$$('[data-genebraintree-name="expiration_month"]').first().value,expirationYear:$$('[data-genebraintree-name="expiration_year"]').first().value,cardholderName:this.getBillingName()},onUserClose:this.onUserClose3ds.bind(this)};void 0!=$$('[data-genebraintree-name="cvv"]').first()&&(t.creditCard.cvv=$$('[data-genebraintree-name="cvv"]').first().value),""!=this.getBillingPostcode()&&(t.creditCard.billingAddress={postalCode:this.getBillingPostcode()}),this.client.verify3DS(t,function(t,i){t?(alert(t.message),e.onFailure?e.onFailure():checkout.setLoadWaiting(!1)):($("creditcard-payment-nonce").value=i.nonce,$("creditcard-payment-nonce").setAttribute("value",i.nonce),e.onSuccess&&e.onSuccess())})},verify3dSecureVault:function(e){var t=$$("#creditcard-saved-accounts input:checked[type=radio]").first().getAttribute("data-threedsecure-nonce");t?this.client.verify3DS({amount:this.amount,creditCard:t},function(t,i){t?(alert(t.message),e.onFailure?e.onFailure():checkout.setLoadWaiting(!1)):($("creditcard-payment-nonce").removeAttribute("disabled"),$("creditcard-payment-nonce").value=i.nonce,$("creditcard-payment-nonce").setAttribute("value",i.nonce),e.onSuccess&&e.onSuccess())}):(alert("No payment nonce present."),e.onFailure?e.onFailure():checkout.setLoadWaiting(!1))},processCard:function(e){var t={number:$$('[data-genebraintree-name="number"]').first().value,cardholderName:this.getBillingName(),expirationMonth:$$('[data-genebraintree-name="expiration_month"]').first().value,expirationYear:$$('[data-genebraintree-name="expiration_year"]').first().value};void 0!=$$('[data-genebraintree-name="cvv"]').first()&&(t.cvv=$$('[data-genebraintree-name="cvv"]').first().value),""!=this.getBillingPostcode()&&(t.billingAddress={postalCode:this.getBillingPostcode()}),this.client.tokenizeCard(t,function(t,i){if(t){for(var n=0;n<t.length;n++)alert(t[n].code+" "+t[n].message);e.onFailure?e.onFailure():checkout.setLoadWaiting(!1)}else $("creditcard-payment-nonce").value=i,$("creditcard-payment-nonce").setAttribute("value",i),e.onSuccess&&e.onSuccess()})},shouldInterceptCreditCard:function(){return!0},shouldInterceptPayPal:function(){return!0},getCardType:function(e){if(e){if(null!=e.match(/^4/))return"VI";if(null!=e.match(/^(34|37)/))return"AE";if(null!=e.match(/^5[1-5]/))return"MC";if(null!=e.match(/^6011/))return"DI";if(null!=e.match(/^(?:2131|1800|35)/))return"JCB";if(null!=e.match(/^(5018|5020|5038|6304|67[0-9]{2})/))return"ME"}return"card"},process:function(e){e=e||{},this._hostedFieldsTokenGenerated?e.onSuccess&&e.onSuccess():this.usingSavedCard()&&$$("#creditcard-saved-accounts input:checked[type=radio]").first().hasAttribute("data-threedsecure-nonce")?this.verify3dSecureVault(e):this.usingSavedCard()?e.onSuccess&&e.onSuccess():1==this.threeDSecure?this.verify3dSecure(e):this.processCard(e)},creditCardLoaded:function(){return!1},paypalLoaded:function(){return!1}};var vZeroPayPalButton=Class.create();vZeroPayPalButton.prototype={initialize:function(e,t,i,n,a){this.clientToken=e,this.storeFrontName=t,this.singleUse=i,this.locale=n,this.futureSingleUse=a,this._paypalOptions={},this._paypalIntegration=!1,this._paypalButton=!1,this._rebuildTimer=!1,this._rebuildCount=0},setPricing:function(e,t){this.amount=parseFloat(e),this.currency=t,null==$("paypal-payment-nonce")||$("paypal-payment-nonce").value||this.rebuildButton()},rebuildButton:function(){if(clearTimeout(this._rebuildTimer),this._paypalIntegration!==!1)try{this._paypalIntegration.teardown(function(){this._paypalIntegration=!1,this.addPayPalButton(this._paypalOptions)}.bind(this))}catch(e){if("Cannot teardown integration more than once"==e.message)this._paypalIntegration=!1,this.addPayPalButton(this._paypalOptions);else{if(this._rebuildCount>=10)return!1;this._rebuildTimer=setTimeout(function(){++this._rebuildCount,this.rebuildButton()}.bind(this),200)}}},addPayPalButton:function(e,t){if(null===$("paypal-container")||null===$("braintree-paypal-button"))return!1;var i=$("braintree-paypal-button").innerHTML;if($("paypal-container").update(""),$("paypal-container").insert(i),!$("paypal-container").select(">button").length)return!1;this._paypalButton=$("paypal-container").select(">button").first(),this._paypalButton.addClassName("braintree-paypal-loading"),this._paypalButton.setAttribute("disabled","disabled"),this._paypalOptions=e,this._paypalIntegration=!1;var n={paymentMethodNonceInputField:"paypal-payment-nonce",displayName:this.storeFrontName,onPaymentMethodReceived:function(t){"function"==typeof e.onSuccess?e.onSuccess(t):(payment.switchMethod("gene_braintree_paypal"),$("paypal-payment-nonce").removeAttribute("disabled"),$("paypal-complete").remove(),window.review&&review.save())},onUnsupported:function(){alert("You need to link your PayPal account with your Braintree account in your Braintree control panel to utilise the PayPal functionality of this extension.")},onReady:function(i){this._paypalIntegration=i,this._attachPayPalButtonEvent(t),"function"==typeof e.onReady&&e.onReady(i)}.bind(this),paypal:{headless:!0}};this.locale&&(n.locale=this.locale),1==this.singleUse?(n.singleUse=!0,n.amount=this.amount,n.currency=this.currency):1==this.futureSingleUse?n.singleUse=!0:n.singleUse=!1,braintree.setup(this.clientToken,"paypal",n)},_attachPayPalButtonEvent:function(e){this._paypalIntegration&&this._paypalButton&&(this._paypalButton.removeClassName("braintree-paypal-loading"),this._paypalButton.removeAttribute("disabled"),Event.stopObserving(this._paypalButton,"click"),Event.observe(this._paypalButton,"click",function(t){Event.stop(t),"object"==typeof e&&"function"==typeof e.validateAll?e.validateAll()&&this._paypalIntegration.paypal.initAuthFlow():this._paypalIntegration.paypal.initAuthFlow()}.bind(this)))},closePayPalWindow:function(e){}};var vZeroIntegration=Class.create();vZeroIntegration.prototype={initialize:function(e,t,i,n,a,o,s){return vZeroIntegration.prototype.loaded?(console.error("Your checkout is including the Braintree resources multiple times, please resolve this."),!1):(vZeroIntegration.prototype.loaded=!0,this.vzero=e||!1,this.vzeroPaypal=t||!1,this.vzero===!1&&this.vzeroPaypal===!1?(console.warn("The vzero and vzeroPaypal objects are not initiated."),!1):(this.paypalMarkUp=i||!1,this.paypalButtonClass=n||!1,this.isOnepage=a||!1,this.config=o||{},this._methodSwitchTimeout=!1,this._hostedFieldsInit=!1,document.observe("dom:loaded",function(){this.prepareSubmitObserver(),this.preparePaymentMethodSwitchObserver()}.bind(this)),this.hostedFieldsGenerated=!1,this.vzero.close3dSecureMethod(function(){this.vzero._hostedFieldsValidationRunning=!1,this.vzero.tokenize3dSavedCards(function(){this.threeDTokenizationComplete()}.bind(this))}.bind(this)),this.isOnepage&&(this.vzero.observeCardType(),this.observeAjaxRequests(),document.observe("dom:loaded",function(){this.initSavedPayPal(),this.initDefaultMethod(),null!==$("braintree-hosted-submit")&&this.initHostedFields()}.bind(this))),void document.observe("dom:loaded",function(){this.initSavedMethods(),null!==$("braintree-hosted-submit")&&this.initHostedFields()}.bind(this))))},initSavedMethods:function(){$$('#creditcard-saved-accounts input[type="radio"], #paypal-saved-accounts input[type="radio"]').each(function(e){var t="",i="";void 0!==e.up("#creditcard-saved-accounts")?(t="#creditcard-saved-accounts",i="#credit-card-form"):void 0!==e.up("#paypal-saved-accounts")&&(t="#paypal-saved-accounts",i=".paypal-info"),$(e).stopObserving("change").observe("change",function(e){return this.showHideOtherMethod(t,i)}.bind(this))}.bind(this))},showHideOtherMethod:function(e,t){void 0!==$$(e+" input:checked[type=radio]").first()&&"other"==$$(e+" input:checked[type=radio]").first().value?void 0!==$$(t).first()&&($$(t).first().show(),$$(t+" input, "+t+" select").each(function(e){e.removeAttribute("disabled")})):void 0!==$$(e+" input:checked[type=radio]").first()&&void 0!==$$(t).first()&&($$(t).first().hide(),$$(t+" input, "+t+" select").each(function(e){e.setAttribute("disabled","disabled")}))},checkSavedOther:function(){var e="",t="";"gene_braintree_creditcard"==this.getPaymentMethod()?(e="#creditcard-saved-accounts",t="#credit-card-form"):"gene_braintree_paypal"==this.getPaymentMethod()&&(e="#paypal-saved-accounts",t=".paypal-info"),void 0!==$$(e).first()&&this.showHideOtherMethod(e,t)},initHostedFields:function(){this.vzero.hostedFields&&null!==$("braintree-hosted-submit")&&(void 0!==$("braintree-hosted-submit").up("form")?(this._hostedFieldsInit=!0,this.form=$("braintree-hosted-submit").up("form"),this.vzero.initHostedFields(this)):console.error("Hosted Fields cannot be initialized as we're unable to locate the parent form."))},afterHostedFieldsNonceReceived:function(e){return this.resetLoading(),this.vzero._hostedFieldsTokenGenerated=!0,this.hostedFieldsGenerated=!0,this.isOnepage?this.submitCheckout():this.submitPayment()},afterHostedFieldsError:function(e){return this.vzero._hostedFieldsTokenGenerated=!1,this.hostedFieldsGenerated=!1,!1},initDefaultMethod:function(){this.shouldAddPayPalButton(!1)&&(this.setLoading(),this.vzero.updateData(function(){this.resetLoading(),this.updatePayPalButton("add")}.bind(this)))},observeAjaxRequests:function(){this.vzero.observeAjaxRequests(function(){this.vzero.updateData(function(){this.isOnepage&&(this.initSavedPayPal(),this.rebuildPayPalButton(),this.checkSavedOther(),this.vzero.hostedFields&&this.initHostedFields()),this.initSavedMethods()}.bind(this))}.bind(this),"undefined"!=typeof this.config.ignoreAjax?this.config.ignoreAjax:!1)},rebuildPayPalButton:function(){null==$("paypal-container")&&this.updatePayPalButton()},initSavedPayPal:function(){void 0!==$$("#paypal-saved-accounts input[type=radio]").first()&&$("paypal-saved-accounts").on("change","input[type=radio]",function(e){this.updatePayPalButton(!1,"gene_braintree_paypal")}.bind(this))},prepareSubmitObserver:function(){return!1},beforeSubmit:function(e){return this._beforeSubmit(e)},_beforeSubmit:function(e){if(this.hostedFieldsGenerated===!1&&this.vzero.hostedFields&&(void 0===$$("#creditcard-saved-accounts input:checked[type=radio]").first()||void 0!==$$("#creditcard-saved-accounts input:checked[type=radio]").first()&&"other"==$$("#creditcard-saved-accounts input:checked[type=radio]").first().value)){var t=$("braintree-hosted-submit").down("button");t.removeAttribute("disabled"),t.click()}else e()},afterSubmit:function(){return!1},submit:function(e,t,i,n){this.shouldInterceptSubmit(e)&&(this.validateAll()?(this.setLoading(),this.beforeSubmit(function(){void 0!=$$('[data-genebraintree-name="number"]').first()&&this.vzero.updateCardType($$('[data-genebraintree-name="number"]').first().value),this.vzero.updateData(function(){this.updateBilling(),this.vzero.process({onSuccess:function(){if(this.enableDeviceData(),this.disableCreditCardForm(),this.resetLoading(),this.afterSubmit(),this.enableDisableNonce(),this.vzero._hostedFieldsTokenGenerated=!1,this.hostedFieldsGenerated=!1,"function"==typeof t)var e=t();return this.setLoading(),this.enableCreditCardForm(),e}.bind(this),onFailure:function(){return this.vzero._hostedFieldsTokenGenerated=!1,this.hostedFieldsGenerated=!1,this.resetLoading(),this.afterSubmit(),"function"==typeof i?i():void 0}.bind(this)})}.bind(this),this.getUpdateDataParams())}.bind(this))):(this.vzero._hostedFieldsTokenGenerated=!1,this.hostedFieldsGenerated=!1,this.resetLoading(),"function"==typeof n&&n()))},submitCheckout:function(){window.review&&review.save()},submitPayment:function(){payment.save&&payment.save()},enableDisableNonce:function(){"gene_braintree_creditcard"==this.getPaymentMethod()?(null!==$("creditcard-payment-nonce")&&$("creditcard-payment-nonce").removeAttribute("disabled"),null!==$("paypal-payment-nonce")&&$("paypal-payment-nonce").setAttribute("disabled","disabled")):"gene_braintree_paypal"==this.getPaymentMethod()&&(null!==$("creditcard-payment-nonce")&&$("creditcard-payment-nonce").setAttribute("disabled","disabled"),null!==$("paypal-payment-nonce")&&$("paypal-payment-nonce").removeAttribute("disabled"))},preparePaymentMethodSwitchObserver:function(){return this.defaultPaymentMethodSwitch()},defaultPaymentMethodSwitch:function(){var e=this,t=Payment.prototype.switchMethod;Payment.prototype.switchMethod=function(i){return e.paymentMethodSwitch(i),t.apply(this,arguments)}},paymentMethodSwitch:function(e){clearTimeout(this._methodSwitchTimeout),this._methodSwitchTimeout=setTimeout(function(){this.shouldAddPayPalButton(e)?this.updatePayPalButton("add",e):this.updatePayPalButton("remove",e),"gene_braintree_creditcard"==(e?e:this.getPaymentMethod())&&this.initHostedFields(),this.checkSavedOther()}.bind(this),50)},completePayPal:function(e){return this.enableDisableNonce(),this.enableDeviceData(),e.nonce&&null!==$("paypal-payment-nonce")?($("paypal-payment-nonce").value=e.nonce,$("paypal-payment-nonce").setAttribute("value",e.nonce)):console.warn("Unable to update PayPal nonce, please verify that the nonce input field has the ID: paypal-payment-nonce"),this.afterPayPalComplete(),!1},afterPayPalComplete:function(){return this.resetLoading(),this.submitCheckout()},updatePayPalButton:function(e,t){if(this.paypalMarkUp===!1)return!1;if("refresh"==e)return this.updatePayPalButton("remove"),this.updatePayPalButton("add"),!0;if(this.shouldAddPayPalButton(t)&&"remove"!=e||"add"==e)if(void 0!==$$(this.paypalButtonClass).first()){if(void 0!==$$("#paypal-complete").first()&&$$("#paypal-complete").first().visible())return!0;$$(this.paypalButtonClass).first().hide(),$$(this.paypalButtonClass).first().insert({after:this.paypalMarkUp});var i={onSuccess:this.completePayPal.bind(this),onReady:this.paypalOnReady.bind(this)};this.vzeroPaypal.addPayPalButton(i,this)}else console.warn("We're unable to find the element "+this.paypalButtonClass+". Please check your integration.");else void 0!==$$(this.paypalButtonClass).first()&&$$(this.paypalButtonClass).first().show(),void 0!==$$("#paypal-complete").first()&&$("paypal-complete").remove()},paypalOnReady:function(e){return!0},setLoading:function(){checkout.setLoadWaiting("payment")},resetLoading:function(){checkout.setLoadWaiting(!1)},enableDeviceData:function(){null!==$("device_data")&&$("device_data").removeAttribute("disabled")},disableCreditCardForm:function(){$$("#credit-card-form input, #credit-card-form select").each(function(e){"creditcard-payment-nonce"!=e.id&&"gene_braintree_creditcard_store_in_vault"!=e.id&&e.setAttribute("disabled","disabled")})},enableCreditCardForm:function(){$$("#credit-card-form input, #credit-card-form select").each(function(e){e.removeAttribute("disabled")})},updateBilling:function(){(null!==$("billing-address-select")&&""==$("billing-address-select").value||null===$("billing-address-select"))&&(null!==$("billing:firstname")&&null!==$("billing:lastname")&&this.vzero.setBillingName($("billing:firstname").value+" "+$("billing:lastname").value),null!==$("billing:postcode")&&this.vzero.setBillingPostcode($("billing:postcode").value))},getUpdateDataParams:function(){var e={};return null!==$("billing-address-select")&&""!=$("billing-address-select").value&&(e.addressId=$("billing-address-select").value),e},getPaymentMethod:function(){return payment.currentMethod},shouldInterceptSubmit:function(e){switch(e){case"creditcard":return"gene_braintree_creditcard"==this.getPaymentMethod()&&this.vzero.shouldInterceptCreditCard();break;case"paypal":return"gene_braintree_paypal"==this.getPaymentMethod()&&this.vzero.shouldInterceptCreditCard()}return!1},shouldAddPayPalButton:function(e){return"gene_braintree_paypal"==(e?e:this.getPaymentMethod())&&null===$("paypal-saved-accounts")||"gene_braintree_paypal"==(e?e:this.getPaymentMethod())&&void 0!==$$("#paypal-saved-accounts input:checked[type=radio]").first()&&"other"==$$("#paypal-saved-accounts input:checked[type=radio]").first().value},threeDTokenizationComplete:function(){this.resetLoading()},validateAll:function(){return!0}},function(){for(var e,t=function(){},i=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","markTimeline","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],n=i.length,a=window.console=window.console||{};n--;)e=i[n],a[e]||(a[e]=t)}();
 
js/gene/braintree/vzero-0.7-min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["vzero-0.7.js"],"names":["vZero","Class","create","prototype","initialize","code","clientToken","threeDSecure","hostedFields","billingName","billingPostcode","quoteUrl","tokenizeUrl","vaultToNonceUrl","this","_hostedFieldsTokenGenerated","acceptedCards","closeMethod","_hostedFieldsTimeout","_updateDataXhr","_updateDataCallbacks","_updateDataParams","_vaultToNonceXhr","init","client","braintree","api","Client","initHostedFields","integration","$$","length","$","clearTimeout","setTimeout","_hostedIntegration","teardown","setupHostedFieldsClient","bind","e","hostedFieldsConfiguration","id","form","styles","input","font-size","color",":focus",".valid",".invalid","number","selector","placeholder","expirationMonth","expirationYear","onFieldEvent","hostedFieldsOnFieldEvent","onReady","onPaymentMethodReceived","hostedFieldsPaymentMethodReceived","onError","hostedFieldsError","cvv","setup","event","type","card","cardMapping","visa","american-express","master-card","discover","jcb","maestro","undefined","updateCardType","vaultToNonce","nonce","callback","parameters","getBillingAddress","Ajax","Request","method","onSuccess","transport","responseText","response","eval","success","resetLoading","error","alert","onFailure","setLoading","updateData","verify3dSecureNonce","hostedFieldsNonceReceived","value","setAttribute","afterHostedFieldsNonceReceived","message","indexOf","afterHostedFieldsError","usingSavedCard","first","setThreeDSecure","flag","setAmount","amount","parseFloat","setBillingName","getBillingName","combineElementsValues","setBillingPostcode","getBillingPostcode","setAcceptedCards","cards","billingAddress","tagName","serialize","extractBilling","up","formData","billing","$H","each","data","key","getAcceptedCards","elements","seperator","element","index","join","cardNumber","cardType","getCardType","skinImageUrl","src","substring","lastIndexOf","observeCardType","Element","observe","vzero","oninput","split","match","RegExp","observeAjaxRequests","ignore","Responders","register","onComplete","handleAjaxRequest","url","window","jQuery","document","ajaxComplete","xhr","settings","Array","shouldIgnore","params","push","abort","grandTotal","vzeroPaypal","currencyCode","setPricing","close3dSecureMethod","tokenize3dSavedCards","tokens","getAttribute","Object","toJSON","onUserClose3ds","checkout","setLoadWaiting","options","threeDSecureRequest","creditCard","onUserClose","verify3DS","verify3dSecure","cardholderName","postalCode","verify3dSecureVault","paymentNonce","removeAttribute","processCard","tokenizeRequest","tokenizeCard","errors","i","shouldInterceptCreditCard","shouldInterceptPayPal","process","hasAttribute","creditCardLoaded","paypalLoaded","vZeroPayPalButton","storeFrontName","singleUse","locale","futureSingleUse","_paypalOptions","_paypalIntegration","_rebuildTimer","_rebuildCount","currency","rebuildButton","addPayPalButton","setupConfiguration","container","paymentMethodNonceInputField","displayName","obj","payment","switchMethod","remove","review","save","onUnsupported","closePayPalWindow","vZeroIntegration","paypalMarkUp","paypalButtonClass","isOnepage","config","loaded","console","warn","_methodSwitchTimeout","_hostedFieldsInit","prepareSubmitObserver","preparePaymentMethodSwitchObserver","hostedFieldsGenerated","_hostedFieldsValidationRunning","threeDTokenizationComplete","initSavedPayPal","initDefaultMethod","initSavedMethods","parentElement","targetElement","stopObserving","showHideOtherMethod","show","formElement","hide","checkSavedOther","getPaymentMethod","submitCheckout","submitPayment","shouldAddPayPalButton","updatePayPalButton","rebuildPayPalButton","ignoreAjax","on","beforeSubmit","_beforeSubmit","button","down","click","afterSubmit","submit","successCallback","failedCallback","validateFailedCallback","shouldInterceptSubmit","validateAll","updateBilling","enableDeviceData","disableCreditCardForm","enableDisableNonce","enableCreditCardForm","getUpdateDataParams","defaultPaymentMethodSwitch","vzeroIntegration","paymentSwitchOriginal","Payment","paymentMethodSwitch","apply","arguments","completePayPal","afterPayPalComplete","action","visible","insert","after","buttonParams","paypalOnReady","Event","stop","addressId","currentMethod","noop","methods"],"mappings":"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","file":"vzero-0.7-min.js"}
1
+ {"version":3,"sources":["vzero-0.7.js"],"names":["vZero","Class","create","prototype","initialize","code","clientToken","threeDSecure","hostedFields","billingName","billingPostcode","quoteUrl","tokenizeUrl","vaultToNonceUrl","this","_hostedFieldsTokenGenerated","acceptedCards","closeMethod","_hostedFieldsTimeout","_updateDataXhr","_updateDataCallbacks","_updateDataParams","_vaultToNonceXhr","init","client","braintree","api","Client","initHostedFields","integration","$$","length","$","clearTimeout","setTimeout","_hostedIntegration","teardown","setupHostedFieldsClient","bind","e","hostedFieldsConfiguration","id","form","styles","input","font-size","color",":focus",".valid",".invalid","number","selector","placeholder","expirationMonth","expirationYear","onFieldEvent","hostedFieldsOnFieldEvent","onReady","onPaymentMethodReceived","hostedFieldsPaymentMethodReceived","onError","hostedFieldsError","cvv","setup","event","type","card","cardMapping","visa","american-express","master-card","discovery","jcb","maestro","undefined","updateCardType","vaultToNonce","nonce","callback","parameters","getBillingAddress","Ajax","Request","method","onSuccess","transport","responseText","response","eval","success","resetLoading","error","alert","onFailure","setLoading","updateData","verify3dSecureNonce","hostedFieldsNonceReceived","value","setAttribute","afterHostedFieldsNonceReceived","message","indexOf","afterHostedFieldsError","usingSavedCard","first","setThreeDSecure","flag","setAmount","amount","parseFloat","setBillingName","getBillingName","combineElementsValues","setBillingPostcode","getBillingPostcode","setAcceptedCards","cards","billingAddress","tagName","serialize","extractBilling","up","formData","billing","$H","each","data","key","getAcceptedCards","elements","seperator","element","index","join","cardNumber","cardType","getCardType","skinImageUrl","src","substring","lastIndexOf","observeCardType","Element","observe","vzero","oninput","split","match","RegExp","observeAjaxRequests","ignore","Responders","register","onComplete","handleAjaxRequest","url","window","jQuery","document","ajaxComplete","xhr","settings","Array","shouldIgnore","params","push","abort","grandTotal","vzeroPaypal","currencyCode","setPricing","close3dSecureMethod","tokenize3dSavedCards","tokens","getAttribute","Object","toJSON","onUserClose3ds","checkout","setLoadWaiting","options","threeDSecureRequest","creditCard","onUserClose","verify3DS","verify3dSecure","cardholderName","postalCode","verify3dSecureVault","paymentNonce","removeAttribute","processCard","tokenizeRequest","tokenizeCard","errors","i","shouldInterceptCreditCard","shouldInterceptPayPal","process","hasAttribute","creditCardLoaded","paypalLoaded","vZeroPayPalButton","storeFrontName","singleUse","locale","futureSingleUse","_paypalOptions","_paypalIntegration","_rebuildTimer","_rebuildCount","currency","rebuildButton","addPayPalButton","setupConfiguration","container","paymentMethodNonceInputField","displayName","obj","payment","switchMethod","remove","review","save","onUnsupported","closePayPalWindow","vZeroIntegration","paypalMarkUp","paypalButtonClass","isOnepage","config","loaded","console","warn","_methodSwitchTimeout","_hostedFieldsInit","prepareSubmitObserver","preparePaymentMethodSwitchObserver","hostedFieldsGenerated","_hostedFieldsValidationRunning","threeDTokenizationComplete","initSavedPayPal","initDefaultMethod","initSavedMethods","parentElement","targetElement","stopObserving","showHideOtherMethod","show","formElement","hide","checkSavedOther","getPaymentMethod","submitCheckout","submitPayment","shouldAddPayPalButton","updatePayPalButton","rebuildPayPalButton","ignoreAjax","on","beforeSubmit","_beforeSubmit","button","down","click","afterSubmit","submit","successCallback","failedCallback","validateFailedCallback","shouldInterceptSubmit","validateAll","updateBilling","enableDeviceData","disableCreditCardForm","enableDisableNonce","enableCreditCardForm","getUpdateDataParams","defaultPaymentMethodSwitch","vzeroIntegration","paymentSwitchOriginal","Payment","paymentMethodSwitch","apply","arguments","completePayPal","afterPayPalComplete","action","visible","insert","after","buttonParams","paypalOnReady","Event","stop","addressId","currentMethod","noop","methods"],"mappings":"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","file":"vzero-0.7-min.js"}
js/gene/braintree/vzero-0.7.js CHANGED
@@ -1,4 +1,3 @@
1
-
2
  /**
3
  * Magento Braintree class to bridge the v.zero JS SDK and Magento
4
  *
@@ -39,7 +38,7 @@ vZero.prototype = {
39
  if (tokenizeUrl) {
40
  this.tokenizeUrl = tokenizeUrl;
41
  }
42
- if(vaultToNonceUrl) {
43
  this.vaultToNonceUrl = vaultToNonceUrl;
44
  }
45
 
@@ -64,7 +63,7 @@ vZero.prototype = {
64
  * Init the vZero integration by starting a new version of the client
65
  * If 3D secure is enabled we also listen out for window messages
66
  */
67
- init: function() {
68
  this.client = new braintree.api.Client({clientToken: this.clientToken});
69
  },
70
 
@@ -73,7 +72,7 @@ vZero.prototype = {
73
  *
74
  * @param integration
75
  */
76
- initHostedFields: function(integration) {
77
 
78
  // If the hosted field number element exists hosted fields is on the page and working!
79
  if ($$('iframe[name^="braintree-"]').length > 0) {
@@ -93,7 +92,7 @@ vZero.prototype = {
93
 
94
  // Utilise a 50ms timeout to ensure the last call of HF is ran
95
  clearTimeout(this._hostedFieldsTimeout);
96
- this._hostedFieldsTimeout = setTimeout(function() {
97
 
98
  if (this._hostedIntegration !== false) {
99
  try {
@@ -113,10 +112,31 @@ vZero.prototype = {
113
  }.bind(this), 50);
114
  },
115
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  /**
117
  * Setup the hosted fields client utilising the Braintree JS SDK
118
  */
119
- setupHostedFieldsClient: function() {
120
 
121
  // If there are iframes within the fields already, don't run again!
122
  // This function has a delay from the original call so we need to verify everything is still good to go!
@@ -129,24 +149,7 @@ vZero.prototype = {
129
  var hostedFieldsConfiguration = {
130
  id: this.integration.form,
131
  hostedFields: {
132
- styles: {
133
- // Style all elements
134
- "input": {
135
- "font-size": "14pt",
136
- "color": "#3A3A3A"
137
- },
138
-
139
- // Styling element state
140
- ":focus": {
141
- "color": "black"
142
- },
143
- ".valid": {
144
- "color": "green"
145
- },
146
- ".invalid": {
147
- "color": "red"
148
- }
149
- },
150
  number: {
151
  selector: "#card-number",
152
  placeholder: "0000 0000 0000 0000"
@@ -161,15 +164,20 @@ vZero.prototype = {
161
  },
162
  onFieldEvent: this.hostedFieldsOnFieldEvent.bind(this)
163
  },
164
- onReady: function(integration) {
165
  this._hostedIntegration = integration;
 
 
 
 
 
166
  }.bind(this),
167
  onPaymentMethodReceived: this.hostedFieldsPaymentMethodReceived.bind(this),
168
  onError: this.hostedFieldsError.bind(this)
169
  };
170
 
171
  // Include the CVV field with the request
172
- if($('cvv') !== null) {
173
  hostedFieldsConfiguration.hostedFields.cvv = {
174
  selector: "#cvv"
175
  };
@@ -178,12 +186,46 @@ vZero.prototype = {
178
  braintree.setup(this.clientToken, "custom", hostedFieldsConfiguration);
179
  },
180
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
  /**
182
  * Update the card type on field event
183
  *
184
  * @param event
185
  */
186
- hostedFieldsOnFieldEvent: function(event) {
187
  if (event.type === "fieldStateChange") {
188
  if (event.card) {
189
  var cardMapping = {
@@ -209,7 +251,7 @@ vZero.prototype = {
209
  * @param nonce
210
  * @param callback
211
  */
212
- vaultToNonce: function(nonce, callback) {
213
 
214
  // Craft the parameters
215
  var parameters = this.getBillingAddress();
@@ -226,6 +268,7 @@ vZero.prototype = {
226
  if (transport && transport.responseText) {
227
 
228
  // Parse as an object
 
229
  try {
230
  response = eval('(' + transport.responseText + ')');
231
  }
@@ -233,7 +276,7 @@ vZero.prototype = {
233
  response = {};
234
  }
235
 
236
- if(response.success && response.nonce) {
237
  callback(response.nonce);
238
  } else {
239
 
@@ -242,7 +285,7 @@ vZero.prototype = {
242
  this.integration.resetLoading();
243
  }
244
 
245
- if(response.error) {
246
  alert(response.error);
247
  } else {
248
  alert('Something wen\'t wrong and we\'re currently unable to take your payment.');
@@ -250,7 +293,7 @@ vZero.prototype = {
250
  }
251
  }
252
  }.bind(this),
253
- onFailure: function() {
254
 
255
  // Hide the loading state
256
  if (typeof this.integration.resetLoading === 'function') {
@@ -269,7 +312,7 @@ vZero.prototype = {
269
  *
270
  * @param response
271
  */
272
- hostedFieldsPaymentMethodReceived: function(response) {
273
 
274
  // Check if validation failed or not?
275
  if (this.threeDSecure) {
@@ -281,7 +324,7 @@ vZero.prototype = {
281
 
282
  // Update the quote totals first
283
  this.updateData(function () {
284
- this.vaultToNonce(response.nonce, function(nonce) {
285
 
286
  // Hide the loading state
287
  if (typeof this.integration.resetLoading === 'function') {
@@ -312,7 +355,7 @@ vZero.prototype = {
312
  *
313
  * @param nonce
314
  */
315
- hostedFieldsNonceReceived: function(nonce) {
316
 
317
  $('creditcard-payment-nonce').value = nonce;
318
  $('creditcard-payment-nonce').setAttribute('value', nonce);
@@ -335,7 +378,7 @@ vZero.prototype = {
335
  * @param response
336
  * @returns {boolean}
337
  */
338
- hostedFieldsError: function(response) {
339
 
340
  if (typeof this.integration.resetLoading === 'function') {
341
  this.integration.resetLoading();
@@ -343,7 +386,7 @@ vZero.prototype = {
343
 
344
  // Stop any "Cannot place two elements in #xxx" messages being shown to the user
345
  // These are non critical errors and the functionality will still work as expected
346
- if(typeof response.message !== 'undefined' && response.message.indexOf('Cannot place two elements in') == -1) {
347
  // Let the user know what went wrong
348
  alert(response.message);
349
  }
@@ -363,7 +406,7 @@ vZero.prototype = {
363
  *
364
  * @returns {boolean}
365
  */
366
- usingSavedCard: function() {
367
  return ($('creditcard-saved-accounts') != undefined
368
  && $$('#creditcard-saved-accounts input:checked[type=radio]').first() != undefined
369
  && $$('#creditcard-saved-accounts input:checked[type=radio]').first().value !== 'other');
@@ -375,7 +418,7 @@ vZero.prototype = {
375
  *
376
  * @param flag a boolean value
377
  */
378
- setThreeDSecure: function(flag) {
379
  this.threeDSecure = flag;
380
  },
381
 
@@ -385,7 +428,7 @@ vZero.prototype = {
385
  *
386
  * @param amount The grand total of the order
387
  */
388
- setAmount: function(amount) {
389
  this.amount = parseFloat(amount);
390
  },
391
 
@@ -394,7 +437,7 @@ vZero.prototype = {
394
  *
395
  * @param billingName
396
  */
397
- setBillingName: function(billingName) {
398
  this.billingName = billingName;
399
  },
400
 
@@ -403,7 +446,7 @@ vZero.prototype = {
403
  *
404
  * @returns {*}
405
  */
406
- getBillingName: function() {
407
 
408
  // If billingName is an object we're wanting to grab the data from elements
409
  if (typeof this.billingName == 'object') {
@@ -423,7 +466,7 @@ vZero.prototype = {
423
  *
424
  * @param billingPostcode
425
  */
426
- setBillingPostcode: function(billingPostcode) {
427
  this.billingPostcode = billingPostcode;
428
  },
429
 
@@ -432,7 +475,7 @@ vZero.prototype = {
432
  *
433
  * @returns {*}
434
  */
435
- getBillingPostcode: function() {
436
 
437
  // If billingName is an object we're wanting to grab the data from elements
438
  if (typeof this.billingPostcode == 'object') {
@@ -452,7 +495,7 @@ vZero.prototype = {
452
  *
453
  * @param cards an array of accepted cards
454
  */
455
- setAcceptedCards: function(cards) {
456
  this.acceptedCards = cards;
457
  },
458
 
@@ -461,7 +504,7 @@ vZero.prototype = {
461
  *
462
  * @returns {array}
463
  */
464
- getBillingAddress: function() {
465
 
466
  // Is there a function in the integration for this action?
467
  if (typeof this.integration.getBillingAddress === 'function') {
@@ -471,17 +514,17 @@ vZero.prototype = {
471
  var billingAddress = {};
472
 
473
  // If not try something generic
474
- if($('co-billing-form') !== null) {
475
- if($('co-billing-form').tagName == 'FORM') {
476
  billingAddress = $('co-billing-form').serialize(true);
477
  } else {
478
  billingAddress = this.extractBilling($('co-billing-form').up('form').serialize(true));
479
  }
480
- } else if($('billing:firstname') !== null) {
481
- billingAddress = this.extractBilling($('billing:firstname').up('form').serialize(true));
482
  }
483
 
484
- if(billingAddress) {
485
  return billingAddress;
486
  }
487
  },
@@ -492,11 +535,11 @@ vZero.prototype = {
492
  * @param formData
493
  * @returns {{}}
494
  */
495
- extractBilling: function(formData) {
496
  var billing = {};
497
- $H(formData).each(function(data) {
498
- // Only include billing details, exclusing passwords
499
- if(data.key.indexOf('billing') == 0 && data.key.indexOf('password') == -1) {
500
  billing[data.key] = data.value;
501
  }
502
  });
@@ -508,7 +551,7 @@ vZero.prototype = {
508
  *
509
  * @returns {boolean|*}
510
  */
511
- getAcceptedCards: function() {
512
  return this.acceptedCards;
513
  },
514
 
@@ -520,7 +563,7 @@ vZero.prototype = {
520
  * @param seperator
521
  * @returns {string}
522
  */
523
- combineElementsValues: function(elements, seperator) {
524
 
525
  // If no seperator is set use a space
526
  if (!seperator) {
@@ -529,7 +572,7 @@ vZero.prototype = {
529
 
530
  // Loop through the elements and build up an array
531
  var response = [];
532
- elements.each(function(element, index) {
533
  if ($(element) !== undefined) {
534
  response[index] = $(element).value;
535
  }
@@ -546,7 +589,7 @@ vZero.prototype = {
546
  * @param cardNumber The card number that the user has entered
547
  * @param cardType The card type, if already known
548
  */
549
- updateCardType: function(cardNumber, cardType) {
550
 
551
  if (!cardType) {
552
  // Retrieve the card type
@@ -579,7 +622,7 @@ vZero.prototype = {
579
  /**
580
  * Create a new event upon the card number field
581
  */
582
- observeCardType: function() {
583
 
584
  if ($$('[data-genebraintree-name="number"]').first() !== undefined) {
585
 
@@ -591,7 +634,7 @@ vZero.prototype = {
591
  });
592
 
593
  // Add a space every 4 characters
594
- $$('[data-genebraintree-name="number"]').first().oninput = function() {
595
  // Add a space every 4 characters
596
  var number = this.value.split(" ").join("");
597
  if (number.length > 0) {
@@ -611,18 +654,18 @@ vZero.prototype = {
611
  * @param callback A defined callback function if needed
612
  * @param ignore An array of indexOf paths to ignore
613
  */
614
- observeAjaxRequests: function(callback, ignore) {
615
 
616
  // For every ajax request on complete update various Braintree things
617
  Ajax.Responders.register({
618
- onComplete: function(transport) {
619
  return this.handleAjaxRequest(transport.url, callback, ignore);
620
  }.bind(this)
621
  });
622
 
623
  // Is jQuery present on the page
624
  if (window.jQuery) {
625
- jQuery(document).ajaxComplete(function(event, xhr, settings) {
626
  return this.handleAjaxRequest(settings.url, callback, ignore)
627
  }.bind(this));
628
  }
@@ -637,7 +680,7 @@ vZero.prototype = {
637
  * @param ignore
638
  * @returns {boolean}
639
  */
640
- handleAjaxRequest: function(url, callback, ignore) {
641
 
642
  // Let's check the ignore variable
643
  if (typeof ignore !== 'undefined' && ignore instanceof Array && ignore.length > 0) {
@@ -657,7 +700,7 @@ vZero.prototype = {
657
  }
658
 
659
  // Check the transport object has a URL and that it wasn't to our own controller
660
- if (url && url.indexOf('braintree') == -1) {
661
 
662
  // Some checkout implementations may require custom callbacks
663
  if (callback) {
@@ -675,14 +718,14 @@ vZero.prototype = {
675
  * @param callback A defined callback function if needed
676
  * @param params any extra data to be passed to the controller
677
  */
678
- updateData: function(callback, params) {
679
 
680
  // Push the callbacks into our array
681
  this._updateDataCallbacks.push(callback);
682
  this._updateDataParams = params;
683
 
684
  // If an updateData ajax request is running, cancel it
685
- if(this._updateDataXhr !== false) {
686
  this._updateDataXhr.transport.abort();
687
  }
688
 
@@ -690,18 +733,18 @@ vZero.prototype = {
690
  this._updateDataXhr = new Ajax.Request(
691
  this.quoteUrl,
692
  {
693
- method:'post',
694
  parameters: this._updateDataParams,
695
- onSuccess: function(transport) {
696
  // Verify we have some response text
697
- if (transport && transport.responseText) {
698
-
699
- // Parse as an object
700
- try {
701
- response = eval('(' + transport.responseText + ')');
702
- }
703
- catch (e) {
704
- response = {};
705
  }
706
 
707
  if (response.billingName != undefined) {
@@ -734,7 +777,7 @@ vZero.prototype = {
734
  this._updateDataXhr = false;
735
 
736
  // Run any callbacks that have been stored
737
- if(this._updateDataCallbacks.length) {
738
  this._updateDataCallbacks.each(function (callback) {
739
  callback(response);
740
  }.bind(this));
@@ -742,7 +785,7 @@ vZero.prototype = {
742
  }
743
  }
744
  }.bind(this),
745
- onFailure: function() {
746
 
747
  // Reset the params
748
  this._updateDataParams = {};
@@ -760,7 +803,7 @@ vZero.prototype = {
760
  *
761
  * @param callback A defined callback function if needed
762
  */
763
- close3dSecureMethod: function(callback) {
764
  this.closeMethod = callback;
765
  },
766
 
@@ -771,7 +814,7 @@ vZero.prototype = {
771
  *
772
  * @param callback A defined callback function if needed
773
  */
774
- tokenize3dSavedCards: function(callback) {
775
 
776
  // Check 3D is enabled
777
  if (this.threeDSecure) {
@@ -789,8 +832,8 @@ vZero.prototype = {
789
  new Ajax.Request(
790
  this.tokenizeUrl,
791
  {
792
- method:'post',
793
- onSuccess: function(transport) {
794
 
795
  // Verify we have some response text
796
  if (transport && transport.responseText) {
@@ -833,7 +876,7 @@ vZero.prototype = {
833
  }
834
  },
835
 
836
- onUserClose3ds: function() {
837
  this._hostedFieldsTokenGenerated = false;
838
  // Is there a close method defined?
839
  if (this.closeMethod) {
@@ -849,7 +892,7 @@ vZero.prototype = {
849
  * @param nonce
850
  * @param options
851
  */
852
- verify3dSecureNonce: function(nonce, options) {
853
 
854
  var threeDSecureRequest = {
855
  amount: this.amount,
@@ -879,7 +922,7 @@ vZero.prototype = {
879
  *
880
  * @param options Contains any callback functions which have been set
881
  */
882
- verify3dSecure: function(options) {
883
 
884
  var threeDSecureRequest = {
885
  amount: this.amount,
@@ -937,7 +980,7 @@ vZero.prototype = {
937
  *
938
  * @param options Contains any callback functions which have been set
939
  */
940
- verify3dSecureVault: function(options) {
941
 
942
  // Get the payment nonce
943
  var paymentNonce = $$('#creditcard-saved-accounts input:checked[type=radio]').first().getAttribute('data-threedsecure-nonce');
@@ -988,7 +1031,7 @@ vZero.prototype = {
988
  *
989
  * @param options Contains any callback functions which have been set
990
  */
991
- processCard: function(options) {
992
 
993
  var tokenizeRequest = {
994
  number: $$('[data-genebraintree-name="number"]').first().value,
@@ -1042,7 +1085,7 @@ vZero.prototype = {
1042
  *
1043
  * @returns {boolean}
1044
  */
1045
- shouldInterceptCreditCard: function() {
1046
  return true;
1047
  },
1048
 
@@ -1051,7 +1094,7 @@ vZero.prototype = {
1051
  *
1052
  * @returns {boolean}
1053
  */
1054
- shouldInterceptPayPal: function() {
1055
  return true;
1056
  },
1057
 
@@ -1061,9 +1104,9 @@ vZero.prototype = {
1061
  * @param number
1062
  * @returns {string}
1063
  */
1064
- getCardType: function(number) {
1065
 
1066
- if(number) {
1067
 
1068
  if (number.match(/^4/) != null)
1069
  return "VI";
@@ -1100,13 +1143,13 @@ vZero.prototype = {
1100
  *
1101
  * @param options Object containing onSuccess, onFailure functions
1102
  */
1103
- process: function(options) {
1104
 
1105
  // If options isn't set, use an empty object
1106
  options = options || {};
1107
 
1108
  // If the hosted fields token has been generated just glide through
1109
- if(this._hostedFieldsTokenGenerated) {
1110
 
1111
  // No action required as we're using a saved card
1112
  if (options.onSuccess) {
@@ -1137,11 +1180,11 @@ vZero.prototype = {
1137
  }
1138
  },
1139
 
1140
- creditCardLoaded: function() {
1141
  return false;
1142
  },
1143
 
1144
- paypalLoaded: function() {
1145
  return false;
1146
  }
1147
 
@@ -1174,6 +1217,7 @@ vZeroPayPalButton.prototype = {
1174
 
1175
  this._paypalOptions = {};
1176
  this._paypalIntegration = false;
 
1177
 
1178
  this._rebuildTimer = false;
1179
  this._rebuildCount = 0;
@@ -1187,21 +1231,24 @@ vZeroPayPalButton.prototype = {
1187
  * @param amount The amount formatted to two decimal places
1188
  * @param currency The currency code
1189
  */
1190
- setPricing: function(amount, currency) {
1191
 
1192
  // Set them into the class
1193
  this.amount = parseFloat(amount);
1194
  this.currency = currency;
1195
 
1196
- // As the amounts and currency has been updated let's update the button by rebuilding it
1197
- this.rebuildButton();
 
 
 
1198
 
1199
  },
1200
 
1201
  /**
1202
  * Rebuild the PayPal button
1203
  */
1204
- rebuildButton: function() {
1205
 
1206
  clearTimeout(this._rebuildTimer);
1207
  if (this._paypalIntegration !== false) {
@@ -1214,10 +1261,10 @@ vZeroPayPalButton.prototype = {
1214
  }.bind(this));
1215
  } catch (e) {
1216
  // This error means the integration has already been torn down
1217
- if(e.message == 'Cannot teardown integration more than once') {
1218
  this._paypalIntegration = false;
1219
  this.addPayPalButton(this._paypalOptions);
1220
- } else if(this._rebuildCount >= 10) {
1221
  // Infinite loops are bad kids
1222
  return false;
1223
  } else {
@@ -1235,13 +1282,27 @@ vZeroPayPalButton.prototype = {
1235
  * Inject the PayPal button into the document
1236
  *
1237
  * @param options Object containing onSuccess method
 
1238
  */
1239
- addPayPalButton: function(options) {
1240
 
1241
  // If the container isn't present on the page we can't add the button
1242
- if($('paypal-container') === null) {
 
 
 
 
 
 
 
 
 
 
1243
  return false;
1244
  }
 
 
 
1245
 
1246
  // Store the options as we may need to rebuild the button
1247
  this._paypalOptions = options;
@@ -1249,10 +1310,9 @@ vZeroPayPalButton.prototype = {
1249
 
1250
  // Build up our setup configuration
1251
  var setupConfiguration = {
1252
- container: "paypal-container",
1253
  paymentMethodNonceInputField: "paypal-payment-nonce",
1254
  displayName: this.storeFrontName,
1255
- onPaymentMethodReceived: function(obj) {
1256
 
1257
  // If we have a success callback we're most likely using a non-default checkout
1258
  if (typeof options.onSuccess === 'function') {
@@ -1272,19 +1332,23 @@ vZeroPayPalButton.prototype = {
1272
  }
1273
 
1274
  },
1275
- onUnsupported: function() {
1276
  alert('You need to link your PayPal account with your Braintree account in your Braintree control panel to utilise the PayPal functionality of this extension.');
1277
  },
1278
- onReady: function(integration) {
1279
  this._paypalIntegration = integration;
 
1280
  if (typeof options.onReady === 'function') {
1281
  options.onReady(integration);
1282
  }
1283
- }.bind(this)
 
 
 
1284
  };
1285
 
1286
  // Pass the locale over to the PayPal instance
1287
- if(this.locale) {
1288
  setupConfiguration.locale = this.locale;
1289
  }
1290
 
@@ -1309,13 +1373,42 @@ vZeroPayPalButton.prototype = {
1309
  braintree.setup(this.clientToken, "paypal", setupConfiguration);
1310
  },
1311
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1312
  /**
1313
  * Allow closing of the PayPal window
1314
  *
1315
  * @param callback A defined callback function if needed
1316
  * @deprecated since version 1.0.4.1
1317
  */
1318
- closePayPalWindow: function(callback) {
1319
  // Function deprecated in favour of using event propagation
1320
  }
1321
 
@@ -1341,7 +1434,7 @@ vZeroIntegration.prototype = {
1341
  * @param config Any further config the integration wants to push into the class
1342
  * @param onReady function fired after integration is "ready"
1343
  */
1344
- initialize: function(vzero, vzeroPaypal, paypalMarkUp, paypalButtonClass, isOnepage, config, onReady) {
1345
 
1346
  // Only allow the system to be initialized twice
1347
  if (vZeroIntegration.prototype.loaded) {
@@ -1354,7 +1447,7 @@ vZeroIntegration.prototype = {
1354
  this.vzeroPaypal = vzeroPaypal || false;
1355
 
1356
  // If both methods aren't present don't run the integration
1357
- if(this.vzero === false && this.vzeroPaypal === false) {
1358
  console.warn('The vzero and vzeroPaypal objects are not initiated.');
1359
  return false;
1360
  }
@@ -1414,6 +1507,10 @@ vZeroIntegration.prototype = {
1414
  document.observe("dom:loaded", function () {
1415
  // Saved methods need events to!
1416
  this.initSavedMethods();
 
 
 
 
1417
  }.bind(this));
1418
 
1419
  },
@@ -1421,7 +1518,7 @@ vZeroIntegration.prototype = {
1421
  /**
1422
  * Init the saved method events
1423
  */
1424
- initSavedMethods: function() {
1425
 
1426
  // Loop through each saved card being selected
1427
  $$('#creditcard-saved-accounts input[type="radio"], #paypal-saved-accounts input[type="radio"]').each(function (element) {
@@ -1452,7 +1549,7 @@ vZeroIntegration.prototype = {
1452
  * @param parentElement
1453
  * @param targetElement
1454
  */
1455
- showHideOtherMethod: function(parentElement, targetElement) {
1456
 
1457
  // Has the user selected other?
1458
  if ($$(parentElement + ' input:checked[type=radio]').first() !== undefined && $$(parentElement + ' input:checked[type=radio]').first().value == 'other') {
@@ -1489,7 +1586,7 @@ vZeroIntegration.prototype = {
1489
  /**
1490
  * Check to see if the "Other" option is selected and show the div correctly
1491
  */
1492
- checkSavedOther: function() {
1493
  var parentElement = '';
1494
  var targetElement = '';
1495
 
@@ -1510,7 +1607,7 @@ vZeroIntegration.prototype = {
1510
  /**
1511
  * Init hosted fields
1512
  */
1513
- initHostedFields: function() {
1514
 
1515
  // Only init hosted fields if it's enabled
1516
  if (this.vzero.hostedFields) {
@@ -1543,7 +1640,7 @@ vZeroIntegration.prototype = {
1543
  * @param nonce
1544
  * @returns {*}
1545
  */
1546
- afterHostedFieldsNonceReceived: function(nonce) {
1547
  this.resetLoading();
1548
  this.vzero._hostedFieldsTokenGenerated = true;
1549
  this.hostedFieldsGenerated = true;
@@ -1560,7 +1657,7 @@ vZeroIntegration.prototype = {
1560
  * @param message
1561
  * @returns {boolean}
1562
  */
1563
- afterHostedFieldsError: function(message) {
1564
  this.vzero._hostedFieldsTokenGenerated = false;
1565
  this.hostedFieldsGenerated = false;
1566
  return false;
@@ -1569,10 +1666,10 @@ vZeroIntegration.prototype = {
1569
  /**
1570
  * Init the default payment methods
1571
  */
1572
- initDefaultMethod: function() {
1573
  if (this.shouldAddPayPalButton(false)) {
1574
  this.setLoading();
1575
- this.vzero.updateData(function() {
1576
  this.resetLoading();
1577
  this.updatePayPalButton('add');
1578
  }.bind(this));
@@ -1582,9 +1679,9 @@ vZeroIntegration.prototype = {
1582
  /**
1583
  * Observe any Ajax requests and refresh the PayPal button or update the checkouts data
1584
  */
1585
- observeAjaxRequests: function() {
1586
- this.vzero.observeAjaxRequests(function() {
1587
- this.vzero.updateData(function() {
1588
 
1589
  // The Ajax request might kill our events
1590
  if (this.isOnepage) {
@@ -1608,7 +1705,7 @@ vZeroIntegration.prototype = {
1608
  /**
1609
  * Rebuild the PayPal button if it's been removed
1610
  */
1611
- rebuildPayPalButton: function() {
1612
 
1613
  // Check to see if the DOM element has been removed?
1614
  if ($('paypal-container') == null) {
@@ -1620,11 +1717,11 @@ vZeroIntegration.prototype = {
1620
  /**
1621
  * Handle saved PayPals being present on the page
1622
  */
1623
- initSavedPayPal: function() {
1624
 
1625
  // If we have any saved accounts we'll need to do something jammy
1626
  if ($$('#paypal-saved-accounts input[type=radio]').first() !== undefined) {
1627
- $('paypal-saved-accounts').on('change', 'input[type=radio]', function(event) {
1628
 
1629
  // Update the PayPal button accordingly
1630
  this.updatePayPalButton(false, 'gene_braintree_paypal');
@@ -1642,7 +1739,7 @@ vZeroIntegration.prototype = {
1642
  *
1643
  * @returns {boolean}
1644
  */
1645
- prepareSubmitObserver: function() {
1646
  return false;
1647
  },
1648
 
@@ -1652,7 +1749,7 @@ vZeroIntegration.prototype = {
1652
  *
1653
  * @returns {boolean}
1654
  */
1655
- beforeSubmit: function(callback) {
1656
  return this._beforeSubmit(callback);
1657
  },
1658
 
@@ -1662,9 +1759,9 @@ vZeroIntegration.prototype = {
1662
  * @param callback
1663
  * @private
1664
  */
1665
- _beforeSubmit: function(callback) {
1666
  // If hosted fields is activated, and we're 100% not using a saved card
1667
- if(this.hostedFieldsGenerated === false && this.vzero.hostedFields && ($$('#creditcard-saved-accounts input:checked[type=radio]').first() === undefined || ($$('#creditcard-saved-accounts input:checked[type=radio]').first() !== undefined && $$('#creditcard-saved-accounts input:checked[type=radio]').first().value == 'other'))) {
1668
  // Fake the form being submitted
1669
  var button = $('braintree-hosted-submit').down('button');
1670
  button.removeAttribute('disabled');
@@ -1679,7 +1776,7 @@ vZeroIntegration.prototype = {
1679
  *
1680
  * @returns {boolean}
1681
  */
1682
- afterSubmit: function() {
1683
  return false;
1684
  },
1685
 
@@ -1691,7 +1788,7 @@ vZeroIntegration.prototype = {
1691
  * @param failedCallback
1692
  * @param validateFailedCallback
1693
  */
1694
- submit: function(type, successCallback, failedCallback, validateFailedCallback) {
1695
 
1696
  // Check we actually want to intercept this credit card transaction?
1697
  if (this.shouldInterceptSubmit(type)) {
@@ -1703,7 +1800,7 @@ vZeroIntegration.prototype = {
1703
  this.setLoading();
1704
 
1705
  // Call the before submit function
1706
- this.beforeSubmit(function() {
1707
 
1708
  // Always attempt to update the card type on submission
1709
  if ($$('[data-genebraintree-name="number"]').first() != undefined) {
@@ -1781,7 +1878,7 @@ vZeroIntegration.prototype = {
1781
  /**
1782
  * Submit the entire checkout
1783
  */
1784
- submitCheckout: function() {
1785
  // Submit the checkout steps
1786
  window.review && review.save();
1787
  },
@@ -1789,14 +1886,14 @@ vZeroIntegration.prototype = {
1789
  /**
1790
  * How to submit the payment section
1791
  */
1792
- submitPayment: function() {
1793
  payment.save && payment.save();
1794
  },
1795
 
1796
  /**
1797
  * Enable/disable the correct nonce input fields
1798
  */
1799
- enableDisableNonce: function() {
1800
  // Make sure the nonce inputs aren't going to interfere
1801
  if (this.getPaymentMethod() == 'gene_braintree_creditcard') {
1802
  if ($('creditcard-payment-nonce') !== null) {
@@ -1821,14 +1918,14 @@ vZeroIntegration.prototype = {
1821
  * This should be overridden within each checkouts .phtml file
1822
  * vZeroIntegration.prototype.preparePaymentMethodSwitchObserver = function() {}
1823
  */
1824
- preparePaymentMethodSwitchObserver: function() {
1825
  return this.defaultPaymentMethodSwitch();
1826
  },
1827
 
1828
  /**
1829
  * If the checkout uses the Magento standard Payment.prototype.switchMethod we can utilise this function
1830
  */
1831
- defaultPaymentMethodSwitch: function() {
1832
 
1833
  // Store a pointer to the vZero integration
1834
  var vzeroIntegration = this;
@@ -1852,11 +1949,11 @@ vZeroIntegration.prototype = {
1852
  * Function to run when the customer changes payment method
1853
  * @param method
1854
  */
1855
- paymentMethodSwitch: function(method) {
1856
 
1857
  // Wait for 50ms to see if this function is called again, only ever run the last instance
1858
  clearTimeout(this._methodSwitchTimeout);
1859
- this._methodSwitchTimeout = setTimeout(function() {
1860
 
1861
  // Should we add a PayPal button?
1862
  if (this.shouldAddPayPalButton(method)) {
@@ -1882,7 +1979,7 @@ vZeroIntegration.prototype = {
1882
  *
1883
  * @returns {boolean}
1884
  */
1885
- completePayPal: function(obj) {
1886
 
1887
  // Make sure the nonces are the correct way around
1888
  this.enableDisableNonce();
@@ -1908,7 +2005,7 @@ vZeroIntegration.prototype = {
1908
  *
1909
  * @returns {boolean}
1910
  */
1911
- afterPayPalComplete: function() {
1912
  this.resetLoading();
1913
  return this.submitCheckout();
1914
  },
@@ -1916,9 +2013,9 @@ vZeroIntegration.prototype = {
1916
  /**
1917
  * Update the PayPal button, if we should add the button do so, otherwise remove it if it exists
1918
  */
1919
- updatePayPalButton: function(action, method) {
1920
 
1921
- if(this.paypalMarkUp === false) {
1922
  return false;
1923
  }
1924
 
@@ -1950,7 +2047,7 @@ vZeroIntegration.prototype = {
1950
  };
1951
 
1952
  // Add in the PayPal button
1953
- this.vzeroPaypal.addPayPalButton(buttonParams);
1954
 
1955
  } else {
1956
  console.warn('We\'re unable to find the element ' + this.paypalButtonClass + '. Please check your integration.');
@@ -1977,47 +2074,29 @@ vZeroIntegration.prototype = {
1977
  *
1978
  * @param integration
1979
  */
1980
- paypalOnReady: function(integration) {
1981
-
1982
- if($('braintree-paypal-button') != null) {
1983
-
1984
- // Always stop the window from opening
1985
- $('braintree-paypal-button').stopObserving('click').on('click', function (event) {
1986
-
1987
- // Validate the form before we open the PayPal modal window
1988
- if (!this.validateAll()) {
1989
-
1990
- // If the form fails to validate kill the event
1991
- Event.stop(event);
1992
- return false;
1993
- }
1994
-
1995
- }.bind(this));
1996
-
1997
- }
1998
-
1999
  },
2000
 
2001
  /**
2002
  * Set the loading state
2003
  */
2004
- setLoading: function() {
2005
  checkout.setLoadWaiting('payment');
2006
  },
2007
 
2008
  /**
2009
  * Reset the loading state
2010
  */
2011
- resetLoading: function() {
2012
  checkout.setLoadWaiting(false);
2013
  },
2014
 
2015
  /**
2016
  * Make sure the device data field isn't disabled
2017
  */
2018
- enableDeviceData: function() {
2019
  if ($('device_data') !== null) {
2020
- $('device_data').setAttribute('name', 'payment[device_data]');
2021
  $('device_data').removeAttribute('disabled');
2022
  }
2023
  },
@@ -2025,8 +2104,8 @@ vZeroIntegration.prototype = {
2025
  /**
2026
  * Disable all fields in the credit card form so they don't end up going server side
2027
  */
2028
- disableCreditCardForm: function() {
2029
- $$('#credit-card-form input, #credit-card-form select').each(function(formElement) {
2030
  if (formElement.id != 'creditcard-payment-nonce' && formElement.id != 'gene_braintree_creditcard_store_in_vault') {
2031
  formElement.setAttribute('disabled', 'disabled');
2032
  }
@@ -2036,7 +2115,7 @@ vZeroIntegration.prototype = {
2036
  /**
2037
  * Re-enable the credit card form, just in case there was an error etc
2038
  */
2039
- enableCreditCardForm: function() {
2040
  $$('#credit-card-form input, #credit-card-form select').each(function (formElement) {
2041
  formElement.removeAttribute('disabled');
2042
  });
@@ -2047,7 +2126,7 @@ vZeroIntegration.prototype = {
2047
  *
2048
  * @returns {boolean}
2049
  */
2050
- updateBilling: function() {
2051
 
2052
  // Verify we're not using a saved address
2053
  if (($('billing-address-select') !== null && $('billing-address-select').value == '') || $('billing-address-select') === null) {
@@ -2067,7 +2146,7 @@ vZeroIntegration.prototype = {
2067
  *
2068
  * @returns {{}}
2069
  */
2070
- getUpdateDataParams: function() {
2071
  var parameters = {};
2072
 
2073
  // If the billing address is selected and we're wanting to ship to that address we need to pass the addressId
@@ -2083,7 +2162,7 @@ vZeroIntegration.prototype = {
2083
  *
2084
  * @returns {*}
2085
  */
2086
- getPaymentMethod: function() {
2087
  return payment.currentMethod;
2088
  },
2089
 
@@ -2093,8 +2172,8 @@ vZeroIntegration.prototype = {
2093
  * @param type
2094
  * @returns {*}
2095
  */
2096
- shouldInterceptSubmit: function(type) {
2097
- switch(type){
2098
  case 'creditcard':
2099
  return (this.getPaymentMethod() == 'gene_braintree_creditcard' && this.vzero.shouldInterceptCreditCard());
2100
  break;
@@ -2109,14 +2188,14 @@ vZeroIntegration.prototype = {
2109
  * Should we be adding a PayPal button?
2110
  * @returns {boolean}
2111
  */
2112
- shouldAddPayPalButton: function(method) {
2113
  return (((method ? method : this.getPaymentMethod()) == 'gene_braintree_paypal' && $('paypal-saved-accounts') === null) || ((method ? method : this.getPaymentMethod()) == 'gene_braintree_paypal' && ($$('#paypal-saved-accounts input:checked[type=radio]').first() !== undefined && $$('#paypal-saved-accounts input:checked[type=radio]').first().value == 'other')));
2114
  },
2115
 
2116
  /**
2117
  * Function to run once 3D retokenization is complete
2118
  */
2119
- threeDTokenizationComplete: function() {
2120
  this.resetLoading();
2121
  },
2122
 
@@ -2125,16 +2204,17 @@ vZeroIntegration.prototype = {
2125
  *
2126
  * @returns {boolean}
2127
  */
2128
- validateAll: function() {
2129
  return true;
2130
  }
2131
 
2132
  };
2133
 
2134
  // Avoid 'console' errors in browsers that lack a console.
2135
- (function() {
2136
  var method;
2137
- var noop = function () {};
 
2138
  var methods = [
2139
  'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
2140
  'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
 
1
  /**
2
  * Magento Braintree class to bridge the v.zero JS SDK and Magento
3
  *
38
  if (tokenizeUrl) {
39
  this.tokenizeUrl = tokenizeUrl;
40
  }
41
+ if (vaultToNonceUrl) {
42
  this.vaultToNonceUrl = vaultToNonceUrl;
43
  }
44
 
63
  * Init the vZero integration by starting a new version of the client
64
  * If 3D secure is enabled we also listen out for window messages
65
  */
66
+ init: function () {
67
  this.client = new braintree.api.Client({clientToken: this.clientToken});
68
  },
69
 
72
  *
73
  * @param integration
74
  */
75
+ initHostedFields: function (integration) {
76
 
77
  // If the hosted field number element exists hosted fields is on the page and working!
78
  if ($$('iframe[name^="braintree-"]').length > 0) {
92
 
93
  // Utilise a 50ms timeout to ensure the last call of HF is ran
94
  clearTimeout(this._hostedFieldsTimeout);
95
+ this._hostedFieldsTimeout = setTimeout(function () {
96
 
97
  if (this._hostedIntegration !== false) {
98
  try {
112
  }.bind(this), 50);
113
  },
114
 
115
+ /**
116
+ * Tear down hosted fields
117
+ *
118
+ * @param callbackFn
119
+ */
120
+ teardownHostedFields: function (callbackFn) {
121
+ if (this._hostedIntegration !== false) {
122
+ this._hostedIntegration.teardown(function () {
123
+ this._hostedIntegration = false;
124
+
125
+ if (typeof callbackFn === 'function') {
126
+ callbackFn();
127
+ }
128
+ }.bind(this));
129
+ } else {
130
+ if (typeof callbackFn === 'function') {
131
+ callbackFn();
132
+ }
133
+ }
134
+ },
135
+
136
  /**
137
  * Setup the hosted fields client utilising the Braintree JS SDK
138
  */
139
+ setupHostedFieldsClient: function () {
140
 
141
  // If there are iframes within the fields already, don't run again!
142
  // This function has a delay from the original call so we need to verify everything is still good to go!
149
  var hostedFieldsConfiguration = {
150
  id: this.integration.form,
151
  hostedFields: {
152
+ styles: this.getHostedFieldsStyles(),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  number: {
154
  selector: "#card-number",
155
  placeholder: "0000 0000 0000 0000"
164
  },
165
  onFieldEvent: this.hostedFieldsOnFieldEvent.bind(this)
166
  },
167
+ onReady: function (integration) {
168
  this._hostedIntegration = integration;
169
+
170
+ // Unset the loading state if it's present
171
+ if ($$('#credit-card-form.loading').length) {
172
+ $$('#credit-card-form.loading').first().removeClassName('loading');
173
+ }
174
  }.bind(this),
175
  onPaymentMethodReceived: this.hostedFieldsPaymentMethodReceived.bind(this),
176
  onError: this.hostedFieldsError.bind(this)
177
  };
178
 
179
  // Include the CVV field with the request
180
+ if ($('cvv') !== null) {
181
  hostedFieldsConfiguration.hostedFields.cvv = {
182
  selector: "#cvv"
183
  };
186
  braintree.setup(this.clientToken, "custom", hostedFieldsConfiguration);
187
  },
188
 
189
+ /**
190
+ * Return the hosted field styles
191
+ * See: https://developers.braintreepayments.com/guides/hosted-fields/styling/javascript/v2
192
+ *
193
+ * @returns {*}
194
+ */
195
+ getHostedFieldsStyles: function () {
196
+
197
+ // Does the integration provide it's own styling options for hosted fields?
198
+ if (typeof this.integration.getHostedFieldsStyles === 'function') {
199
+ return this.integration.getHostedFieldsStyles();
200
+ }
201
+
202
+ // Return some default styles if all else fails
203
+ return {
204
+ // Style all elements
205
+ "input": {
206
+ "font-size": "14pt",
207
+ "color": "#3A3A3A"
208
+ },
209
+
210
+ // Styling element state
211
+ ":focus": {
212
+ "color": "black"
213
+ },
214
+ ".valid": {
215
+ "color": "green"
216
+ },
217
+ ".invalid": {
218
+ "color": "red"
219
+ }
220
+ };
221
+ },
222
+
223
  /**
224
  * Update the card type on field event
225
  *
226
  * @param event
227
  */
228
+ hostedFieldsOnFieldEvent: function (event) {
229
  if (event.type === "fieldStateChange") {
230
  if (event.card) {
231
  var cardMapping = {
251
  * @param nonce
252
  * @param callback
253
  */
254
+ vaultToNonce: function (nonce, callback) {
255
 
256
  // Craft the parameters
257
  var parameters = this.getBillingAddress();
268
  if (transport && transport.responseText) {
269
 
270
  // Parse as an object
271
+ var response;
272
  try {
273
  response = eval('(' + transport.responseText + ')');
274
  }
276
  response = {};
277
  }
278
 
279
+ if (response.success && response.nonce) {
280
  callback(response.nonce);
281
  } else {
282
 
285
  this.integration.resetLoading();
286
  }
287
 
288
+ if (response.error) {
289
  alert(response.error);
290
  } else {
291
  alert('Something wen\'t wrong and we\'re currently unable to take your payment.');
293
  }
294
  }
295
  }.bind(this),
296
+ onFailure: function () {
297
 
298
  // Hide the loading state
299
  if (typeof this.integration.resetLoading === 'function') {
312
  *
313
  * @param response
314
  */
315
+ hostedFieldsPaymentMethodReceived: function (response) {
316
 
317
  // Check if validation failed or not?
318
  if (this.threeDSecure) {
324
 
325
  // Update the quote totals first
326
  this.updateData(function () {
327
+ this.vaultToNonce(response.nonce, function (nonce) {
328
 
329
  // Hide the loading state
330
  if (typeof this.integration.resetLoading === 'function') {
355
  *
356
  * @param nonce
357
  */
358
+ hostedFieldsNonceReceived: function (nonce) {
359
 
360
  $('creditcard-payment-nonce').value = nonce;
361
  $('creditcard-payment-nonce').setAttribute('value', nonce);
378
  * @param response
379
  * @returns {boolean}
380
  */
381
+ hostedFieldsError: function (response) {
382
 
383
  if (typeof this.integration.resetLoading === 'function') {
384
  this.integration.resetLoading();
386
 
387
  // Stop any "Cannot place two elements in #xxx" messages being shown to the user
388
  // These are non critical errors and the functionality will still work as expected
389
+ if (typeof response.message !== 'undefined' && response.message.indexOf('Cannot place two elements in') == -1) {
390
  // Let the user know what went wrong
391
  alert(response.message);
392
  }
406
  *
407
  * @returns {boolean}
408
  */
409
+ usingSavedCard: function () {
410
  return ($('creditcard-saved-accounts') != undefined
411
  && $$('#creditcard-saved-accounts input:checked[type=radio]').first() != undefined
412
  && $$('#creditcard-saved-accounts input:checked[type=radio]').first().value !== 'other');
418
  *
419
  * @param flag a boolean value
420
  */
421
+ setThreeDSecure: function (flag) {
422
  this.threeDSecure = flag;
423
  },
424
 
428
  *
429
  * @param amount The grand total of the order
430
  */
431
+ setAmount: function (amount) {
432
  this.amount = parseFloat(amount);
433
  },
434
 
437
  *
438
  * @param billingName
439
  */
440
+ setBillingName: function (billingName) {
441
  this.billingName = billingName;
442
  },
443
 
446
  *
447
  * @returns {*}
448
  */
449
+ getBillingName: function () {
450
 
451
  // If billingName is an object we're wanting to grab the data from elements
452
  if (typeof this.billingName == 'object') {
466
  *
467
  * @param billingPostcode
468
  */
469
+ setBillingPostcode: function (billingPostcode) {
470
  this.billingPostcode = billingPostcode;
471
  },
472
 
475
  *
476
  * @returns {*}
477
  */
478
+ getBillingPostcode: function () {
479
 
480
  // If billingName is an object we're wanting to grab the data from elements
481
  if (typeof this.billingPostcode == 'object') {
495
  *
496
  * @param cards an array of accepted cards
497
  */
498
+ setAcceptedCards: function (cards) {
499
  this.acceptedCards = cards;
500
  },
501
 
504
  *
505
  * @returns {array}
506
  */
507
+ getBillingAddress: function () {
508
 
509
  // Is there a function in the integration for this action?
510
  if (typeof this.integration.getBillingAddress === 'function') {
514
  var billingAddress = {};
515
 
516
  // If not try something generic
517
+ if ($('co-billing-form') !== null) {
518
+ if ($('co-billing-form').tagName == 'FORM') {
519
  billingAddress = $('co-billing-form').serialize(true);
520
  } else {
521
  billingAddress = this.extractBilling($('co-billing-form').up('form').serialize(true));
522
  }
523
+ } else if ($('billing:firstname') !== null) {
524
+ billingAddress = this.extractBilling($('billing:firstname').up('form').serialize(true));
525
  }
526
 
527
+ if (billingAddress) {
528
  return billingAddress;
529
  }
530
  },
535
  * @param formData
536
  * @returns {{}}
537
  */
538
+ extractBilling: function (formData) {
539
  var billing = {};
540
+ $H(formData).each(function (data) {
541
+ // Only include billing details, excluding passwords
542
+ if (data.key.indexOf('billing') == 0 && data.key.indexOf('password') == -1) {
543
  billing[data.key] = data.value;
544
  }
545
  });
551
  *
552
  * @returns {boolean|*}
553
  */
554
+ getAcceptedCards: function () {
555
  return this.acceptedCards;
556
  },
557
 
563
  * @param seperator
564
  * @returns {string}
565
  */
566
+ combineElementsValues: function (elements, seperator) {
567
 
568
  // If no seperator is set use a space
569
  if (!seperator) {
572
 
573
  // Loop through the elements and build up an array
574
  var response = [];
575
+ elements.each(function (element, index) {
576
  if ($(element) !== undefined) {
577
  response[index] = $(element).value;
578
  }
589
  * @param cardNumber The card number that the user has entered
590
  * @param cardType The card type, if already known
591
  */
592
+ updateCardType: function (cardNumber, cardType) {
593
 
594
  if (!cardType) {
595
  // Retrieve the card type
622
  /**
623
  * Create a new event upon the card number field
624
  */
625
+ observeCardType: function () {
626
 
627
  if ($$('[data-genebraintree-name="number"]').first() !== undefined) {
628
 
634
  });
635
 
636
  // Add a space every 4 characters
637
+ $$('[data-genebraintree-name="number"]').first().oninput = function () {
638
  // Add a space every 4 characters
639
  var number = this.value.split(" ").join("");
640
  if (number.length > 0) {
654
  * @param callback A defined callback function if needed
655
  * @param ignore An array of indexOf paths to ignore
656
  */
657
+ observeAjaxRequests: function (callback, ignore) {
658
 
659
  // For every ajax request on complete update various Braintree things
660
  Ajax.Responders.register({
661
+ onComplete: function (transport) {
662
  return this.handleAjaxRequest(transport.url, callback, ignore);
663
  }.bind(this)
664
  });
665
 
666
  // Is jQuery present on the page
667
  if (window.jQuery) {
668
+ jQuery(document).ajaxComplete(function (event, xhr, settings) {
669
  return this.handleAjaxRequest(settings.url, callback, ignore)
670
  }.bind(this));
671
  }
680
  * @param ignore
681
  * @returns {boolean}
682
  */
683
+ handleAjaxRequest: function (url, callback, ignore) {
684
 
685
  // Let's check the ignore variable
686
  if (typeof ignore !== 'undefined' && ignore instanceof Array && ignore.length > 0) {
700
  }
701
 
702
  // Check the transport object has a URL and that it wasn't to our own controller
703
+ if (url && url.indexOf('/braintree/') == -1) {
704
 
705
  // Some checkout implementations may require custom callbacks
706
  if (callback) {
718
  * @param callback A defined callback function if needed
719
  * @param params any extra data to be passed to the controller
720
  */
721
+ updateData: function (callback, params) {
722
 
723
  // Push the callbacks into our array
724
  this._updateDataCallbacks.push(callback);
725
  this._updateDataParams = params;
726
 
727
  // If an updateData ajax request is running, cancel it
728
+ if (this._updateDataXhr !== false) {
729
  this._updateDataXhr.transport.abort();
730
  }
731
 
733
  this._updateDataXhr = new Ajax.Request(
734
  this.quoteUrl,
735
  {
736
+ method: 'post',
737
  parameters: this._updateDataParams,
738
+ onSuccess: function (transport) {
739
  // Verify we have some response text
740
+ if (transport && (transport.responseJSON || transport.responseText)) {
741
+
742
+ // Parse the response from the server
743
+ var response;
744
+ if (transport.responseJSON && typeof transport.responseJSON === 'object') {
745
+ response = transport.responseJSON;
746
+ } else if (transport.responseText) {
747
+ response = JSON.decode(transport.responseText);
748
  }
749
 
750
  if (response.billingName != undefined) {
777
  this._updateDataXhr = false;
778
 
779
  // Run any callbacks that have been stored
780
+ if (this._updateDataCallbacks.length) {
781
  this._updateDataCallbacks.each(function (callback) {
782
  callback(response);
783
  }.bind(this));
785
  }
786
  }
787
  }.bind(this),
788
+ onFailure: function () {
789
 
790
  // Reset the params
791
  this._updateDataParams = {};
803
  *
804
  * @param callback A defined callback function if needed
805
  */
806
+ close3dSecureMethod: function (callback) {
807
  this.closeMethod = callback;
808
  },
809
 
814
  *
815
  * @param callback A defined callback function if needed
816
  */
817
+ tokenize3dSavedCards: function (callback) {
818
 
819
  // Check 3D is enabled
820
  if (this.threeDSecure) {
832
  new Ajax.Request(
833
  this.tokenizeUrl,
834
  {
835
+ method: 'post',
836
+ onSuccess: function (transport) {
837
 
838
  // Verify we have some response text
839
  if (transport && transport.responseText) {
876
  }
877
  },
878
 
879
+ onUserClose3ds: function () {
880
  this._hostedFieldsTokenGenerated = false;
881
  // Is there a close method defined?
882
  if (this.closeMethod) {
892
  * @param nonce
893
  * @param options
894
  */
895
+ verify3dSecureNonce: function (nonce, options) {
896
 
897
  var threeDSecureRequest = {
898
  amount: this.amount,
922
  *
923
  * @param options Contains any callback functions which have been set
924
  */
925
+ verify3dSecure: function (options) {
926
 
927
  var threeDSecureRequest = {
928
  amount: this.amount,
980
  *
981
  * @param options Contains any callback functions which have been set
982
  */
983
+ verify3dSecureVault: function (options) {
984
 
985
  // Get the payment nonce
986
  var paymentNonce = $$('#creditcard-saved-accounts input:checked[type=radio]').first().getAttribute('data-threedsecure-nonce');
1031
  *
1032
  * @param options Contains any callback functions which have been set
1033
  */
1034
+ processCard: function (options) {
1035
 
1036
  var tokenizeRequest = {
1037
  number: $$('[data-genebraintree-name="number"]').first().value,
1085
  *
1086
  * @returns {boolean}
1087
  */
1088
+ shouldInterceptCreditCard: function () {
1089
  return true;
1090
  },
1091
 
1094
  *
1095
  * @returns {boolean}
1096
  */
1097
+ shouldInterceptPayPal: function () {
1098
  return true;
1099
  },
1100
 
1104
  * @param number
1105
  * @returns {string}
1106
  */
1107
+ getCardType: function (number) {
1108
 
1109
+ if (number) {
1110
 
1111
  if (number.match(/^4/) != null)
1112
  return "VI";
1143
  *
1144
  * @param options Object containing onSuccess, onFailure functions
1145
  */
1146
+ process: function (options) {
1147
 
1148
  // If options isn't set, use an empty object
1149
  options = options || {};
1150
 
1151
  // If the hosted fields token has been generated just glide through
1152
+ if (this._hostedFieldsTokenGenerated) {
1153
 
1154
  // No action required as we're using a saved card
1155
  if (options.onSuccess) {
1180
  }
1181
  },
1182
 
1183
+ creditCardLoaded: function () {
1184
  return false;
1185
  },
1186
 
1187
+ paypalLoaded: function () {
1188
  return false;
1189
  }
1190
 
1217
 
1218
  this._paypalOptions = {};
1219
  this._paypalIntegration = false;
1220
+ this._paypalButton = false;
1221
 
1222
  this._rebuildTimer = false;
1223
  this._rebuildCount = 0;
1231
  * @param amount The amount formatted to two decimal places
1232
  * @param currency The currency code
1233
  */
1234
+ setPricing: function (amount, currency) {
1235
 
1236
  // Set them into the class
1237
  this.amount = parseFloat(amount);
1238
  this.currency = currency;
1239
 
1240
+ if ($('paypal-payment-nonce') != null && !$('paypal-payment-nonce').value) {
1241
+ // As the amounts and currency has been updated let's update the button by rebuilding it
1242
+ // But only if we don't have a nonce
1243
+ this.rebuildButton();
1244
+ }
1245
 
1246
  },
1247
 
1248
  /**
1249
  * Rebuild the PayPal button
1250
  */
1251
+ rebuildButton: function () {
1252
 
1253
  clearTimeout(this._rebuildTimer);
1254
  if (this._paypalIntegration !== false) {
1261
  }.bind(this));
1262
  } catch (e) {
1263
  // This error means the integration has already been torn down
1264
+ if (e.message == 'Cannot teardown integration more than once') {
1265
  this._paypalIntegration = false;
1266
  this.addPayPalButton(this._paypalOptions);
1267
+ } else if (this._rebuildCount >= 10) {
1268
  // Infinite loops are bad kids
1269
  return false;
1270
  } else {
1282
  * Inject the PayPal button into the document
1283
  *
1284
  * @param options Object containing onSuccess method
1285
+ * @param integration Object the integration class
1286
  */
1287
+ addPayPalButton: function (options, checkoutIntegration) {
1288
 
1289
  // If the container isn't present on the page we can't add the button
1290
+ if ($('paypal-container') === null || $('braintree-paypal-button') === null) {
1291
+ return false;
1292
+ }
1293
+
1294
+ // Add our custom button into the view
1295
+ var buttonHtml = $('braintree-paypal-button').innerHTML;
1296
+ $('paypal-container').update('');
1297
+ $('paypal-container').insert(buttonHtml);
1298
+
1299
+ // Assign the new button
1300
+ if (!$('paypal-container').select('>button').length) {
1301
  return false;
1302
  }
1303
+ this._paypalButton = $('paypal-container').select('>button').first();
1304
+ this._paypalButton.addClassName('braintree-paypal-loading');
1305
+ this._paypalButton.setAttribute('disabled', 'disabled');
1306
 
1307
  // Store the options as we may need to rebuild the button
1308
  this._paypalOptions = options;
1310
 
1311
  // Build up our setup configuration
1312
  var setupConfiguration = {
 
1313
  paymentMethodNonceInputField: "paypal-payment-nonce",
1314
  displayName: this.storeFrontName,
1315
+ onPaymentMethodReceived: function (obj) {
1316
 
1317
  // If we have a success callback we're most likely using a non-default checkout
1318
  if (typeof options.onSuccess === 'function') {
1332
  }
1333
 
1334
  },
1335
+ onUnsupported: function () {
1336
  alert('You need to link your PayPal account with your Braintree account in your Braintree control panel to utilise the PayPal functionality of this extension.');
1337
  },
1338
+ onReady: function (integration) {
1339
  this._paypalIntegration = integration;
1340
+ this._attachPayPalButtonEvent(checkoutIntegration);
1341
  if (typeof options.onReady === 'function') {
1342
  options.onReady(integration);
1343
  }
1344
+ }.bind(this),
1345
+ paypal: {
1346
+ headless: true
1347
+ }
1348
  };
1349
 
1350
  // Pass the locale over to the PayPal instance
1351
+ if (this.locale) {
1352
  setupConfiguration.locale = this.locale;
1353
  }
1354
 
1373
  braintree.setup(this.clientToken, "paypal", setupConfiguration);
1374
  },
1375
 
1376
+ /**
1377
+ * Attach the click event to the paypal button
1378
+ *
1379
+ * @param integration
1380
+ *
1381
+ * @private
1382
+ */
1383
+ _attachPayPalButtonEvent: function (checkoutIntegration) {
1384
+ if (this._paypalIntegration && this._paypalButton) {
1385
+ this._paypalButton.removeClassName('braintree-paypal-loading');
1386
+ this._paypalButton.removeAttribute('disabled');
1387
+
1388
+ Event.stopObserving(this._paypalButton, 'click');
1389
+ Event.observe(this._paypalButton, 'click', function (event) {
1390
+ Event.stop(event);
1391
+ if (typeof checkoutIntegration == 'object' && typeof checkoutIntegration.validateAll === 'function') {
1392
+ if (checkoutIntegration.validateAll()) {
1393
+ // Fire the integration
1394
+ this._paypalIntegration.paypal.initAuthFlow();
1395
+ }
1396
+ } else {
1397
+ // Fire the integration
1398
+ this._paypalIntegration.paypal.initAuthFlow();
1399
+ }
1400
+
1401
+ }.bind(this));
1402
+ }
1403
+ },
1404
+
1405
  /**
1406
  * Allow closing of the PayPal window
1407
  *
1408
  * @param callback A defined callback function if needed
1409
  * @deprecated since version 1.0.4.1
1410
  */
1411
+ closePayPalWindow: function (callback) {
1412
  // Function deprecated in favour of using event propagation
1413
  }
1414
 
1434
  * @param config Any further config the integration wants to push into the class
1435
  * @param onReady function fired after integration is "ready"
1436
  */
1437
+ initialize: function (vzero, vzeroPaypal, paypalMarkUp, paypalButtonClass, isOnepage, config, onReady) {
1438
 
1439
  // Only allow the system to be initialized twice
1440
  if (vZeroIntegration.prototype.loaded) {
1447
  this.vzeroPaypal = vzeroPaypal || false;
1448
 
1449
  // If both methods aren't present don't run the integration
1450
+ if (this.vzero === false && this.vzeroPaypal === false) {
1451
  console.warn('The vzero and vzeroPaypal objects are not initiated.');
1452
  return false;
1453
  }
1507
  document.observe("dom:loaded", function () {
1508
  // Saved methods need events to!
1509
  this.initSavedMethods();
1510
+
1511
+ if ($('braintree-hosted-submit') !== null) {
1512
+ this.initHostedFields();
1513
+ }
1514
  }.bind(this));
1515
 
1516
  },
1518
  /**
1519
  * Init the saved method events
1520
  */
1521
+ initSavedMethods: function () {
1522
 
1523
  // Loop through each saved card being selected
1524
  $$('#creditcard-saved-accounts input[type="radio"], #paypal-saved-accounts input[type="radio"]').each(function (element) {
1549
  * @param parentElement
1550
  * @param targetElement
1551
  */
1552
+ showHideOtherMethod: function (parentElement, targetElement) {
1553
 
1554
  // Has the user selected other?
1555
  if ($$(parentElement + ' input:checked[type=radio]').first() !== undefined && $$(parentElement + ' input:checked[type=radio]').first().value == 'other') {
1586
  /**
1587
  * Check to see if the "Other" option is selected and show the div correctly
1588
  */
1589
+ checkSavedOther: function () {
1590
  var parentElement = '';
1591
  var targetElement = '';
1592
 
1607
  /**
1608
  * Init hosted fields
1609
  */
1610
+ initHostedFields: function () {
1611
 
1612
  // Only init hosted fields if it's enabled
1613
  if (this.vzero.hostedFields) {
1640
  * @param nonce
1641
  * @returns {*}
1642
  */
1643
+ afterHostedFieldsNonceReceived: function (nonce) {
1644
  this.resetLoading();
1645
  this.vzero._hostedFieldsTokenGenerated = true;
1646
  this.hostedFieldsGenerated = true;
1657
  * @param message
1658
  * @returns {boolean}
1659
  */
1660
+ afterHostedFieldsError: function (message) {
1661
  this.vzero._hostedFieldsTokenGenerated = false;
1662
  this.hostedFieldsGenerated = false;
1663
  return false;
1666
  /**
1667
  * Init the default payment methods
1668
  */
1669
+ initDefaultMethod: function () {
1670
  if (this.shouldAddPayPalButton(false)) {
1671
  this.setLoading();
1672
+ this.vzero.updateData(function () {
1673
  this.resetLoading();
1674
  this.updatePayPalButton('add');
1675
  }.bind(this));
1679
  /**
1680
  * Observe any Ajax requests and refresh the PayPal button or update the checkouts data
1681
  */
1682
+ observeAjaxRequests: function () {
1683
+ this.vzero.observeAjaxRequests(function () {
1684
+ this.vzero.updateData(function () {
1685
 
1686
  // The Ajax request might kill our events
1687
  if (this.isOnepage) {
1705
  /**
1706
  * Rebuild the PayPal button if it's been removed
1707
  */
1708
+ rebuildPayPalButton: function () {
1709
 
1710
  // Check to see if the DOM element has been removed?
1711
  if ($('paypal-container') == null) {
1717
  /**
1718
  * Handle saved PayPals being present on the page
1719
  */
1720
+ initSavedPayPal: function () {
1721
 
1722
  // If we have any saved accounts we'll need to do something jammy
1723
  if ($$('#paypal-saved-accounts input[type=radio]').first() !== undefined) {
1724
+ $('paypal-saved-accounts').on('change', 'input[type=radio]', function (event) {
1725
 
1726
  // Update the PayPal button accordingly
1727
  this.updatePayPalButton(false, 'gene_braintree_paypal');
1739
  *
1740
  * @returns {boolean}
1741
  */
1742
+ prepareSubmitObserver: function () {
1743
  return false;
1744
  },
1745
 
1749
  *
1750
  * @returns {boolean}
1751
  */
1752
+ beforeSubmit: function (callback) {
1753
  return this._beforeSubmit(callback);
1754
  },
1755
 
1759
  * @param callback
1760
  * @private
1761
  */
1762
+ _beforeSubmit: function (callback) {
1763
  // If hosted fields is activated, and we're 100% not using a saved card
1764
+ if (this.hostedFieldsGenerated === false && this.vzero.hostedFields && ($$('#creditcard-saved-accounts input:checked[type=radio]').first() === undefined || ($$('#creditcard-saved-accounts input:checked[type=radio]').first() !== undefined && $$('#creditcard-saved-accounts input:checked[type=radio]').first().value == 'other'))) {
1765
  // Fake the form being submitted
1766
  var button = $('braintree-hosted-submit').down('button');
1767
  button.removeAttribute('disabled');
1776
  *
1777
  * @returns {boolean}
1778
  */
1779
+ afterSubmit: function () {
1780
  return false;
1781
  },
1782
 
1788
  * @param failedCallback
1789
  * @param validateFailedCallback
1790
  */
1791
+ submit: function (type, successCallback, failedCallback, validateFailedCallback) {
1792
 
1793
  // Check we actually want to intercept this credit card transaction?
1794
  if (this.shouldInterceptSubmit(type)) {
1800
  this.setLoading();
1801
 
1802
  // Call the before submit function
1803
+ this.beforeSubmit(function () {
1804
 
1805
  // Always attempt to update the card type on submission
1806
  if ($$('[data-genebraintree-name="number"]').first() != undefined) {
1878
  /**
1879
  * Submit the entire checkout
1880
  */
1881
+ submitCheckout: function () {
1882
  // Submit the checkout steps
1883
  window.review && review.save();
1884
  },
1886
  /**
1887
  * How to submit the payment section
1888
  */
1889
+ submitPayment: function () {
1890
  payment.save && payment.save();
1891
  },
1892
 
1893
  /**
1894
  * Enable/disable the correct nonce input fields
1895
  */
1896
+ enableDisableNonce: function () {
1897
  // Make sure the nonce inputs aren't going to interfere
1898
  if (this.getPaymentMethod() == 'gene_braintree_creditcard') {
1899
  if ($('creditcard-payment-nonce') !== null) {
1918
  * This should be overridden within each checkouts .phtml file
1919
  * vZeroIntegration.prototype.preparePaymentMethodSwitchObserver = function() {}
1920
  */
1921
+ preparePaymentMethodSwitchObserver: function () {
1922
  return this.defaultPaymentMethodSwitch();
1923
  },
1924
 
1925
  /**
1926
  * If the checkout uses the Magento standard Payment.prototype.switchMethod we can utilise this function
1927
  */
1928
+ defaultPaymentMethodSwitch: function () {
1929
 
1930
  // Store a pointer to the vZero integration
1931
  var vzeroIntegration = this;
1949
  * Function to run when the customer changes payment method
1950
  * @param method
1951
  */
1952
+ paymentMethodSwitch: function (method) {
1953
 
1954
  // Wait for 50ms to see if this function is called again, only ever run the last instance
1955
  clearTimeout(this._methodSwitchTimeout);
1956
+ this._methodSwitchTimeout = setTimeout(function () {
1957
 
1958
  // Should we add a PayPal button?
1959
  if (this.shouldAddPayPalButton(method)) {
1979
  *
1980
  * @returns {boolean}
1981
  */
1982
+ completePayPal: function (obj) {
1983
 
1984
  // Make sure the nonces are the correct way around
1985
  this.enableDisableNonce();
2005
  *
2006
  * @returns {boolean}
2007
  */
2008
+ afterPayPalComplete: function () {
2009
  this.resetLoading();
2010
  return this.submitCheckout();
2011
  },
2013
  /**
2014
  * Update the PayPal button, if we should add the button do so, otherwise remove it if it exists
2015
  */
2016
+ updatePayPalButton: function (action, method) {
2017
 
2018
+ if (this.paypalMarkUp === false) {
2019
  return false;
2020
  }
2021
 
2047
  };
2048
 
2049
  // Add in the PayPal button
2050
+ this.vzeroPaypal.addPayPalButton(buttonParams, this);
2051
 
2052
  } else {
2053
  console.warn('We\'re unable to find the element ' + this.paypalButtonClass + '. Please check your integration.');
2074
  *
2075
  * @param integration
2076
  */
2077
+ paypalOnReady: function (integration) {
2078
+ return true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2079
  },
2080
 
2081
  /**
2082
  * Set the loading state
2083
  */
2084
+ setLoading: function () {
2085
  checkout.setLoadWaiting('payment');
2086
  },
2087
 
2088
  /**
2089
  * Reset the loading state
2090
  */
2091
+ resetLoading: function () {
2092
  checkout.setLoadWaiting(false);
2093
  },
2094
 
2095
  /**
2096
  * Make sure the device data field isn't disabled
2097
  */
2098
+ enableDeviceData: function () {
2099
  if ($('device_data') !== null) {
 
2100
  $('device_data').removeAttribute('disabled');
2101
  }
2102
  },
2104
  /**
2105
  * Disable all fields in the credit card form so they don't end up going server side
2106
  */
2107
+ disableCreditCardForm: function () {
2108
+ $$('#credit-card-form input, #credit-card-form select').each(function (formElement) {
2109
  if (formElement.id != 'creditcard-payment-nonce' && formElement.id != 'gene_braintree_creditcard_store_in_vault') {
2110
  formElement.setAttribute('disabled', 'disabled');
2111
  }
2115
  /**
2116
  * Re-enable the credit card form, just in case there was an error etc
2117
  */
2118
+ enableCreditCardForm: function () {
2119
  $$('#credit-card-form input, #credit-card-form select').each(function (formElement) {
2120
  formElement.removeAttribute('disabled');
2121
  });
2126
  *
2127
  * @returns {boolean}
2128
  */
2129
+ updateBilling: function () {
2130
 
2131
  // Verify we're not using a saved address
2132
  if (($('billing-address-select') !== null && $('billing-address-select').value == '') || $('billing-address-select') === null) {
2146
  *
2147
  * @returns {{}}
2148
  */
2149
+ getUpdateDataParams: function () {
2150
  var parameters = {};
2151
 
2152
  // If the billing address is selected and we're wanting to ship to that address we need to pass the addressId
2162
  *
2163
  * @returns {*}
2164
  */
2165
+ getPaymentMethod: function () {
2166
  return payment.currentMethod;
2167
  },
2168
 
2172
  * @param type
2173
  * @returns {*}
2174
  */
2175
+ shouldInterceptSubmit: function (type) {
2176
+ switch (type) {
2177
  case 'creditcard':
2178
  return (this.getPaymentMethod() == 'gene_braintree_creditcard' && this.vzero.shouldInterceptCreditCard());
2179
  break;
2188
  * Should we be adding a PayPal button?
2189
  * @returns {boolean}
2190
  */
2191
+ shouldAddPayPalButton: function (method) {
2192
  return (((method ? method : this.getPaymentMethod()) == 'gene_braintree_paypal' && $('paypal-saved-accounts') === null) || ((method ? method : this.getPaymentMethod()) == 'gene_braintree_paypal' && ($$('#paypal-saved-accounts input:checked[type=radio]').first() !== undefined && $$('#paypal-saved-accounts input:checked[type=radio]').first().value == 'other')));
2193
  },
2194
 
2195
  /**
2196
  * Function to run once 3D retokenization is complete
2197
  */
2198
+ threeDTokenizationComplete: function () {
2199
  this.resetLoading();
2200
  },
2201
 
2204
  *
2205
  * @returns {boolean}
2206
  */
2207
+ validateAll: function () {
2208
  return true;
2209
  }
2210
 
2211
  };
2212
 
2213
  // Avoid 'console' errors in browsers that lack a console.
2214
+ (function () {
2215
  var method;
2216
+ var noop = function () {
2217
+ };
2218
  var methods = [
2219
  'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
2220
  'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
lib/Braintree/Test/Nonces.php DELETED
@@ -1,33 +0,0 @@
1
- <?php
2
- /**
3
- * Nonces used for testing purposes
4
- *
5
- * @package Braintree
6
- * @subpackage Test
7
- * @copyright 2014 Braintree, a division of PayPal, Inc.
8
- */
9
-
10
- /**
11
- * Nonces used for testing purposes
12
- *
13
- * The constants in this class can be used to perform nonce operations
14
- * with the desired status in the sandbox environment.
15
- *
16
- * @package Braintree
17
- * @subpackage Test
18
- * @copyright 2014 Braintree, a division of PayPal, Inc.
19
- */
20
- class Braintree_Test_Nonces
21
- {
22
- public static $transactable = "fake-valid-nonce";
23
- public static $consumed = "fake-consumed-nonce";
24
- public static $paypalOneTimePayment = "fake-paypal-one-time-nonce";
25
- public static $paypalFuturePayment = "fake-paypal-future-nonce";
26
- public static $applePayVisa = "fake-apple-pay-visa-nonce";
27
- public static $applePayMasterCard = "fake-apple-pay-visa-nonce";
28
- public static $applePayAmEx = "fake-apple-pay-amex-nonce";
29
- public static $androidPay = "fake-android-pay-nonce";
30
- public static $abstractTransactable = "fake-abstract-transactable-nonce";
31
- public static $europe = "fake-europe-bank-account-nonce";
32
- public static $coinbase = "fake-coinbase-nonce";
33
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/{Braintree.php → Gene/Braintree.php} RENAMED
@@ -43,6 +43,7 @@ require_once('Braintree/Digest.php');
43
  require_once('Braintree/Discount.php');
44
  require_once('Braintree/DiscountGateway.php');
45
  require_once('Braintree/IsNode.php');
 
46
  require_once('Braintree/EqualityNode.php');
47
  require_once('Braintree/Exception.php');
48
  require_once('Braintree/Gateway.php');
@@ -113,6 +114,7 @@ require_once('Braintree/Transaction/AddressDetails.php');
113
  require_once('Braintree/Transaction/AndroidPayCardDetails.php');
114
  require_once('Braintree/Transaction/ApplePayCardDetails.php');
115
  require_once('Braintree/Transaction/CoinbaseDetails.php');
 
116
  require_once('Braintree/Transaction/CreditCardDetails.php');
117
  require_once('Braintree/Transaction/PayPalDetails.php');
118
  require_once('Braintree/Transaction/CustomerDetails.php');
@@ -134,6 +136,8 @@ require_once('Braintree/PaymentMethodNonce.php');
134
  require_once('Braintree/PaymentMethodNonceGateway.php');
135
  require_once('Braintree/PaymentInstrumentType.php');
136
  require_once('Braintree/UnknownPaymentMethod.php');
 
 
137
 
138
  if (version_compare(PHP_VERSION, '5.4.0', '<')) {
139
  throw new Braintree_Exception('PHP version >= 5.4.0 required');
43
  require_once('Braintree/Discount.php');
44
  require_once('Braintree/DiscountGateway.php');
45
  require_once('Braintree/IsNode.php');
46
+ require_once('Braintree/EuropeBankAccount.php');
47
  require_once('Braintree/EqualityNode.php');
48
  require_once('Braintree/Exception.php');
49
  require_once('Braintree/Gateway.php');
114
  require_once('Braintree/Transaction/AndroidPayCardDetails.php');
115
  require_once('Braintree/Transaction/ApplePayCardDetails.php');
116
  require_once('Braintree/Transaction/CoinbaseDetails.php');
117
+ require_once('Braintree/Transaction/EuropeBankAccountDetails.php');
118
  require_once('Braintree/Transaction/CreditCardDetails.php');
119
  require_once('Braintree/Transaction/PayPalDetails.php');
120
  require_once('Braintree/Transaction/CustomerDetails.php');
136
  require_once('Braintree/PaymentMethodNonceGateway.php');
137
  require_once('Braintree/PaymentInstrumentType.php');
138
  require_once('Braintree/UnknownPaymentMethod.php');
139
+ require_once('Braintree/Exception/TestOperationPerformedInProduction.php');
140
+ require_once('Braintree/Test/Transaction.php');
141
 
142
  if (version_compare(PHP_VERSION, '5.4.0', '<')) {
143
  throw new Braintree_Exception('PHP version >= 5.4.0 required');
lib/{Braintree → Gene/Braintree}/AddOn.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/AddOnGateway.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Address.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/AddressGateway.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/AndroidPayCard.php RENAMED
@@ -22,6 +22,7 @@
22
  * @property-read string $last4
23
  * @property-read string $sourceCardLast4
24
  * @property-read string $sourceCardType
 
25
  * @property-read string $token
26
  * @property-read string $updatedAt
27
  * @property-read string $virtualCardLast4
22
  * @property-read string $last4
23
  * @property-read string $sourceCardLast4
24
  * @property-read string $sourceCardType
25
+ * @property-read string $sourceDescription
26
  * @property-read string $token
27
  * @property-read string $updatedAt
28
  * @property-read string $virtualCardLast4
lib/{Braintree → Gene/Braintree}/ApplePayCard.php RENAMED
@@ -20,6 +20,7 @@
20
  * @property-read string $last4
21
  * @property-read string $token
22
  * @property-read string $paymentInstrumentName
 
23
  * @property-read string $updatedAt
24
  */
25
  class Braintree_ApplePayCard extends Braintree_Base
20
  * @property-read string $last4
21
  * @property-read string $token
22
  * @property-read string $paymentInstrumentName
23
+ * @property-read string $sourceDescription
24
  * @property-read string $updatedAt
25
  */
26
  class Braintree_ApplePayCard extends Braintree_Base
lib/{Braintree → Gene/Braintree}/Base.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/ClientToken.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/ClientTokenGateway.php RENAMED
@@ -7,13 +7,13 @@ class Braintree_ClientTokenGateway
7
  * @var Braintree_Gateway
8
  */
9
  private $_gateway;
10
-
11
  /**
12
  *
13
  * @var Braintree_Configuration
14
  */
15
  private $_config;
16
-
17
  /**
18
  *
19
  * @var Braintree_Http
@@ -21,7 +21,7 @@ class Braintree_ClientTokenGateway
21
  private $_http;
22
 
23
  /**
24
- *
25
  * @param Braintree_Gateway $gateway
26
  */
27
  public function __construct($gateway)
@@ -61,7 +61,7 @@ class Braintree_ClientTokenGateway
61
  }
62
 
63
  /**
64
- *
65
  * @param array $params
66
  * @throws InvalidArgumentException
67
  */
@@ -75,16 +75,19 @@ class Braintree_ClientTokenGateway
75
  }
76
 
77
  /**
78
- *
79
  * @return mixed[]
80
  */
81
  public function generateWithCustomerIdSignature()
82
  {
83
- return array("version", "customerId", "proxyMerchantId", array("options" => array("makeDefault", "verifyCard", "failOnDuplicatePaymentMethod")), "merchantAccountId");
 
 
 
84
  }
85
 
86
  /**
87
- *
88
  * @return string[]
89
  */
90
  public function generateWithoutCustomerIdSignature()
7
  * @var Braintree_Gateway
8
  */
9
  private $_gateway;
10
+
11
  /**
12
  *
13
  * @var Braintree_Configuration
14
  */
15
  private $_config;
16
+
17
  /**
18
  *
19
  * @var Braintree_Http
21
  private $_http;
22
 
23
  /**
24
+ *
25
  * @param Braintree_Gateway $gateway
26
  */
27
  public function __construct($gateway)
61
  }
62
 
63
  /**
64
+ *
65
  * @param array $params
66
  * @throws InvalidArgumentException
67
  */
75
  }
76
 
77
  /**
78
+ *
79
  * @return mixed[]
80
  */
81
  public function generateWithCustomerIdSignature()
82
  {
83
+ return array(
84
+ "version", "customerId", "proxyMerchantId",
85
+ array("options" => array("makeDefault", "verifyCard", "failOnDuplicatePaymentMethod")),
86
+ "merchantAccountId", "sepaMandateType", "sepaMandateAcceptanceLocation");
87
  }
88
 
89
  /**
90
+ *
91
  * @return string[]
92
  */
93
  public function generateWithoutCustomerIdSignature()
lib/{Braintree → Gene/Braintree}/CoinbaseAccount.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Collection.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Configuration.php RENAMED
@@ -230,16 +230,7 @@ class Braintree_Configuration
230
  */
231
  public function baseUrl()
232
  {
233
- static $defaultPorts = array(
234
- 'http' => 80,
235
- 'https' => 443,
236
- );
237
-
238
- if ($this->portNumber() === $defaultPorts[$this->protocol()]) {
239
- return sprintf('%s://%s', $this->protocol(), $this->serverName());
240
- } else {
241
- return sprintf('%s://%s:%d', $this->protocol(), $this->serverName(), $this->portNumber());
242
- }
243
  }
244
 
245
  /**
230
  */
231
  public function baseUrl()
232
  {
233
+ return sprintf('%s://%s:%d', $this->protocol(), $this->serverName(), $this->portNumber());
 
 
 
 
 
 
 
 
 
234
  }
235
 
236
  /**
lib/{Braintree → Gene/Braintree}/CredentialsParser.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/CreditCard.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/CreditCardGateway.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/CreditCardVerification.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/CreditCardVerificationGateway.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/CreditCardVerificationSearch.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Customer.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/CustomerGateway.php RENAMED
@@ -557,15 +557,15 @@ class Braintree_CustomerGateway
557
  * @throws InvalidArgumentException
558
  */
559
  private function _validateId($id = null) {
560
- if (empty($id)) {
561
- throw new InvalidArgumentException(
562
- 'expected customer id to be set'
563
- );
564
  }
565
  if (!preg_match('/^[0-9A-Za-z_-]+$/', $id)) {
566
  throw new InvalidArgumentException(
567
- $id . ' is an invalid customer id.'
568
- );
569
  }
570
  }
571
 
557
  * @throws InvalidArgumentException
558
  */
559
  private function _validateId($id = null) {
560
+ if (is_null($id)) {
561
+ throw new InvalidArgumentException(
562
+ 'expected customer id to be set'
563
+ );
564
  }
565
  if (!preg_match('/^[0-9A-Za-z_-]+$/', $id)) {
566
  throw new InvalidArgumentException(
567
+ $id . ' is an invalid customer id.'
568
+ );
569
  }
570
  }
571
 
lib/{Braintree → Gene/Braintree}/CustomerSearch.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Descriptor.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Digest.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Disbursement.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/DisbursementDetails.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Discount.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/DiscountGateway.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Dispute.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Dispute/TransactionDetails.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/EqualityNode.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Error/Codes.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Error/ErrorCollection.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Error/Validation.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Error/ValidationErrorCollection.php RENAMED
File without changes
lib/Gene/Braintree/EuropeBankAccount.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Braintree EuropeBankAccount module
4
+ * Creates and manages Braintree Europe Bank Accounts
5
+ *
6
+ * <b>== More information ==</b>
7
+ *
8
+ * See {@link https://developers.braintreepayments.com/javascript+php}<br />
9
+ *
10
+ * @package Braintree
11
+ * @category Resources
12
+ * @copyright 2014 Braintree, a division of PayPal, Inc.
13
+ *
14
+ * @property-read string $token
15
+ * @property-read string $default
16
+ * @property-read string $masked-iban
17
+ * @property-read string $bic
18
+ * @property-read string $mandate-reference-number
19
+ * @property-read string $account-holder-name
20
+ * @property-read string $image-url
21
+ */
22
+ class Braintree_EuropeBankAccount extends Braintree_Base
23
+ {
24
+
25
+ /* instance methods */
26
+ /**
27
+ * returns false if default is null or false
28
+ *
29
+ * @return boolean
30
+ */
31
+ public function isDefault()
32
+ {
33
+ return $this->default;
34
+ }
35
+
36
+ /**
37
+ * factory method: returns an instance of Braintree_EuropeBankAccount
38
+ * to the requesting method, with populated properties
39
+ *
40
+ * @ignore
41
+ * @return object instance of Braintree_EuropeBankAccount
42
+ */
43
+ public static function factory($attributes)
44
+ {
45
+ $defaultAttributes = array(
46
+ );
47
+
48
+ $instance = new self();
49
+ $instance->_initialize(array_merge($defaultAttributes, $attributes));
50
+ return $instance;
51
+ }
52
+
53
+ /**
54
+ * sets instance properties from an array of values
55
+ *
56
+ * @access protected
57
+ * @param array $europeBankAccountAttribs array of EuropeBankAccount properties
58
+ * @return none
59
+ */
60
+ protected function _initialize($europeBankAccountAttribs)
61
+ {
62
+ $this->_attributes = $europeBankAccountAttribs;
63
+ }
64
+ }
lib/{Braintree → Gene/Braintree}/Exception.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Exception/Authentication.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Exception/Authorization.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Exception/Configuration.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Exception/DownForMaintenance.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Exception/ForgedQueryString.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Exception/InvalidChallenge.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Exception/InvalidSignature.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Exception/NotFound.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Exception/SSLCaFileNotFound.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Exception/SSLCertificate.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Exception/ServerError.php RENAMED
File without changes
lib/Gene/Braintree/Exception/TestOperationPerformedInProduction.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Raised when a test method is used in production.
4
+ *
5
+ * @package Braintree
6
+ * @subpackage Exception
7
+ * @copyright 2014 Braintree, a division of PayPal, Inc.
8
+ */
9
+ class Braintree_Exception_TestOperationPerformedInProduction extends Braintree_Exception
10
+ {
11
+ }
lib/{Braintree → Gene/Braintree}/Exception/Unexpected.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Exception/UpgradeRequired.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Exception/ValidationsFailed.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Gateway.php RENAMED
@@ -23,7 +23,7 @@ class Braintree_Gateway
23
  }
24
 
25
  /**
26
- *
27
  * @return \Braintree_AddOnGateway
28
  */
29
  public function addOn()
@@ -32,7 +32,7 @@ class Braintree_Gateway
32
  }
33
 
34
  /**
35
- *
36
  * @return \Braintree_AddressGateway
37
  */
38
  public function address()
@@ -41,7 +41,7 @@ class Braintree_Gateway
41
  }
42
 
43
  /**
44
- *
45
  * @return \Braintree_ClientTokenGateway
46
  */
47
  public function clientToken()
@@ -50,7 +50,7 @@ class Braintree_Gateway
50
  }
51
 
52
  /**
53
- *
54
  * @return \Braintree_CreditCardGateway
55
  */
56
  public function creditCard()
@@ -59,7 +59,7 @@ class Braintree_Gateway
59
  }
60
 
61
  /**
62
- *
63
  * @return \Braintree_CreditCardVerificationGateway
64
  */
65
  public function creditCardVerification()
@@ -68,7 +68,7 @@ class Braintree_Gateway
68
  }
69
 
70
  /**
71
- *
72
  * @return \Braintree_CustomerGateway
73
  */
74
  public function customer()
@@ -77,7 +77,7 @@ class Braintree_Gateway
77
  }
78
 
79
  /**
80
- *
81
  * @return \Braintree_DiscountGateway
82
  */
83
  public function discount()
@@ -86,7 +86,7 @@ class Braintree_Gateway
86
  }
87
 
88
  /**
89
- *
90
  * @return \Braintree_MerchantGateway
91
  */
92
  public function merchant()
@@ -95,7 +95,7 @@ class Braintree_Gateway
95
  }
96
 
97
  /**
98
- *
99
  * @return \Braintree_MerchantAccountGateway
100
  */
101
  public function merchantAccount()
@@ -104,7 +104,7 @@ class Braintree_Gateway
104
  }
105
 
106
  /**
107
- *
108
  * @return \Braintree_OAuthGateway
109
  */
110
  public function oauth()
@@ -113,7 +113,7 @@ class Braintree_Gateway
113
  }
114
 
115
  /**
116
- *
117
  * @return \Braintree_PaymentMethodGateway
118
  */
119
  public function paymentMethod()
@@ -122,7 +122,7 @@ class Braintree_Gateway
122
  }
123
 
124
  /**
125
- *
126
  * @return \Braintree_PaymentMethodNonceGateway
127
  */
128
  public function paymentMethodNonce()
@@ -131,7 +131,7 @@ class Braintree_Gateway
131
  }
132
 
133
  /**
134
- *
135
  * @return \Braintree_PayPalAccountGateway
136
  */
137
  public function payPalAccount()
@@ -140,7 +140,7 @@ class Braintree_Gateway
140
  }
141
 
142
  /**
143
- *
144
  * @return \Braintree_PlanGateway
145
  */
146
  public function plan()
@@ -149,7 +149,7 @@ class Braintree_Gateway
149
  }
150
 
151
  /**
152
- *
153
  * @return \Braintree_SettlementBatchSummaryGateway
154
  */
155
  public function settlementBatchSummary()
@@ -158,7 +158,7 @@ class Braintree_Gateway
158
  }
159
 
160
  /**
161
- *
162
  * @return \Braintree_SubscriptionGateway
163
  */
164
  public function subscription()
@@ -167,7 +167,16 @@ class Braintree_Gateway
167
  }
168
 
169
  /**
170
- *
 
 
 
 
 
 
 
 
 
171
  * @return \Braintree_TransactionGateway
172
  */
173
  public function transaction()
@@ -176,7 +185,7 @@ class Braintree_Gateway
176
  }
177
 
178
  /**
179
- *
180
  * @return \Braintree_TransparentRedirectGateway
181
  */
182
  public function transparentRedirect()
23
  }
24
 
25
  /**
26
+ *
27
  * @return \Braintree_AddOnGateway
28
  */
29
  public function addOn()
32
  }
33
 
34
  /**
35
+ *
36
  * @return \Braintree_AddressGateway
37
  */
38
  public function address()
41
  }
42
 
43
  /**
44
+ *
45
  * @return \Braintree_ClientTokenGateway
46
  */
47
  public function clientToken()
50
  }
51
 
52
  /**
53
+ *
54
  * @return \Braintree_CreditCardGateway
55
  */
56
  public function creditCard()
59
  }
60
 
61
  /**
62
+ *
63
  * @return \Braintree_CreditCardVerificationGateway
64
  */
65
  public function creditCardVerification()
68
  }
69
 
70
  /**
71
+ *
72
  * @return \Braintree_CustomerGateway
73
  */
74
  public function customer()
77
  }
78
 
79
  /**
80
+ *
81
  * @return \Braintree_DiscountGateway
82
  */
83
  public function discount()
86
  }
87
 
88
  /**
89
+ *
90
  * @return \Braintree_MerchantGateway
91
  */
92
  public function merchant()
95
  }
96
 
97
  /**
98
+ *
99
  * @return \Braintree_MerchantAccountGateway
100
  */
101
  public function merchantAccount()
104
  }
105
 
106
  /**
107
+ *
108
  * @return \Braintree_OAuthGateway
109
  */
110
  public function oauth()
113
  }
114
 
115
  /**
116
+ *
117
  * @return \Braintree_PaymentMethodGateway
118
  */
119
  public function paymentMethod()
122
  }
123
 
124
  /**
125
+ *
126
  * @return \Braintree_PaymentMethodNonceGateway
127
  */
128
  public function paymentMethodNonce()
131
  }
132
 
133
  /**
134
+ *
135
  * @return \Braintree_PayPalAccountGateway
136
  */
137
  public function payPalAccount()
140
  }
141
 
142
  /**
143
+ *
144
  * @return \Braintree_PlanGateway
145
  */
146
  public function plan()
149
  }
150
 
151
  /**
152
+ *
153
  * @return \Braintree_SettlementBatchSummaryGateway
154
  */
155
  public function settlementBatchSummary()
158
  }
159
 
160
  /**
161
+ *
162
  * @return \Braintree_SubscriptionGateway
163
  */
164
  public function subscription()
167
  }
168
 
169
  /**
170
+ *
171
+ * @return \Braintree_TestingGateway
172
+ */
173
+ public function testing()
174
+ {
175
+ return new Braintree_TestingGateway($this);
176
+ }
177
+
178
+ /**
179
+ *
180
  * @return \Braintree_TransactionGateway
181
  */
182
  public function transaction()
185
  }
186
 
187
  /**
188
+ *
189
  * @return \Braintree_TransparentRedirectGateway
190
  */
191
  public function transparentRedirect()
lib/{Braintree → Gene/Braintree}/Http.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Instance.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/IsNode.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/KeyValueNode.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Merchant.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/MerchantAccount.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/MerchantAccount/AddressDetails.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/MerchantAccount/BusinessDetails.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/MerchantAccount/FundingDetails.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/MerchantAccount/IndividualDetails.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/MerchantAccountGateway.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/MerchantGateway.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Modification.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/MultipleValueNode.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/MultipleValueOrTextNode.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/OAuthCredentials.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/OAuthGateway.php RENAMED
@@ -91,12 +91,12 @@ class Braintree_OAuthGateway
91
  $queryString = preg_replace('/\%5B\d+\%5D/', '%5B%5D', http_build_query($query));
92
  $url = $this->_config->baseUrl() . '/oauth/connect?' . $queryString;
93
 
94
- return $this->signUrl($url);
95
  }
96
 
97
- private function signUrl($url)
98
  {
99
  $key = hash('sha256', $this->_config->getClientSecret(), true);
100
- return $url . '&signature=' . hash_hmac('sha256', $url, $key) . '&algorithm=SHA256';
101
  }
102
  }
91
  $queryString = preg_replace('/\%5B\d+\%5D/', '%5B%5D', http_build_query($query));
92
  $url = $this->_config->baseUrl() . '/oauth/connect?' . $queryString;
93
 
94
+ return $url . '&signature=' . $this->computeSignature($url) . '&algorithm=SHA256';
95
  }
96
 
97
+ public function computeSignature($url)
98
  {
99
  $key = hash('sha256', $this->_config->getClientSecret(), true);
100
+ return hash_hmac('sha256', $url, $key);
101
  }
102
  }
lib/{Braintree → Gene/Braintree}/PartialMatchNode.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/PartnerMerchant.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/PayPalAccount.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/PayPalAccountGateway.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/PaymentInstrumentType.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/PaymentMethod.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/PaymentMethodGateway.php RENAMED
@@ -63,6 +63,8 @@ class Braintree_PaymentMethodGateway
63
  return Braintree_ApplePayCard::factory($response['applePayCard']);
64
  } else if (isset($response['androidPayCard'])) {
65
  return Braintree_AndroidPayCard::factory($response['androidPayCard']);
 
 
66
  } else if (is_array($response)) {
67
  return Braintree_UnknownPaymentMethod::factory($response);
68
  }
@@ -213,6 +215,12 @@ class Braintree_PaymentMethodGateway
213
  Braintree_AndroidPayCard::factory($response['androidPayCard']),
214
  "paymentMethod"
215
  );
 
 
 
 
 
 
216
  } else if (isset($response['apiErrorResponse'])) {
217
  return new Braintree_Result_Error($response['apiErrorResponse']);
218
  } else if (is_array($response)) {
63
  return Braintree_ApplePayCard::factory($response['applePayCard']);
64
  } else if (isset($response['androidPayCard'])) {
65
  return Braintree_AndroidPayCard::factory($response['androidPayCard']);
66
+ } else if (isset($response['europeBankAccount'])) {
67
+ return Braintree_EuropeBankAccount::factory($response['europeBankAccount']);
68
  } else if (is_array($response)) {
69
  return Braintree_UnknownPaymentMethod::factory($response);
70
  }
215
  Braintree_AndroidPayCard::factory($response['androidPayCard']),
216
  "paymentMethod"
217
  );
218
+ } else if (isset($response['europeBankAccount'])) {
219
+ // return a populated instance of Braintree_EuropeBankAccount
220
+ return new Braintree_Result_Successful(
221
+ Braintree_EuropeBankAccount::factory($response['europeBankAccount']),
222
+ "paymentMethod"
223
+ );
224
  } else if (isset($response['apiErrorResponse'])) {
225
  return new Braintree_Result_Error($response['apiErrorResponse']);
226
  } else if (is_array($response)) {
lib/{Braintree → Gene/Braintree}/PaymentMethodNonce.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/PaymentMethodNonceGateway.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Plan.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/PlanGateway.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/RangeNode.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/ResourceCollection.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Result/CreditCardVerification.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Result/Error.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Result/Successful.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/RiskData.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/SettlementBatchSummary.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/SettlementBatchSummaryGateway.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/SignatureService.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Subscription.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Subscription/StatusDetails.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/SubscriptionGateway.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/SubscriptionSearch.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Test/CreditCardNumbers.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Test/MerchantAccount.php RENAMED
File without changes
lib/Gene/Braintree/Test/Nonces.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Nonces used for testing purposes
4
+ *
5
+ * @package Braintree
6
+ * @subpackage Test
7
+ * @copyright 2014 Braintree, a division of PayPal, Inc.
8
+ */
9
+
10
+ /**
11
+ * Nonces used for testing purposes
12
+ *
13
+ * The constants in this class can be used to perform nonce operations
14
+ * with the desired status in the sandbox environment.
15
+ *
16
+ * @package Braintree
17
+ * @subpackage Test
18
+ * @copyright 2014 Braintree, a division of PayPal, Inc.
19
+ */
20
+ class Braintree_Test_Nonces
21
+ {
22
+ public static $transactable = "fake-valid-nonce";
23
+ public static $consumed = "fake-consumed-nonce";
24
+ public static $paypalOneTimePayment = "fake-paypal-one-time-nonce";
25
+ public static $paypalFuturePayment = "fake-paypal-future-nonce";
26
+ public static $paypalBillingAgreement = "fake-paypal-billing-agreement-nonce";
27
+ public static $applePayVisa = "fake-apple-pay-visa-nonce";
28
+ public static $applePayMasterCard = "fake-apple-pay-visa-nonce";
29
+ public static $applePayAmEx = "fake-apple-pay-amex-nonce";
30
+ public static $androidPay = "fake-android-pay-nonce";
31
+ public static $androidPayDiscover = "fake-android-pay-discover-nonce";
32
+ public static $androidPayVisa = "fake-android-pay-visa-nonce";
33
+ public static $androidPayMasterCard = "fake-android-pay-mastercard-nonce";
34
+ public static $androidPayAmEx = "fake-android-pay-amex-nonce";
35
+ public static $abstractTransactable = "fake-abstract-transactable-nonce";
36
+ public static $europe = "fake-europe-bank-account-nonce";
37
+ public static $coinbase = "fake-coinbase-nonce";
38
+ public static $transactableVisa = "fake-valid-visa-nonce";
39
+ public static $transactableAmEx = "fake-valid-amex-nonce";
40
+ public static $transactableMasterCard = "fake-valid-mastercard-nonce";
41
+ public static $transactableDiscover = "fake-valid-discover-nonce";
42
+ public static $transactableJCB = "fake-valid-jcb-nonce";
43
+ public static $transactableMaestro = "fake-valid-maestro-nonce";
44
+ public static $transactableDinersClub = "fake-valid-dinersclub-nonce";
45
+ public static $transactablePrepaid = "fake-valid-prepaid-nonce";
46
+ public static $transactableCommercial = "fake-valid-commercial-nonce";
47
+ public static $transactableDurbinRegulated = "fake-valid-durbin-regulated-nonce";
48
+ public static $transactableHealthcare = "fake-valid-healthcare-nonce";
49
+ public static $transactableDebit = "fake-valid-debit-nonce";
50
+ public static $transactablePayroll = "fake-valid-payroll-nonce";
51
+ public static $transactableNoIndicators = "fake-valid-no-indicators-nonce";
52
+ public static $transactableUnknownIndicators = "fake-valid-unknown-indicators-nonce";
53
+ public static $transactableCountryOfIssuanceUSA = "fake-valid-country-of-issuance-usa-nonce";
54
+ public static $transactableCountryOfIssuanceCAD = "fake-valid-country-of-issuance-cad-nonce";
55
+ public static $transactableIssuingBankNetworkOnly = "fake-valid-issuing-bank-network-only-nonce";
56
+ public static $processorDeclinedVisa = "fake-processor-declined-visa-nonce";
57
+ public static $processorDeclinedMasterCard = "fake-processor-declined-mastercard-nonce";
58
+ public static $processorDeclinedAmEx = "fake-processor-declined-amex-nonce";
59
+ public static $processorDeclinedDiscover = "fake-processor-declined-discover-nonce";
60
+ public static $processorFailureJCB = "fake-processor-failure-jcb-nonce";
61
+ public static $luhnInvalid = "fake-luhn-invalid-nonce";
62
+ public static $paypalFuturePaymentRefreshToken = "fake-paypal-future-refresh-token-nonce";
63
+ public static $sepa = "fake-sepa-bank-account-nonce";
64
+ public static $gatewayRejectedFraud = "fake-gateway-rejected-fraud-nonce";
65
+ }
lib/Gene/Braintree/Test/Transaction.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ final class Braintree_Test_Transaction
3
+ {
4
+ /**
5
+ * settle a transaction by id in sandbox
6
+ *
7
+ * @param string $id transaction id
8
+ * @param Braintree_Configuration $config gateway config
9
+ * @return object Braintree_Transaction
10
+ */
11
+ public static function settle($transactionId)
12
+ {
13
+ return Braintree_Configuration::gateway()->testing()->settle($transactionId);
14
+ }
15
+
16
+ /**
17
+ * settlement confirm a transaction by id in sandbox
18
+ *
19
+ * @param string $id transaction id
20
+ * @param Braintree_Configuration $config gateway config
21
+ * @return object Braintree_Transaction
22
+ */
23
+ public static function settlementConfirm($transactionId)
24
+ {
25
+ return Braintree_Configuration::gateway()->testing()->settlementConfirm($transactionId);
26
+ }
27
+
28
+ /**
29
+ * settlement decline a transaction by id in sandbox
30
+ *
31
+ * @param string $id transaction id
32
+ * @param Braintree_Configuration $config gateway config
33
+ * @return object Braintree_Transaction
34
+ */
35
+ public static function settlementDecline($transactionId)
36
+ {
37
+ return Braintree_Configuration::gateway()->testing()->settlementDecline($transactionId);
38
+ }
39
+
40
+ /**
41
+ * settlement pending a transaction by id in sandbox
42
+ *
43
+ * @param string $id transaction id
44
+ * @param Braintree_Configuration $config gateway config
45
+ * @return object Braintree_Transaction
46
+ */
47
+ public static function settlementPending($transactionId)
48
+ {
49
+ return Braintree_Configuration::gateway()->testing()->settlementPending($transactionId);
50
+ }
51
+ }
lib/{Braintree → Gene/Braintree}/Test/TransactionAmounts.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Test/VenmoSdk.php RENAMED
File without changes
lib/Gene/Braintree/TestingGateway.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ final class Braintree_TestingGateway
3
+ {
4
+ private $_gateway;
5
+ private $_config;
6
+ private $_http;
7
+
8
+ public function __construct($gateway)
9
+ {
10
+ $this->_gateway = $gateway;
11
+ $this->_config = $gateway->config;
12
+ $this->_http = new Braintree_Http($this->_config);
13
+ }
14
+
15
+ public function settle($transactionId)
16
+ {
17
+ return self::_doTestRequest('/settle', $transactionId);
18
+ }
19
+
20
+ public function settlementPending($transactionId)
21
+ {
22
+ return self::_doTestRequest('/settlement_pending', $transactionId);
23
+ }
24
+
25
+ public function settlementConfirm($transactionId)
26
+ {
27
+ return self::_doTestRequest('/settlement_confirm', $transactionId);
28
+ }
29
+
30
+ public function settlementDecline($transactionId)
31
+ {
32
+ return self::_doTestRequest('/settlement_decline', $transactionId);
33
+ }
34
+
35
+ private function _doTestRequest($testPath, $transactionId)
36
+ {
37
+ self::_checkEnvironment();
38
+ $path = $this->_config->merchantPath() . '/transactions/' . $transactionId . $testPath;
39
+ $response = $this->_http->put($path);
40
+ return Braintree_Transaction::factory($response['transaction']);
41
+ }
42
+
43
+ private function _checkEnvironment()
44
+ {
45
+ if (Braintree_Configuration::$global->getEnvironment() == 'production') {
46
+ throw new Braintree_Exception_TestOperationPerformedInProduction();
47
+ }
48
+ }
49
+ }
lib/{Braintree → Gene/Braintree}/TextNode.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/ThreeDSecureInfo.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Transaction.php RENAMED
@@ -164,6 +164,7 @@
164
  * @property-read string $updatedAt transaction updated timestamp
165
  * @property-read object $disbursementDetails populated when transaction is disbursed
166
  * @property-read object $disputes populated when transaction is disputed
 
167
  *
168
  */
169
 
@@ -183,6 +184,7 @@ final class Braintree_Transaction extends Braintree_Base
183
  const UNRECOGNIZED = 'unrecognized';
184
  const SETTLEMENT_DECLINED = 'settlement_declined';
185
  const SETTLEMENT_PENDING = 'settlement_pending';
 
186
 
187
  // Transaction Escrow Status
188
  const ESCROW_HOLD_PENDING = 'hold_pending';
@@ -261,6 +263,14 @@ final class Braintree_Transaction extends Braintree_Base
261
  );
262
  }
263
 
 
 
 
 
 
 
 
 
264
  if (isset($transactionAttribs['paypal'])) {
265
  $this->_set('paypalDetails',
266
  new Braintree_Transaction_PayPalDetails(
164
  * @property-read string $updatedAt transaction updated timestamp
165
  * @property-read object $disbursementDetails populated when transaction is disbursed
166
  * @property-read object $disputes populated when transaction is disputed
167
+ * @property-read string $amexRewardsResponse AmEx Rewards response
168
  *
169
  */
170
 
184
  const UNRECOGNIZED = 'unrecognized';
185
  const SETTLEMENT_DECLINED = 'settlement_declined';
186
  const SETTLEMENT_PENDING = 'settlement_pending';
187
+ const SETTLEMENT_CONFIRMED = 'settlement_confirmed';
188
 
189
  // Transaction Escrow Status
190
  const ESCROW_HOLD_PENDING = 'hold_pending';
263
  );
264
  }
265
 
266
+ if (isset($transactionAttribs['europeBankAccount'])) {
267
+ $this->_set('europeBankAccount',
268
+ new Braintree_Transaction_EuropeBankAccountDetails(
269
+ $transactionAttribs['europeBankAccount']
270
+ )
271
+ );
272
+ }
273
+
274
  if (isset($transactionAttribs['paypal'])) {
275
  $this->_set('paypalDetails',
276
  new Braintree_Transaction_PayPalDetails(
lib/{Braintree → Gene/Braintree}/Transaction/AddressDetails.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Transaction/AndroidPayCardDetails.php RENAMED
@@ -23,6 +23,7 @@
23
  * @property-read string $imageUrl
24
  * @property-read string $sourceCardLast4
25
  * @property-read string $sourceCardType
 
26
  * @property-read string $token
27
  * @property-read string $virtualCardLast4
28
  * @property-read string $virtualCardType
23
  * @property-read string $imageUrl
24
  * @property-read string $sourceCardLast4
25
  * @property-read string $sourceCardType
26
+ * @property-read string $sourceDescription
27
  * @property-read string $token
28
  * @property-read string $virtualCardLast4
29
  * @property-read string $virtualCardType
lib/{Braintree → Gene/Braintree}/Transaction/ApplePayCardDetails.php RENAMED
@@ -20,6 +20,7 @@
20
  * @property-read string $expirationMonth
21
  * @property-read string $expirationYear
22
  * @property-read string $cardholderName
 
23
  * @uses Braintree_Instance inherits methods
24
  */
25
  class Braintree_Transaction_ApplePayCardDetails extends Braintree_Instance
20
  * @property-read string $expirationMonth
21
  * @property-read string $expirationYear
22
  * @property-read string $cardholderName
23
+ * @property-read string $sourceDescription
24
  * @uses Braintree_Instance inherits methods
25
  */
26
  class Braintree_Transaction_ApplePayCardDetails extends Braintree_Instance
lib/{Braintree → Gene/Braintree}/Transaction/CoinbaseDetails.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Transaction/CreditCardDetails.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Transaction/CustomerDetails.php RENAMED
File without changes
lib/Gene/Braintree/Transaction/EuropeBankAccountDetails.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Europe bank account details from a transaction
4
+ * Creates an instance of europe bank account details as returned from a transaction
5
+ *
6
+ * @package Braintree
7
+ * @subpackage Transaction
8
+ * @copyright 2014 Braintree, a division of PayPal, Inc.
9
+ *
10
+ * @property-read string $accountHolderName
11
+ * @property-read string $bic
12
+ * @property-read string $imageUrl
13
+ * @property-read string $mandateAcceptedAt
14
+ * @property-read string $mandateReferenceNumber
15
+ * @property-read string $maskedIban
16
+ * @property-read string $token
17
+ * @uses Braintree_Instance inherits methods
18
+ */
19
+ class Braintree_Transaction_EuropeBankAccountDetails extends Braintree_Instance
20
+ {
21
+ }
lib/{Braintree → Gene/Braintree}/Transaction/PayPalDetails.php RENAMED
@@ -20,6 +20,9 @@
20
  * @property-read string $authorizationId
21
  * @property-read string $token
22
  * @property-read string $imageUrl
 
 
 
23
  * @uses Braintree_Instance inherits methods
24
  */
25
  class Braintree_Transaction_PayPalDetails extends Braintree_Instance
20
  * @property-read string $authorizationId
21
  * @property-read string $token
22
  * @property-read string $imageUrl
23
+ * @property-read string $transactionFeeAmount
24
+ * @property-read string $transactionFeeCurrencyIsoCode
25
+ * @property-read string $description
26
  * @uses Braintree_Instance inherits methods
27
  */
28
  class Braintree_Transaction_PayPalDetails extends Braintree_Instance
lib/{Braintree → Gene/Braintree}/Transaction/StatusDetails.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Transaction/SubscriptionDetails.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/TransactionGateway.php RENAMED
@@ -158,7 +158,16 @@ final class Braintree_TransactionGateway
158
  array('paypal' =>
159
  array(
160
  'payeeEmail',
161
- 'customField'
 
 
 
 
 
 
 
 
 
162
  )
163
  )
164
  ),
@@ -167,6 +176,7 @@ final class Braintree_TransactionGateway
167
  ),
168
  array('descriptor' => array('name', 'phone', 'url')),
169
  array('paypalAccount' => array('payeeEmail')),
 
170
  array('industry' =>
171
  array('industryType',
172
  array('data' =>
158
  array('paypal' =>
159
  array(
160
  'payeeEmail',
161
+ 'customField',
162
+ 'description'
163
+ )
164
+ ),
165
+ array('amexRewards' =>
166
+ array(
167
+ 'requestId',
168
+ 'points',
169
+ 'currencyAmount',
170
+ 'currencyIsoCode'
171
  )
172
  )
173
  ),
176
  ),
177
  array('descriptor' => array('name', 'phone', 'url')),
178
  array('paypalAccount' => array('payeeEmail')),
179
+ array('apple_pay_card' => array('number', 'cardholder_name', 'cryptogram', 'expiration_month', 'expiration_year')),
180
  array('industry' =>
181
  array('industryType',
182
  array('data' =>
lib/{Braintree → Gene/Braintree}/TransactionSearch.php RENAMED
@@ -28,6 +28,7 @@ class Braintree_TransactionSearch
28
  static function customerWebsite() { return new Braintree_TextNode('customer_website'); }
29
  static function disbursementDate() { return new Braintree_RangeNode("disbursementDate"); }
30
  static function disputeDate() { return new Braintree_RangeNode("disputeDate"); }
 
31
  static function failedAt() { return new Braintree_RangeNode("failedAt"); }
32
  static function gatewayRejectedAt() { return new Braintree_RangeNode("gatewayRejectedAt"); }
33
  static function id() { return new Braintree_TextNode('id'); }
28
  static function customerWebsite() { return new Braintree_TextNode('customer_website'); }
29
  static function disbursementDate() { return new Braintree_RangeNode("disbursementDate"); }
30
  static function disputeDate() { return new Braintree_RangeNode("disputeDate"); }
31
+ static function europeBankAccountIban() { return new Braintree_TextNode("europeBankAccountIban"); }
32
  static function failedAt() { return new Braintree_RangeNode("failedAt"); }
33
  static function gatewayRejectedAt() { return new Braintree_RangeNode("gatewayRejectedAt"); }
34
  static function id() { return new Braintree_TextNode('id'); }
lib/{Braintree → Gene/Braintree}/TransparentRedirect.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/TransparentRedirectGateway.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/UnknownPaymentMethod.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Util.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Version.php RENAMED
@@ -11,7 +11,7 @@ final class Braintree_Version
11
  * class constants
12
  */
13
  const MAJOR = 3;
14
- const MINOR = 2;
15
  const TINY = 0;
16
 
17
  /**
11
  * class constants
12
  */
13
  const MAJOR = 3;
14
+ const MINOR = 5;
15
  const TINY = 0;
16
 
17
  /**
lib/{Braintree → Gene/Braintree}/WebhookNotification.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/WebhookTesting.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Xml.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Xml/Generator.php RENAMED
File without changes
lib/{Braintree → Gene/Braintree}/Xml/Parser.php RENAMED
File without changes
lib/{ssl → Gene/ssl}/api_braintreegateway_com.ca.crt RENAMED
File without changes
lib/{ssl → Gene/ssl}/sandbox_braintreegateway_com.ca.crt RENAMED
File without changes
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Gene_Braintree</name>
4
- <version>1.0.5.4</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/mit-license.php">MIT License</license>
7
  <channel>community</channel>
@@ -9,36 +9,36 @@
9
  <summary>Connect your Magento store to Braintree to accept Credit Cards &amp;amp; PayPal using V.Zero SDK</summary>
10
  <description>From your first payment to your billionth.&#xD;
11
  &#xD;
12
- Since the beginning, Braintree had one focus: provide the best tools for accepting payments. That mission began with a secure API and an amazing support team. Braintree v.zero sdk is the new cross platform way to integrate with Braintree.&#xD;
13
  &#xD;
14
- This Magento extension is easy to install and configure and will allow you to get up and running with Braintree easily and quickly.&#xD;
15
  &#xD;
16
- It works out-of the box with the latest Magento responsive default checkout and has been tested against the most popular checkout extensions from IWD and Amasty. Configuration into custom checkout templates is also very straightforward.&#xD;
17
  &#xD;
18
- Easily add PayPal to your checkout. We've built the best PayPal integration around. All you need is a PayPal Business account and a few minutes and you'll pave the way for 152 million customers. Say goodbye to those IPN issues.&#xD;
19
  &#xD;
20
- &lt;h3&gt;Features&lt;/h3&gt;&#xD;
21
- &lt;ul&gt;&#xD;
22
- &lt;li&gt;Process online credit card and debit card transactions from the Magento storefront and Admin Panel via the V.Zero SDK.&lt;/li&gt;&#xD;
23
- &lt;li&gt;Secure storage of customer payment details in the PCI-compliant Braintree Vault&lt;/li&gt;&#xD;
24
- &lt;li&gt;Stored payment detail management &#x2013; customers can add and delete cards &amp; paypal accounts&lt;/li&gt;&#xD;
25
- &lt;li&gt;Supports multi-merchant and multi-currency Magento instances, including the Magento currency switcher&lt;/li&gt;&#xD;
26
- &lt;li&gt;Provides advanced Braintree fraud protection&lt;/li&gt;&#xD;
27
- &lt;li&gt;Integrated with Kount's fraud and risk management solution&lt;/li&gt;&#xD;
28
- &lt;li&gt;3D secure configuration&lt;/li&gt;&#xD;
29
- &lt;li&gt;Ability to partially capture transactions&lt;/li&gt;&#xD;
30
- &lt;li&gt;Ability to configure the capture action either by invoice or by shipment&lt;/li&gt;&#xD;
31
- &lt;li&gt;Ability to configure the sales action to Authorize only or Authorize and Capture at once&lt;/li&gt;&#xD;
32
- &lt;li&gt;Card auto-detection on storefront&lt;/li&gt;&#xD;
33
- &lt;li&gt;Integration into PayPal through the Braintree Gateway&lt;/li&gt;&#xD;
34
- &lt;li&gt;Sandbox testing environment&lt;/li&gt;&#xD;
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>magento@gene.co.uk</email></author></authors>
39
- <date>2016-02-15</date>
40
- <time>12:25:35</time>
41
- <contents><target name="magecommunity"><dir name="Gene"><dir name="Braintree"><dir name="Block"><dir name="Adminhtml"><dir name="Report"><dir name="Transactions"><file name="Grid.php" hash="32b32086548f62ae4aca4baf456b9ed2"/><file name="Search.php" hash="81d57c3744530f36c37782ce9d0f3a70"/></dir><file name="Transactions.php" hash="7afe45b49353e52b432aa0392d76a08e"/></dir><dir name="System"><dir name="Config"><dir name="Braintree"><file name="Config.php" hash="eaaf6c74be4233a315d5aa5932f7c9ca"/><file name="Currency.php" hash="9ffa8a2ded53be75e88a60a024883b07"/><file name="Moduleversion.php" hash="fe3836bde24bb31c4c4585f2cd2f20ed"/><file name="Version.php" hash="ce58278a4faf965301cc2d8b2da4483c"/></dir></dir></dir></dir><dir name="Cart"><file name="Totals.php" hash="a03c441e8143896f92d02931a809f666"/></dir><dir name="Creditcard"><file name="Info.php" hash="6faf4be87ad62f13373a6b2e852a478b"/><file name="Threedsecure.php" hash="7848d4ecac743be985f328fa969318bf"/></dir><file name="Creditcard.php" hash="3d9dd20d9617a891084950f9a8aa1309"/><file name="Info.php" hash="4d9513f53e20bf7752c1f826bbd63b0e"/><file name="Js.php" hash="cef4a5a297b95969b882d42c04773a69"/><dir name="Paypal"><file name="Info.php" hash="0874c0839a27c14ec9be47fed152e880"/></dir><file name="Paypal.php" hash="b507a5f3340e3cc06ffba03d07ff87cd"/><file name="Saved.php" hash="782f17589219da087e57035a1c0b9a4a"/></dir><dir name="Helper"><file name="Data.php" hash="4dfe4c3a7f186640c77b79cedf273f76"/></dir><dir name="Model"><file name="Debug.php" hash="f3360f71e2346881f93424792ed9f209"/><file name="Observer.php" hash="b2486212947330ce2e5c8d84f725a90c"/><dir name="Paymentmethod"><file name="Abstract.php" hash="0bd5c8409d4dad2c24368891af67b7a3"/><file name="Creditcard.php" hash="19c99d48f960eb0e4fcba5edf062d208"/><file name="Paypal.php" hash="24a0f9dbe319be0c49cbf2837fd70850"/></dir><file name="Saved.php" hash="b0ed5312b1e5efa93eb4bfc82bef8892"/><dir name="Source"><file name="Cctype.php" hash="d76aa6c3a4bd798e3a47695f579d21d4"/><dir name="Creditcard"><file name="CaptureAction.php" hash="6444cfc430de44f06e85bd9c8b80d77b"/><file name="FormIntegration.php" hash="4f137002a98c8f1f352b02abc4506b3b"/><file name="PaymentAction.php" hash="a2f3f3d36a98df4d12f76b6ab77f9c47"/></dir><file name="Environment.php" hash="02567d2ddba74d06ac000b4ddb12723a"/><dir name="Paypal"><file name="Locale.php" hash="adc0ab30619eb3a34d8f5fe1087b07b0"/><file name="Paymenttype.php" hash="fe1fe4ee89d5b7a87c7c28716bb2f1cb"/></dir></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Currency.php" hash="73cb15b1de303e88c487db4c585ef94e"/></dir></dir></dir><dir name="Wrapper"><file name="Braintree.php" hash="1f723e134bee735228dd517a2b096d93"/></dir><file name=".DS_Store" hash="cc4c7586697ffb0a3228c23a17787dc8"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="BraintreeController.php" hash="7c621fa1548c04e24bb1136bcbbe1d72"/></dir><file name="CheckoutController.php" hash="02a35bc3ccacba6ba820842508835569"/><file name="SavedController.php" hash="036e97703c853a5bae064dd7cf5030a8"/></dir><dir name="etc"><file name="adminhtml.xml" hash="c9c940beffa0ec19e4a1499a66f7fd12"/><file name="config.xml" hash="584f8e8d664c6c73da1f0a65af41a1c0"/><file name="system.xml" hash="cf2637e8e86ebe0ef58c1e3c7200a21b"/></dir><dir name="sql"><dir name="gene_braintree_setup"><file name="install-0.1.0.php" hash="7ef62b7c19b9da5990974da6edb3e77c"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="gene"><file name="braintree.xml" hash="7651f0c08130f09fb52780833bb0b8bc"/></dir></dir><dir name="template"><dir name="gene"><dir name="braintree"><dir name="creditcard"><file name="hostedfields.phtml" hash="10757415338b805700d36b25296c90c5"/><file name="info.phtml" hash="2ae1e397b3a633dd305bc26c7b9c1065"/><file name="threedsecure.phtml" hash="ee8ad689afde041c39dd92ffa5274883"/></dir><file name="creditcard.phtml" hash="e019b6da4d3c50fbc570d446b18962c5"/><dir name="customer"><file name="methods.phtml" hash="eb5e2d8f4a0f419fcf720c12062f808a"/><file name="saved.phtml" hash="691162b89ed085599f76072226ca2307"/></dir><dir name="js"><file name="aheadworks.phtml" hash="c024bdbf79bfb5dda71ad6acbbcb58d1"/><file name="amasty.phtml" hash="905800a115f06a681a1d31cb0696b2d7"/><file name="data.phtml" hash="f8b04e3d0d7154cc75332eb5bec3e54e"/><file name="default.phtml" hash="d2375da07bf8f1d50f5b38ba8fab70aa"/><file name="firecheckout.phtml" hash="483541347c83ad3b5466d897ee155471"/><file name="fme.phtml" hash="d80dc389a6936c37642e9ad5d0a9ee4c"/><file name="idev.phtml" hash="54358bd2916ca3e5c705b8a63d8b1373"/><file name="iwd.phtml" hash="48474604fe3b0a3923f77a0ebd82ef70"/><file name="magestore.phtml" hash="9d15ccd68804eb72a5db280793922668"/><file name="multishipping.phtml" hash="b3464d35f42fca64b41b1b085548bcb6"/><file name="oye.phtml" hash="dd728b78f535c9a1d81d77d2ca2bb0f5"/><file name="setup.phtml" hash="f39b3e066b1c1eef36834d41b59174f7"/><file name="unicode.phtml" hash="caeae3b5031ee8539185f78fd4554765"/></dir><dir name="paypal"><file name="info.phtml" hash="5149b273730121e4dec3c3179820f747"/></dir><file name="paypal.phtml" hash="c81c90096517a5a844306345b3c648ca"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="gene"><file name="braintree.xml" hash="d46837b097a58abb640376057ca14596"/></dir></dir><dir name="template"><dir name="gene"><dir name="braintree"><dir name="creditcard"><file name="hostedfields.phtml" hash="3e835a116317449620a90964d2b34b5e"/><file name="info.phtml" hash="24c67bab482ea7383ce57d9a06bb9d6f"/></dir><file name="creditcard.phtml" hash="e95b7ff1b2db6ed33190b879ad547a45"/><file name="js.phtml" hash="4f547da52ab1888485cea4f376aa9d5a"/><dir name="paypal"><file name="info.phtml" hash="a8f92f312f8aa5a9463f1d5c2a38cd1b"/></dir><dir name="transactions"><file name="index.phtml" hash="1791b6393f319616dd79c0b46e391847"/><file name="search.phtml" hash="1682ce6200681681f0ce3c848e2e6694"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Gene_Braintree.xml" hash="8c0ffda8566dca2f0b98a999921e3e55"/></dir></target><target name="mageweb"><dir name="js"><dir name="gene"><dir name="braintree"><file name="braintree-0.1.js" hash="a72cc4545d0d01dd0947dae1474516dd"/><file name="config.codekit" hash="ae566568bb3325d2eefda5315da4a2be"/><file name="vzero-0.7-min.js" hash="bc98b0f8c9f48a765a702bbfa4b7263e"/><file name="vzero-0.7-min.js.map" hash="409035d8fb3405504d0d80e530fdc240"/><file name="vzero-0.7.js" hash="58cacde99c5171114fa25a8716d5f33e"/></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="gene"><dir name="braintree"><file name="AE.png" hash="6b6f405105413b0723a62ee498f88bf6"/><file name="DI.png" hash="d8e3c3022dda9e723f466b8976ae428f"/><file name="JCB.png" hash="3aa9a71ed8a1d6610bbe0dfe2040e29e"/><file name="MC.png" hash="1fcd14928245139962b72f9368bdbe32"/><file name="ME.png" hash="b9389913c47b9546a67f907fcca73706"/><file name="PP.png" hash="b4946bccba574e86c9716a4986e21c36"/><file name="VI.png" hash="c9f74d1d54e61ab2c748f45a4bdface0"/><file name="card.png" hash="66e16f8c573fad93bb0d62258dce28bb"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir></dir></dir><dir name="css"><dir name="gene"><dir name="braintree"><file name="aheadworks.css" hash="6a9d989e354e4069c1a93301460e4151"/><file name="amasty.css" hash="4c7d73736d10dd1d6be077c091e6511d"/><file name="default.css" hash="17035148ee7da331e11f321f8962536b"/><file name="firecheckout.css" hash="9cd93a2534ca4dc6d049c4146bee4f25"/><file name="fme.css" hash="4301ab44b4acf26ece94ccc99f10adf1"/><file name="idev.css" hash="542423bbb2c61c09331717808cd8c841"/><file name="iwd.css" hash="3774db6ec06341de440a5c73b04ca488"/><file name="magestore.css" hash="47bc1ec7b9bd6ac0cf44f0711bf950a9"/><file name="oye.css" hash="33157880b52f3f67d1203d2eb5e8e343"/><file name="unicode.css" hash="582421c71dbcd123916cb35c4c0d2618"/></dir></dir></dir></dir></dir></dir></target><target name="magelib"><dir name="Braintree"><file name="AddOn.php" hash="e8bbb6db343ba99192346b1dcbf45677"/><file name="AddOnGateway.php" hash="d8698ffe89c01fba78a8a06a2fc68122"/><file name="Address.php" hash="004d3d36d39fc6fcc3d510f4b15b1fca"/><file name="AddressGateway.php" hash="41b5a3be7bdb2fe326a49a1554e1b0c3"/><file name="AndroidPayCard.php" hash="7a1de1da0aa0733277a87b75307bb201"/><file name="ApplePayCard.php" hash="06eea10b110792c18d692e482445ffe4"/><file name="Base.php" hash="60d52fd1bef5655bcb607fba45bb4c1c"/><file name="ClientToken.php" hash="358c0a1dba687baf635db818cb7d1dac"/><file name="ClientTokenGateway.php" hash="6f2259a51415a779a072719288811c16"/><file name="CoinbaseAccount.php" hash="ee5cb6963f675a9a71293c453b128866"/><file name="Collection.php" hash="0e7d31ffcbd9780fb554186bd2c194b0"/><file name="Configuration.php" hash="cce5e6b7e215c73767127d3d8441cc8f"/><file name="CredentialsParser.php" hash="c4bb2248a33129d8523a6120ce44108b"/><file name="CreditCard.php" hash="d32b8d8e64b2d046d3d9e4f00c67f1ed"/><file name="CreditCardGateway.php" hash="0d120ed06f06fd614468d6e3f0ad22d2"/><file name="CreditCardVerification.php" hash="48d6ea546914278f4bea2fefb75e7836"/><file name="CreditCardVerificationGateway.php" hash="6a07430c9437f6e6c1516d5b4572a749"/><file name="CreditCardVerificationSearch.php" hash="18efe7d508c2bd5fea1c0e68fc26182f"/><file name="Customer.php" hash="62d0937de86f7a14a512ad66edba7569"/><file name="CustomerGateway.php" hash="1232a22dd6de6ad1446c6fbb9b0f79c3"/><file name="CustomerSearch.php" hash="8aacc83dac341cd9afec5a3deab17593"/><file name="Descriptor.php" hash="3f5db5e817280ce7f2fa18a205281ad9"/><file name="Digest.php" hash="9d12d067770f55b123b8498fce4478fa"/><file name="Disbursement.php" hash="ad122f0f33b27dfd98bcdd38ea138ae4"/><file name="DisbursementDetails.php" hash="ae632207d0982e288a83aed401c880d9"/><file name="Discount.php" hash="763b3f9cde0ff3af3e8795cac4097595"/><file name="DiscountGateway.php" hash="47796edb8ac2fa68e9af8fb8a13aacb1"/><dir name="Dispute"><file name="TransactionDetails.php" hash="7fdea673a1295055508f42286ad57f4e"/></dir><file name="Dispute.php" hash="c3a4e93fa2b3b0e20ddcb593dcdc7b2b"/><file name="EqualityNode.php" hash="cfd6aa184186233b8d6d1ec0f0e79298"/><dir name="Error"><file name="Codes.php" hash="a7f98ff690e725b7fcd198b4b22d0637"/><file name="ErrorCollection.php" hash="e28d638db56524f5bf3609fa725e6d55"/><file name="Validation.php" hash="bf4e2198300019c52ba56f16269d66ce"/><file name="ValidationErrorCollection.php" hash="9ef25d0126a0b4f6951da5334ae6f0dc"/></dir><dir name="Exception"><file name="Authentication.php" hash="f9e13654988452cca2ac5228a80adae4"/><file name="Authorization.php" hash="5f8c017c6e9fd79a556dade8e15a72e8"/><file name="Configuration.php" hash="b50f67e8ea36cff0d9f6ad718126c6fc"/><file name="DownForMaintenance.php" hash="7fd30b1f8976ed7e38b7e9fae5c20f03"/><file name="ForgedQueryString.php" hash="6884dbae1e86767834b77c821df2db62"/><file name="InvalidChallenge.php" hash="1c283a1c9dac65feb137594d0dcf0e35"/><file name="InvalidSignature.php" hash="b83f5b16735cb3a8e0a8111c4f32711e"/><file name="NotFound.php" hash="f832f771d20b381c2780eb2a572b9f44"/><file name="SSLCaFileNotFound.php" hash="e927c7307bf1761814dc8a755238070d"/><file name="SSLCertificate.php" hash="d509b6a6206bd7c5563ac142dfe3801f"/><file name="ServerError.php" hash="b4645290229ab228a257047d08ef63d7"/><file name="Unexpected.php" hash="01ea2800fb91995ec2a15aee5024611e"/><file name="UpgradeRequired.php" hash="7f40b174df891cc3b3e206d1be884a58"/><file name="ValidationsFailed.php" hash="cd2d30c69911f81b55279c3d6bf88c61"/></dir><file name="Exception.php" hash="f14c94bf67206184eb3e4e7aeb4a608a"/><file name="Gateway.php" hash="103156f5646a8193ed548405f5ac476f"/><file name="Http.php" hash="1baa32e0efcae13c4d6294d1233512a1"/><file name="Instance.php" hash="f0603b3f9213b53687e079c5621ac8f3"/><file name="IsNode.php" hash="e4b1f7bbfcbd24b1d08b97f94df592be"/><file name="KeyValueNode.php" hash="255595ec01a16906dd0c49faf67d9efb"/><file name="Merchant.php" hash="5053ebe889c854d11f2686bffdeb58be"/><dir name="MerchantAccount"><file name="AddressDetails.php" hash="1d265d864a884ebcf2504f55207cc0dd"/><file name="BusinessDetails.php" hash="3e80148bac9fda676844aa19d5b2dc28"/><file name="FundingDetails.php" hash="7368f653fcbcc3d87924447b1763e616"/><file name="IndividualDetails.php" hash="777b6f28f643e78616c7ed753a39c0cd"/></dir><file name="MerchantAccount.php" hash="496c93182d824bb2967cc9366dec1ac3"/><file name="MerchantAccountGateway.php" hash="e2073aff6f8b3c5f2e64b23b210c44f7"/><file name="MerchantGateway.php" hash="e0a2e3a28c68dac8bd082973b269ed1b"/><file name="Modification.php" hash="0abe992d4f821327f617ca883c4eb2d1"/><file name="MultipleValueNode.php" hash="92700fa03011eaa9561010b3a160449c"/><file name="MultipleValueOrTextNode.php" hash="ef06bac18e2bc40974bdc0bcb854890f"/><file name="OAuthCredentials.php" hash="e992dca9dfedb27e3d050af55971a968"/><file name="OAuthGateway.php" hash="e2e238d067f43c0f28fcb25c2de4a274"/><file name="PartialMatchNode.php" hash="370c7e0ab8a445cfeef6b19ef1755f4d"/><file name="PartnerMerchant.php" hash="bdb69ebdc75d67009710be9703a47e80"/><file name="PayPalAccount.php" hash="672a7d424f94e590c5e66a21e62d7bc2"/><file name="PayPalAccountGateway.php" hash="d73f5744ebaca6cc882c42d0e9c1a05e"/><file name="PaymentInstrumentType.php" hash="be97a30c7d8fbbb180864dc4efea71f2"/><file name="PaymentMethod.php" hash="5bc31d3e97610e7218c95aba2422cc9a"/><file name="PaymentMethodGateway.php" hash="1ce13a8b1ec93cf32b8029c55ea26fa2"/><file name="PaymentMethodNonce.php" hash="e99302e2468f55c8fb4b2ceeb1bce68e"/><file name="PaymentMethodNonceGateway.php" hash="22a0d89eee071a28b530c6be477dcc6e"/><file name="Plan.php" hash="22ab0117d462352aecb9531d4a26619e"/><file name="PlanGateway.php" hash="95e093b55ad20f8b652ee5f2fc2a0fcf"/><file name="RangeNode.php" hash="4ad9a92547423b3d54d69097114c3daf"/><file name="ResourceCollection.php" hash="8f437cb5014148c0e2f6049347ae795c"/><dir name="Result"><file name="CreditCardVerification.php" hash="7c41787025ec7cffb269f53e3ce479e2"/><file name="Error.php" hash="0e0460f1eea017bc7591e05351f51eb0"/><file name="Successful.php" hash="03f1c379fcedaef499296ab7778d1e36"/></dir><file name="RiskData.php" hash="8bef1074f9f1c50c841a7c7cf627c9cf"/><file name="SettlementBatchSummary.php" hash="388d88e8cea7bec61ee78f388fb78c2c"/><file name="SettlementBatchSummaryGateway.php" hash="bc54658b75fa0505e072331799c2d9ad"/><file name="SignatureService.php" hash="4b78d3e5897e715dcc877c5f65b3cfae"/><dir name="Subscription"><file name="StatusDetails.php" hash="29e375f02150bfd7147591f0eb27cb4f"/></dir><file name="Subscription.php" hash="cde05aa61192d5b930b57330db308835"/><file name="SubscriptionGateway.php" hash="bd1b2aa2d4d41a595463bead64ed34e0"/><file name="SubscriptionSearch.php" hash="1874ebe5cb42d7d2836617810cced1af"/><dir name="Test"><file name="CreditCardNumbers.php" hash="676a9100354eb679e7ca1e0f0d67293f"/><file name="MerchantAccount.php" hash="612e7e30cca364c0d14cbff3b54ebf3f"/><file name="Nonces.php" hash="230dc3687abaf95e9f516573b1836f4a"/><file name="TransactionAmounts.php" hash="ed9bf1f57d871542c32d11de9e031f05"/><file name="VenmoSdk.php" hash="6ce94deccd1f968596011487c7e69cc7"/></dir><file name="TextNode.php" hash="94c95ec9645de57acace2179fef7fb43"/><file name="ThreeDSecureInfo.php" hash="542550c4e03a24551d00e8aad5493035"/><dir name="Transaction"><file name="AddressDetails.php" hash="ff52a4a48248085b7ea92e992160e413"/><file name="AndroidPayCardDetails.php" hash="4dab3acc0cc35b5a6f12f95004074374"/><file name="ApplePayCardDetails.php" hash="c4dd87cd46fe7269e1bd51c867adf7cb"/><file name="CoinbaseDetails.php" hash="d19a625f8de98698b8277c25660358f0"/><file name="CreditCardDetails.php" hash="aac5eb1f5804d4f979b9c71f7b98cb36"/><file name="CustomerDetails.php" hash="e137895c646127312be44292c84a2d81"/><file name="PayPalDetails.php" hash="ede299e376bce7714838d79ca3d40842"/><file name="StatusDetails.php" hash="7c6e719c51bf13bdfd07615030100ac6"/><file name="SubscriptionDetails.php" hash="1cf1f511d1545a2e27b8d3f4bee800ca"/></dir><file name="Transaction.php" hash="09b9e7a574d304e9edebe578173f2994"/><file name="TransactionGateway.php" hash="4282d7497100c26afcd709fd77eae0bd"/><file name="TransactionSearch.php" hash="3101c79514520a1a500e4623f4ca1c32"/><file name="TransparentRedirect.php" hash="154c9850be5175a5cd1b35bdf78ae939"/><file name="TransparentRedirectGateway.php" hash="5ead181bf0d5484db5eb305efa13bec4"/><file name="UnknownPaymentMethod.php" hash="9107498774ab5bc2b25de98838736b47"/><file name="Util.php" hash="9832a44da18b97a55248cadc4bb9a4ad"/><file name="Version.php" hash="2f088b43efe46edb3262b89b7d40d051"/><file name="WebhookNotification.php" hash="4097fb57d46368d903c42bb20fbd49ca"/><file name="WebhookTesting.php" hash="c40311458bb64e37b4c08eb88df37805"/><dir name="Xml"><file name="Generator.php" hash="19f9c9b9b61d4f97f65775f527ac408d"/><file name="Parser.php" hash="c06b1ae155ac7687eaa856fac472656d"/></dir><file name="Xml.php" hash="dc69e05bea21e3d1185d45d53e4747db"/></dir><dir name="."><file name="Braintree.php" hash="424b8ccb072fda0ddf3459be6279734a"/></dir><dir name="ssl"><file name="api_braintreegateway_com.ca.crt" hash="04beb23c767547e980c76eb68c7eab15"/><file name="sandbox_braintreegateway_com.ca.crt" hash="f1b529883c7c2cbb4251658f5da7b4c9"/></dir></target><target name="magelocale"><dir><dir name="en_US"><file name="Gene_Braintree.csv" hash="00ae6dc359bc0d9c48bfc90a865232a3"/></dir></dir></target></contents>
42
  <compatible/>
43
- <dependencies><required><php><min>5.2.1</min><max>6.0.0</max></php><package><name/><channel>connect.magentocommerce.com/core</channel><min/><max/></package></required></dependencies>
44
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Gene_Braintree</name>
4
+ <version>2.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/mit-license.php">MIT License</license>
7
  <channel>community</channel>
9
  <summary>Connect your Magento store to Braintree to accept Credit Cards &amp;amp; PayPal using V.Zero SDK</summary>
10
  <description>From your first payment to your billionth.&#xD;
11
  &#xD;
12
+ Since the beginning, Braintree had one focus: provide the best tools for accepting payments. That mission began with a secure API and an amazing support team. Braintree v.zero sdk is the new cross platform way to integrate with Braintree.&#xD;
13
  &#xD;
14
+ This Magento extension is easy to install and configure and will allow you to get up and running with Braintree easily and quickly.&#xD;
15
  &#xD;
16
+ It works out-of the box with the latest Magento responsive default checkout and has been tested against the most popular checkout extensions from IWD and Amasty. Configuration into custom checkout templates is also very straightforward.&#xD;
17
  &#xD;
18
+ Easily add PayPal to your checkout. We've built the best PayPal integration around. All you need is a PayPal Business account and a few minutes and you'll pave the way for 152 million customers. Say goodbye to those IPN issues.&#xD;
19
  &#xD;
20
+ &lt;h3&gt;Features&lt;/h3&gt;&#xD;
21
+ &lt;ul&gt;&#xD;
22
+ &lt;li&gt;Process online credit card and debit card transactions from the Magento storefront and Admin Panel via the V.Zero SDK.&lt;/li&gt;&#xD;
23
+ &lt;li&gt;Secure storage of customer payment details in the PCI-compliant Braintree Vault&lt;/li&gt;&#xD;
24
+ &lt;li&gt;Stored payment detail management &#x2013; customers can add and delete cards &amp; paypal accounts&lt;/li&gt;&#xD;
25
+ &lt;li&gt;Supports multi-merchant and multi-currency Magento instances, including the Magento currency switcher&lt;/li&gt;&#xD;
26
+ &lt;li&gt;Provides advanced Braintree fraud protection&lt;/li&gt;&#xD;
27
+ &lt;li&gt;Integrated with Kount's fraud and risk management solution&lt;/li&gt;&#xD;
28
+ &lt;li&gt;3D secure configuration&lt;/li&gt;&#xD;
29
+ &lt;li&gt;Ability to partially capture transactions&lt;/li&gt;&#xD;
30
+ &lt;li&gt;Ability to configure the capture action either by invoice or by shipment&lt;/li&gt;&#xD;
31
+ &lt;li&gt;Ability to configure the sales action to Authorize only or Authorize and Capture at once&lt;/li&gt;&#xD;
32
+ &lt;li&gt;Card auto-detection on storefront&lt;/li&gt;&#xD;
33
+ &lt;li&gt;Integration into PayPal through the Braintree Gateway&lt;/li&gt;&#xD;
34
+ &lt;li&gt;Sandbox testing environment&lt;/li&gt;&#xD;
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-06-16</date>
40
+ <time>15:17:40</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="40a2eb78ee6c004b749ec62aaa690bf4"/><file name="Currency.php" hash="9976cc7d6ff80c3ea351ddff9b10b9d8"/><dir name="Kount"><file name="Ens.php" hash="56ef3f1e4da9d09b6bc8d0814a882358"/></dir><file name="Moduleversion.php" hash="eed1f9bcb139b6062e7972d3f98e13c8"/><file name="Version.php" hash="ce58278a4faf965301cc2d8b2da4483c"/></dir><file name="Migration.php" hash="e57911ecb5fb301147cd4940b3f1e4f4"/></dir></dir></dir><dir name="Cart"><file name="Totals.php" hash="a03c441e8143896f92d02931a809f666"/></dir><dir name="Creditcard"><file name="Info.php" hash="6faf4be87ad62f13373a6b2e852a478b"/><file name="Saved.php" hash="2d0a3c3543d8eecc7c94a50cea7810d9"/><file name="Threedsecure.php" hash="7848d4ecac743be985f328fa969318bf"/></dir><file name="Creditcard.php" hash="7871f210f4009cfe53ecfaf5164e43ca"/><dir name="Express"><file name="Button.php" hash="b7bb6fa7e6f80aa4809d1d1dc7dc6950"/><file name="Checkout.php" hash="d0c9bc6f656e93031189e7d6bb1c8533"/></dir><file name="Info.php" hash="4d9513f53e20bf7752c1f826bbd63b0e"/><file name="Js.php" hash="35e604171e4a5d1250732c4a5ad33d9b"/><dir name="Paypal"><file name="Info.php" hash="0874c0839a27c14ec9be47fed152e880"/><file name="Saved.php" hash="6a99ef8a384d7ab8f4537e995867ec85"/></dir><file name="Paypal.php" hash="10cbb40f8801153ac0c04725843f4eee"/><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="b3e5025957b496d3be5cdb865a20e5be"/></dir><dir name="Model"><file name="Debug.php" hash="f3360f71e2346881f93424792ed9f209"/><dir name="Entity"><file name="Setup.php" hash="c580e73ec53ac455698ee6b0ff005e39"/></dir><dir name="Kount"><file name="Ens.php" hash="0929b4b909c1baea965b77b011aff49e"/><file name="Rest.php" hash="5dfb5265a431da0210cb87dba023b7b6"/></dir><file name="Migration.php" hash="f6642a8ddf000b731f2b7044072d1adf"/><file name="Observer.php" hash="e1ac13f65517ef889cc41fc8b421cafb"/><dir name="Paymentmethod"><file name="Abstract.php" hash="f90b0dfa2890402af044dd9e3717c161"/><file name="Creditcard.php" hash="98c528e9db7d336d7e3c8a897e5e5de8"/><dir name="Legacy"><file name="Creditcard.php" hash="cfc791157f3a173ff8ed838e69c96f51"/><file name="Paypal.php" hash="59ef3cfb64f4c4c878015147412c78a7"/></dir><file name="Paypal.php" hash="ceba6e4eca55e5dcfeff4318800a18e5"/></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></dir><dir name="Wrapper"><file name="Braintree.php" hash="40c4fc221552e35c9cb26e66e82930b6"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Braintree"><file name="MigrationController.php" hash="cb9ffed24551fb7fff6ccd871a589101"/></dir><file name="BraintreeController.php" hash="d7ece21342a7b4b37ee41ea0e7ff20ad"/></dir><file name="CheckoutController.php" hash="42ac29d6b91aaf40a3a1e1678be7f5b3"/><file name="ExpressController.php" hash="897ba6b4f1557ed7f7baf8b332f0bc87"/><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="5e37801ecd00956a55f664d2057c682c"/><file name="system.xml" hash="ddd778a4d2a9a3f500fe41758c83e237"/></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"/></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="7a028487a5d85fd4034883eb11b908b4"/></dir></dir><dir name="template"><dir name="gene"><dir name="braintree"><dir name="creditcard"><file name="hostedfields.phtml" hash="bfa98d63527cba0990c5cd793325a013"/><file name="info.phtml" hash="2ae1e397b3a633dd305bc26c7b9c1065"/><file name="saved.phtml" hash="579ec8ca726de3b5bea8600663d1e61f"/><file name="threedsecure.phtml" hash="ee8ad689afde041c39dd92ffa5274883"/></dir><file name="creditcard.phtml" hash="2cf07e28ebd141ea73e6e9082096304e"/><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="cart.phtml" hash="430af653061c7d6f1074bd2ca5e9b04d"/><file name="catalog.phtml" hash="78bb957f8e650cf095f00a0f665f2945"/><file name="error.phtml" hash="dc2c40f1914a5d68e220e3aa82abb1e6"/><file name="shipping_details.phtml" hash="d89af997ad75ed875e3a18d2f38e6571"/></dir><dir name="js"><file name="aheadworks.phtml" hash="533ba9aebbba6768649668386a74a1c2"/><file name="amasty.phtml" hash="2bfc5623dd9a98721b53a4d8cd13c0c3"/><file name="data.phtml" hash="f8b04e3d0d7154cc75332eb5bec3e54e"/><file name="default.phtml" hash="fdcfb27a06ebab20268ef4ed820625c1"/><file name="firecheckout.phtml" hash="06acaa71a28ff9029242c4906cc05314"/><file name="fme.phtml" hash="263fb201b77696cf21cc677696c53fdd"/><file name="idev.phtml" hash="f8677f5296e573b8bfc3e63603e62bf6"/><file name="iwd.phtml" hash="d7e12c84b629306529d3d8beb0c4814d"/><file name="magestore.phtml" hash="ff6a622a4048b8e533f3e672a40e6296"/><file name="multishipping.phtml" hash="a1e777e99df26d81f7c4b9e7b4a7c109"/><file name="oye.phtml" hash="51ef48f818e79acb6d1e8b9eb7889cc9"/><file name="setup.phtml" hash="804d63a30f8d6c985644b545a768da97"/><file name="unicode.phtml" hash="dd07e924a01b0a28ef46c9a62f22e3b5"/></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="a80683ffe99332dffa0c2e563120ef75"/></dir></dir><dir name="template"><dir name="gene"><dir name="braintree"><dir name="creditcard"><file name="hostedfields.phtml" hash="152e09ed938c47ffc056a7c11247375a"/><file name="info.phtml" hash="24c67bab482ea7383ce57d9a06bb9d6f"/><file name="saved.phtml" hash="ca27adb601aebf97cd25a892082a8663"/></dir><file name="creditcard.phtml" hash="2d77487c6b7e9e6c77b2ddb25597bd8b"/><file name="js.phtml" hash="40866b2bdd056310fa0622c3aac3f7db"/><dir name="paypal"><file name="info.phtml" hash="a8f92f312f8aa5a9463f1d5c2a38cd1b"/><file name="saved.phtml" hash="779ca8e907d7d463eafce58dfaf94f0c"/></dir><file name="paypal.phtml" hash="f81578f64c8a30560299bd993d8e996d"/><dir name="system"><dir name="config"><file name="migration.phtml" hash="4cfe0ffb6a9e03d1297eb66a51f77429"/></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"><file name="braintree-0.1.js" hash="a72cc4545d0d01dd0947dae1474516dd"/><file name="config.codekit" hash="ac2da34ea9ef3ca9c6dd616a0ae830d6"/><file name="express.js" hash="616046de857e85d0736839dfd192a133"/><file name="vzero-0.7-min.js" hash="e0a5babca1118aeb94f0655827317e20"/><file name="vzero-0.7-min.js.map" hash="1fc5d50c5cdcb138131930ac92362053"/><file name="vzero-0.7.js" hash="effafba9ab6fa9012da9b352b7996109"/></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="548efcbb5b31d1e8811aa1f352111af9"/><file name="amasty.css" hash="0b5ffece72469b63cebdfde108ad2e13"/><file name="config.codekit" hash="7fac910f64b164f32f561db17f19cbba"/><dir name="core"><file name="_general.less" hash="bdadf4fc85ee76b514f03298be1a7e58"/><file name="_hostedfields.less" hash="555bd4655d78a3b379c4b86a3e2d86e5"/><file name="_paypal.less" hash="e7e55d959247956253a0af1df0c9e899"/><file name="_saved.less" hash="66ec8d894e336f9934a1e54972c4b220"/></dir><file name="default.css" hash="80bb5eaa02405ce35ee960537204a62f"/><file name="express.css" hash="13fffafad7ed0cf5fbb85dc167f2a7bb"/><file name="firecheckout.css" hash="9be117bd43f83a15843b599e955896a2"/><file name="fme.css" hash="1139d2b8f32806f781639872c97df5cb"/><file name="idev.css" hash="bae7b82bb27e4b21a31c5e8e26d7672b"/><dir name="integrations"><file name="aheadworks.less" hash="09b0304383e198885f030119c15641f7"/><file name="amasty.less" hash="4cdf236e1d44112205750cefa11448b4"/><file name="default.less" hash="d366d4560ed1ce3e9e120309e56bec2f"/><file name="firecheckout.less" hash="9ce8a9a8fd82553e9a3dbf76f030872a"/><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="b1aa43d7bb9c97ab54d5392a24b703fb"/><file name="magestore.css" hash="529a595d9aef634527b8fe8e72aa1b84"/><file name="oye.css" hash="80906d460c6f5490e5e303a0a7fc6e20"/><file name="unicode.css" hash="46ca21b52eb30fbae49ce91c9300d9b4"/><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="2847eb017b959db61659562d1e8cfaea"/><file name="adminhtml.less" hash="6456950844fcd86471cf78400f922915"/><file name="config.codekit" hash="1be78e1e754fe681b3d1be469b4d0386"/><file name="migration.css" hash="c67c92df36fe23fecaa1db9f1f1cd996"/><file name="migration.less" hash="2f76dd2f55cc5268bd70197bfe344b20"/><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="AddOn.php" hash="e8bbb6db343ba99192346b1dcbf45677"/><file name="AddOnGateway.php" hash="d8698ffe89c01fba78a8a06a2fc68122"/><file name="Address.php" hash="004d3d36d39fc6fcc3d510f4b15b1fca"/><file name="AddressGateway.php" hash="41b5a3be7bdb2fe326a49a1554e1b0c3"/><file name="AndroidPayCard.php" hash="bb4a81807fefc76db286e615128c5d8c"/><file name="ApplePayCard.php" hash="b895256bcb867854bcaaffc1ce833fbd"/><file name="Base.php" hash="60d52fd1bef5655bcb607fba45bb4c1c"/><file name="ClientToken.php" hash="358c0a1dba687baf635db818cb7d1dac"/><file name="ClientTokenGateway.php" hash="9c24bb9de2c419c7e377c046da2a1ffa"/><file name="CoinbaseAccount.php" hash="ee5cb6963f675a9a71293c453b128866"/><file name="Collection.php" hash="0e7d31ffcbd9780fb554186bd2c194b0"/><file name="Configuration.php" hash="2a416a1eae0c22329d9bef88b25039b2"/><file name="CredentialsParser.php" hash="c4bb2248a33129d8523a6120ce44108b"/><file name="CreditCard.php" hash="d32b8d8e64b2d046d3d9e4f00c67f1ed"/><file name="CreditCardGateway.php" hash="0d120ed06f06fd614468d6e3f0ad22d2"/><file name="CreditCardVerification.php" hash="48d6ea546914278f4bea2fefb75e7836"/><file name="CreditCardVerificationGateway.php" hash="6a07430c9437f6e6c1516d5b4572a749"/><file name="CreditCardVerificationSearch.php" hash="18efe7d508c2bd5fea1c0e68fc26182f"/><file name="Customer.php" hash="62d0937de86f7a14a512ad66edba7569"/><file name="CustomerGateway.php" hash="5367d9d8a878572106e3a94c60132b1b"/><file name="CustomerSearch.php" hash="8aacc83dac341cd9afec5a3deab17593"/><file name="Descriptor.php" hash="3f5db5e817280ce7f2fa18a205281ad9"/><file name="Digest.php" hash="9d12d067770f55b123b8498fce4478fa"/><file name="Disbursement.php" hash="ad122f0f33b27dfd98bcdd38ea138ae4"/><file name="DisbursementDetails.php" hash="ae632207d0982e288a83aed401c880d9"/><file name="Discount.php" hash="763b3f9cde0ff3af3e8795cac4097595"/><file name="DiscountGateway.php" hash="47796edb8ac2fa68e9af8fb8a13aacb1"/><dir name="Dispute"><file name="TransactionDetails.php" hash="7fdea673a1295055508f42286ad57f4e"/></dir><file name="Dispute.php" hash="c3a4e93fa2b3b0e20ddcb593dcdc7b2b"/><file name="EqualityNode.php" hash="cfd6aa184186233b8d6d1ec0f0e79298"/><dir name="Error"><file name="Codes.php" hash="a7f98ff690e725b7fcd198b4b22d0637"/><file name="ErrorCollection.php" hash="e28d638db56524f5bf3609fa725e6d55"/><file name="Validation.php" hash="bf4e2198300019c52ba56f16269d66ce"/><file name="ValidationErrorCollection.php" hash="9ef25d0126a0b4f6951da5334ae6f0dc"/></dir><file name="EuropeBankAccount.php" hash="82ae4f4d1c45ce2c421305bf9397c866"/><dir name="Exception"><file name="Authentication.php" hash="f9e13654988452cca2ac5228a80adae4"/><file name="Authorization.php" hash="5f8c017c6e9fd79a556dade8e15a72e8"/><file name="Configuration.php" hash="b50f67e8ea36cff0d9f6ad718126c6fc"/><file name="DownForMaintenance.php" hash="7fd30b1f8976ed7e38b7e9fae5c20f03"/><file name="ForgedQueryString.php" hash="6884dbae1e86767834b77c821df2db62"/><file name="InvalidChallenge.php" hash="1c283a1c9dac65feb137594d0dcf0e35"/><file name="InvalidSignature.php" hash="b83f5b16735cb3a8e0a8111c4f32711e"/><file name="NotFound.php" hash="f832f771d20b381c2780eb2a572b9f44"/><file name="SSLCaFileNotFound.php" hash="e927c7307bf1761814dc8a755238070d"/><file name="SSLCertificate.php" hash="d509b6a6206bd7c5563ac142dfe3801f"/><file name="ServerError.php" hash="b4645290229ab228a257047d08ef63d7"/><file name="TestOperationPerformedInProduction.php" hash="fde4c6a8b708420b26785fb67a2548ef"/><file name="Unexpected.php" hash="01ea2800fb91995ec2a15aee5024611e"/><file name="UpgradeRequired.php" hash="7f40b174df891cc3b3e206d1be884a58"/><file name="ValidationsFailed.php" hash="cd2d30c69911f81b55279c3d6bf88c61"/></dir><file name="Exception.php" hash="f14c94bf67206184eb3e4e7aeb4a608a"/><file name="Gateway.php" hash="d2fac69479243ef4cea7d7a8add798f7"/><file name="Http.php" hash="1baa32e0efcae13c4d6294d1233512a1"/><file name="Instance.php" hash="f0603b3f9213b53687e079c5621ac8f3"/><file name="IsNode.php" hash="e4b1f7bbfcbd24b1d08b97f94df592be"/><file name="KeyValueNode.php" hash="255595ec01a16906dd0c49faf67d9efb"/><file name="Merchant.php" hash="5053ebe889c854d11f2686bffdeb58be"/><dir name="MerchantAccount"><file name="AddressDetails.php" hash="1d265d864a884ebcf2504f55207cc0dd"/><file name="BusinessDetails.php" hash="3e80148bac9fda676844aa19d5b2dc28"/><file name="FundingDetails.php" hash="7368f653fcbcc3d87924447b1763e616"/><file name="IndividualDetails.php" hash="777b6f28f643e78616c7ed753a39c0cd"/></dir><file name="MerchantAccount.php" hash="496c93182d824bb2967cc9366dec1ac3"/><file name="MerchantAccountGateway.php" hash="e2073aff6f8b3c5f2e64b23b210c44f7"/><file name="MerchantGateway.php" hash="e0a2e3a28c68dac8bd082973b269ed1b"/><file name="Modification.php" hash="0abe992d4f821327f617ca883c4eb2d1"/><file name="MultipleValueNode.php" hash="92700fa03011eaa9561010b3a160449c"/><file name="MultipleValueOrTextNode.php" hash="ef06bac18e2bc40974bdc0bcb854890f"/><file name="OAuthCredentials.php" hash="e992dca9dfedb27e3d050af55971a968"/><file name="OAuthGateway.php" hash="9a0b2b692eaf8fb5f337922044b20cc1"/><file name="PartialMatchNode.php" hash="370c7e0ab8a445cfeef6b19ef1755f4d"/><file name="PartnerMerchant.php" hash="bdb69ebdc75d67009710be9703a47e80"/><file name="PayPalAccount.php" hash="672a7d424f94e590c5e66a21e62d7bc2"/><file name="PayPalAccountGateway.php" hash="d73f5744ebaca6cc882c42d0e9c1a05e"/><file name="PaymentInstrumentType.php" hash="be97a30c7d8fbbb180864dc4efea71f2"/><file name="PaymentMethod.php" hash="5bc31d3e97610e7218c95aba2422cc9a"/><file name="PaymentMethodGateway.php" hash="4c93b070cb79c86ec9384e069fbae777"/><file name="PaymentMethodNonce.php" hash="e99302e2468f55c8fb4b2ceeb1bce68e"/><file name="PaymentMethodNonceGateway.php" hash="22a0d89eee071a28b530c6be477dcc6e"/><file name="Plan.php" hash="22ab0117d462352aecb9531d4a26619e"/><file name="PlanGateway.php" hash="95e093b55ad20f8b652ee5f2fc2a0fcf"/><file name="RangeNode.php" hash="4ad9a92547423b3d54d69097114c3daf"/><file name="ResourceCollection.php" hash="8f437cb5014148c0e2f6049347ae795c"/><dir name="Result"><file name="CreditCardVerification.php" hash="7c41787025ec7cffb269f53e3ce479e2"/><file name="Error.php" hash="0e0460f1eea017bc7591e05351f51eb0"/><file name="Successful.php" hash="03f1c379fcedaef499296ab7778d1e36"/></dir><file name="RiskData.php" hash="8bef1074f9f1c50c841a7c7cf627c9cf"/><file name="SettlementBatchSummary.php" hash="388d88e8cea7bec61ee78f388fb78c2c"/><file name="SettlementBatchSummaryGateway.php" hash="bc54658b75fa0505e072331799c2d9ad"/><file name="SignatureService.php" hash="4b78d3e5897e715dcc877c5f65b3cfae"/><dir name="Subscription"><file name="StatusDetails.php" hash="29e375f02150bfd7147591f0eb27cb4f"/></dir><file name="Subscription.php" hash="cde05aa61192d5b930b57330db308835"/><file name="SubscriptionGateway.php" hash="bd1b2aa2d4d41a595463bead64ed34e0"/><file name="SubscriptionSearch.php" hash="1874ebe5cb42d7d2836617810cced1af"/><dir name="Test"><file name="CreditCardNumbers.php" hash="676a9100354eb679e7ca1e0f0d67293f"/><file name="MerchantAccount.php" hash="612e7e30cca364c0d14cbff3b54ebf3f"/><file name="Nonces.php" hash="d39c75e07c12c005c837c33003cb9ec2"/><file name="Transaction.php" hash="f7ef8730ede38eda778679c7056ae7c7"/><file name="TransactionAmounts.php" hash="ed9bf1f57d871542c32d11de9e031f05"/><file name="VenmoSdk.php" hash="6ce94deccd1f968596011487c7e69cc7"/></dir><file name="TestingGateway.php" hash="ccb1126142799ac3dc9f8d6f1a1f48d4"/><file name="TextNode.php" hash="94c95ec9645de57acace2179fef7fb43"/><file name="ThreeDSecureInfo.php" hash="542550c4e03a24551d00e8aad5493035"/><dir name="Transaction"><file name="AddressDetails.php" hash="ff52a4a48248085b7ea92e992160e413"/><file name="AndroidPayCardDetails.php" hash="0d7716a3c992dfb0833e7ecd437ef346"/><file name="ApplePayCardDetails.php" hash="23f7ba70521889585fa40f4f0388524d"/><file name="CoinbaseDetails.php" hash="d19a625f8de98698b8277c25660358f0"/><file name="CreditCardDetails.php" hash="aac5eb1f5804d4f979b9c71f7b98cb36"/><file name="CustomerDetails.php" hash="e137895c646127312be44292c84a2d81"/><file name="EuropeBankAccountDetails.php" hash="afe4fdc3ab3714ef2995f514ce2be2a6"/><file name="PayPalDetails.php" hash="06903d1ee21879f7329b920138df9ac6"/><file name="StatusDetails.php" hash="7c6e719c51bf13bdfd07615030100ac6"/><file name="SubscriptionDetails.php" hash="1cf1f511d1545a2e27b8d3f4bee800ca"/></dir><file name="Transaction.php" hash="afe5d8ef7fc73633424d26b942c4e5a1"/><file name="TransactionGateway.php" hash="39684956db79fe58891876e5c7845413"/><file name="TransactionSearch.php" hash="aa58846182b909fb8747e165ec7e9b92"/><file name="TransparentRedirect.php" hash="154c9850be5175a5cd1b35bdf78ae939"/><file name="TransparentRedirectGateway.php" hash="5ead181bf0d5484db5eb305efa13bec4"/><file name="UnknownPaymentMethod.php" hash="9107498774ab5bc2b25de98838736b47"/><file name="Util.php" hash="9832a44da18b97a55248cadc4bb9a4ad"/><file name="Version.php" hash="43e074bc53780cb92af4a9ef4887c63e"/><file name="WebhookNotification.php" hash="4097fb57d46368d903c42bb20fbd49ca"/><file name="WebhookTesting.php" hash="c40311458bb64e37b4c08eb88df37805"/><dir name="Xml"><file name="Generator.php" hash="19f9c9b9b61d4f97f65775f527ac408d"/><file name="Parser.php" hash="c06b1ae155ac7687eaa856fac472656d"/></dir><file name="Xml.php" hash="dc69e05bea21e3d1185d45d53e4747db"/></dir><file name="Braintree.php" hash="2c75cf27b3c9a6e1bc557e6b239d2594"/><dir name="ssl"><file name="api_braintreegateway_com.ca.crt" hash="04beb23c767547e980c76eb68c7eab15"/><file name="sandbox_braintreegateway_com.ca.crt" hash="f1b529883c7c2cbb4251658f5da7b4c9"/></dir></dir></target><target name="magelocale"><dir><dir name="en_US"><file name="Gene_Braintree.csv" hash="b0c520cbdf0f42b11c8c6dfafbe999bd"/></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>
skin/{frontend/base/default/images → adminhtml/default/default/css}/gene/braintree/.DS_Store RENAMED
Binary file
skin/adminhtml/default/default/css/gene/braintree/adminhtml.css ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #payment_form_gene_braintree_creditcard {
2
+ padding: 12px 0;
3
+ }
4
+ #payment_form_gene_braintree_creditcard p {
5
+ padding: 0;
6
+ }
7
+ #payment_form_gene_braintree_paypal {
8
+ padding: 12px 0;
9
+ }
10
+ #payment_form_gene_braintree_paypal p {
11
+ padding: 0;
12
+ }
13
+ #payment_form_gene_braintree_creditcard > span {
14
+ margin-bottom: 6px;
15
+ }
16
+ #payment_form_gene_braintree_paypal > span {
17
+ margin-bottom: 6px;
18
+ }
19
+ #credit-card-form.loading {
20
+ position: relative;
21
+ }
22
+ #credit-card-form.loading .credit-card-loading {
23
+ display: block;
24
+ height: 70%;
25
+ left: 0;
26
+ position: absolute;
27
+ right: 0;
28
+ text-align: center;
29
+ top: 30%;
30
+ width: 100%;
31
+ }
32
+ #credit-card-form.loading .credit-card-loading img {
33
+ margin: 16px auto;
34
+ }
35
+ #credit-card-form.loading .braintree-hostedfield {
36
+ opacity: 0;
37
+ }
38
+ #credit-card-form .braintree-hostedfield {
39
+ opacity: 1;
40
+ }
41
+ #credit-card-form .credit-card-loading {
42
+ display: none;
43
+ }
44
+ #creditcard-saved-accounts {
45
+ font-size: 0;
46
+ width: 100%;
47
+ }
48
+ #creditcard-saved-accounts tr {
49
+ border-bottom: 1px dotted lightgrey;
50
+ font-size: 12px;
51
+ }
52
+ #creditcard-saved-accounts tr td {
53
+ vertical-align: middle;
54
+ }
55
+ #creditcard-saved-accounts tr.other-row {
56
+ border-bottom: 0;
57
+ }
58
+ #creditcard-saved-accounts tr.other-row label {
59
+ line-height: 20px;
60
+ padding: 8px 0;
61
+ }
62
+ #creditcard-saved-accounts label {
63
+ float: left;
64
+ line-height: 35px!important;
65
+ padding: 4px 0;
66
+ width: 100%;
67
+ }
68
+ #creditcard-saved-accounts label img {
69
+ float: left;
70
+ height: 35px;
71
+ margin-left: 6px;
72
+ }
73
+ #creditcard-saved-accounts label .saved-card-info {
74
+ float: left;
75
+ margin-left: 14px;
76
+ }
77
+ #creditcard-saved-accounts label .saved-card-info span {
78
+ line-height: 35px;
79
+ }
80
+ #creditcard-saved-accounts label .saved-card-info span.saved-expiry-date {
81
+ font-size: 12px;
82
+ font-weight: normal;
83
+ margin-left: 14px;
84
+ }
85
+ #paypal-saved-accounts {
86
+ font-size: 0;
87
+ width: 100%;
88
+ }
89
+ #paypal-saved-accounts tr {
90
+ border-bottom: 1px dotted lightgrey;
91
+ font-size: 12px;
92
+ }
93
+ #paypal-saved-accounts tr td {
94
+ vertical-align: middle;
95
+ }
96
+ #paypal-saved-accounts tr.other-row {
97
+ border-bottom: 0;
98
+ }
99
+ #paypal-saved-accounts tr.other-row label {
100
+ line-height: 20px;
101
+ padding: 8px 0;
102
+ }
103
+ #paypal-saved-accounts label {
104
+ line-height: 35px!important;
105
+ padding: 6px 0;
106
+ }
107
+ #paypal-saved-accounts label img {
108
+ float: left;
109
+ height: 35px;
110
+ margin-left: 6px;
111
+ }
112
+ #paypal-saved-accounts label .saved-paypal-email {
113
+ float: left;
114
+ margin-left: 14px;
115
+ }
116
+ #payment_form_gene_braintree_creditcard label,
117
+ #payment_form_gene_braintree_paypal label,
118
+ #payment_form_gene_braintree_creditcard .label,
119
+ #payment_form_gene_braintree_paypal .label {
120
+ float: none;
121
+ padding: 0;
122
+ text-align: left;
123
+ width: 100%;
124
+ }
125
+ #gene_braintree_creditcard_store_in_vault_div label {
126
+ width: auto!important;
127
+ }
128
+ label[for="gene_braintree_paypal_store_in_vault"] {
129
+ width: auto!important;
130
+ }
skin/adminhtml/default/default/css/gene/braintree/adminhtml.less ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #payment_form_gene_braintree_creditcard {
2
+ padding: 12px 0;
3
+ p {
4
+ padding: 0;
5
+ }
6
+ }
7
+ #payment_form_gene_braintree_paypal {
8
+ padding: 12px 0;
9
+ p {
10
+ padding: 0;
11
+ }
12
+ }
13
+ #payment_form_gene_braintree_creditcard>span {
14
+ margin-bottom: 6px;
15
+ }
16
+ #payment_form_gene_braintree_paypal>span {
17
+ margin-bottom: 6px;
18
+ }
19
+ #credit-card-form.loading {
20
+ position: relative;
21
+ .credit-card-loading {
22
+ display: block;
23
+ height: 70%;
24
+ left: 0;
25
+ position: absolute;
26
+ right: 0;
27
+ text-align: center;
28
+ top: 30%;
29
+ width: 100%;
30
+ img {
31
+ margin: 16px auto;
32
+ }
33
+ }
34
+ .braintree-hostedfield {
35
+ opacity: 0;
36
+ }
37
+ }
38
+ #credit-card-form {
39
+ .braintree-hostedfield {
40
+ opacity: 1;
41
+ }
42
+ .credit-card-loading {
43
+ display: none;
44
+ }
45
+ }
46
+ #creditcard-saved-accounts {
47
+ font-size: 0;
48
+ width: 100%;
49
+ tr {
50
+ border-bottom: 1px dotted lightgrey;
51
+ font-size:12px;
52
+ td {
53
+ vertical-align: middle;
54
+ }
55
+ }
56
+ tr.other-row {
57
+ border-bottom: 0;
58
+ label {
59
+ line-height: 20px;
60
+ padding: 8px 0;
61
+ }
62
+ }
63
+ label {
64
+ float: left;
65
+ line-height: 35px!important;
66
+ padding: 4px 0;
67
+ width: 100%;
68
+ img {
69
+ float: left;
70
+ height: 35px;
71
+ margin-left: 6px;
72
+ }
73
+ .saved-card-info {
74
+ float: left;
75
+ margin-left: 14px;
76
+ span {
77
+ line-height: 35px;
78
+ }
79
+ span.saved-expiry-date {
80
+ font-size: 12px;
81
+ font-weight: normal;
82
+ margin-left: 14px;
83
+ }
84
+ }
85
+ }
86
+ }
87
+ #paypal-saved-accounts {
88
+ font-size: 0;
89
+ width: 100%;
90
+ tr {
91
+ border-bottom: 1px dotted lightgrey;
92
+ font-size:12px;
93
+ td {
94
+ vertical-align: middle;
95
+ }
96
+ }
97
+ tr.other-row {
98
+ border-bottom: 0;
99
+ label {
100
+ line-height: 20px;
101
+ padding: 8px 0;
102
+ }
103
+ }
104
+ label {
105
+ line-height: 35px!important;
106
+ padding: 6px 0;
107
+ img {
108
+ float: left;
109
+ height: 35px;
110
+ margin-left: 6px;
111
+ }
112
+ .saved-paypal-email {
113
+ float: left;
114
+ margin-left: 14px;
115
+ }
116
+ }
117
+ }
118
+ #payment_form_gene_braintree_creditcard label, #payment_form_gene_braintree_paypal label, #payment_form_gene_braintree_creditcard .label, #payment_form_gene_braintree_paypal .label {
119
+ float: none;
120
+ padding: 0;
121
+ text-align: left;
122
+ width: 100%;
123
+ }
124
+ #gene_braintree_creditcard_store_in_vault_div {
125
+ label {
126
+ width: auto!important;
127
+ }
128
+ }
129
+ label[for="gene_braintree_paypal_store_in_vault"] {
130
+ width: auto!important;
131
+ }
skin/adminhtml/default/default/css/gene/braintree/config.codekit ADDED
@@ -0,0 +1,880 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": "19115",
4
+ "files": {
5
+ "\/adminhtml.css": {
6
+ "fileType": 16,
7
+ "ignore": 1,
8
+ "ignoreWasSetByUser": 0,
9
+ "inputAbbreviatedPath": "\/adminhtml.css",
10
+ "outputAbbreviatedPath": "No Output Path",
11
+ "outputPathIsOutsideProject": 0,
12
+ "outputPathIsSetByUser": 0
13
+ },
14
+ "\/adminhtml.less": {
15
+ "allowInsecureImports": 0,
16
+ "createSourceMap": 0,
17
+ "disableJavascript": 0,
18
+ "fileType": 1,
19
+ "ieCompatibility": 1,
20
+ "ignore": 0,
21
+ "ignoreWasSetByUser": 0,
22
+ "inputAbbreviatedPath": "\/adminhtml.less",
23
+ "outputAbbreviatedPath": "\/adminhtml.css",
24
+ "outputPathIsOutsideProject": 0,
25
+ "outputPathIsSetByUser": 1,
26
+ "outputStyle": 0,
27
+ "relativeURLS": 0,
28
+ "shouldRunAutoprefixer": 0,
29
+ "shouldRunBless": 0,
30
+ "strictImports": 0,
31
+ "strictMath": 0,
32
+ "strictUnits": 0
33
+ },
34
+ "\/migration.css": {
35
+ "fileType": 16,
36
+ "ignore": 1,
37
+ "ignoreWasSetByUser": 0,
38
+ "inputAbbreviatedPath": "\/migration.css",
39
+ "outputAbbreviatedPath": "No Output Path",
40
+ "outputPathIsOutsideProject": 0,
41
+ "outputPathIsSetByUser": 0
42
+ },
43
+ "\/migration.less": {
44
+ "allowInsecureImports": 0,
45
+ "createSourceMap": 0,
46
+ "disableJavascript": 0,
47
+ "fileType": 1,
48
+ "ieCompatibility": 1,
49
+ "ignore": 0,
50
+ "ignoreWasSetByUser": 0,
51
+ "inputAbbreviatedPath": "\/migration.less",
52
+ "outputAbbreviatedPath": "\/migration.css",
53
+ "outputPathIsOutsideProject": 0,
54
+ "outputPathIsSetByUser": 1,
55
+ "outputStyle": 0,
56
+ "relativeURLS": 0,
57
+ "shouldRunAutoprefixer": 0,
58
+ "shouldRunBless": 0,
59
+ "strictImports": 0,
60
+ "strictMath": 0,
61
+ "strictUnits": 0
62
+ }
63
+ },
64
+ "hooks": [
65
+ ],
66
+ "lastSavedByUser": "David Macaulay",
67
+ "manualImportLinks": {
68
+ },
69
+ "projectAttributes": {
70
+ "bowerAbbreviatedPath": "",
71
+ "displayValue": "braintree",
72
+ "displayValueWasSetByUser": 0,
73
+ "iconImageName": "harddrive_orange"
74
+ },
75
+ "projectSettings": {
76
+ "alwaysUseExternalServer": 1,
77
+ "animateCSSInjections": 1,
78
+ "autoApplyPSLanguageSettingsStyle": 0,
79
+ "autoprefixerBrowserString": "> 1%, last 2 versions, Firefox ESR, Opera 12.1",
80
+ "autoSyncProjectSettingsFile": 1,
81
+ "browserRefreshDelay": 0,
82
+ "coffeeAutoOutputPathEnabled": 1,
83
+ "coffeeAutoOutputPathFilenamePattern": "*.js",
84
+ "coffeeAutoOutputPathRelativePath": "",
85
+ "coffeeAutoOutputPathReplace1": "",
86
+ "coffeeAutoOutputPathReplace2": "",
87
+ "coffeeAutoOutputPathStyle": 0,
88
+ "coffeeCreateSourceMap": 0,
89
+ "coffeeLintFlags2": {
90
+ "arrow_spacing": {
91
+ "active": 0,
92
+ "flagValue": -1
93
+ },
94
+ "camel_case_classes": {
95
+ "active": 1,
96
+ "flagValue": -1
97
+ },
98
+ "colon_assignment_spacing": {
99
+ "active": 0,
100
+ "flagValue": 1
101
+ },
102
+ "cyclomatic_complexity": {
103
+ "active": 0,
104
+ "flagValue": 10
105
+ },
106
+ "duplicate_key": {
107
+ "active": 1,
108
+ "flagValue": -1
109
+ },
110
+ "empty_constructor_needs_parens": {
111
+ "active": 0,
112
+ "flagValue": -1
113
+ },
114
+ "ensure_comprehensions": {
115
+ "active": 1,
116
+ "flagValue": -1
117
+ },
118
+ "indentation": {
119
+ "active": 1,
120
+ "flagValue": 2
121
+ },
122
+ "line_endings": {
123
+ "active": 0,
124
+ "flagValue": 0
125
+ },
126
+ "max_line_length": {
127
+ "active": 0,
128
+ "flagValue": 150
129
+ },
130
+ "missing_fat_arrows": {
131
+ "active": 0,
132
+ "flagValue": -1
133
+ },
134
+ "newlines_after_classes": {
135
+ "active": 0,
136
+ "flagValue": 3
137
+ },
138
+ "no_backticks": {
139
+ "active": 1,
140
+ "flagValue": -1
141
+ },
142
+ "no_debugger": {
143
+ "active": 1,
144
+ "flagValue": -1
145
+ },
146
+ "no_empty_functions": {
147
+ "active": 0,
148
+ "flagValue": -1
149
+ },
150
+ "no_empty_param_list": {
151
+ "active": 0,
152
+ "flagValue": -1
153
+ },
154
+ "no_implicit_braces": {
155
+ "active": 1,
156
+ "flagValue": -1
157
+ },
158
+ "no_implicit_parens": {
159
+ "active": 0,
160
+ "flagValue": -1
161
+ },
162
+ "no_interpolation_in_single_quotes": {
163
+ "active": 0,
164
+ "flagValue": -1
165
+ },
166
+ "no_nested_string_interpolation": {
167
+ "active": 1,
168
+ "flagValue": -1
169
+ },
170
+ "no_plusplus": {
171
+ "active": 0,
172
+ "flagValue": -1
173
+ },
174
+ "no_private_function_fat_arrows": {
175
+ "active": 1,
176
+ "flagValue": -1
177
+ },
178
+ "no_stand_alone_at": {
179
+ "active": 1,
180
+ "flagValue": -1
181
+ },
182
+ "no_tabs": {
183
+ "active": 1,
184
+ "flagValue": -1
185
+ },
186
+ "no_this": {
187
+ "active": 0,
188
+ "flagValue": -1
189
+ },
190
+ "no_throwing_strings": {
191
+ "active": 1,
192
+ "flagValue": -1
193
+ },
194
+ "no_trailing_semicolons": {
195
+ "active": 1,
196
+ "flagValue": -1
197
+ },
198
+ "no_trailing_whitespace": {
199
+ "active": 1,
200
+ "flagValue": -1
201
+ },
202
+ "no_unnecessary_double_quotes": {
203
+ "active": 0,
204
+ "flagValue": -1
205
+ },
206
+ "no_unnecessary_fat_arrows": {
207
+ "active": 1,
208
+ "flagValue": -1
209
+ },
210
+ "non_empty_constructor_needs_parens": {
211
+ "active": 0,
212
+ "flagValue": -1
213
+ },
214
+ "prefer_english_operator": {
215
+ "active": 0,
216
+ "flagValue": -1
217
+ },
218
+ "space_operators": {
219
+ "active": 0,
220
+ "flagValue": -1
221
+ },
222
+ "spacing_after_comma": {
223
+ "active": 1,
224
+ "flagValue": -1
225
+ }
226
+ },
227
+ "coffeeMinifyOutput": 1,
228
+ "coffeeOutputStyle": 0,
229
+ "coffeeSyntaxCheckerStyle": 1,
230
+ "externalServerAddress": "http:\/\/rocketweb.braintree.dave.gene.co.uk\/",
231
+ "externalServerPreviewPathAddition": "",
232
+ "genericWebpageFileExtensionsString": "html, htm, shtml, shtm, xhtml, php, jsp, asp, aspx, erb, ctp",
233
+ "hamlAutoOutputPathEnabled": 1,
234
+ "hamlAutoOutputPathFilenamePattern": "*.html",
235
+ "hamlAutoOutputPathRelativePath": "",
236
+ "hamlAutoOutputPathReplace1": "",
237
+ "hamlAutoOutputPathReplace2": "",
238
+ "hamlAutoOutputPathStyle": 0,
239
+ "hamlEscapeHTMLCharacters": 0,
240
+ "hamlNoEscapeInAttributes": 0,
241
+ "hamlOutputFormat": 2,
242
+ "hamlOutputStyle": 0,
243
+ "hamlUseCDATA": 0,
244
+ "hamlUseDoubleQuotes": 0,
245
+ "hamlUseUnixNewlines": 0,
246
+ "jadeAutoOutputPathEnabled": 1,
247
+ "jadeAutoOutputPathFilenamePattern": "*.html",
248
+ "jadeAutoOutputPathRelativePath": "",
249
+ "jadeAutoOutputPathReplace1": "",
250
+ "jadeAutoOutputPathReplace2": "",
251
+ "jadeAutoOutputPathStyle": 0,
252
+ "jadeCompileDebug": 1,
253
+ "jadeOutputStyle": 0,
254
+ "javascriptAutoOutputPathEnabled": 1,
255
+ "javascriptAutoOutputPathFilenamePattern": "*-min.js",
256
+ "javascriptAutoOutputPathRelativePath": "\/min",
257
+ "javascriptAutoOutputPathReplace1": "",
258
+ "javascriptAutoOutputPathReplace2": "",
259
+ "javascriptAutoOutputPathStyle": 2,
260
+ "javascriptCreateSourceMap": 1,
261
+ "javascriptOutputStyle": 1,
262
+ "javascriptSyntaxCheckerStyle": 1,
263
+ "jsCheckerReservedNamesString": "",
264
+ "jsHintFlags2": {
265
+ "asi": {
266
+ "active": 0,
267
+ "flagValue": -1
268
+ },
269
+ "bitwise": {
270
+ "active": 1,
271
+ "flagValue": -1
272
+ },
273
+ "boss": {
274
+ "active": 0,
275
+ "flagValue": -1
276
+ },
277
+ "browser": {
278
+ "active": 1,
279
+ "flagValue": -1
280
+ },
281
+ "browserify": {
282
+ "active": 0,
283
+ "flagValue": -1
284
+ },
285
+ "camelcase": {
286
+ "active": 0,
287
+ "flagValue": -1
288
+ },
289
+ "couch": {
290
+ "active": 0,
291
+ "flagValue": -1
292
+ },
293
+ "curly": {
294
+ "active": 1,
295
+ "flagValue": -1
296
+ },
297
+ "debug": {
298
+ "active": 0,
299
+ "flagValue": -1
300
+ },
301
+ "devel": {
302
+ "active": 0,
303
+ "flagValue": -1
304
+ },
305
+ "dojo": {
306
+ "active": 0,
307
+ "flagValue": -1
308
+ },
309
+ "elision": {
310
+ "active": 1,
311
+ "flagValue": -1
312
+ },
313
+ "eqeqeq": {
314
+ "active": 1,
315
+ "flagValue": -1
316
+ },
317
+ "eqnull": {
318
+ "active": 0,
319
+ "flagValue": -1
320
+ },
321
+ "es3": {
322
+ "active": 0,
323
+ "flagValue": -1
324
+ },
325
+ "esnext": {
326
+ "active": 0,
327
+ "flagValue": -1
328
+ },
329
+ "evil": {
330
+ "active": 0,
331
+ "flagValue": -1
332
+ },
333
+ "expr": {
334
+ "active": 0,
335
+ "flagValue": -1
336
+ },
337
+ "forin": {
338
+ "active": 0,
339
+ "flagValue": -1
340
+ },
341
+ "freeze": {
342
+ "active": 1,
343
+ "flagValue": -1
344
+ },
345
+ "funcscope": {
346
+ "active": 0,
347
+ "flagValue": -1
348
+ },
349
+ "futurehostile": {
350
+ "active": 0,
351
+ "flagValue": -1
352
+ },
353
+ "globalstrict": {
354
+ "active": 0,
355
+ "flagValue": -1
356
+ },
357
+ "immed": {
358
+ "active": 0,
359
+ "flagValue": -1
360
+ },
361
+ "indent": {
362
+ "active": 0,
363
+ "flagValue": 4
364
+ },
365
+ "iterator": {
366
+ "active": 0,
367
+ "flagValue": -1
368
+ },
369
+ "jasmine": {
370
+ "active": 0,
371
+ "flagValue": -1
372
+ },
373
+ "jquery": {
374
+ "active": 1,
375
+ "flagValue": -1
376
+ },
377
+ "lastsemic": {
378
+ "active": 0,
379
+ "flagValue": -1
380
+ },
381
+ "latedef": {
382
+ "active": 1,
383
+ "flagValue": -1
384
+ },
385
+ "laxbreak": {
386
+ "active": 0,
387
+ "flagValue": -1
388
+ },
389
+ "laxcomma": {
390
+ "active": 0,
391
+ "flagValue": -1
392
+ },
393
+ "loopfunc": {
394
+ "active": 0,
395
+ "flagValue": -1
396
+ },
397
+ "maxcomplexity": {
398
+ "active": 0,
399
+ "flagValue": 10
400
+ },
401
+ "maxdepth": {
402
+ "active": 0,
403
+ "flagValue": 3
404
+ },
405
+ "maxlen": {
406
+ "active": 0,
407
+ "flagValue": 150
408
+ },
409
+ "maxparams": {
410
+ "active": 0,
411
+ "flagValue": 3
412
+ },
413
+ "maxstatements": {
414
+ "active": 0,
415
+ "flagValue": 4
416
+ },
417
+ "mocha": {
418
+ "active": 0,
419
+ "flagValue": -1
420
+ },
421
+ "mootools": {
422
+ "active": 0,
423
+ "flagValue": -1
424
+ },
425
+ "moz": {
426
+ "active": 0,
427
+ "flagValue": -1
428
+ },
429
+ "multistr": {
430
+ "active": 0,
431
+ "flagValue": -1
432
+ },
433
+ "newcap": {
434
+ "active": 1,
435
+ "flagValue": -1
436
+ },
437
+ "noarg": {
438
+ "active": 1,
439
+ "flagValue": -1
440
+ },
441
+ "nocomma": {
442
+ "active": 0,
443
+ "flagValue": -1
444
+ },
445
+ "node": {
446
+ "active": 0,
447
+ "flagValue": -1
448
+ },
449
+ "noempty": {
450
+ "active": 0,
451
+ "flagValue": -1
452
+ },
453
+ "nonbsp": {
454
+ "active": 0,
455
+ "flagValue": -1
456
+ },
457
+ "nonew": {
458
+ "active": 1,
459
+ "flagValue": -1
460
+ },
461
+ "nonstandard": {
462
+ "active": 0,
463
+ "flagValue": -1
464
+ },
465
+ "notypeof": {
466
+ "active": 1,
467
+ "flagValue": -1
468
+ },
469
+ "noyield": {
470
+ "active": 0,
471
+ "flagValue": -1
472
+ },
473
+ "onecase": {
474
+ "active": 0,
475
+ "flagValue": -1
476
+ },
477
+ "phantom": {
478
+ "active": 0,
479
+ "flagValue": -1
480
+ },
481
+ "plusplus": {
482
+ "active": 0,
483
+ "flagValue": -1
484
+ },
485
+ "proto": {
486
+ "active": 0,
487
+ "flagValue": -1
488
+ },
489
+ "prototypejs": {
490
+ "active": 0,
491
+ "flagValue": -1
492
+ },
493
+ "qunit": {
494
+ "active": 0,
495
+ "flagValue": -1
496
+ },
497
+ "regexp": {
498
+ "active": 1,
499
+ "flagValue": -1
500
+ },
501
+ "rhino": {
502
+ "active": 0,
503
+ "flagValue": -1
504
+ },
505
+ "scripturl": {
506
+ "active": 0,
507
+ "flagValue": -1
508
+ },
509
+ "shadow": {
510
+ "active": 0,
511
+ "flagValue": -1
512
+ },
513
+ "shelljs": {
514
+ "active": 0,
515
+ "flagValue": -1
516
+ },
517
+ "singleGroups": {
518
+ "active": 0,
519
+ "flagValue": -1
520
+ },
521
+ "strict": {
522
+ "active": 0,
523
+ "flagValue": -1
524
+ },
525
+ "sub": {
526
+ "active": 0,
527
+ "flagValue": -1
528
+ },
529
+ "supernew": {
530
+ "active": 0,
531
+ "flagValue": -1
532
+ },
533
+ "typed": {
534
+ "active": 0,
535
+ "flagValue": -1
536
+ },
537
+ "undef": {
538
+ "active": 1,
539
+ "flagValue": -1
540
+ },
541
+ "unused": {
542
+ "active": 1,
543
+ "flagValue": -1
544
+ },
545
+ "varstmt": {
546
+ "active": 0,
547
+ "flagValue": -1
548
+ },
549
+ "withstmt": {
550
+ "active": 0,
551
+ "flagValue": -1
552
+ },
553
+ "worker": {
554
+ "active": 0,
555
+ "flagValue": -1
556
+ },
557
+ "wsh": {
558
+ "active": 0,
559
+ "flagValue": -1
560
+ },
561
+ "yui": {
562
+ "active": 0,
563
+ "flagValue": -1
564
+ }
565
+ },
566
+ "jsLintFlags2": {
567
+ "bitwise": {
568
+ "active": 0,
569
+ "flagValue": -1
570
+ },
571
+ "browser": {
572
+ "active": 1,
573
+ "flagValue": -1
574
+ },
575
+ "couch": {
576
+ "active": 0,
577
+ "flagValue": -1
578
+ },
579
+ "devel": {
580
+ "active": 0,
581
+ "flagValue": -1
582
+ },
583
+ "es6": {
584
+ "active": 0,
585
+ "flagValue": -1
586
+ },
587
+ "eval": {
588
+ "active": 0,
589
+ "flagValue": -1
590
+ },
591
+ "for": {
592
+ "active": 0,
593
+ "flagValue": -1
594
+ },
595
+ "maxlen": {
596
+ "active": 0,
597
+ "flagValue": 150
598
+ },
599
+ "node": {
600
+ "active": 0,
601
+ "flagValue": -1
602
+ },
603
+ "this": {
604
+ "active": 0,
605
+ "flagValue": -1
606
+ },
607
+ "white": {
608
+ "active": 0,
609
+ "flagValue": -1
610
+ }
611
+ },
612
+ "jsonAutoOutputPathEnabled": 0,
613
+ "jsonAutoOutputPathFilenamePattern": "*-min.json",
614
+ "jsonAutoOutputPathRelativePath": "",
615
+ "jsonAutoOutputPathReplace1": "",
616
+ "jsonAutoOutputPathReplace2": "",
617
+ "jsonAutoOutputPathStyle": 0,
618
+ "jsonOrderOutput": 0,
619
+ "jsonOutputStyle": 1,
620
+ "kitAutoOutputPathEnabled": 1,
621
+ "kitAutoOutputPathFilenamePattern": "*.html",
622
+ "kitAutoOutputPathRelativePath": "",
623
+ "kitAutoOutputPathReplace1": "",
624
+ "kitAutoOutputPathReplace2": "",
625
+ "kitAutoOutputPathStyle": 0,
626
+ "lessAllowInsecureImports": 0,
627
+ "lessAutoOutputPathEnabled": 1,
628
+ "lessAutoOutputPathFilenamePattern": "*.css",
629
+ "lessAutoOutputPathRelativePath": "..\/css",
630
+ "lessAutoOutputPathReplace1": "less",
631
+ "lessAutoOutputPathReplace2": "css",
632
+ "lessAutoOutputPathStyle": 2,
633
+ "lessCreateSourceMap": 0,
634
+ "lessDisableJavascript": 0,
635
+ "lessIeCompatibility": 1,
636
+ "lessOutputStyle": 0,
637
+ "lessRelativeURLS": 0,
638
+ "lessStrictImports": 0,
639
+ "lessStrictMath": 0,
640
+ "lessStrictUnits": 0,
641
+ "markdownAutoOutputPathEnabled": 1,
642
+ "markdownAutoOutputPathFilenamePattern": "*.html",
643
+ "markdownAutoOutputPathRelativePath": "",
644
+ "markdownAutoOutputPathReplace1": "",
645
+ "markdownAutoOutputPathReplace2": "",
646
+ "markdownAutoOutputPathStyle": 0,
647
+ "markdownCriticStyle": 0,
648
+ "markdownEnableFootnotes": 1,
649
+ "markdownEnableLabels": 1,
650
+ "markdownEnableSmartQuotes": 1,
651
+ "markdownEscapeLineBreaks": 0,
652
+ "markdownMaskEmailAddresses": 1,
653
+ "markdownOutputFormat": 0,
654
+ "markdownOutputStyle": 0,
655
+ "markdownParseMetadata": 1,
656
+ "markdownProcessHTML": 0,
657
+ "markdownRandomFootnoteNumbers": 0,
658
+ "markdownUseCompatibilityMode": 0,
659
+ "reloadFileURLs": 0,
660
+ "sassAutoOutputPathEnabled": 1,
661
+ "sassAutoOutputPathFilenamePattern": "*.css",
662
+ "sassAutoOutputPathRelativePath": "..\/css",
663
+ "sassAutoOutputPathReplace1": "sass",
664
+ "sassAutoOutputPathReplace2": "css",
665
+ "sassAutoOutputPathStyle": 2,
666
+ "sassCreateSourceMap": 0,
667
+ "sassDebugStyle": 0,
668
+ "sassDecimalPrecision": 10,
669
+ "sassOutputStyle": 0,
670
+ "sassUseLibsass": 0,
671
+ "shouldRunAutoprefixer": 0,
672
+ "shouldRunBless": 0,
673
+ "skippedItemsString": ".svn, .git, .hg, log, _logs, _cache, cache, logs, node_modules",
674
+ "slimAutoOutputPathEnabled": 1,
675
+ "slimAutoOutputPathFilenamePattern": "*.html",
676
+ "slimAutoOutputPathRelativePath": "",
677
+ "slimAutoOutputPathReplace1": "",
678
+ "slimAutoOutputPathReplace2": "",
679
+ "slimAutoOutputPathStyle": 0,
680
+ "slimCompileOnly": 0,
681
+ "slimLogicless": 0,
682
+ "slimOutputFormat": 0,
683
+ "slimOutputStyle": 1,
684
+ "slimRailsCompatible": 0,
685
+ "stylusAutoOutputPathEnabled": 1,
686
+ "stylusAutoOutputPathFilenamePattern": "*.css",
687
+ "stylusAutoOutputPathRelativePath": "..\/css",
688
+ "stylusAutoOutputPathReplace1": "stylus",
689
+ "stylusAutoOutputPathReplace2": "css",
690
+ "stylusAutoOutputPathStyle": 2,
691
+ "stylusCreateSourceMap": 0,
692
+ "stylusDebugStyle": 0,
693
+ "stylusImportCSS": 0,
694
+ "stylusOutputStyle": 0,
695
+ "stylusResolveRelativeURLS": 0,
696
+ "typescriptAutoOutputPathEnabled": 1,
697
+ "typescriptAutoOutputPathFilenamePattern": "*.js",
698
+ "typescriptAutoOutputPathRelativePath": "\/js",
699
+ "typescriptAutoOutputPathReplace1": "",
700
+ "typescriptAutoOutputPathReplace2": "",
701
+ "typescriptAutoOutputPathStyle": 2,
702
+ "typescriptCreateDeclarationFile": 0,
703
+ "typescriptCreateSourceMap": 0,
704
+ "typescriptJSXMode": 0,
705
+ "typescriptMinifyOutput": 0,
706
+ "typescriptModuleResolutionType": 0,
707
+ "typescriptModuleType": 0,
708
+ "typescriptNoImplicitAny": 0,
709
+ "typescriptPreserveConstEnums": 0,
710
+ "typescriptRemoveComments": 0,
711
+ "typescriptSuppressImplicitAnyIndexErrors": 0,
712
+ "typescriptTargetECMAVersion": 0,
713
+ "uglifyDefinesString": "",
714
+ "uglifyFlags2": {
715
+ "ascii-only": {
716
+ "active": 0,
717
+ "flagValue": -1
718
+ },
719
+ "bare-returns": {
720
+ "active": 0,
721
+ "flagValue": -1
722
+ },
723
+ "booleans": {
724
+ "active": 1,
725
+ "flagValue": -1
726
+ },
727
+ "bracketize": {
728
+ "active": 0,
729
+ "flagValue": -1
730
+ },
731
+ "cascade": {
732
+ "active": 1,
733
+ "flagValue": -1
734
+ },
735
+ "comments": {
736
+ "active": 1,
737
+ "flagValue": -1
738
+ },
739
+ "comparisons": {
740
+ "active": 1,
741
+ "flagValue": -1
742
+ },
743
+ "compress": {
744
+ "active": 1,
745
+ "flagValue": -1
746
+ },
747
+ "conditionals": {
748
+ "active": 1,
749
+ "flagValue": -1
750
+ },
751
+ "dead_code": {
752
+ "active": 0,
753
+ "flagValue": -1
754
+ },
755
+ "drop_console": {
756
+ "active": 0,
757
+ "flagValue": -1
758
+ },
759
+ "drop_debugger": {
760
+ "active": 1,
761
+ "flagValue": -1
762
+ },
763
+ "eval": {
764
+ "active": 0,
765
+ "flagValue": -1
766
+ },
767
+ "evaluate": {
768
+ "active": 1,
769
+ "flagValue": -1
770
+ },
771
+ "hoist_funs": {
772
+ "active": 1,
773
+ "flagValue": -1
774
+ },
775
+ "hoist_vars": {
776
+ "active": 0,
777
+ "flagValue": -1
778
+ },
779
+ "if_return": {
780
+ "active": 1,
781
+ "flagValue": -1
782
+ },
783
+ "indent-level": {
784
+ "active": 0,
785
+ "flagValue": 4
786
+ },
787
+ "indent-start": {
788
+ "active": 0,
789
+ "flagValue": 0
790
+ },
791
+ "inline-script": {
792
+ "active": 0,
793
+ "flagValue": -1
794
+ },
795
+ "join_vars": {
796
+ "active": 1,
797
+ "flagValue": -1
798
+ },
799
+ "keep_fargs": {
800
+ "active": 0,
801
+ "flagValue": -1
802
+ },
803
+ "keep_fnames": {
804
+ "active": 0,
805
+ "flagValue": -1
806
+ },
807
+ "loops": {
808
+ "active": 1,
809
+ "flagValue": -1
810
+ },
811
+ "mangle": {
812
+ "active": 1,
813
+ "flagValue": -1
814
+ },
815
+ "max-line-len": {
816
+ "active": 1,
817
+ "flagValue": 32000
818
+ },
819
+ "negate_iife": {
820
+ "active": 1,
821
+ "flagValue": -1
822
+ },
823
+ "properties": {
824
+ "active": 1,
825
+ "flagValue": -1
826
+ },
827
+ "pure_getters": {
828
+ "active": 0,
829
+ "flagValue": -1
830
+ },
831
+ "quote-keys": {
832
+ "active": 0,
833
+ "flagValue": -1
834
+ },
835
+ "screw-ie8": {
836
+ "active": 0,
837
+ "flagValue": -1
838
+ },
839
+ "semicolons": {
840
+ "active": 1,
841
+ "flagValue": -1
842
+ },
843
+ "sequences": {
844
+ "active": 1,
845
+ "flagValue": -1
846
+ },
847
+ "sort": {
848
+ "active": 0,
849
+ "flagValue": -1
850
+ },
851
+ "space-colon": {
852
+ "active": 1,
853
+ "flagValue": -1
854
+ },
855
+ "toplevel": {
856
+ "active": 0,
857
+ "flagValue": -1
858
+ },
859
+ "unsafe": {
860
+ "active": 0,
861
+ "flagValue": -1
862
+ },
863
+ "unused": {
864
+ "active": 0,
865
+ "flagValue": -1
866
+ },
867
+ "warnings": {
868
+ "active": 0,
869
+ "flagValue": -1
870
+ },
871
+ "width": {
872
+ "active": 1,
873
+ "flagValue": 80
874
+ }
875
+ },
876
+ "uglifyReservedNamesString": "$",
877
+ "websiteRelativeRoot": ""
878
+ },
879
+ "settingsFileVersion": "2"
880
+ }
skin/adminhtml/default/default/css/gene/braintree/migration.css ADDED
@@ -0,0 +1,187 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #braintree-migration-overlay {
2
+ position: fixed;
3
+ left: 0;
4
+ top: 0;
5
+ width: 100%;
6
+ height: 100%;
7
+ background: black;
8
+ z-index: 10001;
9
+ opacity: 0;
10
+ -moz-transition: opacity 0.4s ease-in-out;
11
+ -o-transition: opacity 0.4s ease-in-out;
12
+ -webkit-transition: opacity 0.4s ease-in-out;
13
+ transition: opacity 0.4s ease-in-out;
14
+ }
15
+ #braintree-migration-overlay.active {
16
+ opacity: 0.4;
17
+ }
18
+ #braintree-migration {
19
+ position: fixed;
20
+ left: 50%;
21
+ top: 50%;
22
+ width: 850px;
23
+ margin-top: -220px;
24
+ margin-left: -425px;
25
+ background: #303032;
26
+ z-index: 10002;
27
+ opacity: 0;
28
+ -webkit-border-radius: 10px;
29
+ -webkit-border-bottom-right-radius: 3px;
30
+ -webkit-border-bottom-left-radius: 3px;
31
+ -moz-border-radius: 10px;
32
+ -moz-border-radius-bottomright: 3px;
33
+ -moz-border-radius-bottomleft: 3px;
34
+ border-radius: 10px;
35
+ border-bottom-right-radius: 3px;
36
+ border-bottom-left-radius: 3px;
37
+ transform: translateY(80px);
38
+ -moz-transition: opacity 1s ease-in-out, transform 1s ease-in-out;
39
+ -o-transition: opacity 1s ease-in-out, transform 1s ease-in-out;
40
+ -webkit-transition: opacity 1s ease-in-out, transform 1s ease-in-out;
41
+ transition: opacity 1s ease-in-out, transform 1s ease-in-out;
42
+ box-shadow: 0 0 18px rgba(0, 0, 0, 0.1);
43
+ }
44
+ #braintree-migration.active {
45
+ opacity: 1;
46
+ transform: translateY(0px);
47
+ }
48
+ #braintree-migration .braintree-migration-loading {
49
+ display: none;
50
+ }
51
+ #braintree-migration.loading .braintree-migration-content {
52
+ opacity: 0;
53
+ }
54
+ #braintree-migration.loading .braintree-migration-loading {
55
+ background: url('../../../images/gene/braintree/migration/loader.gif') center 120px no-repeat;
56
+ background-size: 60px 60px;
57
+ display: block;
58
+ position: absolute;
59
+ left: 0;
60
+ top: 0;
61
+ width: 100%;
62
+ height: 100%;
63
+ text-align: center;
64
+ color: #e1e1e1;
65
+ }
66
+ #braintree-migration.loading .braintree-migration-loading h3 {
67
+ text-align: center;
68
+ font-weight: normal;
69
+ color: #e1e1e1;
70
+ padding-top: 220px;
71
+ }
72
+ #braintree-migration .braintree-migration-header {
73
+ background: white;
74
+ float: left;
75
+ width: 100%;
76
+ height: 85px;
77
+ line-height: 85px;
78
+ -webkit-border-top-left-radius: 3px;
79
+ -webkit-border-top-right-radius: 3px;
80
+ -moz-border-radius-topleft: 3px;
81
+ -moz-border-radius-topright: 3px;
82
+ border-top-left-radius: 3px;
83
+ border-top-right-radius: 3px;
84
+ vertical-align: middle;
85
+ }
86
+ #braintree-migration .braintree-migration-header .braintree-migration-logos {
87
+ float: left;
88
+ margin-left: 24px;
89
+ height: 85px;
90
+ vertical-align: middle;
91
+ }
92
+ #braintree-migration .braintree-migration-header .braintree-migration-logos .braintree-migration-braintree-logo {
93
+ float: left;
94
+ width: 139px;
95
+ height: 100%;
96
+ background: url('../../../images/gene/braintree/migration/braintree.png') no-repeat;
97
+ background-size: 139px 34px;
98
+ background-position-y: center;
99
+ }
100
+ #braintree-migration .braintree-migration-header .braintree-migration-logos .braintree-migration-plus {
101
+ float: left;
102
+ line-height: 85px;
103
+ padding: 0 18px;
104
+ font-size: 24px;
105
+ }
106
+ #braintree-migration .braintree-migration-header .braintree-migration-logos .braintree-migration-gene-logo {
107
+ line-height: 85px;
108
+ float: left;
109
+ width: 143px;
110
+ height: 100%;
111
+ background: url('../../../images/gene/braintree/migration/gene-logo.png') no-repeat;
112
+ background-size: 143px 40px;
113
+ background-position-y: center;
114
+ }
115
+ #braintree-migration .braintree-migration-header .braintree-migration-heading {
116
+ float: right;
117
+ margin-right: 28px;
118
+ }
119
+ #braintree-migration .braintree-migration-header .braintree-migration-heading h2 {
120
+ height: 85px;
121
+ line-height: 85px;
122
+ margin: 0;
123
+ font-weight: normal;
124
+ }
125
+ #braintree-migration .braintree-migration-main {
126
+ float: left;
127
+ color: #e1e1e1;
128
+ box-sizing: border-box;
129
+ padding: 28px 26px 28px 26px;
130
+ font-size: 13px;
131
+ position: relative;
132
+ }
133
+ #braintree-migration .braintree-migration-main .braintree-migration-content {
134
+ box-sizing: border-box;
135
+ width: 100%;
136
+ line-height: 22px;
137
+ float: left;
138
+ }
139
+ #braintree-migration .braintree-migration-main .braintree-migration-content ul.braintree-migration-options {
140
+ list-style: none;
141
+ padding: 6px 0 12px 0;
142
+ }
143
+ #braintree-migration .braintree-migration-main .braintree-migration-content ul.braintree-migration-options li {
144
+ position: relative;
145
+ padding: 6px 0;
146
+ }
147
+ #braintree-migration .braintree-migration-main .braintree-migration-content ul.braintree-migration-options li > input {
148
+ position: absolute;
149
+ top: 11px;
150
+ }
151
+ #braintree-migration .braintree-migration-main .braintree-migration-content ul.braintree-migration-options li label {
152
+ padding-left: 24px;
153
+ color: #e1e1e1;
154
+ }
155
+ #braintree-migration .braintree-migration-main .braintree-migration-content ul.braintree-migration-options li label span {
156
+ display: block;
157
+ font-size: 12px;
158
+ color: #d6d6d6;
159
+ padding-left: 24px;
160
+ }
161
+ #braintree-migration .braintree-migration-main .braintree-migration-content ul.braintree-migration-options li label span > input {
162
+ margin-right: 6px;
163
+ }
164
+ #braintree-migration .braintree-migration-main .braintree-migration-buttons {
165
+ padding: 18px 0 12px 0;
166
+ }
167
+ #braintree-migration .braintree-migration-main .braintree-migration-buttons .gene-migration-button {
168
+ background: #4C4C4C;
169
+ color: white;
170
+ border: none;
171
+ font-weight: normal;
172
+ padding: 9px 28px;
173
+ margin-right: 6px;
174
+ border-radius: 3px;
175
+ -moz-border-radius: 3px;
176
+ -webkit-border-radius: 3px;
177
+ }
178
+ #braintree-migration .braintree-migration-main .braintree-migration-buttons .gene-migration-button.gene-migration-run {
179
+ background: white;
180
+ color: #4C4C4C;
181
+ }
182
+ #braintree-migration .braintree-migration-main .braintree-migration-buttons .gene-migration-button:hover {
183
+ background: #666666;
184
+ }
185
+ #braintree-migration .braintree-migration-main .braintree-migration-buttons .gene-migration-button:hover.gene-migration-run {
186
+ background: #e6e6e6;
187
+ }
skin/adminhtml/default/default/css/gene/braintree/migration.less ADDED
@@ -0,0 +1,218 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #braintree-migration-overlay {
2
+ position: fixed;
3
+ left: 0;
4
+ top: 0;
5
+ width: 100%;
6
+ height: 100%;
7
+ background: black;
8
+ z-index: 10001;
9
+ opacity: 0;
10
+
11
+ -moz-transition: opacity 0.4s ease-in-out;
12
+ -o-transition: opacity 0.4s ease-in-out;
13
+ -webkit-transition: opacity 0.4s ease-in-out;
14
+ transition: opacity 0.4s ease-in-out;
15
+
16
+ &.active {
17
+ opacity: 0.4;
18
+ }
19
+ }
20
+
21
+ #braintree-migration {
22
+ position: fixed;
23
+ left: 50%;
24
+ top: 50%;
25
+ width: 850px;
26
+ margin-top: -220px;
27
+ margin-left: -425px;
28
+ background: #303032;
29
+ z-index: 10002;
30
+ opacity: 0;
31
+
32
+ -webkit-border-radius: 10px;
33
+ -webkit-border-bottom-right-radius: 3px;
34
+ -webkit-border-bottom-left-radius: 3px;
35
+ -moz-border-radius: 10px;
36
+ -moz-border-radius-bottomright: 3px;
37
+ -moz-border-radius-bottomleft: 3px;
38
+ border-radius: 10px;
39
+ border-bottom-right-radius: 3px;
40
+ border-bottom-left-radius: 3px;
41
+
42
+ transform: translateY(80px);
43
+
44
+ -moz-transition: opacity 1s ease-in-out, transform 1s ease-in-out;
45
+ -o-transition: opacity 1s ease-in-out, transform 1s ease-in-out;
46
+ -webkit-transition: opacity 1s ease-in-out, transform 1s ease-in-out;
47
+ transition: opacity 1s ease-in-out, transform 1s ease-in-out;
48
+
49
+ box-shadow: 0 0 18px rgba(0,0,0,0.1);
50
+
51
+ &.active {
52
+ opacity: 1;
53
+ transform: translateY(0px);
54
+ }
55
+
56
+ .braintree-migration-loading {
57
+ display: none;
58
+ }
59
+
60
+ &.loading {
61
+ .braintree-migration-content {
62
+ opacity: 0;
63
+ }
64
+ .braintree-migration-loading {
65
+ background: url('../../../images/gene/braintree/migration/loader.gif') center 120px no-repeat;
66
+ background-size: 60px 60px;
67
+ display: block;
68
+ position: absolute;
69
+ left: 0;
70
+ top: 0;
71
+ width: 100%;
72
+ height: 100%;
73
+ text-align: center;
74
+ color: #e1e1e1;
75
+
76
+ h3 {
77
+ text-align: center;
78
+ font-weight: normal;
79
+ color: #e1e1e1;
80
+ padding-top: 220px;
81
+ }
82
+ }
83
+ }
84
+
85
+ .braintree-migration-header {
86
+ background: white;
87
+ float: left;
88
+ width: 100%;
89
+ height: 85px;
90
+ line-height: 85px;
91
+
92
+ -webkit-border-top-left-radius: 3px;
93
+ -webkit-border-top-right-radius: 3px;
94
+ -moz-border-radius-topleft: 3px;
95
+ -moz-border-radius-topright: 3px;
96
+ border-top-left-radius: 3px;
97
+ border-top-right-radius: 3px;
98
+
99
+ vertical-align: middle;
100
+
101
+ .braintree-migration-logos {
102
+ float: left;
103
+ margin-left: 24px;
104
+ height: 85px;
105
+ vertical-align: middle;
106
+
107
+ .braintree-migration-braintree-logo {
108
+ float: left;
109
+ width: 139px;
110
+ height: 100%;
111
+ background: url('../../../images/gene/braintree/migration/braintree.png') no-repeat;
112
+ background-size: 139px 34px;
113
+ background-position-y: center;
114
+ }
115
+ .braintree-migration-plus {
116
+ float: left;
117
+ line-height: 85px;
118
+ padding: 0 18px;
119
+ font-size: 24px;
120
+ }
121
+ .braintree-migration-gene-logo {
122
+ line-height: 85px;
123
+ float: left;
124
+ width: 143px;
125
+ height: 100%;
126
+ background: url('../../../images/gene/braintree/migration/gene-logo.png') no-repeat;
127
+ background-size: 143px 40px;
128
+ background-position-y: center;
129
+ }
130
+ }
131
+ .braintree-migration-heading {
132
+ float: right;
133
+ margin-right: 28px;
134
+
135
+ h2 {
136
+ height: 85px;
137
+ line-height: 85px;
138
+ margin: 0;
139
+ font-weight: normal;
140
+ }
141
+ }
142
+ }
143
+
144
+ .braintree-migration-main {
145
+ float: left;
146
+ color: #e1e1e1;
147
+ box-sizing: border-box;
148
+ padding: 28px 26px 28px 26px;
149
+ font-size: 13px;
150
+ position: relative;
151
+
152
+ .braintree-migration-content {
153
+ box-sizing: border-box;
154
+ width: 100%;
155
+ line-height: 22px;
156
+ float: left;
157
+
158
+ ul.braintree-migration-options {
159
+ list-style: none;
160
+ padding: 6px 0 12px 0;
161
+
162
+ li {
163
+ position: relative;
164
+ padding: 6px 0;
165
+ > input {
166
+ position: absolute;
167
+ top: 11px;
168
+ }
169
+ label {
170
+ padding-left: 24px;
171
+ color: #e1e1e1;
172
+
173
+ span {
174
+ display: block;
175
+ font-size: 12px;
176
+ color: #d6d6d6;
177
+ padding-left: 24px;
178
+
179
+ > input {
180
+ margin-right: 6px;
181
+ }
182
+ }
183
+ }
184
+ }
185
+ }
186
+ }
187
+
188
+ .braintree-migration-buttons {
189
+ padding: 18px 0 12px 0;
190
+
191
+ .gene-migration-button {
192
+ background: #4C4C4C;
193
+ color: white;
194
+ border: none;
195
+ font-weight: normal;
196
+ padding: 9px 28px;
197
+ margin-right: 6px;
198
+
199
+ border-radius: 3px;
200
+ -moz-border-radius: 3px;
201
+ -webkit-border-radius: 3px;
202
+
203
+ &.gene-migration-run {
204
+ background: white;
205
+ color: #4C4C4C;
206
+ }
207
+
208
+ &:hover {
209
+ background: lighten(#4C4C4C, 10%);
210
+
211
+ &.gene-migration-run {
212
+ background: darken(white, 10%);
213
+ }
214
+ }
215
+ }
216
+ }
217
+ }
218
+ }
skin/adminhtml/default/default/images/gene/braintree/AE.png ADDED
Binary file
skin/adminhtml/default/default/images/gene/braintree/DI.png ADDED
Binary file
skin/adminhtml/default/default/images/gene/braintree/JCB.png ADDED
Binary file
skin/adminhtml/default/default/images/gene/braintree/MC.png ADDED
Binary file
skin/adminhtml/default/default/images/gene/braintree/ME.png ADDED
Binary file
skin/adminhtml/default/default/images/gene/braintree/PP.png ADDED
Binary file
skin/adminhtml/default/default/images/gene/braintree/VI.png ADDED
Binary file
skin/adminhtml/default/default/images/gene/braintree/card.png ADDED
Binary file
skin/adminhtml/default/default/images/gene/braintree/migration/braintree.png ADDED
Binary file
skin/adminhtml/default/default/images/gene/braintree/migration/gene-logo.png ADDED
Binary file
skin/adminhtml/default/default/images/gene/braintree/migration/loader.gif ADDED
Binary file
skin/adminhtml/default/default/images/gene/loader.gif ADDED
Binary file
{app/code/community/Gene/Braintree/Model → skin/frontend/base/default/css/gene/braintree}/.DS_Store RENAMED
Binary file
skin/frontend/base/default/css/gene/braintree/account.css ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #braintree-saved-payments .payment-methods-container {
2
+ float: left;
3
+ width: 100%;
4
+ margin: 10px 0;
5
+ }
6
+ #braintree-saved-payments .payment-methods-container .payment-methods {
7
+ float: left;
8
+ width: 100%;
9
+ margin: 20px 0;
10
+ }
11
+ #braintree-saved-payments .payment-methods-container .payment-methods table tr td {
12
+ padding: 0 0 10px 0;
13
+ }
14
+ #braintree-saved-payments .payment-methods-container .payment-methods .payment-method-card-number {
15
+ letter-spacing: 3px;
16
+ display: block;
17
+ }
18
+ #braintree-saved-payments .payment-methods-container .payment-methods .payment-method-expiry-date {
19
+ display: block;
20
+ font-size: 12px;
21
+ }
22
+ #braintree-saved-payments .payment-methods-container .payment-methods .method-options a {
23
+ margin-left: 38px;
24
+ }
25
+ form.gene-braintree-edit-form .input-box.card-number {
26
+ line-height: 48px;
27
+ letter-spacing: 3px;
28
+ }
29
+ form.gene-braintree-edit-form .input-box.card-number img {
30
+ margin-right: 14px;
31
+ }
32
+ form.gene-braintree-edit-form .input-box.expiry-date select {
33
+ width: 110px;
34
+ }
35
+ form.gene-braintree-edit-form .input-box.cvv-field input {
36
+ width: 4em !important;
37
+ }
skin/frontend/base/default/css/gene/braintree/account/account.less ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #braintree-saved-payments {
2
+ .payment-methods-container {
3
+ float: left;
4
+ width: 100%;
5
+ margin: 10px 0;
6
+
7
+ .payment-methods {
8
+ float: left;
9
+ width: 100%;
10
+ margin: 20px 0;
11
+
12
+ table {
13
+ tr {
14
+ td {
15
+ padding: 0 0 10px 0;
16
+ }
17
+ }
18
+ }
19
+
20
+ .payment-method-card-number {
21
+ letter-spacing: 3px;
22
+ display: block;
23
+ }
24
+ .payment-method-expiry-date {
25
+ display: block;
26
+ font-size: 12px;
27
+ }
28
+
29
+ .method-options {
30
+ a {
31
+ margin-left: 38px;
32
+ }
33
+ }
34
+ }
35
+ }
36
+ }
37
+
38
+ form.gene-braintree-edit-form {
39
+ .input-box {
40
+ &.card-number {
41
+ line-height: 48px;
42
+ letter-spacing: 3px;
43
+
44
+ img {
45
+ margin-right: 14px;
46
+ }
47
+ }
48
+
49
+ &.expiry-date {
50
+ select {
51
+ width: 110px;
52
+ }
53
+ }
54
+
55
+ &.cvv-field {
56
+ input {
57
+ width: 4em !important;
58
+ }
59
+ }
60
+ }
61
+ }
skin/frontend/base/default/css/gene/braintree/aheadworks.css CHANGED
@@ -1,129 +1,273 @@
1
- /* This checkout extension has lots of fixed widths, leaving styling as default */
2
-
3
- #braintree-paypal-button {
4
- line-height: unset;
5
- padding: 0;
6
  }
7
- #paypal-complete {
8
- position: relative;
9
- background: #fbfaf6;
10
- text-align: center;
11
- z-index: 6;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  }
13
  #paypal-container iframe {
14
- display: none;
15
  }
16
- #paypal-complete label {
17
- margin-bottom: 8px;
 
 
 
 
 
 
 
 
 
 
 
18
  }
19
- #braintree-paypal-button {
20
- margin: 0 auto;
 
 
 
 
 
 
 
 
 
 
21
  }
22
-
23
- #payment_form_gene_braintree_paypal, #payment_form_gene_braintree_creditcard {
24
- padding-top: 6px;
25
- padding-bottom: 6px;
 
 
 
26
  }
27
-
28
  /* Saved Accounts */
29
- #creditcard-saved-accounts, #paypal-saved-accounts {
30
- font-size: 0;
31
- width: 100%;
 
32
  }
33
- #creditcard-saved-accounts tr, #paypal-saved-accounts tr {
34
- border-bottom: 1px dotted lightgrey;
 
35
  }
36
- #creditcard-saved-accounts tr.other-row, #paypal-saved-accounts tr.other-row {
37
- border-bottom: 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  }
39
  #creditcard-saved-accounts label {
40
- padding: 14px 0;
41
- line-height: 48px;
42
- width: auto;
 
43
  }
44
- #creditcard-saved-accounts tr.other-row label, #paypal-saved-accounts tr.other-row label {
45
- padding: 18px 0;
 
46
  }
47
  #paypal-saved-accounts label {
48
- padding: 8px 0;
49
- line-height: 48px;
50
- width: auto;
51
  }
52
- #creditcard-saved-accounts label img {
53
- float: left;
 
 
 
54
  }
55
- #creditcard-saved-accounts label .saved-card-info, #paypal-saved-accounts label .saved-paypal-email {
56
- margin-left: 12px;
57
- float: left;
 
58
  }
59
  #creditcard-saved-accounts label .saved-card-info span {
60
- display: block;
61
- line-height: 24px;
62
  }
63
  #creditcard-saved-accounts label .saved-card-info span.saved-expiry-date {
64
- font-size: 12px;
 
 
65
  }
66
-
67
- /* Hosted Fields */
68
- #braintree-hosted-submit {
69
- display: none;
70
  }
71
- .braintree-input-field {
72
- height: 42px;
73
- max-width: 340px;
74
- padding: 0 10px;
75
- border: 1px solid lightgrey;
76
- background: white;
77
  }
78
- .braintree-card-input-field {
79
- height: 50px;
80
- width: 100%;
81
- max-width: 372px;
82
- border: 1px solid lightgrey;
83
- position: relative;
84
- background: white;
85
  }
86
- .braintree-card-input-field .card-type {
87
- position: absolute;
88
- top: 0;
89
- left: 0;
90
- bottom: 0;
91
- padding: 0 10px 0 8px;
92
  }
93
- .braintree-card-input-field .card-type img {
94
- height: 48px;
95
  }
96
- .braintree-card-input-field #card-number {
97
- float: left;
98
- height: 48px;
99
- width: 100%;
100
- padding-left: 66px;
101
- box-sizing: border-box;
102
  }
103
- #braintree-expiration-container {
104
- display: block;
105
- width: 100%;
106
- vertical-align: middle;
107
- font-size: 0;
108
  }
109
- .braintree-expiration {
110
- width: 70px;
111
- display: inline-block;
112
- *zoom: 1;
113
- *display: inline;
114
  }
115
- .braintree-expiration-seperator {
116
- vertical-align: top;
117
- line-height: 42px;
118
- display: inline-block;
119
- *zoom: 1;
120
- *display: inline;
121
- font-size: 30px;
122
- padding: 0 8px;
123
  }
124
- .braintree-cvv {
125
- width: 80px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  }
127
- .braintree-hostedfield .cvv-what-is-this {
128
- margin-left: 0;
129
- }
1
+ /* Accepted Cards */
2
+ #braintree-accepted-cards img {
3
+ float: left;
4
+ margin-right: 4px;
 
5
  }
6
+ /* Hosted Fields Loading State */
7
+ #credit-card-form.loading {
8
+ position: relative;
9
+ }
10
+ #credit-card-form .braintree-hostedfield {
11
+ opacity: 1;
12
+ }
13
+ #credit-card-form .credit-card-loading {
14
+ display: none;
15
+ }
16
+ #credit-card-form.loading .credit-card-loading {
17
+ position: absolute;
18
+ top: 30%;
19
+ left: 0;
20
+ right: 0;
21
+ width: 100%;
22
+ height: 70%;
23
+ text-align: center;
24
+ display: block;
25
+ }
26
+ #credit-card-form.loading .credit-card-loading img {
27
+ margin: 16px auto;
28
+ }
29
+ #credit-card-form.loading .braintree-hostedfield {
30
+ opacity: 0;
31
+ }
32
+ /* Hosted Fields */
33
+ #braintree-hosted-submit {
34
+ display: none;
35
+ }
36
+ .braintree-input-field {
37
+ height: 42px;
38
+ max-width: 340px;
39
+ padding: 0 10px;
40
+ border: 1px solid lightgrey;
41
+ background: white;
42
+ }
43
+ .braintree-card-input-field {
44
+ height: 50px;
45
+ width: 100%;
46
+ max-width: 372px;
47
+ border: 1px solid lightgrey;
48
+ position: relative;
49
+ background: white;
50
+ }
51
+ .braintree-card-input-field .card-type {
52
+ position: absolute;
53
+ top: 0;
54
+ left: 0;
55
+ bottom: 0;
56
+ padding: 0 10px 0 8px;
57
+ }
58
+ .braintree-card-input-field .card-type img {
59
+ height: 48px;
60
+ }
61
+ .braintree-card-input-field #card-number {
62
+ float: left;
63
+ height: 48px;
64
+ width: 100%;
65
+ padding-left: 66px;
66
+ box-sizing: border-box;
67
+ }
68
+ #braintree-expiration-container {
69
+ display: block;
70
+ width: 100%;
71
+ vertical-align: middle;
72
+ font-size: 0;
73
+ }
74
+ .braintree-expiration {
75
+ width: 70px;
76
+ display: inline-block;
77
+ *zoom: 1;
78
+ *display: inline;
79
+ }
80
+ .braintree-expiration-seperator {
81
+ vertical-align: top;
82
+ line-height: 42px;
83
+ display: inline-block;
84
+ *zoom: 1;
85
+ *display: inline;
86
+ font-size: 30px;
87
+ padding: 0 8px;
88
+ }
89
+ .braintree-cvv {
90
+ width: 80px;
91
+ }
92
+ .braintree-hostedfield .cvv-what-is-this {
93
+ margin-left: 0;
94
  }
95
  #paypal-container iframe {
96
+ display: none;
97
  }
98
+ /* PayPal headless button */
99
+ button.braintree-paypal-button {
100
+ background: #019cde;
101
+ color: white;
102
+ height: 46px;
103
+ line-height: 46px;
104
+ padding: 0 20px 0 18px;
105
+ border: none;
106
+ border-radius: 3px;
107
+ -webkit-border-radius: 3px;
108
+ font-size: 14px;
109
+ float: left;
110
+ cursor: pointer;
111
  }
112
+ button.braintree-paypal-button.braintree-paypal-loading {
113
+ background: #014c6b url('../../../images/gene/braintree/paypal-loading.gif') center center no-repeat;
114
+ background-size: 32px;
115
+ }
116
+ button.braintree-paypal-button.braintree-paypal-loading > span {
117
+ opacity: 0;
118
+ }
119
+ button.braintree-paypal-button.braintree-paypal-loading:hover {
120
+ background: #014c6b url('../../../images/gene/braintree/paypal-loading.gif') center center no-repeat;
121
+ }
122
+ button.braintree-paypal-button:hover {
123
+ background: #0175a6;
124
  }
125
+ button.braintree-paypal-button > span {
126
+ display: block;
127
+ height: 46px;
128
+ line-height: 46px;
129
+ background: url('../../../images/gene/braintree/paypal.png') right center no-repeat;
130
+ background-size: 80px;
131
+ padding-right: 94px;
132
  }
 
133
  /* Saved Accounts */
134
+ #creditcard-saved-accounts,
135
+ #paypal-saved-accounts {
136
+ font-size: 0;
137
+ width: 100%;
138
  }
139
+ #creditcard-saved-accounts tr,
140
+ #paypal-saved-accounts tr {
141
+ border-bottom: 1px dotted lightgrey;
142
  }
143
+ #creditcard-saved-accounts tr td,
144
+ #paypal-saved-accounts tr td {
145
+ vertical-align: middle;
146
+ }
147
+ #payment_form_gene_braintree_creditcard #creditcard-saved-accounts label,
148
+ #payment_form_gene_braintree_paypal #paypal-saved-accounts label,
149
+ #payment_form_gene_braintree_creditcard #creditcard-saved-accounts .label,
150
+ #payment_form_gene_braintree_paypal #paypal-saved-accounts .label {
151
+ width: 100%;
152
+ padding: 0;
153
+ text-align: left;
154
+ float: none;
155
+ }
156
+ #payment_form_gene_braintree_creditcard p,
157
+ #payment_form_gene_braintree_paypal p {
158
+ padding: 0;
159
+ }
160
+ #creditcard-saved-accounts tr.other-row,
161
+ #paypal-saved-accounts tr.other-row {
162
+ border-bottom: 0;
163
  }
164
  #creditcard-saved-accounts label {
165
+ float: left;
166
+ padding: 10px 0;
167
+ line-height: 40px;
168
+ width: 100%;
169
  }
170
+ #creditcard-saved-accounts tr.other-row label,
171
+ #paypal-saved-accounts tr.other-row label {
172
+ padding: 8px 0;
173
  }
174
  #paypal-saved-accounts label {
175
+ padding: 6px 0;
176
+ line-height: 40px;
 
177
  }
178
+ #creditcard-saved-accounts label img,
179
+ #paypal-saved-accounts label img {
180
+ margin-left: 6px;
181
+ height: 40px;
182
+ float: left;
183
  }
184
+ #creditcard-saved-accounts label .saved-card-info,
185
+ #paypal-saved-accounts label .saved-paypal-email {
186
+ margin-left: 14px;
187
+ float: left;
188
  }
189
  #creditcard-saved-accounts label .saved-card-info span {
190
+ line-height: 40px;
 
191
  }
192
  #creditcard-saved-accounts label .saved-card-info span.saved-expiry-date {
193
+ font-size: 12px;
194
+ font-weight: normal;
195
+ margin-left: 14px;
196
  }
197
+ #gene_braintree_creditcard_store_in_vault_div label,
198
+ label[for="gene_braintree_paypal_store_in_vault"] {
199
+ width: auto!important;
 
200
  }
201
+ /* Centrally aligned PayPal button */
202
+ button.braintree-paypal-button {
203
+ margin: 0 auto;
204
+ float: none;
 
 
205
  }
206
+ /* This checkout extension has lots of fixed widths, leaving styling as default */
207
+ #braintree-paypal-button {
208
+ line-height: unset;
209
+ padding: 0;
 
 
 
210
  }
211
+ #paypal-complete {
212
+ position: relative;
213
+ background: #fbfaf6;
214
+ text-align: center;
215
+ z-index: 6;
 
216
  }
217
+ #paypal-container iframe {
218
+ display: none;
219
  }
220
+ #paypal-complete label {
221
+ margin-bottom: 8px;
 
 
 
 
222
  }
223
+ #braintree-paypal-button {
224
+ margin: 0 auto;
 
 
 
225
  }
226
+ #payment_form_gene_braintree_paypal,
227
+ #payment_form_gene_braintree_creditcard {
228
+ padding-top: 6px;
229
+ padding-bottom: 6px;
 
230
  }
231
+ /* Saved Accounts */
232
+ #creditcard-saved-accounts,
233
+ #paypal-saved-accounts {
234
+ font-size: 0;
235
+ width: 100%;
 
 
 
236
  }
237
+ #creditcard-saved-accounts tr,
238
+ #paypal-saved-accounts tr {
239
+ border-bottom: 1px dotted lightgrey;
240
+ }
241
+ #creditcard-saved-accounts tr.other-row,
242
+ #paypal-saved-accounts tr.other-row {
243
+ border-bottom: 0;
244
+ }
245
+ #creditcard-saved-accounts label {
246
+ padding: 14px 0;
247
+ line-height: 48px;
248
+ width: auto;
249
+ }
250
+ #creditcard-saved-accounts tr.other-row label,
251
+ #paypal-saved-accounts tr.other-row label {
252
+ padding: 18px 0;
253
+ }
254
+ #paypal-saved-accounts label {
255
+ padding: 8px 0;
256
+ line-height: 48px;
257
+ width: auto;
258
+ }
259
+ #creditcard-saved-accounts label img {
260
+ float: left;
261
+ }
262
+ #creditcard-saved-accounts label .saved-card-info,
263
+ #paypal-saved-accounts label .saved-paypal-email {
264
+ margin-left: 12px;
265
+ float: left;
266
+ }
267
+ #creditcard-saved-accounts label .saved-card-info span {
268
+ display: block;
269
+ line-height: 24px;
270
+ }
271
+ #creditcard-saved-accounts label .saved-card-info span.saved-expiry-date {
272
+ font-size: 12px;
273
  }
 
 
 
skin/frontend/base/default/css/gene/braintree/amasty.css CHANGED
@@ -1,136 +1,219 @@
1
- #braintree-paypal-button {
2
- line-height: unset;
3
- padding: 0;
4
- margin: 0 auto;
5
  }
6
- #paypal-complete {
7
- margin-top: 12px;
8
- text-align: center;
9
- float: left;
10
- width: 100%;
11
  }
12
- #paypal-container iframe {
13
- display: none;
14
- }
15
- #paypal-label {
16
- line-height: 32px;
17
- display: block;
18
- margin-right: 12px;
19
- }
20
- #paypal-container {
21
- display: block;
22
  }
23
- #creditcard-saved-accounts td, #paypal-saved-accounts td {
24
- vertical-align: middle;
25
  }
26
- #gene_braintree_creditcard_cc_number {
27
- text-indent: 62px!important;
28
- }
29
-
30
- #payment_form_gene_braintree_paypal, #payment_form_gene_braintree_creditcard {
31
- padding-top: 6px;
32
- padding-bottom: 6px;
 
 
33
  }
34
-
35
- /* Saved Accounts */
36
- #creditcard-saved-accounts, #paypal-saved-accounts {
37
- font-size: 0;
38
- width: 100%;
39
  }
40
- #creditcard-saved-accounts tr, #paypal-saved-accounts tr {
41
- border-bottom: 1px dotted lightgrey;
42
  }
43
- #creditcard-saved-accounts tr.other-row, #paypal-saved-accounts tr.other-row {
44
- border-bottom: 0;
45
- }
46
- #creditcard-saved-accounts label {
47
- padding: 14px 0;
48
- line-height: 48px;
49
- width: auto;
50
- }
51
- #creditcard-saved-accounts tr.other-row label, #paypal-saved-accounts tr.other-row label {
52
- padding: 18px 0;
53
- }
54
- #paypal-saved-accounts label {
55
- padding: 8px 0;
56
- line-height: 48px;
57
- width: auto;
58
- }
59
- #creditcard-saved-accounts label img {
60
- float: left;
61
- }
62
- #creditcard-saved-accounts label .saved-card-info, #paypal-saved-accounts label .saved-paypal-email {
63
- margin-left: 12px;
64
- float: left;
65
- }
66
- #creditcard-saved-accounts label .saved-card-info span {
67
- display: block;
68
- line-height: 24px;
69
- }
70
- #creditcard-saved-accounts label .saved-card-info span.saved-expiry-date {
71
- font-size: 12px;
72
- }
73
-
74
  /* Hosted Fields */
75
  #braintree-hosted-submit {
76
- display: none;
77
  }
78
  .braintree-input-field {
79
- height: 42px;
80
- max-width: 340px;
81
- padding: 0 10px;
82
- border: 1px solid lightgrey;
83
- background: white;
84
  }
85
  .braintree-card-input-field {
86
- height: 50px;
87
- width: 100%;
88
- max-width: 372px;
89
- border: 1px solid lightgrey;
90
- position: relative;
91
- background: white;
92
  }
93
  .braintree-card-input-field .card-type {
94
- position: absolute;
95
- top: 0;
96
- left: 0;
97
- bottom: 0;
98
- padding: 0 10px 0 8px;
99
  }
100
  .braintree-card-input-field .card-type img {
101
- height: 48px;
102
  }
103
  .braintree-card-input-field #card-number {
104
- float: left;
105
- height: 48px;
106
- width: 100%;
107
- padding-left: 66px;
108
- box-sizing: border-box;
109
  }
110
  #braintree-expiration-container {
111
- display: block;
112
- width: 100%;
113
- vertical-align: middle;
114
- font-size: 0;
115
  }
116
  .braintree-expiration {
117
- width: 70px;
118
- display: inline-block;
119
- *zoom: 1;
120
- *display: inline;
121
  }
122
  .braintree-expiration-seperator {
123
- vertical-align: top;
124
- line-height: 42px;
125
- display: inline-block;
126
- *zoom: 1;
127
- *display: inline;
128
- font-size: 30px;
129
- padding: 0 8px;
130
  }
131
  .braintree-cvv {
132
- width: 80px;
133
  }
134
  .braintree-hostedfield .cvv-what-is-this {
135
- margin-left: 0;
136
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Accepted Cards */
2
+ #braintree-accepted-cards img {
3
+ float: left;
4
+ margin-right: 4px;
5
  }
6
+ /* Hosted Fields Loading State */
7
+ #credit-card-form.loading {
8
+ position: relative;
 
 
9
  }
10
+ #credit-card-form .braintree-hostedfield {
11
+ opacity: 1;
 
 
 
 
 
 
 
 
12
  }
13
+ #credit-card-form .credit-card-loading {
14
+ display: none;
15
  }
16
+ #credit-card-form.loading .credit-card-loading {
17
+ position: absolute;
18
+ top: 30%;
19
+ left: 0;
20
+ right: 0;
21
+ width: 100%;
22
+ height: 70%;
23
+ text-align: center;
24
+ display: block;
25
  }
26
+ #credit-card-form.loading .credit-card-loading img {
27
+ margin: 16px auto;
 
 
 
28
  }
29
+ #credit-card-form.loading .braintree-hostedfield {
30
+ opacity: 0;
31
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  /* Hosted Fields */
33
  #braintree-hosted-submit {
34
+ display: none;
35
  }
36
  .braintree-input-field {
37
+ height: 42px;
38
+ max-width: 340px;
39
+ padding: 0 10px;
40
+ border: 1px solid lightgrey;
41
+ background: white;
42
  }
43
  .braintree-card-input-field {
44
+ height: 50px;
45
+ width: 100%;
46
+ max-width: 372px;
47
+ border: 1px solid lightgrey;
48
+ position: relative;
49
+ background: white;
50
  }
51
  .braintree-card-input-field .card-type {
52
+ position: absolute;
53
+ top: 0;
54
+ left: 0;
55
+ bottom: 0;
56
+ padding: 0 10px 0 8px;
57
  }
58
  .braintree-card-input-field .card-type img {
59
+ height: 48px;
60
  }
61
  .braintree-card-input-field #card-number {
62
+ float: left;
63
+ height: 48px;
64
+ width: 100%;
65
+ padding-left: 66px;
66
+ box-sizing: border-box;
67
  }
68
  #braintree-expiration-container {
69
+ display: block;
70
+ width: 100%;
71
+ vertical-align: middle;
72
+ font-size: 0;
73
  }
74
  .braintree-expiration {
75
+ width: 70px;
76
+ display: inline-block;
77
+ *zoom: 1;
78
+ *display: inline;
79
  }
80
  .braintree-expiration-seperator {
81
+ vertical-align: top;
82
+ line-height: 42px;
83
+ display: inline-block;
84
+ *zoom: 1;
85
+ *display: inline;
86
+ font-size: 30px;
87
+ padding: 0 8px;
88
  }
89
  .braintree-cvv {
90
+ width: 80px;
91
  }
92
  .braintree-hostedfield .cvv-what-is-this {
93
+ margin-left: 0;
94
+ }
95
+ #paypal-container iframe {
96
+ display: none;
97
+ }
98
+ /* PayPal headless button */
99
+ button.braintree-paypal-button {
100
+ background: #019cde;
101
+ color: white;
102
+ height: 46px;
103
+ line-height: 46px;
104
+ padding: 0 20px 0 18px;
105
+ border: none;
106
+ border-radius: 3px;
107
+ -webkit-border-radius: 3px;
108
+ font-size: 14px;
109
+ float: left;
110
+ cursor: pointer;
111
+ }
112
+ button.braintree-paypal-button.braintree-paypal-loading {
113
+ background: #014c6b url('../../../images/gene/braintree/paypal-loading.gif') center center no-repeat;
114
+ background-size: 32px;
115
+ }
116
+ button.braintree-paypal-button.braintree-paypal-loading > span {
117
+ opacity: 0;
118
+ }
119
+ button.braintree-paypal-button.braintree-paypal-loading:hover {
120
+ background: #014c6b url('../../../images/gene/braintree/paypal-loading.gif') center center no-repeat;
121
+ }
122
+ button.braintree-paypal-button:hover {
123
+ background: #0175a6;
124
+ }
125
+ button.braintree-paypal-button > span {
126
+ display: block;
127
+ height: 46px;
128
+ line-height: 46px;
129
+ background: url('../../../images/gene/braintree/paypal.png') right center no-repeat;
130
+ background-size: 80px;
131
+ padding-right: 94px;
132
+ }
133
+ /* Saved Accounts */
134
+ #creditcard-saved-accounts,
135
+ #paypal-saved-accounts {
136
+ font-size: 0;
137
+ width: 100%;
138
+ }
139
+ #creditcard-saved-accounts tr,
140
+ #paypal-saved-accounts tr {
141
+ border-bottom: 1px dotted lightgrey;
142
+ }
143
+ #creditcard-saved-accounts tr td,
144
+ #paypal-saved-accounts tr td {
145
+ vertical-align: middle;
146
+ }
147
+ #payment_form_gene_braintree_creditcard #creditcard-saved-accounts label,
148
+ #payment_form_gene_braintree_paypal #paypal-saved-accounts label,
149
+ #payment_form_gene_braintree_creditcard #creditcard-saved-accounts .label,
150
+ #payment_form_gene_braintree_paypal #paypal-saved-accounts .label {
151
+ width: 100%;
152
+ padding: 0;
153
+ text-align: left;
154
+ float: none;
155
+ }
156
+ #payment_form_gene_braintree_creditcard p,
157
+ #payment_form_gene_braintree_paypal p {
158
+ padding: 0;
159
+ }
160
+ #creditcard-saved-accounts tr.other-row,
161
+ #paypal-saved-accounts tr.other-row {
162
+ border-bottom: 0;
163
+ }
164
+ #creditcard-saved-accounts label {
165
+ float: left;
166
+ padding: 10px 0;
167
+ line-height: 40px;
168
+ width: 100%;
169
+ }
170
+ #creditcard-saved-accounts tr.other-row label,
171
+ #paypal-saved-accounts tr.other-row label {
172
+ padding: 8px 0;
173
+ }
174
+ #paypal-saved-accounts label {
175
+ padding: 6px 0;
176
+ line-height: 40px;
177
+ }
178
+ #creditcard-saved-accounts label img,
179
+ #paypal-saved-accounts label img {
180
+ margin-left: 6px;
181
+ height: 40px;
182
+ float: left;
183
+ }
184
+ #creditcard-saved-accounts label .saved-card-info,
185
+ #paypal-saved-accounts label .saved-paypal-email {
186
+ margin-left: 14px;
187
+ float: left;
188
+ }
189
+ #creditcard-saved-accounts label .saved-card-info span {
190
+ line-height: 40px;
191
+ }
192
+ #creditcard-saved-accounts label .saved-card-info span.saved-expiry-date {
193
+ font-size: 12px;
194
+ font-weight: normal;
195
+ margin-left: 14px;
196
+ }
197
+ #gene_braintree_creditcard_store_in_vault_div label,
198
+ label[for="gene_braintree_paypal_store_in_vault"] {
199
+ width: auto!important;
200
+ }
201
+ /* Centrally aligned PayPal button */
202
+ button.braintree-paypal-button {
203
+ margin: 10px 0;
204
+ }
205
+ button.braintree-paypal-button > span {
206
+ text-align: right;
207
+ }
208
+ #creditcard-saved-accounts td,
209
+ #paypal-saved-accounts td {
210
+ vertical-align: middle;
211
+ }
212
+ #gene_braintree_creditcard_cc_number {
213
+ text-indent: 62px!important;
214
+ }
215
+ #payment_form_gene_braintree_paypal,
216
+ #payment_form_gene_braintree_creditcard {
217
+ padding-top: 6px;
218
+ padding-bottom: 6px;
219
+ }
skin/frontend/base/default/css/gene/braintree/config.codekit ADDED
@@ -0,0 +1,1230 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": "19115",
4
+ "files": {
5
+ "\/account.css": {
6
+ "fileType": 16,
7
+ "ignore": 1,
8
+ "ignoreWasSetByUser": 0,
9
+ "inputAbbreviatedPath": "\/account.css",
10
+ "outputAbbreviatedPath": "No Output Path",
11
+ "outputPathIsOutsideProject": 0,
12
+ "outputPathIsSetByUser": 0
13
+ },
14
+ "\/account\/account.less": {
15
+ "allowInsecureImports": 0,
16
+ "createSourceMap": 0,
17
+ "disableJavascript": 0,
18
+ "fileType": 1,
19
+ "ieCompatibility": 1,
20
+ "ignore": 0,
21
+ "ignoreWasSetByUser": 0,
22
+ "inputAbbreviatedPath": "\/account\/account.less",
23
+ "outputAbbreviatedPath": "\/account.css",
24
+ "outputPathIsOutsideProject": 0,
25
+ "outputPathIsSetByUser": 1,
26
+ "outputStyle": 0,
27
+ "relativeURLS": 0,
28
+ "shouldRunAutoprefixer": 0,
29
+ "shouldRunBless": 0,
30
+ "strictImports": 0,
31
+ "strictMath": 0,
32
+ "strictUnits": 0
33
+ },
34
+ "\/aheadworks.css": {
35
+ "fileType": 16,
36
+ "ignore": 1,
37
+ "ignoreWasSetByUser": 0,
38
+ "inputAbbreviatedPath": "\/aheadworks.css",
39
+ "outputAbbreviatedPath": "No Output Path",
40
+ "outputPathIsOutsideProject": 0,
41
+ "outputPathIsSetByUser": 0
42
+ },
43
+ "\/amasty.css": {
44
+ "fileType": 16,
45
+ "ignore": 1,
46
+ "ignoreWasSetByUser": 0,
47
+ "inputAbbreviatedPath": "\/amasty.css",
48
+ "outputAbbreviatedPath": "No Output Path",
49
+ "outputPathIsOutsideProject": 0,
50
+ "outputPathIsSetByUser": 0
51
+ },
52
+ "\/core\/_general.less": {
53
+ "allowInsecureImports": 0,
54
+ "createSourceMap": 0,
55
+ "disableJavascript": 0,
56
+ "fileType": 1,
57
+ "ieCompatibility": 1,
58
+ "ignore": 1,
59
+ "ignoreWasSetByUser": 0,
60
+ "inputAbbreviatedPath": "\/core\/_general.less",
61
+ "outputAbbreviatedPath": "\/css\/_general.css",
62
+ "outputPathIsOutsideProject": 0,
63
+ "outputPathIsSetByUser": 0,
64
+ "outputStyle": 0,
65
+ "relativeURLS": 0,
66
+ "shouldRunAutoprefixer": 0,
67
+ "shouldRunBless": 0,
68
+ "strictImports": 0,
69
+ "strictMath": 0,
70
+ "strictUnits": 0
71
+ },
72
+ "\/core\/_hostedfields.less": {
73
+ "allowInsecureImports": 0,
74
+ "createSourceMap": 0,
75
+ "disableJavascript": 0,
76
+ "fileType": 1,
77
+ "ieCompatibility": 1,
78
+ "ignore": 1,
79
+ "ignoreWasSetByUser": 0,
80
+ "inputAbbreviatedPath": "\/core\/_hostedfields.less",
81
+ "outputAbbreviatedPath": "\/css\/_hostedfields.css",
82
+ "outputPathIsOutsideProject": 0,
83
+ "outputPathIsSetByUser": 0,
84
+ "outputStyle": 0,
85
+ "relativeURLS": 0,
86
+ "shouldRunAutoprefixer": 0,
87
+ "shouldRunBless": 0,
88
+ "strictImports": 0,
89
+ "strictMath": 0,
90
+ "strictUnits": 0
91
+ },
92
+ "\/core\/_paypal.less": {
93
+ "allowInsecureImports": 0,
94
+ "createSourceMap": 0,
95
+ "disableJavascript": 0,
96
+ "fileType": 1,
97
+ "ieCompatibility": 1,
98
+ "ignore": 1,
99
+ "ignoreWasSetByUser": 0,
100
+ "inputAbbreviatedPath": "\/core\/_paypal.less",
101
+ "outputAbbreviatedPath": "\/css\/_paypal.css",
102
+ "outputPathIsOutsideProject": 0,
103
+ "outputPathIsSetByUser": 0,
104
+ "outputStyle": 0,
105
+ "relativeURLS": 0,
106
+ "shouldRunAutoprefixer": 0,
107
+ "shouldRunBless": 0,
108
+ "strictImports": 0,
109
+ "strictMath": 0,
110
+ "strictUnits": 0
111
+ },
112
+ "\/core\/_saved.less": {
113
+ "allowInsecureImports": 0,
114
+ "createSourceMap": 0,
115
+ "disableJavascript": 0,
116
+ "fileType": 1,
117
+ "ieCompatibility": 1,
118
+ "ignore": 1,
119
+ "ignoreWasSetByUser": 0,
120
+ "inputAbbreviatedPath": "\/core\/_saved.less",
121
+ "outputAbbreviatedPath": "\/css\/_saved.css",
122
+ "outputPathIsOutsideProject": 0,
123
+ "outputPathIsSetByUser": 0,
124
+ "outputStyle": 0,
125
+ "relativeURLS": 0,
126
+ "shouldRunAutoprefixer": 0,
127
+ "shouldRunBless": 0,
128
+ "strictImports": 0,
129
+ "strictMath": 0,
130
+ "strictUnits": 0
131
+ },
132
+ "\/default.css": {
133
+ "fileType": 16,
134
+ "ignore": 1,
135
+ "ignoreWasSetByUser": 0,
136
+ "inputAbbreviatedPath": "\/default.css",
137
+ "outputAbbreviatedPath": "No Output Path",
138
+ "outputPathIsOutsideProject": 0,
139
+ "outputPathIsSetByUser": 0
140
+ },
141
+ "\/express.css": {
142
+ "fileType": 16,
143
+ "ignore": 0,
144
+ "ignoreWasSetByUser": 0,
145
+ "inputAbbreviatedPath": "\/express.css",
146
+ "outputAbbreviatedPath": "No Output Path",
147
+ "outputPathIsOutsideProject": 0,
148
+ "outputPathIsSetByUser": 0
149
+ },
150
+ "\/firecheckout.css": {
151
+ "fileType": 16,
152
+ "ignore": 1,
153
+ "ignoreWasSetByUser": 0,
154
+ "inputAbbreviatedPath": "\/firecheckout.css",
155
+ "outputAbbreviatedPath": "No Output Path",
156
+ "outputPathIsOutsideProject": 0,
157
+ "outputPathIsSetByUser": 0
158
+ },
159
+ "\/fme.css": {
160
+ "fileType": 16,
161
+ "ignore": 1,
162
+ "ignoreWasSetByUser": 0,
163
+ "inputAbbreviatedPath": "\/fme.css",
164
+ "outputAbbreviatedPath": "No Output Path",
165
+ "outputPathIsOutsideProject": 0,
166
+ "outputPathIsSetByUser": 0
167
+ },
168
+ "\/idev.css": {
169
+ "fileType": 16,
170
+ "ignore": 1,
171
+ "ignoreWasSetByUser": 0,
172
+ "inputAbbreviatedPath": "\/idev.css",
173
+ "outputAbbreviatedPath": "No Output Path",
174
+ "outputPathIsOutsideProject": 0,
175
+ "outputPathIsSetByUser": 0
176
+ },
177
+ "\/integrations\/aheadworks.less": {
178
+ "allowInsecureImports": 0,
179
+ "createSourceMap": 0,
180
+ "disableJavascript": 0,
181
+ "fileType": 1,
182
+ "ieCompatibility": 1,
183
+ "ignore": 0,
184
+ "ignoreWasSetByUser": 0,
185
+ "inputAbbreviatedPath": "\/integrations\/aheadworks.less",
186
+ "outputAbbreviatedPath": "\/aheadworks-0.1.css",
187
+ "outputPathIsOutsideProject": 0,
188
+ "outputPathIsSetByUser": 1,
189
+ "outputStyle": 0,
190
+ "relativeURLS": 0,
191
+ "shouldRunAutoprefixer": 0,
192
+ "shouldRunBless": 0,
193
+ "strictImports": 0,
194
+ "strictMath": 0,
195
+ "strictUnits": 0
196
+ },
197
+ "\/integrations\/amasty.less": {
198
+ "allowInsecureImports": 0,
199
+ "createSourceMap": 0,
200
+ "disableJavascript": 0,
201
+ "fileType": 1,
202
+ "ieCompatibility": 1,
203
+ "ignore": 0,
204
+ "ignoreWasSetByUser": 0,
205
+ "inputAbbreviatedPath": "\/integrations\/amasty.less",
206
+ "outputAbbreviatedPath": "\/amasty-0.1.css",
207
+ "outputPathIsOutsideProject": 0,
208
+ "outputPathIsSetByUser": 1,
209
+ "outputStyle": 0,
210
+ "relativeURLS": 0,
211
+ "shouldRunAutoprefixer": 0,
212
+ "shouldRunBless": 0,
213
+ "strictImports": 0,
214
+ "strictMath": 0,
215
+ "strictUnits": 0
216
+ },
217
+ "\/integrations\/default.less": {
218
+ "allowInsecureImports": 0,
219
+ "createSourceMap": 0,
220
+ "disableJavascript": 0,
221
+ "fileType": 1,
222
+ "ieCompatibility": 1,
223
+ "ignore": 0,
224
+ "ignoreWasSetByUser": 0,
225
+ "inputAbbreviatedPath": "\/integrations\/default.less",
226
+ "outputAbbreviatedPath": "\/default-0.1.css",
227
+ "outputPathIsOutsideProject": 0,
228
+ "outputPathIsSetByUser": 1,
229
+ "outputStyle": 0,
230
+ "relativeURLS": 0,
231
+ "shouldRunAutoprefixer": 0,
232
+ "shouldRunBless": 0,
233
+ "strictImports": 0,
234
+ "strictMath": 0,
235
+ "strictUnits": 0
236
+ },
237
+ "\/integrations\/firecheckout.less": {
238
+ "allowInsecureImports": 0,
239
+ "createSourceMap": 0,
240
+ "disableJavascript": 0,
241
+ "fileType": 1,
242
+ "ieCompatibility": 1,
243
+ "ignore": 0,
244
+ "ignoreWasSetByUser": 0,
245
+ "inputAbbreviatedPath": "\/integrations\/firecheckout.less",
246
+ "outputAbbreviatedPath": "\/firecheckout-0.1.css",
247
+ "outputPathIsOutsideProject": 0,
248
+ "outputPathIsSetByUser": 1,
249
+ "outputStyle": 0,
250
+ "relativeURLS": 0,
251
+ "shouldRunAutoprefixer": 0,
252
+ "shouldRunBless": 0,
253
+ "strictImports": 0,
254
+ "strictMath": 0,
255
+ "strictUnits": 0
256
+ },
257
+ "\/integrations\/fme.less": {
258
+ "allowInsecureImports": 0,
259
+ "createSourceMap": 0,
260
+ "disableJavascript": 0,
261
+ "fileType": 1,
262
+ "ieCompatibility": 1,
263
+ "ignore": 0,
264
+ "ignoreWasSetByUser": 0,
265
+ "inputAbbreviatedPath": "\/integrations\/fme.less",
266
+ "outputAbbreviatedPath": "\/fme-0.1.css",
267
+ "outputPathIsOutsideProject": 0,
268
+ "outputPathIsSetByUser": 1,
269
+ "outputStyle": 0,
270
+ "relativeURLS": 0,
271
+ "shouldRunAutoprefixer": 0,
272
+ "shouldRunBless": 0,
273
+ "strictImports": 0,
274
+ "strictMath": 0,
275
+ "strictUnits": 0
276
+ },
277
+ "\/integrations\/idev.less": {
278
+ "allowInsecureImports": 0,
279
+ "createSourceMap": 0,
280
+ "disableJavascript": 0,
281
+ "fileType": 1,
282
+ "ieCompatibility": 1,
283
+ "ignore": 0,
284
+ "ignoreWasSetByUser": 0,
285
+ "inputAbbreviatedPath": "\/integrations\/idev.less",
286
+ "outputAbbreviatedPath": "\/idev-0.1.css",
287
+ "outputPathIsOutsideProject": 0,
288
+ "outputPathIsSetByUser": 1,
289
+ "outputStyle": 0,
290
+ "relativeURLS": 0,
291
+ "shouldRunAutoprefixer": 0,
292
+ "shouldRunBless": 0,
293
+ "strictImports": 0,
294
+ "strictMath": 0,
295
+ "strictUnits": 0
296
+ },
297
+ "\/integrations\/iwd.less": {
298
+ "allowInsecureImports": 0,
299
+ "createSourceMap": 0,
300
+ "disableJavascript": 0,
301
+ "fileType": 1,
302
+ "ieCompatibility": 1,
303
+ "ignore": 0,
304
+ "ignoreWasSetByUser": 0,
305
+ "inputAbbreviatedPath": "\/integrations\/iwd.less",
306
+ "outputAbbreviatedPath": "\/iwd-0.1.css",
307
+ "outputPathIsOutsideProject": 0,
308
+ "outputPathIsSetByUser": 1,
309
+ "outputStyle": 0,
310
+ "relativeURLS": 0,
311
+ "shouldRunAutoprefixer": 0,
312
+ "shouldRunBless": 0,
313
+ "strictImports": 0,
314
+ "strictMath": 0,
315
+ "strictUnits": 0
316
+ },
317
+ "\/integrations\/magestore.less": {
318
+ "allowInsecureImports": 0,
319
+ "createSourceMap": 0,
320
+ "disableJavascript": 0,
321
+ "fileType": 1,
322
+ "ieCompatibility": 1,
323
+ "ignore": 0,
324
+ "ignoreWasSetByUser": 0,
325
+ "inputAbbreviatedPath": "\/integrations\/magestore.less",
326
+ "outputAbbreviatedPath": "\/magestore-0.1.css",
327
+ "outputPathIsOutsideProject": 0,
328
+ "outputPathIsSetByUser": 1,
329
+ "outputStyle": 0,
330
+ "relativeURLS": 0,
331
+ "shouldRunAutoprefixer": 0,
332
+ "shouldRunBless": 0,
333
+ "strictImports": 0,
334
+ "strictMath": 0,
335
+ "strictUnits": 0
336
+ },
337
+ "\/integrations\/oye.less": {
338
+ "allowInsecureImports": 0,
339
+ "createSourceMap": 0,
340
+ "disableJavascript": 0,
341
+ "fileType": 1,
342
+ "ieCompatibility": 1,
343
+ "ignore": 0,
344
+ "ignoreWasSetByUser": 0,
345
+ "inputAbbreviatedPath": "\/integrations\/oye.less",
346
+ "outputAbbreviatedPath": "\/oye-0.1.css",
347
+ "outputPathIsOutsideProject": 0,
348
+ "outputPathIsSetByUser": 1,
349
+ "outputStyle": 0,
350
+ "relativeURLS": 0,
351
+ "shouldRunAutoprefixer": 0,
352
+ "shouldRunBless": 0,
353
+ "strictImports": 0,
354
+ "strictMath": 0,
355
+ "strictUnits": 0
356
+ },
357
+ "\/integrations\/unicode.less": {
358
+ "allowInsecureImports": 0,
359
+ "createSourceMap": 0,
360
+ "disableJavascript": 0,
361
+ "fileType": 1,
362
+ "ieCompatibility": 1,
363
+ "ignore": 0,
364
+ "ignoreWasSetByUser": 0,
365
+ "inputAbbreviatedPath": "\/integrations\/unicode.less",
366
+ "outputAbbreviatedPath": "\/unicode-0.1.css",
367
+ "outputPathIsOutsideProject": 0,
368
+ "outputPathIsSetByUser": 1,
369
+ "outputStyle": 0,
370
+ "relativeURLS": 0,
371
+ "shouldRunAutoprefixer": 0,
372
+ "shouldRunBless": 0,
373
+ "strictImports": 0,
374
+ "strictMath": 0,
375
+ "strictUnits": 0
376
+ },
377
+ "\/iwd.css": {
378
+ "fileType": 16,
379
+ "ignore": 1,
380
+ "ignoreWasSetByUser": 0,
381
+ "inputAbbreviatedPath": "\/iwd.css",
382
+ "outputAbbreviatedPath": "No Output Path",
383
+ "outputPathIsOutsideProject": 0,
384
+ "outputPathIsSetByUser": 0
385
+ },
386
+ "\/magestore.css": {
387
+ "fileType": 16,
388
+ "ignore": 1,
389
+ "ignoreWasSetByUser": 0,
390
+ "inputAbbreviatedPath": "\/magestore.css",
391
+ "outputAbbreviatedPath": "No Output Path",
392
+ "outputPathIsOutsideProject": 0,
393
+ "outputPathIsSetByUser": 0
394
+ },
395
+ "\/oye.css": {
396
+ "fileType": 16,
397
+ "ignore": 1,
398
+ "ignoreWasSetByUser": 0,
399
+ "inputAbbreviatedPath": "\/oye.css",
400
+ "outputAbbreviatedPath": "No Output Path",
401
+ "outputPathIsOutsideProject": 0,
402
+ "outputPathIsSetByUser": 0
403
+ },
404
+ "\/unicode.css": {
405
+ "fileType": 16,
406
+ "ignore": 1,
407
+ "ignoreWasSetByUser": 0,
408
+ "inputAbbreviatedPath": "\/unicode.css",
409
+ "outputAbbreviatedPath": "No Output Path",
410
+ "outputPathIsOutsideProject": 0,
411
+ "outputPathIsSetByUser": 0
412
+ }
413
+ },
414
+ "hooks": [
415
+ ],
416
+ "lastSavedByUser": "David Macaulay",
417
+ "manualImportLinks": {
418
+ },
419
+ "projectAttributes": {
420
+ "bowerAbbreviatedPath": "",
421
+ "displayValue": "braintree",
422
+ "displayValueWasSetByUser": 0,
423
+ "iconImageName": "globe_gray"
424
+ },
425
+ "projectSettings": {
426
+ "alwaysUseExternalServer": 1,
427
+ "animateCSSInjections": 1,
428
+ "autoApplyPSLanguageSettingsStyle": 0,
429
+ "autoprefixerBrowserString": "> 1%, last 2 versions, Firefox ESR, Opera 12.1",
430
+ "autoSyncProjectSettingsFile": 1,
431
+ "browserRefreshDelay": 0,
432
+ "coffeeAutoOutputPathEnabled": 1,
433
+ "coffeeAutoOutputPathFilenamePattern": "*.js",
434
+ "coffeeAutoOutputPathRelativePath": "",
435
+ "coffeeAutoOutputPathReplace1": "",
436
+ "coffeeAutoOutputPathReplace2": "",
437
+ "coffeeAutoOutputPathStyle": 0,
438
+ "coffeeCreateSourceMap": 0,
439
+ "coffeeLintFlags2": {
440
+ "arrow_spacing": {
441
+ "active": 0,
442
+ "flagValue": -1
443
+ },
444
+ "camel_case_classes": {
445
+ "active": 1,
446
+ "flagValue": -1
447
+ },
448
+ "colon_assignment_spacing": {
449
+ "active": 0,
450
+ "flagValue": 1
451
+ },
452
+ "cyclomatic_complexity": {
453
+ "active": 0,
454
+ "flagValue": 10
455
+ },
456
+ "duplicate_key": {
457
+ "active": 1,
458
+ "flagValue": -1
459
+ },
460
+ "empty_constructor_needs_parens": {
461
+ "active": 0,
462
+ "flagValue": -1
463
+ },
464
+ "ensure_comprehensions": {
465
+ "active": 1,
466
+ "flagValue": -1
467
+ },
468
+ "indentation": {
469
+ "active": 1,
470
+ "flagValue": 2
471
+ },
472
+ "line_endings": {
473
+ "active": 0,
474
+ "flagValue": 0
475
+ },
476
+ "max_line_length": {
477
+ "active": 0,
478
+ "flagValue": 150
479
+ },
480
+ "missing_fat_arrows": {
481
+ "active": 0,
482
+ "flagValue": -1
483
+ },
484
+ "newlines_after_classes": {
485
+ "active": 0,
486
+ "flagValue": 3
487
+ },
488
+ "no_backticks": {
489
+ "active": 1,
490
+ "flagValue": -1
491
+ },
492
+ "no_debugger": {
493
+ "active": 1,
494
+ "flagValue": -1
495
+ },
496
+ "no_empty_functions": {
497
+ "active": 0,
498
+ "flagValue": -1
499
+ },
500
+ "no_empty_param_list": {
501
+ "active": 0,
502
+ "flagValue": -1
503
+ },
504
+ "no_implicit_braces": {
505
+ "active": 1,
506
+ "flagValue": -1
507
+ },
508
+ "no_implicit_parens": {
509
+ "active": 0,
510
+ "flagValue": -1
511
+ },
512
+ "no_interpolation_in_single_quotes": {
513
+ "active": 0,
514
+ "flagValue": -1
515
+ },
516
+ "no_nested_string_interpolation": {
517
+ "active": 1,
518
+ "flagValue": -1
519
+ },
520
+ "no_plusplus": {
521
+ "active": 0,
522
+ "flagValue": -1
523
+ },
524
+ "no_private_function_fat_arrows": {
525
+ "active": 1,
526
+ "flagValue": -1
527
+ },
528
+ "no_stand_alone_at": {
529
+ "active": 1,
530
+ "flagValue": -1
531
+ },
532
+ "no_tabs": {
533
+ "active": 1,
534
+ "flagValue": -1
535
+ },
536
+ "no_this": {
537
+ "active": 0,
538
+ "flagValue": -1
539
+ },
540
+ "no_throwing_strings": {
541
+ "active": 1,
542
+ "flagValue": -1
543
+ },
544
+ "no_trailing_semicolons": {
545
+ "active": 1,
546
+ "flagValue": -1
547
+ },
548
+ "no_trailing_whitespace": {
549
+ "active": 1,
550
+ "flagValue": -1
551
+ },
552
+ "no_unnecessary_double_quotes": {
553
+ "active": 0,
554
+ "flagValue": -1
555
+ },
556
+ "no_unnecessary_fat_arrows": {
557
+ "active": 1,
558
+ "flagValue": -1
559
+ },
560
+ "non_empty_constructor_needs_parens": {
561
+ "active": 0,
562
+ "flagValue": -1
563
+ },
564
+ "prefer_english_operator": {
565
+ "active": 0,
566
+ "flagValue": -1
567
+ },
568
+ "space_operators": {
569
+ "active": 0,
570
+ "flagValue": -1
571
+ },
572
+ "spacing_after_comma": {
573
+ "active": 1,
574
+ "flagValue": -1
575
+ }
576
+ },
577
+ "coffeeMinifyOutput": 1,
578
+ "coffeeOutputStyle": 0,
579
+ "coffeeSyntaxCheckerStyle": 1,
580
+ "externalServerAddress": "http:\/\/braintree.dave.gene.co.uk\/",
581
+ "externalServerPreviewPathAddition": "",
582
+ "genericWebpageFileExtensionsString": "html, htm, shtml, shtm, xhtml, php, jsp, asp, aspx, erb, ctp",
583
+ "hamlAutoOutputPathEnabled": 1,
584
+ "hamlAutoOutputPathFilenamePattern": "*.html",
585
+ "hamlAutoOutputPathRelativePath": "",
586
+ "hamlAutoOutputPathReplace1": "",
587
+ "hamlAutoOutputPathReplace2": "",
588
+ "hamlAutoOutputPathStyle": 0,
589
+ "hamlEscapeHTMLCharacters": 0,
590
+ "hamlNoEscapeInAttributes": 0,
591
+ "hamlOutputFormat": 2,
592
+ "hamlOutputStyle": 0,
593
+ "hamlUseCDATA": 0,
594
+ "hamlUseDoubleQuotes": 0,
595
+ "hamlUseUnixNewlines": 0,
596
+ "jadeAutoOutputPathEnabled": 1,
597
+ "jadeAutoOutputPathFilenamePattern": "*.html",
598
+ "jadeAutoOutputPathRelativePath": "",
599
+ "jadeAutoOutputPathReplace1": "",
600
+ "jadeAutoOutputPathReplace2": "",
601
+ "jadeAutoOutputPathStyle": 0,
602
+ "jadeCompileDebug": 1,
603
+ "jadeOutputStyle": 0,
604
+ "javascriptAutoOutputPathEnabled": 1,
605
+ "javascriptAutoOutputPathFilenamePattern": "*-min.js",
606
+ "javascriptAutoOutputPathRelativePath": "\/min",
607
+ "javascriptAutoOutputPathReplace1": "",
608
+ "javascriptAutoOutputPathReplace2": "",
609
+ "javascriptAutoOutputPathStyle": 2,
610
+ "javascriptCreateSourceMap": 1,
611
+ "javascriptOutputStyle": 1,
612
+ "javascriptSyntaxCheckerStyle": 1,
613
+ "jsCheckerReservedNamesString": "",
614
+ "jsHintFlags2": {
615
+ "asi": {
616
+ "active": 0,
617
+ "flagValue": -1
618
+ },
619
+ "bitwise": {
620
+ "active": 1,
621
+ "flagValue": -1
622
+ },
623
+ "boss": {
624
+ "active": 0,
625
+ "flagValue": -1
626
+ },
627
+ "browser": {
628
+ "active": 1,
629
+ "flagValue": -1
630
+ },
631
+ "browserify": {
632
+ "active": 0,
633
+ "flagValue": -1
634
+ },
635
+ "camelcase": {
636
+ "active": 0,
637
+ "flagValue": -1
638
+ },
639
+ "couch": {
640
+ "active": 0,
641
+ "flagValue": -1
642
+ },
643
+ "curly": {
644
+ "active": 1,
645
+ "flagValue": -1
646
+ },
647
+ "debug": {
648
+ "active": 0,
649
+ "flagValue": -1
650
+ },
651
+ "devel": {
652
+ "active": 0,
653
+ "flagValue": -1
654
+ },
655
+ "dojo": {
656
+ "active": 0,
657
+ "flagValue": -1
658
+ },
659
+ "elision": {
660
+ "active": 1,
661
+ "flagValue": -1
662
+ },
663
+ "eqeqeq": {
664
+ "active": 1,
665
+ "flagValue": -1
666
+ },
667
+ "eqnull": {
668
+ "active": 0,
669
+ "flagValue": -1
670
+ },
671
+ "es3": {
672
+ "active": 0,
673
+ "flagValue": -1
674
+ },
675
+ "esnext": {
676
+ "active": 0,
677
+ "flagValue": -1
678
+ },
679
+ "evil": {
680
+ "active": 0,
681
+ "flagValue": -1
682
+ },
683
+ "expr": {
684
+ "active": 0,
685
+ "flagValue": -1
686
+ },
687
+ "forin": {
688
+ "active": 0,
689
+ "flagValue": -1
690
+ },
691
+ "freeze": {
692
+ "active": 1,
693
+ "flagValue": -1
694
+ },
695
+ "funcscope": {
696
+ "active": 0,
697
+ "flagValue": -1
698
+ },
699
+ "futurehostile": {
700
+ "active": 0,
701
+ "flagValue": -1
702
+ },
703
+ "globalstrict": {
704
+ "active": 0,
705
+ "flagValue": -1
706
+ },
707
+ "immed": {
708
+ "active": 0,
709
+ "flagValue": -1
710
+ },
711
+ "indent": {
712
+ "active": 0,
713
+ "flagValue": 4
714
+ },
715
+ "iterator": {
716
+ "active": 0,
717
+ "flagValue": -1
718
+ },
719
+ "jasmine": {
720
+ "active": 0,
721
+ "flagValue": -1
722
+ },
723
+ "jquery": {
724
+ "active": 1,
725
+ "flagValue": -1
726
+ },
727
+ "lastsemic": {
728
+ "active": 0,
729
+ "flagValue": -1
730
+ },
731
+ "latedef": {
732
+ "active": 1,
733
+ "flagValue": -1
734
+ },
735
+ "laxbreak": {
736
+ "active": 0,
737
+ "flagValue": -1
738
+ },
739
+ "laxcomma": {
740
+ "active": 0,
741
+ "flagValue": -1
742
+ },
743
+ "loopfunc": {
744
+ "active": 0,
745
+ "flagValue": -1
746
+ },
747
+ "maxcomplexity": {
748
+ "active": 0,
749
+ "flagValue": 10
750
+ },
751
+ "maxdepth": {
752
+ "active": 0,
753
+ "flagValue": 3
754
+ },
755
+ "maxlen": {
756
+ "active": 0,
757
+ "flagValue": 150
758
+ },
759
+ "maxparams": {
760
+ "active": 0,
761
+ "flagValue": 3
762
+ },
763
+ "maxstatements": {
764
+ "active": 0,
765
+ "flagValue": 4
766
+ },
767
+ "mocha": {
768
+ "active": 0,
769
+ "flagValue": -1
770
+ },
771
+ "mootools": {
772
+ "active": 0,
773
+ "flagValue": -1
774
+ },
775
+ "moz": {
776
+ "active": 0,
777
+ "flagValue": -1
778
+ },
779
+ "multistr": {
780
+ "active": 0,
781
+ "flagValue": -1
782
+ },
783
+ "newcap": {
784
+ "active": 1,
785
+ "flagValue": -1
786
+ },
787
+ "noarg": {
788
+ "active": 1,
789
+ "flagValue": -1
790
+ },
791
+ "nocomma": {
792
+ "active": 0,
793
+ "flagValue": -1
794
+ },
795
+ "node": {
796
+ "active": 0,
797
+ "flagValue": -1
798
+ },
799
+ "noempty": {
800
+ "active": 0,
801
+ "flagValue": -1
802
+ },
803
+ "nonbsp": {
804
+ "active": 0,
805
+ "flagValue": -1
806
+ },
807
+ "nonew": {
808
+ "active": 1,
809
+ "flagValue": -1
810
+ },
811
+ "nonstandard": {
812
+ "active": 0,
813
+ "flagValue": -1
814
+ },
815
+ "notypeof": {
816
+ "active": 1,
817
+ "flagValue": -1
818
+ },
819
+ "noyield": {
820
+ "active": 0,
821
+ "flagValue": -1
822
+ },
823
+ "onecase": {
824
+ "active": 0,
825
+ "flagValue": -1
826
+ },
827
+ "phantom": {
828
+ "active": 0,
829
+ "flagValue": -1
830
+ },
831
+ "plusplus": {
832
+ "active": 0,
833
+ "flagValue": -1
834
+ },
835
+ "proto": {
836
+ "active": 0,
837
+ "flagValue": -1
838
+ },
839
+ "prototypejs": {
840
+ "active": 0,
841
+ "flagValue": -1
842
+ },
843
+ "qunit": {
844
+ "active": 0,
845
+ "flagValue": -1
846
+ },
847
+ "regexp": {
848
+ "active": 1,
849
+ "flagValue": -1
850
+ },
851
+ "rhino": {
852
+ "active": 0,
853
+ "flagValue": -1
854
+ },
855
+ "scripturl": {
856
+ "active": 0,
857
+ "flagValue": -1
858
+ },
859
+ "shadow": {
860
+ "active": 0,
861
+ "flagValue": -1
862
+ },
863
+ "shelljs": {
864
+ "active": 0,
865
+ "flagValue": -1
866
+ },
867
+ "singleGroups": {
868
+ "active": 0,
869
+ "flagValue": -1
870
+ },
871
+ "strict": {
872
+ "active": 0,
873
+ "flagValue": -1
874
+ },
875
+ "sub": {
876
+ "active": 0,
877
+ "flagValue": -1
878
+ },
879
+ "supernew": {
880
+ "active": 0,
881
+ "flagValue": -1
882
+ },
883
+ "typed": {
884
+ "active": 0,
885
+ "flagValue": -1
886
+ },
887
+ "undef": {
888
+ "active": 1,
889
+ "flagValue": -1
890
+ },
891
+ "unused": {
892
+ "active": 1,
893
+ "flagValue": -1
894
+ },
895
+ "varstmt": {
896
+ "active": 0,
897
+ "flagValue": -1
898
+ },
899
+ "withstmt": {
900
+ "active": 0,
901
+ "flagValue": -1
902
+ },
903
+ "worker": {
904
+ "active": 0,
905
+ "flagValue": -1
906
+ },
907
+ "wsh": {
908
+ "active": 0,
909
+ "flagValue": -1
910
+ },
911
+ "yui": {
912
+ "active": 0,
913
+ "flagValue": -1
914
+ }
915
+ },
916
+ "jsLintFlags2": {
917
+ "bitwise": {
918
+ "active": 0,
919
+ "flagValue": -1
920
+ },
921
+ "browser": {
922
+ "active": 1,
923
+ "flagValue": -1
924
+ },
925
+ "couch": {
926
+ "active": 0,
927
+ "flagValue": -1
928
+ },
929
+ "devel": {
930
+ "active": 0,
931
+ "flagValue": -1
932
+ },
933
+ "es6": {
934
+ "active": 0,
935
+ "flagValue": -1
936
+ },
937
+ "eval": {
938
+ "active": 0,
939
+ "flagValue": -1
940
+ },
941
+ "for": {
942
+ "active": 0,
943
+ "flagValue": -1
944
+ },
945
+ "maxlen": {
946
+ "active": 0,
947
+ "flagValue": 150
948
+ },
949
+ "node": {
950
+ "active": 0,
951
+ "flagValue": -1
952
+ },
953
+ "this": {
954
+ "active": 0,
955
+ "flagValue": -1
956
+ },
957
+ "white": {
958
+ "active": 0,
959
+ "flagValue": -1
960
+ }
961
+ },
962
+ "jsonAutoOutputPathEnabled": 0,
963
+ "jsonAutoOutputPathFilenamePattern": "*-min.json",
964
+ "jsonAutoOutputPathRelativePath": "",
965
+ "jsonAutoOutputPathReplace1": "",
966
+ "jsonAutoOutputPathReplace2": "",
967
+ "jsonAutoOutputPathStyle": 0,
968
+ "jsonOrderOutput": 0,
969
+ "jsonOutputStyle": 1,
970
+ "kitAutoOutputPathEnabled": 1,
971
+ "kitAutoOutputPathFilenamePattern": "*.html",
972
+ "kitAutoOutputPathRelativePath": "",
973
+ "kitAutoOutputPathReplace1": "",
974
+ "kitAutoOutputPathReplace2": "",
975
+ "kitAutoOutputPathStyle": 0,
976
+ "lessAllowInsecureImports": 0,
977
+ "lessAutoOutputPathEnabled": 1,
978
+ "lessAutoOutputPathFilenamePattern": "*.css",
979
+ "lessAutoOutputPathRelativePath": "..\/css",
980
+ "lessAutoOutputPathReplace1": "less",
981
+ "lessAutoOutputPathReplace2": "css",
982
+ "lessAutoOutputPathStyle": 2,
983
+ "lessCreateSourceMap": 0,
984
+ "lessDisableJavascript": 0,
985
+ "lessIeCompatibility": 1,
986
+ "lessOutputStyle": 0,
987
+ "lessRelativeURLS": 0,
988
+ "lessStrictImports": 0,
989
+ "lessStrictMath": 0,
990
+ "lessStrictUnits": 0,
991
+ "markdownAutoOutputPathEnabled": 1,
992
+ "markdownAutoOutputPathFilenamePattern": "*.html",
993
+ "markdownAutoOutputPathRelativePath": "",
994
+ "markdownAutoOutputPathReplace1": "",
995
+ "markdownAutoOutputPathReplace2": "",
996
+ "markdownAutoOutputPathStyle": 0,
997
+ "markdownCriticStyle": 0,
998
+ "markdownEnableFootnotes": 1,
999
+ "markdownEnableLabels": 1,
1000
+ "markdownEnableSmartQuotes": 1,
1001
+ "markdownEscapeLineBreaks": 0,
1002
+ "markdownMaskEmailAddresses": 1,
1003
+ "markdownOutputFormat": 0,
1004
+ "markdownOutputStyle": 0,
1005
+ "markdownParseMetadata": 1,
1006
+ "markdownProcessHTML": 0,
1007
+ "markdownRandomFootnoteNumbers": 0,
1008
+ "markdownUseCompatibilityMode": 0,
1009
+ "reloadFileURLs": 0,
1010
+ "sassAutoOutputPathEnabled": 1,
1011
+ "sassAutoOutputPathFilenamePattern": "*.css",
1012
+ "sassAutoOutputPathRelativePath": "..\/css",
1013
+ "sassAutoOutputPathReplace1": "sass",
1014
+ "sassAutoOutputPathReplace2": "css",
1015
+ "sassAutoOutputPathStyle": 2,
1016
+ "sassCreateSourceMap": 0,
1017
+ "sassDebugStyle": 0,
1018
+ "sassDecimalPrecision": 10,
1019
+ "sassOutputStyle": 0,
1020
+ "sassUseLibsass": 0,
1021
+ "shouldRunAutoprefixer": 0,
1022
+ "shouldRunBless": 0,
1023
+ "skippedItemsString": ".svn, .git, .hg, log, _logs, _cache, cache, logs, node_modules",
1024
+ "slimAutoOutputPathEnabled": 1,
1025
+ "slimAutoOutputPathFilenamePattern": "*.html",
1026
+ "slimAutoOutputPathRelativePath": "",
1027
+ "slimAutoOutputPathReplace1": "",
1028
+ "slimAutoOutputPathReplace2": "",
1029
+ "slimAutoOutputPathStyle": 0,
1030
+ "slimCompileOnly": 0,
1031
+ "slimLogicless": 0,
1032
+ "slimOutputFormat": 0,
1033
+ "slimOutputStyle": 1,
1034
+ "slimRailsCompatible": 0,
1035
+ "stylusAutoOutputPathEnabled": 1,
1036
+ "stylusAutoOutputPathFilenamePattern": "*.css",
1037
+ "stylusAutoOutputPathRelativePath": "..\/css",
1038
+ "stylusAutoOutputPathReplace1": "stylus",
1039
+ "stylusAutoOutputPathReplace2": "css",
1040
+ "stylusAutoOutputPathStyle": 2,
1041
+ "stylusCreateSourceMap": 0,
1042
+ "stylusDebugStyle": 0,
1043
+ "stylusImportCSS": 0,
1044
+ "stylusOutputStyle": 0,
1045
+ "stylusResolveRelativeURLS": 0,
1046
+ "typescriptAutoOutputPathEnabled": 1,
1047
+ "typescriptAutoOutputPathFilenamePattern": "*.js",
1048
+ "typescriptAutoOutputPathRelativePath": "\/js",
1049
+ "typescriptAutoOutputPathReplace1": "",
1050
+ "typescriptAutoOutputPathReplace2": "",
1051
+ "typescriptAutoOutputPathStyle": 2,
1052
+ "typescriptCreateDeclarationFile": 0,
1053
+ "typescriptCreateSourceMap": 0,
1054
+ "typescriptJSXMode": 0,
1055
+ "typescriptMinifyOutput": 0,
1056
+ "typescriptModuleResolutionType": 0,
1057
+ "typescriptModuleType": 0,
1058
+ "typescriptNoImplicitAny": 0,
1059
+ "typescriptPreserveConstEnums": 0,
1060
+ "typescriptRemoveComments": 0,
1061
+ "typescriptSuppressImplicitAnyIndexErrors": 0,
1062
+ "typescriptTargetECMAVersion": 0,
1063
+ "uglifyDefinesString": "",
1064
+ "uglifyFlags2": {
1065
+ "ascii-only": {
1066
+ "active": 0,
1067
+ "flagValue": -1
1068
+ },
1069
+ "bare-returns": {
1070
+ "active": 0,
1071
+ "flagValue": -1
1072
+ },
1073
+ "booleans": {
1074
+ "active": 1,
1075
+ "flagValue": -1
1076
+ },
1077
+ "bracketize": {
1078
+ "active": 0,
1079
+ "flagValue": -1
1080
+ },
1081
+ "cascade": {
1082
+ "active": 1,
1083
+ "flagValue": -1
1084
+ },
1085
+ "comments": {
1086
+ "active": 1,
1087
+ "flagValue": -1
1088
+ },
1089
+ "comparisons": {
1090
+ "active": 1,
1091
+ "flagValue": -1
1092
+ },
1093
+ "compress": {
1094
+ "active": 1,
1095
+ "flagValue": -1
1096
+ },
1097
+ "conditionals": {
1098
+ "active": 1,
1099
+ "flagValue": -1
1100
+ },
1101
+ "dead_code": {
1102
+ "active": 0,
1103
+ "flagValue": -1
1104
+ },
1105
+ "drop_console": {
1106
+ "active": 0,
1107
+ "flagValue": -1
1108
+ },
1109
+ "drop_debugger": {
1110
+ "active": 1,
1111
+ "flagValue": -1
1112
+ },
1113
+ "eval": {
1114
+ "active": 0,
1115
+ "flagValue": -1
1116
+ },
1117
+ "evaluate": {
1118
+ "active": 1,
1119
+ "flagValue": -1
1120
+ },
1121
+ "hoist_funs": {
1122
+ "active": 1,
1123
+ "flagValue": -1
1124
+ },
1125
+ "hoist_vars": {
1126
+ "active": 0,
1127
+ "flagValue": -1
1128
+ },
1129
+ "if_return": {
1130
+ "active": 1,
1131
+ "flagValue": -1
1132
+ },
1133
+ "indent-level": {
1134
+ "active": 0,
1135
+ "flagValue": 4
1136
+ },
1137
+ "indent-start": {
1138
+ "active": 0,
1139
+ "flagValue": 0
1140
+ },
1141
+ "inline-script": {
1142
+ "active": 0,
1143
+ "flagValue": -1
1144
+ },
1145
+ "join_vars": {
1146
+ "active": 1,
1147
+ "flagValue": -1
1148
+ },
1149
+ "keep_fargs": {
1150
+ "active": 0,
1151
+ "flagValue": -1
1152
+ },
1153
+ "keep_fnames": {
1154
+ "active": 0,
1155
+ "flagValue": -1
1156
+ },
1157
+ "loops": {
1158
+ "active": 1,
1159
+ "flagValue": -1
1160
+ },
1161
+ "mangle": {
1162
+ "active": 1,
1163
+ "flagValue": -1
1164
+ },
1165
+ "max-line-len": {
1166
+ "active": 1,
1167
+ "flagValue": 32000
1168
+ },
1169
+ "negate_iife": {
1170
+ "active": 1,
1171
+ "flagValue": -1
1172
+ },
1173
+ "properties": {
1174
+ "active": 1,
1175
+ "flagValue": -1
1176
+ },
1177
+ "pure_getters": {
1178
+ "active": 0,
1179
+ "flagValue": -1
1180
+ },
1181
+ "quote-keys": {
1182
+ "active": 0,
1183
+ "flagValue": -1
1184
+ },
1185
+ "screw-ie8": {
1186
+ "active": 0,
1187
+ "flagValue": -1
1188
+ },
1189
+ "semicolons": {
1190
+ "active": 1,
1191
+ "flagValue": -1
1192
+ },
1193
+ "sequences": {
1194
+ "active": 1,
1195
+ "flagValue": -1
1196
+ },
1197
+ "sort": {
1198
+ "active": 0,
1199
+ "flagValue": -1
1200
+ },
1201
+ "space-colon": {
1202
+ "active": 1,
1203
+ "flagValue": -1
1204
+ },
1205
+ "toplevel": {
1206
+ "active": 0,
1207
+ "flagValue": -1
1208
+ },
1209
+ "unsafe": {
1210
+ "active": 0,
1211
+ "flagValue": -1
1212
+ },
1213
+ "unused": {
1214
+ "active": 0,
1215
+ "flagValue": -1
1216
+ },
1217
+ "warnings": {
1218
+ "active": 0,
1219
+ "flagValue": -1
1220
+ },
1221
+ "width": {
1222
+ "active": 1,
1223
+ "flagValue": 80
1224
+ }
1225
+ },
1226
+ "uglifyReservedNamesString": "$",
1227
+ "websiteRelativeRoot": ""
1228
+ },
1229
+ "settingsFileVersion": "2"
1230
+ }
skin/frontend/base/default/css/gene/braintree/core/_general.less ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ /* Accepted Cards */
2
+ #braintree-accepted-cards img {
3
+ float: left;
4
+ margin-right: 4px;
5
+ }
skin/frontend/base/default/css/gene/braintree/core/_hostedfields.less ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Hosted Fields Loading State */
2
+ #credit-card-form.loading {
3
+ position: relative;
4
+ }
5
+ #credit-card-form .braintree-hostedfield {
6
+ opacity: 1;
7
+ }
8
+ #credit-card-form .credit-card-loading {
9
+ display: none;
10
+ }
11
+ #credit-card-form.loading .credit-card-loading {
12
+ position: absolute;
13
+ top: 30%;
14
+ left: 0;
15
+ right: 0;
16
+ width: 100%;
17
+ height: 70%;
18
+ text-align: center;
19
+ display: block;
20
+ }
21
+ #credit-card-form.loading .credit-card-loading img {
22
+ margin: 16px auto;
23
+ }
24
+ #credit-card-form.loading .braintree-hostedfield {
25
+ opacity: 0;
26
+ }
27
+
28
+ /* Hosted Fields */
29
+ #braintree-hosted-submit {
30
+ display: none;
31
+ }
32
+ .braintree-input-field {
33
+ height: 42px;
34
+ max-width: 340px;
35
+ padding: 0 10px;
36
+ border: 1px solid lightgrey;
37
+ background: white;
38
+ }
39
+ .braintree-card-input-field {
40
+ height: 50px;
41
+ width: 100%;
42
+ max-width: 372px;
43
+ border: 1px solid lightgrey;
44
+ position: relative;
45
+ background: white;
46
+ }
47
+ .braintree-card-input-field .card-type {
48
+ position: absolute;
49
+ top: 0;
50
+ left: 0;
51
+ bottom: 0;
52
+ padding: 0 10px 0 8px;
53
+ }
54
+ .braintree-card-input-field .card-type img {
55
+ height: 48px;
56
+ }
57
+ .braintree-card-input-field #card-number {
58
+ float: left;
59
+ height: 48px;
60
+ width: 100%;
61
+ padding-left: 66px;
62
+ box-sizing: border-box;
63
+ }
64
+ #braintree-expiration-container {
65
+ display: block;
66
+ width: 100%;
67
+ vertical-align: middle;
68
+ font-size: 0;
69
+ }
70
+ .braintree-expiration {
71
+ width: 70px;
72
+ display: inline-block;
73
+ *zoom: 1;
74
+ *display: inline;
75
+ }
76
+ .braintree-expiration-seperator {
77
+ vertical-align: top;
78
+ line-height: 42px;
79
+ display: inline-block;
80
+ *zoom: 1;
81
+ *display: inline;
82
+ font-size: 30px;
83
+ padding: 0 8px;
84
+ }
85
+ .braintree-cvv {
86
+ width: 80px;
87
+ }
88
+ .braintree-hostedfield .cvv-what-is-this {
89
+ margin-left: 0;
90
+ }
skin/frontend/base/default/css/gene/braintree/core/_paypal.less ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #paypal-container iframe {
2
+ display: none;
3
+ }
4
+
5
+ /* PayPal headless button */
6
+ button.braintree-paypal-button {
7
+ background: #019cde;
8
+ color: white;
9
+ height: 46px;
10
+ line-height: 46px;
11
+ padding: 0 20px 0 18px;
12
+ border: none;
13
+ border-radius: 3px;
14
+ -webkit-border-radius: 3px;
15
+ font-size: 14px;
16
+ float: left;
17
+ cursor: pointer;
18
+ }
19
+ button.braintree-paypal-button.braintree-paypal-loading {
20
+ background: #014c6b url('../../../images/gene/braintree/paypal-loading.gif') center center no-repeat;
21
+ background-size: 32px;
22
+ }
23
+ button.braintree-paypal-button.braintree-paypal-loading > span {
24
+ opacity: 0;
25
+ }
26
+ button.braintree-paypal-button.braintree-paypal-loading:hover {
27
+ background: #014c6b url('../../../images/gene/braintree/paypal-loading.gif') center center no-repeat;
28
+ }
29
+ button.braintree-paypal-button:hover {
30
+ background: #0175a6;
31
+ }
32
+ button.braintree-paypal-button > span {
33
+ display: block;
34
+ height: 46px;
35
+ line-height: 46px;
36
+ background: url('../../../images/gene/braintree/paypal.png') right center no-repeat;
37
+ background-size: 80px;
38
+ padding-right: 94px;
39
+ }
skin/frontend/base/default/css/gene/braintree/core/_saved.less ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Saved Accounts */
2
+ #creditcard-saved-accounts, #paypal-saved-accounts {
3
+ font-size: 0;
4
+ width: 100%;
5
+ }
6
+ #creditcard-saved-accounts tr, #paypal-saved-accounts tr {
7
+ border-bottom: 1px dotted lightgrey;
8
+ }
9
+ #creditcard-saved-accounts tr td, #paypal-saved-accounts tr td {
10
+ vertical-align: middle;
11
+ }
12
+ #payment_form_gene_braintree_creditcard #creditcard-saved-accounts label, #payment_form_gene_braintree_paypal #paypal-saved-accounts label,
13
+ #payment_form_gene_braintree_creditcard #creditcard-saved-accounts .label, #payment_form_gene_braintree_paypal #paypal-saved-accounts .label {
14
+ width: 100%;
15
+ padding: 0;
16
+ text-align: left;
17
+ float: none;
18
+ }
19
+ #payment_form_gene_braintree_creditcard p, #payment_form_gene_braintree_paypal p {
20
+ padding: 0;
21
+ }
22
+ #creditcard-saved-accounts tr.other-row, #paypal-saved-accounts tr.other-row {
23
+ border-bottom: 0;
24
+ }
25
+ #creditcard-saved-accounts label {
26
+ float: left;
27
+ padding: 10px 0;
28
+ line-height: 40px;
29
+ width: 100%;
30
+ }
31
+ #creditcard-saved-accounts tr.other-row label, #paypal-saved-accounts tr.other-row label {
32
+ padding: 8px 0;
33
+ }
34
+ #paypal-saved-accounts label {
35
+ padding: 6px 0;
36
+ line-height: 40px;
37
+ }
38
+ #creditcard-saved-accounts label img, #paypal-saved-accounts label img {
39
+ margin-left: 6px;
40
+ height: 40px;
41
+ float: left;
42
+ }
43
+ #creditcard-saved-accounts label .saved-card-info, #paypal-saved-accounts label .saved-paypal-email {
44
+ margin-left: 14px;
45
+ float: left;
46
+ }
47
+ #creditcard-saved-accounts label .saved-card-info span {
48
+ line-height: 40px;
49
+ }
50
+ #creditcard-saved-accounts label .saved-card-info span.saved-expiry-date {
51
+ font-size: 12px;
52
+ font-weight: normal;
53
+ margin-left: 14px;
54
+ }
55
+ #gene_braintree_creditcard_store_in_vault_div label, label[for="gene_braintree_paypal_store_in_vault"] {
56
+ width: auto!important;
57
+ }
skin/frontend/base/default/css/gene/braintree/default.css CHANGED
@@ -1,124 +1,221 @@
1
- #paypal-container iframe {
2
- display: none;
3
- }
4
-
5
- /* Saved Accounts */
6
- #creditcard-saved-accounts, #paypal-saved-accounts {
7
- font-size: 0;
8
- width: 100%;
9
- }
10
- #creditcard-saved-accounts tr, #paypal-saved-accounts tr {
11
- border-bottom: 1px dotted lightgrey;
12
- }
13
- #creditcard-saved-accounts tr td, #paypal-saved-accounts tr td {
14
- vertical-align: middle;
15
- }
16
- #payment_form_gene_braintree_creditcard label, #payment_form_gene_braintree_paypal label {
17
- width: 100%;
18
- padding: 0;
19
- text-align: left;
20
- float: none;
21
- }
22
- #payment_form_gene_braintree_creditcard p, #payment_form_gene_braintree_paypal p {
23
- padding: 0;
24
- }
25
- #creditcard-saved-accounts tr.other-row, #paypal-saved-accounts tr.other-row {
26
- border-bottom: 0;
27
- }
28
- #creditcard-saved-accounts label {
29
- float: left;
30
- padding: 10px 0;
31
- line-height: 40px;
32
- width: 100%;
33
  }
34
- #creditcard-saved-accounts tr.other-row label, #paypal-saved-accounts tr.other-row label {
35
- padding: 8px 0;
 
36
  }
37
- #paypal-saved-accounts label {
38
- padding: 6px 0;
39
- line-height: 40px;
40
  }
41
- #creditcard-saved-accounts label img, #paypal-saved-accounts label img {
42
- margin-left: 6px;
43
- height: 40px;
44
- float: left;
45
  }
46
- #creditcard-saved-accounts label .saved-card-info, #paypal-saved-accounts label .saved-paypal-email {
47
- margin-left: 14px;
48
- float: left;
 
 
 
 
 
 
49
  }
50
- #creditcard-saved-accounts label .saved-card-info span {
51
- line-height: 40px;
52
- }
53
- #creditcard-saved-accounts label .saved-card-info span.saved-expiry-date {
54
- font-size: 12px;
55
- font-weight: normal;
56
- margin-left: 14px;
57
  }
58
- #gene_braintree_creditcard_store_in_vault_div label, label[for="gene_braintree_paypal_store_in_vault"] {
59
- width: auto!important;
60
  }
61
-
62
  /* Hosted Fields */
63
  #braintree-hosted-submit {
64
- display: none;
65
  }
66
  .braintree-input-field {
67
- height: 42px;
68
- max-width: 340px;
69
- padding: 0 10px;
70
- border: 1px solid lightgrey;
71
- background: white;
72
  }
73
  .braintree-card-input-field {
74
- height: 50px;
75
- width: 100%;
76
- max-width: 372px;
77
- border: 1px solid lightgrey;
78
- position: relative;
79
- background: white;
80
  }
81
  .braintree-card-input-field .card-type {
82
- position: absolute;
83
- top: 0;
84
- left: 0;
85
- bottom: 0;
86
- padding: 0 10px 0 8px;
87
  }
88
  .braintree-card-input-field .card-type img {
89
- height: 48px;
90
  }
91
  .braintree-card-input-field #card-number {
92
- float: left;
93
- height: 48px;
94
- width: 100%;
95
- padding-left: 66px;
96
- box-sizing: border-box;
97
  }
98
  #braintree-expiration-container {
99
- display: block;
100
- width: 100%;
101
- vertical-align: middle;
102
- font-size: 0;
103
  }
104
  .braintree-expiration {
105
- width: 70px;
106
- display: inline-block;
107
- *zoom: 1;
108
- *display: inline;
109
  }
110
  .braintree-expiration-seperator {
111
- vertical-align: top;
112
- line-height: 42px;
113
- display: inline-block;
114
- *zoom: 1;
115
- *display: inline;
116
- font-size: 30px;
117
- padding: 0 8px;
118
  }
119
  .braintree-cvv {
120
- width: 80px;
121
  }
122
  .braintree-hostedfield .cvv-what-is-this {
123
- margin-left: 0;
124
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Accepted Cards */
2
+ #braintree-accepted-cards img {
3
+ float: left;
4
+ margin-right: 4px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  }
6
+ /* Hosted Fields Loading State */
7
+ #credit-card-form.loading {
8
+ position: relative;
9
  }
10
+ #credit-card-form .braintree-hostedfield {
11
+ opacity: 1;
 
12
  }
13
+ #credit-card-form .credit-card-loading {
14
+ display: none;
 
 
15
  }
16
+ #credit-card-form.loading .credit-card-loading {
17
+ position: absolute;
18
+ top: 30%;
19
+ left: 0;
20
+ right: 0;
21
+ width: 100%;
22
+ height: 70%;
23
+ text-align: center;
24
+ display: block;
25
  }
26
+ #credit-card-form.loading .credit-card-loading img {
27
+ margin: 16px auto;
 
 
 
 
 
28
  }
29
+ #credit-card-form.loading .braintree-hostedfield {
30
+ opacity: 0;
31
  }
 
32
  /* Hosted Fields */
33
  #braintree-hosted-submit {
34
+ display: none;
35
  }
36
  .braintree-input-field {
37
+ height: 42px;
38
+ max-width: 340px;
39
+ padding: 0 10px;
40
+ border: 1px solid lightgrey;
41
+ background: white;
42
  }
43
  .braintree-card-input-field {
44
+ height: 50px;
45
+ width: 100%;
46
+ max-width: 372px;
47
+ border: 1px solid lightgrey;
48
+ position: relative;
49
+ background: white;
50
  }
51
  .braintree-card-input-field .card-type {
52
+ position: absolute;
53
+ top: 0;
54
+ left: 0;
55
+ bottom: 0;
56
+ padding: 0 10px 0 8px;
57
  }
58
  .braintree-card-input-field .card-type img {
59
+ height: 48px;
60
  }
61
  .braintree-card-input-field #card-number {
62
+ float: left;
63
+ height: 48px;
64
+ width: 100%;
65
+ padding-left: 66px;
66
+ box-sizing: border-box;
67
  }
68
  #braintree-expiration-container {
69
+ display: block;
70
+ width: 100%;
71
+ vertical-align: middle;
72
+ font-size: 0;
73
  }
74
  .braintree-expiration {
75
+ width: 70px;
76
+ display: inline-block;
77
+ *zoom: 1;
78
+ *display: inline;
79
  }
80
  .braintree-expiration-seperator {
81
+ vertical-align: top;
82
+ line-height: 42px;
83
+ display: inline-block;
84
+ *zoom: 1;
85
+ *display: inline;
86
+ font-size: 30px;
87
+ padding: 0 8px;
88
  }
89
  .braintree-cvv {
90
+ width: 80px;
91
  }
92
  .braintree-hostedfield .cvv-what-is-this {
93
+ margin-left: 0;
94
+ }
95
+ #paypal-container iframe {
96
+ display: none;
97
+ }
98
+ /* PayPal headless button */
99
+ button.braintree-paypal-button {
100
+ background: #019cde;
101
+ color: white;
102
+ height: 46px;
103
+ line-height: 46px;
104
+ padding: 0 20px 0 18px;
105
+ border: none;
106
+ border-radius: 3px;
107
+ -webkit-border-radius: 3px;
108
+ font-size: 14px;
109
+ float: left;
110
+ cursor: pointer;
111
+ }
112
+ button.braintree-paypal-button.braintree-paypal-loading {
113
+ background: #014c6b url('../../../images/gene/braintree/paypal-loading.gif') center center no-repeat;
114
+ background-size: 32px;
115
+ }
116
+ button.braintree-paypal-button.braintree-paypal-loading > span {
117
+ opacity: 0;
118
+ }
119
+ button.braintree-paypal-button.braintree-paypal-loading:hover {
120
+ background: #014c6b url('../../../images/gene/braintree/paypal-loading.gif') center center no-repeat;
121
+ }
122
+ button.braintree-paypal-button:hover {
123
+ background: #0175a6;
124
+ }
125
+ button.braintree-paypal-button > span {
126
+ display: block;
127
+ height: 46px;
128
+ line-height: 46px;
129
+ background: url('../../../images/gene/braintree/paypal.png') right center no-repeat;
130
+ background-size: 80px;
131
+ padding-right: 94px;
132
+ }
133
+ /* Saved Accounts */
134
+ #creditcard-saved-accounts,
135
+ #paypal-saved-accounts {
136
+ font-size: 0;
137
+ width: 100%;
138
+ }
139
+ #creditcard-saved-accounts tr,
140
+ #paypal-saved-accounts tr {
141
+ border-bottom: 1px dotted lightgrey;
142
+ }
143
+ #creditcard-saved-accounts tr td,
144
+ #paypal-saved-accounts tr td {
145
+ vertical-align: middle;
146
+ }
147
+ #payment_form_gene_braintree_creditcard #creditcard-saved-accounts label,
148
+ #payment_form_gene_braintree_paypal #paypal-saved-accounts label,
149
+ #payment_form_gene_braintree_creditcard #creditcard-saved-accounts .label,
150
+ #payment_form_gene_braintree_paypal #paypal-saved-accounts .label {
151
+ width: 100%;
152
+ padding: 0;
153
+ text-align: left;
154
+ float: none;
155
+ }
156
+ #payment_form_gene_braintree_creditcard p,
157
+ #payment_form_gene_braintree_paypal p {
158
+ padding: 0;
159
+ }
160
+ #creditcard-saved-accounts tr.other-row,
161
+ #paypal-saved-accounts tr.other-row {
162
+ border-bottom: 0;
163
+ }
164
+ #creditcard-saved-accounts label {
165
+ float: left;
166
+ padding: 10px 0;
167
+ line-height: 40px;
168
+ width: 100%;
169
+ }
170
+ #creditcard-saved-accounts tr.other-row label,
171
+ #paypal-saved-accounts tr.other-row label {
172
+ padding: 8px 0;
173
+ }
174
+ #paypal-saved-accounts label {
175
+ padding: 6px 0;
176
+ line-height: 40px;
177
+ }
178
+ #creditcard-saved-accounts label img,
179
+ #paypal-saved-accounts label img {
180
+ margin-left: 6px;
181
+ height: 40px;
182
+ float: left;
183
+ }
184
+ #creditcard-saved-accounts label .saved-card-info,
185
+ #paypal-saved-accounts label .saved-paypal-email {
186
+ margin-left: 14px;
187
+ float: left;
188
+ }
189
+ #creditcard-saved-accounts label .saved-card-info span {
190
+ line-height: 40px;
191
+ }
192
+ #creditcard-saved-accounts label .saved-card-info span.saved-expiry-date {
193
+ font-size: 12px;
194
+ font-weight: normal;
195
+ margin-left: 14px;
196
+ }
197
+ #gene_braintree_creditcard_store_in_vault_div label,
198
+ label[for="gene_braintree_paypal_store_in_vault"] {
199
+ width: auto!important;
200
+ }
201
+ /* Multi shipping */
202
+ body.checkout-multishipping-billing #payment-continue.loading {
203
+ padding-left: 12px;
204
+ }
205
+ body.checkout-multishipping-billing #payment-continue.loading > span {
206
+ background: url('../../../images/gene/loader-white.gif') center left no-repeat;
207
+ background-size: 15px 15px;
208
+ padding-left: 22px;
209
+ }
210
+ body.checkout-multishipping-billing .buttons-set #paypal-complete {
211
+ float: right;
212
+ width: 400px;
213
+ text-align: right;
214
+ }
215
+ body.checkout-multishipping-billing .buttons-set #paypal-complete > label {
216
+ float: right;
217
+ margin-right: 16px;
218
+ }
219
+ body.checkout-multishipping-billing .buttons-set #paypal-complete #paypal-container {
220
+ float: right;
221
+ }
skin/frontend/base/default/css/gene/braintree/express.css ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #pp-express-overlay {
2
+ display: none;
3
+ position: fixed;
4
+ top: 0;
5
+ left: 0;
6
+ right: 0;
7
+ bottom: 0;
8
+ z-index: 100;
9
+ background:rgba(0, 0, 0, 0.701961);
10
+ }
11
+
12
+ #pp-express-modal {
13
+ box-sizing: border-box;
14
+ display: none;
15
+ position: fixed;
16
+ top: 20%;
17
+ left: 40%;
18
+ left: calc(50% - 175px);
19
+ z-index: 101;
20
+
21
+ width: 350px;
22
+ height: 390px;
23
+ padding: 15px;
24
+
25
+ background: #fff;
26
+ border: 3px solid #ccc;
27
+ border-radius: 4px;
28
+ overflow: auto;
29
+ }
30
+
31
+ @media (max-width: 770px) {
32
+ #pp-express-modal {
33
+ width: 70%;
34
+ height: 80%;
35
+ top: 10%;
36
+ left: 15%;
37
+ }
38
+ }
39
+
40
+ @media (max-width: 500px) {
41
+ #pp-express-modal {
42
+ width: 100%;
43
+ height: 100%;
44
+ top: 0;
45
+ left: 0;
46
+ border: none;
47
+ border-radius: 0;
48
+ padding: 25px;
49
+ }
50
+ }
51
+
52
+ #pp-express-modal.loading:before {
53
+ content: " ";
54
+ background: url('../../../images/gene/loader.gif') no-repeat;
55
+ height: 48px;
56
+ width: 48px;
57
+ position: absolute;
58
+ top: 30%;
59
+ left: 44%;
60
+ left: calc(50% - 24px);
61
+ }
62
+
63
+ #pp-express-modal .button {
64
+ display: block;
65
+ width: 100%;
66
+ margin-top: 30px;
67
+ }
68
+
69
+ #pp-express-modal .button2 {
70
+ display: block;
71
+ width: 100%;
72
+ margin-top: 6px;
73
+ font-size: 0.9rem;
74
+ }
75
+
76
+ #pp-express-modal .product-row {
77
+ min-height: 60px;
78
+ margin: 0;
79
+ }
80
+
81
+ #pp-express-modal .item-row {
82
+ border-bottom: 1px solid #ccc;
83
+ padding-bottom: 10px;
84
+ margin-bottom: 10px;
85
+ display: block;
86
+ }
87
+
88
+ #pp-express-modal .item-subrow {
89
+ margin-top: 5px;
90
+ margin-bottom: 5px;
91
+ display: block;
92
+ }
93
+
94
+ #pp-express-modal .product-image {
95
+ float: left;
96
+ width: 50px;
97
+ height: 50px;
98
+ margin: 0;
99
+ overflow: hidden;
100
+ }
101
+ #pp-express-modal .product-image img {
102
+ max-width: 100%;
103
+ }
104
+
105
+ #pp-express-modal .product-info {
106
+ margin-left: 60px;
107
+ padding-top: 5px;
108
+ }
109
+
110
+ #pp-express-modal .product-qty {
111
+ font-size: 0.8rem;
112
+ }
113
+
114
+ #pp-express-modal #shopping-cart-totals-table {
115
+ width: 100%;
116
+ }
117
+ #pp-express-modal #shopping-cart-totals-table td {
118
+ padding-left: 10px;
119
+ }
skin/frontend/base/default/css/gene/braintree/firecheckout.css CHANGED
@@ -1,125 +1,219 @@
1
- #paypal-complete #paypal-label {
2
- float: right;
3
- margin-right: 8px;
4
- line-height: 44px;
5
- }
6
- #paypal-container iframe {
7
- display: none;
8
- }
9
- #paypal-complete #paypal-container {
10
- float: right;
11
- }
12
- #braintree-paypal-button {
13
- padding: 0;
14
- }
15
-
16
- #payment_form_gene_braintree_paypal, #payment_form_gene_braintree_creditcard {
17
- padding-top: 6px;
18
- padding-bottom: 6px;
19
- }
20
-
21
- /* Saved Accounts */
22
- #creditcard-saved-accounts, #paypal-saved-accounts {
23
- font-size: 0;
24
- width: 100%;
25
- }
26
- #creditcard-saved-accounts tr, #paypal-saved-accounts tr {
27
- border-bottom: 1px dotted lightgrey;
28
  }
29
- #creditcard-saved-accounts tr.other-row, #paypal-saved-accounts tr.other-row {
30
- border-bottom: 0;
 
31
  }
32
- #creditcard-saved-accounts label {
33
- padding: 14px 0;
34
- line-height: 48px;
35
- width: auto;
36
- }
37
- #creditcard-saved-accounts tr.other-row label, #paypal-saved-accounts tr.other-row label {
38
- padding: 18px 0;
39
- }
40
- #creditcard-saved-accounts tr.other-row label[for="other-creditcard"], #paypal-saved-accounts tr.other-row label[for="other-paypal"] {
41
- padding: 8px 0;
42
  }
43
- #paypal-saved-accounts label {
44
- padding: 8px 0;
45
- line-height: 48px;
46
- width: auto;
47
  }
48
- #creditcard-saved-accounts label img {
49
- float: left;
 
 
 
 
 
 
 
50
  }
51
- #creditcard-saved-accounts label .saved-card-info, #paypal-saved-accounts label .saved-paypal-email {
52
- margin-left: 12px;
53
- float: left;
54
  }
55
- #creditcard-saved-accounts label .saved-card-info span {
56
- display: block;
57
- line-height: 24px;
58
  }
59
- #creditcard-saved-accounts label .saved-card-info span.saved-expiry-date {
60
- font-size: 12px;
61
- }
62
-
63
  /* Hosted Fields */
64
  #braintree-hosted-submit {
65
- display: none;
66
  }
67
  .braintree-input-field {
68
- height: 42px;
69
- max-width: 340px;
70
- padding: 0 10px;
71
- border: 1px solid lightgrey;
72
- background: white;
73
  }
74
  .braintree-card-input-field {
75
- height: 50px;
76
- width: 100%;
77
- max-width: 372px;
78
- border: 1px solid lightgrey;
79
- position: relative;
80
- background: white;
81
  }
82
  .braintree-card-input-field .card-type {
83
- position: absolute;
84
- top: 0;
85
- left: 0;
86
- bottom: 0;
87
- padding: 0 10px 0 8px;
88
  }
89
  .braintree-card-input-field .card-type img {
90
- height: 48px;
91
  }
92
  .braintree-card-input-field #card-number {
93
- float: left;
94
- height: 48px;
95
- width: 100%;
96
- padding-left: 66px;
97
- box-sizing: border-box;
98
  }
99
  #braintree-expiration-container {
100
- display: block;
101
- width: 100%;
102
- vertical-align: middle;
103
- font-size: 0;
104
  }
105
  .braintree-expiration {
106
- width: 70px;
107
- display: inline-block;
108
- *zoom: 1;
109
- *display: inline;
110
  }
111
  .braintree-expiration-seperator {
112
- vertical-align: top;
113
- line-height: 42px;
114
- display: inline-block;
115
- *zoom: 1;
116
- *display: inline;
117
- font-size: 30px;
118
- padding: 0 8px;
119
  }
120
  .braintree-cvv {
121
- width: 80px;
122
  }
123
  .braintree-hostedfield .cvv-what-is-this {
124
- margin-left: 0;
125
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Accepted Cards */
2
+ #braintree-accepted-cards img {
3
+ float: left;
4
+ margin-right: 4px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  }
6
+ /* Hosted Fields Loading State */
7
+ #credit-card-form.loading {
8
+ position: relative;
9
  }
10
+ #credit-card-form .braintree-hostedfield {
11
+ opacity: 1;
 
 
 
 
 
 
 
 
12
  }
13
+ #credit-card-form .credit-card-loading {
14
+ display: none;
 
 
15
  }
16
+ #credit-card-form.loading .credit-card-loading {
17
+ position: absolute;
18
+ top: 30%;
19
+ left: 0;
20
+ right: 0;
21
+ width: 100%;
22
+ height: 70%;
23
+ text-align: center;
24
+ display: block;
25
  }
26
+ #credit-card-form.loading .credit-card-loading img {
27
+ margin: 16px auto;
 
28
  }
29
+ #credit-card-form.loading .braintree-hostedfield {
30
+ opacity: 0;
 
31
  }
 
 
 
 
32
  /* Hosted Fields */
33
  #braintree-hosted-submit {
34
+ display: none;
35
  }
36
  .braintree-input-field {
37
+ height: 42px;
38
+ max-width: 340px;
39
+ padding: 0 10px;
40
+ border: 1px solid lightgrey;
41
+ background: white;
42
  }
43
  .braintree-card-input-field {
44
+ height: 50px;
45
+ width: 100%;
46
+ max-width: 372px;
47
+ border: 1px solid lightgrey;
48
+ position: relative;
49
+ background: white;
50
  }
51
  .braintree-card-input-field .card-type {
52
+ position: absolute;
53
+ top: 0;
54
+ left: 0;
55
+ bottom: 0;
56
+ padding: 0 10px 0 8px;
57
  }
58
  .braintree-card-input-field .card-type img {
59
+ height: 48px;
60
  }
61
  .braintree-card-input-field #card-number {
62
+ float: left;
63
+ height: 48px;
64
+ width: 100%;
65
+ padding-left: 66px;
66
+ box-sizing: border-box;
67
  }
68
  #braintree-expiration-container {
69
+ display: block;
70
+ width: 100%;
71
+ vertical-align: middle;
72
+ font-size: 0;
73
  }
74
  .braintree-expiration {
75
+ width: 70px;
76
+ display: inline-block;
77
+ *zoom: 1;
78
+ *display: inline;
79
  }
80
  .braintree-expiration-seperator {
81
+ vertical-align: top;
82
+ line-height: 42px;
83
+ display: inline-block;
84
+ *zoom: 1;
85
+ *display: inline;
86
+ font-size: 30px;
87
+ padding: 0 8px;
88
  }
89
  .braintree-cvv {
90
+ width: 80px;
91
  }
92
  .braintree-hostedfield .cvv-what-is-this {
93
+ margin-left: 0;
94
+ }
95
+ #paypal-container iframe {
96
+ display: none;
97
+ }
98
+ /* PayPal headless button */
99
+ button.braintree-paypal-button {
100
+ background: #019cde;
101
+ color: white;
102
+ height: 46px;
103
+ line-height: 46px;
104
+ padding: 0 20px 0 18px;
105
+ border: none;
106
+ border-radius: 3px;
107
+ -webkit-border-radius: 3px;
108
+ font-size: 14px;
109
+ float: left;
110
+ cursor: pointer;
111
+ }
112
+ button.braintree-paypal-button.braintree-paypal-loading {
113
+ background: #014c6b url('../../../images/gene/braintree/paypal-loading.gif') center center no-repeat;
114
+ background-size: 32px;
115
+ }
116
+ button.braintree-paypal-button.braintree-paypal-loading > span {
117
+ opacity: 0;
118
+ }
119
+ button.braintree-paypal-button.braintree-paypal-loading:hover {
120
+ background: #014c6b url('../../../images/gene/braintree/paypal-loading.gif') center center no-repeat;
121
+ }
122
+ button.braintree-paypal-button:hover {
123
+ background: #0175a6;
124
+ }
125
+ button.braintree-paypal-button > span {
126
+ display: block;
127
+ height: 46px;
128
+ line-height: 46px;
129
+ background: url('../../../images/gene/braintree/paypal.png') right center no-repeat;
130
+ background-size: 80px;
131
+ padding-right: 94px;
132
+ }
133
+ /* Saved Accounts */
134
+ #creditcard-saved-accounts,
135
+ #paypal-saved-accounts {
136
+ font-size: 0;
137
+ width: 100%;
138
+ }
139
+ #creditcard-saved-accounts tr,
140
+ #paypal-saved-accounts tr {
141
+ border-bottom: 1px dotted lightgrey;
142
+ }
143
+ #creditcard-saved-accounts tr td,
144
+ #paypal-saved-accounts tr td {
145
+ vertical-align: middle;
146
+ }
147
+ #payment_form_gene_braintree_creditcard #creditcard-saved-accounts label,
148
+ #payment_form_gene_braintree_paypal #paypal-saved-accounts label,
149
+ #payment_form_gene_braintree_creditcard #creditcard-saved-accounts .label,
150
+ #payment_form_gene_braintree_paypal #paypal-saved-accounts .label {
151
+ width: 100%;
152
+ padding: 0;
153
+ text-align: left;
154
+ float: none;
155
+ }
156
+ #payment_form_gene_braintree_creditcard p,
157
+ #payment_form_gene_braintree_paypal p {
158
+ padding: 0;
159
+ }
160
+ #creditcard-saved-accounts tr.other-row,
161
+ #paypal-saved-accounts tr.other-row {
162
+ border-bottom: 0;
163
+ }
164
+ #creditcard-saved-accounts label {
165
+ float: left;
166
+ padding: 10px 0;
167
+ line-height: 40px;
168
+ width: 100%;
169
+ }
170
+ #creditcard-saved-accounts tr.other-row label,
171
+ #paypal-saved-accounts tr.other-row label {
172
+ padding: 8px 0;
173
+ }
174
+ #paypal-saved-accounts label {
175
+ padding: 6px 0;
176
+ line-height: 40px;
177
+ }
178
+ #creditcard-saved-accounts label img,
179
+ #paypal-saved-accounts label img {
180
+ margin-left: 6px;
181
+ height: 40px;
182
+ float: left;
183
+ }
184
+ #creditcard-saved-accounts label .saved-card-info,
185
+ #paypal-saved-accounts label .saved-paypal-email {
186
+ margin-left: 14px;
187
+ float: left;
188
+ }
189
+ #creditcard-saved-accounts label .saved-card-info span {
190
+ line-height: 40px;
191
+ }
192
+ #creditcard-saved-accounts label .saved-card-info span.saved-expiry-date {
193
+ font-size: 12px;
194
+ font-weight: normal;
195
+ margin-left: 14px;
196
+ }
197
+ #gene_braintree_creditcard_store_in_vault_div label,
198
+ label[for="gene_braintree_paypal_store_in_vault"] {
199
+ width: auto!important;
200
+ }
201
+ #paypal-complete #paypal-label {
202
+ float: right;
203
+ margin-right: 8px;
204
+ line-height: 44px;
205
+ }
206
+ #paypal-container iframe {
207
+ display: none;
208
+ }
209
+ #paypal-complete #paypal-container {
210
+ float: right;
211
+ }
212
+ #braintree-paypal-button {
213
+ padding: 0;
214
+ }
215
+ #payment_form_gene_braintree_paypal,
216
+ #payment_form_gene_braintree_creditcard {
217
+ padding-top: 6px;
218
+ padding-bottom: 6px;
219
+ }
skin/frontend/base/default/css/gene/braintree/fme.css CHANGED
@@ -1,136 +1,217 @@
1
- #braintree-paypal-button {
2
- line-height: unset;
3
- padding: 0;
4
- margin: 0 auto;
5
  }
6
- #paypal-complete {
7
- margin-top: 12px;
8
- text-align: center;
9
- float: left;
10
- width: 100%;
11
  }
12
- #paypal-container iframe {
13
- display: none;
14
- }
15
- #paypal-label {
16
- line-height: 32px;
17
- margin-right: 12px;
18
- float: right;
19
- }
20
- #paypal-container {
21
- float: right;
22
- }
23
- #creditcard-saved-accounts td, #paypal-saved-accounts td {
24
- vertical-align: middle;
25
- }
26
- #gene_braintree_creditcard_cc_number {
27
- text-indent: 62px!important;
28
- }
29
-
30
- #payment_form_gene_braintree_paypal, #payment_form_gene_braintree_creditcard {
31
- padding-top: 6px;
32
- padding-bottom: 6px;
33
- }
34
-
35
- /* Saved Accounts */
36
- #creditcard-saved-accounts, #paypal-saved-accounts {
37
- font-size: 0;
38
- width: 100%;
39
- }
40
- #creditcard-saved-accounts tr, #paypal-saved-accounts tr {
41
- border-bottom: 1px dotted lightgrey;
42
  }
43
- #creditcard-saved-accounts tr.other-row, #paypal-saved-accounts tr.other-row {
44
- border-bottom: 0;
45
  }
46
- #creditcard-saved-accounts label {
47
- padding: 14px 0;
48
- line-height: 48px;
49
- width: auto;
50
- }
51
- #creditcard-saved-accounts tr.other-row label, #paypal-saved-accounts tr.other-row label {
52
- padding: 18px 0;
53
- }
54
- #paypal-saved-accounts label {
55
- padding: 8px 0;
56
- line-height: 48px;
57
- width: auto;
58
- }
59
- #creditcard-saved-accounts label img {
60
- float: left;
61
  }
62
- #creditcard-saved-accounts label .saved-card-info, #paypal-saved-accounts label .saved-paypal-email {
63
- margin-left: 12px;
64
- float: left;
65
  }
66
- #creditcard-saved-accounts label .saved-card-info span {
67
- display: block;
68
- line-height: 24px;
69
- }
70
- #creditcard-saved-accounts label .saved-card-info span.saved-expiry-date {
71
- font-size: 12px;
72
  }
73
-
74
  /* Hosted Fields */
75
  #braintree-hosted-submit {
76
- display: none;
77
  }
78
  .braintree-input-field {
79
- height: 42px;
80
- max-width: 340px;
81
- padding: 0 10px;
82
- border: 1px solid lightgrey;
83
- background: white;
84
  }
85
  .braintree-card-input-field {
86
- height: 50px;
87
- width: 100%;
88
- max-width: 372px;
89
- border: 1px solid lightgrey;
90
- position: relative;
91
- background: white;
92
  }
93
  .braintree-card-input-field .card-type {
94
- position: absolute;
95
- top: 0;
96
- left: 0;
97
- bottom: 0;
98
- padding: 0 10px 0 8px;
99
  }
100
  .braintree-card-input-field .card-type img {
101
- height: 48px;
102
  }
103
  .braintree-card-input-field #card-number {
104
- float: left;
105
- height: 48px;
106
- width: 100%;
107
- padding-left: 66px;
108
- box-sizing: border-box;
109
  }
110
  #braintree-expiration-container {
111
- display: block;
112
- width: 100%;
113
- vertical-align: middle;
114
- font-size: 0;
115
  }
116
  .braintree-expiration {
117
- width: 70px;
118
- display: inline-block;
119
- *zoom: 1;
120
- *display: inline;
121
  }
122
  .braintree-expiration-seperator {
123
- vertical-align: top;
124
- line-height: 42px;
125
- display: inline-block;
126
- *zoom: 1;
127
- *display: inline;
128
- font-size: 30px;
129
- padding: 0 8px;
130
  }
131
  .braintree-cvv {
132
- width: 80px;
133
  }
134
  .braintree-hostedfield .cvv-what-is-this {
135
- margin-left: 0;
136
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Accepted Cards */
2
+ #braintree-accepted-cards img {
3
+ float: left;
4
+ margin-right: 4px;
5
  }
6
+ /* Hosted Fields Loading State */
7
+ #credit-card-form.loading {
8
+ position: relative;
 
 
9
  }
10
+ #credit-card-form .braintree-hostedfield {
11
+ opacity: 1;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  }
13
+ #credit-card-form .credit-card-loading {
14
+ display: none;
15
  }
16
+ #credit-card-form.loading .credit-card-loading {
17
+ position: absolute;
18
+ top: 30%;
19
+ left: 0;
20
+ right: 0;
21
+ width: 100%;
22
+ height: 70%;
23
+ text-align: center;
24
+ display: block;
 
 
 
 
 
 
25
  }
26
+ #credit-card-form.loading .credit-card-loading img {
27
+ margin: 16px auto;
 
28
  }
29
+ #credit-card-form.loading .braintree-hostedfield {
30
+ opacity: 0;
 
 
 
 
31
  }
 
32
  /* Hosted Fields */
33
  #braintree-hosted-submit {
34
+ display: none;
35
  }
36
  .braintree-input-field {
37
+ height: 42px;
38
+ max-width: 340px;
39
+ padding: 0 10px;
40
+ border: 1px solid lightgrey;
41
+ background: white;
42
  }
43
  .braintree-card-input-field {
44
+ height: 50px;
45
+ width: 100%;
46
+ max-width: 372px;
47
+ border: 1px solid lightgrey;
48
+ position: relative;
49
+ background: white;
50
  }
51
  .braintree-card-input-field .card-type {
52
+ position: absolute;
53
+ top: 0;
54
+ left: 0;
55
+ bottom: 0;
56
+ padding: 0 10px 0 8px;
57
  }
58
  .braintree-card-input-field .card-type img {
59
+ height: 48px;
60
  }
61
  .braintree-card-input-field #card-number {
62
+ float: left;
63
+ height: 48px;
64
+ width: 100%;
65
+ padding-left: 66px;
66
+ box-sizing: border-box;
67
  }
68
  #braintree-expiration-container {
69
+ display: block;
70
+ width: 100%;
71
+ vertical-align: middle;
72
+ font-size: 0;
73
  }
74
  .braintree-expiration {
75
+ width: 70px;
76
+ display: inline-block;
77
+ *zoom: 1;
78
+ *display: inline;
79
  }
80
  .braintree-expiration-seperator {
81
+ vertical-align: top;
82
+ line-height: 42px;
83
+ display: inline-block;
84
+ *zoom: 1;
85
+ *display: inline;
86
+ font-size: 30px;
87
+ padding: 0 8px;
88
  }
89
  .braintree-cvv {
90
+ width: 80px;
91
  }
92
  .braintree-hostedfield .cvv-what-is-this {
93
+ margin-left: 0;
94
+ }
95
+ #paypal-container iframe {
96
+ display: none;
97
+ }
98
+ /* PayPal headless button */
99
+ button.braintree-paypal-button {
100
+ background: #019cde;
101
+ color: white;
102
+ height: 46px;
103
+ line-height: 46px;
104
+ padding: 0 20px 0 18px;
105
+ border: none;
106
+ border-radius: 3px;
107
+ -webkit-border-radius: 3px;
108
+ font-size: 14px;
109
+ float: left;
110
+ cursor: pointer;
111
+ }
112
+ button.braintree-paypal-button.braintree-paypal-loading {
113
+ background: #014c6b url('../../../images/gene/braintree/paypal-loading.gif') center center no-repeat;
114
+ background-size: 32px;
115
+ }
116
+ button.braintree-paypal-button.braintree-paypal-loading > span {
117
+ opacity: 0;
118
+ }
119
+ button.braintree-paypal-button.braintree-paypal-loading:hover {
120
+ background: #014c6b url('../../../images/gene/braintree/paypal-loading.gif') center center no-repeat;
121
+ }
122
+ button.braintree-paypal-button:hover {
123
+ background: #0175a6;
124
+ }
125
+ button.braintree-paypal-button > span {
126
+ display: block;
127
+ height: 46px;
128
+ line-height: 46px;
129
+ background: url('../../../images/gene/braintree/paypal.png') right center no-repeat;
130
+ background-size: 80px;
131
+ padding-right: 94px;
132
+ }
133
+ /* Saved Accounts */
134
+ #creditcard-saved-accounts,
135
+ #paypal-saved-accounts {
136
+ font-size: 0;
137
+ width: 100%;
138
+ }
139
+ #creditcard-saved-accounts tr,
140
+ #paypal-saved-accounts tr {
141
+ border-bottom: 1px dotted lightgrey;
142
+ }
143
+ #creditcard-saved-accounts tr td,
144
+ #paypal-saved-accounts tr td {
145
+ vertical-align: middle;
146
+ }
147
+ #payment_form_gene_braintree_creditcard #creditcard-saved-accounts label,
148
+ #payment_form_gene_braintree_paypal #paypal-saved-accounts label,
149
+ #payment_form_gene_braintree_creditcard #creditcard-saved-accounts .label,
150
+ #payment_form_gene_braintree_paypal #paypal-saved-accounts .label {
151
+ width: 100%;
152
+ padding: 0;
153
+ text-align: left;
154
+ float: none;
155
+ }
156
+ #payment_form_gene_braintree_creditcard p,
157
+ #payment_form_gene_braintree_paypal p {
158
+ padding: 0;
159
+ }
160
+ #creditcard-saved-accounts tr.other-row,
161
+ #paypal-saved-accounts tr.other-row {
162
+ border-bottom: 0;
163
+ }
164
+ #creditcard-saved-accounts label {
165
+ float: left;
166
+ padding: 10px 0;
167
+ line-height: 40px;
168
+ width: 100%;
169
+ }
170
+ #creditcard-saved-accounts tr.other-row label,
171
+ #paypal-saved-accounts tr.other-row label {
172
+ padding: 8px 0;
173
+ }
174
+ #paypal-saved-accounts label {
175
+ padding: 6px 0;
176
+ line-height: 40px;
177
+ }
178
+ #creditcard-saved-accounts label img,
179
+ #paypal-saved-accounts label img {
180
+ margin-left: 6px;
181
+ height: 40px;
182
+ float: left;
183
+ }
184
+ #creditcard-saved-accounts label .saved-card-info,
185
+ #paypal-saved-accounts label .saved-paypal-email {
186
+ margin-left: 14px;
187
+ float: left;
188
+ }
189
+ #creditcard-saved-accounts label .saved-card-info span {
190
+ line-height: 40px;
191
+ }
192
+ #creditcard-saved-accounts label .saved-card-info span.saved-expiry-date {
193
+ font-size: 12px;
194
+ font-weight: normal;
195
+ margin-left: 14px;
196
+ }
197
+ #gene_braintree_creditcard_store_in_vault_div label,
198
+ label[for="gene_braintree_paypal_store_in_vault"] {
199
+ width: auto!important;
200
+ }
201
+ /* Centrally aligned PayPal button */
202
+ button.braintree-paypal-button {
203
+ margin: 0 auto;
204
+ float: none;
205
+ }
206
+ #creditcard-saved-accounts td,
207
+ #paypal-saved-accounts td {
208
+ vertical-align: middle;
209
+ }
210
+ #gene_braintree_creditcard_cc_number {
211
+ text-indent: 62px!important;
212
+ }
213
+ #payment_form_gene_braintree_paypal,
214
+ #payment_form_gene_braintree_creditcard {
215
+ padding-top: 6px;
216
+ padding-bottom: 6px;
217
+ }
skin/frontend/base/default/css/gene/braintree/idev.css CHANGED
@@ -1,127 +1,268 @@
1
- #paypal-container {
2
- float: right;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  }
4
  #paypal-container iframe {
5
- display: none;
6
  }
7
- #paypal-label {
8
- line-height: 44px;
9
- float: right;
10
- margin-right: 12px;
 
 
 
 
 
 
 
 
 
11
  }
12
- #braintree-paypal-button {
13
- padding: 0!important;
14
- line-height: unset!important;
15
- float: left!important;
16
  }
17
- #credit-card-form .form-list {
18
- margin: 10px 0 0 0!important;
19
- padding: 0!important;
20
- border: 0!important;
 
 
 
 
21
  }
22
- #credit-card-form .form-list:before, #credit-card-form .form-list:after {
23
- border: 0!important;
 
 
 
 
 
24
  }
25
-
26
  /* Saved Accounts */
27
- #creditcard-saved-accounts, #paypal-saved-accounts {
28
- font-size: 0;
29
- width: 100%;
 
30
  }
31
- #creditcard-saved-accounts tr, #paypal-saved-accounts tr {
32
- border-bottom: 1px dotted lightgrey;
 
33
  }
34
- #creditcard-saved-accounts tr.other-row, #paypal-saved-accounts tr.other-row {
35
- border-bottom: 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  }
37
  #creditcard-saved-accounts label {
38
- padding: 14px 0;
39
- line-height: 48px;
40
- width: auto;
 
41
  }
42
- #creditcard-saved-accounts tr.other-row label, #paypal-saved-accounts tr.other-row label {
43
- padding: 18px 0;
 
44
  }
45
  #paypal-saved-accounts label {
46
- padding: 8px 0;
47
- line-height: 48px;
48
- width: auto;
49
  }
50
- #creditcard-saved-accounts label img {
51
- float: left;
 
 
 
52
  }
53
- #creditcard-saved-accounts label .saved-card-info, #paypal-saved-accounts label .saved-paypal-email {
54
- margin-left: 12px;
55
- float: left;
 
56
  }
57
  #creditcard-saved-accounts label .saved-card-info span {
58
- display: block;
59
- line-height: 24px;
60
  }
61
  #creditcard-saved-accounts label .saved-card-info span.saved-expiry-date {
62
- font-size: 12px;
 
 
63
  }
64
-
65
- /* Hosted Fields */
66
- #braintree-hosted-submit {
67
- display: none;
68
  }
69
- .braintree-input-field {
70
- height: 42px;
71
- max-width: 340px;
72
- padding: 0 10px;
73
- border: 1px solid lightgrey;
74
- background: white;
75
  }
76
- .braintree-card-input-field {
77
- height: 50px;
78
- width: 100%;
79
- max-width: 372px;
80
- border: 1px solid lightgrey;
81
- position: relative;
82
- background: white;
83
  }
84
- .braintree-card-input-field .card-type {
85
- position: absolute;
86
- top: 0;
87
- left: 0;
88
- bottom: 0;
89
- padding: 0 10px 0 8px;
90
  }
91
- .braintree-card-input-field .card-type img {
92
- height: 48px;
 
 
93
  }
94
- .braintree-card-input-field #card-number {
95
- float: left;
96
- height: 48px;
97
- width: 100%;
98
- padding-left: 66px;
99
- box-sizing: border-box;
100
  }
101
- #braintree-expiration-container {
102
- display: block;
103
- width: 100%;
104
- vertical-align: middle;
105
- font-size: 0;
106
  }
107
- .braintree-expiration {
108
- width: 70px;
109
- display: inline-block;
110
- *zoom: 1;
111
- *display: inline;
112
  }
113
- .braintree-expiration-seperator {
114
- vertical-align: top;
115
- line-height: 42px;
116
- display: inline-block;
117
- *zoom: 1;
118
- *display: inline;
119
- font-size: 30px;
120
- padding: 0 8px;
121
  }
122
- .braintree-cvv {
123
- width: 80px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  }
125
- .braintree-hostedfield .cvv-what-is-this {
126
- margin-left: 0;
127
- }
1
+ /* Accepted Cards */
2
+ #braintree-accepted-cards img {
3
+ float: left;
4
+ margin-right: 4px;
5
+ }
6
+ /* Hosted Fields Loading State */
7
+ #credit-card-form.loading {
8
+ position: relative;
9
+ }
10
+ #credit-card-form .braintree-hostedfield {
11
+ opacity: 1;
12
+ }
13
+ #credit-card-form .credit-card-loading {
14
+ display: none;
15
+ }
16
+ #credit-card-form.loading .credit-card-loading {
17
+ position: absolute;
18
+ top: 30%;
19
+ left: 0;
20
+ right: 0;
21
+ width: 100%;
22
+ height: 70%;
23
+ text-align: center;
24
+ display: block;
25
+ }
26
+ #credit-card-form.loading .credit-card-loading img {
27
+ margin: 16px auto;
28
+ }
29
+ #credit-card-form.loading .braintree-hostedfield {
30
+ opacity: 0;
31
+ }
32
+ /* Hosted Fields */
33
+ #braintree-hosted-submit {
34
+ display: none;
35
+ }
36
+ .braintree-input-field {
37
+ height: 42px;
38
+ max-width: 340px;
39
+ padding: 0 10px;
40
+ border: 1px solid lightgrey;
41
+ background: white;
42
+ }
43
+ .braintree-card-input-field {
44
+ height: 50px;
45
+ width: 100%;
46
+ max-width: 372px;
47
+ border: 1px solid lightgrey;
48
+ position: relative;
49
+ background: white;
50
+ }
51
+ .braintree-card-input-field .card-type {
52
+ position: absolute;
53
+ top: 0;
54
+ left: 0;
55
+ bottom: 0;
56
+ padding: 0 10px 0 8px;
57
+ }
58
+ .braintree-card-input-field .card-type img {
59
+ height: 48px;
60
+ }
61
+ .braintree-card-input-field #card-number {
62
+ float: left;
63
+ height: 48px;
64
+ width: 100%;
65
+ padding-left: 66px;
66
+ box-sizing: border-box;
67
+ }
68
+ #braintree-expiration-container {
69
+ display: block;
70
+ width: 100%;
71
+ vertical-align: middle;
72
+ font-size: 0;
73
+ }
74
+ .braintree-expiration {
75
+ width: 70px;
76
+ display: inline-block;
77
+ *zoom: 1;
78
+ *display: inline;
79
+ }
80
+ .braintree-expiration-seperator {
81
+ vertical-align: top;
82
+ line-height: 42px;
83
+ display: inline-block;
84
+ *zoom: 1;
85
+ *display: inline;
86
+ font-size: 30px;
87
+ padding: 0 8px;
88
+ }
89
+ .braintree-cvv {
90
+ width: 80px;
91
+ }
92
+ .braintree-hostedfield .cvv-what-is-this {
93
+ margin-left: 0;
94
  }
95
  #paypal-container iframe {
96
+ display: none;
97
  }
98
+ /* PayPal headless button */
99
+ button.braintree-paypal-button {
100
+ background: #019cde;
101
+ color: white;
102
+ height: 46px;
103
+ line-height: 46px;
104
+ padding: 0 20px 0 18px;
105
+ border: none;
106
+ border-radius: 3px;
107
+ -webkit-border-radius: 3px;
108
+ font-size: 14px;
109
+ float: left;
110
+ cursor: pointer;
111
  }
112
+ button.braintree-paypal-button.braintree-paypal-loading {
113
+ background: #014c6b url('../../../images/gene/braintree/paypal-loading.gif') center center no-repeat;
114
+ background-size: 32px;
 
115
  }
116
+ button.braintree-paypal-button.braintree-paypal-loading > span {
117
+ opacity: 0;
118
+ }
119
+ button.braintree-paypal-button.braintree-paypal-loading:hover {
120
+ background: #014c6b url('../../../images/gene/braintree/paypal-loading.gif') center center no-repeat;
121
+ }
122
+ button.braintree-paypal-button:hover {
123
+ background: #0175a6;
124
  }
125
+ button.braintree-paypal-button > span {
126
+ display: block;
127
+ height: 46px;
128
+ line-height: 46px;
129
+ background: url('../../../images/gene/braintree/paypal.png') right center no-repeat;
130
+ background-size: 80px;
131
+ padding-right: 94px;
132
  }
 
133
  /* Saved Accounts */
134
+ #creditcard-saved-accounts,
135
+ #paypal-saved-accounts {
136
+ font-size: 0;
137
+ width: 100%;
138
  }
139
+ #creditcard-saved-accounts tr,
140
+ #paypal-saved-accounts tr {
141
+ border-bottom: 1px dotted lightgrey;
142
  }
143
+ #creditcard-saved-accounts tr td,
144
+ #paypal-saved-accounts tr td {
145
+ vertical-align: middle;
146
+ }
147
+ #payment_form_gene_braintree_creditcard #creditcard-saved-accounts label,
148
+ #payment_form_gene_braintree_paypal #paypal-saved-accounts label,
149
+ #payment_form_gene_braintree_creditcard #creditcard-saved-accounts .label,
150
+ #payment_form_gene_braintree_paypal #paypal-saved-accounts .label {
151
+ width: 100%;
152
+ padding: 0;
153
+ text-align: left;
154
+ float: none;
155
+ }
156
+ #payment_form_gene_braintree_creditcard p,
157
+ #payment_form_gene_braintree_paypal p {
158
+ padding: 0;
159
+ }
160
+ #creditcard-saved-accounts tr.other-row,
161
+ #paypal-saved-accounts tr.other-row {
162
+ border-bottom: 0;
163
  }
164
  #creditcard-saved-accounts label {
165
+ float: left;
166
+ padding: 10px 0;
167
+ line-height: 40px;
168
+ width: 100%;
169
  }
170
+ #creditcard-saved-accounts tr.other-row label,
171
+ #paypal-saved-accounts tr.other-row label {
172
+ padding: 8px 0;
173
  }
174
  #paypal-saved-accounts label {
175
+ padding: 6px 0;
176
+ line-height: 40px;
 
177
  }
178
+ #creditcard-saved-accounts label img,
179
+ #paypal-saved-accounts label img {
180
+ margin-left: 6px;
181
+ height: 40px;
182
+ float: left;
183
  }
184
+ #creditcard-saved-accounts label .saved-card-info,
185
+ #paypal-saved-accounts label .saved-paypal-email {
186
+ margin-left: 14px;
187
+ float: left;
188
  }
189
  #creditcard-saved-accounts label .saved-card-info span {
190
+ line-height: 40px;
 
191
  }
192
  #creditcard-saved-accounts label .saved-card-info span.saved-expiry-date {
193
+ font-size: 12px;
194
+ font-weight: normal;
195
+ margin-left: 14px;
196
  }
197
+ #gene_braintree_creditcard_store_in_vault_div label,
198
+ label[for="gene_braintree_paypal_store_in_vault"] {
199
+ width: auto!important;
 
200
  }
201
+ #paypal-container {
202
+ float: right;
 
 
 
 
203
  }
204
+ #paypal-container iframe {
205
+ display: none;
 
 
 
 
 
206
  }
207
+ #paypal-label {
208
+ line-height: 44px;
209
+ float: right;
210
+ margin-right: 12px;
 
 
211
  }
212
+ #braintree-paypal-button {
213
+ padding: 0!important;
214
+ line-height: unset!important;
215
+ float: left!important;
216
  }
217
+ #credit-card-form .form-list {
218
+ margin: 10px 0 0 0!important;
219
+ padding: 0!important;
220
+ border: 0!important;
 
 
221
  }
222
+ #credit-card-form .form-list:before,
223
+ #credit-card-form .form-list:after {
224
+ border: 0!important;
 
 
225
  }
226
+ /* Saved Accounts */
227
+ #creditcard-saved-accounts,
228
+ #paypal-saved-accounts {
229
+ font-size: 0;
230
+ width: 100%;
231
  }
232
+ #creditcard-saved-accounts tr,
233
+ #paypal-saved-accounts tr {
234
+ border-bottom: 1px dotted lightgrey;
 
 
 
 
 
235
  }
236
+ #creditcard-saved-accounts tr.other-row,
237
+ #paypal-saved-accounts tr.other-row {
238
+ border-bottom: 0;
239
+ }
240
+ #creditcard-saved-accounts label {
241
+ padding: 14px 0;
242
+ line-height: 48px;
243
+ width: auto;
244
+ }
245
+ #creditcard-saved-accounts tr.other-row label,
246
+ #paypal-saved-accounts tr.other-row label {
247
+ padding: 18px 0;
248
+ }
249
+ #paypal-saved-accounts label {
250
+ padding: 8px 0;
251
+ line-height: 48px;
252
+ width: auto;
253
+ }
254
+ #creditcard-saved-accounts label img {
255
+ float: left;
256
+ }
257
+ #creditcard-saved-accounts label .saved-card-info,
258
+ #paypal-saved-accounts label .saved-paypal-email {
259
+ margin-left: 12px;
260
+ float: left;
261
+ }
262
+ #creditcard-saved-accounts label .saved-card-info span {
263
+ display: block;
264
+ line-height: 24px;
265
+ }
266
+ #creditcard-saved-accounts label .saved-card-info span.saved-expiry-date {
267
+ font-size: 12px;
268
  }
 
 
 
skin/frontend/base/default/css/gene/braintree/integrations/aheadworks.less ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../core/_general';
2
+ @import '../core/_hostedfields';
3
+ @import '../core/_paypal';
4
+ @import '../core/_saved';
5
+
6
+ /* Centrally aligned PayPal button */
7
+ button.braintree-paypal-button {
8
+ margin: 0 auto;
9
+ float: none;
10
+ }
11
+
12
+ /* This checkout extension has lots of fixed widths, leaving styling as default */
13
+ #braintree-paypal-button {
14
+ line-height: unset;
15
+ padding: 0;
16
+ }
17
+ #paypal-complete {
18
+ position: relative;
19
+ background: #fbfaf6;
20
+ text-align: center;
21
+ z-index: 6;
22
+ }
23
+ #paypal-container iframe {
24
+ display: none;
25
+ }
26
+ #paypal-complete label {
27
+ margin-bottom: 8px;
28
+ }
29
+ #braintree-paypal-button {
30
+ margin: 0 auto;
31
+ }
32
+
33
+ #payment_form_gene_braintree_paypal, #payment_form_gene_braintree_creditcard {
34
+ padding-top: 6px;
35
+ padding-bottom: 6px;
36
+ }
37
+
38
+ /* Saved Accounts */
39
+ #creditcard-saved-accounts, #paypal-saved-accounts {
40
+ font-size: 0;
41
+ width: 100%;
42
+ }
43
+ #creditcard-saved-accounts tr, #paypal-saved-accounts tr {
44
+ border-bottom: 1px dotted lightgrey;
45
+ }
46
+ #creditcard-saved-accounts tr.other-row, #paypal-saved-accounts tr.other-row {
47
+ border-bottom: 0;
48
+ }
49
+ #creditcard-saved-accounts label {
50
+ padding: 14px 0;
51
+ line-height: 48px;
52
+ width: auto;
53
+ }
54
+ #creditcard-saved-accounts tr.other-row label, #paypal-saved-accounts tr.other-row label {
55
+ padding: 18px 0;
56
+ }
57
+ #paypal-saved-accounts label {
58
+ padding: 8px 0;
59
+ line-height: 48px;
60
+ width: auto;
61
+ }
62
+ #creditcard-saved-accounts label img {
63
+ float: left;
64
+ }
65
+ #creditcard-saved-accounts label .saved-card-info, #paypal-saved-accounts label .saved-paypal-email {
66
+ margin-left: 12px;
67
+ float: left;
68
+ }
69
+ #creditcard-saved-accounts label .saved-card-info span {
70
+ display: block;
71
+ line-height: 24px;
72
+ }
73
+ #creditcard-saved-accounts label .saved-card-info span.saved-expiry-date {
74
+ font-size: 12px;
75
+ }
skin/frontend/base/default/css/gene/braintree/integrations/amasty.less ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../core/_general';
2
+ @import '../core/_hostedfields';
3
+ @import '../core/_paypal';
4
+ @import '../core/_saved';
5
+
6
+ /* Centrally aligned PayPal button */
7
+ button.braintree-paypal-button {
8
+ margin: 10px 0;
9
+ }
10
+ button.braintree-paypal-button > span {
11
+ text-align:right;
12
+ }
13
+
14
+ #creditcard-saved-accounts td, #paypal-saved-accounts td {
15
+ vertical-align: middle;
16
+ }
17
+ #gene_braintree_creditcard_cc_number {
18
+ text-indent: 62px!important;
19
+ }
20
+
21
+ #payment_form_gene_braintree_paypal, #payment_form_gene_braintree_creditcard {
22
+ padding-top: 6px;
23
+ padding-bottom: 6px;
24
+ }
skin/frontend/base/default/css/gene/braintree/integrations/default.less ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../core/_general';
2
+ @import '../core/_hostedfields';
3
+ @import '../core/_paypal';
4
+ @import '../core/_saved';
5
+
6
+ /* Multi shipping */
7
+ body.checkout-multishipping-billing #payment-continue.loading {
8
+ padding-left: 12px;
9
+ }
10
+ body.checkout-multishipping-billing #payment-continue.loading > span {
11
+ background: url('../../../images/gene/loader-white.gif') center left no-repeat;
12
+ background-size: 15px 15px;
13
+ padding-left: 22px;
14
+ }
15
+ body.checkout-multishipping-billing .buttons-set #paypal-complete {
16
+ float: right;
17
+ width: 400px;
18
+ text-align: right;
19
+ }
20
+ body.checkout-multishipping-billing .buttons-set #paypal-complete > label {
21
+ float: right;
22
+ margin-right: 16px;
23
+ }
24
+ body.checkout-multishipping-billing .buttons-set #paypal-complete #paypal-container {
25
+ float: right;
26
+ }
skin/frontend/base/default/css/gene/braintree/integrations/firecheckout.less ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../core/_general';
2
+ @import '../core/_hostedfields';
3
+ @import '../core/_paypal';
4
+ @import '../core/_saved';
5
+
6
+ #paypal-complete #paypal-label {
7
+ float: right;
8
+ margin-right: 8px;
9
+ line-height: 44px;
10
+ }
11
+ #paypal-container iframe {
12
+ display: none;
13
+ }
14
+ #paypal-complete #paypal-container {
15
+ float: right;
16
+ }
17
+ #braintree-paypal-button {
18
+ padding: 0;
19
+ }
20
+
21
+ #payment_form_gene_braintree_paypal, #payment_form_gene_braintree_creditcard {
22
+ padding-top: 6px;
23
+ padding-bottom: 6px;
24
+ }
skin/frontend/base/default/css/gene/braintree/integrations/fme.less ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../core/_general';
2
+ @import '../core/_hostedfields';
3
+ @import '../core/_paypal';
4
+ @import '../core/_saved';
5
+
6
+ /* Centrally aligned PayPal button */
7
+ button.braintree-paypal-button {
8
+ margin: 0 auto;
9
+ float: none;
10
+ }
11
+
12
+ #creditcard-saved-accounts td, #paypal-saved-accounts td {
13
+ vertical-align: middle;
14
+ }
15
+ #gene_braintree_creditcard_cc_number {
16
+ text-indent: 62px!important;
17
+ }
18
+
19
+ #payment_form_gene_braintree_paypal, #payment_form_gene_braintree_creditcard {
20
+ padding-top: 6px;
21
+ padding-bottom: 6px;
22
+ }
skin/frontend/base/default/css/gene/braintree/integrations/idev.less ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../core/_general';
2
+ @import '../core/_hostedfields';
3
+ @import '../core/_paypal';
4
+ @import '../core/_saved';
5
+
6
+ #paypal-container {
7
+ float: right;
8
+ }
9
+ #paypal-container iframe {
10
+ display: none;
11
+ }
12
+ #paypal-label {
13
+ line-height: 44px;
14
+ float: right;
15
+ margin-right: 12px;
16
+ }
17
+ #braintree-paypal-button {
18
+ padding: 0!important;
19
+ line-height: unset!important;
20
+ float: left!important;
21
+ }
22
+ #credit-card-form .form-list {
23
+ margin: 10px 0 0 0!important;
24
+ padding: 0!important;
25
+ border: 0!important;
26
+ }
27
+ #credit-card-form .form-list:before, #credit-card-form .form-list:after {
28
+ border: 0!important;
29
+ }
30
+
31
+ /* Saved Accounts */
32
+ #creditcard-saved-accounts, #paypal-saved-accounts {
33
+ font-size: 0;
34
+ width: 100%;
35
+ }
36
+ #creditcard-saved-accounts tr, #paypal-saved-accounts tr {
37
+ border-bottom: 1px dotted lightgrey;
38
+ }
39
+ #creditcard-saved-accounts tr.other-row, #paypal-saved-accounts tr.other-row {
40
+ border-bottom: 0;
41
+ }
42
+ #creditcard-saved-accounts label {
43
+ padding: 14px 0;
44
+ line-height: 48px;
45
+ width: auto;
46
+ }
47
+ #creditcard-saved-accounts tr.other-row label, #paypal-saved-accounts tr.other-row label {
48
+ padding: 18px 0;
49
+ }
50
+ #paypal-saved-accounts label {
51
+ padding: 8px 0;
52
+ line-height: 48px;
53
+ width: auto;
54
+ }
55
+ #creditcard-saved-accounts label img {
56
+ float: left;
57
+ }
58
+ #creditcard-saved-accounts label .saved-card-info, #paypal-saved-accounts label .saved-paypal-email {
59
+ margin-left: 12px;
60
+ float: left;
61
+ }
62
+ #creditcard-saved-accounts label .saved-card-info span {
63
+ display: block;
64
+ line-height: 24px;
65
+ }
66
+ #creditcard-saved-accounts label .saved-card-info span.saved-expiry-date {
67
+ font-size: 12px;
68
+ }
skin/frontend/base/default/css/gene/braintree/integrations/iwd.less ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../core/_general';
2
+ @import '../core/_hostedfields';
3
+ @import '../core/_paypal';
4
+ @import '../core/_saved';
5
+
6
+ /* IWD uses a lot of badly targeted styles meaning we have to target our elements more specifically */
7
+ .opc-wrapper-opc button.braintree-paypal-button {
8
+ background:#019cde !important;
9
+ color:white !important;
10
+ height:46px;
11
+ line-height:46px;
12
+ padding:0 20px 0 18px;
13
+ border:none;
14
+ border-radius:3px;
15
+ -webkit-border-radius:3px;
16
+ font-size:14px;
17
+ float:none;
18
+ margin:14px auto;
19
+ > span {
20
+ display:block !important;
21
+ color:white !important;
22
+ height:46px;
23
+ line-height:46px;
24
+ background:url('../../../images/gene/braintree/paypal.png') right center no-repeat !important;
25
+ background-size:80px !important;
26
+ padding-right:94px !important;
27
+ > span {
28
+ color:white;
29
+ }
30
+ }
31
+ }
32
+ .opc-wrapper-opc button.braintree-paypal-button.braintree-paypal-loading {
33
+ background:#014c6b url('../../../images/gene/braintree/paypal-loading.gif') center center no-repeat !important;
34
+ background-size:32px !important;
35
+ > span {
36
+ opacity:0;
37
+ }
38
+ }
39
+ .opc-wrapper-opc button.braintree-paypal-button.braintree-paypal-loading:hover {
40
+ background:#014c6b url('../../../images/gene/braintree/paypal-loading.gif') center center no-repeat !important;
41
+ }
42
+ .opc-wrapper-opc button.braintree-paypal-button:hover {
43
+ background:#0175a6 !important;
44
+ }
45
+
46
+ /* IWD Specific Styling */
47
+ #paypal-saved-accounts, .paypal-info, #creditcard-saved-accounts, #credit-card-form {
48
+ margin-bottom:20px;
49
+ }
50
+ #paypal-complete {
51
+ text-align:center;
52
+ padding:4px 0;
53
+ label {
54
+ margin-bottom:8px;
55
+ }
56
+ }
57
+ #paypal-container iframe {
58
+ display:none;
59
+ }
60
+ #braintree-paypal-button {
61
+ line-height:unset;
62
+ padding:0;
63
+ }
64
+ a#braintree-paypal-button {
65
+ margin:0 auto;
66
+ }
skin/frontend/base/default/css/gene/braintree/integrations/magestore.less ADDED
@@ -0,0 +1,203 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../core/_general';
2
+ @import '../core/_hostedfields';
3
+ @import '../core/_paypal';
4
+ @import '../core/_saved';
5
+
6
+ #braintree-accepted-cards {
7
+ float: left;
8
+ width: 100%;
9
+
10
+ > div {
11
+ float: left;
12
+ width: 100%;
13
+ }
14
+ }
15
+ #paypal-complete {
16
+ padding: 20px 0;
17
+ }
18
+ #paypal-complete label {
19
+ margin-right: 16px;
20
+ line-height: 44px;
21
+ }
22
+ #braintree-paypal-button {
23
+ line-height: unset;
24
+ padding: 0;
25
+ float: left;
26
+ }
27
+ #paypal-container {
28
+ float:right;
29
+ }
30
+ #paypal-container iframe {
31
+ display: none;
32
+ }
33
+ .one-step-checkout .input-text[name="payment[cc_number]"] {
34
+ height: 46px!important;
35
+ text-indent: 56px!important;
36
+ }
37
+ .saved-cards-intro {
38
+ float: left;
39
+ }
40
+ #credit-card-form {
41
+ padding-bottom: 12px;
42
+ float: left;
43
+ }
44
+ #credit-card-form .form-list, #payment_form_gene_braintree_creditcard, #payment_form_gene_braintree_paypal {
45
+ width: 100%;
46
+ padding: 0;
47
+ }
48
+ #payment_form_gene_braintree_creditcard, #payment_form_gene_braintree_paypal {
49
+ padding: 4px 0;
50
+
51
+ em {
52
+ color: darkgrey;
53
+ }
54
+ }
55
+ #credit-card-form label {
56
+ display: block;
57
+ width: 100%;
58
+ float: none;
59
+ margin-top: 8px;
60
+ }
61
+ #credit-card-form #gene_braintree_creditcard_store_in_vault_div {
62
+ float: left;
63
+ width: 100%;
64
+ }
65
+ #credit-card-form #gene_braintree_creditcard_store_in_vault_div input, #credit-card-form #gene_braintree_creditcard_store_in_vault_div label {
66
+ display: inline;
67
+ }
68
+ #payment_form_gene_braintree_paypal p {
69
+ float: left;
70
+ width: 100%;
71
+ }
72
+
73
+ /* Hosted Fields Loading State */
74
+ #credit-card-form.loading {
75
+ position: relative;
76
+ }
77
+ #credit-card-form .braintree-hostedfield {
78
+ opacity: 1;
79
+ }
80
+ #credit-card-form .credit-card-loading {
81
+ display: none;
82
+ }
83
+ #credit-card-form.loading .credit-card-loading {
84
+ position: absolute;
85
+ top: 30%;
86
+ left: 0;
87
+ right: 0;
88
+ width: 100%;
89
+ height: 70%;
90
+ text-align: center;
91
+ display: block;
92
+ }
93
+ #credit-card-form.loading .credit-card-loading img {
94
+ margin: 16px auto;
95
+ }
96
+ #credit-card-form.loading .braintree-hostedfield {
97
+ opacity: 0;
98
+ }
99
+
100
+ /* Saved Accounts */
101
+ #creditcard-saved-accounts, #paypal-saved-accounts {
102
+ font-size: 0;
103
+ width: 100%;
104
+ }
105
+ #creditcard-saved-accounts tr, #paypal-saved-accounts tr {
106
+ border-bottom: 1px dotted lightgrey;
107
+ }
108
+ #creditcard-saved-accounts tr.other-row, #paypal-saved-accounts tr.other-row {
109
+ border-bottom: 0;
110
+ }
111
+ #creditcard-saved-accounts label {
112
+ padding: 14px 0;
113
+ line-height: 48px;
114
+ width: auto;
115
+ }
116
+ #creditcard-saved-accounts tr.other-row label, #paypal-saved-accounts tr.other-row label {
117
+ padding: 18px 0;
118
+ }
119
+ #paypal-saved-accounts label {
120
+ padding: 8px 0;
121
+ line-height: 48px;
122
+ width: auto;
123
+ }
124
+ #creditcard-saved-accounts label img {
125
+ margin-left: 6px;
126
+ float: left;
127
+ }
128
+ #creditcard-saved-accounts label .saved-card-info, #paypal-saved-accounts label .saved-paypal-email {
129
+ margin-left: 12px;
130
+ float: left;
131
+ }
132
+ #creditcard-saved-accounts label .saved-card-info span {
133
+ display: block;
134
+ line-height: 24px;
135
+ }
136
+ #creditcard-saved-accounts label .saved-card-info span.saved-expiry-date {
137
+ font-size: 12px;
138
+ font-weight: normal;
139
+ }
140
+
141
+ /* Hosted Fields */
142
+ #braintree-hosted-submit {
143
+ display: none;
144
+ }
145
+ .braintree-input-field {
146
+ height: 42px;
147
+ max-width: 340px;
148
+ padding: 0 10px;
149
+ border: 1px solid lightgrey;
150
+ background: white;
151
+ }
152
+ .braintree-card-input-field {
153
+ height: 50px;
154
+ width: 100%;
155
+ max-width: 372px;
156
+ border: 1px solid lightgrey;
157
+ position: relative;
158
+ background: white;
159
+ }
160
+ .braintree-card-input-field .card-type {
161
+ position: absolute;
162
+ top: 0;
163
+ left: 0;
164
+ bottom: 0;
165
+ padding: 0 10px 0 8px;
166
+ }
167
+ .braintree-card-input-field .card-type img {
168
+ height: 48px;
169
+ }
170
+ .braintree-card-input-field #card-number {
171
+ float: left;
172
+ height: 48px;
173
+ width: 100%;
174
+ padding-left: 66px;
175
+ box-sizing: border-box;
176
+ }
177
+ #braintree-expiration-container {
178
+ display: block;
179
+ width: 100%;
180
+ vertical-align: middle;
181
+ font-size: 0;
182
+ }
183
+ .braintree-expiration {
184
+ width: 70px;
185
+ display: inline-block;
186
+ *zoom: 1;
187
+ *display: inline;
188
+ }
189
+ .braintree-expiration-seperator {
190
+ vertical-align: top;
191
+ line-height: 42px;
192
+ display: inline-block;
193
+ *zoom: 1;
194
+ *display: inline;
195
+ font-size: 30px;
196
+ padding: 0 8px;
197
+ }
198
+ .braintree-cvv {
199
+ width: 80px;
200
+ }
201
+ .braintree-hostedfield .cvv-what-is-this {
202
+ margin-left: 0;
203
+ }
skin/frontend/base/default/css/gene/braintree/integrations/oye.less ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../core/_general';
2
+ @import '../core/_hostedfields';
3
+ @import '../core/_paypal';
4
+ @import '../core/_saved';
5
+
6
+ #paypal-complete #paypal-label {
7
+ float: right;
8
+ margin-right: 8px;
9
+ line-height: 44px;
10
+ }
11
+ #paypal-container iframe {
12
+ display: none;
13
+ }
14
+ #paypal-complete #paypal-container {
15
+ float: right;
16
+ }
17
+ #braintree-paypal-button {
18
+ padding: 0;
19
+ }
20
+
21
+ #payment_form_gene_braintree_paypal, #payment_form_gene_braintree_creditcard {
22
+ padding-top: 6px;
23
+ padding-bottom: 6px;
24
+ }
25
+
26
+ .braintree-input-field {
27
+ height: 42px;
28
+ max-width: 340px;
29
+ padding: 0 10px;
30
+ border: 1px solid lightgrey;
31
+ background: white;
32
+ }
33
+ .braintree-card-input-field {
34
+ height: 50px;
35
+ width: 100%;
36
+ max-width: 372px;
37
+ border: 1px solid lightgrey;
38
+ position: relative;
39
+ background: white;
40
+ }
41
+ .braintree-card-input-field .card-type {
42
+ position: absolute;
43
+ top: 0;
44
+ left: 0;
45
+ bottom: 0;
46
+ padding: 0 10px 0 8px;
47
+ }
48
+ .braintree-card-input-field .card-type img {
49
+ height: 48px;
50
+ }
51
+ .braintree-card-input-field #card-number {
52
+ float: left;
53
+ height: 48px;
54
+ width: 100%;
55
+ padding-left: 66px;
56
+ box-sizing: border-box;
57
+ }
58
+ #braintree-expiration-container {
59
+ display: block;
60
+ width: 100%;
61
+ vertical-align: middle;
62
+ font-size: 0;
63
+ }
64
+ .braintree-expiration {
65
+ width: 70px;
66
+ display: inline-block;
67
+ *zoom: 1;
68
+ *display: inline;
69
+ }
70
+ .braintree-expiration-seperator {
71
+ vertical-align: top;
72
+ line-height: 42px;
73
+ display: inline-block;
74
+ *zoom: 1;
75
+ *display: inline;
76
+ font-size: 30px;
77
+ padding: 0 8px;
78
+ }
79
+ .braintree-cvv {
80
+ width: 80px;
81
+ }
82
+ .braintree-hostedfield .cvv-what-is-this {
83
+ margin-left: 0;
84
+ }
skin/frontend/base/default/css/gene/braintree/integrations/unicode.less ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../core/_general';
2
+ @import '../core/_hostedfields';
3
+ @import '../core/_paypal';
4
+ @import '../core/_saved';
5
+
6
+ /* Centrally aligned PayPal button */
7
+ button.braintree-paypal-button {
8
+ margin: 10px auto;
9
+ float: none;
10
+ }
11
+
12
+ #creditcard-saved-accounts tr td, #paypal-saved-accounts tr td {
13
+ vertical-align: middle!important;
14
+ }
15
+
16
+ #payment_form_gene_braintree_paypal, #payment_form_gene_braintree_creditcard {
17
+ margin-left: 0!important;
18
+ padding: 8px 0;
19
+ }
20
+ #payment_form_gene_braintree_paypal label, #payment_form_gene_braintree_creditcard label {
21
+ width: 100%;
22
+ text-align: left;
23
+ float: none;
24
+ }
25
+ #payment_form_gene_braintree_paypal p {
26
+ padding: 0!important;
27
+ }
28
+ #paypal-complete {
29
+ padding: 20px 0;
30
+ text-align: center;
31
+ }
32
+ #paypal-complete label {
33
+ line-height: 32px;
34
+ }
35
+ #braintree-paypal-button {
36
+ line-height: unset;
37
+ padding: 0;
38
+ margin: 0 auto;
39
+ }
40
+ #paypal-container iframe {
41
+ display: none;
42
+ }
skin/frontend/base/default/css/gene/braintree/iwd.css CHANGED
@@ -1,124 +1,263 @@
1
- #paypal-saved-accounts, .paypal-info, #creditcard-saved-accounts, #credit-card-form {
2
- margin-bottom: 20px;
 
 
3
  }
4
- #paypal-complete {
5
- text-align: center;
6
- padding: 4px 0;
7
  }
8
- #paypal-complete label {
9
- margin-bottom: 8px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  }
11
  #paypal-container iframe {
12
- display: none;
13
  }
14
- #braintree-paypal-button {
15
- line-height: unset;
16
- padding: 0;
 
 
 
 
 
 
 
 
 
 
17
  }
18
- a#braintree-paypal-button {
19
- margin: 0 auto;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  }
21
-
22
  /* Saved Accounts */
23
- #creditcard-saved-accounts, #paypal-saved-accounts {
24
- font-size: 0;
25
- width: 100%;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  }
27
- #creditcard-saved-accounts tr, #paypal-saved-accounts tr {
28
- border-bottom: 1px dotted lightgrey;
 
29
  }
30
- #creditcard-saved-accounts tr.other-row, #paypal-saved-accounts tr.other-row {
31
- border-bottom: 0;
 
32
  }
33
  #creditcard-saved-accounts label {
34
- padding: 14px 0;
35
- line-height: 48px;
36
- width: auto;
 
37
  }
38
- #creditcard-saved-accounts tr.other-row label, #paypal-saved-accounts tr.other-row label {
39
- padding: 0;
 
40
  }
41
  #paypal-saved-accounts label {
42
- padding: 8px 0;
43
- line-height: 48px;
44
- width: auto;
45
  }
46
- #creditcard-saved-accounts label img, #paypal-saved-accounts label img {
47
- margin-left: 6px;
48
- float: left;
 
 
49
  }
50
- #creditcard-saved-accounts label .saved-card-info, #paypal-saved-accounts label .saved-paypal-email {
51
- margin-left: 14px;
52
- float: left;
 
53
  }
54
  #creditcard-saved-accounts label .saved-card-info span {
55
- display: block;
56
- line-height: 24px;
57
  }
58
  #creditcard-saved-accounts label .saved-card-info span.saved-expiry-date {
59
- font-size: 12px;
 
 
60
  }
61
-
62
- /* Hosted Fields */
63
- #braintree-hosted-submit {
64
- display: none;
65
  }
66
- .braintree-input-field {
67
- height: 42px;
68
- max-width: 340px;
69
- padding: 0 10px;
70
- border: 1px solid lightgrey;
71
- background: white;
 
 
 
 
 
 
 
72
  }
73
- .braintree-card-input-field {
74
- height: 50px;
75
- width: 100%;
76
- max-width: 372px;
77
- border: 1px solid lightgrey;
78
- position: relative;
79
- background: white;
 
80
  }
81
- .braintree-card-input-field .card-type {
82
- position: absolute;
83
- top: 0;
84
- left: 0;
85
- bottom: 0;
86
- padding: 0 10px 0 8px;
87
  }
88
- .braintree-card-input-field .card-type img {
89
- height: 48px;
 
90
  }
91
- .braintree-card-input-field #card-number {
92
- float: left;
93
- height: 48px;
94
- width: 100%;
95
- padding-left: 66px;
96
- box-sizing: border-box;
97
  }
98
- #braintree-expiration-container {
99
- display: block;
100
- width: 100%;
101
- vertical-align: middle;
102
- font-size: 0;
103
  }
104
- .braintree-expiration {
105
- width: 70px;
106
- display: inline-block;
107
- *zoom: 1;
108
- *display: inline;
109
  }
110
- .braintree-expiration-seperator {
111
- vertical-align: top;
112
- line-height: 42px;
113
- display: inline-block;
114
- *zoom: 1;
115
- *display: inline;
116
- font-size: 30px;
117
- padding: 0 8px;
118
  }
119
- .braintree-cvv {
120
- width: 80px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  }
122
- .braintree-hostedfield .cvv-what-is-this {
123
- margin-left: 0;
124
- }
1
+ /* Accepted Cards */
2
+ #braintree-accepted-cards img {
3
+ float: left;
4
+ margin-right: 4px;
5
  }
6
+ /* Hosted Fields Loading State */
7
+ #credit-card-form.loading {
8
+ position: relative;
9
  }
10
+ #credit-card-form .braintree-hostedfield {
11
+ opacity: 1;
12
+ }
13
+ #credit-card-form .credit-card-loading {
14
+ display: none;
15
+ }
16
+ #credit-card-form.loading .credit-card-loading {
17
+ position: absolute;
18
+ top: 30%;
19
+ left: 0;
20
+ right: 0;
21
+ width: 100%;
22
+ height: 70%;
23
+ text-align: center;
24
+ display: block;
25
+ }
26
+ #credit-card-form.loading .credit-card-loading img {
27
+ margin: 16px auto;
28
+ }
29
+ #credit-card-form.loading .braintree-hostedfield {
30
+ opacity: 0;
31
+ }
32
+ /* Hosted Fields */
33
+ #braintree-hosted-submit {
34
+ display: none;
35
+ }
36
+ .braintree-input-field {
37
+ height: 42px;
38
+ max-width: 340px;
39
+ padding: 0 10px;
40
+ border: 1px solid lightgrey;
41
+ background: white;
42
+ }
43
+ .braintree-card-input-field {
44
+ height: 50px;
45
+ width: 100%;
46
+ max-width: 372px;
47
+ border: 1px solid lightgrey;
48
+ position: relative;
49
+ background: white;
50
+ }
51
+ .braintree-card-input-field .card-type {
52
+ position: absolute;
53
+ top: 0;
54
+ left: 0;
55
+ bottom: 0;
56
+ padding: 0 10px 0 8px;
57
+ }
58
+ .braintree-card-input-field .card-type img {
59
+ height: 48px;
60
+ }
61
+ .braintree-card-input-field #card-number {
62
+ float: left;
63
+ height: 48px;
64
+ width: 100%;
65
+ padding-left: 66px;
66
+ box-sizing: border-box;
67
+ }
68
+ #braintree-expiration-container {
69
+ display: block;
70
+ width: 100%;
71
+ vertical-align: middle;
72
+ font-size: 0;
73
+ }
74
+ .braintree-expiration {
75
+ width: 70px;
76
+ display: inline-block;
77
+ *zoom: 1;
78
+ *display: inline;
79
+ }
80
+ .braintree-expiration-seperator {
81
+ vertical-align: top;
82
+ line-height: 42px;
83
+ display: inline-block;
84
+ *zoom: 1;
85
+ *display: inline;
86
+ font-size: 30px;
87
+ padding: 0 8px;
88
+ }
89
+ .braintree-cvv {
90
+ width: 80px;
91
+ }
92
+ .braintree-hostedfield .cvv-what-is-this {
93
+ margin-left: 0;
94
  }
95
  #paypal-container iframe {
96
+ display: none;
97
  }
98
+ /* PayPal headless button */
99
+ button.braintree-paypal-button {
100
+ background: #019cde;
101
+ color: white;
102
+ height: 46px;
103
+ line-height: 46px;
104
+ padding: 0 20px 0 18px;
105
+ border: none;
106
+ border-radius: 3px;
107
+ -webkit-border-radius: 3px;
108
+ font-size: 14px;
109
+ float: left;
110
+ cursor: pointer;
111
  }
112
+ button.braintree-paypal-button.braintree-paypal-loading {
113
+ background: #014c6b url('../../../images/gene/braintree/paypal-loading.gif') center center no-repeat;
114
+ background-size: 32px;
115
+ }
116
+ button.braintree-paypal-button.braintree-paypal-loading > span {
117
+ opacity: 0;
118
+ }
119
+ button.braintree-paypal-button.braintree-paypal-loading:hover {
120
+ background: #014c6b url('../../../images/gene/braintree/paypal-loading.gif') center center no-repeat;
121
+ }
122
+ button.braintree-paypal-button:hover {
123
+ background: #0175a6;
124
+ }
125
+ button.braintree-paypal-button > span {
126
+ display: block;
127
+ height: 46px;
128
+ line-height: 46px;
129
+ background: url('../../../images/gene/braintree/paypal.png') right center no-repeat;
130
+ background-size: 80px;
131
+ padding-right: 94px;
132
  }
 
133
  /* Saved Accounts */
134
+ #creditcard-saved-accounts,
135
+ #paypal-saved-accounts {
136
+ font-size: 0;
137
+ width: 100%;
138
+ }
139
+ #creditcard-saved-accounts tr,
140
+ #paypal-saved-accounts tr {
141
+ border-bottom: 1px dotted lightgrey;
142
+ }
143
+ #creditcard-saved-accounts tr td,
144
+ #paypal-saved-accounts tr td {
145
+ vertical-align: middle;
146
+ }
147
+ #payment_form_gene_braintree_creditcard #creditcard-saved-accounts label,
148
+ #payment_form_gene_braintree_paypal #paypal-saved-accounts label,
149
+ #payment_form_gene_braintree_creditcard #creditcard-saved-accounts .label,
150
+ #payment_form_gene_braintree_paypal #paypal-saved-accounts .label {
151
+ width: 100%;
152
+ padding: 0;
153
+ text-align: left;
154
+ float: none;
155
  }
156
+ #payment_form_gene_braintree_creditcard p,
157
+ #payment_form_gene_braintree_paypal p {
158
+ padding: 0;
159
  }
160
+ #creditcard-saved-accounts tr.other-row,
161
+ #paypal-saved-accounts tr.other-row {
162
+ border-bottom: 0;
163
  }
164
  #creditcard-saved-accounts label {
165
+ float: left;
166
+ padding: 10px 0;
167
+ line-height: 40px;
168
+ width: 100%;
169
  }
170
+ #creditcard-saved-accounts tr.other-row label,
171
+ #paypal-saved-accounts tr.other-row label {
172
+ padding: 8px 0;
173
  }
174
  #paypal-saved-accounts label {
175
+ padding: 6px 0;
176
+ line-height: 40px;
 
177
  }
178
+ #creditcard-saved-accounts label img,
179
+ #paypal-saved-accounts label img {
180
+ margin-left: 6px;
181
+ height: 40px;
182
+ float: left;
183
  }
184
+ #creditcard-saved-accounts label .saved-card-info,
185
+ #paypal-saved-accounts label .saved-paypal-email {
186
+ margin-left: 14px;
187
+ float: left;
188
  }
189
  #creditcard-saved-accounts label .saved-card-info span {
190
+ line-height: 40px;
 
191
  }
192
  #creditcard-saved-accounts label .saved-card-info span.saved-expiry-date {
193
+ font-size: 12px;
194
+ font-weight: normal;
195
+ margin-left: 14px;
196
  }
197
+ #gene_braintree_creditcard_store_in_vault_div label,
198
+ label[for="gene_braintree_paypal_store_in_vault"] {
199
+ width: auto!important;
 
200
  }
201
+ /* IWD uses a lot of badly targeted styles meaning we have to target our elements more specifically */
202
+ .opc-wrapper-opc button.braintree-paypal-button {
203
+ background: #019cde !important;
204
+ color: white !important;
205
+ height: 46px;
206
+ line-height: 46px;
207
+ padding: 0 20px 0 18px;
208
+ border: none;
209
+ border-radius: 3px;
210
+ -webkit-border-radius: 3px;
211
+ font-size: 14px;
212
+ float: none;
213
+ margin: 14px auto;
214
  }
215
+ .opc-wrapper-opc button.braintree-paypal-button > span {
216
+ display: block !important;
217
+ color: white !important;
218
+ height: 46px;
219
+ line-height: 46px;
220
+ background: url('../../../images/gene/braintree/paypal.png') right center no-repeat !important;
221
+ background-size: 80px !important;
222
+ padding-right: 94px !important;
223
  }
224
+ .opc-wrapper-opc button.braintree-paypal-button > span > span {
225
+ color: white;
 
 
 
 
226
  }
227
+ .opc-wrapper-opc button.braintree-paypal-button.braintree-paypal-loading {
228
+ background: #014c6b url('../../../images/gene/braintree/paypal-loading.gif') center center no-repeat !important;
229
+ background-size: 32px !important;
230
  }
231
+ .opc-wrapper-opc button.braintree-paypal-button.braintree-paypal-loading > span {
232
+ opacity: 0;
 
 
 
 
233
  }
234
+ .opc-wrapper-opc button.braintree-paypal-button.braintree-paypal-loading:hover {
235
+ background: #014c6b url('../../../images/gene/braintree/paypal-loading.gif') center center no-repeat !important;
 
 
 
236
  }
237
+ .opc-wrapper-opc button.braintree-paypal-button:hover {
238
+ background: #0175a6 !important;
 
 
 
239
  }
240
+ /* IWD Specific Styling */
241
+ #paypal-saved-accounts,
242
+ .paypal-info,
243
+ #creditcard-saved-accounts,
244
+ #credit-card-form {
245
+ margin-bottom: 20px;
 
 
246
  }
247
+ #paypal-complete {
248
+ text-align: center;
249
+ padding: 4px 0;
250
+ }
251
+ #paypal-complete label {
252
+ margin-bottom: 8px;
253
+ }
254
+ #paypal-container iframe {
255
+ display: none;
256
+ }
257
+ #braintree-paypal-button {
258
+ line-height: unset;
259
+ padding: 0;
260
+ }
261
+ a#braintree-paypal-button {
262
+ margin: 0 auto;
263
  }
 
 
 
skin/frontend/base/default/css/gene/braintree/magestore.css CHANGED
@@ -1,155 +1,403 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  #paypal-complete {
2
- padding: 20px 0;
3
  }
4
  #paypal-complete label {
5
- margin-right: 16px;
6
- line-height: 44px;
7
  }
8
  #braintree-paypal-button {
9
- line-height: unset;
10
- padding: 0;
11
- float: left;
 
 
 
12
  }
13
  #paypal-container iframe {
14
- display: none;
15
  }
16
  .one-step-checkout .input-text[name="payment[cc_number]"] {
17
- height: 46px!important;
18
- text-indent: 56px!important;
19
  }
20
  .saved-cards-intro {
21
- float: left;
22
  }
23
  #credit-card-form {
24
- padding-bottom: 12px;
25
- float: left;
 
 
 
 
 
 
26
  }
27
- #credit-card-form .form-list, #payment_form_gene_braintree_creditcard, #payment_form_gene_braintree_paypal {
28
- width: 100%;
29
- padding: 0;
30
  }
31
- #payment_form_gene_braintree_creditcard, #payment_form_gene_braintree_paypal {
32
- padding: 4px 0;
 
33
  }
34
  #credit-card-form label {
35
- display: block;
36
- width: 100%;
37
- float: none;
38
- margin-top: 8px;
39
  }
40
  #credit-card-form #gene_braintree_creditcard_store_in_vault_div {
41
- float: left;
42
- width: 100%;
43
  }
44
- #credit-card-form #gene_braintree_creditcard_store_in_vault_div input, #credit-card-form #gene_braintree_creditcard_store_in_vault_div label {
45
- display: inline;
 
46
  }
47
  #payment_form_gene_braintree_paypal p {
48
- float: left;
49
- width: 100%;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  }
51
-
52
  /* Saved Accounts */
53
- #creditcard-saved-accounts, #paypal-saved-accounts {
54
- font-size: 0;
55
- width: 100%;
 
56
  }
57
- #creditcard-saved-accounts tr, #paypal-saved-accounts tr {
58
- border-bottom: 1px dotted lightgrey;
 
59
  }
60
- #creditcard-saved-accounts tr.other-row, #paypal-saved-accounts tr.other-row {
61
- border-bottom: 0;
 
62
  }
63
  #creditcard-saved-accounts label {
64
- padding: 14px 0;
65
- line-height: 48px;
66
- width: auto;
67
  }
68
- #creditcard-saved-accounts tr.other-row label, #paypal-saved-accounts tr.other-row label {
69
- padding: 18px 0;
 
70
  }
71
  #paypal-saved-accounts label {
72
- padding: 8px 0;
73
- line-height: 48px;
74
- width: auto;
75
  }
76
  #creditcard-saved-accounts label img {
77
- margin-left: 6px;
78
- float: left;
79
  }
80
- #creditcard-saved-accounts label .saved-card-info, #paypal-saved-accounts label .saved-paypal-email {
81
- margin-left: 12px;
82
- float: left;
 
83
  }
84
  #creditcard-saved-accounts label .saved-card-info span {
85
- display: block;
86
- line-height: 24px;
87
  }
88
  #creditcard-saved-accounts label .saved-card-info span.saved-expiry-date {
89
- font-size: 12px;
90
- font-weight: normal;
91
  }
92
-
93
  /* Hosted Fields */
94
  #braintree-hosted-submit {
95
- display: none;
96
  }
97
  .braintree-input-field {
98
- height: 42px;
99
- max-width: 340px;
100
- padding: 0 10px;
101
- border: 1px solid lightgrey;
102
- background: white;
103
  }
104
  .braintree-card-input-field {
105
- height: 50px;
106
- width: 100%;
107
- max-width: 372px;
108
- border: 1px solid lightgrey;
109
- position: relative;
110
- background: white;
111
  }
112
  .braintree-card-input-field .card-type {
113
- position: absolute;
114
- top: 0;
115
- left: 0;
116
- bottom: 0;
117
- padding: 0 10px 0 8px;
118
  }
119
  .braintree-card-input-field .card-type img {
120
- height: 48px;
121
  }
122
  .braintree-card-input-field #card-number {
123
- float: left;
124
- height: 48px;
125
- width: 100%;
126
- padding-left: 66px;
127
- box-sizing: border-box;
128
  }
129
  #braintree-expiration-container {
130
- display: block;
131
- width: 100%;
132
- vertical-align: middle;
133
- font-size: 0;
134
  }
135
  .braintree-expiration {
136
- width: 70px;
137
- display: inline-block;
138
- *zoom: 1;
139
- *display: inline;
140
  }
141
  .braintree-expiration-seperator {
142
- vertical-align: top;
143
- line-height: 42px;
144
- display: inline-block;
145
- *zoom: 1;
146
- *display: inline;
147
- font-size: 30px;
148
- padding: 0 8px;
149
  }
150
  .braintree-cvv {
151
- width: 80px;
152
  }
153
  .braintree-hostedfield .cvv-what-is-this {
154
- margin-left: 0;
155
- }
1
+ /* Accepted Cards */
2
+ #braintree-accepted-cards img {
3
+ float: left;
4
+ margin-right: 4px;
5
+ }
6
+ /* Hosted Fields Loading State */
7
+ #credit-card-form.loading {
8
+ position: relative;
9
+ }
10
+ #credit-card-form .braintree-hostedfield {
11
+ opacity: 1;
12
+ }
13
+ #credit-card-form .credit-card-loading {
14
+ display: none;
15
+ }
16
+ #credit-card-form.loading .credit-card-loading {
17
+ position: absolute;
18
+ top: 30%;
19
+ left: 0;
20
+ right: 0;
21
+ width: 100%;
22
+ height: 70%;
23
+ text-align: center;
24
+ display: block;
25
+ }
26
+ #credit-card-form.loading .credit-card-loading img {
27
+ margin: 16px auto;
28
+ }
29
+ #credit-card-form.loading .braintree-hostedfield {
30
+ opacity: 0;
31
+ }
32
+ /* Hosted Fields */
33
+ #braintree-hosted-submit {
34
+ display: none;
35
+ }
36
+ .braintree-input-field {
37
+ height: 42px;
38
+ max-width: 340px;
39
+ padding: 0 10px;
40
+ border: 1px solid lightgrey;
41
+ background: white;
42
+ }
43
+ .braintree-card-input-field {
44
+ height: 50px;
45
+ width: 100%;
46
+ max-width: 372px;
47
+ border: 1px solid lightgrey;
48
+ position: relative;
49
+ background: white;
50
+ }
51
+ .braintree-card-input-field .card-type {
52
+ position: absolute;
53
+ top: 0;
54
+ left: 0;
55
+ bottom: 0;
56
+ padding: 0 10px 0 8px;
57
+ }
58
+ .braintree-card-input-field .card-type img {
59
+ height: 48px;
60
+ }
61
+ .braintree-card-input-field #card-number {
62
+ float: left;
63
+ height: 48px;
64
+ width: 100%;
65
+ padding-left: 66px;
66
+ box-sizing: border-box;
67
+ }
68
+ #braintree-expiration-container {
69
+ display: block;
70
+ width: 100%;
71
+ vertical-align: middle;
72
+ font-size: 0;
73
+ }
74
+ .braintree-expiration {
75
+ width: 70px;
76
+ display: inline-block;
77
+ *zoom: 1;
78
+ *display: inline;
79
+ }
80
+ .braintree-expiration-seperator {
81
+ vertical-align: top;
82
+ line-height: 42px;
83
+ display: inline-block;
84
+ *zoom: 1;
85
+ *display: inline;
86
+ font-size: 30px;
87
+ padding: 0 8px;
88
+ }
89
+ .braintree-cvv {
90
+ width: 80px;
91
+ }
92
+ .braintree-hostedfield .cvv-what-is-this {
93
+ margin-left: 0;
94
+ }
95
+ #paypal-container iframe {
96
+ display: none;
97
+ }
98
+ /* PayPal headless button */
99
+ button.braintree-paypal-button {
100
+ background: #019cde;
101
+ color: white;
102
+ height: 46px;
103
+ line-height: 46px;
104
+ padding: 0 20px 0 18px;
105
+ border: none;
106
+ border-radius: 3px;
107
+ -webkit-border-radius: 3px;
108
+ font-size: 14px;
109
+ float: left;
110
+ cursor: pointer;
111
+ }
112
+ button.braintree-paypal-button.braintree-paypal-loading {
113
+ background: #014c6b url('../../../images/gene/braintree/paypal-loading.gif') center center no-repeat;
114
+ background-size: 32px;
115
+ }
116
+ button.braintree-paypal-button.braintree-paypal-loading > span {
117
+ opacity: 0;
118
+ }
119
+ button.braintree-paypal-button.braintree-paypal-loading:hover {
120
+ background: #014c6b url('../../../images/gene/braintree/paypal-loading.gif') center center no-repeat;
121
+ }
122
+ button.braintree-paypal-button:hover {
123
+ background: #0175a6;
124
+ }
125
+ button.braintree-paypal-button > span {
126
+ display: block;
127
+ height: 46px;
128
+ line-height: 46px;
129
+ background: url('../../../images/gene/braintree/paypal.png') right center no-repeat;
130
+ background-size: 80px;
131
+ padding-right: 94px;
132
+ }
133
+ /* Saved Accounts */
134
+ #creditcard-saved-accounts,
135
+ #paypal-saved-accounts {
136
+ font-size: 0;
137
+ width: 100%;
138
+ }
139
+ #creditcard-saved-accounts tr,
140
+ #paypal-saved-accounts tr {
141
+ border-bottom: 1px dotted lightgrey;
142
+ }
143
+ #creditcard-saved-accounts tr td,
144
+ #paypal-saved-accounts tr td {
145
+ vertical-align: middle;
146
+ }
147
+ #payment_form_gene_braintree_creditcard #creditcard-saved-accounts label,
148
+ #payment_form_gene_braintree_paypal #paypal-saved-accounts label,
149
+ #payment_form_gene_braintree_creditcard #creditcard-saved-accounts .label,
150
+ #payment_form_gene_braintree_paypal #paypal-saved-accounts .label {
151
+ width: 100%;
152
+ padding: 0;
153
+ text-align: left;
154
+ float: none;
155
+ }
156
+ #payment_form_gene_braintree_creditcard p,
157
+ #payment_form_gene_braintree_paypal p {
158
+ padding: 0;
159
+ }
160
+ #creditcard-saved-accounts tr.other-row,
161
+ #paypal-saved-accounts tr.other-row {
162
+ border-bottom: 0;
163
+ }
164
+ #creditcard-saved-accounts label {
165
+ float: left;
166
+ padding: 10px 0;
167
+ line-height: 40px;
168
+ width: 100%;
169
+ }
170
+ #creditcard-saved-accounts tr.other-row label,
171
+ #paypal-saved-accounts tr.other-row label {
172
+ padding: 8px 0;
173
+ }
174
+ #paypal-saved-accounts label {
175
+ padding: 6px 0;
176
+ line-height: 40px;
177
+ }
178
+ #creditcard-saved-accounts label img,
179
+ #paypal-saved-accounts label img {
180
+ margin-left: 6px;
181
+ height: 40px;
182
+ float: left;
183
+ }
184
+ #creditcard-saved-accounts label .saved-card-info,
185
+ #paypal-saved-accounts label .saved-paypal-email {
186
+ margin-left: 14px;
187
+ float: left;
188
+ }
189
+ #creditcard-saved-accounts label .saved-card-info span {
190
+ line-height: 40px;
191
+ }
192
+ #creditcard-saved-accounts label .saved-card-info span.saved-expiry-date {
193
+ font-size: 12px;
194
+ font-weight: normal;
195
+ margin-left: 14px;
196
+ }
197
+ #gene_braintree_creditcard_store_in_vault_div label,
198
+ label[for="gene_braintree_paypal_store_in_vault"] {
199
+ width: auto!important;
200
+ }
201
+ #braintree-accepted-cards {
202
+ float: left;
203
+ width: 100%;
204
+ }
205
+ #braintree-accepted-cards > div {
206
+ float: left;
207
+ width: 100%;
208
+ }
209
  #paypal-complete {
210
+ padding: 20px 0;
211
  }
212
  #paypal-complete label {
213
+ margin-right: 16px;
214
+ line-height: 44px;
215
  }
216
  #braintree-paypal-button {
217
+ line-height: unset;
218
+ padding: 0;
219
+ float: left;
220
+ }
221
+ #paypal-container {
222
+ float: right;
223
  }
224
  #paypal-container iframe {
225
+ display: none;
226
  }
227
  .one-step-checkout .input-text[name="payment[cc_number]"] {
228
+ height: 46px!important;
229
+ text-indent: 56px!important;
230
  }
231
  .saved-cards-intro {
232
+ float: left;
233
  }
234
  #credit-card-form {
235
+ padding-bottom: 12px;
236
+ float: left;
237
+ }
238
+ #credit-card-form .form-list,
239
+ #payment_form_gene_braintree_creditcard,
240
+ #payment_form_gene_braintree_paypal {
241
+ width: 100%;
242
+ padding: 0;
243
  }
244
+ #payment_form_gene_braintree_creditcard,
245
+ #payment_form_gene_braintree_paypal {
246
+ padding: 4px 0;
247
  }
248
+ #payment_form_gene_braintree_creditcard em,
249
+ #payment_form_gene_braintree_paypal em {
250
+ color: darkgrey;
251
  }
252
  #credit-card-form label {
253
+ display: block;
254
+ width: 100%;
255
+ float: none;
256
+ margin-top: 8px;
257
  }
258
  #credit-card-form #gene_braintree_creditcard_store_in_vault_div {
259
+ float: left;
260
+ width: 100%;
261
  }
262
+ #credit-card-form #gene_braintree_creditcard_store_in_vault_div input,
263
+ #credit-card-form #gene_braintree_creditcard_store_in_vault_div label {
264
+ display: inline;
265
  }
266
  #payment_form_gene_braintree_paypal p {
267
+ float: left;
268
+ width: 100%;
269
+ }
270
+ /* Hosted Fields Loading State */
271
+ #credit-card-form.loading {
272
+ position: relative;
273
+ }
274
+ #credit-card-form .braintree-hostedfield {
275
+ opacity: 1;
276
+ }
277
+ #credit-card-form .credit-card-loading {
278
+ display: none;
279
+ }
280
+ #credit-card-form.loading .credit-card-loading {
281
+ position: absolute;
282
+ top: 30%;
283
+ left: 0;
284
+ right: 0;
285
+ width: 100%;
286
+ height: 70%;
287
+ text-align: center;
288
+ display: block;
289
+ }
290
+ #credit-card-form.loading .credit-card-loading img {
291
+ margin: 16px auto;
292
+ }
293
+ #credit-card-form.loading .braintree-hostedfield {
294
+ opacity: 0;
295
  }
 
296
  /* Saved Accounts */
297
+ #creditcard-saved-accounts,
298
+ #paypal-saved-accounts {
299
+ font-size: 0;
300
+ width: 100%;
301
  }
302
+ #creditcard-saved-accounts tr,
303
+ #paypal-saved-accounts tr {
304
+ border-bottom: 1px dotted lightgrey;
305
  }
306
+ #creditcard-saved-accounts tr.other-row,
307
+ #paypal-saved-accounts tr.other-row {
308
+ border-bottom: 0;
309
  }
310
  #creditcard-saved-accounts label {
311
+ padding: 14px 0;
312
+ line-height: 48px;
313
+ width: auto;
314
  }
315
+ #creditcard-saved-accounts tr.other-row label,
316
+ #paypal-saved-accounts tr.other-row label {
317
+ padding: 18px 0;
318
  }
319
  #paypal-saved-accounts label {
320
+ padding: 8px 0;
321
+ line-height: 48px;
322
+ width: auto;
323
  }
324
  #creditcard-saved-accounts label img {
325
+ margin-left: 6px;
326
+ float: left;
327
  }
328
+ #creditcard-saved-accounts label .saved-card-info,
329
+ #paypal-saved-accounts label .saved-paypal-email {
330
+ margin-left: 12px;
331
+ float: left;
332
  }
333
  #creditcard-saved-accounts label .saved-card-info span {
334
+ display: block;
335
+ line-height: 24px;
336
  }
337
  #creditcard-saved-accounts label .saved-card-info span.saved-expiry-date {
338
+ font-size: 12px;
339
+ font-weight: normal;
340
  }
 
341
  /* Hosted Fields */
342
  #braintree-hosted-submit {
343
+ display: none;
344
  }
345
  .braintree-input-field {
346
+ height: 42px;
347
+ max-width: 340px;
348
+ padding: 0 10px;
349
+ border: 1px solid lightgrey;
350
+ background: white;
351
  }
352
  .braintree-card-input-field {
353
+ height: 50px;
354
+ width: 100%;
355
+ max-width: 372px;
356
+ border: 1px solid lightgrey;
357
+ position: relative;
358
+ background: white;
359
  }
360
  .braintree-card-input-field .card-type {
361
+ position: absolute;
362
+ top: 0;
363
+ left: 0;
364
+ bottom: 0;
365
+ padding: 0 10px 0 8px;
366
  }
367
  .braintree-card-input-field .card-type img {
368
+ height: 48px;
369
  }
370
  .braintree-card-input-field #card-number {
371
+ float: left;
372
+ height: 48px;
373
+ width: 100%;
374
+ padding-left: 66px;
375
+ box-sizing: border-box;
376
  }
377
  #braintree-expiration-container {
378
+ display: block;
379
+ width: 100%;
380
+ vertical-align: middle;
381
+ font-size: 0;
382
  }
383
  .braintree-expiration {
384
+ width: 70px;
385
+ display: inline-block;
386
+ *zoom: 1;
387
+ *display: inline;
388
  }
389
  .braintree-expiration-seperator {
390
+ vertical-align: top;
391
+ line-height: 42px;
392
+ display: inline-block;
393
+ *zoom: 1;
394
+ *display: inline;
395
+ font-size: 30px;
396
+ padding: 0 8px;
397
  }
398
  .braintree-cvv {
399
+ width: 80px;
400
  }
401
  .braintree-hostedfield .cvv-what-is-this {
402
+ margin-left: 0;
403
+ }
skin/frontend/base/default/css/gene/braintree/oye.css CHANGED
@@ -1,130 +1,278 @@
1
- /* @todo remove */
2
- .checkout-onepage-index .col-main {
3
- width: 100%!important;
 
4
  }
5
-
6
- #paypal-complete #paypal-label {
7
- float: right;
8
- margin-right: 8px;
9
- line-height: 44px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  }
11
  #paypal-container iframe {
12
- display: none;
13
  }
14
- #paypal-complete #paypal-container {
15
- float: right;
 
 
 
 
 
 
 
 
 
 
 
16
  }
17
- #braintree-paypal-button {
18
- padding: 0;
 
 
 
 
19
  }
20
-
21
- #payment_form_gene_braintree_paypal, #payment_form_gene_braintree_creditcard {
22
- padding-top: 6px;
23
- padding-bottom: 6px;
 
 
 
 
 
 
 
 
 
24
  }
25
-
26
  /* Saved Accounts */
27
- #creditcard-saved-accounts, #paypal-saved-accounts {
28
- font-size: 0;
29
- width: 100%;
 
30
  }
31
- #creditcard-saved-accounts tr, #paypal-saved-accounts tr {
32
- border-bottom: 1px dotted lightgrey;
 
33
  }
34
- #creditcard-saved-accounts tr.other-row, #paypal-saved-accounts tr.other-row {
35
- border-bottom: 0;
 
36
  }
37
- #creditcard-saved-accounts label {
38
- padding: 14px 0;
39
- line-height: 48px;
40
- width: auto;
 
 
 
 
41
  }
42
- #creditcard-saved-accounts tr.other-row label, #paypal-saved-accounts tr.other-row label {
43
- padding: 18px 0;
 
 
 
 
 
 
 
 
 
 
 
44
  }
45
- #creditcard-saved-accounts tr.other-row label[for="other-creditcard"], #paypal-saved-accounts tr.other-row label[for="other-paypal"] {
46
- padding: 8px 0;
 
47
  }
48
  #paypal-saved-accounts label {
49
- padding: 8px 0;
50
- line-height: 48px;
51
- width: auto;
52
  }
53
- #creditcard-saved-accounts label img {
54
- float: left;
 
 
 
55
  }
56
- #creditcard-saved-accounts label .saved-card-info, #paypal-saved-accounts label .saved-paypal-email {
57
- margin-left: 12px;
58
- float: left;
 
59
  }
60
  #creditcard-saved-accounts label .saved-card-info span {
61
- display: block;
62
- line-height: 24px;
63
  }
64
  #creditcard-saved-accounts label .saved-card-info span.saved-expiry-date {
65
- font-size: 12px;
 
 
66
  }
67
-
68
- /* Hosted Fields */
69
- #braintree-hosted-submit {
70
- display: none;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  }
72
  .braintree-input-field {
73
- height: 42px;
74
- max-width: 340px;
75
- padding: 0 10px;
76
- border: 1px solid lightgrey;
77
- background: white;
78
  }
79
  .braintree-card-input-field {
80
- height: 50px;
81
- width: 100%;
82
- max-width: 372px;
83
- border: 1px solid lightgrey;
84
- position: relative;
85
- background: white;
86
  }
87
  .braintree-card-input-field .card-type {
88
- position: absolute;
89
- top: 0;
90
- left: 0;
91
- bottom: 0;
92
- padding: 0 10px 0 8px;
93
  }
94
  .braintree-card-input-field .card-type img {
95
- height: 48px;
96
  }
97
  .braintree-card-input-field #card-number {
98
- float: left;
99
- height: 48px;
100
- width: 100%;
101
- padding-left: 66px;
102
- box-sizing: border-box;
103
  }
104
  #braintree-expiration-container {
105
- display: block;
106
- width: 100%;
107
- vertical-align: middle;
108
- font-size: 0;
109
  }
110
  .braintree-expiration {
111
- width: 70px;
112
- display: inline-block;
113
- *zoom: 1;
114
- *display: inline;
115
  }
116
  .braintree-expiration-seperator {
117
- vertical-align: top;
118
- line-height: 42px;
119
- display: inline-block;
120
- *zoom: 1;
121
- *display: inline;
122
- font-size: 30px;
123
- padding: 0 8px;
124
  }
125
  .braintree-cvv {
126
- width: 80px;
127
  }
128
  .braintree-hostedfield .cvv-what-is-this {
129
- margin-left: 0;
130
- }
1
+ /* Accepted Cards */
2
+ #braintree-accepted-cards img {
3
+ float: left;
4
+ margin-right: 4px;
5
  }
6
+ /* Hosted Fields Loading State */
7
+ #credit-card-form.loading {
8
+ position: relative;
9
+ }
10
+ #credit-card-form .braintree-hostedfield {
11
+ opacity: 1;
12
+ }
13
+ #credit-card-form .credit-card-loading {
14
+ display: none;
15
+ }
16
+ #credit-card-form.loading .credit-card-loading {
17
+ position: absolute;
18
+ top: 30%;
19
+ left: 0;
20
+ right: 0;
21
+ width: 100%;
22
+ height: 70%;
23
+ text-align: center;
24
+ display: block;
25
+ }
26
+ #credit-card-form.loading .credit-card-loading img {
27
+ margin: 16px auto;
28
+ }
29
+ #credit-card-form.loading .braintree-hostedfield {
30
+ opacity: 0;
31
+ }
32
+ /* Hosted Fields */
33
+ #braintree-hosted-submit {
34
+ display: none;
35
+ }
36
+ .braintree-input-field {
37
+ height: 42px;
38
+ max-width: 340px;
39
+ padding: 0 10px;
40
+ border: 1px solid lightgrey;
41
+ background: white;
42
+ }
43
+ .braintree-card-input-field {
44
+ height: 50px;
45
+ width: 100%;
46
+ max-width: 372px;
47
+ border: 1px solid lightgrey;
48
+ position: relative;
49
+ background: white;
50
+ }
51
+ .braintree-card-input-field .card-type {
52
+ position: absolute;
53
+ top: 0;
54
+ left: 0;
55
+ bottom: 0;
56
+ padding: 0 10px 0 8px;
57
+ }
58
+ .braintree-card-input-field .card-type img {
59
+ height: 48px;
60
+ }
61
+ .braintree-card-input-field #card-number {
62
+ float: left;
63
+ height: 48px;
64
+ width: 100%;
65
+ padding-left: 66px;
66
+ box-sizing: border-box;
67
+ }
68
+ #braintree-expiration-container {
69
+ display: block;
70
+ width: 100%;
71
+ vertical-align: middle;
72
+ font-size: 0;
73
+ }
74
+ .braintree-expiration {
75
+ width: 70px;
76
+ display: inline-block;
77
+ *zoom: 1;
78
+ *display: inline;
79
+ }
80
+ .braintree-expiration-seperator {
81
+ vertical-align: top;
82
+ line-height: 42px;
83
+ display: inline-block;
84
+ *zoom: 1;
85
+ *display: inline;
86
+ font-size: 30px;
87
+ padding: 0 8px;
88
+ }
89
+ .braintree-cvv {
90
+ width: 80px;
91
+ }
92
+ .braintree-hostedfield .cvv-what-is-this {
93
+ margin-left: 0;
94
  }
95
  #paypal-container iframe {
96
+ display: none;
97
  }
98
+ /* PayPal headless button */
99
+ button.braintree-paypal-button {
100
+ background: #019cde;
101
+ color: white;
102
+ height: 46px;
103
+ line-height: 46px;
104
+ padding: 0 20px 0 18px;
105
+ border: none;
106
+ border-radius: 3px;
107
+ -webkit-border-radius: 3px;
108
+ font-size: 14px;
109
+ float: left;
110
+ cursor: pointer;
111
  }
112
+ button.braintree-paypal-button.braintree-paypal-loading {
113
+ background: #014c6b url('../../../images/gene/braintree/paypal-loading.gif') center center no-repeat;
114
+ background-size: 32px;
115
+ }
116
+ button.braintree-paypal-button.braintree-paypal-loading > span {
117
+ opacity: 0;
118
  }
119
+ button.braintree-paypal-button.braintree-paypal-loading:hover {
120
+ background: #014c6b url('../../../images/gene/braintree/paypal-loading.gif') center center no-repeat;
121
+ }
122
+ button.braintree-paypal-button:hover {
123
+ background: #0175a6;
124
+ }
125
+ button.braintree-paypal-button > span {
126
+ display: block;
127
+ height: 46px;
128
+ line-height: 46px;
129
+ background: url('../../../images/gene/braintree/paypal.png') right center no-repeat;
130
+ background-size: 80px;
131
+ padding-right: 94px;
132
  }
 
133
  /* Saved Accounts */
134
+ #creditcard-saved-accounts,
135
+ #paypal-saved-accounts {
136
+ font-size: 0;
137
+ width: 100%;
138
  }
139
+ #creditcard-saved-accounts tr,
140
+ #paypal-saved-accounts tr {
141
+ border-bottom: 1px dotted lightgrey;
142
  }
143
+ #creditcard-saved-accounts tr td,
144
+ #paypal-saved-accounts tr td {
145
+ vertical-align: middle;
146
  }
147
+ #payment_form_gene_braintree_creditcard #creditcard-saved-accounts label,
148
+ #payment_form_gene_braintree_paypal #paypal-saved-accounts label,
149
+ #payment_form_gene_braintree_creditcard #creditcard-saved-accounts .label,
150
+ #payment_form_gene_braintree_paypal #paypal-saved-accounts .label {
151
+ width: 100%;
152
+ padding: 0;
153
+ text-align: left;
154
+ float: none;
155
  }
156
+ #payment_form_gene_braintree_creditcard p,
157
+ #payment_form_gene_braintree_paypal p {
158
+ padding: 0;
159
+ }
160
+ #creditcard-saved-accounts tr.other-row,
161
+ #paypal-saved-accounts tr.other-row {
162
+ border-bottom: 0;
163
+ }
164
+ #creditcard-saved-accounts label {
165
+ float: left;
166
+ padding: 10px 0;
167
+ line-height: 40px;
168
+ width: 100%;
169
  }
170
+ #creditcard-saved-accounts tr.other-row label,
171
+ #paypal-saved-accounts tr.other-row label {
172
+ padding: 8px 0;
173
  }
174
  #paypal-saved-accounts label {
175
+ padding: 6px 0;
176
+ line-height: 40px;
 
177
  }
178
+ #creditcard-saved-accounts label img,
179
+ #paypal-saved-accounts label img {
180
+ margin-left: 6px;
181
+ height: 40px;
182
+ float: left;
183
  }
184
+ #creditcard-saved-accounts label .saved-card-info,
185
+ #paypal-saved-accounts label .saved-paypal-email {
186
+ margin-left: 14px;
187
+ float: left;
188
  }
189
  #creditcard-saved-accounts label .saved-card-info span {
190
+ line-height: 40px;
 
191
  }
192
  #creditcard-saved-accounts label .saved-card-info span.saved-expiry-date {
193
+ font-size: 12px;
194
+ font-weight: normal;
195
+ margin-left: 14px;
196
  }
197
+ #gene_braintree_creditcard_store_in_vault_div label,
198
+ label[for="gene_braintree_paypal_store_in_vault"] {
199
+ width: auto!important;
200
+ }
201
+ #paypal-complete #paypal-label {
202
+ float: right;
203
+ margin-right: 8px;
204
+ line-height: 44px;
205
+ }
206
+ #paypal-container iframe {
207
+ display: none;
208
+ }
209
+ #paypal-complete #paypal-container {
210
+ float: right;
211
+ }
212
+ #braintree-paypal-button {
213
+ padding: 0;
214
+ }
215
+ #payment_form_gene_braintree_paypal,
216
+ #payment_form_gene_braintree_creditcard {
217
+ padding-top: 6px;
218
+ padding-bottom: 6px;
219
  }
220
  .braintree-input-field {
221
+ height: 42px;
222
+ max-width: 340px;
223
+ padding: 0 10px;
224
+ border: 1px solid lightgrey;
225
+ background: white;
226
  }
227
  .braintree-card-input-field {
228
+ height: 50px;
229
+ width: 100%;
230
+ max-width: 372px;
231
+ border: 1px solid lightgrey;
232
+ position: relative;
233
+ background: white;
234
  }
235
  .braintree-card-input-field .card-type {
236
+ position: absolute;
237
+ top: 0;
238
+ left: 0;
239
+ bottom: 0;
240
+ padding: 0 10px 0 8px;
241
  }
242
  .braintree-card-input-field .card-type img {
243
+ height: 48px;
244
  }
245
  .braintree-card-input-field #card-number {
246
+ float: left;
247
+ height: 48px;
248
+ width: 100%;
249
+ padding-left: 66px;
250
+ box-sizing: border-box;
251
  }
252
  #braintree-expiration-container {
253
+ display: block;
254
+ width: 100%;
255
+ vertical-align: middle;
256
+ font-size: 0;
257
  }
258
  .braintree-expiration {
259
+ width: 70px;
260
+ display: inline-block;
261
+ *zoom: 1;
262
+ *display: inline;
263
  }
264
  .braintree-expiration-seperator {
265
+ vertical-align: top;
266
+ line-height: 42px;
267
+ display: inline-block;
268
+ *zoom: 1;
269
+ *display: inline;
270
+ font-size: 30px;
271
+ padding: 0 8px;
272
  }
273
  .braintree-cvv {
274
+ width: 80px;
275
  }
276
  .braintree-hostedfield .cvv-what-is-this {
277
+ margin-left: 0;
278
+ }
skin/frontend/base/default/css/gene/braintree/unicode.css CHANGED
@@ -1,136 +1,238 @@
1
- #payment_form_gene_braintree_paypal, #payment_form_gene_braintree_creditcard {
2
- margin-left: 0!important;
3
- padding: 8px 0;
 
4
  }
5
- #payment_form_gene_braintree_paypal label, #payment_form_gene_braintree_creditcard label {
6
- width: 100%;
7
- text-align: left;
8
- float: none;
9
  }
10
- #payment_form_gene_braintree_paypal p {
11
- padding: 0!important;
12
  }
13
- #paypal-complete {
14
- padding: 20px 0;
15
- text-align: center;
16
  }
17
- #paypal-complete label {
18
- line-height: 32px;
 
 
 
 
 
 
 
19
  }
20
- #braintree-paypal-button {
21
- line-height: unset;
22
- padding: 0;
23
- margin: 0 auto;
24
  }
25
- #paypal-container iframe {
26
- display: none;
27
- }
28
-
29
- /* Saved Accounts */
30
- #creditcard-saved-accounts, #paypal-saved-accounts {
31
- font-size: 0;
32
- width: 100%;
33
- }
34
- #creditcard-saved-accounts tr, #paypal-saved-accounts tr {
35
- border-bottom: 1px dotted lightgrey;
36
- }
37
- #creditcard-saved-accounts tr td, #paypal-saved-accounts tr td {
38
- vertical-align: middle!important;
39
- }
40
- #creditcard-saved-accounts tr.other-row, #paypal-saved-accounts tr.other-row {
41
- border-bottom: 0;
42
- }
43
- #creditcard-saved-accounts label, #paypal-saved-accounts label {
44
- float: left;
45
- }
46
- #creditcard-saved-accounts label {
47
- padding: 14px 0;
48
- line-height: 48px;
49
- width: auto;
50
  }
51
- #creditcard-saved-accounts tr.other-row label, #paypal-saved-accounts tr.other-row label {
52
- padding: 10px 0;
53
- }
54
- #paypal-saved-accounts label {
55
- padding: 8px 0;
56
- line-height: 48px;
57
- width: auto;
58
- }
59
- #creditcard-saved-accounts label img {
60
- float: left;
61
- }
62
- #creditcard-saved-accounts label .saved-card-info, #paypal-saved-accounts label .saved-paypal-email {
63
- margin-left: 12px;
64
- float: left;
65
- }
66
- #creditcard-saved-accounts label .saved-card-info span {
67
- display: block;
68
- line-height: 24px;
69
- }
70
- #creditcard-saved-accounts label .saved-card-info span.saved-expiry-date {
71
- font-size: 12px;
72
- }
73
-
74
  /* Hosted Fields */
75
  #braintree-hosted-submit {
76
- display: none;
77
  }
78
  .braintree-input-field {
79
- height: 42px;
80
- max-width: 340px;
81
- padding: 0 10px;
82
- border: 1px solid lightgrey;
83
- background: white;
84
  }
85
  .braintree-card-input-field {
86
- height: 50px;
87
- width: 100%;
88
- max-width: 372px;
89
- border: 1px solid lightgrey;
90
- position: relative;
91
- background: white;
92
  }
93
  .braintree-card-input-field .card-type {
94
- position: absolute;
95
- top: 0;
96
- left: 0;
97
- bottom: 0;
98
- padding: 0 10px 0 8px;
99
  }
100
  .braintree-card-input-field .card-type img {
101
- height: 48px;
102
  }
103
  .braintree-card-input-field #card-number {
104
- float: left;
105
- height: 48px;
106
- width: 100%;
107
- padding-left: 66px;
108
- box-sizing: border-box;
109
  }
110
  #braintree-expiration-container {
111
- display: block;
112
- width: 100%;
113
- vertical-align: middle;
114
- font-size: 0;
115
  }
116
  .braintree-expiration {
117
- width: 70px;
118
- display: inline-block;
119
- *zoom: 1;
120
- *display: inline;
121
  }
122
  .braintree-expiration-seperator {
123
- vertical-align: top;
124
- line-height: 42px;
125
- display: inline-block;
126
- *zoom: 1;
127
- *display: inline;
128
- font-size: 30px;
129
- padding: 0 8px;
130
  }
131
  .braintree-cvv {
132
- width: 80px;
133
  }
134
  .braintree-hostedfield .cvv-what-is-this {
135
- margin-left: 0;
136
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Accepted Cards */
2
+ #braintree-accepted-cards img {
3
+ float: left;
4
+ margin-right: 4px;
5
  }
6
+ /* Hosted Fields Loading State */
7
+ #credit-card-form.loading {
8
+ position: relative;
 
9
  }
10
+ #credit-card-form .braintree-hostedfield {
11
+ opacity: 1;
12
  }
13
+ #credit-card-form .credit-card-loading {
14
+ display: none;
 
15
  }
16
+ #credit-card-form.loading .credit-card-loading {
17
+ position: absolute;
18
+ top: 30%;
19
+ left: 0;
20
+ right: 0;
21
+ width: 100%;
22
+ height: 70%;
23
+ text-align: center;
24
+ display: block;
25
  }
26
+ #credit-card-form.loading .credit-card-loading img {
27
+ margin: 16px auto;
 
 
28
  }
29
+ #credit-card-form.loading .braintree-hostedfield {
30
+ opacity: 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  /* Hosted Fields */
33
  #braintree-hosted-submit {
34
+ display: none;
35
  }
36
  .braintree-input-field {
37
+ height: 42px;
38
+ max-width: 340px;
39
+ padding: 0 10px;
40
+ border: 1px solid lightgrey;
41
+ background: white;
42
  }
43
  .braintree-card-input-field {
44
+ height: 50px;
45
+ width: 100%;
46
+ max-width: 372px;
47
+ border: 1px solid lightgrey;
48
+ position: relative;
49
+ background: white;
50
  }
51
  .braintree-card-input-field .card-type {
52
+ position: absolute;
53
+ top: 0;
54
+ left: 0;
55
+ bottom: 0;
56
+ padding: 0 10px 0 8px;
57
  }
58
  .braintree-card-input-field .card-type img {
59
+ height: 48px;
60
  }
61
  .braintree-card-input-field #card-number {
62
+ float: left;
63
+ height: 48px;
64
+ width: 100%;
65
+ padding-left: 66px;
66
+ box-sizing: border-box;
67
  }
68
  #braintree-expiration-container {
69
+ display: block;
70
+ width: 100%;
71
+ vertical-align: middle;
72
+ font-size: 0;
73
  }
74
  .braintree-expiration {
75
+ width: 70px;
76
+ display: inline-block;
77
+ *zoom: 1;
78
+ *display: inline;
79
  }
80
  .braintree-expiration-seperator {
81
+ vertical-align: top;
82
+ line-height: 42px;
83
+ display: inline-block;
84
+ *zoom: 1;
85
+ *display: inline;
86
+ font-size: 30px;
87
+ padding: 0 8px;
88
  }
89
  .braintree-cvv {
90
+ width: 80px;
91
  }
92
  .braintree-hostedfield .cvv-what-is-this {
93
+ margin-left: 0;
94
+ }
95
+ #paypal-container iframe {
96
+ display: none;
97
+ }
98
+ /* PayPal headless button */
99
+ button.braintree-paypal-button {
100
+ background: #019cde;
101
+ color: white;
102
+ height: 46px;
103
+ line-height: 46px;
104
+ padding: 0 20px 0 18px;
105
+ border: none;
106
+ border-radius: 3px;
107
+ -webkit-border-radius: 3px;
108
+ font-size: 14px;
109
+ float: left;
110
+ cursor: pointer;
111
+ }
112
+ button.braintree-paypal-button.braintree-paypal-loading {
113
+ background: #014c6b url('../../../images/gene/braintree/paypal-loading.gif') center center no-repeat;
114
+ background-size: 32px;
115
+ }
116
+ button.braintree-paypal-button.braintree-paypal-loading > span {
117
+ opacity: 0;
118
+ }
119
+ button.braintree-paypal-button.braintree-paypal-loading:hover {
120
+ background: #014c6b url('../../../images/gene/braintree/paypal-loading.gif') center center no-repeat;
121
+ }
122
+ button.braintree-paypal-button:hover {
123
+ background: #0175a6;
124
+ }
125
+ button.braintree-paypal-button > span {
126
+ display: block;
127
+ height: 46px;
128
+ line-height: 46px;
129
+ background: url('../../../images/gene/braintree/paypal.png') right center no-repeat;
130
+ background-size: 80px;
131
+ padding-right: 94px;
132
+ }
133
+ /* Saved Accounts */
134
+ #creditcard-saved-accounts,
135
+ #paypal-saved-accounts {
136
+ font-size: 0;
137
+ width: 100%;
138
+ }
139
+ #creditcard-saved-accounts tr,
140
+ #paypal-saved-accounts tr {
141
+ border-bottom: 1px dotted lightgrey;
142
+ }
143
+ #creditcard-saved-accounts tr td,
144
+ #paypal-saved-accounts tr td {
145
+ vertical-align: middle;
146
+ }
147
+ #payment_form_gene_braintree_creditcard #creditcard-saved-accounts label,
148
+ #payment_form_gene_braintree_paypal #paypal-saved-accounts label,
149
+ #payment_form_gene_braintree_creditcard #creditcard-saved-accounts .label,
150
+ #payment_form_gene_braintree_paypal #paypal-saved-accounts .label {
151
+ width: 100%;
152
+ padding: 0;
153
+ text-align: left;
154
+ float: none;
155
+ }
156
+ #payment_form_gene_braintree_creditcard p,
157
+ #payment_form_gene_braintree_paypal p {
158
+ padding: 0;
159
+ }
160
+ #creditcard-saved-accounts tr.other-row,
161
+ #paypal-saved-accounts tr.other-row {
162
+ border-bottom: 0;
163
+ }
164
+ #creditcard-saved-accounts label {
165
+ float: left;
166
+ padding: 10px 0;
167
+ line-height: 40px;
168
+ width: 100%;
169
+ }
170
+ #creditcard-saved-accounts tr.other-row label,
171
+ #paypal-saved-accounts tr.other-row label {
172
+ padding: 8px 0;
173
+ }
174
+ #paypal-saved-accounts label {
175
+ padding: 6px 0;
176
+ line-height: 40px;
177
+ }
178
+ #creditcard-saved-accounts label img,
179
+ #paypal-saved-accounts label img {
180
+ margin-left: 6px;
181
+ height: 40px;
182
+ float: left;
183
+ }
184
+ #creditcard-saved-accounts label .saved-card-info,
185
+ #paypal-saved-accounts label .saved-paypal-email {
186
+ margin-left: 14px;
187
+ float: left;
188
+ }
189
+ #creditcard-saved-accounts label .saved-card-info span {
190
+ line-height: 40px;
191
+ }
192
+ #creditcard-saved-accounts label .saved-card-info span.saved-expiry-date {
193
+ font-size: 12px;
194
+ font-weight: normal;
195
+ margin-left: 14px;
196
+ }
197
+ #gene_braintree_creditcard_store_in_vault_div label,
198
+ label[for="gene_braintree_paypal_store_in_vault"] {
199
+ width: auto!important;
200
+ }
201
+ /* Centrally aligned PayPal button */
202
+ button.braintree-paypal-button {
203
+ margin: 10px auto;
204
+ float: none;
205
+ }
206
+ #creditcard-saved-accounts tr td,
207
+ #paypal-saved-accounts tr td {
208
+ vertical-align: middle!important;
209
+ }
210
+ #payment_form_gene_braintree_paypal,
211
+ #payment_form_gene_braintree_creditcard {
212
+ margin-left: 0!important;
213
+ padding: 8px 0;
214
+ }
215
+ #payment_form_gene_braintree_paypal label,
216
+ #payment_form_gene_braintree_creditcard label {
217
+ width: 100%;
218
+ text-align: left;
219
+ float: none;
220
+ }
221
+ #payment_form_gene_braintree_paypal p {
222
+ padding: 0!important;
223
+ }
224
+ #paypal-complete {
225
+ padding: 20px 0;
226
+ text-align: center;
227
+ }
228
+ #paypal-complete label {
229
+ line-height: 32px;
230
+ }
231
+ #braintree-paypal-button {
232
+ line-height: unset;
233
+ padding: 0;
234
+ margin: 0 auto;
235
+ }
236
+ #paypal-container iframe {
237
+ display: none;
238
+ }
skin/frontend/base/default/images/gene/braintree/paypal-loading.gif ADDED
Binary file
skin/frontend/base/default/images/gene/braintree/paypal.png ADDED
Binary file
skin/frontend/base/default/images/gene/loader-white.gif ADDED
Binary file
skin/frontend/base/default/images/gene/loader.gif ADDED
Binary file