├── .gitignore ├── README.md ├── app ├── code │ └── community │ │ └── Gene │ │ └── Braintree │ │ ├── Block │ │ ├── Adminhtml │ │ │ ├── Report │ │ │ │ ├── Transactions.php │ │ │ │ └── Transactions │ │ │ │ │ ├── Grid.php │ │ │ │ │ └── Search.php │ │ │ └── System │ │ │ │ └── Config │ │ │ │ ├── Braintree │ │ │ │ ├── Config.php │ │ │ │ ├── Currency.php │ │ │ │ ├── Kount │ │ │ │ │ └── Ens.php │ │ │ │ ├── Migration.php │ │ │ │ ├── Moduleversion.php │ │ │ │ └── Version.php │ │ │ │ └── Migration.php │ │ ├── Applepay.php │ │ ├── Applepay │ │ │ ├── Express │ │ │ │ ├── Abstract.php │ │ │ │ ├── Button.php │ │ │ │ └── Setup.php │ │ │ ├── Info.php │ │ │ └── Setup.php │ │ ├── Assets.php │ │ ├── Braintree.php │ │ ├── Cart │ │ │ └── Totals.php │ │ ├── Creditcard.php │ │ ├── Creditcard │ │ │ ├── Info.php │ │ │ ├── Saved.php │ │ │ └── Threedsecure.php │ │ ├── Express │ │ │ ├── Abstract.php │ │ │ ├── Button.php │ │ │ ├── Checkout.php │ │ │ └── Setup.php │ │ ├── Googlepay.php │ │ ├── Googlepay │ │ │ ├── Info.php │ │ │ └── Setup.php │ │ ├── Info.php │ │ ├── Js.php │ │ ├── Paypal.php │ │ ├── Paypal │ │ │ ├── Info.php │ │ │ └── Saved.php │ │ ├── Saved.php │ │ └── Saved │ │ │ └── Edit.php │ │ ├── Helper │ │ └── Data.php │ │ ├── Model │ │ ├── Applepay │ │ │ └── Express.php │ │ ├── Debug.php │ │ ├── Entity │ │ │ └── Setup.php │ │ ├── Express │ │ │ └── Assets.php │ │ ├── Kount │ │ │ ├── Ens.php │ │ │ └── Rest.php │ │ ├── Migration.php │ │ ├── Observer.php │ │ ├── Paymentmethod │ │ │ ├── Abstract.php │ │ │ ├── Applepay.php │ │ │ ├── Creditcard.php │ │ │ ├── Googlepay.php │ │ │ ├── Legacy │ │ │ │ ├── Creditcard.php │ │ │ │ └── Paypal.php │ │ │ └── Paypal.php │ │ ├── Saved.php │ │ ├── Source │ │ │ ├── ButtonStyle │ │ │ │ ├── Color.php │ │ │ │ ├── Layout.php │ │ │ │ ├── Shape.php │ │ │ │ └── Size.php │ │ │ ├── Cctype.php │ │ │ ├── Creditcard │ │ │ │ ├── CaptureAction.php │ │ │ │ ├── FormIntegration.php │ │ │ │ └── PaymentAction.php │ │ │ ├── Environment.php │ │ │ ├── Googlepay │ │ │ │ └── AcceptedCards.php │ │ │ └── Paypal │ │ │ │ ├── CaptureAction.php │ │ │ │ ├── Funding.php │ │ │ │ ├── Locale.php │ │ │ │ ├── PaymentAction.php │ │ │ │ └── Paymenttype.php │ │ ├── System │ │ │ └── Config │ │ │ │ ├── Backend │ │ │ │ └── Currency.php │ │ │ │ └── Source │ │ │ │ └── Payment │ │ │ │ ├── Liabilityaction.php │ │ │ │ └── Threedsecurecountries.php │ │ └── Wrapper │ │ │ └── Braintree.php │ │ ├── Traits │ │ └── PaymentMethods.php │ │ ├── controllers │ │ ├── Adminhtml │ │ │ ├── Braintree │ │ │ │ └── MigrationController.php │ │ │ ├── BraintreeController.php │ │ │ └── CheckoutController.php │ │ ├── ApplepayController.php │ │ ├── CheckoutController.php │ │ ├── ExpressController.php │ │ ├── GooglepayController.php │ │ ├── Kount │ │ │ └── EnsController.php │ │ └── SavedController.php │ │ ├── etc │ │ ├── adminhtml.xml │ │ ├── config.xml │ │ ├── jstranslator.xml │ │ └── system.xml │ │ └── sql │ │ └── gene_braintree_setup │ │ ├── install-0.1.0.php │ │ ├── upgrade-1.0.5.4-2.0.0.php │ │ ├── upgrade-2.0.0-2.0.1.php │ │ └── upgrade-2.0.4-2.1.0.php ├── design │ ├── adminhtml │ │ └── default │ │ │ └── default │ │ │ ├── layout │ │ │ └── gene │ │ │ │ └── braintree.xml │ │ │ └── template │ │ │ └── gene │ │ │ └── braintree │ │ │ ├── applepay │ │ │ └── info.phtml │ │ │ ├── assets.phtml │ │ │ ├── creditcard │ │ │ ├── hostedfields.phtml │ │ │ ├── info.phtml │ │ │ └── saved.phtml │ │ │ ├── googlepay │ │ │ └── info.phtml │ │ │ ├── js.phtml │ │ │ ├── paypal.phtml │ │ │ ├── paypal │ │ │ ├── info.phtml │ │ │ └── saved.phtml │ │ │ ├── system │ │ │ └── config │ │ │ │ └── migration.phtml │ │ │ └── transactions │ │ │ ├── index.phtml │ │ │ └── search.phtml │ └── frontend │ │ └── base │ │ └── default │ │ ├── layout │ │ └── gene │ │ │ └── braintree.xml │ │ └── template │ │ └── gene │ │ └── braintree │ │ ├── applepay.phtml │ │ ├── applepay │ │ ├── express │ │ │ ├── cart │ │ │ │ ├── button.phtml │ │ │ │ └── setup.phtml │ │ │ └── catalog │ │ │ │ ├── button.phtml │ │ │ │ └── setup.phtml │ │ └── info.phtml │ │ ├── assets.phtml │ │ ├── creditcard │ │ ├── hostedfields.phtml │ │ ├── info.phtml │ │ ├── saved.phtml │ │ └── threedsecure.phtml │ │ ├── customer │ │ ├── edit.phtml │ │ ├── methods.phtml │ │ └── saved.phtml │ │ ├── express │ │ ├── button.phtml │ │ ├── cart.phtml │ │ ├── catalog.phtml │ │ ├── error.phtml │ │ └── shipping_details.phtml │ │ ├── googlepay.phtml │ │ ├── googlepay │ │ └── info.phtml │ │ ├── js │ │ ├── aheadworks.phtml │ │ ├── amasty.phtml │ │ ├── applepaysetup.phtml │ │ ├── awesomecheckout.phtml │ │ ├── default.phtml │ │ ├── fancycheckout.phtml │ │ ├── firecheckout.phtml │ │ ├── fme.phtml │ │ ├── googlepaysetup.phtml │ │ ├── idev.phtml │ │ ├── iwd.phtml │ │ ├── magestore.phtml │ │ ├── multishipping.phtml │ │ ├── oye.phtml │ │ ├── setup.phtml │ │ └── unicode.phtml │ │ ├── paypal.phtml │ │ └── paypal │ │ ├── info.phtml │ │ └── saved.phtml ├── etc │ └── modules │ │ └── Gene_Braintree.xml └── locale │ └── en_US │ └── Gene_Braintree.csv ├── composer.json ├── composer.lock ├── js └── gene │ └── braintree │ ├── config.codekit │ ├── minified │ ├── express │ │ ├── abstract.min.js │ │ ├── applepay.min.js │ │ └── paypal.min.js │ ├── vzero-applepay.min.js │ ├── vzero-googlepay.min.js │ ├── vzero-integration.min.js │ ├── vzero-paypal.min.js │ └── vzero.min.js │ └── source │ ├── express │ ├── abstract.js │ ├── applepay.js │ └── paypal.js │ ├── vzero-applepay.js │ ├── vzero-googlepay.js │ ├── vzero-integration.js │ ├── vzero-paypal.js │ └── vzero.js ├── modman └── skin ├── adminhtml └── base │ └── default │ ├── css │ └── gene │ │ └── braintree │ │ ├── adminhtml.css │ │ ├── adminhtml.less │ │ ├── config.codekit │ │ ├── migration.css │ │ └── migration.less │ └── images │ └── gene │ ├── braintree │ ├── AE.png │ ├── DI.png │ ├── JCB.png │ ├── MC.png │ ├── ME.png │ ├── PP.png │ ├── VI.png │ ├── apple-pay-logo.png │ ├── braintree-logo-black.png │ ├── card.png │ ├── google-pay-logo.png │ ├── paypal-loading.gif │ └── paypal.png │ ├── loader-transparent.gif │ ├── loader-white.gif │ └── loader.gif └── frontend └── base └── default ├── css └── gene │ └── braintree │ ├── minified │ ├── account.min.css │ ├── aheadworks.min.css │ ├── amasty.min.css │ ├── applepay.min.css │ ├── awesomecheckout.min.css │ ├── default.min.css │ ├── express.min.css │ ├── fancycheckout.min.css │ ├── firecheckout.min.css │ ├── fme.min.css │ ├── googlepay.min.css │ ├── idev.min.css │ ├── iwd.min.css │ ├── magestore.min.css │ ├── oye.min.css │ └── unicode.min.css │ └── source │ ├── account.css │ ├── aheadworks.css │ ├── amasty.css │ ├── applepay.css │ ├── awesomecheckout.css │ ├── default.css │ ├── express.css │ ├── fancycheckout.css │ ├── firecheckout.css │ ├── fme.css │ ├── idev.css │ ├── iwd.css │ ├── magestore.css │ ├── oye.css │ └── unicode.css └── images └── gene ├── braintree ├── AE.png ├── DI.png ├── JCB.png ├── MC.png ├── ME.png ├── PP.png ├── VI.png ├── apple-pay-logo.png ├── braintree-logo-black.png ├── card.png ├── google-pay-logo.png ├── paypal-loading.gif └── paypal.png ├── loader-transparent.gif ├── loader-white.gif └── loader.gif /.gitignore: -------------------------------------------------------------------------------- 1 | vendor 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # module-gene-braintree 2 | OpenMage compatible fork of Gene_Braintree module 3 | 4 | This module was originally available through the Magento Marketplace under the name "Braintree Payments With Hosted Fields". 5 | 6 | This module has been updated to use the 6.x.x version of the [Braintree PHP library](https://github.com/braintree/braintree_php). Originally, the Gene module used the 3.x.x version of the Braintree library which will be deprecated in March 2022 and unsupported in March 2023. Since the OpenMage project aims to continue supporting Magento 1.9 for many years, merchants may need an updated version of this module. 7 | 8 | It is important to note that this fork removed the inlined copy of the Braintree library, and instead uses Composer to manage the dependency of the Braintree library. Therefore, you must install this module via Composer. For example: 9 | 10 | ``` 11 | { 12 | "minimum-stability": "dev", 13 | "prefer-stable": true, 14 | "repositories": [ 15 | { "type": "vcs", "no-api": true, "url": "git@github.com:justinbeaty/module-gene-braintree.git" }, 16 | ], 17 | "require": { 18 | "aydin-hassan/magento-core-composer-installer": "*", 19 | "openmage/magento-lts": "*", 20 | "gene/braintree": "dev-master", 21 | } 22 | } 23 | ``` 24 | 25 | This module has been tested with at least one production OpenMage 20.x website, but you should make sure to test it on a local or staging website pushing it live. 26 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Block/Adminhtml/Report/Transactions.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Block_Adminhtml_Report_Transactions extends Mage_Adminhtml_Block_Widget_Grid_Container 9 | { 10 | public function __construct() 11 | { 12 | $this->_blockGroup = 'gene_braintree'; 13 | $this->_controller = 'adminhtml_report_transactions'; 14 | $this->_headerText = Mage::helper('gene_braintree')->__('Braintree Transactions'); 15 | 16 | parent::__construct(); 17 | 18 | $this->_removeButton('add'); 19 | } 20 | } -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Block/Adminhtml/Report/Transactions/Search.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Block_Adminhtml_Report_Transactions_Search extends Mage_Core_Block_Template 9 | { 10 | /** 11 | * Return the from date 12 | * 13 | * @return string 14 | */ 15 | public function getFromDate() 16 | { 17 | if($fromDate = Mage::app()->getRequest()->getParam('from_date')) { 18 | return $fromDate; 19 | } 20 | 21 | return $this->formateDateBraintree(strtotime('-24 hour')); 22 | } 23 | 24 | /** 25 | * Return the to date 26 | * 27 | * @return string 28 | */ 29 | public function getToDate() 30 | { 31 | if($toDate = Mage::app()->getRequest()->getParam('to_date')) { 32 | return $toDate; 33 | } 34 | 35 | return $this->formateDateBraintree(time()); 36 | } 37 | 38 | /** 39 | * Return all of the possible statuses 40 | * 41 | * @return array 42 | */ 43 | public function getStatusesAsArray() 44 | { 45 | // Add in a show all option 46 | $all[''] = 'Show All'; 47 | 48 | // Grab all the statuses 49 | $statuses = Mage::helper('gene_braintree')->getStatusesAsArray(); 50 | 51 | // Combine them 52 | return array_merge($all, $statuses); 53 | } 54 | 55 | /** 56 | * Return the types as an array 57 | * 58 | * @return array 59 | */ 60 | public function getTypesAsArray() 61 | { 62 | return array( 63 | '' => 'All', 64 | 'sale' => 'Sale', 65 | 'credit' => 'Credit' 66 | ); 67 | } 68 | 69 | /** 70 | * Return the selected status 71 | * 72 | * @return mixed 73 | */ 74 | public function getSelectedType() 75 | { 76 | return Mage::app()->getRequest()->getParam('type'); 77 | } 78 | 79 | /** 80 | * Return the selected status 81 | * 82 | * @return mixed 83 | */ 84 | public function getSelectedStatus() 85 | { 86 | return Mage::app()->getRequest()->getParam('status'); 87 | } 88 | 89 | /** 90 | * Return the selected status 91 | * 92 | * @return mixed 93 | */ 94 | public function getOrderId() 95 | { 96 | return Mage::app()->getRequest()->getParam('order_id'); 97 | } 98 | 99 | /** 100 | * Format the date for display on the Braintree search form 101 | * 102 | * @param $date 103 | * 104 | * @return string 105 | */ 106 | public function formateDateBraintree($date) 107 | { 108 | return date('d-m-Y G:i', $date); 109 | } 110 | } -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Braintree/Config.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Config 9 | extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface 10 | { 11 | /** 12 | * Render element html 13 | * 14 | * @param Varien_Data_Form_Element_Abstract $element 15 | * @return string 16 | */ 17 | public function render(Varien_Data_Form_Element_Abstract $element) 18 | { 19 | return sprintf(' 20 | 21 | %s 22 | 23 | 24 | %s 25 | 26 | ', 27 | $element->getHtmlId(), $element->getHtmlId(), $element->getLabel(), $this->getValidConfigHtml() 28 | ); 29 | } 30 | 31 | /** 32 | * Inform the user there version will not work 33 | * @return string 34 | */ 35 | protected function getValidConfigHtml() 36 | { 37 | $response = Mage::getModel('gene_braintree/wrapper_braintree')->validateCredentials(true); 38 | $response.= ' 39 | '; 85 | return $response; 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Braintree/Currency.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Currency 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 16 | */ 17 | protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) 18 | { 19 | return $this->getCurrencyTableHtml($element); 20 | } 21 | 22 | /** 23 | * Inform the user there version will not work 24 | * @return string 25 | */ 26 | protected 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(); 51 | 52 | // Build our response 53 | $response = ' 54 | 55 | 56 | 57 | 58 | '; 59 | 60 | // Loop through each currency and add a value 61 | foreach($currencies as $currency) { 62 | $response .= ' 63 | 64 | 65 | '; 66 | } 67 | 68 | $response .= '
' . $this->__('Currency Code') . '' . $this->__('Merchant Account ID') . '
' . $currency . '
'; 69 | 70 | return $response; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Braintree/Kount/Ens.php: -------------------------------------------------------------------------------- 1 | 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/Migration.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Migration 9 | extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface 10 | { 11 | /** 12 | * Render element html 13 | * 14 | * @param Varien_Data_Form_Element_Abstract $element 15 | * @return string 16 | */ 17 | public function render(Varien_Data_Form_Element_Abstract $element) 18 | { 19 | // This option is only available if the migration can be ran 20 | if (!Mage::helper('gene_braintree')->canRunMigration()) { 21 | return ''; 22 | } 23 | 24 | $useContainerId = $element->getData('use_container_id'); 25 | return sprintf(' 26 | 27 | %s 28 | 29 | 30 | %s 31 |

32 | '. $this->__('The migration tool allows you to import various settings, import customers and remove the legacy files from the Braintree_Payments extension.') . ' 33 |

34 | 35 | ', 36 | $element->getHtmlId(), $element->getHtmlId(), $element->getLabel(), $this->getMigrationHtml() 37 | ); 38 | } 39 | 40 | /** 41 | * Return HTML to run the migration 42 | * 43 | * @return string 44 | */ 45 | protected function getMigrationHtml() 46 | { 47 | return ''; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Braintree/Moduleversion.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Moduleversion 9 | extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface 10 | { 11 | /** 12 | * Render element html 13 | * 14 | * @param Varien_Data_Form_Element_Abstract $element 15 | * @return string 16 | */ 17 | public function render(Varien_Data_Form_Element_Abstract $element) 18 | { 19 | $useContainerId = $element->getData('use_container_id'); 20 | return sprintf(' 21 | 22 | %s 23 | 24 | 25 | %s 26 |
27 |
28 | ' . $this->__('Checking latest version...') . ' 29 |
30 |
31 | 32 | ', 33 | $element->getHtmlId(), $element->getHtmlId(), $element->getLabel(), $this->getVersionHtml() 34 | ); 35 | } 36 | 37 | /** 38 | * Inform the user there version will not work 39 | * @return string 40 | */ 41 | protected function getVersionHtml() 42 | { 43 | $response = Mage::getConfig()->getModuleConfig('Gene_Braintree')->version; 44 | $response.= ' 45 | 91 | '; 92 | 93 | return $response; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Braintree/Version.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Block_Adminhtml_System_Config_Braintree_Version 9 | extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface 10 | { 11 | /** 12 | * Render element html 13 | * 14 | * @param Varien_Data_Form_Element_Abstract $element 15 | * @return string 16 | */ 17 | public function render(Varien_Data_Form_Element_Abstract $element) 18 | { 19 | $useContainerId = $element->getData('use_container_id'); 20 | return sprintf(' 21 | 22 | %s 23 | 24 | 25 | %s 26 | 27 | ', 28 | $element->getHtmlId(), $element->getHtmlId(), $element->getLabel(), $this->getVersionHtml() 29 | ); 30 | } 31 | 32 | /** 33 | * Inform the user there version will not work 34 | * @return string 35 | */ 36 | protected function getVersionHtml() 37 | { 38 | if(@class_exists('Braintree\Version')) { 39 | $version = Braintree\Version::get(); 40 | if ($version < 2.32) { 41 | return ' 42 | ' . $version . '
43 | 44 | Warning: Our payment methods will not work with a version of the Braintree lib files older than 2.32.0. You\'ll have to upgrade, please download the newer version here. Once you\'ve downloaded it please replace the file /lib/Braintree.php and the folder /lib/Braintree/ with the newer versions within the archive. 45 | '; 46 | } else { 47 | return '' . $version . ''; 48 | } 49 | } else { 50 | return 'Not Installed'; 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Block/Adminhtml/System/Config/Migration.php: -------------------------------------------------------------------------------- 1 | 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')->canRunMigration(); 36 | } 37 | } -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Block/Applepay.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Block_Applepay extends Mage_Payment_Block_Form 9 | { 10 | /** 11 | * Internal constructor. Set template 12 | */ 13 | protected function _construct() 14 | { 15 | parent::_construct(); 16 | $this->setTemplate('gene/braintree/applepay.phtml'); 17 | } 18 | 19 | /** 20 | * Generate and return a token 21 | * 22 | * @return mixed 23 | */ 24 | public function getClientToken() 25 | { 26 | return Mage::getModel('gene_braintree/wrapper_braintree')->init()->generateToken(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Block/Applepay/Express/Abstract.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Paul Canning 8 | */ 9 | class Gene_Braintree_Block_Applepay_Express_Abstract extends Mage_Core_Block_Template 10 | { 11 | const GENE_BRAINTREE_APPLEPAY_ACTIVE = 'payment/gene_braintree_applepay/active'; 12 | const GENE_BRAINTREE_APPLEPAY_EXPRESS_ACTIVE = 'payment/gene_braintree_applepay/express_active'; 13 | const GENE_BRAINTREE_APPLEPAY_EXPRESS_PDP = 'payment/gene_braintree_applepay/express_pdp'; 14 | const GENE_BRAINTREE_APPLEPAY_EXPRESS_CART = 'payment/gene_braintree_applepay/express_cart'; 15 | 16 | /** 17 | * Retrieve the current quote 18 | * 19 | * @return \Mage_Sales_Model_Quote 20 | */ 21 | public function getQuote() 22 | { 23 | return Mage::getSingleton('checkout/session')->getQuote(); 24 | } 25 | 26 | /** 27 | * Get the current product 28 | * 29 | * @return bool|Mage_Catalog_Model_Product 30 | */ 31 | public function getProduct() 32 | { 33 | return Mage::registry('current_product'); 34 | } 35 | 36 | /** 37 | * Is the express mode enabled 38 | * 39 | * @return bool 40 | */ 41 | public function isEnabled() 42 | { 43 | return Mage::getStoreConfig(self::GENE_BRAINTREE_APPLEPAY_ACTIVE) 44 | && Mage::getStoreConfig(self::GENE_BRAINTREE_APPLEPAY_EXPRESS_ACTIVE); 45 | } 46 | 47 | /** 48 | * Is Express enabled on product pages? 49 | * 50 | * @return bool 51 | */ 52 | public function isEnabledPdp() 53 | { 54 | return $this->isEnabled() && Mage::getStoreConfig(self::GENE_BRAINTREE_APPLEPAY_EXPRESS_PDP); 55 | } 56 | 57 | /** 58 | * Is express enabled in the cart? 59 | * 60 | * @return bool 61 | */ 62 | public function isEnabledCart() 63 | { 64 | return $this->isEnabled() && Mage::getStoreConfig(self::GENE_BRAINTREE_APPLEPAY_EXPRESS_CART); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Block/Applepay/Express/Button.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Block_Applepay_Express_Button extends Gene_Braintree_Block_Applepay_Express_Abstract 9 | { 10 | /** 11 | * Generate braintree token 12 | */ 13 | protected function _construct() 14 | { 15 | parent::_construct(); 16 | } 17 | 18 | /** 19 | * Registry entry to mark this block as instantiated 20 | * 21 | * @param string $html 22 | * 23 | * @return string 24 | */ 25 | public function _afterToHtml($html) 26 | { 27 | if ($this->isEnabled()) { 28 | // Never show the Apple Pay button for free products 29 | if ($this->getProduct() && 30 | $this->getProduct()->getFinalPrice() == 0 && 31 | ( 32 | $this->getProduct()->getTypeId() != Mage_Catalog_Model_Product_Type::TYPE_GROUPED && 33 | $this->getProduct()->getTypeId() != Mage_Catalog_Model_Product_Type::TYPE_BUNDLE 34 | ) 35 | ) { 36 | return ''; 37 | } 38 | 39 | return $html; 40 | } 41 | 42 | return ''; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Block/Applepay/Express/Setup.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Block_Applepay_Express_Setup extends Gene_Braintree_Block_Applepay_Express_Abstract 9 | { 10 | /** 11 | * Braintree token 12 | * 13 | * @var string 14 | */ 15 | protected $_token = null; 16 | 17 | /** 18 | * Generate braintree token 19 | */ 20 | protected function _construct() 21 | { 22 | parent::_construct(); 23 | $this->_token = Mage::getModel('gene_braintree/wrapper_braintree')->init()->generateToken(); 24 | } 25 | 26 | /** 27 | * Get braintree token 28 | * 29 | * @return string 30 | */ 31 | public function getToken() 32 | { 33 | return $this->_token; 34 | } 35 | 36 | /** 37 | * Get store currency code. 38 | * 39 | * @return string 40 | */ 41 | public function getStoreCurrency() 42 | { 43 | return Mage::app()->getStore()->getCurrentCurrencyCode(); 44 | } 45 | 46 | /** 47 | * Get the store locale. 48 | * 49 | * @return string 50 | */ 51 | public function getStoreLocale() 52 | { 53 | return Mage::app()->getLocale()->getLocaleCode(); 54 | } 55 | 56 | /** 57 | * Registry entry to determine if block has been instantiated yet 58 | * 59 | * @return bool 60 | */ 61 | public function hasBeenSetup() 62 | { 63 | if (Mage::registry('gene_braintree_applepay_btn_loaded')) { 64 | return true; 65 | } 66 | 67 | return false; 68 | } 69 | 70 | /** 71 | * Get the grand total for the quote 72 | * 73 | * @return float 74 | */ 75 | public function getQuoteGrandTotal() 76 | { 77 | return number_format($this->getQuote()->getGrandTotal(), 2, '.', ''); 78 | } 79 | 80 | /** 81 | * Registry entry to mark this block as instantiated 82 | * 83 | * @param string $html 84 | * 85 | * @return string 86 | */ 87 | public function _afterToHtml($html) 88 | { 89 | if (!$this->hasBeenSetup()) { 90 | Mage::register('gene_braintree_applepay_btn_loaded', true); 91 | } 92 | 93 | return $html; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Block/Applepay/Info.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Block_Applepay_Info extends Gene_Braintree_Block_Info 9 | { 10 | 11 | /** 12 | * Use a custom template 13 | */ 14 | protected function _construct() 15 | { 16 | parent::_construct(); 17 | $this->setTemplate('gene/braintree/applepay/info.phtml'); 18 | } 19 | 20 | /** 21 | * Prepare information specific to current payment method 22 | * 23 | * @param null | array $transport 24 | * 25 | * @return Varien_Object 26 | */ 27 | protected function _prepareSpecificInformation($transport = null) 28 | { 29 | // Get the original transport data 30 | $transport = parent::_prepareSpecificInformation($transport); 31 | 32 | // Only display this information if it's a single invoice 33 | if ($this->isSingleInvoice()) { 34 | 35 | // Display present data 36 | if ($this->getInfo()->getCcOwner()) { 37 | $data[$this->__('Card Holder')] = $this->getInfo()->getCcOwner(); 38 | } 39 | if ($this->getInfo()->getCcLast4()) { 40 | $data[$this->__('Card Number (Last 4)')] = $this->getInfo()->getCcLast4(); 41 | } 42 | if ($this->getInfo()->getCcType()) { 43 | $data[$this->__('Credit Card Type')] = $this->getInfo()->getCcType(); 44 | } 45 | 46 | } else { 47 | 48 | // Never leave an empty array 49 | $data = array(); 50 | } 51 | 52 | // Check we're in the admin area 53 | if (Mage::app()->getStore()->isAdmin()) { 54 | 55 | // Include live details for this transaction 56 | $this->includeLiveDetails($data); 57 | } 58 | 59 | // Add the data to the class variable 60 | $transport->setData(array_merge($data, $transport->getData())); 61 | $this->_paymentSpecificInformation = $transport->getData(); 62 | 63 | // And return it 64 | return $transport; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Block/Applepay/Setup.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Block_Applepay_Setup extends Mage_Core_Block_Template 9 | { 10 | /** 11 | * Is Apple Pay active? 12 | * 13 | * @return bool 14 | */ 15 | public function isActive() 16 | { 17 | return Mage::getModel('gene_braintree/paymentmethod_applepay')->isAvailable(); 18 | } 19 | 20 | /** 21 | * If one of the other methods is available than core setup is already present, otherwise we'll need to manually 22 | * initialise vzero 23 | * 24 | * @return bool 25 | */ 26 | public function isCoreSetupPresent() 27 | { 28 | return Mage::getModel('gene_braintree/paymentmethod_creditcard')->isAvailable() 29 | || Mage::getModel('gene_braintree/paymentmethod_paypal')->isAvailable(); 30 | } 31 | 32 | /** 33 | * Generate and return a token 34 | * 35 | * @return mixed 36 | */ 37 | protected function getClientToken() 38 | { 39 | return Mage::getSingleton('gene_braintree/wrapper_braintree')->init()->generateToken(); 40 | } 41 | 42 | /** 43 | * Generate url by route and parameters 44 | * 45 | * @param string $route 46 | * @param array $params 47 | * @return string 48 | */ 49 | public function getUrl($route = '', $params = array()) 50 | { 51 | // Always force secure on getUrl calls 52 | if (!isset($params['_forced_secure'])) { 53 | $params['_forced_secure'] = true; 54 | } 55 | 56 | return parent::getUrl($route, $params); 57 | } 58 | 59 | /** 60 | * Only render if the payment method is active 61 | * 62 | * @return string 63 | */ 64 | protected function _toHtml() 65 | { 66 | // Check the payment method is active, block duplicate rendering of this block 67 | if (($this->isActive()) && !Mage::registry('gene_applepay_' . $this->getTemplate())) { 68 | Mage::register('gene_applepay_' . $this->getTemplate(), true); 69 | 70 | return parent::_toHtml(); 71 | } 72 | 73 | return ''; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Block/Braintree.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Block_Cart_Totals extends Mage_Checkout_Block_Cart_Totals 9 | { 10 | 11 | /** 12 | * Check if we have display grand total in base currency 13 | * 14 | * @return bool 15 | */ 16 | public function needDisplayBaseGrandtotal() 17 | { 18 | // If we have a mapped currency code never display base grand total 19 | if (Mage::getSingleton('gene_braintree/wrapper_braintree')->hasMappedCurrencyCode()) { 20 | return false; 21 | } 22 | 23 | return parent::needDisplayBaseGrandtotal(); 24 | } 25 | } -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Block/Creditcard/Info.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Block_Creditcard_Info extends Gene_Braintree_Block_Info 9 | { 10 | 11 | /** 12 | * Use a custom template 13 | */ 14 | protected function _construct() 15 | { 16 | parent::_construct(); 17 | $this->setTemplate('gene/braintree/creditcard/info.phtml'); 18 | } 19 | 20 | /** 21 | * Prepare information specific to current payment method 22 | * 23 | * @param null | array $transport 24 | * 25 | * @return Varien_Object 26 | */ 27 | protected function _prepareSpecificInformation($transport = null) 28 | { 29 | // Get the original transport data 30 | $transport = parent::_prepareSpecificInformation($transport); 31 | 32 | // Only display this information if it's a single invoice 33 | if ($this->isSingleInvoice() || ($this->getInfo()->getCcLast4() && $this->getInfo()->getCcType())) { 34 | 35 | // Build up the data we wish to pass through 36 | $data = array( 37 | $this->__('Card Number (Last 4)') => $this->getInfo()->getCcLast4(), 38 | $this->__('Credit Card Type') => $this->getInfo()->getCcType() 39 | ); 40 | 41 | } else { 42 | 43 | // Never leave an empty array 44 | $data = array(); 45 | } 46 | 47 | // Check we're in the admin area 48 | if (Mage::app()->getStore()->isAdmin()) { 49 | 50 | // Include the transaction statuses 51 | $this->includeLiveDetails($data); 52 | 53 | // Only include extra information when viewing a single invoice 54 | if ($this->isSingleInvoice()) { 55 | 56 | // What additional information should we show 57 | $additionalInfoHeadings = array( 58 | 'avsErrorResponseCode' => $this->__('AVS Error Response Code'), 59 | 'avsPostalCodeResponseCode' => $this->__('AVS Postal Response Code'), 60 | 'avsStreetAddressResponseCode' => $this->__('AVS Street Address Response Code'), 61 | 'cvvResponseCode' => $this->__('CVV Response Code'), 62 | 'gatewayRejectionReason' => $this->__('Gateway Rejection Reason'), 63 | 'processorAuthorizationCode' => $this->__('Processor Autorization Code'), 64 | 'processorResponseCode' => $this->__('Processor Response Code'), 65 | 'processorResponseText' => $this->__('Processor Response Text'), 66 | 'threeDSecure' => $this->__('3D Secure') 67 | ); 68 | 69 | // Add any of the data that we've recorded into the view 70 | foreach ($additionalInfoHeadings as $key => $heading) { 71 | if ($infoData = $this->getInfo()->getAdditionalInformation($key)) { 72 | $data[$heading] = $infoData; 73 | } 74 | } 75 | 76 | } 77 | 78 | } 79 | 80 | // Add the data to the class variable 81 | $transport->setData(array_merge($data, $transport->getData())); 82 | $this->_paymentSpecificInformation = $transport->getData(); 83 | 84 | // And return it 85 | return $transport; 86 | } 87 | 88 | } -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Block/Creditcard/Saved.php: -------------------------------------------------------------------------------- 1 | 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/Creditcard/Threedsecure.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Block_Creditcard_Threedsecure extends Mage_Core_Block_Template 9 | { 10 | /** 11 | * Only render if the payment method is active and 3D secure is enabled 12 | * 13 | * @return string 14 | */ 15 | protected function _toHtml() 16 | { 17 | // Check the payment method is active 18 | if (Mage::getSingleton('gene_braintree/paymentmethod_creditcard')->isAvailable()) { 19 | 20 | // Due to the introduction of the 3Ds threshold we need this block to always be present 21 | return parent::_toHtml(); 22 | } 23 | 24 | return ''; 25 | } 26 | } -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Block/Express/Abstract.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Block_Express_Abstract extends Mage_Core_Block_Template 9 | { 10 | /** 11 | * Is the express mode enabled 12 | * 13 | * @return bool 14 | */ 15 | public function isEnabled() 16 | { 17 | return Mage::getStoreConfig('payment/gene_braintree_paypal/active') 18 | && Mage::getStoreConfig('payment/gene_braintree_paypal/express_active'); 19 | } 20 | 21 | /** 22 | * Is express enabled on the product page? 23 | * 24 | * @return bool 25 | */ 26 | public function isEnabledPdp() 27 | { 28 | return $this->isEnabled() && Mage::getStoreConfig('payment/gene_braintree_paypal/express_pdp'); 29 | } 30 | 31 | /** 32 | * Is express enabled in the cart? 33 | * 34 | * @return bool 35 | */ 36 | public function isEnabledCart() 37 | { 38 | return $this->isEnabled() && Mage::getStoreConfig('payment/gene_braintree_paypal/express_cart'); 39 | } 40 | 41 | /** 42 | * Get store currency code. 43 | * 44 | * @return string 45 | */ 46 | public function getStoreCurrency() 47 | { 48 | return Mage::app()->getStore()->getCurrentCurrencyCode(); 49 | } 50 | 51 | /** 52 | * Get the store locale. 53 | * 54 | * @return string 55 | */ 56 | public function getStoreLocale() 57 | { 58 | return Mage::app()->getLocale()->getLocaleCode(); 59 | } 60 | 61 | /** 62 | * Get button styling configuration settings as an array 63 | * @param $scope 64 | * @return array 65 | */ 66 | public function getStyleConfigArray($scope) 67 | { 68 | return Mage::helper('gene_braintree')->getStyleConfigArray($scope); 69 | } 70 | 71 | /** 72 | * Get button styling configuration settings 73 | * @param $scope 74 | * @return string 75 | */ 76 | public function getStyleConfig($scope) 77 | { 78 | return Mage::helper('gene_braintree')->getStyleConfig($scope); 79 | } 80 | 81 | /** 82 | * Button funding options 83 | * @return string 84 | */ 85 | public function getFunding() 86 | { 87 | $funding = Mage::getStoreConfig('payment/gene_braintree_paypal/disabled_funding'); 88 | $funding = explode(",", $funding); 89 | $disallowed = $allowed = array(); 90 | 91 | // Credit (only for USD currencies) 92 | // We don't explicitly disable this as it causes a JS error with the button 93 | if (!(in_array("credit", $funding) || $this->getStoreCurrency() != "USD")) { 94 | $allowed[] = "'credit'"; 95 | } 96 | 97 | // Cards 98 | if (in_array("card", $funding)) { 99 | $disallowed[] = "'card'"; 100 | } 101 | 102 | // German ELV 103 | if (in_array("elv", $funding)) { 104 | $disallowed[] = "'elv'"; 105 | } 106 | 107 | $return = array(); 108 | if ($disallowed) { 109 | $return[] = 'disallowed: [' . implode(",", $disallowed) . ']'; 110 | } else { 111 | $return[] = 'disallowed: []'; 112 | } 113 | if ($allowed) { 114 | $return[] = 'allowed: [' . implode(",", $allowed) . ']'; 115 | } else { 116 | $return[] = 'allowed: []'; 117 | } 118 | 119 | if ($return) { 120 | return implode(",", $return); 121 | } 122 | return ''; 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Block/Express/Button.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Block_Express_Button extends Gene_Braintree_Block_Express_Abstract 9 | { 10 | const TYPE_CART = 'cart'; 11 | const TYPE_CATALOG = 'catalog'; 12 | 13 | /** 14 | * Registry entry to mark this block as instantiated 15 | * 16 | * @param string $html 17 | * 18 | * @return string 19 | */ 20 | public function _afterToHtml($html) 21 | { 22 | if ($this->getExpressType() == self::TYPE_CART && $this->isEnabledCart()) { 23 | return $html; 24 | } elseif ($this->getExpressType() == self::TYPE_CATALOG && $this->isEnabledPdp()) { 25 | return $html; 26 | } 27 | 28 | return ''; 29 | } 30 | 31 | /** 32 | * @return string 33 | */ 34 | public function getButtonLocation() 35 | { 36 | if ($this->getRequest()->getControllerName() === 'product') { 37 | return 'pdp'; 38 | } 39 | if ($this->getIsCart()) { 40 | return 'cart'; 41 | } 42 | return 'checkout'; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Block/Express/Checkout.php: -------------------------------------------------------------------------------- 1 | 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/Express/Setup.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Block_Express_Setup extends Gene_Braintree_Block_Express_Abstract 9 | { 10 | /** 11 | * Braintree token 12 | * 13 | * @var string 14 | */ 15 | protected $_token = null; 16 | 17 | /** 18 | * Get braintree token 19 | * 20 | * @return string 21 | */ 22 | public function getToken() 23 | { 24 | if ($this->_token === null) { 25 | $this->_token = Mage::getModel('gene_braintree/wrapper_braintree')->init()->generateToken(); 26 | } 27 | 28 | return $this->_token; 29 | } 30 | 31 | /** 32 | * Shall we do a single use payment? 33 | * 34 | * @return string 35 | */ 36 | public function getSingleUse() 37 | { 38 | // We prefer to do future payments, so anything else is future 39 | if ((Mage::getSingleton('gene_braintree/paymentmethod_paypal')->getPaymentType() == 40 | Gene_Braintree_Model_Source_Paypal_Paymenttype::GENE_BRAINTREE_PAYPAL_SINGLE_PAYMENT) || 41 | (!Mage::getSingleton('customer/session')->isLoggedIn()) 42 | ) { 43 | return 'true'; 44 | } 45 | 46 | return 'false'; 47 | } 48 | 49 | /** 50 | * Get the current product 51 | * 52 | * @return mixed 53 | */ 54 | public function getProduct() 55 | { 56 | return Mage::registry('current_product'); 57 | } 58 | 59 | /** 60 | * Registry entry to determine if block has been instantiated yet 61 | * 62 | * @return bool 63 | */ 64 | public function hasBeenSetup() 65 | { 66 | if (Mage::registry('gene_braintree_btn_loaded')) { 67 | return true; 68 | } 69 | 70 | return false; 71 | } 72 | 73 | /** 74 | * Registry entry to mark this block as instantiated 75 | * 76 | * @param string $html 77 | * 78 | * @return string 79 | */ 80 | public function _afterToHtml($html) 81 | { 82 | if (!$this->hasBeenSetup()) { 83 | Mage::register('gene_braintree_btn_loaded', true); 84 | } 85 | 86 | return $html; 87 | } 88 | 89 | /** 90 | * Get payment Environment 91 | * 92 | * @return string 93 | */ 94 | public function getEnv() 95 | { 96 | return Mage::getStoreConfig('payment/gene_braintree/environment'); 97 | } 98 | 99 | /** 100 | * Get payment Environment 101 | * 102 | * @return string 103 | */ 104 | public function getProductTotals() 105 | { 106 | $cart = Mage::getModel('checkout/cart')->getQuote(); 107 | $cartTotal = 0; 108 | foreach ($cart->getAllItems() as $item) { 109 | $cartTotal += ($item->getProduct()->getPrice() * $item->getQty() ); 110 | } 111 | return $cartTotal; 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Block/Googlepay.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Block_Googlepay extends Mage_Payment_Block_Form 9 | { 10 | /** 11 | * Class Construct 12 | */ 13 | protected function _construct() 14 | { 15 | parent::_construct(); 16 | $this->setTemplate('gene/braintree/googlepay.phtml'); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Block/Googlepay/Info.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Block_Googlepay_Info extends Gene_Braintree_Block_Info 9 | { 10 | /** 11 | * Class Construct 12 | */ 13 | protected function _construct() 14 | { 15 | parent::_construct(); 16 | $this->setTemplate('gene/braintree/googlepay/info.phtml'); 17 | } 18 | 19 | /** 20 | * Prepare information specific to current payment method 21 | * @param null $transport 22 | * @return Varien_Object 23 | */ 24 | protected function _prepareSpecificInformation($transport = null) 25 | { 26 | // Get the original transport data 27 | $transport = parent::_prepareSpecificInformation($transport); 28 | 29 | // Only display this information if it's a single invoice 30 | if ($this->isSingleInvoice()) { 31 | 32 | // Display present data 33 | if ($this->getInfo()->getCcOwner()) { 34 | $data[$this->__('Card Holder')] = $this->getInfo()->getCcOwner(); 35 | } 36 | if ($this->getInfo()->getCcLast4()) { 37 | $data[$this->__('Card Number (Last 4)')] = $this->getInfo()->getCcLast4(); 38 | } 39 | if ($this->getInfo()->getCcType()) { 40 | $data[$this->__('Credit Card Type')] = $this->getInfo()->getCcType(); 41 | } 42 | 43 | } else { 44 | 45 | // Never leave an empty array 46 | $data = array(); 47 | } 48 | 49 | // Check we're in the admin area 50 | if (Mage::app()->getStore()->isAdmin()) { 51 | 52 | // Include live details for this transaction 53 | $this->includeLiveDetails($data); 54 | } 55 | 56 | // Add the data to the class variable 57 | $transport->setData(array_merge($data, $transport->getData())); 58 | $this->_paymentSpecificInformation = $transport->getData(); 59 | 60 | // And return it 61 | return $transport; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Block/Googlepay/Setup.php: -------------------------------------------------------------------------------- 1 | isAvailable(); 18 | } 19 | 20 | /** 21 | * @return mixed 22 | */ 23 | public function getGoogleMerchantAccountID() 24 | { 25 | return Mage::getStoreConfig('payment/gene_braintree_googlepay/merchant_account_id'); 26 | } 27 | 28 | /** 29 | * @return string 30 | */ 31 | public function getAllowedCardNetworks() 32 | { 33 | $allowedCardNetworks = Mage::getStoreConfig('payment/gene_braintree_googlepay/accepted_cards'); 34 | 35 | if ($allowedCardNetworks) { 36 | $allowedCardNetworks = explode(',', $allowedCardNetworks); 37 | $allowedCardNetworks = '["' . implode('", "', $allowedCardNetworks) . '"]'; 38 | return $allowedCardNetworks; 39 | } 40 | 41 | return ''; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Block/Paypal.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Block_Paypal extends Mage_Payment_Block_Form 9 | { 10 | 11 | /** 12 | * Store this so we don't load it multiple times 13 | */ 14 | private $_savedDetails = false; 15 | 16 | /** 17 | * Internal constructor. Set template 18 | */ 19 | protected function _construct() 20 | { 21 | parent::_construct(); 22 | $this->setTemplate('gene/braintree/paypal.phtml'); 23 | } 24 | 25 | /** 26 | * Generate and return a token 27 | * 28 | * @return mixed 29 | */ 30 | public function getClientToken() 31 | { 32 | return Mage::getModel('gene_braintree/wrapper_braintree')->init()->generateToken(); 33 | } 34 | 35 | /** 36 | * Shall we do a single use payment? 37 | * 38 | * @return string 39 | */ 40 | public function getSingleUse() 41 | { 42 | // We prefer to do future payments, so anything else is future 43 | if (Mage::getSingleton('gene_braintree/paymentmethod_paypal')->getPaymentType() == Gene_Braintree_Model_Source_Paypal_Paymenttype::GENE_BRAINTREE_PAYPAL_SINGLE_PAYMENT) { 44 | return 'true'; 45 | } 46 | 47 | return 'false'; 48 | } 49 | 50 | /** 51 | * Does this customer have saved accounts? 52 | * 53 | * @return mixed 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 | } 61 | } 62 | 63 | return false; 64 | } 65 | 66 | /** 67 | * Return the saved accounts 68 | * 69 | * @return bool 70 | */ 71 | public function getSavedDetails() 72 | { 73 | if (!$this->_savedDetails) { 74 | $this->_savedDetails = Mage::getSingleton('gene_braintree/saved')->getSavedMethodsByType(Gene_Braintree_Model_Saved::SAVED_PAYPAL_ID); 75 | } 76 | 77 | return $this->_savedDetails; 78 | } 79 | 80 | /** 81 | * Get the saved child HTML 82 | * 83 | * @return string 84 | */ 85 | public function getSavedChildHtml() 86 | { 87 | $html = $this->getChildHtml('saved', false); 88 | $this->unsetChild('saved'); 89 | 90 | return $html; 91 | } 92 | 93 | /** 94 | * Is the vault enabled? Meaning we can save PayPal 95 | * 96 | * @return mixed 97 | */ 98 | public function canSavePayPal() 99 | { 100 | if ($this->getMethod()->isVaultEnabled() 101 | && (Mage::getSingleton('customer/session')->isLoggedIn() 102 | || Mage::getSingleton('checkout/type_onepage')->getCheckoutMethod() == Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER) 103 | ) { 104 | return true; 105 | } 106 | 107 | return false; 108 | } 109 | 110 | } -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Block/Paypal/Info.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Block_Paypal_Info extends Gene_Braintree_Block_Info 9 | { 10 | 11 | /** 12 | * Use a custom template 13 | */ 14 | protected function _construct() 15 | { 16 | parent::_construct(); 17 | $this->setTemplate('gene/braintree/paypal/info.phtml'); 18 | } 19 | 20 | /** 21 | * Prepare information specific to current payment method 22 | * 23 | * @param null | array $transport 24 | * 25 | * @return Varien_Object 26 | */ 27 | protected function _prepareSpecificInformation($transport = null) 28 | { 29 | // Get the original transport data 30 | $transport = parent::_prepareSpecificInformation($transport); 31 | 32 | // Start out data array 33 | $data = array(); 34 | 35 | // Build up the data we wish to pass through 36 | if ($this->getInfo()->getAdditionalInformation('paypal_email')) { 37 | $data[$this->__('PayPal Email')] = $this->getInfo()->getAdditionalInformation('paypal_email'); 38 | } 39 | 40 | // Check we're in the admin area 41 | if (Mage::app()->getStore()->isAdmin()) { 42 | 43 | // Include live details for this transaction 44 | $transaction = $this->includeLiveDetails($data); 45 | 46 | // Insert these values if they're present 47 | if ($this->getInfo()->getAdditionalInformation('payment_id')) { 48 | $data[$this->__('Payment ID')] = $this->getInfo()->getAdditionalInformation('payment_id'); 49 | } 50 | if ($this->getInfo()->getAdditionalInformation('authorization_id')) { 51 | $data[$this->__('Authorization ID')] = $this->getInfo()->getAdditionalInformation('authorization_id'); 52 | } 53 | 54 | // If the additional information doens't contain certain data, than retrieve it from Braintree 55 | if ($transaction && $transaction instanceof Braintree\Transaction) { 56 | if (!isset($data[$this->__('PayPal Email')]) && isset($transaction->paypalDetails->payerEmail)) { 57 | $data[$this->__('PayPal Email')] = $transaction->paypalDetails->payerEmail; 58 | } 59 | if (!isset($data[$this->__('Payment ID')]) && isset($transaction->paypalDetails->paymentId)) { 60 | $data[$this->__('Payment ID')] = $transaction->paypalDetails->paymentId; 61 | } 62 | if (!isset($data[$this->__('Authorization ID')]) 63 | && isset($transaction->paypalDetails->authorizationId) 64 | ) { 65 | $data[$this->__('Authorization ID')] = $transaction->paypalDetails->authorizationId; 66 | } 67 | } 68 | } 69 | 70 | // Add the data to the class variable 71 | $transport->setData(array_merge($data, $transport->getData())); 72 | $this->_paymentSpecificInformation = $transport->getData(); 73 | 74 | // And return it 75 | return $transport; 76 | } 77 | 78 | } -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Block/Paypal/Saved.php: -------------------------------------------------------------------------------- 1 | 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.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Block_Saved extends Mage_Core_Block_Template 9 | { 10 | /** 11 | * Return whether the customer has saved details 12 | * 13 | * @param bool $type 14 | * 15 | * @return bool 16 | */ 17 | public function hasSavedDetails($type = false) 18 | { 19 | return Mage::getSingleton('gene_braintree/saved')->hasType($type); 20 | } 21 | 22 | /** 23 | * Retrieve those said saved details 24 | * 25 | * @param bool $type 26 | * 27 | * @return array 28 | */ 29 | public function getSavedDetails($type = false) 30 | { 31 | return Mage::getSingleton('gene_braintree/saved')->getSavedMethodsByType($type); 32 | } 33 | 34 | /** 35 | * Don't cache this block as it updates whenever the customers adds a new card 36 | * 37 | * @return int 38 | */ 39 | public function getCacheLifetime() 40 | { 41 | return null; 42 | } 43 | 44 | } -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Block/Saved/Edit.php: -------------------------------------------------------------------------------- 1 | 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/Model/Debug.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Model_Debug extends Mage_Core_Model_Abstract 9 | { 10 | 11 | /** 12 | * Is the debugging enabled? 13 | */ 14 | const GENE_BRAINTREE_DEBUG = 'payment/gene_braintree/debug'; 15 | 16 | /** 17 | * Where shall we store the debugging information 18 | */ 19 | const GENE_BRAINTREE_DEBUG_FILE = 'gene_braintree.log'; 20 | 21 | /** 22 | * Log any data passed to this method in the debug file 23 | * 24 | * @param $data 25 | */ 26 | static public function log($data) 27 | { 28 | // Check the debug flag in the admin 29 | if(Mage::getStoreConfigFlag(self::GENE_BRAINTREE_DEBUG)) { 30 | 31 | // If the data is an exception convert it to a string 32 | if($data instanceof Exception) { 33 | $data = $data->getMessage() . $data->getTraceAsString(); 34 | } 35 | 36 | // Use the built in logging function 37 | Mage::log($data, null, self::GENE_BRAINTREE_DEBUG_FILE, true); 38 | } 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Model/Entity/Setup.php: -------------------------------------------------------------------------------- 1 | 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/Express/Assets.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Model_Express_Assets extends Mage_Core_Model_Abstract 9 | { 10 | /** 11 | * Is the express mode enabled 12 | * 13 | * @return bool 14 | */ 15 | public function isEnabled() 16 | { 17 | return Mage::getStoreConfig('payment/gene_braintree_paypal/active') 18 | && Mage::getStoreConfig('payment/gene_braintree_paypal/express_active'); 19 | } 20 | 21 | /** 22 | * Is express enabled on the product page? 23 | * 24 | * @return bool 25 | */ 26 | public function isEnabledPdp() 27 | { 28 | return $this->isEnabled() && Mage::getStoreConfig('payment/gene_braintree_paypal/express_pdp'); 29 | } 30 | 31 | /** 32 | * Is express enabled in the cart? 33 | * 34 | * @return bool 35 | */ 36 | public function isEnabledCart() 37 | { 38 | return $this->isEnabled() && Mage::getStoreConfig('payment/gene_braintree_paypal/express_cart'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Model/Paymentmethod/Legacy/Creditcard.php: -------------------------------------------------------------------------------- 1 | 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_legacy'; 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: -------------------------------------------------------------------------------- 1 | 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_legacy'; 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/Source/ButtonStyle/Color.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Model_Source_ButtonStyle_Color 9 | { 10 | 11 | const COLOR_GOLD = 'gold'; 12 | const COLOR_BLUE = 'blue'; 13 | const COLOR_SILVER = 'silver'; 14 | const COLOUR_BLACK = 'black'; 15 | 16 | /** 17 | * Availabe colours for button 18 | * 19 | * @return array 20 | */ 21 | public function toOptionArray() 22 | { 23 | return array( 24 | array( 25 | 'value' => self::COLOR_GOLD, 26 | 'label' => Mage::helper('gene_braintree')->__('Gold (Recommended)') 27 | ), 28 | array( 29 | 'value' => self::COLOR_BLUE, 30 | 'label' => Mage::helper('gene_braintree')->__('Blue') 31 | ), 32 | array( 33 | 'value' => self::COLOR_SILVER, 34 | 'label' => Mage::helper('gene_braintree')->__('Silver') 35 | ), 36 | array( 37 | 'value' => self::COLOUR_BLACK, 38 | 'label' => Mage::helper('gene_braintree')->__('Black') 39 | ), 40 | ); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Model/Source/ButtonStyle/Layout.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Model_Source_ButtonStyle_Layout 9 | { 10 | 11 | const LAYOUT_VERTICAL = 'vertical'; 12 | const LAYOUT_HORIZONTAL = 'horizontal'; 13 | 14 | 15 | /** 16 | * Possible actions on order place 17 | * 18 | * @return array 19 | */ 20 | public function toOptionArray() 21 | { 22 | return array( 23 | array( 24 | 'value' => self::LAYOUT_VERTICAL, 25 | 'label' => Mage::helper('gene_braintree')->__('Vertical (All buttons)') 26 | ), 27 | array( 28 | 'value' => self::LAYOUT_HORIZONTAL, 29 | 'label' => Mage::helper('gene_braintree')->__('Horizontal (Max 2 Buttons)') 30 | ), 31 | ); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Model/Source/ButtonStyle/Shape.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Model_Source_ButtonStyle_Shape 9 | { 10 | 11 | const SHAPE_PILL = 'pill'; 12 | const SHAPE_RECTANGLE = 'rect'; 13 | 14 | /** 15 | * Possible actions on order place 16 | * 17 | * @return array 18 | */ 19 | public function toOptionArray() 20 | { 21 | return array( 22 | array( 23 | 'value' => self::SHAPE_PILL, 24 | 'label' => Mage::helper('gene_braintree')->__('Pill') 25 | ), 26 | array( 27 | 'value' => self::SHAPE_RECTANGLE, 28 | 'label' => Mage::helper('gene_braintree')->__('Rectangle (Recommended)') 29 | ), 30 | ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Model/Source/ButtonStyle/Size.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Model_Source_ButtonStyle_Size 9 | { 10 | 11 | const SIZE_MEDIUM = 'medium'; 12 | const SIZE_LARGE = 'large'; 13 | const SIZE_RESPONSIVE = 'responsive'; 14 | 15 | /** 16 | * Possible actions on order place 17 | * 18 | * @return array 19 | */ 20 | public function toOptionArray() 21 | { 22 | return array( 23 | array( 24 | 'value' => self::SIZE_MEDIUM, 25 | 'label' => Mage::helper('gene_braintree')->__('Medium') 26 | ), 27 | array( 28 | 'value' => self::SIZE_LARGE, 29 | 'label' => Mage::helper('gene_braintree')->__('Large') 30 | ), 31 | array( 32 | 'value' => self::SIZE_RESPONSIVE, 33 | 'label' => Mage::helper('gene_braintree')->__('Responsive (Recommended)') 34 | ), 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Model/Source/Cctype.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Model_Source_Cctype extends Mage_Payment_Model_Source_Cctype 9 | { 10 | /** 11 | * Allowed credit card types 12 | * This list includes a separate entry for Maestro 13 | * 14 | * @return array 15 | */ 16 | public function getAllowedTypes() 17 | { 18 | return array( 19 | 'VI', 20 | 'MC', 21 | 'AE', 22 | 'DI', 23 | 'JCB', 24 | 'OT', 25 | 'ME' 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Model/Source/Creditcard/CaptureAction.php: -------------------------------------------------------------------------------- 1 | 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'; 13 | const CAPTURE_SHIPMENT = 'shipment'; 14 | 15 | /** 16 | * Possible actions on order place 17 | * 18 | * @return array 19 | */ 20 | public function toOptionArray() 21 | { 22 | return array( 23 | array( 24 | 'value' => self::CAPTURE_INVOICE, 25 | 'label' => Mage::helper('gene_braintree')->__('Invoice') 26 | ), 27 | array( 28 | 'value' => self::CAPTURE_SHIPMENT, 29 | 'label' => Mage::helper('gene_braintree')->__('Shipment') 30 | ), 31 | ); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Model/Source/Creditcard/FormIntegration.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Model_Source_Creditcard_FormIntegration 9 | { 10 | // kept for 1.0 to 2.0 migration 11 | const INTEGRATION_ACTION_XML_PATH = 'payment/gene_braintree_creditcard/form_integration'; 12 | 13 | /** 14 | * Default presents security risks for exploited Magento sites. Hosted Fields ensures security regardless of the 15 | * stores own security. 16 | * 17 | * @deprecated deprecated since version 2.0.0, use hosted fields 18 | */ 19 | const INTEGRATION_DEFAULT = 'default'; 20 | 21 | /** 22 | * https://www.braintreepayments.com/en-gb/products-and-features/custom-ui/hosted-fields 23 | */ 24 | const INTEGRATION_HOSTED = 'hosted'; 25 | 26 | /** 27 | * Possible integrations for the credit card form 28 | * 29 | * @return array 30 | */ 31 | public function toOptionArray() 32 | { 33 | return array( 34 | array( 35 | 'value' => self::INTEGRATION_HOSTED, 36 | 'label' => Mage::helper('gene_braintree')->__('Hosted Fields') 37 | ) 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Model/Source/Creditcard/PaymentAction.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Model_Source_Creditcard_PaymentAction 9 | { 10 | const PAYMENT_ACTION_XML_PATH = 'payment/gene_braintree_creditcard/payment_action'; 11 | 12 | /** 13 | * Possible actions on order place 14 | * 15 | * @return array 16 | */ 17 | public function toOptionArray() 18 | { 19 | return array( 20 | array( 21 | 'value' => Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE, 22 | 'label' => Mage::helper('gene_braintree')->__('Authorize') 23 | ), 24 | array( 25 | 'value' => Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE_CAPTURE, 26 | 'label' => Mage::helper('gene_braintree')->__('Authorize & Capture') 27 | ), 28 | ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Model/Source/Environment.php: -------------------------------------------------------------------------------- 1 | 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 | * 16 | * @return array 17 | */ 18 | public function toOptionArray() 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 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Model/Source/Googlepay/AcceptedCards.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Model_Source_Googlepay_AcceptedCards 9 | { 10 | 11 | /** 12 | * Return the array of options 13 | * 14 | * @return array 15 | */ 16 | public function getArray() 17 | { 18 | return array( 19 | 'AMEX' => Mage::helper('gene_braintree')->__('American Express'), 20 | 'DISCOVER' => Mage::helper('gene_braintree')->__('Discovery'), 21 | 'INTERAC' => Mage::helper('gene_braintree')->__('Interac'), 22 | 'JCB' => Mage::helper('gene_braintree')->__('JCB'), 23 | 'MASTERCARD' => Mage::helper('gene_braintree')->__('Mastercard'), 24 | 'VISA' => Mage::helper('gene_braintree')->__('Visa') 25 | ); 26 | } 27 | 28 | /** 29 | * Options getter 30 | * 31 | * @return array 32 | */ 33 | public function toOptionArray() 34 | { 35 | $response = array(); 36 | foreach($this->getArray() as $key => $value) { 37 | $response[] = array( 38 | 'value' => $key, 39 | 'label' => $value 40 | ); 41 | } 42 | return $response; 43 | } 44 | 45 | /** 46 | * Get options in "key-value" format 47 | * 48 | * @return array 49 | */ 50 | public function toArray() 51 | { 52 | return $this->getArray(); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Model/Source/Paypal/CaptureAction.php: -------------------------------------------------------------------------------- 1 | 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 | } 35 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Model/Source/Paypal/Funding.php: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | class Gene_Braintree_Model_Source_Paypal_Funding 8 | { 9 | 10 | /** 11 | * Return the array of options 12 | * @return array 13 | */ 14 | public function getArray() 15 | { 16 | return array( 17 | 'credit' => Mage::helper('gene_braintree')->__('PayPal Credit'), 18 | 'card' => Mage::helper('gene_braintree')->__('PayPal Guest Checkout Credit Card Icons'), 19 | 'elv' => Mage::helper('gene_braintree')->__('Elektronisches Lastschriftverfahren – German ELV') 20 | ); 21 | } 22 | 23 | /** 24 | * Options getter 25 | * 26 | * @return array 27 | */ 28 | public function toOptionArray() 29 | { 30 | $response = array(); 31 | foreach($this->getArray() as $key => $value) { 32 | $response[] = array( 33 | 'value' => $key, 34 | 'label' => $value 35 | ); 36 | } 37 | return $response; 38 | } 39 | 40 | /** 41 | * Get options in "key-value" format 42 | * 43 | * @return array 44 | */ 45 | public function toArray() 46 | { 47 | return $this->getArray(); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Model/Source/Paypal/Locale.php: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | class Gene_Braintree_Model_Source_Paypal_Locale 8 | { 9 | 10 | /** 11 | * Return the array of options 12 | * @return array 13 | */ 14 | public function getArray() 15 | { 16 | return array( 17 | 'en_AU' => Mage::helper('gene_braintree')->__('Australia'), 18 | 'de_AT' => Mage::helper('gene_braintree')->__('Austria'), 19 | 'en_BE' => Mage::helper('gene_braintree')->__('Belgium'), 20 | 'en_CA' => Mage::helper('gene_braintree')->__('Canada'), 21 | 'da_DK' => Mage::helper('gene_braintree')->__('Denmark'), 22 | 'fr_FR' => Mage::helper('gene_braintree')->__('France'), 23 | 'de_DE' => Mage::helper('gene_braintree')->__('Germany'), 24 | 'en_GB' => Mage::helper('gene_braintree')->__('Great Britain & Ireland'), 25 | 'zh_HK' => Mage::helper('gene_braintree')->__('Hong Kong'), 26 | 'it_IT' => Mage::helper('gene_braintree')->__('Italy'), 27 | 'nl_NL' => Mage::helper('gene_braintree')->__('Netherlands'), 28 | 'no_NO' => Mage::helper('gene_braintree')->__('Norway'), 29 | 'pl_PL' => Mage::helper('gene_braintree')->__('Poland'), 30 | 'es_ES' => Mage::helper('gene_braintree')->__('Spain'), 31 | 'sv_SE' => Mage::helper('gene_braintree')->__('Sweden'), 32 | 'en_CH' => Mage::helper('gene_braintree')->__('Switzerland'), 33 | 'tr_TR' => Mage::helper('gene_braintree')->__('Turkey'), 34 | 'en_US' => Mage::helper('gene_braintree')->__('United States') 35 | ); 36 | } 37 | 38 | /** 39 | * Options getter 40 | * 41 | * @return array 42 | */ 43 | public function toOptionArray() 44 | { 45 | $response = array(); 46 | foreach($this->getArray() as $key => $value) { 47 | $response[] = array( 48 | 'value' => $key, 49 | 'label' => $value 50 | ); 51 | } 52 | return $response; 53 | } 54 | 55 | /** 56 | * Get options in "key-value" format 57 | * 58 | * @return array 59 | */ 60 | public function toArray() 61 | { 62 | return $this->getArray(); 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Model/Source/Paypal/PaymentAction.php: -------------------------------------------------------------------------------- 1 | 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 | } 26 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Model/Source/Paypal/Paymenttype.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Model_Source_Paypal_Paymenttype 9 | { 10 | 11 | const GENE_BRAINTREE_PAYPAL_SINGLE_PAYMENT = 'single'; 12 | const GENE_BRAINTREE_PAYPAL_FUTURE_PAYMENTS = 'future'; 13 | 14 | /** 15 | * Return our options 16 | * 17 | * @return array 18 | */ 19 | public function toOptionArray() 20 | { 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 | } 32 | 33 | } -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Model/System/Config/Backend/Currency.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Model_System_Config_Backend_Currency extends Mage_Core_Model_Config_Data 9 | { 10 | 11 | /** 12 | * Json decode the value 13 | */ 14 | protected function _afterLoad() 15 | { 16 | if (!is_array($this->getValue())) { 17 | $value = $this->getValue(); 18 | $this->setValue(empty($value) ? false : Mage::helper('core')->jsonDecode($value, Zend_Json::TYPE_OBJECT)); 19 | } 20 | } 21 | 22 | /** 23 | * Json encode the value to be stored in the database 24 | */ 25 | protected function _beforeSave() 26 | { 27 | if (is_array($this->getValue())) { 28 | $this->setValue(Mage::helper('core')->jsonEncode($this->getValue())); 29 | } 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Model/System/Config/Source/Payment/Liabilityaction.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Model_System_Config_Source_Payment_Liabilityaction 9 | { 10 | const BLOCK = 1; 11 | const FRAUD = 2; 12 | const PROCESS = 3; 13 | 14 | /** 15 | * Return options for 3D secure specific countries option 16 | * 17 | * @return array 18 | */ 19 | public function toOptionArray() 20 | { 21 | return array( 22 | array('value' => self::BLOCK, 'label' => Mage::helper('adminhtml')->__('Request Alternative Payment Method')), 23 | array('value' => self::FRAUD, 'label' => Mage::helper('adminhtml')->__('Accept & Mark as Fraud')), 24 | array('value' => self::PROCESS, 'label' => Mage::helper('adminhtml')->__('Accept')), 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Model/System/Config/Source/Payment/Threedsecurecountries.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Model_System_Config_Source_Payment_Threedsecurecountries 9 | { 10 | const ALL_COUNTRIES = 0; 11 | const SPECIFIC_COUNTRIES = 1; 12 | 13 | /** 14 | * Return options for 3D secure specific countries option 15 | * 16 | * @return array 17 | */ 18 | public function toOptionArray() 19 | { 20 | return array( 21 | array('value' => self::ALL_COUNTRIES, 'label' => Mage::helper('adminhtml')->__('All Countries')), 22 | array('value' => self::SPECIFIC_COUNTRIES, 'label' => Mage::helper('adminhtml')->__('Specific Countries')), 23 | ); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/Traits/PaymentMethods.php: -------------------------------------------------------------------------------- 1 | getStore()->getCurrentCurrencyCode(); 23 | } 24 | } -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/controllers/Adminhtml/Braintree/MigrationController.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Gene_Braintree_Adminhtml_Braintree_MigrationController extends Mage_Adminhtml_Controller_Action 9 | { 10 | /** 11 | * Check current user permission on resource and privilege 12 | * 13 | * @return bool 14 | */ 15 | protected function _isAllowed() 16 | { 17 | return Mage::getSingleton('admin/session')->isAllowed('sales/order'); 18 | } 19 | 20 | /** 21 | * Run the migration based on the users choice 22 | * 23 | * @return $this 24 | */ 25 | public function runAction() 26 | { 27 | // If the system shouldn't run the migration don't allow this controller to initialize 28 | if (!Mage::helper('gene_braintree')->canRunMigration()) { 29 | $this->norouteAction(); 30 | return $this; 31 | } 32 | 33 | $actions = $this->getRequest()->getParam('migration'); 34 | 35 | /* @var $migration Gene_Braintree_Model_Migration */ 36 | $migration = Mage::getModel('gene_braintree/migration'); 37 | 38 | // Pass the users choices through to the migration model 39 | $migration->setRunConfiguration( 40 | (isset($actions['configuration-settings']) && $actions['configuration-settings'] == 'on') 41 | ); 42 | $migration->setRunCustomerData( 43 | (isset($actions['customer-data']) && $actions['customer-data'] == 'on') 44 | ); 45 | $migration->setDisableLegacy( 46 | (isset($actions['disable-legacy']) && $actions['disable-legacy'] == 'on'), 47 | (isset($actions['remove-legacy']) && $actions['remove-legacy'] == 'on') 48 | ); 49 | $migration->setRunOrderTransactionInfo( 50 | (isset($actions['order-transaction-info']) && $actions['order-transaction-info'] == 'on') 51 | ); 52 | 53 | // Run the migration process 54 | $result = $migration->process(); 55 | 56 | // Add a success message into the session 57 | $this->_getSession()->addSuccess(Mage::helper('gene_braintree')->__('We have successfully migrated you from the Braintree Payments extension to the new Gene Braintree extension.')); 58 | 59 | // Return a JSON response to the browser 60 | return $this->_returnJson(array_merge(array( 61 | 'success' => true 62 | ), $result->debug())); 63 | } 64 | 65 | /** 66 | * Cancelling the migration will ensure it doesn't appear again 67 | * 68 | * @return \Gene_Braintree_Adminhtml_Braintree_MigrationController 69 | */ 70 | public function cancelAction() 71 | { 72 | // Update the configuration to log that the migration is complete 73 | $config = Mage::getConfig(); 74 | $config->saveConfig(Gene_Braintree_Helper_Data::MIGRATION_COMPLETE, 1); 75 | $config->cleanCache(); 76 | 77 | return $this->_returnJson(array('success' => true)); 78 | } 79 | 80 | /** 81 | * Return JSON to the browser 82 | * 83 | * @param $array 84 | * 85 | * @return $this 86 | */ 87 | protected function _returnJson($array) 88 | { 89 | $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($array)); 90 | $this->getResponse()->setHeader('Content-type', 'application/json'); 91 | 92 | return $this; 93 | } 94 | 95 | } -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/controllers/Adminhtml/CheckoutController.php: -------------------------------------------------------------------------------- 1 | isAllowed('sales/order'); 13 | } 14 | 15 | /** 16 | * Return a client token to the browser 17 | * 18 | * @return \Gene_Braintree_CheckoutController 19 | */ 20 | public function clientTokenAction() 21 | { 22 | try { 23 | return $this->_returnJson(array( 24 | 'success' => true, 25 | 'client_token' => Mage::getSingleton('gene_braintree/wrapper_braintree')->init()->generateToken() 26 | )); 27 | } catch (Exception $e) { 28 | return $this->_returnJson(array( 29 | 'success' => false, 30 | 'error' => $e->getMessage() 31 | )); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/controllers/Kount/EnsController.php: -------------------------------------------------------------------------------- 1 | 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 = 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 = << 85 | 86 | 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/etc/adminhtml.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Allow Everything 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Braintree Transactions 16 | 100 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 11 33 | Braintree Transactions 34 | adminhtml/braintree/transactions 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/etc/jstranslator.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Card Number 5 | 6 | 7 | Expiry Month 8 | 9 | 10 | Expiry Year 11 | 12 | 13 | CVV 14 | 15 | 16 | is invalid. 17 | 18 | 19 | There are a number of errors present with the credit card form: 20 | 21 | 22 | Your payment has failed 3D secure verification, please try an alternate payment method. 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/sql/gene_braintree_setup/install-0.1.0.php: -------------------------------------------------------------------------------- 1 | startSetup(); 6 | 7 | $entityTypeId = $installer->getEntityTypeId('customer'); 8 | $attributeSetId = $installer->getDefaultAttributeSetId($entityTypeId); 9 | $attributeGroupId = $installer->getDefaultAttributeGroupId($entityTypeId, $attributeSetId); 10 | 11 | // Add in a new attribute for the braintree's customer ID 12 | // This is generated and stored Magento side and is used for stored details 13 | $installer->addAttribute('customer', 'braintree_customer_id', array( 14 | 'input' => 'text', 15 | 'type' => 'varchar', 16 | 'label' => 'Generated Braintree Customer Account ID', 17 | 'visible' => 0, 18 | 'required' => 0, 19 | 'user_defined' => 1, 20 | )); 21 | 22 | // Add the attribute into the group 23 | $installer->addAttributeToGroup( 24 | $entityTypeId, 25 | $attributeSetId, 26 | $attributeGroupId, 27 | 'braintree_customer_id', 28 | '999' 29 | ); 30 | 31 | $installer->endSetup(); -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/sql/gene_braintree_setup/upgrade-1.0.5.4-2.0.0.php: -------------------------------------------------------------------------------- 1 | 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/code/community/Gene/Braintree/sql/gene_braintree_setup/upgrade-2.0.0-2.0.1.php: -------------------------------------------------------------------------------- 1 | startSetup(); 6 | 7 | // Update the white list for AnattaDesign Awesome Checkout 8 | if (Mage::helper('core')->isModuleEnabled('AnattaDesign_AwesomeCheckout')) { 9 | $whiteListConfigXmlPath = 'awesomecheckout/advanced/whitelisted_css_js'; 10 | $whiteList = array( 11 | 'gene/braintree/vzero-0.7-min.js', 12 | 'gene/braintree/vzero-0.7.js', 13 | 'css/gene/braintree/awesomecheckout.css' 14 | ); 15 | 16 | // Update values on the default scope 17 | if ($currentWhiteList = $this->getStoreConfig($whiteListConfigXmlPath)) { 18 | $currentWhiteListArray = explode("\n", $currentWhiteList); 19 | if (is_array($currentWhiteListArray) && count($currentWhiteListArray) > 0) { 20 | $whiteList = array_merge($currentWhiteListArray, $whiteList); 21 | } 22 | } 23 | 24 | // Save the new default config values 25 | Mage::getConfig()->saveConfig( 26 | $whiteListConfigXmlPath, 27 | implode("\n", $whiteList), 28 | 'default', 29 | 0 30 | ); 31 | 32 | // Loop through the stores and ensure they're all up to date 33 | $stores = Mage::getModel('core/store')->getCollection(); 34 | foreach ($stores as $store) { 35 | 36 | // Update values on the default scope 37 | if ($currentWhiteList = $this->getStoreConfig($whiteListConfigXmlPath, $store)) { 38 | $currentWhiteListArray = explode("\n", $currentWhiteList); 39 | if (is_array($currentWhiteListArray) && count($currentWhiteListArray) > 0) { 40 | $whiteList = array_merge($currentWhiteListArray, $whiteList); 41 | } 42 | } 43 | 44 | // Save the new default config values 45 | Mage::getConfig()->saveConfig( 46 | $whiteListConfigXmlPath, 47 | implode("\n", $whiteList), 48 | 'stores', 49 | $store->getId() 50 | ); 51 | } 52 | 53 | // Clean the cache 54 | Mage::getConfig()->cleanCache(); 55 | } 56 | 57 | $installer->endSetup(); -------------------------------------------------------------------------------- /app/code/community/Gene/Braintree/sql/gene_braintree_setup/upgrade-2.0.4-2.1.0.php: -------------------------------------------------------------------------------- 1 | startSetup(); 6 | 7 | // Update the white list for AnattaDesign Awesome Checkout 8 | if (Mage::helper('core')->isModuleEnabled('AnattaDesign_AwesomeCheckout')) { 9 | $whiteListConfigXmlPath = 'awesomecheckout/advanced/whitelisted_css_js'; 10 | $whiteList = array( 11 | 'gene/braintree/vzero-min.js', 12 | 'gene/braintree/vzero-paypal-min.js', 13 | 'gene/braintree/vzero-integration-min.js', 14 | 'css/gene/braintree/awesomecheckout.css' 15 | ); 16 | 17 | // Update values on the default scope 18 | if ($currentWhiteList = $this->getStoreConfig($whiteListConfigXmlPath)) { 19 | $currentWhiteListArray = explode("\n", $currentWhiteList); 20 | if (is_array($currentWhiteListArray) && count($currentWhiteListArray) > 0) { 21 | $whiteList = array_merge($currentWhiteListArray, $whiteList); 22 | } 23 | } 24 | 25 | // Save the new default config values 26 | Mage::getConfig()->saveConfig( 27 | $whiteListConfigXmlPath, 28 | implode("\n", $whiteList), 29 | 'default', 30 | 0 31 | ); 32 | 33 | // Loop through the stores and ensure they're all up to date 34 | $stores = Mage::getModel('core/store')->getCollection(); 35 | foreach ($stores as $store) { 36 | 37 | // Update values on the default scope 38 | if ($currentWhiteList = $this->getStoreConfig($whiteListConfigXmlPath, $store)) { 39 | $currentWhiteListArray = explode("\n", $currentWhiteList); 40 | if (is_array($currentWhiteListArray) && count($currentWhiteListArray) > 0) { 41 | $whiteList = array_merge($currentWhiteListArray, $whiteList); 42 | } 43 | } 44 | 45 | // Save the new default config values 46 | Mage::getConfig()->saveConfig( 47 | $whiteListConfigXmlPath, 48 | implode("\n", $whiteList), 49 | 'stores', 50 | $store->getId() 51 | ); 52 | } 53 | 54 | // Clean the cache 55 | Mage::getConfig()->cleanCache(); 56 | } 57 | 58 | $installer->endSetup(); -------------------------------------------------------------------------------- /app/design/adminhtml/default/default/layout/gene/braintree.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | css/gene/braintree/adminhtml.css 20 | 21 | jsbraintree/braintree-1.3.4.js 22 | 23 | 24 | 25 | 26 | https://js.braintreegateway.com/web/{SDK_VERSION}/js/client.min.js 27 | https://js.braintreegateway.com/web/{SDK_VERSION}/js/hosted-fields.min.js 28 | https://js.braintreegateway.com/web/{SDK_VERSION}/js/three-d-secure.min.js 29 | https://js.braintreegateway.com/web/{SDK_VERSION}/js/data-collector.min.js 30 | gene/braintree/minified/vzero.min.js 31 | gene/braintree/minified/vzero-paypal.min.js 32 | gene/braintree/minified/vzero-integration.min.js 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | css/gene/braintree/adminhtml.css 44 | 45 | 46 | 47 | 48 | 49 | 50 | css/gene/braintree/migration.css 51 | 52 | 53 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /app/design/adminhtml/default/default/template/gene/braintree/applepay/info.phtml: -------------------------------------------------------------------------------- 1 | 4 |
5 | 9 | 10 | getSpecificInformation()):?> 11 | 12 | $_value):?> 13 | 14 | 16 | 17 | 18 |
escapeHtml($_label)?>: 15 | getValueAsArray($_value, false), "\n"))?>
19 | 20 | 21 | isSingleInvoice()): ?> 22 |

__('This order contains multiple Braintree transactions, to view more information on each transaction please view their corresponding invoice.'); ?>

23 | 24 |
25 | 26 | getChildHtml()?> -------------------------------------------------------------------------------- /app/design/adminhtml/default/default/template/gene/braintree/assets.phtml: -------------------------------------------------------------------------------- 1 | 4 | 5 | getExternalJs() as $js) : ?> 6 | 7 | 8 | getJs() as $js) : ?> 9 | 10 | -------------------------------------------------------------------------------- /app/design/adminhtml/default/default/template/gene/braintree/creditcard/info.phtml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | getStore()->isAdmin() && $this->getMethod()->getCode() == 'braintree_legacy'): ?> 8 |
9 |

__('Legacy Payment'); ?>

10 |

__('This order was imported from the legacy Braintree extension. The information displayed below maybe incomplete due to information not being provided by the original extension.'); ?>

11 |

__('Certain operations such as credit memos & voiding may not work with this order.'); ?>

12 |
13 | 14 | 15 | getSpecificInformation()):?> 16 | 17 | $_value):?> 18 | 19 | 21 | 22 | 23 |
escapeHtml($_label)?>: 20 | getValueAsArray($_value, false), "\n"))?>
24 | 25 | 26 | isSingleInvoice()): ?> 27 |

__('This order contains multiple Braintree transactions, to view more information on each transaction please view their corresponding invoice.'); ?>

28 | 29 | 30 | getChildHtml()?> -------------------------------------------------------------------------------- /app/design/adminhtml/default/default/template/gene/braintree/creditcard/saved.phtml: -------------------------------------------------------------------------------- 1 | hasSavedDetails() && $this->getMethod()->isVaultEnabled()): ?> 2 | 3 |
4 |

__('The customer has the following cards linked with their account.'); ?>

5 | 6 | getSavedDetails() as $savedDetail): 9 | ?> 10 | 11 | 14 | 23 | 24 | 27 | 28 | 29 | 30 | 31 |
12 | /> 13 | 15 | 22 |
32 | 33 | -------------------------------------------------------------------------------- /app/design/adminhtml/default/default/template/gene/braintree/googlepay/info.phtml: -------------------------------------------------------------------------------- 1 |
2 | 6 | 7 | getSpecificInformation()): ?> 8 | 9 | $_value): ?> 10 | 11 | 13 | 14 | 15 |
escapeHtml($_label); ?>: 12 | getValueAsArray($_value, false))); ?>
16 | 17 | 18 | isSingleInvoice()): ?> 19 |

__('This order contains multiple Braintree transactions, to view more information on each transaction please view their corresponding invoice.'); ?>

20 | 21 |
22 | 23 | getChildHtml(); ?> -------------------------------------------------------------------------------- /app/design/adminhtml/default/default/template/gene/braintree/paypal.phtml: -------------------------------------------------------------------------------- 1 | getMethodCode() 4 | ?> 5 | 10 | -------------------------------------------------------------------------------- /app/design/adminhtml/default/default/template/gene/braintree/paypal/info.phtml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | getStore()->isAdmin() && $this->getMethod()->getCode() == 'braintree_paypal_legacy'): ?> 8 |
9 |

__('Legacy Payment'); ?>

10 |

__('This order was imported from the legacy Braintree extension. The information displayed below maybe incomplete due to information not being provided by the original extension.'); ?>

11 |

__('Certain operations such as credit memos & voiding may not work with this order.'); ?>

12 |
13 | 14 | 15 | getSpecificInformation()):?> 16 | 17 | $_value):?> 18 | 19 | 21 | 22 | 23 |
escapeHtml($_label)?>: 20 | getValueAsArray($_value, false), "\n"))?>
24 | 25 | 26 | getChildHtml()?> 27 | -------------------------------------------------------------------------------- /app/design/adminhtml/default/default/template/gene/braintree/paypal/saved.phtml: -------------------------------------------------------------------------------- 1 | 2 | hasSavedDetails()): ?> 3 | 4 |

__('The customer has the following linked PayPal accounts.'); ?>

5 | 6 | 7 | getSavedDetails() as $savedDetail): 10 | ?> 11 | 12 | 13 | 19 | 20 | 23 | 24 |
/> 14 | 18 |
25 | 26 | 27 |

__('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.'); ?>

28 | 29 | -------------------------------------------------------------------------------- /app/design/adminhtml/default/default/template/gene/braintree/transactions/index.phtml: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | 7 |
getHeaderHtml() ?>getButtonsHtml() ?>
8 |
9 | getChildHtml('search'); ?> 10 |
11 | getGridHtml() ?> 12 |
13 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/gene/braintree/applepay.phtml: -------------------------------------------------------------------------------- 1 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/gene/braintree/applepay/express/cart/button.phtml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/gene/braintree/applepay/express/cart/setup.phtml: -------------------------------------------------------------------------------- 1 | isEnabled() || !$this->isEnabledCart()) return; ?> 2 | 3 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/gene/braintree/applepay/express/catalog/button.phtml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/gene/braintree/applepay/express/catalog/setup.phtml: -------------------------------------------------------------------------------- 1 | isEnabled() || !$this->isEnabledPdp()) return; ?> 2 | 3 | getProduct()->getFinalPrice(); 6 | if ($this->getProduct() && $this->getProduct()->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_GROUPED) { 7 | $price = 1; 8 | } 9 | ?> 10 | 11 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/gene/braintree/applepay/info.phtml: -------------------------------------------------------------------------------- 1 |

escapeHtml($this->getMethod()->getTitle()) ?>

2 | 3 | getSpecificInformation()):?> 4 | 5 | 6 | $_value): 7 | if($_value): ?> 8 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 17 |
escapeHtml($_label)?>:
getValueAsArray($_value, true)))?>
18 | 19 | 20 | getChildHtml()?> 21 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/gene/braintree/assets.phtml: -------------------------------------------------------------------------------- 1 | 4 | 5 | getExternalJs() as $js) : ?> 6 | 7 | 8 | getJs() as $js) : ?> 9 | 10 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/gene/braintree/creditcard/info.phtml: -------------------------------------------------------------------------------- 1 |

escapeHtml($this->getMethod()->getTitle()) ?>

2 | 3 | getSpecificInformation()):?> 4 | 5 | 6 | $_value): 7 | if($_value): ?> 8 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 17 |
escapeHtml($_label)?>:
getValueAsArray($_value, true), "\n"))?>
18 | 19 | 20 | getChildHtml()?> 21 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/gene/braintree/creditcard/saved.phtml: -------------------------------------------------------------------------------- 1 | hasSavedDetails() && $this->getMethod()->isVaultEnabled()): ?> 2 | 3 |
4 |

__('The following credit cards accounts are currently linked with your account.'); ?>

5 | 6 | getSavedDetails() as $savedDetail): 9 | ?> 10 | 11 | 18 | 27 | 28 | 31 | 32 | 33 | 34 | 35 |
12 | getMethod()->is3DEnabled()): ?> 13 | /> 14 | 15 | /> 16 | 17 | 19 | 26 |
36 | 37 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/gene/braintree/creditcard/threedsecure.phtml: -------------------------------------------------------------------------------- 1 | 2 |
-------------------------------------------------------------------------------- /app/design/frontend/base/default/template/gene/braintree/customer/methods.phtml: -------------------------------------------------------------------------------- 1 | getSavedDetails($this->getType())): ?> 2 | 3 | 4 | 5 | 6 | 9 | 23 | 29 | 30 | 31 |
7 | 8 | 10 | cardType)): ?> 11 | 12 | bin; ?>******last4; ?> 13 | 14 | 15 | __('Expires:'); ?> expirationMonth; ?>/expirationYear; ?> 16 | 17 | 18 | 21 | 22 | 24 | cardType)): ?> 25 | __('Edit'); ?> 26 | 27 | __('Remove'); ?> 28 |
32 | 33 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/gene/braintree/customer/saved.phtml: -------------------------------------------------------------------------------- 1 |
2 |
3 |

__('Saved Payment Information') ?>

4 |
5 | 6 | getMessagesBlock()->toHtml() ?> 7 | 8 |
9 | 10 | hasSavedDetails()): ?> 11 | 12 |

__('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.'); ?>

13 | 14 |
15 |
16 | hasSavedDetails(Gene_Braintree_Model_Saved::SAVED_CREDITCARD_ID)): ?> 17 |
18 |

__('Credit Cards') ?>

19 | getChild('methods')->setType(Gene_Braintree_Model_Saved::SAVED_CREDITCARD_ID)->toHtml(); ?> 20 |
21 | 22 | 23 | hasSavedDetails(Gene_Braintree_Model_Saved::SAVED_PAYPAL_ID)): ?> 24 |
25 |

__('PayPal') ?>

26 | getChild('methods')->setType(Gene_Braintree_Model_Saved::SAVED_PAYPAL_ID)->toHtml(); ?> 27 |
28 | 29 |
30 |
31 | 32 | 33 |

__('You currently have no saved payment information, you can save a payment method when making a purchase.'); ?>

34 | 35 |
36 |
-------------------------------------------------------------------------------- /app/design/frontend/base/default/template/gene/braintree/express/button.phtml: -------------------------------------------------------------------------------- 1 | getStyleConfigArray($this->getData("config_name")); 4 | ?> 5 | 6 |
-------------------------------------------------------------------------------- /app/design/frontend/base/default/template/gene/braintree/express/cart.phtml: -------------------------------------------------------------------------------- 1 | isEnabledCart()) { 4 | return; 5 | } 6 | ?> 7 | 8 | 53 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/gene/braintree/express/catalog.phtml: -------------------------------------------------------------------------------- 1 | isEnabledPdp()) { 4 | return; 5 | } 6 | ?> 7 | 8 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/gene/braintree/express/error.phtml: -------------------------------------------------------------------------------- 1 | 4 |
5 |

__('There has been an issue whilst processing your order'); ?>

6 |

__('The following error has occurred whilst trying to process your order:'); ?>

7 |
8 |
9 | getMessagesBlock(); 11 | /* @var $message Mage_Core_Model_Message_Error */ 12 | foreach ($messages->getMessages() as $message) { 13 | ?> 14 |

15 | getText(); ?> 16 |

17 | 20 |
21 |
22 | 23 |
-------------------------------------------------------------------------------- /app/design/frontend/base/default/template/gene/braintree/express/shipping_details.phtml: -------------------------------------------------------------------------------- 1 | 4 |
5 | 6 | 7 |
__('Your Order'); ?>
8 | getMessagesBlock()->getGroupedHtml() ?> 9 | 10 | getQuote()->getAllVisibleItems() as $item): ?> 11 |
12 |
13 |
14 |

getProduct()->getName(); ?>

15 |
__('Quantity:'); ?> getQty(); ?>
16 |
17 |
18 | 19 | 20 | hasShippingRates()): ?> 21 |
22 | __('Shipping method:'); ?> 23 | getShippingRates() as $_rate): ?> 24 | 30 | 31 |
32 |
33 | 34 | 35 | 36 | 37 |
38 |
39 | getChildHtml('totals'); ?> 40 |
41 | 42 | 43 | 44 |

__('There are no shipping methods available for your address.'); ?>

45 |

__('Please repeat the process, selecting an address that we\'re able to deliver to.'); ?>

46 |

47 | 48 | 49 |
50 |
-------------------------------------------------------------------------------- /app/design/frontend/base/default/template/gene/braintree/googlepay.phtml: -------------------------------------------------------------------------------- 1 | 4 | 11 | 12 | 18 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/gene/braintree/googlepay/info.phtml: -------------------------------------------------------------------------------- 1 | 2 |

3 | 4 | escapeHtml($this->getMethod()->getTitle()); ?> 5 | 6 |

7 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/gene/braintree/js/applepaysetup.phtml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 24 | 25 | 44 | 45 | 51 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/gene/braintree/js/fme.phtml: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | ?> 8 | 9 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/gene/braintree/js/googlepaysetup.phtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/gene/braintree/js/setup.phtml: -------------------------------------------------------------------------------- 1 | 7 | 58 | 59 | 68 | 69 | 74 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/gene/braintree/js/unicode.phtml: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | ?> 8 | 9 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/gene/braintree/paypal.phtml: -------------------------------------------------------------------------------- 1 | 4 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/gene/braintree/paypal/info.phtml: -------------------------------------------------------------------------------- 1 |

escapeHtml($this->getMethod()->getTitle()) ?>

2 | 3 | getSpecificInformation()):?> 4 | 5 | 6 | $_value): 7 | if($_value): 8 | ?> 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 18 |
escapeHtml($_label)?>:
getValueAsArray($_value, true), "\n"))?>
19 | 20 | 21 | getChildHtml()?> 22 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/gene/braintree/paypal/saved.phtml: -------------------------------------------------------------------------------- 1 | hasSavedDetails() && $this->getMethod()->isVaultEnabled()): ?> 2 | 3 | 4 |

__('The following PayPal accounts are currently linked with your account.'); ?>

5 | 6 | 7 | getSavedDetails() as $savedDetail): 10 | ?> 11 | 12 | 13 | 19 | 20 | 23 | 24 | 25 | 26 | 27 | 28 |
/> 14 | 18 |
29 | 30 | -------------------------------------------------------------------------------- /app/etc/modules/Gene_Braintree.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | community 7 | 8 | 9 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gene/braintree", 3 | "type": "magento-module", 4 | "require": { 5 | "braintree/braintree_php": "^6" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "8d3051f7737873d410653d3c1c740dfd", 8 | "packages": [ 9 | { 10 | "name": "braintree/braintree_php", 11 | "version": "6.24.0", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/braintree/braintree_php.git", 15 | "reference": "8b5b96630106aff5c6564ace13bddb123ff68891" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/braintree/braintree_php/zipball/8b5b96630106aff5c6564ace13bddb123ff68891", 20 | "reference": "8b5b96630106aff5c6564ace13bddb123ff68891", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "ext-curl": "*", 25 | "ext-dom": "*", 26 | "ext-hash": "*", 27 | "ext-openssl": "*", 28 | "ext-xmlwriter": "*", 29 | "php": ">=7.3.0" 30 | }, 31 | "require-dev": { 32 | "phpunit/phpunit": "^9.0", 33 | "squizlabs/php_codesniffer": "^3.0" 34 | }, 35 | "type": "library", 36 | "autoload": { 37 | "psr-4": { 38 | "Braintree\\": "lib/Braintree" 39 | } 40 | }, 41 | "notification-url": "https://packagist.org/downloads/", 42 | "license": [ 43 | "MIT" 44 | ], 45 | "authors": [ 46 | { 47 | "name": "Braintree", 48 | "homepage": "https://www.braintreepayments.com" 49 | } 50 | ], 51 | "description": "Braintree PHP Client Library", 52 | "support": { 53 | "issues": "https://github.com/braintree/braintree_php/issues", 54 | "source": "https://github.com/braintree/braintree_php/tree/6.24.0" 55 | }, 56 | "time": "2025-02-28T18:43:37+00:00" 57 | } 58 | ], 59 | "packages-dev": [], 60 | "aliases": [], 61 | "minimum-stability": "stable", 62 | "stability-flags": {}, 63 | "prefer-stable": false, 64 | "prefer-lowest": false, 65 | "platform": {}, 66 | "platform-dev": {}, 67 | "plugin-api-version": "2.6.0" 68 | } 69 | -------------------------------------------------------------------------------- /js/gene/braintree/minified/express/paypal.min.js: -------------------------------------------------------------------------------- 1 | var BraintreePayPalExpress=Class.create(BraintreeExpressAbstract,{vzeroPayPal:!1,_init:function(){this.vzeroPayPal=new vZeroPayPalButton(!1,"",!1,this.config.locale,!1,!1,this.urls.clientTokenUrl,{})},attachToButtons:function(e){var a=this,t={env:a.config.env,commit:!1,style:a.config.buttonStyle,funding:a.config.funding,payment:{flow:"checkout",amount:a.config.total,currency:a.config.currency,enableShippingAddress:!0,shippingAddressEditable:!0,displayName:a.config.displayName},events:{validate:a.validateForm,onAuthorize:function(e){var t={paypal:JSON.stringify(e)};void 0!==a.config.productId&&(t.product_id=a.config.productId,t.form_data=$("product_addtocart_form")?$("product_addtocart_form").serialize():$("pp_express_form").serialize()),a.initModal(t)},onCancel:function(){a.hideModal()},onError:function(){alert("object"==typeof Translator?Translator.translate("We were unable to complete the request. Please try again."):"We were unable to complete the request. Please try again.")}}};e.each(function(e){e.up().addClassName("braintree-paypal-express-container")}),this.vzeroPayPal.attachPayPalButtonEvent(e,t)}}); -------------------------------------------------------------------------------- /js/gene/braintree/minified/vzero-paypal.min.js: -------------------------------------------------------------------------------- 1 | var vZeroPayPalButton=Class.create();vZeroPayPalButton.prototype={initialize:function(t,e,n,i,o,r,a,s){this.clientToken=t||!1,this.clientTokenUrl=a,this.storeFrontName=e,this.singleUse=n,this.locale=i,this.additionalOptions=s,this.amount=0,this.currency=!1,this.client=!1,this.onlyVaultOnVault=r||!1},getClientToken:function(n){return!1!==this.clientToken?n(this.clientToken):window.braintreeClientToken?n(window.braintreeClientToken):void new Ajax.Request(this.clientTokenUrl,{method:"get",onSuccess:function(t){if(t&&(t.responseJSON||t.responseText)){var e=this._parseTransportAsJson(t);if(1==e.success&&"string"==typeof e.client_token)return this.clientToken=e.client_token,window.braintreeClientToken=e.client_token,n(this.clientToken);console.error("We were unable to retrieve a client token from the server to initialize the Braintree flow."),e.error&&console.error(e.error)}}.bind(this),onFailure:function(){console.error("We were unable to retrieve a client token from the server to initialize the Braintree flow.")}.bind(this)})},getClient:function(n){!1!==this.client?"function"==typeof n&&n(this.client):this.getClientToken(function(t){braintree.client.create({authorization:t},function(t,e){t?console.error(t):(this.client=e,n(this.client))}.bind(this))})},setPricing:function(t,e){this.amount=parseFloat(t),this.currency=e},rebuildButton:function(){return!1},addPayPalButton:function(t,e){var n;if(!(n="string"==typeof(e=e||"#paypal-container")?$$(e):e))return console.error("Unable to locate container "+e+" for PayPal button."),!1;this.attachPayPalButtonEvent(n,t)},attachPayPalButtonEvent:function(r,a){var s=this;this.getClient(function(t){braintree.paypalCheckout.create({client:t},function(t,n){if(t)console.error("Error creating PayPal Checkout:",t);else for(var e,i=0;i 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 | } 131 | .braintree_legacy_order { 132 | background: #dddddd; 133 | padding: 16px 15px 10px 15px; 134 | margin: 12px -15px; 135 | border-top: 1px solid #c7c7c7; 136 | border-bottom: 1px solid #c7c7c7; 137 | } 138 | -------------------------------------------------------------------------------- /skin/adminhtml/base/default/css/gene/braintree/adminhtml.less: -------------------------------------------------------------------------------- 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 | } 132 | 133 | .braintree_legacy_order { 134 | background: #dddddd; 135 | padding: 16px 15px 10px 15px; 136 | margin: 12px -15px; 137 | border-top: 1px solid #c7c7c7; 138 | border-bottom: 1px solid #c7c7c7; 139 | 140 | } -------------------------------------------------------------------------------- /skin/adminhtml/base/default/images/gene/braintree/AE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/adminhtml/base/default/images/gene/braintree/AE.png -------------------------------------------------------------------------------- /skin/adminhtml/base/default/images/gene/braintree/DI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/adminhtml/base/default/images/gene/braintree/DI.png -------------------------------------------------------------------------------- /skin/adminhtml/base/default/images/gene/braintree/JCB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/adminhtml/base/default/images/gene/braintree/JCB.png -------------------------------------------------------------------------------- /skin/adminhtml/base/default/images/gene/braintree/MC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/adminhtml/base/default/images/gene/braintree/MC.png -------------------------------------------------------------------------------- /skin/adminhtml/base/default/images/gene/braintree/ME.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/adminhtml/base/default/images/gene/braintree/ME.png -------------------------------------------------------------------------------- /skin/adminhtml/base/default/images/gene/braintree/PP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/adminhtml/base/default/images/gene/braintree/PP.png -------------------------------------------------------------------------------- /skin/adminhtml/base/default/images/gene/braintree/VI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/adminhtml/base/default/images/gene/braintree/VI.png -------------------------------------------------------------------------------- /skin/adminhtml/base/default/images/gene/braintree/apple-pay-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/adminhtml/base/default/images/gene/braintree/apple-pay-logo.png -------------------------------------------------------------------------------- /skin/adminhtml/base/default/images/gene/braintree/braintree-logo-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/adminhtml/base/default/images/gene/braintree/braintree-logo-black.png -------------------------------------------------------------------------------- /skin/adminhtml/base/default/images/gene/braintree/card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/adminhtml/base/default/images/gene/braintree/card.png -------------------------------------------------------------------------------- /skin/adminhtml/base/default/images/gene/braintree/google-pay-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/adminhtml/base/default/images/gene/braintree/google-pay-logo.png -------------------------------------------------------------------------------- /skin/adminhtml/base/default/images/gene/braintree/paypal-loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/adminhtml/base/default/images/gene/braintree/paypal-loading.gif -------------------------------------------------------------------------------- /skin/adminhtml/base/default/images/gene/braintree/paypal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/adminhtml/base/default/images/gene/braintree/paypal.png -------------------------------------------------------------------------------- /skin/adminhtml/base/default/images/gene/loader-transparent.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/adminhtml/base/default/images/gene/loader-transparent.gif -------------------------------------------------------------------------------- /skin/adminhtml/base/default/images/gene/loader-white.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/adminhtml/base/default/images/gene/loader-white.gif -------------------------------------------------------------------------------- /skin/adminhtml/base/default/images/gene/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/adminhtml/base/default/images/gene/loader.gif -------------------------------------------------------------------------------- /skin/frontend/base/default/css/gene/braintree/minified/account.min.css: -------------------------------------------------------------------------------- 1 | #braintree-saved-payments .payment-methods-container{float:left;width:100%;margin:10px 0}#braintree-saved-payments .payment-methods-container .payment-methods{float:left;width:100%;margin:20px 0}#braintree-saved-payments .payment-methods-container .payment-methods table tr td{padding:0 0 10px 0}#braintree-saved-payments .payment-methods-container .payment-methods .payment-method-card-number{letter-spacing:3px;display:block}#braintree-saved-payments .payment-methods-container .payment-methods .payment-method-expiry-date{display:block;font-size:12px}#braintree-saved-payments .payment-methods-container .payment-methods .method-options a{margin-left:38px}form.gene-braintree-edit-form .input-box.card-number{line-height:48px;letter-spacing:3px}form.gene-braintree-edit-form .input-box.card-number img{margin-right:14px}form.gene-braintree-edit-form .input-box.expiry-date select{width:110px}form.gene-braintree-edit-form .input-box.cvv-field input{width:4em!important} -------------------------------------------------------------------------------- /skin/frontend/base/default/css/gene/braintree/minified/applepay.min.css: -------------------------------------------------------------------------------- 1 | .apple-pay-button-with-text{--apple-pay-scale:1;display:inline-block;font-size:12px;border-radius:5px;padding:0;box-sizing:border-box;min-width:200px;min-height:32px;max-height:64px;text-align:center;vertical-align:middle;font-size:0;border:0;min-height:40px}.apple-pay-button-black-with-text{background-color:#000;color:#fff}.apple-pay-button-white-with-text{background-color:#fff;color:#000}.apple-pay-button-white-with-line-with-text{background-color:#fff;color:#000;border:.5px solid #000}.apple-pay-button-with-text.apple-pay-button-black-with-text>.ap-logo{background-image:-webkit-named-image(apple-pay-logo-white);background-color:#000}.apple-pay-button-with-text.apple-pay-button-white-with-text>.ap-logo{background-image:-webkit-named-image(apple-pay-logo-black);background-color:#fff}.apple-pay-button-with-text.apple-pay-button-white-with-line-with-text>.ap-logo{background-image:-webkit-named-image(apple-pay-logo-black);background-color:#fff}.apple-pay-button-with-text>.text{font-family:-apple-system;font-size:12px;font-weight:300;align-self:center;margin-right:calc(2px * var(--apple-pay-scale));vertical-align:middle}.apple-pay-button-with-text>.ap-logo{background-size:100% 60%;background-repeat:no-repeat;background-position:0 50%;margin-left:calc(4px * var(--apple-pay-scale));border:none;width:42px;height:34px;vertical-align:middle;display:inline-block}.apple-pay-loading-overlay{transition:.5s;opacity:0;visibility:hidden}.apple-pay-loading-overlay.active{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.7);background-size:64px 64px;z-index:10001;opacity:1;visibility:visible}.apple-pay-loading-overlay .ball-scale-ripple-multiple{position:absolute;left:50%;top:50%}@-webkit-keyframes ball-scale-ripple-multiple{0%{-webkit-transform:scale(.1);transform:scale(.1);opacity:1}70%{-webkit-transform:scale(1);transform:scale(1);opacity:.7}100%{opacity:0}}@keyframes ball-scale-ripple-multiple{0%{-webkit-transform:scale(.1);transform:scale(.1);opacity:1}70%{-webkit-transform:scale(1);transform:scale(1);opacity:.7}100%{opacity:0}}.ball-scale-ripple-multiple{position:relative;-webkit-transform:translateY(-25px);-ms-transform:translateY(-25px);transform:translateY(-25px)}.ball-scale-ripple-multiple>div:nth-child(0){-webkit-animation-delay:-.8s;animation-delay:-.8s}.ball-scale-ripple-multiple>div:nth-child(1){-webkit-animation-delay:-.6s;animation-delay:-.6s}.ball-scale-ripple-multiple>div:nth-child(2){-webkit-animation-delay:-.4s;animation-delay:-.4s}.ball-scale-ripple-multiple>div:nth-child(3){-webkit-animation-delay:-.2s;animation-delay:-.2s}.ball-scale-ripple-multiple>div{-webkit-animation-fill-mode:both;animation-fill-mode:both;position:absolute;top:-2px;left:-33px;width:64px;height:64px;border-radius:100%;border:2px solid #fff;-webkit-animation:ball-scale-ripple-multiple 1.25s 0s infinite cubic-bezier(.21,.53,.56,.8);animation:ball-scale-ripple-multiple 1.25s 0s infinite cubic-bezier(.21,.53,.56,.8)}.product-view .add-to-cart-buttons.braintree-applepay-express-container .button{width:auto}.product-view .add-to-cart-buttons.braintree-applepay-express-container .button+.apple-pay-button-with-text{margin-left:5px}ul.checkout-types .braintree-applepay-express-container .apple-pay-button-with-text{height:33px;min-height:33px}@media (max-width:450px){.product-view .add-to-cart-buttons.braintree-applepay-express-container{width:100%}.product-view .add-to-cart-buttons.braintree-applepay-express-container .button{width:100%}.product-view .add-to-cart-buttons.braintree-applepay-express-container .apple-pay-button-with-text{width:100%;margin-bottom:10px}.product-view .add-to-cart-buttons.braintree-applepay-express-container .button+.apple-pay-button-with-text{margin-left:0}ul.checkout-types .braintree-applepay-express-container .apple-pay-button-with-text{width:100%;height:40px;min-height:40px}}.applepay-info-header{font-weight:700;padding:3px 0;text-align:left}.applepay-info{padding:3px 0} -------------------------------------------------------------------------------- /skin/frontend/base/default/css/gene/braintree/minified/express.min.css: -------------------------------------------------------------------------------- 1 | #pp-express-overlay{display:none;position:fixed;top:0;left:0;right:0;bottom:0;z-index:100;background:rgba(0,0,0,.701961)}#pp-express-modal{box-sizing:border-box;display:none;position:fixed;top:20%;left:40%;left:calc(50% - 175px);z-index:101;width:350px;height:390px;padding:15px;background:#fff;border:3px solid #ccc;border-radius:4px;overflow:auto}#pp-express-modal .button{display:block;width:100%;margin-top:30px}#pp-express-modal .button.coupon-submit{margin:0;float:right;width:50%;box-sizing:border-box}#pp-express-modal .button.loading{background-image:url(../../../images/gene/loader-transparent.gif);background-repeat:no-repeat;background-position:center center;background-size:auto 60%;text-indent:-9999px}#pp-express-modal #paypal-express-coupon{float:left;width:50%;box-sizing:border-box;height:33px;line-height:33px}#pp-express-modal #paypal-express-coupon-error{margin-bottom:6px}#pp-express-modal .button2{display:block;width:100%;margin-top:6px;font-size:.9rem}#pp-express-modal .product-row{min-height:60px;margin:0}#pp-express-modal .item-row{border-bottom:1px solid #ccc;padding-bottom:10px;margin-bottom:10px;display:block}#pp-express-modal .item-row.coupon-row{float:left;width:100%}#pp-express-modal .item-subrow{margin-top:5px;margin-bottom:5px;display:block}#pp-express-modal .product-image{float:left;width:50px;height:50px;margin:0;overflow:hidden}#pp-express-modal .product-image img{max-width:100%}#pp-express-modal .product-info{margin-left:60px;padding-top:5px}#pp-express-modal .product-qty{font-size:.8rem}#pp-express-modal #shopping-cart-totals-table{width:100%}#pp-express-modal #shopping-cart-totals-table td{padding-left:10px}#pp-express-modal.loading:before{content:" ";background:url(../../../images/gene/loader.gif) no-repeat;height:48px;width:48px;position:absolute;top:30%;left:44%;left:calc(50% - 24px)}@media (max-width:770px){#pp-express-modal{width:70%;height:80%;top:10%;left:15%}}@media (max-width:500px){#pp-express-modal{width:100%;height:100%;top:0;left:0;border:none;border-radius:0;padding:25px}}.product-view .add-to-cart-buttons.braintree-paypal-express-container .button{width:auto}.paypal-express-btn{width:200px}.product-view .add-to-cart-buttons.braintree-paypal-express-container .paypal-express-btn{float:left;margin-left:15px;margin-top:2px}@media (max-width:599px){.paypal-express-btn{width:100%}.product-view .add-to-cart-buttons.braintree-paypal-express-container{width:100%}.product-view .add-to-cart-buttons.braintree-paypal-express-container .button{width:100%}.product-view .add-to-cart-buttons.braintree-paypal-express-container .paypal-express-btn{float:none;margin:15px 0}}.checkout-types.top li.braintree-paypal-express-container{display:block;float:left;margin-right:15px}.checkout-types.bottom li.braintree-paypal-express-container{margin-right:10px}.checkout-types.bottom li.braintree-paypal-express-container,.checkout-types.bottom li.braintree-paypal-express-container+li{float:left}@media (max-width:740px){.checkout-types.top li.braintree-paypal-express-container{float:none;margin-bottom:10px}.paypal-express-btn{width:100%}}@media (max-width:770px){.checkout-types.top li.braintree-paypal-express-container{margin-right:0}.checkout-types.bottom li.braintree-paypal-express-container,.checkout-types.bottom li.braintree-paypal-express-container+li{float:none}.checkout-types.bottom li.braintree-paypal-express-container{margin:0}} -------------------------------------------------------------------------------- /skin/frontend/base/default/css/gene/braintree/minified/googlepay.min.css: -------------------------------------------------------------------------------- 1 | #googlepay-express-overlay{display:none;position:fixed;top:0;left:0;right:0;bottom:0;z-index:100;background:rgba(0,0,0,.701961)}#googlepay-express-modal{box-sizing:border-box;display:none;position:fixed;top:20%;left:40%;z-index:101;width:350px;height:390px;padding:15px;background:#fff;border:3px solid #ccc;border-radius:4px;overflow:auto}#googlepay-express-modal .button{display:block;width:100%;margin-top:30px}#googlepay-express-modal .button.coupon-submit{margin:0;float:right;width:50%;box-sizing:border-box}#googlepay-express-modal .button.loading{background-image:url(../../../images/gene/loader-transparent.gif);background-repeat:no-repeat;background-position:center center;background-size:auto 60%;text-indent:-9999px}#googlepay-express-modal #paypal-express-coupon{float:left;width:50%;box-sizing:border-box;height:33px;line-height:33px}#googlepay-express-modal #paypal-express-coupon-error{margin-bottom:6px}#googlepay-express-modal .button2{display:block;width:100%;margin-top:6px;font-size:.9rem}#googlepay-express-modal .product-row{min-height:60px;margin:0}#googlepay-express-modal .item-row{border-bottom:1px solid #ccc;padding-bottom:10px;margin-bottom:10px;display:block}#googlepay-express-modal .item-row.coupon-row{float:left;width:100%}#googlepay-express-modal .item-subrow{margin-top:5px;margin-bottom:5px;display:block}#googlepay-express-modal .product-image{float:left;width:50px;height:50px;margin:0;overflow:hidden}#googlepay-express-modal .product-image img{max-width:100%}#googlepay-express-modal .product-info{margin-left:60px;padding-top:5px}#googlepay-express-modal .product-qty{font-size:.8rem}#googlepay-express-modal #shogooglepaying-cart-totals-table{width:100%}#googlepay-express-modal #shopping-cart-totals-table td{padding-left:10px}#googlepay-express-modal.loading:before{content:" ";background:url(../../../../images/gene/loader.gif) no-repeat;height:48px;width:48px;position:absolute;top:30%;left:44%} -------------------------------------------------------------------------------- /skin/frontend/base/default/css/gene/braintree/source/account.css: -------------------------------------------------------------------------------- 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 | } 38 | -------------------------------------------------------------------------------- /skin/frontend/base/default/images/gene/braintree/AE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/frontend/base/default/images/gene/braintree/AE.png -------------------------------------------------------------------------------- /skin/frontend/base/default/images/gene/braintree/DI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/frontend/base/default/images/gene/braintree/DI.png -------------------------------------------------------------------------------- /skin/frontend/base/default/images/gene/braintree/JCB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/frontend/base/default/images/gene/braintree/JCB.png -------------------------------------------------------------------------------- /skin/frontend/base/default/images/gene/braintree/MC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/frontend/base/default/images/gene/braintree/MC.png -------------------------------------------------------------------------------- /skin/frontend/base/default/images/gene/braintree/ME.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/frontend/base/default/images/gene/braintree/ME.png -------------------------------------------------------------------------------- /skin/frontend/base/default/images/gene/braintree/PP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/frontend/base/default/images/gene/braintree/PP.png -------------------------------------------------------------------------------- /skin/frontend/base/default/images/gene/braintree/VI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/frontend/base/default/images/gene/braintree/VI.png -------------------------------------------------------------------------------- /skin/frontend/base/default/images/gene/braintree/apple-pay-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/frontend/base/default/images/gene/braintree/apple-pay-logo.png -------------------------------------------------------------------------------- /skin/frontend/base/default/images/gene/braintree/braintree-logo-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/frontend/base/default/images/gene/braintree/braintree-logo-black.png -------------------------------------------------------------------------------- /skin/frontend/base/default/images/gene/braintree/card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/frontend/base/default/images/gene/braintree/card.png -------------------------------------------------------------------------------- /skin/frontend/base/default/images/gene/braintree/google-pay-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/frontend/base/default/images/gene/braintree/google-pay-logo.png -------------------------------------------------------------------------------- /skin/frontend/base/default/images/gene/braintree/paypal-loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/frontend/base/default/images/gene/braintree/paypal-loading.gif -------------------------------------------------------------------------------- /skin/frontend/base/default/images/gene/braintree/paypal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/frontend/base/default/images/gene/braintree/paypal.png -------------------------------------------------------------------------------- /skin/frontend/base/default/images/gene/loader-transparent.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/frontend/base/default/images/gene/loader-transparent.gif -------------------------------------------------------------------------------- /skin/frontend/base/default/images/gene/loader-white.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/frontend/base/default/images/gene/loader-white.gif -------------------------------------------------------------------------------- /skin/frontend/base/default/images/gene/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinbeaty/module-gene-braintree/eea11d6b74a60ccd8fb75e0296cb7dbd07432efb/skin/frontend/base/default/images/gene/loader.gif --------------------------------------------------------------------------------