diff --git a/app/code/Magento/BraintreeTwo/Block/Adminhtml/Form/Field/CcTypes.php b/app/code/Magento/Braintree/Block/Adminhtml/Form/Field/CcTypes.php
similarity index 92%
rename from app/code/Magento/BraintreeTwo/Block/Adminhtml/Form/Field/CcTypes.php
rename to app/code/Magento/Braintree/Block/Adminhtml/Form/Field/CcTypes.php
index b76bee4ef0ed86ff1ea7a3fb08e83ffe03bf685d..9a6a0d96ed9e90352702149070e06fb2618c648a 100644
--- a/app/code/Magento/BraintreeTwo/Block/Adminhtml/Form/Field/CcTypes.php
+++ b/app/code/Magento/Braintree/Block/Adminhtml/Form/Field/CcTypes.php
@@ -3,9 +3,9 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Block\Adminhtml\Form\Field;
+namespace Magento\Braintree\Block\Adminhtml\Form\Field;
 
-use Magento\BraintreeTwo\Helper\CcType;
+use Magento\Braintree\Helper\CcType;
 use Magento\Framework\View\Element\Context;
 use Magento\Framework\View\Element\Html\Select;
 
diff --git a/app/code/Magento/Braintree/Block/Adminhtml/Form/Field/Cctypes.php b/app/code/Magento/Braintree/Block/Adminhtml/Form/Field/Cctypes.php
deleted file mode 100644
index 4ef4617c251673b1a59b1d74055feb95cdb15038..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Block/Adminhtml/Form/Field/Cctypes.php
+++ /dev/null
@@ -1,80 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Block\Adminhtml\Form\Field;
-
-class Cctypes extends \Magento\Framework\View\Element\Html\Select
-{
-    /**
-     * All possible credit card types
-     *
-     * @var array
-     */
-    protected $ccTypes = [];
-
-    /**
-     * @var \Magento\Braintree\Model\Source\CcType
-     */
-    protected $ccTypeSource;
-
-    /**
-     * Constructor
-     *
-     * @param \Magento\Framework\View\Element\Context $context
-     * @param \Magento\Braintree\Model\Source\CcType $ccTypeSource
-     * @param array $data
-     */
-    public function __construct(
-        \Magento\Framework\View\Element\Context $context,
-        \Magento\Braintree\Model\Source\CcType $ccTypeSource,
-        array $data = []
-    ) {
-        parent::__construct($context, $data);
-        $this->ccTypeSource = $ccTypeSource;
-    }
-
-    /**
-     * Render block HTML
-     *
-     * @return string
-     */
-    public function _toHtml()
-    {
-        if (!$this->getOptions()) {
-            foreach ($this->_getCcTypes() as $country) {
-                if (isset($country['value']) && $country['value'] && isset($country['label']) && $country['label']) {
-                    $this->addOption($country['value'], $country['label']);
-                }
-            }
-        }
-        $this->setClass('cc-type-select');
-        $this->setExtraParams('multiple="multiple"');
-        return parent::_toHtml();
-    }
-
-    /**
-     * All possible credit card types
-     *
-     * @return array
-     */
-    protected function _getCcTypes()
-    {
-        if (!$this->ccTypes) {
-            $this->ccTypes = $this->ccTypeSource->toOptionArray();
-        }
-        return $this->ccTypes;
-    }
-
-    /**
-     * Sets name for input element
-     *
-     * @param string $value
-     * @return $this
-     */
-    public function setInputName($value)
-    {
-        return $this->setName($value . '[]');
-    }
-}
diff --git a/app/code/Magento/Braintree/Block/Adminhtml/Form/Field/Countries.php b/app/code/Magento/Braintree/Block/Adminhtml/Form/Field/Countries.php
index 81244111e907dc122cb421df2eabfb11c58b0d15..b9afb74e48069f41b13f039831b40018902b973e 100644
--- a/app/code/Magento/Braintree/Block/Adminhtml/Form/Field/Countries.php
+++ b/app/code/Magento/Braintree/Block/Adminhtml/Form/Field/Countries.php
@@ -5,59 +5,31 @@
  */
 namespace Magento\Braintree\Block\Adminhtml\Form\Field;
 
-class Countries extends \Magento\Framework\View\Element\Html\Select
-{
-    /**
-     * Countries cache
-     *
-     * @var array
-     */
-    protected $countries;
-
-    /**
-     * @var \Magento\Braintree\Model\System\Config\Source\Country
-     */
-    protected $countrySource;
+use Magento\Braintree\Helper\Country;
+use Magento\Framework\View\Element\Context;
+use Magento\Framework\View\Element\Html\Select;
 
+/**
+ * Class Countries
+ */
+class Countries extends Select
+{
     /**
-     * @var \Magento\Directory\Model\ResourceModel\Country\CollectionFactory
+     * @var Country
      */
-    protected $countryCollectionFactory;
+    private $countryHelper;
 
     /**
      * Constructor
      *
-     * @param \Magento\Framework\View\Element\Context $context
-     * @param \Magento\Braintree\Model\System\Config\Source\Country $countrySource
-     * @param \Magento\Directory\Model\ResourceModel\Country\CollectionFactory $countryCollectionFactory
+     * @param Context $context
+     * @param Country $countryHelper
      * @param array $data
      */
-    public function __construct(
-        \Magento\Framework\View\Element\Context $context,
-        \Magento\Braintree\Model\System\Config\Source\Country $countrySource,
-        \Magento\Directory\Model\ResourceModel\Country\CollectionFactory $countryCollectionFactory,
-        array $data = []
-    ) {
-        parent::__construct($context, $data);
-        $this->countrySource = $countrySource;
-        $this->countryCollectionFactory = $countryCollectionFactory;
-    }
-
-    /**
-     * Returns countries array
-     * 
-     * @return array
-     */
-    protected function _getCountries()
+    public function __construct(Context $context, Country $countryHelper, array $data = [])
     {
-        if (!$this->countries) {
-            $restrictedCountries = $this->countrySource->getRestrictedCountries();
-            $this->countries = $this->countryCollectionFactory->create()
-                ->addFieldToFilter('country_id', ['nin' => $restrictedCountries])
-                ->loadData()
-                ->toOptionArray(false);
-        }
-        return $this->countries;
+        parent::__construct($context, $data);
+        $this->countryHelper = $countryHelper;
     }
     
     /**
@@ -65,14 +37,10 @@ class Countries extends \Magento\Framework\View\Element\Html\Select
      *
      * @return string
      */
-    public function _toHtml()
+    protected function _toHtml()
     {
         if (!$this->getOptions()) {
-            foreach ($this->_getCountries() as $country) {
-                if (isset($country['value']) && $country['value'] && isset($country['label']) && $country['label']) {
-                    $this->addOption($country['value'], $country['label']);
-                }
-            }
+            $this->setOptions($this->countryHelper->getCountries());
         }
         return parent::_toHtml();
     }
diff --git a/app/code/Magento/BraintreeTwo/Block/Adminhtml/Form/Field/CountryCreditCard.php b/app/code/Magento/Braintree/Block/Adminhtml/Form/Field/CountryCreditCard.php
similarity index 97%
rename from app/code/Magento/BraintreeTwo/Block/Adminhtml/Form/Field/CountryCreditCard.php
rename to app/code/Magento/Braintree/Block/Adminhtml/Form/Field/CountryCreditCard.php
index 29b25070352528fa504ee8657c40913015caa988..9dfd80f910cddcac9ff1dbb1d1440ded3c7d1857 100644
--- a/app/code/Magento/BraintreeTwo/Block/Adminhtml/Form/Field/CountryCreditCard.php
+++ b/app/code/Magento/Braintree/Block/Adminhtml/Form/Field/CountryCreditCard.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Block\Adminhtml\Form\Field;
+namespace Magento\Braintree\Block\Adminhtml\Form\Field;
 
 use Magento\Framework\DataObject;
 use Magento\Config\Block\System\Config\Form\Field\FieldArray\AbstractFieldArray;
diff --git a/app/code/Magento/Braintree/Block/Adminhtml/Form/Field/Countrycreditcard.php b/app/code/Magento/Braintree/Block/Adminhtml/Form/Field/Countrycreditcard.php
deleted file mode 100644
index b22dd5c97b80ef5a1599107cadec7739ef33e59b..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Block/Adminhtml/Form/Field/Countrycreditcard.php
+++ /dev/null
@@ -1,104 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Block\Adminhtml\Form\Field;
-
-class Countrycreditcard extends \Magento\Config\Block\System\Config\Form\Field\FieldArray\AbstractFieldArray
-{
-    /**
-     * @var \Magento\Braintree\Block\Adminhtml\Form\Field\Countries
-     */
-    protected $countryRenderer = null;
-
-    /**
-     * @var \Magento\Braintree\Block\Adminhtml\Form\Field\CcTypes
-     */
-    protected $ccTypesRenderer = null;
-    
-    /**
-     * Returns renderer for country element
-     * 
-     * @return \Magento\Braintree\Block\Adminhtml\Form\Field\Countries
-     */
-    protected function getCountryRenderer()
-    {
-        if (!$this->countryRenderer) {
-            $this->countryRenderer = $this->getLayout()->createBlock(
-                '\Magento\Braintree\Block\Adminhtml\Form\Field\Countries',
-                '',
-                ['data' => ['is_render_to_js_template' => true]]
-            );
-        }
-        return $this->countryRenderer;
-    }
-
-    /**
-     * Returns renderer for country element
-     * 
-     * @return \Magento\Braintree\Block\Adminhtml\Form\Field\Cctypes
-     */
-    protected function getCcTypesRenderer()
-    {
-        if (!$this->ccTypesRenderer) {
-            $this->ccTypesRenderer = $this->getLayout()->createBlock(
-                '\Magento\Braintree\Block\Adminhtml\Form\Field\Cctypes',
-                '',
-                ['data' => ['is_render_to_js_template' => true]]
-            );
-        }
-        return $this->ccTypesRenderer;
-    }
-
-    /**
-     * Prepare to render
-     * @return void
-     */
-    protected function _prepareToRender()
-    {
-        $this->addColumn(
-            'country_id',
-            [
-                'label'     => __('Country'),
-                'renderer'  => $this->getCountryRenderer(),
-            ]
-        );
-        $this->addColumn(
-            'cc_types',
-            [
-                'label' => __('Allowed Credit Card Types'),
-                'renderer'  => $this->getCcTypesRenderer(),
-            ]
-        );
-        $this->_addAfter = false;
-        $this->_addButtonLabel = __('Add Rule');
-    }
-
-    /**
-     * Prepare existing row data object
-     *
-     * @param \Magento\Framework\DataObject $row
-     * @return void
-     */
-    protected function _prepareArrayRow(\Magento\Framework\DataObject $row)
-    {
-        $country = $row->getCountryId();
-        $options = [];
-        if ($country) {
-            $options['option_' . $this->getCountryRenderer()->calcOptionHash($country)]
-                = 'selected="selected"';
-
-            $ccTypes = $row->getCcTypes();
-            if (!is_array($ccTypes)) {
-                $ccTypes = [$ccTypes];
-            }
-            foreach ($ccTypes as $cardType) {
-                $options['option_' . $this->getCcTypesRenderer()->calcOptionHash($cardType)]
-                    = 'selected="selected"';
-            }
-        }
-        $row->setData('option_extra_attrs', $options);
-        return;
-    }
-}
diff --git a/app/code/Magento/Braintree/Block/Checkout/Review.php b/app/code/Magento/Braintree/Block/Checkout/Review.php
deleted file mode 100644
index 25f72fd70a773cbaff26775d4dd44bea280dffe9..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Block/Checkout/Review.php
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Block\Checkout;
-
-/**
- * Braintree PayPal shortcut checkout block
- *
- * @author      Magento Core Team <core@magentocommerce.com>
- */
-class Review extends \Magento\Paypal\Block\Express\Review
-{
-    /**
-     * Controller path
-     *
-     * @var string
-     */
-    protected $_controllerPath = 'braintree/paypal';
-
-    /**
-     * Does not allow editing payment information as customer has gone through paypal flow already
-     *
-     * @return null
-     * @codeCoverageIgnore
-     */
-    public function getEditUrl()
-    {
-        return null;
-    }
-}
diff --git a/app/code/Magento/Braintree/Block/Creditcard/Management.php b/app/code/Magento/Braintree/Block/Creditcard/Management.php
deleted file mode 100644
index 6f5037cf4c5404b8904e3c2d67ccf178592229c8..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Block/Creditcard/Management.php
+++ /dev/null
@@ -1,427 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Block\Creditcard;
-
-use \Braintree_CreditCard;
-
-class Management extends \Magento\Framework\View\Element\Template
-{
-    const TYPE_EDIT         = 'edit';
-
-    /**
-     * @var \Magento\Braintree\Model\Vault
-     */
-    protected $vault;
-
-    /**
-     * @var \Magento\Braintree\Model\Config\Cc
-     */
-    protected $config;
-
-    /**
-     * @var \Magento\Customer\Model\Session
-     */
-    protected $customerSession;
-
-    /**
-     * @var \Magento\Customer\Api\CustomerRepositoryInterface
-     */
-    protected $customerRepository;
-
-    /**
-     * @var \Magento\Customer\Api\Data\CustomerInterface
-     */
-    protected $customer;
-
-    /**
-     * @var \Magento\Directory\Model\ResourceModel\Region\CollectionFactory $regionCollectionFactory
-     */
-    protected $regionCollectionFactory;
-
-    /**
-     * @var \Magento\Payment\Model\Config
-     */
-    protected $paymentConfig;
-
-    /**
-     * @var \Magento\Payment\Model\CcConfig
-     */
-    protected $ccConfig;
-
-    /**
-     * @var \Magento\Braintree\Helper\Data
-     */
-    protected $dataHelper;
-
-    /**
-     * Constructor
-     *
-     * @param \Magento\Framework\View\Element\Template\Context $context
-     * @param \Magento\Directory\Model\ResourceModel\Region\CollectionFactory $regionCollectionFactory
-     * @param \Magento\Payment\Model\Config $paymentConfig
-     * @param \Magento\Braintree\Model\Vault $vault
-     * @param \Magento\Braintree\Model\Config\Cc $config
-     * @param \Magento\Customer\Model\Session $customerSession
-     * @param \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository
-     * @param \Magento\Payment\Model\CcConfig $ccConfig
-     * @param \Magento\Braintree\Helper\Data $dataHelper
-     * @param array $data
-     * @SuppressWarnings(PHPMD.ExcessiveParameterList)
-     */
-    public function __construct(
-        \Magento\Framework\View\Element\Template\Context $context,
-        \Magento\Directory\Model\ResourceModel\Region\CollectionFactory $regionCollectionFactory,
-        \Magento\Payment\Model\Config $paymentConfig,
-        \Magento\Braintree\Model\Vault $vault,
-        \Magento\Braintree\Model\Config\Cc $config,
-        \Magento\Customer\Model\Session $customerSession,
-        \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository,
-        \Magento\Payment\Model\CcConfig $ccConfig,
-        \Magento\Braintree\Helper\Data $dataHelper,
-        array $data = []
-    ) {
-        parent::__construct($context, $data);
-        $this->regionCollectionFactory = $regionCollectionFactory;
-        $this->paymentConfig = $paymentConfig;
-        $this->vault = $vault;
-        $this->config = $config;
-        $this->customerSession = $customerSession;
-        $this->customerRepository = $customerRepository;
-        $this->ccConfig = $ccConfig;
-        $this->dataHelper = $dataHelper;
-    }
-
-
-    /**
-     * Returns credit card
-     *
-     * @return \Braintree_CreditCard
-     */
-    public function creditCard()
-    {
-        $token = $this->getRequest()->getParam('token');
-        return $this->vault->storedCard($token);
-    }
-
-    /**
-     * Returns page title
-     *
-     * @return string
-     */
-    public function getTitle()
-    {
-        $title = '';
-        if ($this->getType() == self::TYPE_EDIT) {
-            $title = 'Edit Credit Card';
-        } else {
-            $title = 'Add Credit Card';
-        }
-        return __($title);
-    }
-
-    /**
-     * If card is edited
-     * 
-     * @return boolean
-     */
-    public function isEditMode()
-    {
-        if ($this->getType() == self::TYPE_EDIT) {
-            return true;
-        }
-        return false;
-    }
-
-    /**
-     * Returns html select for country
-     *
-     * @param string $name
-     * @param string $id
-     * @param string $default
-     * @param string $title
-     * @return string
-     */
-    public function countrySelect($name, $id, $default = '', $title = 'Country')
-    {
-        $this->getChildBlock('customer_creditcard_management_country');
-        return $this->getChildBlock('customer_creditcard_management_country')
-            ->getCountryHtmlSelect($default, $name, $id, $title);
-    }
-
-    /**
-     * Returns region code by name
-     *
-     * @param string $region
-     * @param string $countryId
-     * @return string
-     */
-    public function getRegionIdByName($region, $countryId)
-    {
-        $collection = $this->regionCollectionFactory->create()
-            ->addRegionCodeOrNameFilter($region)
-            ->addCountryFilter($countryId);
-
-        if ($collection->getSize()) {
-            return $collection->getFirstItem()->getId();
-        }
-        return '';
-    }
-
-    /**
-     * Retrieve credit card expire months
-     *
-     * @return array
-     */
-    public function getCcMonths()
-    {
-        $months = $this->getData('cc_months');
-        if (!($months)) {
-            $months[0] =  __('Month');
-            $months = array_merge($months, $this->paymentConfig->getMonths());
-            $this->setData('cc_months', $months);
-        }
-        return $months;
-    }
-
-    /**
-     * Retrieve credit card expire years
-     *
-     * @return array
-     */
-    public function getCcYears()
-    {
-        $years = $this->getData('cc_years');
-        if (!($years)) {
-            $years = $this->paymentConfig->getYears();
-            $years = [ 0 => __('Year')] + $years;
-            $this->setData('cc_years', $years);
-        }
-        return $years;
-    }
-
-    /**
-     * Retrieve current stored cards
-     *
-     * @return array
-     */
-    public function getCurrentCustomerStoredCards()
-    {
-        return $this->vault->currentCustomerStoredCards();
-    }
-
-    /**
-     * @return \Magento\Customer\Api\Data\CustomerInterface
-     */
-    protected function getCustomer()
-    {
-        if ($this->customer == null) {
-            $this->customer = $this->customerRepository->getById($this->customerSession->getCustomerId());
-        }
-        return $this->customer;
-    }
-
-    /**
-     * Customer name
-     *
-     * @return null|string
-     */
-    public function currentCustomerName()
-    {
-        if ($this->config->useVault() && $this->customerSession->isLoggedIn()) {
-            return $this->getCustomer()->getFirstname();
-        }
-        return null;
-    }
-
-    /**
-     * Customer last name
-     *
-     * @return null|string
-     */
-    public function currentCustomerLastName()
-    {
-        if ($this->config->useVault() && $this->customerSession->isLoggedIn()) {
-            return $this->getCustomer()->getLastname();
-        }
-        return null;
-    }
-
-    //@codeCoverageIgnoreStart
-    /**
-     * Returns url for edit
-     *
-     * @param string $token
-     * @return string
-     */
-    public function getEditUrl($token)
-    {
-        return $this->getUrl('braintree/creditcard/edit', ['token' => $token, '_secure' => true]);
-    }
-
-    /**
-     * Returns url for delete
-     *
-     * @param string $token
-     * @return string
-     */
-    public function getDeleteUrl($token)
-    {
-        return $this->getUrl('braintree/creditcard/delete', ['token' => $token, '_secure' => true]);
-    }
-
-    /**
-     * Returns url for add
-     *
-     * @return string
-     */
-    public function getAddUrl()
-    {
-        return $this->getUrl('braintree/creditcard/newcard', ['_secure' => true]);
-    }
-
-    /**
-     * Returns url for add
-     *
-     * @return string
-     */
-    public function getDeleteConfirmUrl()
-    {
-        return $this->getUrl('braintree/creditcard/deleteconfirm', ['_secure' => true]);
-    }
-
-    /**
-     * Returns url for ajax save
-     *
-     * @return string
-     */
-    public function getAjaxSaveUrl()
-    {
-        return $this->getUrl('braintree/creditcard/ajaxsave', ['_secure' => true]);
-    }
-
-    /**
-     * Returns url for edit form
-     *
-     * @return string
-     */
-    public function getFormAction()
-    {
-        return $this->getUrl('braintree/creditcard/save', ['_secure' => true]);
-    }
-
-    /**
-     * Returns url for edit form
-     *
-     * @return string
-     */
-    public function getBackUrl()
-    {
-        return $this->getUrl('braintree/creditcard/index', ['_secure' => true]);
-    }
-
-    /**
-     * Retrieve use of vault
-     *
-     * @return bool
-     * @SuppressWarnings(PHPMD.BooleanGetMethodName)
-     */
-    public function getUsesVault()
-    {
-        return $this->config->useVault();
-    }
-
-    /**
-     * If fraud detection is enabled
-     *
-     * @return bool
-     * @SuppressWarnings(PHPMD.BooleanGetMethodName)
-     */
-    public function isFraudDetectionEnabled()
-    {
-        return $this->config->isFraudDetectionEnabled();
-    }
-
-    /**
-     * Retrieve use of vault
-     *
-     * @return bool
-     */
-    public function hasVerification()
-    {
-        return $this->config->useCvv();
-    }
-
-    /**
-     * Retrieve today month
-     *
-     * @return string
-     */
-    public function getTodayMonth()
-    {
-        return $this->dataHelper->getTodayMonth();
-    }
-
-    /**
-     * Retrieve today year
-     *
-     * @return string
-     */
-    public function getTodayYear()
-    {
-        return $this->dataHelper->getTodayYear();
-    }
-
-    /**
-     * @return string
-     */
-    public function getClientToken()
-    {
-        return $this->config->getClientToken();
-    }
-
-    /**
-     * Retrieve available credit card types
-     *
-     * @return array
-     */
-    public function getCcAvailableTypes()
-    {
-        return $this->dataHelper->getCcAvailableCardTypes();
-    }
-
-    /**
-     * Retrieve the cvv image from ccconfig
-     *
-     * @return string
-     */
-    public function getCvvImageUrl()
-    {
-        return $this->ccConfig->getCvvImageUrl();
-    }
-
-    /**
-     * Retrieve country specific credit card types as json
-     *
-     * @return string
-     */
-    public function getCountrySpecificCardTypeConfig()
-    {
-        return $this->config->getCountrySpecificCardTypeConfig();
-    }
-
-
-    /**
-     * Retrieve applicable credit card types
-     *
-     * @return array
-     */
-    public function getCcApplicableTypes()
-    {
-        return $this->config->getApplicableCardTypes(null);
-    }
-
-    //@codeCoverageIgnoreStart
-}
diff --git a/app/code/Magento/BraintreeTwo/Block/Customer/CardRenderer.php b/app/code/Magento/Braintree/Block/Customer/CardRenderer.php
similarity index 93%
rename from app/code/Magento/BraintreeTwo/Block/Customer/CardRenderer.php
rename to app/code/Magento/Braintree/Block/Customer/CardRenderer.php
index 6358eb3c688b6e1d7ab0b64a1a6bc6f1498993bd..41da99d12623056426a19b6d1665c02a8a0255f3 100644
--- a/app/code/Magento/BraintreeTwo/Block/Customer/CardRenderer.php
+++ b/app/code/Magento/Braintree/Block/Customer/CardRenderer.php
@@ -3,9 +3,9 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Block\Customer;
+namespace Magento\Braintree\Block\Customer;
 
-use Magento\BraintreeTwo\Model\Ui\ConfigProvider;
+use Magento\Braintree\Model\Ui\ConfigProvider;
 use Magento\Framework\View\Element\Template;
 use Magento\Vault\Api\Data\PaymentTokenInterface;
 use Magento\Vault\Block\AbstractCardRenderer;
diff --git a/app/code/Magento/Braintree/Block/Datajs.php b/app/code/Magento/Braintree/Block/Datajs.php
deleted file mode 100644
index 34f103ad59d8c00642a561a08b26f7f9ce1c3698..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Block/Datajs.php
+++ /dev/null
@@ -1,68 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Block;
-
-class Datajs extends \Magento\Framework\View\Element\Template
-{
-    const JS_SRC_CONFIG_PATH        = 'payment/braintree/data_js';
-    const MERCHANT_ID_CONFIG_PATH   = 'payment/braintree/merchant_id';
-
-    /**
-     * Returns data.js script source from store config
-     *
-     * @return string
-     */
-    public function getJsSrc()
-    {
-        return $this->_scopeConfig->getValue(
-            self::JS_SRC_CONFIG_PATH,
-            \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
-            null
-        );
-    }
-    
-    /**
-     * Returns merchant_id from store config
-     *
-     * @return string
-     */
-    public function getMerchantId()
-    {
-        return $this->_scopeConfig->getValue(
-            self::MERCHANT_ID_CONFIG_PATH,
-            \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
-            null
-        );
-    }
-
-    /**
-     * Returns the credit card form id
-     *
-     * @return string
-     */
-    public function getFormId()
-    {
-        $controllerName = $this->getRequest()->getControllerName();
-        $actionName = $this->getRequest()->getActionName();
-
-        if ($controllerName == 'creditcard') {
-            switch($actionName) {
-                case 'newcard':
-                    return 'form-validate';
-                case 'edit':
-                    return 'form-validate';
-                case 'delete':
-                    return 'delete-form';
-            }
-        } elseif ($controllerName == 'multishipping') {
-            return 'multishipping-billing-form';
-        } elseif ($controllerName == 'order_create') {
-            return 'edit_form';
-        } else {
-            return 'co-payment-form';
-        }
-    }
-}
diff --git a/app/code/Magento/Braintree/Block/Directory/Data.php b/app/code/Magento/Braintree/Block/Directory/Data.php
deleted file mode 100644
index 86f7c2312a979076b61f0d7cdb775ccd9ea5dca4..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Block/Directory/Data.php
+++ /dev/null
@@ -1,137 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Block\Directory;
-
-class Data extends \Magento\Directory\Block\Data
-{
-    /**
-     * @var \Magento\Braintree\Helper\Data
-     */
-    protected $braintreeHelper;
-
-    /**
-     * @var \Magento\Braintree\Model\System\Config\Source\Country
-     */
-    protected $countrySource;
-
-    /**
-     * @var \Magento\Braintree\Model\Config\Cc
-     */
-    protected $config;
-
-    /**
-     * @param \Magento\Framework\View\Element\Template\Context $context
-     * @param \Magento\Directory\Helper\Data $directoryHelper
-     * @param \Magento\Framework\Json\EncoderInterface $jsonEncoder
-     * @param \Magento\Framework\App\Cache\Type\Config $configCacheType
-     * @param \Magento\Directory\Model\ResourceModel\Region\CollectionFactory $regionCollectionFactory
-     * @param \Magento\Directory\Model\ResourceModel\Country\CollectionFactory $countryCollectionFactory
-     * @param \Magento\Braintree\Helper\Data $braintreeHelper
-     * @param \Magento\Braintree\Model\System\Config\Source\Country $countrySource
-     * @param \Magento\Braintree\Model\Config\Cc $config
-     * @param array $data
-     *
-     * @SuppressWarnings(PHPMD.ExcessiveParameterList)
-     */
-    public function __construct(
-        \Magento\Framework\View\Element\Template\Context $context,
-        \Magento\Directory\Helper\Data $directoryHelper,
-        \Magento\Framework\Json\EncoderInterface $jsonEncoder,
-        \Magento\Framework\App\Cache\Type\Config $configCacheType,
-        \Magento\Directory\Model\ResourceModel\Region\CollectionFactory $regionCollectionFactory,
-        \Magento\Directory\Model\ResourceModel\Country\CollectionFactory $countryCollectionFactory,
-        \Magento\Braintree\Helper\Data $braintreeHelper,
-        \Magento\Braintree\Model\System\Config\Source\Country $countrySource,
-        \Magento\Braintree\Model\Config\Cc $config,
-        array $data = []
-    ) {
-        $this->braintreeHelper = $braintreeHelper;
-        $this->countrySource = $countrySource;
-        $this->config = $config;
-        parent::__construct(
-            $context,
-            $directoryHelper,
-            $jsonEncoder,
-            $configCacheType,
-            $regionCollectionFactory,
-            $countryCollectionFactory,
-            $data
-        );
-    }
-
-    /**
-     * Prepares html with countries
-     *
-     * @param string $defValue
-     * @param string $name
-     * @param string $id
-     * @param string $title
-     * @return string
-     */
-    public function getCountryHtmlSelect($defValue = null, $name = 'country_id', $id = 'country', $title = 'Country')
-    {
-        if (!($defValue)) {
-            $defValue = $this->getCountryId();
-        }
-
-        $cacheId = 'BRAINTREE_DIRECTORY_COUNTRY_SELECT_STORE_'.$this->_storeManager->getStore()->getCode();
-        if ($cache = $this->_configCacheType->load($cacheId)) {
-            $options = unserialize($cache);
-        } else {
-            $options = $this->getCountryCollection()->toOptionArray(false);
-        }
-        $html = $this->getLayout()->createBlock('Magento\Framework\View\Element\Html\Select')
-            ->setName($name)
-            ->setId($id)
-            ->setTitle(__($title))
-            ->setClass('validate-select')
-            ->setValue($defValue)
-            ->setOptions($options)
-            ->getHtml();
-        return $html;
-    }
-
-    /**
-     * Loads country collection
-     *
-     * @return \Magento\Directory\Model\ResourceModel\Country\Collection
-     */
-    public function getCountryCollection()
-    {
-        $collection = $this->getData('country_collection');
-        if ($collection == null) {
-            $restrictedCountriesByBraintree = $this->countrySource->getRestrictedCountries();
-
-            $collection = $this->_countryCollectionFactory->create()
-                ->addFieldToFilter('country_id', ['nin' => $restrictedCountriesByBraintree])
-                ->loadByStore();
-
-            foreach ($collection as $item) {
-                $countryCode=$item->getData('country_id');
-                if (!$this->config->canUseForCountry($countryCode)) {
-                    $restrictedCountriesByBraintree[]=$item->getData('country_id');
-                }
-            }
-
-            $collection = $this->_countryCollectionFactory->create()
-                ->addFieldToFilter('country_id', ['nin' => $restrictedCountriesByBraintree])
-                ->loadByStore();
-
-            $this->setData('country_collection', $collection);
-        }
-        return $collection;
-    }
-
-    /**
-     * Retrieve the default country
-     *
-     * @return string
-     */
-    public function getDefaultCountry()
-    {
-        return $this->directoryHelper->getDefaultCountry();
-    }
-}
diff --git a/app/code/Magento/Braintree/Block/Form.php b/app/code/Magento/Braintree/Block/Form.php
index 41caf1acc84cf3784588def3fbbde11b08fecad0..691bbeb6760fd892474317e0823881a5b933c6ab 100644
--- a/app/code/Magento/Braintree/Block/Form.php
+++ b/app/code/Magento/Braintree/Block/Form.php
@@ -5,256 +5,122 @@
  */
 namespace Magento\Braintree\Block;
 
-class Form extends \Magento\Payment\Block\Form\Cc
-{
-    /**
-     * @var \Magento\Braintree\Model\Vault
-     */
-    protected $vault;
-
-    /**
-     * @var \Magento\Braintree\Model\Config\Cc
-     */
-    protected $config;
+use Magento\Backend\Model\Session\Quote;
+use Magento\Braintree\Gateway\Config\Config as GatewayConfig;
+use Magento\Braintree\Model\Adminhtml\Source\CcType;
+use Magento\Braintree\Model\Ui\ConfigProvider;
+use Magento\Framework\View\Element\Template\Context;
+use Magento\Payment\Block\Form\Cc;
+use Magento\Payment\Model\Config;
+use Magento\Vault\Model\VaultPaymentInterface;
 
-    /**
-     * @var \Magento\Checkout\Model\Type\Onepage
-     */
-    protected $onepage;
+/**
+ * Class Form
+ */
+class Form extends Cc
+{
 
     /**
-     * @var \Magento\Checkout\Model\Session
+     * @var Quote
      */
-    protected $checkoutSession;
+    protected $sessionQuote;
 
     /**
-     * @var \Magento\Customer\Model\Session
+     * @var Config
      */
-    protected $customerSession;
+    protected $gatewayConfig;
 
     /**
-     * @var \Magento\Braintree\Helper\Data
+     * @var CcType
      */
-    protected $dataHelper;
+    protected $ccType;
 
     /**
-     * @var \Magento\Backend\Model\Session\Quote
+     * @var VaultPaymentInterface
      */
-    protected $sessionQuote;
+    protected $vaultService;
 
     /**
-     * @param \Magento\Framework\View\Element\Template\Context $context
-     * @param \Magento\Payment\Model\Config $paymentConfig
-     * @param \Magento\Braintree\Model\Vault $vault
-     * @param \Magento\Braintree\Model\Config\Cc $config
-     * @param \Magento\Checkout\Model\Type\Onepage $onepage
-     * @param \Magento\Checkout\Model\Session $checkoutSession
-     * @param \Magento\Customer\Model\Session $customerSession
-     * @param \Magento\Braintree\Helper\Data $dataHelper
-     * @param \Magento\Backend\Model\Session\Quote $sessionQuote
+     * @param Context $context
+     * @param Config $paymentConfig
+     * @param Quote $sessionQuote
+     * @param GatewayConfig $gatewayConfig
+     * @param CcType $ccType
+     * @param VaultPaymentInterface $vaultService
      * @param array $data
-     * @SuppressWarnings(PHPMD.ExcessiveParameterList)
      */
     public function __construct(
-        \Magento\Framework\View\Element\Template\Context $context,
-        \Magento\Payment\Model\Config $paymentConfig,
-        \Magento\Braintree\Model\Vault $vault,
-        \Magento\Braintree\Model\Config\Cc $config,
-        \Magento\Checkout\Model\Type\Onepage $onepage,
-        \Magento\Checkout\Model\Session $checkoutSession,
-        \Magento\Customer\Model\Session $customerSession,
-        \Magento\Braintree\Helper\Data $dataHelper,
-        \Magento\Backend\Model\Session\Quote $sessionQuote,
+        Context $context,
+        Config $paymentConfig,
+        Quote $sessionQuote,
+        GatewayConfig $gatewayConfig,
+        CcType $ccType,
+        VaultPaymentInterface $vaultService,
         array $data = []
     ) {
         parent::__construct($context, $paymentConfig, $data);
-        $this->vault = $vault;
-        $this->config = $config;
-        $this->onepage = $onepage;
-        $this->checkoutSession = $checkoutSession;
-        $this->customerSession = $customerSession;
-        $this->dataHelper = $dataHelper;
         $this->sessionQuote = $sessionQuote;
+        $this->gatewayConfig = $gatewayConfig;
+        $this->ccType = $ccType;
+        $this->vaultService = $vaultService;
     }
 
     /**
-     * Internal constructor. Set template
-     *
-     * @return void
-     */
-    protected function _construct()
-    {
-        parent::_construct();
-        $this->setTemplate('form.phtml');
-    }
-
-    /**
-     * Set quote and payment
-     * 
-     * @return $this
-     */
-    public function setMethodInfo()
-    {
-        $payment = $this->onepage
-            ->getQuote()
-            ->getPayment();
-        $this->setMethod($payment->getMethodInstance());
-
-        return $this;
-    }
-
-    /**
-     * Returns applicable stored cards
-     * 
-     * @return array
-     */
-    public function getStoredCards()
-    {
-        $storedCards = $this->vault->currentCustomerStoredCards();
-        $country = $this->checkoutSession->getQuote()->getBillingAddress()->getCountryId();
-        $cardTypes = $this->config->getApplicableCardTypes($country);
-        $applicableCards = [];
-        foreach ($storedCards as $card) {
-            if (in_array($this->dataHelper->getCcTypeCodeByName($card->cardType), $cardTypes)) {
-                $applicableCards[] = $card;
-            }
-        }
-        return $applicableCards;
-    }
-
-    /**
-     * Retrieve availables credit card types
-     *
+     * Get list of available card types of order billing address country
      * @return array
      */
     public function getCcAvailableTypes()
     {
-        if ($this->_appState->getAreaCode() === \Magento\Backend\App\Area\FrontNameResolver::AREA_CODE) {
-            $country = $this->sessionQuote->getQuote()->getBillingAddress()->getCountryId();
-        } else {
-            $country = $this->checkoutSession->getQuote()->getBillingAddress()->getCountryId();
-        }
-        $applicableTypes = $this->config->getApplicableCardTypes($country);
-        $types = $this->_paymentConfig->getCcTypes();
-        foreach (array_keys($types) as $code) {
-            if (!in_array($code, $applicableTypes)) {
-                unset($types[$code]);
-            }
-        }
-        return $types;
+        $configuredCardTypes = $this->getConfiguredCardTypes();
+        $countryId = $this->sessionQuote->getQuote()->getBillingAddress()->getCountryId();
+        return $this->filterCardTypesForCountry($configuredCardTypes, $countryId);
     }
 
     /**
-     * If card can be saved for further use
-     *
+     * Check if cvv validation is available
      * @return boolean
      */
-    public function canSaveCard()
-    {
-        if ($this->config->useVault() &&
-            ($this->customerSession->isLoggedIn() ||
-            $this->onepage->getCheckoutMethod() == \Magento\Checkout\Model\Type\Onepage::METHOD_REGISTER)) {
-            return true;
-        }
-        return false;
-    }
-
-    /**
-     * @return bool
-     */
-    public function isCustomerLoggedIn()
-    {
-        return $this->customerSession->isLoggedIn();
-    }
-
-    /**
-     * @return bool
-     */
-    public function isCcDetectionEnabled()
-    {
-        return (bool)$this->config->getConfigData('enable_cc_detection');
-    }
-
-    /**
-     * @return bool
-     */
-    public function useVault()
-    {
-        return (bool)$this->config->useVault();
-    }
-
-    /**
-     * @return bool
-     */
     public function useCvv()
     {
-        return (bool)$this->config->useCvv();
+        return $this->gatewayConfig->isCvvEnabled();
     }
 
     /**
+     * Check if vault enabled
      * @return bool
      */
-    public function is3dSecureEnabled()
+    public function isVaultEnabled()
     {
-        return (bool)$this->config->is3dSecureEnabled();
+        return $this->vaultService->isActiveForPayment(ConfigProvider::CODE);
     }
 
     /**
-     * @return string
-     */
-    public function getBraintreeDataJs()
-    {
-        return $this->config->getBraintreeDataJs();
-    }
-
-
-    /**
-     * If fraud detection is enabled
-     *
-     * @return bool
-     * @SuppressWarnings(PHPMD.BooleanGetMethodName)
-     */
-    public function isFraudDetectionEnabled()
-    {
-        return $this->config->isFraudDetectionEnabled();
-    }
-
-    /**
-     * Get configuration data
-     *
-     * @param string $path
-     * @return mixed
-     */
-    public function getConfigData($path)
-    {
-        return $this->config->getConfigData($path);
-    }
-
-    /**
-     * @return string
+     * Get card types available for Braintree
+     * @return array
      */
-    public function getClientToken()
+    private function getConfiguredCardTypes()
     {
-        return $this->config->getClientToken();
-    }
+        $types = $this->ccType->getCcTypeLabelMap();
+        $configCardTypes = array_fill_keys($this->gatewayConfig->getAvailableCardTypes(), '');
 
-    /**
-     * Retrieve today month
-     *
-     * @return string
-     */
-    public function getTodayMonth()
-    {
-        return $this->dataHelper->getTodayMonth();
+        return array_intersect_key($types, $configCardTypes);
     }
 
     /**
-     * Retrieve today year
-     *
-     * @return string
+     * Filter card types for specific country
+     * @param array $configCardTypes
+     * @param string $countryId
+     * @return array
      */
-    public function getTodayYear()
+    private function filterCardTypesForCountry(array $configCardTypes, $countryId)
     {
-        return $this->dataHelper->getTodayYear();
+        $filtered = $configCardTypes;
+        $countryCardTypes = $this->gatewayConfig->getCountryAvailableCardTypes($countryId);
+        // filter card types only if specific card types are set for country
+        if (!empty($countryCardTypes)) {
+            $availableTypes = array_fill_keys($countryCardTypes, '');
+            $filtered = array_intersect_key($filtered, $availableTypes);
+        }
+        return $filtered;
     }
 }
diff --git a/app/code/Magento/Braintree/Block/Info.php b/app/code/Magento/Braintree/Block/Info.php
index 80e3ddf06c54ae993b16ab9776e64f3f7a3e6b48..4de3dd4f19966ec7dd2daedc6111260069d56e50 100644
--- a/app/code/Magento/Braintree/Block/Info.php
+++ b/app/code/Magento/Braintree/Block/Info.php
@@ -5,99 +5,22 @@
  */
 namespace Magento\Braintree\Block;
 
-class Info extends \Magento\Payment\Block\Info
-{
-    /**
-     * @var \Magento\Payment\Model\Config
-     */
-    protected $paymentConfig;
-
-    /**
-     * Constructor
-     *
-     * @param \Magento\Framework\View\Element\Template\Context $context
-     * @param \Magento\Payment\Model\Config $paymentConfig
-     * @param array $data
-     */
-    public function __construct(
-        \Magento\Framework\View\Element\Template\Context $context,
-        \Magento\Payment\Model\Config $paymentConfig,
-        array $data = []
-    ) {
-        parent::__construct($context, $data);
-        $this->paymentConfig = $paymentConfig;
-    }
-
-    /**
-     * Return credit cart type
-     * 
-     * @return string
-     */
-    protected function getCcTypeName()
-    {
-        $types = $this->paymentConfig->getCcTypes();
-        $ccType = $this->getInfo()->getCcType();
-        if (isset($types[$ccType])) {
-            return $types[$ccType];
-        } else {
-            return __('Stored Card');
-        }
-    }
-
-    /**
-     * Prepare information specific to current payment method
-     *
-     * @param null | array $transport
-     * @return \Magento\Framework\DataObject
-     */
-    protected function _prepareSpecificInformation($transport = null)
-    {
-        $transport = parent::_prepareSpecificInformation($transport);
-        $data = [];
-        $info = $this->getInfo();
-        if ($ccType = $this->getCcTypeName()) {
-            $data[__('Credit Card Type')->getText()] = $ccType;
-        }
-        if ($info->getCcLast4()) {
-            $data[__('Credit Card Number')->getText()] =
-                sprintf('xxxx-%s', $info->getCcLast4());
-        }
-        if ($this->_appState->getAreaCode() === \Magento\Backend\App\Area\FrontNameResolver::AREA_CODE
-            && $info->getAdditionalInformation()
-        ) {
-            foreach ($info->getAdditionalInformation() as $field => $value) {
-                $beautifiedFieldName = ucwords(trim(preg_replace('/(?<=\\w)(?=[A-Z])/', " $1", $field)));
-                $data[__($beautifiedFieldName)->getText()] = $value;
-            }
-        }
-        return $transport->setData(array_merge($data, $transport->getData()));
-    }
+use Magento\Framework\Phrase;
+use Magento\Payment\Block\ConfigurableInfo;
 
+/**
+ * Class Info
+ */
+class Info extends ConfigurableInfo
+{
     /**
-     * Retrieve child block HTML
+     * Returns label
      *
-     * @param   string $name
-     * @param   boolean $useCache
-     * @return  string
-     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+     * @param string $field
+     * @return Phrase
      */
-    public function getChildHtml($name = '', $useCache = true)
+    protected function getLabel($field)
     {
-        $payment = $this->getRequest()->getPost('payment');
-        $result = "";
-        $deviceData = $this->getRequest()->getPost('device_data');
-
-        if (isset($payment["cc_token"]) && $payment["cc_token"]) {
-            $ccToken = $payment["cc_token"];
-            $result .= "<input type='hidden' name='payment[cc_token]' value='$ccToken'>";
-        }
-        if (isset($payment['store_in_vault']) && $payment['store_in_vault']) {
-            $storeInVault = $payment['store_in_vault'];
-            $result .= "<input type='hidden' name='payment[store_in_vault]' value='$storeInVault'>";
-        }
-        if ($deviceData) {
-            $result .= "<input type='hidden' name='device_data' value='$deviceData'>";
-        }
-        return $result;
+        return __($field);
     }
 }
diff --git a/app/code/Magento/Braintree/Block/Info/PayPal.php b/app/code/Magento/Braintree/Block/Info/PayPal.php
deleted file mode 100644
index 519981e6348e1f5af755718d57e4844043aa65dc..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Block/Info/PayPal.php
+++ /dev/null
@@ -1,81 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Block\Info;
-
-class PayPal extends \Magento\Payment\Block\Info
-{
-    /**
-     * @var \Magento\Payment\Model\Config
-     */
-    protected $paymentConfig;
-
-    /**
-     * Constructor
-     *
-     * @param \Magento\Framework\View\Element\Template\Context $context
-     * @param \Magento\Payment\Model\Config $paymentConfig
-     * @param array $data
-     */
-    public function __construct(
-        \Magento\Framework\View\Element\Template\Context $context,
-        \Magento\Payment\Model\Config $paymentConfig,
-        array $data = []
-    ) {
-        parent::__construct($context, $data);
-        $this->paymentConfig = $paymentConfig;
-    }
-
-    /**
-     * Return credit card type
-     * 
-     * @return string
-     */
-    protected function getCcTypeName()
-    {
-        return null;
-    }
-
-    /**
-     * Prepare information specific to current payment method
-     * 
-     * @param null | array $transport
-     * @return \Magento\Framework\DataObject
-     */
-    protected function _prepareSpecificInformation($transport = null)
-    {
-        $transport = parent::_prepareSpecificInformation($transport);
-        $data = [];
-        $info = $this->getInfo();
-        if ($this->_appState->getAreaCode() === \Magento\Backend\App\Area\FrontNameResolver::AREA_CODE
-            && $info->getAdditionalInformation()
-        ) {
-            foreach ($info->getAdditionalInformation() as $field => $value) {
-                $beautifiedFieldName = ucwords(trim(preg_replace('/(?<=\\w)(?=[A-Z])/', " $1", $field)));
-                $data[__($beautifiedFieldName)->getText()] = $value;
-            }
-        }
-        return $transport->setData(array_merge($data, $transport->getData()));
-    }
-
-    /**
-     * Retrieve child block HTML
-     *
-     * @param   string $name
-     * @param   boolean $useCache
-     * @return  string
-     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
-     */
-    public function getChildHtml($name = '', $useCache = true)
-    {
-        $result = "";
-        $deviceData = $this->getRequest()->getPost('device_data');
-
-        if ($deviceData) {
-            $result .= "<input type='hidden' name='device_data' value='$deviceData'>";
-        }
-        return $result;
-    }
-}
diff --git a/app/code/Magento/Braintree/Block/PayPal/Shortcut.php b/app/code/Magento/Braintree/Block/PayPal/Shortcut.php
deleted file mode 100644
index 917265a948f7948aa86e1c1bd472c3176c9eacc6..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Block/PayPal/Shortcut.php
+++ /dev/null
@@ -1,242 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Block\PayPal;
-
-use Magento\Catalog\Block as CatalogBlock;
-use Magento\Braintree\Model\PaymentMethod\PayPal as PayPalPaymentMethod;
-use Magento\Braintree\Model\Config\PayPal as PayPalConfig;
-
-/**
- * Braintree Paypal express checkout shortcut link
- *
- */
-class Shortcut extends \Magento\Framework\View\Element\Template implements CatalogBlock\ShortcutInterface
-{
-    /**
-     * Key for the flag of mini cart
-     */
-    const MINI_CART_FLAG_KEY = 'is_in_mini_cart';
-
-    /**
-     * Default template name
-     */
-    const PAYPAL_SHORTCUT_TEMPLATE = 'PayPal/shortcut.phtml';
-
-    /**
-     * Shortcut alias
-     *
-     * @var string
-     */
-    protected $alias = '';
-
-    /**
-     * @var \Magento\Checkout\Model\Session
-     */
-    protected $checkoutSession;
-
-    /**
-     * @var \Magento\Framework\Math\Random
-     */
-    protected $mathRandom;
-
-    /**
-     * @var \Magento\Framework\Locale\ResolverInterface
-     */
-    protected $localeResolver;
-
-    /**
-     * @var PayPalConfig
-     */
-    protected $paypalConfig;
-
-    /**
-     * @var \Magento\Customer\Model\Session
-     */
-    protected $customerSession;
-
-    /**
-     * @var \Magento\Checkout\Helper\Data
-     */
-    protected $checkoutData;
-
-    /**
-     * @param \Magento\Framework\View\Element\Template\Context $context
-     * @param \Magento\Framework\Math\Random $mathRandom
-     * @param \Magento\Framework\Locale\ResolverInterface $localeResolver
-     * @param PayPalConfig $paypalConfig
-     * @param \Magento\Checkout\Model\Session $checkoutSession
-     * @param \Magento\Customer\Model\Session $customerSession
-     * @param \Magento\Checkout\Helper\Data $checkoutData
-     * @param array $data
-     * @SuppressWarnings(PHPMD.ExcessiveParameterList)
-     */
-    public function __construct(
-        \Magento\Framework\View\Element\Template\Context $context,
-        \Magento\Framework\Math\Random $mathRandom,
-        \Magento\Framework\Locale\ResolverInterface $localeResolver,
-        PayPalConfig $paypalConfig,
-        \Magento\Checkout\Model\Session $checkoutSession,
-        \Magento\Customer\Model\Session $customerSession,
-        \Magento\Checkout\Helper\Data $checkoutData,
-        array $data = []
-    ) {
-        parent::__construct($context, $data);
-        $this->mathRandom = $mathRandom;
-        $this->localeResolver = $localeResolver;
-        $this->paypalConfig = $paypalConfig;
-        $this->checkoutSession = $checkoutSession;
-        $this->customerSession = $customerSession;
-        $this->checkoutData = $checkoutData;
-        $this->setTemplate(self::PAYPAL_SHORTCUT_TEMPLATE);
-    }
-
-    /**
-     * @return bool
-     */
-    public function isInMiniCart()
-    {
-        return (bool)$this->getData(self::MINI_CART_FLAG_KEY);
-    }
-
-    /**
-     * @return string
-     */
-    public function getButtonDataUrl()
-    {
-        return $this->_urlBuilder->getUrl('braintree/paypal/getbuttondata');
-    }
-
-    /**
-     * Get shortcut alias
-     *
-     * @return string
-     * @codeCoverageIgnore
-     */
-    public function getAlias()
-    {
-        return $this->alias;
-    }
-
-    /**
-     * @return string
-     */
-    public function getClientToken()
-    {
-        return $this->paypalConfig->getClientToken();
-    }
-
-    /**
-     * @return float
-     */
-    public function getAmount()
-    {
-        return $this->checkoutSession->getQuote()->getBaseGrandTotal();
-    }
-
-    /**
-     * @return string
-     */
-    public function getReviewPageUrl()
-    {
-        return $this->_urlBuilder->getUrl('braintree/paypal/review', ['_secure' => true]);
-    }
-
-    /**
-     * @return null|string
-     */
-    public function getCurrency()
-    {
-        return $this->checkoutSession->getQuote()->getCurrency()->getBaseCurrencyCode();
-    }
-
-    /**
-     * @return string
-     */
-    public function getLocale()
-    {
-        return $this->localeResolver->getLocale();
-    }
-
-    /**
-     * @return string
-     */
-    public function getMerchantName()
-    {
-        return $this->paypalConfig->getMerchantNameOverride();
-    }
-
-    /**
-     * @return bool
-     */
-    public function enableBillingAddress()
-    {
-        return $this->paypalConfig->isBillingAddressEnabled();
-    }
-
-    /**
-     * Don't display the shortcut button if customer is not logged in and guest mode is not allowed
-     *
-     * @return bool
-     */
-    public function skipShortcutForGuest()
-    {
-        if ($this->customerSession->isLoggedIn()) {
-            return false;
-        }
-        if ($this->checkoutData->isAllowedGuestCheckout($this->checkoutSession->getQuote())) {
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * @return string
-     */
-    public function getContainerId()
-    {
-        if ($this->isInMiniCart()) {
-            return 'braintree_paypal_container_minicart';
-        } else {
-            return 'braintree_paypal_container' . $this->mathRandom->getRandomString(5);
-        }
-    }
-
-    /**
-     * @return string
-     */
-    public function getSubmitFormId()
-    {
-        if ($this->isInMiniCart()) {
-            return 'braintree_paypal_submit_form_minicart';
-        } else {
-            return 'braintree_paypal_submit_form' . $this->mathRandom->getRandomString(5);
-        }
-    }
-
-    /**
-     * @return string
-     */
-    public function getPaymentMethodNonceId()
-    {
-        if ($this->isInMiniCart()) {
-            return 'braintree_paypal_payment_method_nonce_minicart';
-        } else {
-            return 'braintree_paypal_payment_method_nonce' . $this->mathRandom->getRandomString(5);
-        }
-    }
-
-    /**
-     * @return string
-     */
-    public function getPaymentDetailsId()
-    {
-        if ($this->isInMiniCart()) {
-            return 'braintree_paypal_payment_details_minicart';
-        } else {
-            return 'braintree_paypal_payment_details' . $this->mathRandom->getRandomString(5);
-        }
-    }
-}
diff --git a/app/code/Magento/BraintreeTwo/Block/Payment.php b/app/code/Magento/Braintree/Block/Payment.php
similarity index 93%
rename from app/code/Magento/BraintreeTwo/Block/Payment.php
rename to app/code/Magento/Braintree/Block/Payment.php
index 3e152e4fd195a24d6c34f955045895db76583ce4..990aeb6bdfe7ce23acbf84328bf5c5b0df4a2b76 100644
--- a/app/code/Magento/BraintreeTwo/Block/Payment.php
+++ b/app/code/Magento/Braintree/Block/Payment.php
@@ -3,9 +3,9 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Block;
+namespace Magento\Braintree\Block;
 
-use Magento\BraintreeTwo\Model\Ui\ConfigProvider;
+use Magento\Braintree\Model\Ui\ConfigProvider;
 use Magento\Checkout\Model\ConfigProviderInterface;
 use Magento\Framework\View\Element\Template;
 use Magento\Framework\View\Element\Template\Context;
@@ -46,6 +46,7 @@ class Payment extends Template
         $config['code'] = $this->getCode();
         return json_encode($config, JSON_UNESCAPED_SLASHES);
     }
+
     /**
      * @return string
      */
diff --git a/app/code/Magento/BraintreeTwo/Block/Paypal/Button.php b/app/code/Magento/Braintree/Block/Paypal/Button.php
similarity index 95%
rename from app/code/Magento/BraintreeTwo/Block/Paypal/Button.php
rename to app/code/Magento/Braintree/Block/Paypal/Button.php
index 2b5113fe586cf5170d33e260ded224b754274449..7b4c97d95dfdcadfdd2c10d0709b0a73a37f3faa 100644
--- a/app/code/Magento/BraintreeTwo/Block/Paypal/Button.php
+++ b/app/code/Magento/Braintree/Block/Paypal/Button.php
@@ -3,15 +3,15 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Block\Paypal;
+namespace Magento\Braintree\Block\Paypal;
 
 use Magento\Checkout\Model\Session;
 use Magento\Catalog\Block\ShortcutInterface;
 use Magento\Framework\View\Element\Template;
 use Magento\Framework\Locale\ResolverInterface;
-use Magento\BraintreeTwo\Model\Ui\ConfigProvider;
+use Magento\Braintree\Model\Ui\ConfigProvider;
 use Magento\Framework\View\Element\Template\Context;
-use Magento\BraintreeTwo\Gateway\Config\PayPal\Config;
+use Magento\Braintree\Gateway\Config\PayPal\Config;
 use Magento\Payment\Model\MethodInterface;
 
 /**
diff --git a/app/code/Magento/BraintreeTwo/Block/Paypal/Checkout/Review.php b/app/code/Magento/Braintree/Block/Paypal/Checkout/Review.php
similarity index 82%
rename from app/code/Magento/BraintreeTwo/Block/Paypal/Checkout/Review.php
rename to app/code/Magento/Braintree/Block/Paypal/Checkout/Review.php
index a10dcc0ce2f6044f2d8060b63728fa42b3a4a1c5..982729ea6ed3a373a7f3883ef0f2f5a10d4693a9 100644
--- a/app/code/Magento/BraintreeTwo/Block/Paypal/Checkout/Review.php
+++ b/app/code/Magento/Braintree/Block/Paypal/Checkout/Review.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Block\Paypal\Checkout;
+namespace Magento\Braintree\Block\Paypal\Checkout;
 
 use Magento\Paypal\Block\Express;
 
@@ -17,7 +17,7 @@ class Review extends Express\Review
      *
      * @var string
      */
-    protected $_controllerPath = 'braintreetwo/paypal';
+    protected $_controllerPath = 'braintree/paypal';
 
     /**
      * Does not allow editing payment information as customer has gone through paypal flow already
diff --git a/app/code/Magento/BraintreeTwo/Controller/Adminhtml/Payment/GetNonce.php b/app/code/Magento/Braintree/Controller/Adminhtml/Payment/GetNonce.php
similarity index 50%
rename from app/code/Magento/BraintreeTwo/Controller/Adminhtml/Payment/GetNonce.php
rename to app/code/Magento/Braintree/Controller/Adminhtml/Payment/GetNonce.php
index ae63ed6e4bd3bd70681f6a0add0faa3467094015..1cf847803422452b9178cd3574f8c314d7db2cfb 100644
--- a/app/code/Magento/BraintreeTwo/Controller/Adminhtml/Payment/GetNonce.php
+++ b/app/code/Magento/Braintree/Controller/Adminhtml/Payment/GetNonce.php
@@ -3,12 +3,12 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Controller\Adminhtml\Payment;
+namespace Magento\Braintree\Controller\Adminhtml\Payment;
 
 
 /**
  * Class GetNonce
  */
-class GetNonce extends \Magento\BraintreeTwo\Controller\Payment\GetNonce
+class GetNonce extends \Magento\Braintree\Controller\Payment\GetNonce
 {
 }
diff --git a/app/code/Magento/BraintreeTwo/Controller/Adminhtml/Report/Index.php b/app/code/Magento/Braintree/Controller/Adminhtml/Report/Index.php
similarity index 89%
rename from app/code/Magento/BraintreeTwo/Controller/Adminhtml/Report/Index.php
rename to app/code/Magento/Braintree/Controller/Adminhtml/Report/Index.php
index e0f49a79501cf8ee0ce0beed95107b152e11f97d..c2aaa31829574df005d7595d55dcac73b8ea2db3 100644
--- a/app/code/Magento/BraintreeTwo/Controller/Adminhtml/Report/Index.php
+++ b/app/code/Magento/Braintree/Controller/Adminhtml/Report/Index.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Controller\Adminhtml\Report;
+namespace Magento\Braintree\Controller\Adminhtml\Report;
 
 use Magento\Backend\App\Action;
 use Magento\Backend\App\Action\Context;
@@ -20,7 +20,7 @@ class Index extends Action
      */
     protected $resultPageFactory;
 
-    const ADMIN_RESOURCE = 'Magento_BraintreeTwo::settlement_report';
+    const ADMIN_RESOURCE = 'Magento_Braintree::settlement_report';
 
     /**
      * @param Context $context
diff --git a/app/code/Magento/Braintree/Controller/Creditcard/AjaxSave.php b/app/code/Magento/Braintree/Controller/Creditcard/AjaxSave.php
deleted file mode 100644
index 0177988ea45ab3754d00528e7f4d5e1b3064f2da..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Controller/Creditcard/AjaxSave.php
+++ /dev/null
@@ -1,49 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Controller\Creditcard;
-
-use Magento\Framework\Controller\ResultFactory;
-
-class AjaxSave extends \Magento\Braintree\Controller\MyCreditCards
-{
-    /**
-     * Save Tax Rate via AJAX
-     *
-     * @return \Magento\Framework\Controller\Result\Json
-     */
-    public function execute()
-    {
-        try {
-            $this->vault->processNonce(
-                $this->getRequest()->getParam('nonce'),
-                $this->getRequest()->getParam('options'),
-                $this->getRequest()->getParam('billingAddress')
-            );
-            $this->messageManager->addSuccess(__('Credit card successfully added'));
-            $responseContent = [
-                'success' => true,
-                'error_message' => '',
-            ];
-        } catch (\Magento\Framework\Exception\LocalizedException $e) {
-            $responseContent = [
-                'success' => false,
-                'error_message' => __($e->getMessage()),
-            ];
-            $this->messageManager->addError(__($e->getMessage()));
-        } catch (\Exception $e) {
-            $responseContent = [
-                'success' => false,
-                'error_message' => __('Something went wrong while saving the card.'),
-            ];
-            $this->messageManager->addError(__('Something went wrong while saving the card.'));
-        }
-
-        /** @var \Magento\Framework\Controller\Result\Json $resultJson */
-        $resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON);
-        $resultJson->setData($responseContent);
-        return $resultJson;
-    }
-}
diff --git a/app/code/Magento/Braintree/Controller/Creditcard/Delete.php b/app/code/Magento/Braintree/Controller/Creditcard/Delete.php
deleted file mode 100644
index 2dd4c4f9b136b356ac6de35218d9c1c8bedeaecb..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Controller/Creditcard/Delete.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Controller\Creditcard;
-
-class Delete extends \Magento\Braintree\Controller\MyCreditCards
-{
-    /**
-     * Edit an existing credit card action
-     *
-     * @return \Magento\Framework\View\Result\Page|\Magento\Framework\Controller\Result\Redirect
-     */
-    public function execute()
-    {
-        if ($this->hasToken()) {
-            if (!$this->vault->storedCard($this->hasToken())) {
-                $this->messageManager->addError(__('Credit card does not exist'));
-                /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */
-                $resultRedirect = $this->resultRedirectFactory->create();
-                $resultRedirect->setPath('braintree/creditcard/index');
-                return $resultRedirect;
-            }
-
-            /** @var \Magento\Framework\View\Result\Page $resultPage */
-            $resultPage = $this->resultPageFactory->create();
-            if ($navigationBlock = $resultPage->getLayout()->getBlock('customer_account_navigation')) {
-                $navigationBlock->setActive('braintree/creditcard/index');
-            }
-            if ($block = $resultPage->getLayout()->getBlock('customer_creditcard_management')) {
-                $block->setRefererUrl($this->_redirect->getRefererUrl());
-            }
-            $resultPage->getConfig()->getTitle()->set(__('Delete Credit Card'));
-            return $resultPage;
-        } else {
-            /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */
-            $resultRedirect = $this->resultRedirectFactory->create();
-            $resultRedirect->setPath('braintree/creditcard/index');
-            return $resultRedirect;
-        }
-    }
-}
diff --git a/app/code/Magento/Braintree/Controller/Creditcard/DeleteConfirm.php b/app/code/Magento/Braintree/Controller/Creditcard/DeleteConfirm.php
deleted file mode 100644
index bef7c62f781895173744abc0ccd2e7e47f2c15cc..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Controller/Creditcard/DeleteConfirm.php
+++ /dev/null
@@ -1,50 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Controller\Creditcard;
-
-use \Braintree_Result_Error;
-
-class DeleteConfirm extends \Magento\Braintree\Controller\MyCreditCards
-{
-    /**
-     * Add errors from Braintree into customer session
-     *
-     * @param \Braintree_Result_Error $errors
-     * @return $this
-     */
-    protected function _addError($errors)
-    {
-        $messages = explode("\n", $errors->message);
-        foreach ($messages as $error) {
-            $this->messageManager->addError(__($error));
-        }
-        return $this;
-    }
-
-    /**
-     * Save a new credit card action
-     *
-     * @return \Magento\Framework\Controller\Result\Redirect
-     */
-    public function execute()
-    {
-        if ($token = $this->hasToken()) {
-            $result = $this->vault->deleteCard($token);
-            if (!$result) {
-                $this->messageManager->addError(__('There was error deleting the credit card'));
-            } elseif ($result->success) {
-                $this->messageManager->addSuccess(__('Credit card successfully deleted'));
-            } else {
-                $this->_addError($result);
-            }
-        }
-
-        /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */
-        $resultRedirect = $this->resultRedirectFactory->create();
-        $resultRedirect->setPath('braintree/creditcard/index');
-        return $resultRedirect;
-    }
-}
diff --git a/app/code/Magento/Braintree/Controller/Creditcard/Edit.php b/app/code/Magento/Braintree/Controller/Creditcard/Edit.php
deleted file mode 100644
index 864d53f55639bcad696e7ca7035c920af7ca52db..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Controller/Creditcard/Edit.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Controller\Creditcard;
-
-class Edit extends \Magento\Braintree\Controller\MyCreditCards
-{
-    /**
-     * Edit an existing credit card action
-     *
-     * @return \Magento\Framework\View\Result\Page|\Magento\Framework\Controller\Result\Redirect
-     */
-    public function execute()
-    {
-        if ($this->hasToken()) {
-            if (!$this->vault->storedCard($this->hasToken())) {
-                $this->messageManager->addError(__('Credit card does not exist'));
-                /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */
-                $resultRedirect = $this->resultRedirectFactory->create();
-                $resultRedirect->setPath('braintree/creditcard/index');
-                return $resultRedirect;
-            }
-
-            /** @var \Magento\Framework\View\Result\Page $resultPage */
-            $resultPage = $this->resultPageFactory->create();
-            if ($navigationBlock = $resultPage->getLayout()->getBlock('customer_account_navigation')) {
-                $navigationBlock->setActive('braintree/creditcard/index');
-            }
-            if ($block = $resultPage->getLayout()->getBlock('customer_creditcard_management')) {
-                $block->setRefererUrl($this->_redirect->getRefererUrl());
-            }
-            $resultPage->getConfig()->getTitle()->set(__('Edit Credit Card'));
-            return $resultPage;
-        } else {
-            /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */
-            $resultRedirect = $this->resultRedirectFactory->create();
-            $resultRedirect->setPath('braintree/creditcard/index');
-            return $resultRedirect;
-        }
-    }
-}
diff --git a/app/code/Magento/Braintree/Controller/Creditcard/Generate.php b/app/code/Magento/Braintree/Controller/Creditcard/Generate.php
deleted file mode 100644
index 7bfcdfde5b99270582a0dbeb798f89dee906fa60..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Controller/Creditcard/Generate.php
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Controller\Creditcard;
-
-use Magento\Framework\Controller\ResultFactory;
-
-class Generate extends \Magento\Braintree\Controller\MyCreditCards
-{
-    /**
-     * @var string $errorMessage
-     */
-    protected $errorMessage = 'Something went wrong while processing.';
-
-    /**
-     * Save Tax Rate via AJAX
-     *
-     * @return \Magento\Framework\Controller\Result\Json
-     */
-    public function execute()
-    {
-        try {
-            if ($this->hasToken()) {
-                $nonce = $this->vault->generatePaymentMethodToken($this->hasToken());
-                $responseContent = [
-                    'success' => true,
-                    'nonce' => $nonce,
-                    'error_message' => '',
-                ];
-            } else {
-                throw new \Magento\Framework\Exception\LocalizedException(__($this->errorMessage));
-            }
-        } catch (\Magento\Framework\Exception\LocalizedException $e) {
-            $responseContent = [
-                'success' => false,
-                'error_message' => __($e->getMessage()),
-            ];
-            $this->messageManager->addError(__($e->getMessage()));
-        } catch (\Exception $e) {
-            $responseContent = [
-                'success' => false,
-                'error_message' => __($this->errorMessage),
-            ];
-            $this->messageManager->addError(__($e->getMessage()));
-        }
-
-        /** @var \Magento\Framework\Controller\Result\Json $resultJson */
-        $resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON);
-        $resultJson->setData($responseContent);
-        return $resultJson;
-    }
-}
diff --git a/app/code/Magento/Braintree/Controller/Creditcard/Index.php b/app/code/Magento/Braintree/Controller/Creditcard/Index.php
deleted file mode 100644
index db240cda6fcc7c2f077c5263b5461981cc22b2e5..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Controller/Creditcard/Index.php
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Controller\Creditcard;
-
-class Index extends \Magento\Braintree\Controller\MyCreditCards
-{
-    /**
-     * Display a list of credit cards
-     *
-     * @return \Magento\Framework\View\Result\Page
-     */
-    public function execute()
-    {
-        /** @var \Magento\Framework\View\Result\Page $resultPage */
-        $resultPage = $this->resultPageFactory->create();
-        if ($navigationBlock = $resultPage->getLayout()->getBlock('customer_account_navigation')) {
-            $navigationBlock->setActive('braintree/creditcard/index');
-        }
-        if ($block = $resultPage->getLayout()->getBlock('customer_creditcard_management')) {
-            $block->setRefererUrl($this->_redirect->getRefererUrl());
-        }
-        $resultPage->getConfig()->getTitle()->set(__('My Credit Cards'));
-        return $resultPage;
-    }
-}
diff --git a/app/code/Magento/Braintree/Controller/Creditcard/NewCard.php b/app/code/Magento/Braintree/Controller/Creditcard/NewCard.php
deleted file mode 100644
index 000ba39e0ab21c4bfd5f26fec25745b2dce71591..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Controller/Creditcard/NewCard.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Controller\Creditcard;
-
-class NewCard extends \Magento\Braintree\Controller\MyCreditCards
-{
-    /**
-     *  New credit card form action
-     *
-     * @return \Magento\Framework\View\Result\Page
-     */
-    public function execute()
-    {
-        /** @var \Magento\Framework\View\Result\Page $resultPage */
-        $resultPage = $this->resultPageFactory->create();
-        if ($navigationBlock = $resultPage->getLayout()->getBlock('customer_account_navigation')) {
-            $navigationBlock->setActive('braintree/creditcard/index');
-        }
-        $resultPage->getConfig()->getTitle()->set(__('New Credit Card'));
-
-        return $resultPage;
-    }
-}
diff --git a/app/code/Magento/Braintree/Controller/Creditcard/Save.php b/app/code/Magento/Braintree/Controller/Creditcard/Save.php
deleted file mode 100644
index d51c3de282860c48a2d40be82794040015d0b5e6..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Controller/Creditcard/Save.php
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Controller\Creditcard;
-
-class Save extends \Magento\Braintree\Controller\MyCreditCards
-{
-    /**
-     * Save fallback action in case ajax fails
-     *
-     * @return \Magento\Framework\Controller\Result\Redirect
-     */
-    public function execute()
-    {
-        $this->messageManager->addError(__('There was error during saving card data'));
-        /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */
-        $resultRedirect = $this->resultRedirectFactory->create();
-        $resultRedirect->setPath($this->_redirect->getRefererUrl());
-        return $resultRedirect;
-    }
-}
diff --git a/app/code/Magento/Braintree/Controller/MyCreditCards.php b/app/code/Magento/Braintree/Controller/MyCreditCards.php
deleted file mode 100644
index 122edc79ca2a0697bddbe08f4a0c787039dce6c9..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Controller/MyCreditCards.php
+++ /dev/null
@@ -1,97 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Controller;
-
-use Magento\Framework\App\RequestInterface;
-use Magento\Customer\Model\Session;
-use Magento\Framework\View\Result\PageFactory;
-use Magento\Framework\App\Action\Context;
-use \Braintree_Result_Error;
-
-abstract class MyCreditCards extends \Magento\Framework\App\Action\Action
-{
-    /**
-     * @var \Magento\Customer\Model\Session
-     */
-    protected $customerSession;
-
-    /**
-     * @var \Magento\Braintree\Model\Config\Cc
-     */
-    protected $config;
-
-    /**
-     * @var \Magento\Braintree\Model\Vault
-     */
-    protected $vault;
-
-    /**
-     * @var PageFactory
-     */
-    protected $resultPageFactory;
-
-    /**
-     * @var \Magento\Customer\Model\Url
-     */
-    protected $customerUrl;
-
-    /**
-     * @param \Magento\Framework\App\Action\Context $context
-     * @param \Magento\Customer\Model\Session $customerSession
-     * @param PageFactory $resultPageFactory
-     * @param \Magento\Braintree\Model\Vault $vault
-     * @param \Magento\Braintree\Model\Config\Cc $config
-     * @param @param \Magento\Customer\Model\Url $customerUrl
-     */
-    public function __construct(
-        Context $context,
-        Session $customerSession,
-        PageFactory $resultPageFactory,
-        \Magento\Braintree\Model\Vault $vault,
-        \Magento\Braintree\Model\Config\Cc $config,
-        \Magento\Customer\Model\Url $customerUrl
-    ) {
-        $this->customerSession = $customerSession;
-        $this->resultPageFactory = $resultPageFactory;
-        $this->vault = $vault;
-        $this->config = $config;
-        $this->customerUrl = $customerUrl;
-        parent::__construct($context);
-    }
-
-    /**
-     * Check customer authentication
-     *
-     * @param RequestInterface $request
-     * @return \Magento\Framework\Controller\Result\Redirect|\Magento\Framework\App\ResponseInterface
-     */
-    public function dispatch(RequestInterface $request)
-    {
-        $loginUrl = $this->customerUrl->getLoginUrl();
-        if (!$this->customerSession->authenticate($loginUrl)) {
-            $this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true);
-        }
-        if (!$this->config->useVault()) {
-            $this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true);
-            /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */
-            $resultRedirect = $this->resultRedirectFactory->create();
-            $resultRedirect->setPath('noRoute');
-            return $resultRedirect;
-        }
-
-        return parent::dispatch($request);
-    }
-
-    /**
-     * If token exists
-     *
-     * @return boolean
-     */
-    protected function hasToken()
-    {
-        return $this->getRequest()->getParam('token');
-    }
-}
diff --git a/app/code/Magento/Braintree/Controller/PayPal.php b/app/code/Magento/Braintree/Controller/PayPal.php
deleted file mode 100644
index e24bd47e8d322c64938c7ea82684d9b59d08c189..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Controller/PayPal.php
+++ /dev/null
@@ -1,138 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Controller;
-
-use Magento\Framework\App\RequestInterface;
-
-/**
- * Braintree PayPal Checkout Controller
- */
-abstract class PayPal extends \Magento\Framework\App\Action\Action
-{
-    /**
-     * @var \Magento\Braintree\Model\CheckoutFactory
-     */
-    protected $checkoutFactory;
-
-    /**
-     * @var \Magento\Quote\Model\Quote
-     */
-    protected $quote = false;
-
-    /**
-     * @var \Magento\Customer\Model\Session
-     */
-    protected $customerSession;
-
-    /**
-     * @var \Magento\Checkout\Model\Session
-     */
-    protected $checkoutSession;
-
-    /**
-     * @var \Magento\Braintree\Model\Config\PayPal
-     */
-    protected $braintreePayPalConfig;
-
-    /**
-     * @var \Magento\Paypal\Model\Config
-     */
-    protected $paypalConfig;
-
-    /**
-     * @var \Magento\Braintree\Model\Checkout
-     */
-    protected $checkout;
-
-    /**
-     * @param \Magento\Framework\App\Action\Context $context
-     * @param \Magento\Customer\Model\Session $customerSession
-     * @param \Magento\Checkout\Model\Session $checkoutSession
-     * @param \Magento\Braintree\Model\Config\PayPal $braintreePayPalConfig
-     * @param \Magento\Paypal\Model\Config $paypalConfig
-     * @param \Magento\Braintree\Model\CheckoutFactory $checkoutFactory
-     */
-    public function __construct(
-        \Magento\Framework\App\Action\Context $context,
-        \Magento\Customer\Model\Session $customerSession,
-        \Magento\Checkout\Model\Session $checkoutSession,
-        \Magento\Braintree\Model\Config\PayPal $braintreePayPalConfig,
-        \Magento\Paypal\Model\Config $paypalConfig,
-        \Magento\Braintree\Model\CheckoutFactory $checkoutFactory
-    ) {
-        parent::__construct($context);
-        $this->customerSession = $customerSession;
-        $this->checkoutSession = $checkoutSession;
-        $this->braintreePayPalConfig = $braintreePayPalConfig;
-        $this->paypalConfig = $paypalConfig;
-        $this->checkoutFactory = $checkoutFactory;
-    }
-
-    /**
-     * Check whether payment method is enabled
-     *
-     * @param RequestInterface $request
-     * @return \Magento\Framework\Controller\Result\Redirect|\Magento\Framework\App\ResponseInterface
-     */
-    public function dispatch(RequestInterface $request)
-    {
-        if (!$this->braintreePayPalConfig->isActive() || !$this->braintreePayPalConfig->isShortcutCheckoutEnabled()) {
-            $this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true);
-            /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */
-            $resultRedirect = $this->resultRedirectFactory->create();
-            $resultRedirect->setPath('noRoute');
-            return $resultRedirect;
-        }
-
-        return parent::dispatch($request);
-    }
-
-    /**
-     * Instantiate quote and checkout
-     *
-     * @return void
-     * @throws \Magento\Framework\Exception\LocalizedException
-     */
-    protected function initCheckout()
-    {
-        $quote = $this->getQuote();
-        if (!$quote->hasItems() || $quote->getHasError()) {
-            $this->getResponse()->setStatusHeader(403, '1.1', 'Forbidden');
-            throw new \Magento\Framework\Exception\LocalizedException(__('We can\'t initialize checkout.'));
-        }
-    }
-
-    /**
-     * Return checkout quote object
-     *
-     * @return \Magento\Quote\Model\Quote
-     */
-    protected function getQuote()
-    {
-        if (!$this->quote) {
-            $this->quote = $this->checkoutSession->getQuote();
-        }
-        return $this->quote;
-    }
-
-    /**
-     * @return \Magento\Braintree\Model\Checkout
-     */
-    protected function getCheckout()
-    {
-        if (!$this->checkout) {
-            $this->checkout = $this->checkoutFactory->create(
-                [
-                    'params' => [
-                        'quote' => $this->checkoutSession->getQuote(),
-                        'config' => $this->paypalConfig,
-                    ],
-                ]
-            );
-        }
-        return $this->checkout;
-    }
-}
diff --git a/app/code/Magento/Braintree/Controller/PayPal/PlaceOrder.php b/app/code/Magento/Braintree/Controller/PayPal/PlaceOrder.php
deleted file mode 100644
index 45041a25ef04eca3ba2ddee4e4b56f957c07cd8c..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Controller/PayPal/PlaceOrder.php
+++ /dev/null
@@ -1,88 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Controller\PayPal;
-
-use Magento\Framework\Controller\ResultFactory;
-
-class PlaceOrder extends \Magento\Braintree\Controller\PayPal
-{
-    /**
-     * @var \Magento\Checkout\Api\AgreementsValidatorInterface
-     */
-    protected $agreementsValidator;
-
-    /**
-     * @param \Magento\Framework\App\Action\Context $context
-     * @param \Magento\Customer\Model\Session $customerSession
-     * @param \Magento\Checkout\Model\Session $checkoutSession
-     * @param \Magento\Braintree\Model\Config\PayPal $braintreePayPalConfig
-     * @param \Magento\Paypal\Model\Config $paypalConfig
-     * @param \Magento\Braintree\Model\CheckoutFactory $checkoutFactory
-     * @param \Magento\Checkout\Api\AgreementsValidatorInterface $agreementsValidator
-     */
-    public function __construct(
-        \Magento\Framework\App\Action\Context $context,
-        \Magento\Customer\Model\Session $customerSession,
-        \Magento\Checkout\Model\Session $checkoutSession,
-        \Magento\Braintree\Model\Config\PayPal $braintreePayPalConfig,
-        \Magento\Paypal\Model\Config $paypalConfig,
-        \Magento\Braintree\Model\CheckoutFactory $checkoutFactory,
-        \Magento\Checkout\Api\AgreementsValidatorInterface $agreementsValidator
-    ) {
-        $this->agreementsValidator = $agreementsValidator;
-        parent::__construct(
-            $context,
-            $customerSession,
-            $checkoutSession,
-            $braintreePayPalConfig,
-            $paypalConfig,
-            $checkoutFactory
-        );
-    }
-
-    /**
-     * Submit the order
-     *
-     * @return \Magento\Framework\Controller\Result\Redirect
-     */
-    public function execute()
-    {
-        try {
-            if (!$this->agreementsValidator->isValid(array_keys($this->getRequest()->getPost('agreement', [])))) {
-                throw new \Magento\Framework\Exception\LocalizedException(
-                    __('Please agree to all the terms and conditions before placing the order.')
-                );
-            }
-            $this->initCheckout();
-            $this->getCheckout()->place(null);
-
-            // prepare session to success or cancellation page
-            $this->checkoutSession->clearHelperData();
-
-            // "last successful quote"
-            $quoteId = $this->getQuote()->getId();
-            $this->checkoutSession->setLastQuoteId($quoteId)->setLastSuccessQuoteId($quoteId);
-
-            // an order may be created
-            $order = $this->getCheckout()->getOrder();
-            if ($order) {
-                $this->checkoutSession->setLastOrderId($order->getId())
-                    ->setLastRealOrderId($order->getIncrementId());
-            }
-
-            /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */
-            $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
-            return $resultRedirect->setPath('checkout/onepage/success');
-        } catch (\Magento\Framework\Exception\LocalizedException $e) {
-            $this->messageManager->addExceptionMessage($e, $e->getMessage());
-        } catch (\Exception $e) {
-            $this->messageManager->addExceptionMessage($e, __('We can\'t place the order.'));
-        }
-        /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */
-        $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
-        return $resultRedirect->setPath('checkout/cart');
-    }
-}
diff --git a/app/code/Magento/Braintree/Controller/PayPal/Review.php b/app/code/Magento/Braintree/Controller/PayPal/Review.php
deleted file mode 100644
index ef01f89b38e11dc78fe6895dd87e5370bb856eb0..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Controller/PayPal/Review.php
+++ /dev/null
@@ -1,103 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Controller\PayPal;
-
-use Magento\Customer\Model\Session;
-use Magento\Framework\App\Action\Context;
-use Magento\Framework\Controller\ResultFactory;
-use Magento\Braintree\Model\PaymentMethod\PayPal;
-
-class Review extends \Magento\Braintree\Controller\PayPal
-{
-    /**
-     * @var \Magento\Framework\Json\Helper\Data
-     */
-    protected $jsonHelper;
-
-    /**
-     * @param \Magento\Framework\App\Action\Context $context
-     * @param \Magento\Customer\Model\Session $customerSession
-     * @param \Magento\Checkout\Model\Session $checkoutSession
-     * @param \Magento\Braintree\Model\Config\PayPal $braintreePayPalConfig
-     * @param \Magento\Paypal\Model\Config $paypalConfig
-     * @param \Magento\Braintree\Model\CheckoutFactory $checkoutFactory
-     * @param \Magento\Framework\Json\Helper\Data $jsonHelper
-     */
-    public function __construct(
-        Context $context,
-        Session $customerSession,
-        \Magento\Checkout\Model\Session $checkoutSession,
-        \Magento\Braintree\Model\Config\PayPal $braintreePayPalConfig,
-        \Magento\Paypal\Model\Config $paypalConfig,
-        \Magento\Braintree\Model\CheckoutFactory $checkoutFactory,
-        \Magento\Framework\Json\Helper\Data $jsonHelper
-    ) {
-        parent::__construct(
-            $context,
-            $customerSession,
-            $checkoutSession,
-            $braintreePayPalConfig,
-            $paypalConfig,
-            $checkoutFactory
-        );
-        $this->jsonHelper = $jsonHelper;
-    }
-
-    /**
-     * @return $this|\Magento\Framework\View\Result\Page
-     */
-    public function execute()
-    {
-        $paymentMethodNonce = $this->getRequest()->getParam('payment_method_nonce');
-        $details = $this->getRequest()->getParam('details');
-        if (!empty($details)) {
-            $details = $this->jsonHelper->jsonDecode($details);
-        }
-        try {
-            $this->initCheckout();
-
-            if ($paymentMethodNonce && $details) {
-                if (!$this->braintreePayPalConfig->isBillingAddressEnabled()) {
-                    unset($details['billingAddress']);
-                }
-                $this->getCheckout()->initializeQuoteForReview($paymentMethodNonce, $details);
-                $paymentMethod = $this->getQuote()->getPayment()->getMethodInstance();
-                $paymentMethod->validate();
-            } else {
-                $paymentMethod = $this->getQuote()->getPayment()->getMethodInstance();
-                if (!$paymentMethod || $paymentMethod->getCode() !== PayPal::METHOD_CODE) {
-                    $this->messageManager->addErrorMessage(
-                        __('Incorrect payment method.')
-                    );
-
-                    /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */
-                    $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
-                    return $resultRedirect->setPath('checkout/cart');
-                }
-                $this->getQuote()->setMayEditShippingMethod(true);
-            }
-
-            /** @var \Magento\Framework\View\Result\Page $resultPage */
-            $resultPage = $this->resultFactory->create(ResultFactory::TYPE_PAGE);
-            /** @var \Magento\Braintree\Block\Checkout\Review $reviewBlock */
-            $reviewBlock = $resultPage->getLayout()->getBlock('braintree.paypal.review');
-            $reviewBlock->setQuote($this->getQuote());
-            $reviewBlock->getChildBlock('shipping_method')->setQuote($this->getQuote());
-            return $resultPage;
-        } catch (\Magento\Framework\Exception\LocalizedException $e) {
-            $this->messageManager->addExceptionMessage($e, $e->getMessage());
-        } catch (\Exception $e) {
-            $this->messageManager->addExceptionMessage(
-                $e,
-                __('We can\'t initialize checkout review.')
-            );
-        }
-
-        /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */
-        $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
-        return $resultRedirect->setPath('checkout/cart');
-    }
-}
diff --git a/app/code/Magento/Braintree/Controller/PayPal/SaveShippingMethod.php b/app/code/Magento/Braintree/Controller/PayPal/SaveShippingMethod.php
deleted file mode 100644
index d8041b7186ea4bb786a7827cd3e34595f6aaf5ba..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Controller/PayPal/SaveShippingMethod.php
+++ /dev/null
@@ -1,48 +0,0 @@
-<?php
-/**
- *
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Controller\PayPal;
-
-use Magento\Framework\Controller\ResultFactory;
-
-class SaveShippingMethod extends \Magento\Braintree\Controller\PayPal
-{
-    /**
-     * Update shipping method (combined action for ajax and regular request)
-     *
-     * @return void
-     */
-    public function execute()
-    {
-        try {
-            $isAjax = $this->getRequest()->getParam('isAjax');
-            $this->initCheckout();
-            $this->getCheckout()->updateShippingMethod($this->getRequest()->getParam('shipping_method'));
-            if ($isAjax) {
-                /** @var \Magento\Framework\View\Result\Page $response */
-                $response = $this->resultFactory->create(ResultFactory::TYPE_PAGE);
-                $layout = $response->addHandle('paypal_express_review_details')->getLayout();
-
-                $response = $layout->getBlock('page.block')->toHtml();
-                $this->getResponse()->setBody($response);
-                return;
-            }
-        } catch (\Magento\Framework\Exception\LocalizedException $e) {
-            $this->messageManager->addExceptionMessage($e, $e->getMessage());
-        } catch (\Exception $e) {
-            $this->messageManager->addExceptionMessage($e, __('We can\'t update shipping method.'));
-        }
-        if ($isAjax) {
-            $this->getResponse()->setBody(
-                '<script>window.location.href = '
-                . $this->_url->getUrl('*/*/review', ['_secure' => true])
-                . ';</script>'
-            );
-        } else {
-            $this->_redirect('*/*/review', ['_secure' => true]);
-        }
-    }
-}
diff --git a/app/code/Magento/BraintreeTwo/Controller/Payment/GetNonce.php b/app/code/Magento/Braintree/Controller/Payment/GetNonce.php
similarity index 95%
rename from app/code/Magento/BraintreeTwo/Controller/Payment/GetNonce.php
rename to app/code/Magento/Braintree/Controller/Payment/GetNonce.php
index cef49a7cbd5d43383b336c7064b0ba1a2c7250bd..d381f5da173967521622da10d2e098622661bc6f 100644
--- a/app/code/Magento/BraintreeTwo/Controller/Payment/GetNonce.php
+++ b/app/code/Magento/Braintree/Controller/Payment/GetNonce.php
@@ -3,9 +3,9 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Controller\Payment;
+namespace Magento\Braintree\Controller\Payment;
 
-use Magento\BraintreeTwo\Gateway\Command\GetPaymentNonceCommand;
+use Magento\Braintree\Gateway\Command\GetPaymentNonceCommand;
 use Magento\Framework\App\Action\Action;
 use Magento\Framework\App\Action\Context;
 use Magento\Framework\Controller\ResultFactory;
diff --git a/app/code/Magento/BraintreeTwo/Controller/Paypal/AbstractAction.php b/app/code/Magento/Braintree/Controller/Paypal/AbstractAction.php
similarity index 94%
rename from app/code/Magento/BraintreeTwo/Controller/Paypal/AbstractAction.php
rename to app/code/Magento/Braintree/Controller/Paypal/AbstractAction.php
index d22e8eb10aa437d31d8561a64d98fc7ac50cb0ea..fa89f93945ac76c3bb833b4e2c5bbbd22c543019 100644
--- a/app/code/Magento/BraintreeTwo/Controller/Paypal/AbstractAction.php
+++ b/app/code/Magento/Braintree/Controller/Paypal/AbstractAction.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Controller\Paypal;
+namespace Magento\Braintree\Controller\Paypal;
 
 use Magento\Checkout\Model\Session;
 use Magento\Framework\App\Action\Action;
@@ -11,7 +11,7 @@ use Magento\Framework\App\Action\Context;
 use Magento\Quote\Api\Data\CartInterface;
 use Magento\Framework\App\RequestInterface;
 use Magento\Framework\Controller\Result\Redirect;
-use Magento\BraintreeTwo\Gateway\Config\PayPal\Config;
+use Magento\Braintree\Gateway\Config\PayPal\Config;
 
 /**
  * Abstract class AbstractAction
diff --git a/app/code/Magento/BraintreeTwo/Controller/Paypal/PlaceOrder.php b/app/code/Magento/Braintree/Controller/Paypal/PlaceOrder.php
similarity index 91%
rename from app/code/Magento/BraintreeTwo/Controller/Paypal/PlaceOrder.php
rename to app/code/Magento/Braintree/Controller/Paypal/PlaceOrder.php
index 17d89bf123bd53d5f10caf803bd6998c19ab3d26..0c1cc9b179f25b92a3ad9393269d02c6ea7896f5 100644
--- a/app/code/Magento/BraintreeTwo/Controller/Paypal/PlaceOrder.php
+++ b/app/code/Magento/Braintree/Controller/Paypal/PlaceOrder.php
@@ -3,14 +3,14 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Controller\Paypal;
+namespace Magento\Braintree\Controller\Paypal;
 
 use Magento\Checkout\Model\Session;
 use Magento\Framework\App\Action\Context;
-use Magento\BraintreeTwo\Model\Paypal\Helper;
+use Magento\Braintree\Model\Paypal\Helper;
 use Magento\Framework\Controller\ResultFactory;
 use Magento\Framework\Exception\LocalizedException;
-use Magento\BraintreeTwo\Gateway\Config\PayPal\Config;
+use Magento\Braintree\Gateway\Config\PayPal\Config;
 
 /**
  * Class PlaceOrder
@@ -40,7 +40,6 @@ class PlaceOrder extends AbstractAction
         $this->orderPlace = $orderPlace;
     }
 
-
     /**
      * @inheritdoc
      * @throws LocalizedException
diff --git a/app/code/Magento/BraintreeTwo/Controller/Paypal/Review.php b/app/code/Magento/Braintree/Controller/Paypal/Review.php
similarity index 89%
rename from app/code/Magento/BraintreeTwo/Controller/Paypal/Review.php
rename to app/code/Magento/Braintree/Controller/Paypal/Review.php
index 9b951a15109640c9bb422818ed9a4f2d9e67338b..5531de362c78a43325800dc542b9d0b5c61644e1 100644
--- a/app/code/Magento/BraintreeTwo/Controller/Paypal/Review.php
+++ b/app/code/Magento/Braintree/Controller/Paypal/Review.php
@@ -3,13 +3,13 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Controller\Paypal;
+namespace Magento\Braintree\Controller\Paypal;
 
 use Magento\Checkout\Model\Session;
 use Magento\Framework\App\Action\Context;
 use Magento\Framework\Controller\ResultFactory;
-use Magento\BraintreeTwo\Gateway\Config\PayPal\Config;
-use Magento\BraintreeTwo\Model\Paypal\Helper\QuoteUpdater;
+use Magento\Braintree\Gateway\Config\PayPal\Config;
+use Magento\Braintree\Model\Paypal\Helper\QuoteUpdater;
 
 /**
  * Class Review
@@ -63,8 +63,8 @@ class Review extends AbstractAction
             /** @var \Magento\Framework\View\Result\Page $resultPage */
             $resultPage = $this->resultFactory->create(ResultFactory::TYPE_PAGE);
 
-            /** @var \Magento\BraintreeTwo\Block\Paypal\Checkout\Review $reviewBlock */
-            $reviewBlock = $resultPage->getLayout()->getBlock('braintreetwo.paypal.review');
+            /** @var \Magento\Braintree\Block\Paypal\Checkout\Review $reviewBlock */
+            $reviewBlock = $resultPage->getLayout()->getBlock('braintree.paypal.review');
 
             $reviewBlock->setQuote($quote);
             $reviewBlock->getChildBlock('shipping_method')->setData('quote', $quote);
diff --git a/app/code/Magento/BraintreeTwo/Controller/Paypal/SaveShippingMethod.php b/app/code/Magento/Braintree/Controller/Paypal/SaveShippingMethod.php
similarity index 92%
rename from app/code/Magento/BraintreeTwo/Controller/Paypal/SaveShippingMethod.php
rename to app/code/Magento/Braintree/Controller/Paypal/SaveShippingMethod.php
index 9f7ac9023e1e3dd7943033989cb063dba2aa9c2e..a170365b04d34a484b1913096bf5335f186068cf 100644
--- a/app/code/Magento/BraintreeTwo/Controller/Paypal/SaveShippingMethod.php
+++ b/app/code/Magento/Braintree/Controller/Paypal/SaveShippingMethod.php
@@ -3,14 +3,14 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Controller\Paypal;
+namespace Magento\Braintree\Controller\Paypal;
 
 use Magento\Checkout\Model\Session;
 use Magento\Framework\View\Result\Page;
 use Magento\Framework\App\Action\Context;
 use Magento\Framework\Controller\ResultFactory;
-use Magento\BraintreeTwo\Gateway\Config\PayPal\Config;
-use Magento\BraintreeTwo\Model\Paypal\Helper\ShippingMethodUpdater;
+use Magento\Braintree\Gateway\Config\PayPal\Config;
+use Magento\Braintree\Model\Paypal\Helper\ShippingMethodUpdater;
 
 /**
  * Class SaveShippingMethod
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Command/CaptureStrategyCommand.php b/app/code/Magento/Braintree/Gateway/Command/CaptureStrategyCommand.php
similarity index 97%
rename from app/code/Magento/BraintreeTwo/Gateway/Command/CaptureStrategyCommand.php
rename to app/code/Magento/Braintree/Gateway/Command/CaptureStrategyCommand.php
index d4c152f98eaa21e28c99b0840b7bf1761af73999..73a058794d4c8fc6a6c100c283af7c7f30417674 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Command/CaptureStrategyCommand.php
+++ b/app/code/Magento/Braintree/Gateway/Command/CaptureStrategyCommand.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Command;
+namespace Magento\Braintree\Gateway\Command;
 
 use Magento\Framework\Api\FilterBuilder;
 use Magento\Framework\Api\SearchCriteriaBuilder;
@@ -11,7 +11,7 @@ use Magento\Payment\Gateway\Command;
 use Magento\Payment\Gateway\Command\CommandPoolInterface;
 use Magento\Payment\Gateway\CommandInterface;
 use Magento\Payment\Gateway\Helper\ContextHelper;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 use Magento\Sales\Api\Data\OrderPaymentInterface;
 use Magento\Sales\Api\TransactionRepositoryInterface;
 use Magento\Sales\Api\Data\TransactionInterface;
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Command/GetPaymentNonceCommand.php b/app/code/Magento/Braintree/Gateway/Command/GetPaymentNonceCommand.php
similarity index 91%
rename from app/code/Magento/BraintreeTwo/Gateway/Command/GetPaymentNonceCommand.php
rename to app/code/Magento/Braintree/Gateway/Command/GetPaymentNonceCommand.php
index dea64cafb6f6d35b1517ba8ac8fb3f15b291a31d..0ede6fcb719f741868977aa4b561f06870be83ab 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Command/GetPaymentNonceCommand.php
+++ b/app/code/Magento/Braintree/Gateway/Command/GetPaymentNonceCommand.php
@@ -4,12 +4,12 @@
  * See COPYING.txt for license details.
  */
 
-namespace Magento\BraintreeTwo\Gateway\Command;
+namespace Magento\Braintree\Gateway\Command;
 
 use Exception;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
-use Magento\BraintreeTwo\Gateway\Validator\PaymentNonceResponseValidator;
-use Magento\BraintreeTwo\Model\Adapter\BraintreeAdapter;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Validator\PaymentNonceResponseValidator;
+use Magento\Braintree\Model\Adapter\BraintreeAdapter;
 use Magento\Payment\Gateway\Command;
 use Magento\Payment\Gateway\Command\Result\ArrayResultFactory;
 use Magento\Payment\Gateway\CommandInterface;
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Config/CanVoidHandler.php b/app/code/Magento/Braintree/Gateway/Config/CanVoidHandler.php
similarity index 90%
rename from app/code/Magento/BraintreeTwo/Gateway/Config/CanVoidHandler.php
rename to app/code/Magento/Braintree/Gateway/Config/CanVoidHandler.php
index 4129be918c257e5636a6b877f09e63b2a0eb544e..1c988d81a6d905af5e0eec13437a6f7c2ccb9e4d 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Config/CanVoidHandler.php
+++ b/app/code/Magento/Braintree/Gateway/Config/CanVoidHandler.php
@@ -3,9 +3,9 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Config;
+namespace Magento\Braintree\Gateway\Config;
 
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 use Magento\Payment\Gateway\Config\ValueHandlerInterface;
 use Magento\Sales\Model\Order\Payment;
 
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Config/Config.php b/app/code/Magento/Braintree/Gateway/Config/Config.php
similarity index 96%
rename from app/code/Magento/BraintreeTwo/Gateway/Config/Config.php
rename to app/code/Magento/Braintree/Gateway/Config/Config.php
index d731c346295e79c37c072c9803a413e92e30a7c6..39b20fdf888bd1de0419ccc6c2c25a71ee028ce4 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Config/Config.php
+++ b/app/code/Magento/Braintree/Gateway/Config/Config.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Config;
+namespace Magento\Braintree\Gateway\Config;
 
 /**
  * Class Config
@@ -27,8 +27,8 @@ class Config extends \Magento\Payment\Gateway\Config\Config
     const KEY_VERIFY_SPECIFIC = 'verify_specific_countries';
     const VALUE_3DSECURE_ALL = 0;
     const CODE_3DSECURE = 'three_d_secure';
-    const KEY_KOUNT_MERCHANT_ID = 'kount_merchant_id';
-    const FRAUD_PROTECTION = 'fraud_protection';
+    const KEY_KOUNT_MERCHANT_ID = 'kount_id';
+    const FRAUD_PROTECTION = 'fraudprotection';
 
     /**
      * Return the country specific card type config
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Config/PayPal/Config.php b/app/code/Magento/Braintree/Gateway/Config/PayPal/Config.php
similarity index 96%
rename from app/code/Magento/BraintreeTwo/Gateway/Config/PayPal/Config.php
rename to app/code/Magento/Braintree/Gateway/Config/PayPal/Config.php
index de73c472aeda8344750d1a62f73287c38d85ee46..9b3c271a9213a4719a5c596cca27e85cb55d0e66 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Config/PayPal/Config.php
+++ b/app/code/Magento/Braintree/Gateway/Config/PayPal/Config.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Config\PayPal;
+namespace Magento\Braintree\Gateway\Config\PayPal;
 
 /**
  * Class Config
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Helper/SubjectReader.php b/app/code/Magento/Braintree/Gateway/Helper/SubjectReader.php
similarity index 98%
rename from app/code/Magento/BraintreeTwo/Gateway/Helper/SubjectReader.php
rename to app/code/Magento/Braintree/Gateway/Helper/SubjectReader.php
index b9bd4538bef579a1afdb56a16333523e7ff143d7..83c43342a427bb4db3717336efdcefe7ffba2655 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Helper/SubjectReader.php
+++ b/app/code/Magento/Braintree/Gateway/Helper/SubjectReader.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Helper;
+namespace Magento\Braintree\Gateway\Helper;
 
 use Braintree\Transaction;
 use Magento\Quote\Model\Quote;
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Http/Client/AbstractTransaction.php b/app/code/Magento/Braintree/Gateway/Http/Client/AbstractTransaction.php
similarity index 94%
rename from app/code/Magento/BraintreeTwo/Gateway/Http/Client/AbstractTransaction.php
rename to app/code/Magento/Braintree/Gateway/Http/Client/AbstractTransaction.php
index 3e2fb25881286a97b394f3b6f1ccf1330cd72baf..001bb9a355d43004ab5a80bb2ff4ba87b90c605e 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Http/Client/AbstractTransaction.php
+++ b/app/code/Magento/Braintree/Gateway/Http/Client/AbstractTransaction.php
@@ -4,9 +4,9 @@
  * See COPYING.txt for license details.
  */
 
-namespace Magento\BraintreeTwo\Gateway\Http\Client;
+namespace Magento\Braintree\Gateway\Http\Client;
 
-use Magento\BraintreeTwo\Model\Adapter\BraintreeAdapter;
+use Magento\Braintree\Model\Adapter\BraintreeAdapter;
 use Magento\Payment\Gateway\Http\ClientException;
 use Magento\Payment\Gateway\Http\ClientInterface;
 use Magento\Payment\Gateway\Http\TransferInterface;
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Http/Client/TransactionRefund.php b/app/code/Magento/Braintree/Gateway/Http/Client/TransactionRefund.php
similarity index 81%
rename from app/code/Magento/BraintreeTwo/Gateway/Http/Client/TransactionRefund.php
rename to app/code/Magento/Braintree/Gateway/Http/Client/TransactionRefund.php
index 2f4110cf07abc5f8b0bfc9cc0d5fd68869eb5603..1729ea56da591b1e8cce32911430c21b0853e240 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Http/Client/TransactionRefund.php
+++ b/app/code/Magento/Braintree/Gateway/Http/Client/TransactionRefund.php
@@ -3,9 +3,9 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Http\Client;
+namespace Magento\Braintree\Gateway\Http\Client;
 
-use Magento\BraintreeTwo\Gateway\Request\PaymentDataBuilder;
+use Magento\Braintree\Gateway\Request\PaymentDataBuilder;
 
 class TransactionRefund extends AbstractTransaction
 {
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Http/Client/TransactionSale.php b/app/code/Magento/Braintree/Gateway/Http/Client/TransactionSale.php
similarity index 86%
rename from app/code/Magento/BraintreeTwo/Gateway/Http/Client/TransactionSale.php
rename to app/code/Magento/Braintree/Gateway/Http/Client/TransactionSale.php
index f906e22fa9629a09d0b3bbf6831ec18aea6733f0..30c98639f3aadb237c80aec6b0ee39ed3d0d8622 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Http/Client/TransactionSale.php
+++ b/app/code/Magento/Braintree/Gateway/Http/Client/TransactionSale.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Http\Client;
+namespace Magento\Braintree\Gateway\Http\Client;
 
 /**
  * Class TransactionSale
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Http/Client/TransactionSubmitForSettlement.php b/app/code/Magento/Braintree/Gateway/Http/Client/TransactionSubmitForSettlement.php
similarity index 73%
rename from app/code/Magento/BraintreeTwo/Gateway/Http/Client/TransactionSubmitForSettlement.php
rename to app/code/Magento/Braintree/Gateway/Http/Client/TransactionSubmitForSettlement.php
index 36615c32780e05d96ee24d08482bd2da0489b44f..828e5d4d362b780e9402826dc1470aecd3810599 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Http/Client/TransactionSubmitForSettlement.php
+++ b/app/code/Magento/Braintree/Gateway/Http/Client/TransactionSubmitForSettlement.php
@@ -3,10 +3,10 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Http\Client;
+namespace Magento\Braintree\Gateway\Http\Client;
 
-use Magento\BraintreeTwo\Gateway\Request\CaptureDataBuilder;
-use Magento\BraintreeTwo\Gateway\Request\PaymentDataBuilder;
+use Magento\Braintree\Gateway\Request\CaptureDataBuilder;
+use Magento\Braintree\Gateway\Request\PaymentDataBuilder;
 
 /**
  * Class TransactionSubmitForSettlement
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Http/Client/TransactionVoid.php b/app/code/Magento/Braintree/Gateway/Http/Client/TransactionVoid.php
similarity index 88%
rename from app/code/Magento/BraintreeTwo/Gateway/Http/Client/TransactionVoid.php
rename to app/code/Magento/Braintree/Gateway/Http/Client/TransactionVoid.php
index cba4c4584b0d4e85e56cf78a3c804b2cb58150b6..2354f196d6d4c79c95ad1f0fb56cd1d4ec51582f 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Http/Client/TransactionVoid.php
+++ b/app/code/Magento/Braintree/Gateway/Http/Client/TransactionVoid.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Http\Client;
+namespace Magento\Braintree\Gateway\Http\Client;
 
 class TransactionVoid extends AbstractTransaction
 {
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Http/TransferFactory.php b/app/code/Magento/Braintree/Gateway/Http/TransferFactory.php
similarity index 95%
rename from app/code/Magento/BraintreeTwo/Gateway/Http/TransferFactory.php
rename to app/code/Magento/Braintree/Gateway/Http/TransferFactory.php
index cd21881d36df469be6497ab8caa41b3875beb166..1bef09300886a2077919fba2337939691b38ea1a 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Http/TransferFactory.php
+++ b/app/code/Magento/Braintree/Gateway/Http/TransferFactory.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Http;
+namespace Magento\Braintree\Gateway\Http;
 
 use Magento\Payment\Gateway\Http\TransferBuilder;
 use Magento\Payment\Gateway\Http\TransferFactoryInterface;
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Request/AddressDataBuilder.php b/app/code/Magento/Braintree/Gateway/Request/AddressDataBuilder.php
similarity index 97%
rename from app/code/Magento/BraintreeTwo/Gateway/Request/AddressDataBuilder.php
rename to app/code/Magento/Braintree/Gateway/Request/AddressDataBuilder.php
index 557bbafcb3b7682cd2d12b227c98214fc340513a..97d890759525d39b404061c10e41f034c69754ca 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Request/AddressDataBuilder.php
+++ b/app/code/Magento/Braintree/Gateway/Request/AddressDataBuilder.php
@@ -3,10 +3,10 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Request;
+namespace Magento\Braintree\Gateway\Request;
 
 use Magento\Payment\Gateway\Request\BuilderInterface;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 
 /**
  * Class AddressDataBuilder
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Request/CaptureDataBuilder.php b/app/code/Magento/Braintree/Gateway/Request/CaptureDataBuilder.php
similarity index 92%
rename from app/code/Magento/BraintreeTwo/Gateway/Request/CaptureDataBuilder.php
rename to app/code/Magento/Braintree/Gateway/Request/CaptureDataBuilder.php
index 11bfdf81429685628a9d4c30fc96423bb21a728d..0e74430e52d37b79baa7973adcfffc37df2688bd 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Request/CaptureDataBuilder.php
+++ b/app/code/Magento/Braintree/Gateway/Request/CaptureDataBuilder.php
@@ -3,10 +3,10 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Request;
+namespace Magento\Braintree\Gateway\Request;
 
 use Magento\Framework\Exception\LocalizedException;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 use Magento\Payment\Gateway\Request\BuilderInterface;
 use Magento\Payment\Helper\Formatter;
 
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Request/CustomerDataBuilder.php b/app/code/Magento/Braintree/Gateway/Request/CustomerDataBuilder.php
similarity index 94%
rename from app/code/Magento/BraintreeTwo/Gateway/Request/CustomerDataBuilder.php
rename to app/code/Magento/Braintree/Gateway/Request/CustomerDataBuilder.php
index ee3c188070f35a8b3aae899efd68bc62af15e061..0aa752817db6f0556f163dae3bd15a322f03270f 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Request/CustomerDataBuilder.php
+++ b/app/code/Magento/Braintree/Gateway/Request/CustomerDataBuilder.php
@@ -3,10 +3,10 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Request;
+namespace Magento\Braintree\Gateway\Request;
 
 use Magento\Payment\Gateway\Request\BuilderInterface;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 
 /**
  * Class CustomerDataBuilder
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Request/KountPaymentDataBuilder.php b/app/code/Magento/Braintree/Gateway/Request/KountPaymentDataBuilder.php
similarity index 86%
rename from app/code/Magento/BraintreeTwo/Gateway/Request/KountPaymentDataBuilder.php
rename to app/code/Magento/Braintree/Gateway/Request/KountPaymentDataBuilder.php
index 4a121b9a2cadbb02963d39150afc625a65449a95..9e5ccfc716ca6cf0f34e0e0a4e21e63c388e652c 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Request/KountPaymentDataBuilder.php
+++ b/app/code/Magento/Braintree/Gateway/Request/KountPaymentDataBuilder.php
@@ -3,11 +3,11 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Request;
+namespace Magento\Braintree\Gateway\Request;
 
-use Magento\BraintreeTwo\Gateway\Config\Config;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
-use Magento\BraintreeTwo\Observer\DataAssignObserver;
+use Magento\Braintree\Gateway\Config\Config;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Observer\DataAssignObserver;
 use Magento\Payment\Gateway\Request\BuilderInterface;
 
 /**
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Request/PaymentDataBuilder.php b/app/code/Magento/Braintree/Gateway/Request/PaymentDataBuilder.php
similarity index 92%
rename from app/code/Magento/BraintreeTwo/Gateway/Request/PaymentDataBuilder.php
rename to app/code/Magento/Braintree/Gateway/Request/PaymentDataBuilder.php
index 485ca4fa35f732bcdb7e0cc39c3c70c5195ef11a..19e0f2eccbb54895ac5013f0c573c35cad59a089 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Request/PaymentDataBuilder.php
+++ b/app/code/Magento/Braintree/Gateway/Request/PaymentDataBuilder.php
@@ -3,11 +3,11 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Request;
+namespace Magento\Braintree\Gateway\Request;
 
-use Magento\BraintreeTwo\Gateway\Config\Config;
-use Magento\BraintreeTwo\Observer\DataAssignObserver;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Config\Config;
+use Magento\Braintree\Observer\DataAssignObserver;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 use Magento\Payment\Gateway\Request\BuilderInterface;
 use Magento\Payment\Helper\Formatter;
 
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Request/RefundDataBuilder.php b/app/code/Magento/Braintree/Gateway/Request/RefundDataBuilder.php
similarity index 74%
rename from app/code/Magento/BraintreeTwo/Gateway/Request/RefundDataBuilder.php
rename to app/code/Magento/Braintree/Gateway/Request/RefundDataBuilder.php
index 3521a7d2a358190c144f4b758f98001089546d5e..fcfcd95b3242cf5ac28512e099591a6c500ec0e5 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Request/RefundDataBuilder.php
+++ b/app/code/Magento/Braintree/Gateway/Request/RefundDataBuilder.php
@@ -3,11 +3,12 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Request;
+namespace Magento\Braintree\Gateway\Request;
 
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 use Magento\Payment\Gateway\Request\BuilderInterface;
 use Magento\Payment\Helper\Formatter;
+use Magento\Sales\Api\Data\TransactionInterface;
 use Magento\Sales\Model\Order\Payment;
 
 class RefundDataBuilder implements BuilderInterface
@@ -51,8 +52,14 @@ class RefundDataBuilder implements BuilderInterface
 
         /*
          * we should remember that Payment sets Capture txn id of current Invoice into ParentTransactionId Field
+         * We should also support previous implementations of Magento Braintree -
+         * and cut off '-capture' postfix from transaction ID to support backward compatibility
          */
-        $txnId = $payment->getParentTransactionId();
+        $txnId = str_replace(
+            '-' . TransactionInterface::TYPE_CAPTURE,
+            '',
+            $payment->getParentTransactionId()
+        );
 
         return [
             'transaction_id' => $txnId,
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Request/SettlementDataBuilder.php b/app/code/Magento/Braintree/Gateway/Request/SettlementDataBuilder.php
similarity index 91%
rename from app/code/Magento/BraintreeTwo/Gateway/Request/SettlementDataBuilder.php
rename to app/code/Magento/Braintree/Gateway/Request/SettlementDataBuilder.php
index 4def50e3893d03fb08b86a31f50b809b8089ef35..f9244eecb1dbffcb7fd2a9aae01864c7d4f41aee 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Request/SettlementDataBuilder.php
+++ b/app/code/Magento/Braintree/Gateway/Request/SettlementDataBuilder.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Request;
+namespace Magento\Braintree\Gateway\Request;
 
 use Magento\Payment\Gateway\Request\BuilderInterface;
 
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Request/ThreeDSecureDataBuilder.php b/app/code/Magento/Braintree/Gateway/Request/ThreeDSecureDataBuilder.php
similarity index 92%
rename from app/code/Magento/BraintreeTwo/Gateway/Request/ThreeDSecureDataBuilder.php
rename to app/code/Magento/Braintree/Gateway/Request/ThreeDSecureDataBuilder.php
index 12206605a618a75ee66f4449fab0d041cb00c857..ba8f0bcba2312dd8ee94f82de55a2f4ede294a44 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Request/ThreeDSecureDataBuilder.php
+++ b/app/code/Magento/Braintree/Gateway/Request/ThreeDSecureDataBuilder.php
@@ -3,11 +3,11 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Request;
+namespace Magento\Braintree\Gateway\Request;
 
-use Magento\BraintreeTwo\Gateway\Config\Config;
+use Magento\Braintree\Gateway\Config\Config;
 use Magento\Payment\Gateway\Data\OrderAdapterInterface;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 use Magento\Payment\Gateway\Request\BuilderInterface;
 use Magento\Payment\Helper\Formatter;
 
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Request/VaultCaptureDataBuilder.php b/app/code/Magento/Braintree/Gateway/Request/VaultCaptureDataBuilder.php
similarity index 91%
rename from app/code/Magento/BraintreeTwo/Gateway/Request/VaultCaptureDataBuilder.php
rename to app/code/Magento/Braintree/Gateway/Request/VaultCaptureDataBuilder.php
index 7959651759b91f96db51ae7486996fdf4c0866b4..11954a881418a72d0d69623edbb59788dca8e130 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Request/VaultCaptureDataBuilder.php
+++ b/app/code/Magento/Braintree/Gateway/Request/VaultCaptureDataBuilder.php
@@ -3,9 +3,9 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Request;
+namespace Magento\Braintree\Gateway\Request;
 
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 use Magento\Payment\Gateway\Request\BuilderInterface;
 use Magento\Payment\Helper\Formatter;
 
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Request/VaultDataBuilder.php b/app/code/Magento/Braintree/Gateway/Request/VaultDataBuilder.php
similarity index 94%
rename from app/code/Magento/BraintreeTwo/Gateway/Request/VaultDataBuilder.php
rename to app/code/Magento/Braintree/Gateway/Request/VaultDataBuilder.php
index 25f6d5e770db1f4b8fba6bf1c37aa3e2c06d8c28..f4ec2bb69423f69f1f72575ad1c4a11ed713f4f9 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Request/VaultDataBuilder.php
+++ b/app/code/Magento/Braintree/Gateway/Request/VaultDataBuilder.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Request;
+namespace Magento\Braintree\Gateway\Request;
 
 use Magento\Payment\Gateway\Request\BuilderInterface;
 
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Request/VoidDataBuilder.php b/app/code/Magento/Braintree/Gateway/Request/VoidDataBuilder.php
similarity index 90%
rename from app/code/Magento/BraintreeTwo/Gateway/Request/VoidDataBuilder.php
rename to app/code/Magento/Braintree/Gateway/Request/VoidDataBuilder.php
index 21c82c191b174276fafb5ee71de890d997e7a115..03810c3046938dbf262ae6cd0caf6625da07f332 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Request/VoidDataBuilder.php
+++ b/app/code/Magento/Braintree/Gateway/Request/VoidDataBuilder.php
@@ -3,9 +3,9 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Request;
+namespace Magento\Braintree\Gateway\Request;
 
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 use Magento\Payment\Gateway\Request\BuilderInterface;
 use Magento\Sales\Model\Order\Payment;
 
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Response/CardDetailsHandler.php b/app/code/Magento/Braintree/Gateway/Response/CardDetailsHandler.php
similarity index 94%
rename from app/code/Magento/BraintreeTwo/Gateway/Response/CardDetailsHandler.php
rename to app/code/Magento/Braintree/Gateway/Response/CardDetailsHandler.php
index a8bd79cf883293b3a54b1a46b07d6b49262506f0..46e020305b3c5feb0a3c466da52588c55cc05242 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Response/CardDetailsHandler.php
+++ b/app/code/Magento/Braintree/Gateway/Response/CardDetailsHandler.php
@@ -3,13 +3,13 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Response;
+namespace Magento\Braintree\Gateway\Response;
 
 use \Braintree\Transaction;
-use Magento\BraintreeTwo\Gateway\Config\Config;
+use Magento\Braintree\Gateway\Config\Config;
 use Magento\Payment\Gateway\Helper\ContextHelper;
 use Magento\Sales\Api\Data\OrderPaymentInterface;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 use Magento\Payment\Gateway\Response\HandlerInterface;
 
 /**
@@ -70,7 +70,6 @@ class CardDetailsHandler implements HandlerInterface
         $payment->setCcExpMonth($creditCard[self::CARD_EXP_MONTH]);
         $payment->setCcExpYear($creditCard[self::CARD_EXP_YEAR]);
 
-
         $payment->setCcType($this->getCreditCardType($creditCard[self::CARD_TYPE]));
 
         // set card details to additional info
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Response/PayPalDetailsHandler.php b/app/code/Magento/Braintree/Gateway/Response/PayPalDetailsHandler.php
similarity index 92%
rename from app/code/Magento/BraintreeTwo/Gateway/Response/PayPalDetailsHandler.php
rename to app/code/Magento/Braintree/Gateway/Response/PayPalDetailsHandler.php
index 6d914906d495684c8b4d6a29ad45b974268c9e07..f85f6bdcdf031d9d229a89b1ce6ac878576bb6a2 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Response/PayPalDetailsHandler.php
+++ b/app/code/Magento/Braintree/Gateway/Response/PayPalDetailsHandler.php
@@ -3,10 +3,10 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Response;
+namespace Magento\Braintree\Gateway\Response;
 
 use Magento\Payment\Gateway\Response\HandlerInterface;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 use Magento\Sales\Api\Data\OrderPaymentInterface;
 
 /**
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Response/PaymentDetailsHandler.php b/app/code/Magento/Braintree/Gateway/Response/PaymentDetailsHandler.php
similarity index 93%
rename from app/code/Magento/BraintreeTwo/Gateway/Response/PaymentDetailsHandler.php
rename to app/code/Magento/Braintree/Gateway/Response/PaymentDetailsHandler.php
index fc635d378d37c2c31df55813ef33f0fb2dedf4a5..aae9cfc06d3ab404c1a81878d4dac67f850f5d8d 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Response/PaymentDetailsHandler.php
+++ b/app/code/Magento/Braintree/Gateway/Response/PaymentDetailsHandler.php
@@ -3,12 +3,12 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Response;
+namespace Magento\Braintree\Gateway\Response;
 
 use Braintree\Transaction;
-use Magento\BraintreeTwo\Observer\DataAssignObserver;
+use Magento\Braintree\Observer\DataAssignObserver;
 use Magento\Payment\Gateway\Helper\ContextHelper;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 use Magento\Payment\Gateway\Response\HandlerInterface;
 use Magento\Sales\Api\Data\OrderPaymentInterface;
 
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Response/RefundHandler.php b/app/code/Magento/Braintree/Gateway/Response/RefundHandler.php
similarity index 91%
rename from app/code/Magento/BraintreeTwo/Gateway/Response/RefundHandler.php
rename to app/code/Magento/Braintree/Gateway/Response/RefundHandler.php
index d7d09ec6dc068fd4aacec352fc3b14b75b856174..bf0ad7d3a0157ea1c9d013adb8d330b842b16d33 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Response/RefundHandler.php
+++ b/app/code/Magento/Braintree/Gateway/Response/RefundHandler.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Response;
+namespace Magento\Braintree\Gateway\Response;
 
 use Magento\Sales\Model\Order\Payment;
 
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Response/RiskDataHandler.php b/app/code/Magento/Braintree/Gateway/Response/RiskDataHandler.php
similarity index 93%
rename from app/code/Magento/BraintreeTwo/Gateway/Response/RiskDataHandler.php
rename to app/code/Magento/Braintree/Gateway/Response/RiskDataHandler.php
index 36678eb3718171a332156ebc13ce8fc41f7b0a3b..df9ec89c88dc73e3e304fccf9e4e0012836e9e26 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Response/RiskDataHandler.php
+++ b/app/code/Magento/Braintree/Gateway/Response/RiskDataHandler.php
@@ -3,10 +3,10 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Response;
+namespace Magento\Braintree\Gateway\Response;
 
 use Magento\Payment\Gateway\Helper\ContextHelper;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 use Magento\Payment\Gateway\Response\HandlerInterface;
 
 /**
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Response/ThreeDSecureDetailsHandler.php b/app/code/Magento/Braintree/Gateway/Response/ThreeDSecureDetailsHandler.php
similarity index 95%
rename from app/code/Magento/BraintreeTwo/Gateway/Response/ThreeDSecureDetailsHandler.php
rename to app/code/Magento/Braintree/Gateway/Response/ThreeDSecureDetailsHandler.php
index 14005691da7eb3a9282530426d8542ba72b8bcb0..23e28bab95039985e4b827ff2a9ce2f8ff7eff7f 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Response/ThreeDSecureDetailsHandler.php
+++ b/app/code/Magento/Braintree/Gateway/Response/ThreeDSecureDetailsHandler.php
@@ -3,11 +3,11 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Response;
+namespace Magento\Braintree\Gateway\Response;
 
 use Braintree\Transaction;
 use Magento\Payment\Gateway\Helper\ContextHelper;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 use Magento\Payment\Gateway\Response\HandlerInterface;
 use Magento\Sales\Api\Data\OrderPaymentInterface;
 
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Response/TransactionIdHandler.php b/app/code/Magento/Braintree/Gateway/Response/TransactionIdHandler.php
similarity index 95%
rename from app/code/Magento/BraintreeTwo/Gateway/Response/TransactionIdHandler.php
rename to app/code/Magento/Braintree/Gateway/Response/TransactionIdHandler.php
index 88323fe845bd2be8e6b1a779d0e29aad931436b6..7620f325983728807341033d8df1a23a61f36065 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Response/TransactionIdHandler.php
+++ b/app/code/Magento/Braintree/Gateway/Response/TransactionIdHandler.php
@@ -3,9 +3,9 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Response;
+namespace Magento\Braintree\Gateway\Response;
 
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 use Magento\Payment\Gateway\Response\HandlerInterface;
 use Magento\Sales\Model\Order\Payment;
 
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Response/VaultDetailsHandler.php b/app/code/Magento/Braintree/Gateway/Response/VaultDetailsHandler.php
similarity index 97%
rename from app/code/Magento/BraintreeTwo/Gateway/Response/VaultDetailsHandler.php
rename to app/code/Magento/Braintree/Gateway/Response/VaultDetailsHandler.php
index 9bcd6a1b93d71a605986899ffa81d31bdfe612e2..4e97c76ec3ead451283088fa0ad071fb8498bc87 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Response/VaultDetailsHandler.php
+++ b/app/code/Magento/Braintree/Gateway/Response/VaultDetailsHandler.php
@@ -3,11 +3,11 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Response;
+namespace Magento\Braintree\Gateway\Response;
 
 use Braintree\Transaction;
-use Magento\BraintreeTwo\Gateway\Config\Config;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Config\Config;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 use Magento\Payment\Gateway\Response\HandlerInterface;
 use Magento\Payment\Model\InfoInterface;
 use Magento\Sales\Api\Data\OrderPaymentExtensionInterface;
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Response/VoidHandler.php b/app/code/Magento/Braintree/Gateway/Response/VoidHandler.php
similarity index 95%
rename from app/code/Magento/BraintreeTwo/Gateway/Response/VoidHandler.php
rename to app/code/Magento/Braintree/Gateway/Response/VoidHandler.php
index b6edc371705c32b41bec106b3c249ff7dd4d13da..521d5d9e17664de4eabb80aa46a90641b12d39fd 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Response/VoidHandler.php
+++ b/app/code/Magento/Braintree/Gateway/Response/VoidHandler.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Response;
+namespace Magento\Braintree\Gateway\Response;
 
 use Magento\Sales\Model\Order\Payment;
 
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Validator/GeneralResponseValidator.php b/app/code/Magento/Braintree/Gateway/Validator/GeneralResponseValidator.php
similarity index 94%
rename from app/code/Magento/BraintreeTwo/Gateway/Validator/GeneralResponseValidator.php
rename to app/code/Magento/Braintree/Gateway/Validator/GeneralResponseValidator.php
index 16ec9c0f74f1033cb4e4badd6165443b37f9d196..d10eb1b97b560989a2b8ed0a24a5cbe2d71a6039 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Validator/GeneralResponseValidator.php
+++ b/app/code/Magento/Braintree/Gateway/Validator/GeneralResponseValidator.php
@@ -3,12 +3,12 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Validator;
+namespace Magento\Braintree\Gateway\Validator;
 
 use Braintree\Result\Error;
 use Braintree\Result\Successful;
 use Magento\Payment\Gateway\Validator\AbstractValidator;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 use Magento\Payment\Gateway\Validator\ResultInterfaceFactory;
 
 class GeneralResponseValidator extends AbstractValidator
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Validator/PaymentNonceResponseValidator.php b/app/code/Magento/Braintree/Gateway/Validator/PaymentNonceResponseValidator.php
similarity index 93%
rename from app/code/Magento/BraintreeTwo/Gateway/Validator/PaymentNonceResponseValidator.php
rename to app/code/Magento/Braintree/Gateway/Validator/PaymentNonceResponseValidator.php
index 10622224d4b3bbedf77bb493272a68f4381a075a..5d9be958cab67899e854bce4c4e6a9e4049f0624 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Validator/PaymentNonceResponseValidator.php
+++ b/app/code/Magento/Braintree/Gateway/Validator/PaymentNonceResponseValidator.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Validator;
+namespace Magento\Braintree\Gateway\Validator;
 
 /**
  * Class PaymentNonceResponseValidator
diff --git a/app/code/Magento/BraintreeTwo/Gateway/Validator/ResponseValidator.php b/app/code/Magento/Braintree/Gateway/Validator/ResponseValidator.php
similarity index 95%
rename from app/code/Magento/BraintreeTwo/Gateway/Validator/ResponseValidator.php
rename to app/code/Magento/Braintree/Gateway/Validator/ResponseValidator.php
index f78fe029a65a874a62e472dde8bd6302b268ba41..de7cbae5003ed313e3af366c6031003b0f485d1f 100644
--- a/app/code/Magento/BraintreeTwo/Gateway/Validator/ResponseValidator.php
+++ b/app/code/Magento/Braintree/Gateway/Validator/ResponseValidator.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Gateway\Validator;
+namespace Magento\Braintree\Gateway\Validator;
 
 use Braintree\Result\Error;
 use Braintree\Result\Successful;
diff --git a/app/code/Magento/BraintreeTwo/Helper/CcType.php b/app/code/Magento/Braintree/Helper/CcType.php
similarity index 80%
rename from app/code/Magento/BraintreeTwo/Helper/CcType.php
rename to app/code/Magento/Braintree/Helper/CcType.php
index 427c773a8766bfb7e3c630f76ca89df2a462ecb4..8792cf815a463356d42a332e3f7806d266333f7d 100644
--- a/app/code/Magento/BraintreeTwo/Helper/CcType.php
+++ b/app/code/Magento/Braintree/Helper/CcType.php
@@ -3,9 +3,9 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Helper;
+namespace Magento\Braintree\Helper;
 
-use Magento\BraintreeTwo\Model\Adminhtml\Source\CcType as CcTypeSource;
+use Magento\Braintree\Model\Adminhtml\Source\CcType as CcTypeSource;
 
 /**
  * Class CcType
@@ -20,7 +20,7 @@ class CcType
     private $ccTypes = [];
 
     /**
-     * @var \Magento\BraintreeTwo\Model\Adminhtml\Source\CcType
+     * @var \Magento\Braintree\Model\Adminhtml\Source\CcType
      */
     private $ccTypeSource;
 
diff --git a/app/code/Magento/BraintreeTwo/Helper/Country.php b/app/code/Magento/Braintree/Helper/Country.php
similarity index 81%
rename from app/code/Magento/BraintreeTwo/Helper/Country.php
rename to app/code/Magento/Braintree/Helper/Country.php
index 1780e633586990ad1778fc4fbb9c0e9009005d40..02fcdd35c06bcef6ae530e80f4b5aefb58172d06 100644
--- a/app/code/Magento/BraintreeTwo/Helper/Country.php
+++ b/app/code/Magento/Braintree/Helper/Country.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Helper;
+namespace Magento\Braintree\Helper;
 
 use Magento\Directory\Model\ResourceModel\Country\CollectionFactory;
 
@@ -18,7 +18,7 @@ class Country
     private $collectionFactory;
 
     /**
-     * @var \Magento\BraintreeTwo\Model\Adminhtml\System\Config\Country
+     * @var \Magento\Braintree\Model\Adminhtml\System\Config\Country
      */
     private $countryConfig;
 
@@ -29,11 +29,11 @@ class Country
 
     /**
      * @param \Magento\Directory\Model\ResourceModel\Country\CollectionFactory $factory
-     * @param \Magento\BraintreeTwo\Model\Adminhtml\System\Config\Country $countryConfig
+     * @param \Magento\Braintree\Model\Adminhtml\System\Config\Country $countryConfig
      */
     public function __construct(
         \Magento\Directory\Model\ResourceModel\Country\CollectionFactory $factory,
-        \Magento\BraintreeTwo\Model\Adminhtml\System\Config\Country $countryConfig
+        \Magento\Braintree\Model\Adminhtml\System\Config\Country $countryConfig
     ) {
         $this->collectionFactory = $factory;
         $this->countryConfig = $countryConfig;
diff --git a/app/code/Magento/Braintree/Helper/Createorder.php b/app/code/Magento/Braintree/Helper/Createorder.php
deleted file mode 100644
index 6a73e26398213c563c1271ea0e8201e3643c86b8..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Helper/Createorder.php
+++ /dev/null
@@ -1,102 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Helper;
-
-use Magento\Braintree\Model\Adapter\BraintreeCustomer;
-use \Braintree_Exception;
-use \Magento\Framework\App\Helper\Context;
-use \Magento\Braintree\Model\PaymentMethod;
-use Magento\Framework\App\Config\ScopeConfigInterface;
-
-class Createorder extends \Magento\Framework\App\Helper\AbstractHelper
-{
-    const CONFIG_PATH_VAULT         = 'payment/braintree/use_vault';
-    const CONFIG_PATH_MERCHANT_ID   = 'payment/braintree/merchant_id';
-
-    /**
-     * @var \Magento\Braintree\Helper\Data
-     */
-    protected $paymentHelper;
-
-    /**
-     * @var \Magento\Backend\Model\Session\Quote
-     */
-    protected $sessionQuote;
-
-    /**
-     * @var BraintreeCustomer
-     */
-    protected $braintreeCustomerAdapter;
-
-    /**
-     * @param Context $context
-     * @param \Magento\Braintree\Helper\Data $paymentHelper
-     * @param BraintreeCustomer $braintreeCustomerAdapter
-     * @param \Magento\Backend\Model\Session\Quote $sessionQuote
-     */
-    public function __construct(
-        Context $context,
-        \Magento\Braintree\Helper\Data $paymentHelper,
-        BraintreeCustomer $braintreeCustomerAdapter,
-        \Magento\Backend\Model\Session\Quote $sessionQuote
-    ) {
-        parent::__construct($context);
-        $this->paymentHelper = $paymentHelper;
-        $this->braintreeCustomerAdapter = $braintreeCustomerAdapter;
-        $this->sessionQuote = $sessionQuote;
-    }
-
-    /**
-     * Returns customer credit cards if applicable
-     * 
-     * @return \Braintree_Customer|boolean
-     */
-    public function getLoggedInCustomerCards()
-    {
-        $applicableCards = [];
-        $useVault = (bool)(int)$this->scopeConfig->getValue(
-            self::CONFIG_PATH_VAULT,
-            ScopeConfigInterface::SCOPE_TYPE_DEFAULT,
-            $this->sessionQuote->getStoreId()
-        );
-        if ($useVault) {
-            $storedCards = false;
-            if ($this->sessionQuote->getCustomerId()) {
-                $customerId = $this->paymentHelper->generateCustomerId(
-                    $this->sessionQuote->getCustomerId(),
-                    $this->sessionQuote->getQuote()->getCustomerEmail()
-                );
-                try {
-                    $storedCards = $this->braintreeCustomerAdapter->find($customerId)->creditCards;
-                } catch (\Braintree_Exception $e) {
-                    $this->_logger->critical($e);
-                }
-            }
-            if ($storedCards) {
-                $country = $this->sessionQuote->getQuote()->getBillingAddress()->getCountryId();
-                $cardTypes = $this->paymentHelper->getCcAvailableCardTypes($country);
-                $applicableCards = [];
-                foreach ($storedCards as $card) {
-                    if (isset($cardTypes[$this->paymentHelper->getCcTypeCodeByName($card->cardType)])) {
-                        $applicableCards[] = $card;
-                    }
-                }
-                
-            }
-        }
-        return $applicableCards;
-    }
-    
-    /**
-     * Returns merchant id
-     *
-     * @return string
-     */
-    public function getMerchantId()
-    {
-        return $this->scopeConfig->getValue(self::CONFIG_PATH_MERCHANT_ID, $this->sessionQuote->getStoreId());
-    }
-}
diff --git a/app/code/Magento/Braintree/Helper/Data.php b/app/code/Magento/Braintree/Helper/Data.php
deleted file mode 100644
index ba80e97c2ac96e56e033aa91a9a06f548c45bfff..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Helper/Data.php
+++ /dev/null
@@ -1,238 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Helper;
-
-use Magento\Framework\App\Helper\Context;
-use Magento\Payment\Model\Config as PaymentConfig;
-
-class Data extends \Magento\Framework\App\Helper\AbstractHelper
-{
-    const CONFIG_PATH_KOUNT_ID = 'payment/braintree/kount_id';
-
-    /**
-     * @var int|null
-     */
-    protected $today = null;
-
-    /**
-     * @var PaymentConfig
-     */
-    protected $paymentConfig;
-
-    /**
-     * @var \Magento\Braintree\Model\Config\Cc
-     */
-    protected $braintreeCcConfig;
-
-    /**
-     * @var \Magento\Framework\Stdlib\DateTime
-     */
-    protected $dateFormat;
-
-    /**
-     * @var \Magento\Framework\Stdlib\DateTime\DateTime
-     */
-    protected $dateTime;
-
-    /**
-     * @var cached cc types
-     */
-    protected $ccTypes = null;
-
-    /**
-     * @param Context $context
-     * @param PaymentConfig $paymentConfig
-     * @param \Magento\Braintree\Model\Config\Cc $braintreeCcConfig
-     * @param \Magento\Framework\Stdlib\DateTime $dateFormat
-     * @param \Magento\Framework\Stdlib\DateTime\DateTime $dateTime
-     */
-    public function __construct(
-        Context $context,
-        PaymentConfig $paymentConfig,
-        \Magento\Braintree\Model\Config\Cc $braintreeCcConfig,
-        \Magento\Framework\Stdlib\DateTime $dateFormat,
-        \Magento\Framework\Stdlib\DateTime\DateTime $dateTime
-    ) {
-        parent::__construct($context);
-        $this->paymentConfig = $paymentConfig;
-        $this->braintreeCcConfig = $braintreeCcConfig;
-        $this->dateFormat = $dateFormat;
-        $this->dateTime = $dateTime;
-    }
-
-    /**
-     * Finds credit card type by type name using global payments config
-     *
-     * @param string $name
-     * @return string|bool
-     */
-    public function getCcTypeCodeByName($name)
-    {
-        if (!$this->ccTypes) {
-            $ccTypes = $this->paymentConfig->getCcTypes();
-            $this->ccTypes = array_flip($ccTypes);
-        }
-        if (isset($this->ccTypes[$name])) {
-            return $this->ccTypes[$name];
-        } else {
-            return false;
-        }
-    }
-
-    /**
-     * Finds credit card type by type name using global payments config
-     *
-     * @param string $code
-     * @return mixed
-     */
-    public function getCcTypeNameByCode($code)
-    {
-        $ccTypes = $this->paymentConfig->getCcTypes();
-        if (isset($ccTypes[$code])) {
-            return $ccTypes[$code];
-        } else {
-            return false;
-        }
-    }
-
-    /**
-     * Finds all credit card types using global payments config
-     *
-     * @return mixed
-     */
-    public function getCcTypes()
-    {
-        $ccTypes = $this->paymentConfig->getCcTypes();
-        if (is_array($ccTypes)) {
-            return $ccTypes;
-        } else {
-            return false;
-        }
-    }
-
-    /**
-     * Get the configured Kount ID
-     *
-     * @return mixed
-     */
-    public function getKountId()
-    {
-        return $this->scopeConfig->getValue(self::CONFIG_PATH_KOUNT_ID);
-    }
-
-    /**
-     * Removes Magento added transaction id suffix if applicable
-     *
-     * @param string $transactionId
-     * @return string
-     */
-    public function clearTransactionId($transactionId)
-    {
-        $suffixes = [
-            '-' . \Magento\Sales\Model\Order\Payment\Transaction::TYPE_CAPTURE,
-            '-' . \Magento\Sales\Model\Order\Payment\Transaction::TYPE_VOID,
-        ];
-        foreach ($suffixes as $suffix) {
-            if (strpos($transactionId, $suffix) !== false) {
-                $transactionId = str_replace($suffix, '', $transactionId);
-            }
-        }
-        return $transactionId;
-    }
-
-    /**
-     * Returns today year
-     *
-     * @return string
-     */
-    public function getTodayYear()
-    {
-        if (!$this->today) {
-            $this->today = $this->dateTime->gmtTimestamp();
-        }
-        return date('Y', $this->today);
-    }
-
-    /**
-     * Returns today month
-     *
-     * @return string
-     */
-    public function getTodayMonth()
-    {
-        if (!$this->today) {
-            $this->today = $this->dateTime->gmtTimestamp();
-        }
-        return date('m', $this->today);
-    }
-
-    /**
-     * Generates md5 hash to be used as customer id
-     *
-     * @param string $customerId
-     * @param string $email
-     * @return string
-     */
-    public function generateCustomerId($customerId, $email)
-    {
-        return md5($customerId . '-' . $email);
-    }
-
-    /**
-     * Retrieve available credit card types as associative array code & title
-     *
-     * @param string $country
-     * @return array
-     * @SuppressWarnings(PHPMD.NPathComplexity)
-     * @SuppressWarnings(PHPMD.CyclomaticComplexity)
-     */
-    public function getCcAvailableCardTypes($country = null)
-    {
-        $types = array_flip(explode(',', $this->braintreeCcConfig->getConfigData('cctypes')));
-        $mergedArray= [];
-
-        if (is_array($types)) {
-            foreach (array_keys($types) as $type) {
-                $types[$type] = $this->getCcTypeNameByCode($type);
-            }
-        }
-        //merge options then filter by a specific country
-        $countrySpecificTypes = $this->braintreeCcConfig->getCountrySpecificCardTypeConfig();
-
-
-        //include all country specific in types
-        if (is_array($countrySpecificTypes)) {
-            foreach ($countrySpecificTypes as $countryArray) {
-                foreach ($countryArray as $ccType) {
-                    $types[$ccType]=$this->getCcTypeNameByCode($ccType);
-                }
-            }
-        }
-
-        //preserve the same credit card order
-        $allTypes = $this->getCcTypes();
-        if (is_array($allTypes)) {
-            foreach ($allTypes as $ccTypeCode => $ccTypeName) {
-                if (array_key_exists($ccTypeCode, $types)) {
-                    $mergedArray[$ccTypeCode] = $ccTypeName;
-                }
-            }
-        }
-
-        if ($country) {
-            $countrySpecificTypesApplicable = $this->braintreeCcConfig->getApplicableCardTypes($country);
-            if (!empty($countrySpecificTypesApplicable)) {
-                foreach (array_keys($mergedArray) as $code) {
-                    if (!in_array($code, $countrySpecificTypesApplicable)) {
-                        unset($mergedArray[$code]);
-                    }
-                }
-            }
-        }
-
-        return $mergedArray;
-    }
-}
diff --git a/app/code/Magento/Braintree/Helper/Error.php b/app/code/Magento/Braintree/Helper/Error.php
deleted file mode 100644
index 64bc3226685a5993cae1ebca3fe07256f227d433..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Helper/Error.php
+++ /dev/null
@@ -1,177 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Helper;
-
-use \Braintree_Result_Error;
-
-class Error extends \Magento\Framework\App\Helper\AbstractHelper
-{
-    const STATUS_GATEWAY_REJECTED   = 'gateway_rejected';
-    const STATUS_PROCESSOR_DECLINED = 'processor_declined';
-    const CLONE_ERROR_CODE          = '91542';
-    const NONCE_USED_MORE_THAN_ONCE = '91564';
-
-    /**
-     * @var array
-     */
-    protected $_codesMessages = [
-        2000 => 'Contact your bank or try another card',
-        2001 => 'Contact your bank or try another card',
-        2002 => 'Contact your bank or try another card',
-        2003 => 'Contact your bank or try another card',
-        2004 => 'Check card details or try another card',
-        2005 => 'Check card details or try another card',
-        2006 => 'Check card details or try another card',
-        2007 => 'Check card details or try another card',
-        2008 => 'Check card details or try another card',
-        2009 => 'Try another card',
-        2010 => 'Check card details or try another card',
-        2011 => 'Voice Authorization Required',
-        2012 => 'Contact your bank or try another card',
-        2013 => 'Contact your bank or try another card',
-        2014 => 'Contact your bank or try another card',
-        2015 => 'Contact your bank or try another card',
-        2016 => 'Duplicate transaction',
-        2017 => 'Contact your bank or try another card',
-        2018 => 'Contact your bank or try another card',
-        2019 => 'Contact your bank or try another card',
-        2020 => 'Contact your bank or try another card',
-        2021 => 'Contact your bank or try another card',
-        2022 => 'Contact your bank or try another card',
-        2023 => 'Try another card',
-        2024 => 'Try another card',
-        2025 => 'Try again later',
-        2026 => 'Try again later',
-        2027 => 'Try again later',
-        2028 => 'Try again later',
-        2029 => 'Try again later',
-        2030 => 'Try again later',
-        2031 => 'Try another card',
-        2032 => 'Try another card',
-        2033 => 'Try another card',
-        2034 => 'Try another card',
-        2035 => 'Try another card',
-        2036 => 'Try another card',
-        2037 => 'Try another card',
-        2038 => 'Contact your bank or try another card',
-        2039 => 'Try another card',
-        2040 => 'Try another card',
-        2041 => 'Contact your bank or try another card',
-        2043 => 'Contact your bank or try another card',
-        2044 => 'Contact your bank or try another card',
-        2045 => 'Try again later',
-        2046 => 'Contact your bank or try another card',
-        2047 => 'Try another card',
-        2048 => 'Try again later',
-        2049 => 'Try again later',
-        2050 => 'Try again later',
-        2051 => 'Check card details or try another card',
-        2052 => 'Try again later',
-        2053 => 'Try another card',
-        2054 => 'Processor decline',
-        2055 => 'Processor decline',
-        2056 => 'Processor decline',
-        2057 => 'Contact your bank or try another card',
-        2058 => 'Try another card',
-        2059 => 'Contact your bank or try another card',
-        2060 => 'Contact your bank or try another card',
-        2061 => 'Processor decline',
-        2062 => 'Processor decline',
-        3000 => 'Processor network error',
-    ];
-
-    /**
-     * Parses unsuccessful result into message
-     *
-     * @param \Braintree_Result_Error $result
-     * @return \Magento\Framework\Phrase
-     * @SuppressWarnings(PHPMD.CyclomaticComplexity)
-     */
-    public function parseBraintreeError($result)
-    {
-        $message = null;
-        if ($this->isCreditCardApiError($result)) {
-            $message = __($this->isCreditCardApiError($result));
-        } elseif ($this->isNonceUsedMoreThanOnceError($result)) {
-            $message = __("The processor declined your transaction, please re-enter your payment information");
-        } elseif (isset($result->transaction) && $result->transaction && $result->transaction->status) {
-            if ($result->transaction->status == self::STATUS_GATEWAY_REJECTED) {
-                $message = __('Transaction declined by gateway: Check card details or try another card');
-            } else if ($result->transaction->status == self::STATUS_PROCESSOR_DECLINED) {
-                if (isset($result->transaction->processorResponseCode) && $result->transaction->processorResponseCode) {
-                    $code = $result->transaction->processorResponseCode;
-                    if (array_key_exists($code, $this->_codesMessages)) {
-                        $prefix = __('Transaction declined: ')->getText();
-                        $message = __($prefix . __($this->_codesMessages[$code])->getText());
-                    }
-                }
-            }
-        }
-        if (!is_object($message)) {
-            $errors = explode("\n", $result->message);
-            $message = '';
-            foreach ($errors as $error) {
-                $message .= rtrim(' ' . __($error)->getText().', ', ', ');
-            }
-            $message = __($message);
-        }
-        if (!is_object($message)) {
-            $message = __("The processor responded with an unknown error");
-        }
-        return $message;
-    }
-
-    /**
-     * If result error is "Unsuccessful transaction cannot be cloned."
-     * 
-     * @param \Braintree_Result_Error $result
-     * @return boolean
-     */
-    public function isCloneUnsuccessfulError($result)
-    {
-        $errors = $result->errors->deepAll();
-        foreach ($errors as $error) {
-            if ($error->code  == self::CLONE_ERROR_CODE) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * If result error is "Unsuccessful transaction nonce can't be used more than once."
-     *
-     * @param \Braintree_Result_Error $result
-     * @return boolean
-     */
-    public function isNonceUsedMoreThanOnceError($result)
-    {
-        $errors = $result->errors->deepAll();
-        foreach ($errors as $error) {
-            if ($error->code  == self::NONCE_USED_MORE_THAN_ONCE) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * If result error is related to input validation
-     *
-     * @param \Braintree_Result_Error $result
-     * @return boolean
-     */
-    public function isCreditCardApiError($result)
-    {
-        $errors = $result->errors->deepAll();
-        foreach ($errors as $error) {
-            if (($error->code > 80000) && ($error->code < 90000)) {
-                return $error->message;
-            }
-        }
-        return false;
-    }
-}
diff --git a/app/code/Magento/BraintreeTwo/Model/Adapter/BraintreeAdapter.php b/app/code/Magento/Braintree/Model/Adapter/BraintreeAdapter.php
similarity index 96%
rename from app/code/Magento/BraintreeTwo/Model/Adapter/BraintreeAdapter.php
rename to app/code/Magento/Braintree/Model/Adapter/BraintreeAdapter.php
index 1c953836c5ae2b8c1a5421d063490c1979893aac..6c2aefc0c3d287aff26f0a785b545127b947c782 100644
--- a/app/code/Magento/BraintreeTwo/Model/Adapter/BraintreeAdapter.php
+++ b/app/code/Magento/Braintree/Model/Adapter/BraintreeAdapter.php
@@ -3,15 +3,15 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Model\Adapter;
+namespace Magento\Braintree\Model\Adapter;
 
 use Braintree\ClientToken;
 use Braintree\Configuration;
 use Braintree\CreditCard;
 use Braintree\PaymentMethodNonce;
 use Braintree\Transaction;
-use Magento\BraintreeTwo\Gateway\Config\Config;
-use Magento\BraintreeTwo\Model\Adminhtml\Source\Environment;
+use Magento\Braintree\Gateway\Config\Config;
+use Magento\Braintree\Model\Adminhtml\Source\Environment;
 
 /**
  * Class BraintreeAdapter
diff --git a/app/code/Magento/Braintree/Model/Adapter/BraintreeClientToken.php b/app/code/Magento/Braintree/Model/Adapter/BraintreeClientToken.php
deleted file mode 100644
index bca4d6f435ad4f7123d86238c6db847c928db685..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Model/Adapter/BraintreeClientToken.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Model\Adapter;
-
-use \Braintree_ClientToken;
-use \Braintree_Result_Error;
-use \Braintree_Result_Successful;
-
-/**
- * BraintreeClientToken
- *
- * @codeCoverageIgnore
- */
-class BraintreeClientToken
-{
-    /**
-     * @param array $params
-     * @return \Braintree_Result_Successful|\Braintree_Result_Error|null
-     */
-    public function generate(array $params = [])
-    {
-        try {
-            return \Braintree_ClientToken::generate($params);
-        } catch (\Exception $e) {
-            return null;
-        }
-    }
-}
diff --git a/app/code/Magento/Braintree/Model/Adapter/BraintreeConfiguration.php b/app/code/Magento/Braintree/Model/Adapter/BraintreeConfiguration.php
deleted file mode 100644
index 9dc59d7adb4b5322e8e2212e53ae65ddb00d72e5..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Model/Adapter/BraintreeConfiguration.php
+++ /dev/null
@@ -1,52 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Model\Adapter;
-
-use \Braintree_Configuration;
-
-/**
- * BraintreeConfiguration
- *
- * @codeCoverageIgnore
- */
-class BraintreeConfiguration
-{
-    /**
-     * @param string|null $value
-     * @return mixed
-     */
-    public function environment($value = null)
-    {
-        return \Braintree_Configuration::environment($value);
-    }
-
-    /**
-     * @param string|null $value
-     * @return mixed
-     */
-    public function merchantId($value = null)
-    {
-        return \Braintree_Configuration::merchantId($value);
-    }
-
-    /**
-     * @param string|null $value
-     * @return mixed
-     */
-    public function publicKey($value = null)
-    {
-        return \Braintree_Configuration::publicKey($value);
-    }
-
-    /**
-     * @param string|null $value
-     * @return mixed
-     */
-    public function privateKey($value = null)
-    {
-        return \Braintree_Configuration::privateKey($value);
-    }
-}
diff --git a/app/code/Magento/Braintree/Model/Adapter/BraintreeCreditCard.php b/app/code/Magento/Braintree/Model/Adapter/BraintreeCreditCard.php
deleted file mode 100644
index eb45c76eea6a257eb22c5d98fd3c7fcecf9e5b30..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Model/Adapter/BraintreeCreditCard.php
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Model\Adapter;
-
-use \Braintree_CreditCard;
-use \Braintree_Result_Error;
-use \Braintree_Result_Successful;
-
-/**
- * BraintreeCreditCard
- *
- * @codeCoverageIgnore
- */
-class BraintreeCreditCard
-{
-    /**
-     * @param string $id
-     * @return \Braintree_CreditCard
-     */
-    public function find($token)
-    {
-        return \Braintree_CreditCard::find($token);
-    }
-
-    /**
-     * @param string $token
-     * @return \Braintree_Result_Successful
-     */
-    public function delete($token)
-    {
-        return \Braintree_CreditCard::delete($token);
-    }
-}
diff --git a/app/code/Magento/Braintree/Model/Adapter/BraintreeCustomer.php b/app/code/Magento/Braintree/Model/Adapter/BraintreeCustomer.php
deleted file mode 100644
index 65e5706eeb1a11203d42a5e9b2731003d65c8889..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Model/Adapter/BraintreeCustomer.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Model\Adapter;
-
-use \Braintree_Customer;
-use \Braintree_Result_Successful;
-
-/**
- * BraintreeCustomer
- *
- * @codeCoverageIgnore
- */
-class BraintreeCustomer
-{
-    /**
-     * @param string $customerId
-     * @return \Braintree_Customer
-     */
-    public function find($customerId)
-    {
-        return \Braintree_Customer::find($customerId);
-    }
-
-    /**
-     * @param string $customerId
-     * @return \Braintree_Result_Successful
-     */
-    public function delete($customerId)
-    {
-        return \Braintree_Customer::delete($customerId);
-    }
-
-    /**
-     * @param array $customerRequest
-     * @return \Braintree_Customer
-     */
-    public function create(array $customerRequest)
-    {
-        return \Braintree_Customer::create($customerRequest);
-    }
-}
diff --git a/app/code/Magento/Braintree/Model/Adapter/BraintreePaymentMethod.php b/app/code/Magento/Braintree/Model/Adapter/BraintreePaymentMethod.php
deleted file mode 100644
index ece8eb611411549dcbebd0ac288d84a55a5f336d..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Model/Adapter/BraintreePaymentMethod.php
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Model\Adapter;
-
-use \Braintree_PaymentMethod;
-use \Braintree_PaymentMethodNonce;
-use \Braintree_Result_Error;
-use \Braintree_Result_Successful;
-
-/**
- * BraintreePaymentMethod
- *
- * @codeCoverageIgnore
- */
-class BraintreePaymentMethod
-{
-    /**
-     * @param array $attribs
-     * @return \Braintree_Result_Successful|\Braintree_Result_Error
-     */
-    public function create(array $attribs)
-    {
-        return \Braintree_PaymentMethod::create($attribs);
-    }
-
-    /**
-     * @param string $token
-     * @param array $attribs
-     * @return \Braintree_Result_Successful|\Braintree_Result_Error
-     */
-    public function update($token, array $attribs)
-    {
-        return \Braintree_PaymentMethod::update($token, $attribs);
-    }
-
-    /**
-     * @param string $token
-     * @return \Braintree_Result_Successful|\Braintree_Result_Error
-     */
-    public function createNonce($token)
-    {
-        return \Braintree_PaymentMethodNonce::create($token);
-    }
-}
diff --git a/app/code/Magento/BraintreeTwo/Model/Adapter/BraintreeSearchAdapter.php b/app/code/Magento/Braintree/Model/Adapter/BraintreeSearchAdapter.php
similarity index 97%
rename from app/code/Magento/BraintreeTwo/Model/Adapter/BraintreeSearchAdapter.php
rename to app/code/Magento/Braintree/Model/Adapter/BraintreeSearchAdapter.php
index d4a365a7ba16b61c48f24c3f5f910cb9f006beb5..194706ba8eb9a53124d30867d69cf3e17048779c 100644
--- a/app/code/Magento/BraintreeTwo/Model/Adapter/BraintreeSearchAdapter.php
+++ b/app/code/Magento/Braintree/Model/Adapter/BraintreeSearchAdapter.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Model\Adapter;
+namespace Magento\Braintree\Model\Adapter;
 
 use Braintree\MultipleValueNode;
 use Braintree\RangeNode;
diff --git a/app/code/Magento/Braintree/Model/Adapter/BraintreeTransaction.php b/app/code/Magento/Braintree/Model/Adapter/BraintreeTransaction.php
deleted file mode 100644
index 8e5a20d358fbee036d7289caa567ccd166ebeada..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Model/Adapter/BraintreeTransaction.php
+++ /dev/null
@@ -1,75 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Model\Adapter;
-
-use \Braintree_Transaction;
-use \Braintree_Result_Error;
-use \Braintree_Result_Successful;
-
-/**
- * BraintreeTransaction
- *
- * @codeCoverageIgnore
- */
-class BraintreeTransaction
-{
-    /**
-     * @param array $attribs
-     * @return \Braintree_Result_Successful|\Braintree_Result_Error
-     */
-    public function sale(array $attribs)
-    {
-        return \Braintree_Transaction::sale($attribs);
-    }
-
-    /**
-     * @param string $transactionId
-     * @param null|float $amount
-     * @return \Braintree_Result_Successful|\Braintree_Result_Error
-     */
-    public function submitForSettlement($transactionId, $amount = null)
-    {
-        return \Braintree_Transaction::submitForSettlement($transactionId, $amount);
-    }
-
-    /**
-     * @param string $id
-     * @return \Braintree_Transaction
-     */
-    public function find($id)
-    {
-        return \Braintree_Transaction::find($id);
-    }
-
-    /**
-     * @param string $transactionId
-     * @return \Braintree_Result_Successful|\Braintree_Result_Error
-     */
-    public function void($transactionId)
-    {
-        return \Braintree_Transaction::void($transactionId);
-    }
-
-    /**
-     * @param string $transactionId
-     * @param null|float $amount
-     * @return \Braintree_Result_Successful|\Braintree_Result_Error
-     */
-    public function refund($transactionId, $amount = null)
-    {
-        return \Braintree_Transaction::refund($transactionId, $amount);
-    }
-
-    /**
-     * @param string $transactionId
-     * @param array $attribs
-     * @return \Braintree_Result_Successful|\Braintree_Result_Error
-     */
-    public function cloneTransaction($transactionId, array $attribs)
-    {
-        return \Braintree_Transaction::cloneTransaction($transactionId, $attribs);
-    }
-}
diff --git a/app/code/Magento/BraintreeTwo/Model/Adminhtml/Source/CcType.php b/app/code/Magento/Braintree/Model/Adminhtml/Source/CcType.php
similarity index 95%
rename from app/code/Magento/BraintreeTwo/Model/Adminhtml/Source/CcType.php
rename to app/code/Magento/Braintree/Model/Adminhtml/Source/CcType.php
index 284d9eb370c30622900906c99cd1f75ae6b944a2..7f1cb8f8cd2c2ecdb4425b16ecbbd36db1e0dbe7 100644
--- a/app/code/Magento/BraintreeTwo/Model/Adminhtml/Source/CcType.php
+++ b/app/code/Magento/Braintree/Model/Adminhtml/Source/CcType.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Model\Adminhtml\Source;
+namespace Magento\Braintree\Model\Adminhtml\Source;
 
 /**
  * Class CcType
diff --git a/app/code/Magento/BraintreeTwo/Model/Adminhtml/Source/Environment.php b/app/code/Magento/Braintree/Model/Adminhtml/Source/Environment.php
similarity index 92%
rename from app/code/Magento/BraintreeTwo/Model/Adminhtml/Source/Environment.php
rename to app/code/Magento/Braintree/Model/Adminhtml/Source/Environment.php
index 3990ead5cf187b9d515879138b62cd4c8485c2e2..636d924df2ac2adaafc9104028ab7aeb52886f0e 100644
--- a/app/code/Magento/BraintreeTwo/Model/Adminhtml/Source/Environment.php
+++ b/app/code/Magento/Braintree/Model/Adminhtml/Source/Environment.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Model\Adminhtml\Source;
+namespace Magento\Braintree\Model\Adminhtml\Source;
 
 use Magento\Framework\Option\ArrayInterface;
 
diff --git a/app/code/Magento/BraintreeTwo/Model/Adminhtml/Source/PaymentAction.php b/app/code/Magento/Braintree/Model/Adminhtml/Source/PaymentAction.php
similarity index 92%
rename from app/code/Magento/BraintreeTwo/Model/Adminhtml/Source/PaymentAction.php
rename to app/code/Magento/Braintree/Model/Adminhtml/Source/PaymentAction.php
index b23cac564ee683561ff3795fb09734394d10f979..0b2887d6a9a1b72a83395a6d673cbeb43eba0719 100644
--- a/app/code/Magento/BraintreeTwo/Model/Adminhtml/Source/PaymentAction.php
+++ b/app/code/Magento/Braintree/Model/Adminhtml/Source/PaymentAction.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Model\Adminhtml\Source;
+namespace Magento\Braintree\Model\Adminhtml\Source;
 
 use Magento\Payment\Model\Method\AbstractMethod;
 use Magento\Framework\Option\ArrayInterface;
diff --git a/app/code/Magento/BraintreeTwo/Model/Adminhtml/System/Config/Country.php b/app/code/Magento/Braintree/Model/Adminhtml/System/Config/Country.php
similarity index 97%
rename from app/code/Magento/BraintreeTwo/Model/Adminhtml/System/Config/Country.php
rename to app/code/Magento/Braintree/Model/Adminhtml/System/Config/Country.php
index d7549dded21c006762118b03966b7807dfe71523..2f761e59adac24057310121b24bf44acdfe8b681 100644
--- a/app/code/Magento/BraintreeTwo/Model/Adminhtml/System/Config/Country.php
+++ b/app/code/Magento/Braintree/Model/Adminhtml/System/Config/Country.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Model\Adminhtml\System\Config;
+namespace Magento\Braintree\Model\Adminhtml\System\Config;
 
 use Magento\Directory\Model\ResourceModel\Country\Collection;
 use Magento\Framework\Option\ArrayInterface;
diff --git a/app/code/Magento/BraintreeTwo/Model/Adminhtml/System/Config/CountryCreditCard.php b/app/code/Magento/Braintree/Model/Adminhtml/System/Config/CountryCreditCard.php
similarity index 98%
rename from app/code/Magento/BraintreeTwo/Model/Adminhtml/System/Config/CountryCreditCard.php
rename to app/code/Magento/Braintree/Model/Adminhtml/System/Config/CountryCreditCard.php
index dcd6c19b5a27b47457c14c6bc52803b415e9dfc5..e5e232de072f88309384f4b36f65040fef6e7f55 100644
--- a/app/code/Magento/BraintreeTwo/Model/Adminhtml/System/Config/CountryCreditCard.php
+++ b/app/code/Magento/Braintree/Model/Adminhtml/System/Config/CountryCreditCard.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Model\Adminhtml\System\Config;
+namespace Magento\Braintree\Model\Adminhtml\System\Config;
 
 use Magento\Framework\App\Cache\TypeListInterface;
 use Magento\Framework\App\Config\ScopeConfigInterface;
diff --git a/app/code/Magento/Braintree/Model/Checkout.php b/app/code/Magento/Braintree/Model/Checkout.php
deleted file mode 100644
index 3e5ad0e46acd025a4f6960e818b8ae0961a2fa7a..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Model/Checkout.php
+++ /dev/null
@@ -1,164 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Model;
-
-use Magento\Sales\Model\Order\Payment;
-use Magento\Quote\Model\Quote;
-use Magento\Braintree\Model\PaymentMethod\PayPal as BraintreePayPal;
-use Magento\Customer\Model\AccountManagement;
-use Magento\Quote\Model\Quote\Address;
-
-class Checkout extends \Magento\Paypal\Model\Express\Checkout
-{
-    /**
-     * Payment method type
-     *
-     * @var string
-     */
-    protected $_methodType = BraintreePayPal::METHOD_CODE;
-
-    /**
-     * Update quote when returned from PayPal
-     * export shipping address in case address absence
-     *
-     * @param string $paymentMethodNonce
-     * @param array $details
-     * @return void
-     */
-    public function initializeQuoteForReview($paymentMethodNonce, array $details)
-    {
-        $quote = $this->_quote;
-
-        $this->populateQuoteAddress($quote, $details);
-
-        // import payment info
-        $payment = $quote->getPayment();
-        $payment->setMethod($this->_methodType);
-        $payment->setAdditionalInformation('payment_method_nonce', $paymentMethodNonce);
-        $payment->setAdditionalInformation('payerEmail', $details['email']);
-        $payment->setAdditionalInformation('payerFirstName', $details['firstName']);
-        $payment->setAdditionalInformation('payerLastName', $details['lastName']);
-
-        $this->_quote->setMayEditShippingAddress(
-            true
-        );
-        $this->_quote->setMayEditShippingMethod(
-            true
-        );
-
-        $this->ignoreAddressValidation();
-
-        $quote->collectTotals();
-        $this->quoteRepository->save($quote);
-    }
-
-    /**
-     * @param \Magento\Quote\Model\Quote $quote
-     * @param array $details
-     * @return $this
-     * @SuppressWarnings(PHPMD.NPathComplexity)
-     */
-    protected function populateQuoteAddress($quote, $details)
-    {
-        // import shipping address
-        $exportedShippingAddress = isset($details['shippingAddress']) ? $details['shippingAddress'] : null;
-        if (!$quote->getIsVirtual()) {
-            $shippingAddress = $quote->getShippingAddress();
-            if ($exportedShippingAddress) {
-                $this->importAddressData($shippingAddress, $exportedShippingAddress);
-            }
-            // PayPal doesn't provide detailed shipping info: prefix, suffix
-            $shippingAddress->setLastname($details['lastName']);
-            $shippingAddress->setFirstname($details['firstName']);
-            $shippingAddress->setEmail($details['email']);
-            $shippingAddress->setCollectShippingRates(true);
-        }
-
-        $exportedBillingAddress = isset($details['billingAddress']) ? $details['billingAddress'] : null;
-        $billingAddress = $quote->getBillingAddress();
-        if ($exportedBillingAddress) {
-            $this->importBillingAddressData($billingAddress, $exportedBillingAddress);
-            $billingAddress->setFirstname($details['firstName']);
-            $billingAddress->setLastname($details['lastName']);
-            $billingAddress->setEmail($details['email']);
-        } elseif ($exportedShippingAddress) {
-            $this->importAddressData($billingAddress, $exportedShippingAddress);
-            $billingAddress->setFirstname($details['firstName']);
-            $billingAddress->setLastname($details['lastName']);
-            $billingAddress->setEmail($details['email']);
-        }
-
-        return $this;
-    }
-
-    /**
-     * Make sure addresses will be saved without validation errors
-     *
-     * @return void
-     */
-    private function ignoreAddressValidation()
-    {
-        $this->_quote->getBillingAddress()->setShouldIgnoreValidation(true);
-        if (!$this->_quote->getIsVirtual()) {
-            $this->_quote->getShippingAddress()->setShouldIgnoreValidation(true);
-            if (!$this->_quote->getBillingAddress()->getEmail()) {
-                $this->_quote->getBillingAddress()->setSameAsBilling(1);
-            }
-        }
-    }
-
-    /**
-     * Sets address data from exported address
-     *
-     * @param Address $address
-     * @param array $exportedAddress
-     * @return $this
-     */
-    protected function importAddressData($address, $exportedAddress)
-    {
-        $extendedAddress = isset($exportedAddress['extendedAddress']) ? $exportedAddress['extendedAddress'] : null;
-        $address->setStreet([$exportedAddress['streetAddress'], $extendedAddress]);
-        $address->setCity($exportedAddress['locality']);
-        $address->setRegionCode($exportedAddress['region']);
-        $address->setCountryId($exportedAddress['countryCodeAlpha2']);
-        $address->setPostcode($exportedAddress['postalCode']);
-        return $this;
-    }
-
-    /**
-     * The billing address returned from Braintree may have different format than the shipping address
-     *
-     * @param Address $address
-     * @param array $exportedAddress
-     * @return $this
-     * @SuppressWarnings(PHPMD.NPathComplexity)
-     */
-    protected function importBillingAddressData($address, $exportedAddress)
-    {
-        $line1 = isset($exportedAddress['streetAddress']) ?
-            $exportedAddress['streetAddress'] :
-            $exportedAddress['line1'];
-        $line2 = isset($exportedAddress['extendedAddress']) ?
-            $exportedAddress['extendedAddress'] :
-            $exportedAddress['line2'];
-        $city = isset($exportedAddress['locality']) ?
-            $exportedAddress['locality'] :
-            $exportedAddress['city'];
-        $regionCode = isset($exportedAddress['region']) ?
-            $exportedAddress['region'] :
-            $exportedAddress['state'];
-        $countryCode = isset($exportedAddress['countryCodeAlpha2']) ?
-            $exportedAddress['countryCodeAlpha2'] :
-            $exportedAddress['countryCode'];
-
-        $address->setStreet([$line1, $line2]);
-        $address->setCity($city);
-        $address->setRegionCode($regionCode);
-        $address->setCountryId($countryCode);
-        $address->setPostcode($exportedAddress['postalCode']);
-        return $this;
-    }
-}
diff --git a/app/code/Magento/Braintree/Model/Config.php b/app/code/Magento/Braintree/Model/Config.php
deleted file mode 100644
index 5d4116f33089419c3581c526c25a5be0574c5b95..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Model/Config.php
+++ /dev/null
@@ -1,214 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Model;
-
-use Magento\Braintree\Model\Adapter\BraintreeConfiguration;
-use Magento\Braintree\Model\Adapter\BraintreeClientToken;
-use \Magento\Framework\App\Config\ScopeConfigInterface;
-
-class Config
-{
-    const KEY_ENVIRONMENT = 'environment';
-    const KEY_MERCHANT_ACCOUNT_ID = 'merchant_account_id';
-    const KEY_ALLOW_SPECIFIC = 'allowspecific';
-    const KEY_SPECIFIC_COUNTRY = 'specificcountry';
-    const KEY_ACTIVE = 'active';
-    const KEY_MERCHANT_ID = 'merchant_id';
-    const KEY_PUBLIC_KEY = 'public_key';
-    const KEY_PRIVATE_KEY = 'private_key';
-    const KEY_DEBUG = 'debug';
-
-    /**
-     * @var string
-     */
-    protected $methodCode = 'braintree';
-
-    /**
-     * @var ScopeConfigInterface
-     */
-    protected $scopeConfig;
-
-    /**
-     * @var string
-     */
-    protected $merchantAccountId = '';
-
-    /**
-     * @var string
-     */
-    protected $clientToken;
-
-    /**
-     * @var int
-     */
-    protected $storeId = null;
-
-    /**
-     * @var \Magento\Braintree\Model\System\Config\Source\Country
-     */
-    protected $sourceCountry;
-
-    /**
-     * @var BraintreeConfiguration
-     */
-    protected $braintreeConfiguration;
-
-    /**
-     * @var BraintreeClientToken
-     */
-    protected $braintreeClientToken;
-
-    /**
-     * @var array
-     */
-    protected $braintreeSharedConfigFields = [
-        'environment' => true,
-        'merchant_account_id' => true,
-        'merchant_id' => false,
-        'public_key' => true,
-        'private_key' => false,
-    ];
-
-    /**
-     * @param ScopeConfigInterface $scopeConfig
-     * @param BraintreeConfiguration $braintreeConfiguration
-     * @param BraintreeClientToken $braintreeClientToken
-     * @param \Magento\Braintree\Model\System\Config\Source\Country $sourceCountry
-     */
-    public function __construct(
-        ScopeConfigInterface $scopeConfig,
-        BraintreeConfiguration $braintreeConfiguration,
-        BraintreeClientToken $braintreeClientToken,
-        \Magento\Braintree\Model\System\Config\Source\Country $sourceCountry
-    ) {
-        $this->scopeConfig = $scopeConfig;
-        $this->braintreeConfiguration = $braintreeConfiguration;
-        $this->braintreeClientToken = $braintreeClientToken;
-        $this->sourceCountry = $sourceCountry;
-        if ($this->getConfigData(self::KEY_ACTIVE) == 1) {
-            $this->initEnvironment(null);
-        }
-    }
-
-    /**
-     * @param int $storeId
-     * @return $this
-     */
-    public function setStoreId($storeId)
-    {
-        $this->storeId = $storeId;
-        return $this;
-    }
-
-    /**
-     * Retrieve information from payment configuration
-     *
-     * @param string $field
-     * @param null|string $storeId
-     *
-     * @return mixed
-     */
-    public function getConfigData($field, $storeId = null)
-    {
-        if ($storeId == null) {
-            $storeId = $this->storeId;
-        }
-        if (array_key_exists($field, $this->braintreeSharedConfigFields)) {
-            $code = PaymentMethod::METHOD_CODE;
-        } else {
-            $code = $this->methodCode;
-        }
-        $path = 'payment/' . $code . '/' . $field;
-        return $this->scopeConfig->getValue($path, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $storeId);
-    }
-
-    /**
-     * Initializes environment. This function can be called more than once with different storeId
-     *
-     * @param int $storeId
-     * @return $this
-     */
-    public function initEnvironment($storeId)
-    {
-        if ($this->getConfigData('environment', $storeId) ==
-            \Magento\Braintree\Model\Source\Environment::ENVIRONMENT_PRODUCTION) {
-            $this->braintreeConfiguration->environment(
-                \Magento\Braintree\Model\Source\Environment::ENVIRONMENT_PRODUCTION
-            );
-        } else {
-            $this->braintreeConfiguration->environment(
-                \Magento\Braintree\Model\Source\Environment::ENVIRONMENT_SANDBOX
-            );
-        }
-        $this->braintreeConfiguration->merchantId($this->getConfigData(self::KEY_MERCHANT_ID, $storeId));
-        $this->braintreeConfiguration->publicKey($this->getConfigData(self::KEY_PUBLIC_KEY, $storeId));
-        $this->braintreeConfiguration->privateKey($this->getConfigData(self::KEY_PRIVATE_KEY, $storeId));
-        $this->merchantAccountId = $this->getConfigData(self::KEY_MERCHANT_ACCOUNT_ID, $storeId);
-        $this->storeId = $storeId;
-        //Need to set clientToken to null after initialization
-        $this->clientToken = null;
-        return $this;
-    }
-
-    /**
-     * @return bool
-     */
-    public function isActive()
-    {
-        return (bool)(int)$this->getConfigData(self::KEY_ACTIVE, $this->storeId);
-    }
-
-    /**
-     * Generate a new client token if necessary
-     *
-     * @return string
-     */
-    public function getClientToken()
-    {
-        if ($this->clientToken == null) {
-            $this->clientToken = $this->braintreeClientToken->generate();
-        }
-        return $this->clientToken;
-    }
-
-    /**
-     * To check billing country is allowed for the payment method
-     *
-     * @param string $country
-     * @return bool
-     */
-    public function canUseForCountry($country)
-    {
-        /*
-        for specific country, the flag will set up as 1
-        */
-        if ($this->getConfigData(self::KEY_ALLOW_SPECIFIC) == 1) {
-            $availableCountries = explode(',', $this->getConfigData(self::KEY_SPECIFIC_COUNTRY));
-            if (!in_array($country, $availableCountries)) {
-                return false;
-            }
-        } elseif ($this->sourceCountry->isCountryRestricted($country)) {
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * @return string
-     */
-    public function getMerchantAccountId()
-    {
-        return $this->merchantAccountId;
-    }
-
-    /**
-     * @return bool
-     */
-    public function isDebugEnabled()
-    {
-        return (bool)(int)$this->getConfigData(self::KEY_DEBUG);
-    }
-}
diff --git a/app/code/Magento/Braintree/Model/Config/Cc.php b/app/code/Magento/Braintree/Model/Config/Cc.php
deleted file mode 100644
index fcae6bb32a4622db09010defa4d3a073f63f9159..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Model/Config/Cc.php
+++ /dev/null
@@ -1,220 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Model\Config;
-
-use \Braintree_CreditCard;
-use \Braintree_PaymentMethod;
-use \Braintree_Exception;
-use \Braintree_Customer;
-use \Braintree_Transaction;
-use \Braintree_Configuration;
-use \Braintree_Result_Successful;
-use \Braintree_ClientToken;
-use Magento\Framework\Exception\LocalizedException;
-use Magento\Sales\Model\ResourceModel\Order\Payment\Transaction\CollectionFactory as TransactionCollectionFactory;
-use Magento\Sales\Model\Order\Payment\Transaction as PaymentTransaction;
-use Magento\Payment\Model\InfoInterface;
-
-class Cc extends \Magento\Braintree\Model\Config
-{
-    const KEY_USE_VAULT = 'use_vault';
-    const KEY_ALLOW_DUPLICATE_CARD = 'duplicate_card';
-    const KEY_USE_CVV = 'useccv';
-    const KEY_VERIFY_3DSCURE = 'verify_3dsecure';
-    const KEY_ADVANCED_FRAUD_PROTECTION = 'fraudprotection';
-    const KEY_ADVANCED_FRAUD_JS = 'data_js';
-    const KEY_COUNTRY_CREDIT_CARD = 'countrycreditcard';
-    const KEY_CC_TYPES = 'cctypes';
-    const KEY_ACTIVE = 'active';
-    const KEY_FRAUD_PROTECTION = 'fraudprotection';
-    const KEY_AUTO_DETECTION = 'enable_cc_detection';
-
-    /**
-     * @var string
-     */
-    protected $methodCode = 'braintree';
-
-    /**
-     * @var \Magento\Customer\Model\Session
-     */
-    protected $customerSession;
-
-    /**
-     * @var \Magento\Customer\Model\CustomerFactory
-     */
-    protected $customerFactory;
-
-    /**
-     * @var \Magento\Directory\Model\ResourceModel\Country\CollectionFactory $countryCollectionFactory
-     */
-    protected $countryFactory;
-
-    /**
-     * @var \Magento\Braintree\Model\System\Config\Source\Country
-     */
-    protected $sourceCountry;
-
-    /**
-     *
-     * @param string $country
-     * @param string $ccType
-     * @return bool|\Magento\Framework\Phrase
-     */
-    public function canUseCcTypeForCountry($country, $ccType)
-    {
-        try {
-            $countriesCardTypes = unserialize($this->getConfigData(self::KEY_COUNTRY_CREDIT_CARD));
-        } catch (\Exception $e) {
-            $countriesCardTypes = false;
-        }
-        $countryFound = false;
-        if ($countriesCardTypes) {
-            if (array_key_exists($country, $countriesCardTypes)) {
-                if (!in_array($ccType, $countriesCardTypes[$country])) {
-                    return __('Credit card type is not allowed for your country.');
-                }
-                $countryFound = true;
-            }
-        }
-        if (!$countryFound) {
-            $availableTypes = explode(',', $this->getConfigData(self::KEY_CC_TYPES));
-            if (!in_array($ccType, $availableTypes)) {
-                return __('Credit card type is not allowed for this payment method.');
-            }
-        }
-        return false;
-    }
-
-    /**
-     * If there are any card types for country
-     *
-     * @param string $country
-     * @return array
-     */
-    public function getApplicableCardTypes($country)
-    {
-        try {
-            $countriesCardTypes = unserialize($this->getConfigData(self::KEY_COUNTRY_CREDIT_CARD));
-        } catch (\Exception $e) {
-            $countriesCardTypes = false;
-        }
-        if ($countriesCardTypes && array_key_exists($country, $countriesCardTypes)) {
-            $allowedTypes = $countriesCardTypes[$country];
-        } else {
-            $allowedTypes = explode(',', $this->getConfigData(self::KEY_CC_TYPES));
-        }
-        if (!is_array($allowedTypes)) {
-            $allowedTypes = [$allowedTypes];
-        }
-        return $allowedTypes;
-    }
-
-    /**
-     * Return the country specific card type config
-     *
-     * @return array
-     */
-    public function getCountrySpecificCardTypeConfig()
-    {
-        try {
-            $countriesCardTypes = unserialize($this->getConfigData(self::KEY_COUNTRY_CREDIT_CARD));
-        } catch (\Exception $e) {
-            $countriesCardTypes = false;
-        }
-
-        return $countriesCardTypes ? $countriesCardTypes : [];
-    }
-
-    //@codeCoverageIgnoreStart
-    /**
-     * @return bool
-     */
-    public function isActive()
-    {
-        return (bool)(int)$this->getConfigData(self::KEY_ACTIVE, $this->storeId);
-    }
-
-    /**
-     * If vault can be used
-     *
-     * @return bool
-     */
-    public function useVault()
-    {
-        return (bool)(int)$this->getConfigData(self::KEY_USE_VAULT, $this->storeId);
-    }
-
-    /**
-     * If duplicate credit cards are allowed
-     *
-     * @return bool
-     */
-    public function allowDuplicateCards()
-    {
-        return (bool)(int)$this->getConfigData(self::KEY_ALLOW_DUPLICATE_CARD, $this->storeId);
-    }
-
-    /**
-     * If 3dSecure is enabled
-     *
-     * @return bool
-     */
-    public function is3dSecureEnabled()
-    {
-        return (bool)(int)$this->getConfigData(self::KEY_VERIFY_3DSCURE, $this->storeId);
-    }
-
-    /**
-     * If Fraud Detection is enabled
-     *
-     * @return bool
-     */
-    public function isFraudDetectionEnabled()
-    {
-        return (bool)(int)$this->getConfigData(self::KEY_ADVANCED_FRAUD_PROTECTION, $this->storeId);
-    }
-
-    /**
-     * If Credit Card Auto Detection is enabled
-     *
-     * @return bool
-     */
-    public function isCcDetectionEnabled()
-    {
-        return (bool)(int)$this->getConfigData(self::KEY_AUTO_DETECTION, $this->storeId);
-    }
-
-
-    /**
-     * Get Advanced Fraud JS
-     *
-     * @return string
-     */
-    public function getBraintreeDataJs()
-    {
-        return $this->getConfigData(self::KEY_ADVANCED_FRAUD_JS);
-    }
-
-
-    /**
-     * If to validate cvv
-     *
-     * @return boolean
-     */
-    public function useCvv()
-    {
-        return (bool)(int)$this->getConfigData(self::KEY_USE_CVV, $this->storeId);
-    }
-
-    /**
-     * @return bool
-     */
-    public function isFraudProtectionEnabled()
-    {
-        return (bool)(int)$this->getConfigData(self::KEY_FRAUD_PROTECTION, $this->storeId);
-    }
-    //@codeCoverageIgnoreEnd
-}
diff --git a/app/code/Magento/Braintree/Model/Config/PayPal.php b/app/code/Magento/Braintree/Model/Config/PayPal.php
deleted file mode 100644
index 6c25173a6c35faf744a091757df2b72bb94707d0..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Model/Config/PayPal.php
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Model\Config;
-
-class PayPal extends \Magento\Braintree\Model\Config
-{
-    const KEY_MERCHANT_NAME_OVERRIDE = 'merchant_name_override';
-    const KEY_DISPLAY_ON_SHOPPING_CART = 'display_on_shopping_cart';
-    const KEY_REQUIRE_BILLING_ADDRESS = 'require_billing_address';
-
-    /**
-     * @var string
-     */
-    protected $methodCode = 'braintree_paypal';
-
-    /**
-     * @return string
-     */
-    public function getMerchantNameOverride()
-    {
-        return $this->getConfigData(self::KEY_MERCHANT_NAME_OVERRIDE);
-    }
-
-    /**
-     * @return bool
-     */
-    public function isShortcutCheckoutEnabled()
-    {
-        return (bool)(int)$this->getConfigData(self::KEY_DISPLAY_ON_SHOPPING_CART);
-    }
-
-    /**
-     * @return bool
-     */
-    public function isBillingAddressEnabled()
-    {
-        return (bool)(int)$this->getConfigData(self::KEY_REQUIRE_BILLING_ADDRESS);
-    }
-}
diff --git a/app/code/Magento/Braintree/Model/ConfigProvider.php b/app/code/Magento/Braintree/Model/ConfigProvider.php
deleted file mode 100644
index 831bfc53ab0cbcfa825d242e07c2ac33607b1e54..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Model/ConfigProvider.php
+++ /dev/null
@@ -1,195 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Model;
-
-use Magento\Payment\Model\CcGenericConfigProvider;
-use Magento\Payment\Helper\Data as PaymentHelper;
-use Magento\Payment\Model\CcConfig;
-use \Magento\Braintree\Model\PaymentMethod;
-
-class ConfigProvider extends CcGenericConfigProvider
-{
-
-    /**
-     * @var string[]
-     */
-    protected $methodCodes = [
-        PaymentMethod::METHOD_CODE,
-    ];
-
-    /**
-     * @var \Magento\Braintree\Model\Vault
-     */
-    protected $vault;
-
-    /**
-     * @var \Magento\Braintree\Model\Config\Cc
-     */
-    protected $config;
-
-    /**
-     * @var \Magento\Checkout\Model\Session
-     */
-    protected $checkoutSession;
-
-    /**
-     * @var \Magento\Customer\Model\Session
-     */
-    protected $customerSession;
-
-    /**
-     * @var \Magento\Braintree\Helper\Data
-     */
-    protected $dataHelper;
-
-    /**
-     * Url Builder
-     *
-     * @var \Magento\Framework\Url
-     */
-    protected $urlBuilder;
-
-    /**
-     * @param CcConfig $ccConfig
-     * @param PaymentHelper $paymentHelper
-     * @param \Magento\Braintree\Model\Vault $vault
-     * @param \Magento\Braintree\Model\Config\Cc $config
-     * @param \Magento\Checkout\Model\Session $checkoutSession
-     * @param \Magento\Customer\Model\Session $customerSession
-     * @param \Magento\Framework\Url $urlBuilder
-     * @param \Magento\Braintree\Helper\Data $dataHelper
-     */
-    public function __construct(
-        CcConfig $ccConfig,
-        PaymentHelper $paymentHelper,
-        \Magento\Braintree\Model\Vault $vault,
-        \Magento\Braintree\Model\Config\Cc $config,
-        \Magento\Checkout\Model\Session $checkoutSession,
-        \Magento\Customer\Model\Session $customerSession,
-        \Magento\Framework\Url $urlBuilder,
-        \Magento\Braintree\Helper\Data $dataHelper
-    ) {
-        parent::__construct($ccConfig, $paymentHelper);
-        $this->vault = $vault;
-        $this->config = $config;
-        $this->checkoutSession = $checkoutSession;
-        $this->customerSession = $customerSession;
-        $this->urlBuilder = $urlBuilder;
-        $this->dataHelper = $dataHelper;
-    }
-
-    /**
-     * Returns applicable stored cards
-     *
-     * @return array
-     */
-    public function getStoredCards()
-    {
-        return $this->vault->currentCustomerStoredCards();
-    }
-
-    /**
-     * Retrieve available credit card types
-     *
-     * @return array
-     */
-    protected function getCcAvailableCcTypes()
-    {
-        return $this->dataHelper->getCcAvailableCardTypes();
-    }
-
-    /**
-     * If card can be saved for further use
-     *
-     * @return boolean
-     */
-    public function canSaveCard()
-    {
-        if ($this->config->useVault() && $this->customerSession->isLoggedIn()) {
-            return true;
-        }
-        return false;
-    }
-
-    /**
-     * If 3dsecure is enabled
-     *
-     * @return boolean
-     */
-    public function show3dSecure()
-    {
-        if ($this->config->is3dSecureEnabled()) {
-            return true;
-        }
-        return false;
-    }
-
-    /**
-     * Get generate nonce URL
-     *
-     * @return string
-     */
-    public function getAjaxGenerateNonceUrl()
-    {
-        return $this->urlBuilder->getUrl('braintree/creditcard/generate', ['_secure' => true]);
-    }
-
-    /**
-     * @return array|void
-     */
-    public function getConfig()
-    {
-        if (!$this->config->isActive()) {
-            return [];
-        }
-        $config = parent::getConfig();
-
-        $clientToken = $this->config->getClientToken();
-        $useVault = $this->config->useVault();
-        $selectedCardToken = null;
-        $storedCardOptions = [];
-        if ($useVault) {
-            $storedCards = $this->getStoredCards();
-            if (count($storedCards) == 0) {
-                $useVault = false;
-            } else {
-                foreach ($storedCards as $creditCard) {
-                    $storedCardOptions[] = [
-                        'token' => $creditCard->token,
-                        'maskedNumber' => $creditCard->maskedNumber . ' - ' . $creditCard->cardType,
-                        'selected' => $creditCard->default,
-                        'type' => $this->dataHelper->getCcTypeCodeByName($creditCard->cardType),
-                    ];
-                    if ($creditCard->default) {
-                        $selectedCardToken = $creditCard->token;
-                    }
-                }
-            }
-        }
-        $config = array_merge_recursive($config, [
-            'payment' => [
-                'braintree' => [
-                    'clientToken' => $clientToken,
-                    'useVault' => $useVault,
-                    'canSaveCard' => $this->canSaveCard(),
-                    'show3dSecure' => $this->show3dSecure(),
-                    'storedCards' => $storedCardOptions,
-                    'selectedCardToken' => $selectedCardToken,
-                    'creditCardExpMonth' => (int)$this->dataHelper->getTodayMonth(),
-                    'creditCardExpYear' => (int)$this->dataHelper->getTodayYear(),
-                    'countrySpecificCardTypes' => $this->config->getCountrySpecificCardTypeConfig(),
-                    'isFraudDetectionEnabled' => $this->config->isFraudDetectionEnabled(),
-                    'isCcDetectionEnabled' => $this->config->isCcDetectionEnabled(),
-                    'availableCardTypes' => $this->getCcAvailableCcTypes(),
-                    'braintreeDataJs'=> $this->config->getBraintreeDataJs(),
-                    'ajaxGenerateNonceUrl' => $this->getAjaxGenerateNonceUrl()
-                ],
-            ],
-        ]);
-
-        return $config;
-    }
-}
diff --git a/app/code/Magento/Braintree/Model/ConfigProvider/PayPal.php b/app/code/Magento/Braintree/Model/ConfigProvider/PayPal.php
deleted file mode 100644
index 4d40d2bb2fe4ad58ccd219860dba94f45db3d20f..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Model/ConfigProvider/PayPal.php
+++ /dev/null
@@ -1,70 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Model\ConfigProvider;
-
-use Magento\Checkout\Model\ConfigProviderInterface;
-use \Magento\Braintree\Model\Config\PayPal as PayPalConfig;
-use Magento\Braintree\Model\PaymentMethod\PayPal as PayPalPaymentMethod;
-
-class PayPal implements ConfigProviderInterface
-{
-    /**
-     * @var string[]
-     */
-    protected $methodCodes = [
-        PayPalPaymentMethod::METHOD_CODE,
-    ];
-
-    /**
-     * @var PayPalConfig
-     */
-    protected $config;
-
-    /**
-     * @var \Magento\Braintree\Helper\Data
-     */
-    protected $dataHelper;
-
-    /**
-     * @var \Magento\Framework\Locale\ResolverInterface
-     */
-    protected $localeResolver;
-
-    /**
-     * @param PayPalConfig $config
-     * @param \Magento\Framework\Locale\ResolverInterface $localeResolver
-     */
-    public function __construct(
-        PayPalConfig $config,
-        \Magento\Framework\Locale\ResolverInterface $localeResolver
-    ) {
-        $this->config = $config;
-        $this->localeResolver = $localeResolver;
-    }
-
-    /**
-     * @return array|void
-     */
-    public function getConfig()
-    {
-        if (!$this->config->isActive()) {
-            return [];
-        }
-        $clientToken = $this->config->getClientToken();
-
-        $config = [
-            'payment' => [
-                'braintree_paypal' => [
-                    'clientToken' => $clientToken,
-                    'locale' => $this->localeResolver->getLocale(),
-                    'merchantDisplayName' => $this->config->getMerchantNameOverride(),
-                ],
-            ]
-        ];
-
-        return $config;
-    }
-}
diff --git a/app/code/Magento/Braintree/Model/PaymentMethod.php b/app/code/Magento/Braintree/Model/PaymentMethod.php
deleted file mode 100644
index af46d1082ba10e0c99ccceab45da67614ee79b45..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Model/PaymentMethod.php
+++ /dev/null
@@ -1,969 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Model;
-
-use Magento\Braintree\Model\Adapter\BraintreeCreditCard;
-use Magento\Braintree\Model\Adapter\BraintreeTransaction;
-use \Braintree_Exception;
-use \Braintree_Transaction;
-use \Braintree_Result_Successful;
-use Magento\Framework\Exception\LocalizedException;
-use Magento\Sales\Model\Order\Payment\Transaction;
-use Magento\Sales\Model\ResourceModel\Order\Payment\Transaction\CollectionFactory as TransactionCollectionFactory;
-use Magento\Sales\Model\Order\Payment\Transaction as PaymentTransaction;
-use Magento\Payment\Model\InfoInterface;
-
-/**
- * Class PaymentMethod
- * @package Magento\Braintree\Model
- * @SuppressWarnings(PHPMD.TooManyFields)
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
- * @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
- */
-class PaymentMethod extends \Magento\Payment\Model\Method\Cc
-{
-    const CAPTURE_ON_INVOICE        = 'invoice';
-    const CAPTURE_ON_SHIPMENT       = 'shipment';
-    const CHANNEL_NAME              = 'Magento';
-    const METHOD_CODE               = 'braintree';
-    const REGISTER_NAME             = 'braintree_save_card';
-    const CONFIG_MASKED_FIELDS      = 'masked_fields';
-
-    /**
-     * @var string
-     */
-    protected $_formBlockType = 'Magento\Braintree\Block\Form';
-
-    /**
-     * @var string
-     */
-    protected $_infoBlockType = 'Magento\Braintree\Block\Info';
-
-    /**
-     * @var string
-     */
-    protected $_code                    = self::METHOD_CODE;
-
-    /**
-     * @var bool
-     */
-    protected $_isGateway               = true;
-
-    /**
-     * @var bool
-     */
-    protected $_canAuthorize            = true;
-
-    /**
-     * @var bool
-     */
-    protected $_canCapture              = true;
-
-    /**
-     * @var bool
-     */
-    protected $_canCapturePartial       = true;
-
-    /**
-     * @var bool
-     */
-    protected $_canRefund               = true;
-
-    /**
-     * @var bool
-     */
-    protected $_canVoid                 = true;
-
-    /**
-     * @var bool
-     */
-    protected $_canUseInternal          = true;
-
-    /**
-     * @var bool
-     */
-    protected $_canUseCheckout          = true;
-
-    /**
-     * @var bool
-     */
-    protected $_canSaveCc               = false;
-
-    /**
-     * @var bool
-     */
-    protected $_canRefundInvoicePartial = true;
-
-    /**
-     * @var string
-     */
-    protected $merchantAccountId       = '';
-
-    /**
-     * @var bool
-     */
-    protected $allowDuplicates         = true;
-
-    /**
-     * @var array|null
-     */
-    protected $requestMaskedFields     = null;
-
-    /**
-     * @var \Magento\Braintree\Model\Config\Cc
-     */
-    protected $config;
-
-    /**
-     * @var Vault
-     */
-    protected $vault;
-
-    /**
-     * @var \Magento\Framework\App\RequestInterface
-     */
-    protected $request;
-
-    /**
-     * @var \Magento\Braintree\Helper\Data
-     */
-    protected $braintreeHelper;
-
-    /**
-     * @var \Magento\Braintree\Helper\Error
-     */
-    protected $errorHelper;
-
-    /**
-     * @var TransactionCollectionFactory
-     */
-    protected $salesTransactionCollectionFactory;
-
-    /**
-     * @var \Magento\Framework\App\ProductMetadataInterface
-     */
-    protected $productMetaData;
-
-    /**
-     * @var \Magento\Directory\Model\RegionFactory
-     */
-    protected $regionFactory;
-
-    /**
-     * @var BraintreeTransaction
-     */
-    protected $braintreeTransaction;
-
-    /**
-     * @var BraintreeCreditCard
-     */
-    protected $braintreeCreditCard;
-
-    /**
-     * @var \Magento\Sales\Api\OrderRepositoryInterface
-     */
-    protected $orderRepository;
-
-    /**
-     * @param \Magento\Framework\Model\Context $context
-     * @param \Magento\Framework\Registry $registry
-     * @param \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory
-     * @param \Magento\Framework\Api\AttributeValueFactory $customAttributeFactory
-     * @param \Magento\Payment\Helper\Data $paymentData
-     * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
-     * @param \Magento\Payment\Model\Method\Logger $logger
-     * @param \Magento\Framework\Module\ModuleListInterface $moduleList
-     * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate
-     * @param \Magento\Braintree\Model\Config\Cc $config
-     * @param Vault $vault
-     * @param BraintreeTransaction $braintreeTransaction
-     * @param BraintreeCreditCard $braintreeCreditCard
-     * @param \Magento\Framework\App\RequestInterface $request
-     * @param \Magento\Braintree\Helper\Data $braintreeHelper
-     * @param \Magento\Braintree\Helper\Error $errorHelper
-     * @param TransactionCollectionFactory $salesTransactionCollectionFactory
-     * @param \Magento\Framework\App\ProductMetadataInterface $productMetaData
-     * @param \Magento\Directory\Model\RegionFactory $regionFactory
-     * @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
-     * @param \Magento\Sales\Api\OrderRepositoryInterface $orderRepository
-     * @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
-     * @param array $data
-     * @SuppressWarnings(PHPMD.ExcessiveParameterList)
-     */
-    public function __construct(
-        \Magento\Framework\Model\Context $context,
-        \Magento\Framework\Registry $registry,
-        \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory,
-        \Magento\Framework\Api\AttributeValueFactory $customAttributeFactory,
-        \Magento\Payment\Helper\Data $paymentData,
-        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
-        \Magento\Payment\Model\Method\Logger $logger,
-        \Magento\Framework\Module\ModuleListInterface $moduleList,
-        \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate,
-        \Magento\Braintree\Model\Config\Cc $config,
-        Vault $vault,
-        BraintreeTransaction $braintreeTransaction,
-        BraintreeCreditCard $braintreeCreditCard,
-        \Magento\Framework\App\RequestInterface $request,
-        \Magento\Braintree\Helper\Data $braintreeHelper,
-        \Magento\Braintree\Helper\Error $errorHelper,
-        TransactionCollectionFactory $salesTransactionCollectionFactory,
-        \Magento\Framework\App\ProductMetadataInterface $productMetaData,
-        \Magento\Directory\Model\RegionFactory $regionFactory,
-        \Magento\Sales\Api\OrderRepositoryInterface $orderRepository,
-        \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
-        \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
-        array $data = []
-    ) {
-        parent::__construct(
-            $context,
-            $registry,
-            $extensionFactory,
-            $customAttributeFactory,
-            $paymentData,
-            $scopeConfig,
-            $logger,
-            $moduleList,
-            $localeDate,
-            $resource,
-            $resourceCollection,
-            $data
-        );
-        $this->config = $config;
-        $this->vault = $vault;
-        $this->braintreeTransaction = $braintreeTransaction;
-        $this->braintreeCreditCard = $braintreeCreditCard;
-        $this->request = $request;
-        $this->braintreeHelper = $braintreeHelper;
-        $this->errorHelper = $errorHelper;
-        $this->salesTransactionCollectionFactory = $salesTransactionCollectionFactory;
-        $this->productMetaData = $productMetaData;
-        $this->regionFactory = $regionFactory;
-        $this->orderRepository = $orderRepository;
-    }
-
-    /**
-     * Assign corresponding data
-     *
-     * @param \Magento\Framework\DataObject|mixed $data
-     * @return $this
-     * @throws LocalizedException
-     */
-    public function assignData(\Magento\Framework\DataObject $data)
-    {
-        parent::assignData($data);
-        $infoInstance = $this->getInfoInstance();
-        if ($this->getConfigData('fraudprotection') > 0) {
-            $infoInstance->setAdditionalInformation('device_data', $data->getData('device_data'));
-        }
-        $infoInstance->setAdditionalInformation('cc_last4', $data->getData('cc_last4'));
-        $infoInstance->setAdditionalInformation('cc_token', $data->getCcToken());
-        $infoInstance->setAdditionalInformation('payment_method_nonce', $data->getPaymentMethodNonce());
-        $infoInstance->setAdditionalInformation('store_in_vault', $data->getStoreInVault());
-        return $this;
-    }
-
-    /**
-     * Validate data
-     *
-     * @return $this
-     * @throws \Magento\Framework\Exception\LocalizedException
-     */
-    public function validate()
-    {
-        $info = $this->getInfoInstance();
-        if ($info instanceof \Magento\Sales\Model\Order\Payment) {
-            $billingCountry = $info->getOrder()->getBillingAddress()->getCountryId();
-        } else {
-            $billingCountry = $info->getQuote()->getBillingAddress()->getCountryId();
-        }
-
-        if (!$this->config->canUseForCountry($billingCountry)) {
-            throw new LocalizedException(__('Selected payment type is not allowed for billing country.'));
-        }
-
-        $ccType = $info->getCcType();
-        if (!$ccType) {
-            $token = $this->getInfoInstance()->getAdditionalInformation('cc_token');
-            if ($token) {
-                $ccType = $this->vault->getSavedCardType($token);
-            }
-        }
-
-        if ($ccType) {
-            $error = $this->config->canUseCcTypeForCountry($billingCountry, $ccType);
-            if ($error) {
-                throw new LocalizedException($error);
-            }
-        }
-
-        return $this;
-    }
-
-    /**
-     * Authorizes specified amount
-     *
-     * @param InfoInterface $payment
-     * @param float $amount
-     * @return $this
-     * @throws LocalizedException
-     */
-    public function authorize(InfoInterface $payment, $amount)
-    {
-        return $this->braintreeAuthorize($payment, $amount, false);
-    }
-
-    /**
-     * Whether this payment method accept token
-     *
-     * @return bool
-     */
-    public function isTokenAllowed()
-    {
-        return true;
-    }
-
-    /**
-     * Whether payment method nonce represent credit card payment
-     *
-     * @return bool
-     */
-    public function isPaymentMethodNonceForCc()
-    {
-        return true;
-    }
-
-    /**
-     * Avoid saving duplicate card
-     *
-     * @param string $last4
-     * @return bool
-     */
-    protected function shouldSaveCard($last4)
-    {
-        // to avoid card save several times during multishipping
-        if ($this->_registry->registry(self::REGISTER_NAME) !== null) {
-            return false;
-        }
-
-        if ($this->vault->canSaveCard($last4)) {
-            $this->_registry->register(self::REGISTER_NAME, true);
-            return true;
-        }
-        return false;
-    }
-
-    /**
-     * @return bool
-     * @throws LocalizedException
-     */
-    protected function verify3dSecure()
-    {
-        return $this->config->is3dSecureEnabled() &&
-            $this->_appState->getAreaCode() !== \Magento\Backend\App\Area\FrontNameResolver::AREA_CODE;
-    }
-
-    /**
-     * @param InfoInterface $payment
-     * @param string|null $token
-     * @return array
-     * @throws LocalizedException
-     * @SuppressWarnings(PHPMD.CyclomaticComplexity)
-     * @SuppressWarnings(PHPMD.NPathComplexity)
-     */
-    protected function populateAuthorizeRequest(InfoInterface $payment, $token)
-    {
-        /** @var \Magento\Sales\Api\Data\OrderInterface $order */
-        $order = $payment->getOrder();
-        $orderId = $order->getIncrementId();
-        $billing = $order->getBillingAddress();
-        $shipping = $order->getShippingAddress();
-        $transactionParams = [
-            'channel'   => $this->getChannel(),
-            'orderId'   => $orderId,
-            'customer'  => [
-                'firstName' => $billing->getFirstname(),
-                'lastName'  => $billing->getLastname(),
-                'company'   => $billing->getCompany(),
-                'phone'     => $billing->getTelephone(),
-                'fax'       => $billing->getFax(),
-                'email'     => $order->getCustomerEmail(),
-            ]
-        ];
-        $customerId = $this->braintreeHelper
-            ->generateCustomerId($order->getCustomerId(), $order->getCustomerEmail());
-
-        $merchantAccountId = $this->config->getMerchantAccountId();
-        if ($merchantAccountId) {
-            $transactionParams['merchantAccountId'] = $merchantAccountId;
-        }
-
-        if (!$this->isTokenAllowed()) {
-            $token = null;
-        } elseif (!$token) {
-            $token = $this->getInfoInstance()->getAdditionalInformation('cc_token');
-        }
-
-        if ($token) {
-            $transactionParams['paymentMethodToken'] = $token;
-            $transactionParams['customerId'] = $customerId;
-            $transactionParams['billing']  = $this->toBraintreeAddress($billing);
-            $transactionParams['shipping'] = $this->toBraintreeAddress($shipping);
-        } elseif ($this->getInfoInstance()->getAdditionalInformation('payment_method_nonce')) {
-            $transactionParams['paymentMethodNonce'] =
-                $this->getInfoInstance()->getAdditionalInformation('payment_method_nonce');
-            if ($this->isPaymentMethodNonceForCc()) {
-                if ($order->getCustomerId() && $this->config->useVault()) {
-                    if ($this->getInfoInstance()->getAdditionalInformation('store_in_vault')) {
-                        $last4 = $this->getInfoInstance()->getAdditionalInformation('cc_last4');
-                        if ($this->shouldSaveCard($last4)) {
-                            $transactionParams['options']['storeInVaultOnSuccess'] = true;
-                        }
-                    } else {
-                        $transactionParams['options']['storeInVault'] = false;
-                    }
-                    if ($this->vault->exists($customerId)) {
-                        $transactionParams['customerId'] = $customerId;
-                        //TODO: How can we update customer information?
-                        unset($transactionParams['customer']);
-                    } else {
-                        $transactionParams['customer']['id'] = $customerId;
-                    }
-                }
-
-                $transactionParams['creditCard'] = [
-                    'cardholderName'    => $billing->getFirstname() . ' ' . $billing->getLastname(),
-                ];
-            }
-            $transactionParams['billing']  = $this->toBraintreeAddress($billing);
-            $transactionParams['shipping'] = $this->toBraintreeAddress($shipping);
-            $transactionParams['options']['addBillingAddressToPaymentMethod']  = true;
-        } else {
-            throw new LocalizedException(__('Incomplete payment information.'));
-        }
-
-        if ($this->verify3dSecure()) {
-            $transactionParams['options']['three_d_secure'] = [
-                'required' => true,
-            ];
-
-            if ($token && $this->getInfoInstance()->getAdditionalInformation('payment_method_nonce')) {
-                $transactionParams['paymentMethodNonce'] =
-                    $this->getInfoInstance()->getAdditionalInformation('payment_method_nonce');
-                unset($transactionParams['paymentMethodToken']);
-            }
-        }
-
-        if ($this->config->isFraudProtectionEnabled() &&
-            strlen($this->getInfoInstance()->getAdditionalInformation('device_data')) > 0) {
-            $transactionParams['deviceData'] = $this->getInfoInstance()->getAdditionalInformation('device_data');
-        }
-        return $transactionParams;
-    }
-
-    /**
-     * Authorizes specified amount
-     *
-     * @param InfoInterface $payment
-     * @param float $amount
-     * @param bool $capture
-     * @param string $token
-     * @return $this
-     * @throws LocalizedException
-     */
-    protected function braintreeAuthorize(InfoInterface $payment, $amount, $capture, $token = null)
-    {
-        try {
-            $transactionParams = $this->populateAuthorizeRequest($payment, $token);
-            if ($capture) {
-                $transactionParams['options']['submitForSettlement'] = true;
-            }
-            $transactionParams['amount'] = $amount;
-
-            $this->_debug($transactionParams);
-            try {
-                $result = $this->braintreeTransaction->sale($transactionParams);
-                $this->_debug($this->_convertObjToArray($result));
-            } catch (\Exception $e) {
-                $this->_logger->critical($e);
-                throw new LocalizedException(__('Please try again later'));
-            }
-            if ($result->success) {
-                $this->setStore($payment->getOrder()->getStoreId());
-                $this->processSuccessResult($payment, $result, $amount);
-            } else {
-                throw new LocalizedException($this->errorHelper->parseBraintreeError($result));
-            }
-        } catch (LocalizedException $e) {
-            $this->_registry->unregister(self::REGISTER_NAME);
-            throw $e;
-        }
-        return $this;
-    }
-
-    /**
-     * Returns extra transaction information, to be logged as part of the order payment
-     *
-     * @param \Braintree_Transaction $transaction
-     * @return array
-     */
-    protected function getExtraTransactionInformation(\Braintree_Transaction $transaction)
-    {
-        $data = [];
-        $loggedFields =[
-            'avsErrorResponseCode',
-            'avsPostalCodeResponseCode',
-            'avsStreetAddressResponseCode',
-            'cvvResponseCode',
-            'gatewayRejectionReason',
-            'processorAuthorizationCode',
-            'processorResponseCode',
-            'processorResponseText',
-        ];
-        foreach ($loggedFields as $loggedField) {
-            if (!empty($transaction->{$loggedField})) {
-                $data[$loggedField] = $transaction->{$loggedField};
-            }
-        }
-        return $data;
-    }
-
-    /**
-     * @param InfoInterface $payment
-     * @param string $amount
-     * @return $this
-     * @throws LocalizedException
-     */
-    protected function partialCapture($payment, $amount)
-    {
-        $collection = $this->salesTransactionCollectionFactory->create()
-            ->addPaymentIdFilter($payment->getId())
-            ->addTxnTypeFilter(PaymentTransaction::TYPE_AUTH)
-            ->setOrder('created_at', \Magento\Framework\Data\Collection::SORT_ORDER_DESC)
-            ->setOrder('transaction_id', \Magento\Framework\Data\Collection::SORT_ORDER_DESC)
-            ->setPageSize(1)
-            ->setCurPage(1);
-        $authTransaction = $collection->getFirstItem();
-        if (!$authTransaction->getId()) {
-            throw new LocalizedException(__('Can not find original authorization transaction for partial capture'));
-        }
-        if (($token = $authTransaction->getAdditionalInformation('token'))) {
-            //order was placed using saved card or card was saved during checkout token
-            $found = true;
-            try {
-                $this->braintreeCreditCard->find($token);
-            } catch (\Exception $e) {
-                $found = false;
-            }
-            if ($found) {
-                $this->config->initEnvironment($payment->getOrder()->getStoreId());
-                $this->braintreeAuthorize($payment, $amount, true, $token);
-            } else {
-                // case if payment token is no more applicable. attempt to clone transaction
-                $result = $this->cloneTransaction($amount, $authTransaction->getTxnId());
-                if ($result && $result->success) {
-                    $this->processSuccessResult($payment, $result, $amount);
-                } else {
-                    throw new LocalizedException($this->errorHelper->parseBraintreeError($result));
-                }
-            }
-        } else {
-            // order was placed without saved card and card wasn't saved during checkout
-            $result = $this->cloneTransaction($amount, $authTransaction->getTxnId());
-            if ($result->success) {
-                $this->processSuccessResult($payment, $result, $amount);
-            } else {
-                throw new LocalizedException($this->errorHelper->parseBraintreeError($result));
-            }
-        }
-        return $this;
-    }
-
-    /**
-     * Captures specified amount
-     *
-     * @param InfoInterface $payment
-     * @param string $amount
-     * @return $this
-     * @throws LocalizedException
-     */
-    public function capture(InfoInterface $payment, $amount)
-    {
-        try {
-            /** @var \Magento\Sales\Model\Order\Payment $payment */
-            if ($payment->getCcTransId()) {
-                $collection = $this->salesTransactionCollectionFactory->create()
-                    ->addFieldToFilter('payment_id', $payment->getId())
-                    ->addFieldToFilter('txn_type', PaymentTransaction::TYPE_CAPTURE);
-                if ($collection->getSize() > 0) {
-                    $this->partialCapture($payment, $amount);
-                } else {
-                    $result = $this->braintreeTransaction->submitForSettlement($payment->getCcTransId(), $amount);
-                    $this->_debug([$payment->getCcTransId().' - '.$amount]);
-                    $this->_debug($this->_convertObjToArray($result));
-                    if ($result->success) {
-                        $payment->setIsTransactionClosed(false)
-                            ->setShouldCloseParentTransaction(false);
-                        if ($payment->isCaptureFinal($amount)) {
-                            $payment->setShouldCloseParentTransaction(true);
-                        }
-                    } else {
-                        throw new LocalizedException($this->errorHelper->parseBraintreeError($result));
-                    }
-                }
-            } else {
-                $this->braintreeAuthorize($payment, $amount, true);
-            }
-        } catch (\Exception $e) {
-            $this->_logger->critical($e);
-            throw new LocalizedException(__('There was an error capturing the transaction: %1.', $e->getMessage()));
-        }
-        return $this;
-    }
-
-    /**
-     * Refunds specified amount
-     *
-     * @param InfoInterface $payment
-     * @param float $amount
-     * @return $this
-     * @throws LocalizedException
-     */
-    public function refund(InfoInterface $payment, $amount)
-    {
-        $transactionId = $this->braintreeHelper->clearTransactionId($payment->getRefundTransactionId());
-        try {
-            $transaction = $this->braintreeTransaction->find($transactionId);
-            $this->_debug([$payment->getCcTransId()]);
-            $this->_debug($this->_convertObjToArray($transaction));
-            if ($transaction->status === \Braintree_Transaction::SUBMITTED_FOR_SETTLEMENT) {
-                if ($transaction->amount != $amount) {
-                    $message = __('This refund is for a partial amount but the Transaction has not settled.')
-                        ->getText();
-                    $message .= ' ';
-                    $message .= __('Please wait 24 hours before trying to issue a partial refund.')
-                        ->getText();
-                    throw new LocalizedException(
-                        __($message)
-                    );
-                }
-            }
-
-            // transaction should be voided if it not settled
-            $canVoid = ($transaction->status === \Braintree_Transaction::AUTHORIZED
-                || $transaction->status === \Braintree_Transaction::SUBMITTED_FOR_SETTLEMENT);
-            $result = $canVoid
-                ? $this->braintreeTransaction->void($transactionId)
-                : $this->braintreeTransaction->refund($transactionId, $amount);
-            $this->_debug($this->_convertObjToArray($result));
-            if ($result->success) {
-                $payment->setIsTransactionClosed(true);
-            } else {
-                throw new LocalizedException($this->errorHelper->parseBraintreeError($result));
-            }
-        } catch (\Exception $e) {
-            $message = $e->getMessage();
-            throw new LocalizedException(__('There was an error refunding the transaction: %1.', $message));
-        }
-        return $this;
-    }
-
-    /**
-     * @param InfoInterface $payment
-     * @return array
-     */
-    protected function getTransactionsToVoid(InfoInterface $payment)
-    {
-        $transactionIds = [];
-        $invoice = $this->_registry->registry('current_invoice');
-        if ($invoice && $invoice->getId() && $invoice->getTransactionId()) {
-            $transactionIds[] = $this->braintreeHelper->clearTransactionId($invoice->getTransactionId());
-        } else {
-            $collection = $this->salesTransactionCollectionFactory->create()
-                ->addFieldToSelect('txn_id')
-                ->addOrderIdFilter($payment->getOrder()->getId())
-                ->addTxnTypeFilter(
-                    [
-                        PaymentTransaction::TYPE_AUTH,
-                        PaymentTransaction::TYPE_CAPTURE,
-                    ]
-                );
-            $fetchedIds = $collection->getColumnValues('txn_id');
-            foreach ($fetchedIds as $transactionId) {
-                $txnId = $this->braintreeHelper->clearTransactionId($transactionId);
-                if (!in_array($txnId, $transactionIds)) {
-                    $transactionIds[] = $txnId;
-                }
-            }
-        }
-        return $transactionIds;
-    }
-
-    /**
-     * Voids transaction
-     *
-     * @param InfoInterface $payment
-     * @throws LocalizedException
-     * @return $this
-     * @SuppressWarnings(PHPMD.CyclomaticComplexity)
-     */
-    public function void(InfoInterface $payment)
-    {
-        $transactionIds = $this->getTransactionsToVoid($payment);
-        $message = false;
-        foreach ($transactionIds as $transactionId) {
-            $transaction = $this->braintreeTransaction->find($transactionId);
-            if ($transaction->status !== \Braintree_Transaction::SUBMITTED_FOR_SETTLEMENT &&
-                $transaction->status !== \Braintree_Transaction::AUTHORIZED) {
-                throw new LocalizedException(
-                    __('Some transactions are already settled or voided and cannot be voided.')
-                );
-            }
-            if ($transaction->status === \Braintree_Transaction::SUBMITTED_FOR_SETTLEMENT) {
-                $message = __('Voided capture.') ;
-            }
-        }
-        $errors = '';
-        foreach ($transactionIds as $transactionId) {
-            $this->_debug(['void-' . $transactionId]);
-            $result = $this->braintreeTransaction->void($transactionId);
-            $this->_debug($this->_convertObjToArray($result));
-            if (!$result->success) {
-                $errors .= ' ' . $this->errorHelper->parseBraintreeError($result)->getText();
-            } elseif ($message) {
-                $payment->setMessage($message);
-            }
-        }
-        if ($errors) {
-            throw new LocalizedException(__('There was an error voiding the transaction: %1.', $errors));
-        } else {
-            $match = true;
-            foreach ($transactionIds as $transactionId) {
-                $collection = $this->salesTransactionCollectionFactory->create()
-                    ->addFieldToFilter('parent_txn_id', ['eq' => $transactionId])
-                    ->addFieldToFilter('txn_type', PaymentTransaction::TYPE_VOID);
-                if ($collection->getSize() < 1) {
-                    $match = false;
-                }
-            }
-            if ($match) {
-                $payment->setIsTransactionClosed(true);
-            }
-        }
-        return $this;
-    }
-
-    /**
-     * Returns two digit region code if possible
-     *
-     * @param string $region
-     * @param int|string $regionId
-     * @return string
-     */
-    protected function convertRegionToCode($region, $regionId)
-    {
-        if (is_string($region) && strlen($region) == 2) {
-            return $region;
-        } else {
-            $regionObj = $this->regionFactory->create()->load($regionId);
-            if ($regionObj->getId()) {
-                return $regionObj->getCode();
-            }
-        }
-        return $region;
-    }
-
-    /**
-     * Convert magento address to array for braintree
-     *
-     * @param \Magento\Sales\Api\Data\OrderAddressInterface $address
-     * @return array
-     */
-    public function toBraintreeAddress($address)
-    {
-        if ($address) {
-            $countryId = $address->getCountryId();
-            $region = $address->getRegion();
-            if ($countryId == 'US') {
-                $region = $this->convertRegionToCode($region, $address->getRegionId());
-            }
-            $street = $address->getStreet();
-            $streetAddress = $street[0];
-            return [
-                'firstName'         => $address->getFirstname(),
-                'lastName'          => $address->getLastname(),
-                'company'           => $address->getCompany(),
-                'streetAddress'     => $streetAddress,
-                'extendedAddress'   => isset($street[1]) ? $street[1] : null,
-                'locality'          => $address->getCity(),
-                'region'            => $region,
-                'postalCode'        => $address->getPostcode(),
-                'countryCodeAlpha2' => $countryId, // alpha2 is the default in magento
-            ];
-        } else {
-            return [];
-        }
-    }
-
-    /**
-     * Voids transaction on cancel action
-     *
-     * @param InfoInterface $payment
-     * @return $this
-     * @throws LocalizedException
-     */
-    public function cancel(InfoInterface $payment)
-    {
-        try {
-            $this->void($payment);
-        } catch (\Exception $e) {
-            $this->_logger->critical($e);
-            throw new LocalizedException(__('There was an error voiding the transaction: %1.', $e->getMessage()));
-        }
-        return $this;
-    }
-
-    /**
-     * Check whether payment method is applicable to quote
-     * Purposed to allow use in controllers some logic that was implemented in blocks only before
-     *
-     * @param \Magento\Quote\Api\Data\CartInterface|null $quote
-     * @return bool
-     */
-    public function isAvailable(\Magento\Quote\Api\Data\CartInterface $quote = null)
-    {
-        if (parent::isAvailable($quote)) {
-            if ($quote != null) {
-                $availableCcTypes = $this->config->getApplicableCardTypes($quote->getBillingAddress()->getCountryId());
-                if (!$availableCcTypes) {
-                    return false;
-                }
-            }
-        } else {
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * Format param "channel" for transaction
-     *
-     * @return string
-     */
-    protected function getChannel()
-    {
-        $edition = $this->productMetaData->getEdition();
-        $version = $this->productMetaData->getVersion();
-        return self::CHANNEL_NAME . ' ' . $edition . ' ' . $version;
-    }
-
-    /**
-     * Clones existing transaction
-     *
-     * @param float $amount
-     * @param string $transactionId
-     * @return mixed
-     * @throws \Exception
-     */
-    protected function cloneTransaction($amount, $transactionId)
-    {
-        $this->_debug(['clone-' . $transactionId . ' amount=' . $amount]);
-        $result = $this->braintreeTransaction->cloneTransaction(
-            $transactionId,
-            [
-                'amount'    => $amount,
-                'options'   => [
-                    'submitForSettlement' => true,
-                ]
-            ]
-        );
-        $this->_debug($this->_convertObjToArray($result));
-        return $result;
-    }
-
-    /**
-     * Processes successful authorize/clone result
-     *
-     * @param \Magento\Framework\DataObject $payment
-     * @param \Braintree_Result_Successful $result
-     * @param string $amount
-     * @return \Magento\Framework\DataObject
-     */
-    protected function processSuccessResult(
-        \Magento\Framework\DataObject $payment,
-        \Braintree_Result_Successful $result,
-        $amount
-    ) {
-        /** @var \Magento\Sales\Model\Order\Payment $payment */
-        $payment->setStatus(self::STATUS_APPROVED)
-            ->setCcTransId($result->transaction->id)
-            ->setLastTransId($result->transaction->id)
-            ->setTransactionId($result->transaction->id)
-            ->setIsTransactionClosed(false)
-            ->setCcLast4($result->transaction->creditCardDetails->last4)
-            ->setAdditionalInformation($this->getExtraTransactionInformation($result->transaction))
-            ->setAmount($amount)
-            ->setShouldCloseParentTransaction(false);
-        if ($payment->isCaptureFinal($amount)) {
-            $payment->setShouldCloseParentTransaction(true);
-        }
-        if (isset($result->transaction->creditCard['token']) && $result->transaction->creditCard['token']) {
-            $payment->setTransactionAdditionalInfo('token', $result->transaction->creditCard['token']);
-        }
-        return $payment;
-    }
-
-    /**
-     * @return bool
-     */
-    public function canVoid()
-    {
-        if ((($order = $this->_registry->registry('current_order'))
-            && $order->getId() && $order->hasInvoices()) || $this->_registry->registry('current_invoice')) {
-            return false;
-        }
-        return $this->_canVoid;
-    }
-
-    /**
-     * Return replace keys for debug data
-     *
-     * @return array
-     */
-    public function getDebugReplacePrivateDataKeys()
-    {
-        if (!$this->requestMaskedFields) {
-            $this->requestMaskedFields = explode(',', $this->config->getConfigData(self::CONFIG_MASKED_FIELDS));
-        }
-        return (array) $this->requestMaskedFields;
-    }
-
-    /**
-     * Retrieve information from payment configuration
-     *
-     * @param string $field
-     * @param int|string|null|\Magento\Store\Model\Store $storeId
-     *
-     * @return mixed
-     */
-    public function getConfigData($field, $storeId = null)
-    {
-        if ('order_place_redirect_url' === $field) {
-            return $this->getOrderPlaceRedirectUrl();
-        }
-        return $this->config->getConfigData($field, $storeId);
-    }
-
-    /**
-     * Convert response from Braintree to array
-     * @param \Braintree_Result_Successful|\Braintree_Result_Error|\Braintree_Transaction $data
-     * @return array
-     */
-    protected function _convertObjToArray($data)
-    {
-        return json_decode(json_encode($data), true);
-    }
-}
diff --git a/app/code/Magento/Braintree/Model/PaymentMethod/PayPal.php b/app/code/Magento/Braintree/Model/PaymentMethod/PayPal.php
deleted file mode 100644
index 5f956167953c3b74c3def40dbf5ddb7d4d51fad0..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Model/PaymentMethod/PayPal.php
+++ /dev/null
@@ -1,314 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Model\PaymentMethod;
-
-use Magento\Braintree\Model\Adapter\BraintreeTransaction;
-use Magento\Braintree\Model\Adapter\BraintreeCreditCard;
-use \Braintree_Exception;
-use \Braintree_Transaction;
-use \Braintree_Result_Successful;
-use Magento\Framework\Exception\LocalizedException;
-use Magento\Braintree\Model\PaymentMethod;
-use Magento\Payment\Model\InfoInterface;
-use Magento\Braintree\Model\Vault;
-use Magento\Sales\Model\ResourceModel\Order\Payment\Transaction\CollectionFactory as TransactionCollectionFactory;
-
-/**
- * Class PayPal
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
- */
-class PayPal extends \Magento\Braintree\Model\PaymentMethod
-{
-    const METHOD_CODE = 'braintree_paypal';
-
-    /**
-     * @var string
-     */
-    protected $_code = self::METHOD_CODE;
-
-    /**
-     * PayPal can't be used on backend
-     *
-     * @var bool
-     */
-    protected $_canUseInternal = false;
-
-    /**
-     * @var string
-     */
-    protected $_infoBlockType = 'Magento\Braintree\Block\Info\PayPal';
-
-    /**
-     * @var \Magento\Braintree\Model\Config\PayPal
-     */
-    protected $payPalConfig;
-
-    /**
-     * @param \Magento\Framework\Model\Context $context
-     * @param \Magento\Framework\Registry $registry
-     * @param \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory
-     * @param \Magento\Framework\Api\AttributeValueFactory $customAttributeFactory
-     * @param \Magento\Payment\Helper\Data $paymentData
-     * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
-     * @param \Magento\Payment\Model\Method\Logger $logger
-     * @param \Magento\Framework\Module\ModuleListInterface $moduleList
-     * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate
-     * @param \Magento\Braintree\Model\Config\Cc $config
-     * @param Vault $vault
-     * @param BraintreeTransaction $braintreeTransaction
-     * @param BraintreeCreditCard $braintreeCreditCard
-     * @param \Magento\Framework\App\RequestInterface $request
-     * @param \Magento\Braintree\Helper\Data $braintreeHelper
-     * @param \Magento\Braintree\Helper\Error $errorHelper
-     * @param TransactionCollectionFactory $salesTransactionCollectionFactory
-     * @param \Magento\Framework\App\ProductMetadataInterface $productMetaData
-     * @param \Magento\Directory\Model\RegionFactory $regionFactory
-     * @param \Magento\Sales\Api\OrderRepositoryInterface $orderRepository
-     * @param \Magento\Braintree\Model\Config\PayPal $payPalConfig
-     * @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
-     * @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
-     * @param array $data
-     * @SuppressWarnings(PHPMD.ExcessiveParameterList)
-     */
-    public function __construct(
-        \Magento\Framework\Model\Context $context,
-        \Magento\Framework\Registry $registry,
-        \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory,
-        \Magento\Framework\Api\AttributeValueFactory $customAttributeFactory,
-        \Magento\Payment\Helper\Data $paymentData,
-        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
-        \Magento\Payment\Model\Method\Logger $logger,
-        \Magento\Framework\Module\ModuleListInterface $moduleList,
-        \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate,
-        \Magento\Braintree\Model\Config\Cc $config,
-        Vault $vault,
-        BraintreeTransaction $braintreeTransaction,
-        BraintreeCreditCard $braintreeCreditCard,
-        \Magento\Framework\App\RequestInterface $request,
-        \Magento\Braintree\Helper\Data $braintreeHelper,
-        \Magento\Braintree\Helper\Error $errorHelper,
-        TransactionCollectionFactory $salesTransactionCollectionFactory,
-        \Magento\Framework\App\ProductMetadataInterface $productMetaData,
-        \Magento\Directory\Model\RegionFactory $regionFactory,
-        \Magento\Sales\Api\OrderRepositoryInterface $orderRepository,
-        \Magento\Braintree\Model\Config\PayPal $payPalConfig,
-        \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
-        \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
-        array $data = []
-    ) {
-        parent::__construct(
-            $context,
-            $registry,
-            $extensionFactory,
-            $customAttributeFactory,
-            $paymentData,
-            $scopeConfig,
-            $logger,
-            $moduleList,
-            $localeDate,
-            $config,
-            $vault,
-            $braintreeTransaction,
-            $braintreeCreditCard,
-            $request,
-            $braintreeHelper,
-            $errorHelper,
-            $salesTransactionCollectionFactory,
-            $productMetaData,
-            $regionFactory,
-            $orderRepository,
-            $resource,
-            $resourceCollection,
-            $data
-        );
-        $this->payPalConfig = $payPalConfig;
-    }
-
-    /**
-     * Retrieve information from payment configuration
-     *
-     * @param string $field
-     * @param int|string|null|\Magento\Store\Model\Store $storeId
-     *
-     * @return mixed
-     */
-    public function getConfigData($field, $storeId = null)
-    {
-        if ('order_place_redirect_url' === $field) {
-            return $this->getOrderPlaceRedirectUrl();
-        }
-        return $this->payPalConfig->getConfigData($field, $storeId);
-    }
-
-    /**
-     * Assign corresponding data
-     *
-     * @param \Magento\Framework\DataObject|mixed $data
-     * @return $this
-     * @throws LocalizedException
-     */
-    public function assignData(\Magento\Framework\DataObject $data)
-    {
-        $infoInstance = $this->getInfoInstance();
-        $infoInstance->setAdditionalInformation('payment_method_nonce', $data->getPaymentMethodNonce());
-        return $this;
-    }
-
-    /**
-     * Validate data
-     *
-     * @return $this
-     * @throws LocalizedException
-     */
-    public function validate()
-    {
-        $info = $this->getInfoInstance();
-        if ($info instanceof \Magento\Sales\Model\Order\Payment) {
-            $billingCountry = $info->getOrder()->getBillingAddress()->getCountryId();
-        } else {
-            $billingCountry = $info->getQuote()->getBillingAddress()->getCountryId();
-        }
-
-        if (!$this->payPalConfig->canUseForCountry($billingCountry)) {
-            throw new LocalizedException(__('Selected payment type is not allowed for billing country.'));
-        }
-        return $this;
-    }
-
-    /**
-     * Check whether payment method can be used with the quote
-     *
-     * @param \Magento\Quote\Api\Data\CartInterface|null $quote
-     * @return bool
-     */
-    public function isAvailable(\Magento\Quote\Api\Data\CartInterface $quote = null)
-    {
-        return $this->isActive($quote ? $quote->getStoreId() : null);
-    }
-
-    /**
-     * Whether this payment method accept token
-     *
-     * @return bool
-     */
-    public function isTokenAllowed()
-    {
-        return false;
-    }
-
-    /**
-     * Whether payment method nonce represent credit card payment
-     *
-     * @return bool
-     */
-    public function isPaymentMethodNonceForCc()
-    {
-        return false;
-    }
-
-    /**
-     * @return bool
-     */
-    protected function verify3dSecure()
-    {
-        return false;
-    }
-
-    /**
-     * Processes successful authorize/clone result
-     *
-     * @param \Magento\Framework\DataObject $payment
-     * @param \Braintree_Result_Successful $result
-     * @param float $amount
-     * @return \Magento\Framework\DataObject
-     */
-    protected function processSuccessResult(
-        \Magento\Framework\DataObject $payment,
-        \Braintree_Result_Successful $result,
-        $amount
-    ) {
-        $additionalInformation = $this->getExtraTransactionInformation($result->transaction);
-        $payment->setStatus(self::STATUS_APPROVED)
-            ->setCcTransId($result->transaction->id)
-            ->setLastTransId($result->transaction->id)
-            ->setTransactionId($result->transaction->id)
-            ->setIsTransactionClosed(false)
-            ->setAdditionalInformation($additionalInformation)
-            ->setAmount($amount)
-            ->setShouldCloseParentTransaction(false);
-        return $payment;
-    }
-
-    /**
-     * Returns extra transaction information, to be logged as part of the order payment
-     *
-     * @param \Braintree_Transaction $transaction
-     * @return array
-     */
-    protected function getExtraTransactionInformation(\Braintree_Transaction $transaction)
-    {
-        $data = [];
-        $loggedFields =[
-            'gatewayRejectionReason',
-            'processorAuthorizationCode',
-            'processorResponseCode',
-            'processorResponseText',
-        ];
-        foreach ($loggedFields as $loggedField) {
-            if (!empty($transaction->{$loggedField})) {
-                $data[$loggedField] = $transaction->{$loggedField};
-            }
-        }
-        $payPalFields = [
-            'payerEmail',
-            'paymentId',
-            'authorizationId',
-            'payerId',
-            'payerFirstName',
-            'payerLastName'
-        ];
-        $payPalDetails = $transaction->paypalDetails;
-        foreach ($payPalFields as $loggedField) {
-            if (!empty($payPalDetails->{$loggedField})) {
-                $data[$loggedField] = $payPalDetails->{$loggedField};
-            }
-        }
-        return $data;
-    }
-
-    /**
-     * Captures specified amount, override the method in Braintree CC method as transaction through PayPal does not
-     * can't be cloned
-     *
-     * @param InfoInterface $payment
-     * @param float $amount
-     * @return $this
-     * @throws LocalizedException
-     */
-    public function capture(InfoInterface $payment, $amount)
-    {
-        try {
-            /** @var \Magento\Sales\Model\Order\Payment $payment */
-            if ($payment->getCcTransId()) {
-                $result = $this->braintreeTransaction->submitForSettlement($payment->getCcTransId(), $amount);
-                $this->_debug([$payment->getCcTransId().' - '.$amount]);
-                $this->_debug($this->_convertObjToArray($result));
-                if ($result->success) {
-                    $payment->setIsTransactionClosed(false)
-                        ->setShouldCloseParentTransaction(true);
-                } else {
-                    throw new LocalizedException($this->errorHelper->parseBraintreeError($result));
-                }
-            } else {
-                $this->braintreeAuthorize($payment, $amount, true);
-            }
-        } catch (\Exception $e) {
-            $this->_logger->critical($e);
-            throw new LocalizedException(__('There was an error capturing the transaction: %1.', $e->getMessage()));
-        }
-        return $this;
-    }
-}
diff --git a/app/code/Magento/BraintreeTwo/Model/Paypal/Helper/AbstractHelper.php b/app/code/Magento/Braintree/Model/Paypal/Helper/AbstractHelper.php
similarity index 94%
rename from app/code/Magento/BraintreeTwo/Model/Paypal/Helper/AbstractHelper.php
rename to app/code/Magento/Braintree/Model/Paypal/Helper/AbstractHelper.php
index a746d8a83141ef1d33b952b427d906cdba9bf053..b08e1b078e295533864d3fcfbd825250e042c609 100644
--- a/app/code/Magento/BraintreeTwo/Model/Paypal/Helper/AbstractHelper.php
+++ b/app/code/Magento/Braintree/Model/Paypal/Helper/AbstractHelper.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Model\Paypal\Helper;
+namespace Magento\Braintree\Model\Paypal\Helper;
 
 use Magento\Quote\Model\Quote;
 
diff --git a/app/code/Magento/BraintreeTwo/Model/Paypal/Helper/OrderPlace.php b/app/code/Magento/Braintree/Model/Paypal/Helper/OrderPlace.php
similarity index 98%
rename from app/code/Magento/BraintreeTwo/Model/Paypal/Helper/OrderPlace.php
rename to app/code/Magento/Braintree/Model/Paypal/Helper/OrderPlace.php
index d81cd826311bdf807d73ca33b0b1759b224417dd..f88e6cfb2dc25b5b682d520b340b76a7ba248d7e 100644
--- a/app/code/Magento/BraintreeTwo/Model/Paypal/Helper/OrderPlace.php
+++ b/app/code/Magento/Braintree/Model/Paypal/Helper/OrderPlace.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Model\Paypal\Helper;
+namespace Magento\Braintree\Model\Paypal\Helper;
 
 use Magento\Quote\Model\Quote;
 use Magento\Checkout\Helper\Data;
diff --git a/app/code/Magento/BraintreeTwo/Model/Paypal/Helper/QuoteUpdater.php b/app/code/Magento/Braintree/Model/Paypal/Helper/QuoteUpdater.php
similarity index 95%
rename from app/code/Magento/BraintreeTwo/Model/Paypal/Helper/QuoteUpdater.php
rename to app/code/Magento/Braintree/Model/Paypal/Helper/QuoteUpdater.php
index 70cfb04c508db41af203904af8ea674057095aba..75e499fafebf26f9c489152e1541836a8d4bdc7c 100644
--- a/app/code/Magento/BraintreeTwo/Model/Paypal/Helper/QuoteUpdater.php
+++ b/app/code/Magento/Braintree/Model/Paypal/Helper/QuoteUpdater.php
@@ -3,16 +3,16 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Model\Paypal\Helper;
+namespace Magento\Braintree\Model\Paypal\Helper;
 
 use Magento\Quote\Model\Quote;
 use Magento\Quote\Model\Quote\Address;
 use Magento\Quote\Model\Quote\Payment;
 use Magento\Quote\Api\CartRepositoryInterface;
-use Magento\BraintreeTwo\Model\Ui\ConfigProvider;
+use Magento\Braintree\Model\Ui\ConfigProvider;
 use Magento\Framework\Exception\LocalizedException;
-use Magento\BraintreeTwo\Observer\DataAssignObserver;
-use Magento\BraintreeTwo\Gateway\Config\PayPal\Config;
+use Magento\Braintree\Observer\DataAssignObserver;
+use Magento\Braintree\Gateway\Config\PayPal\Config;
 
 /**
  * Class QuoteUpdater
diff --git a/app/code/Magento/BraintreeTwo/Model/Paypal/Helper/ShippingMethodUpdater.php b/app/code/Magento/Braintree/Model/Paypal/Helper/ShippingMethodUpdater.php
similarity index 93%
rename from app/code/Magento/BraintreeTwo/Model/Paypal/Helper/ShippingMethodUpdater.php
rename to app/code/Magento/Braintree/Model/Paypal/Helper/ShippingMethodUpdater.php
index 02e38e04489cc8f8cd91bda3c1627f1af68d8cdd..aa7eedf1fefe5b17479409a4840632bdc0feeb0c 100644
--- a/app/code/Magento/BraintreeTwo/Model/Paypal/Helper/ShippingMethodUpdater.php
+++ b/app/code/Magento/Braintree/Model/Paypal/Helper/ShippingMethodUpdater.php
@@ -3,11 +3,11 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Model\Paypal\Helper;
+namespace Magento\Braintree\Model\Paypal\Helper;
 
 use Magento\Quote\Model\Quote;
 use Magento\Quote\Api\CartRepositoryInterface;
-use Magento\BraintreeTwo\Gateway\Config\PayPal\Config;
+use Magento\Braintree\Gateway\Config\PayPal\Config;
 
 /**
  * Class ShippingMethodUpdater
diff --git a/app/code/Magento/Braintree/Model/Plugin/Sales/Order/PaymentPlugin.php b/app/code/Magento/Braintree/Model/Plugin/Sales/Order/PaymentPlugin.php
deleted file mode 100644
index 0e48c848dc1474d2dd4c4c02c9cc35809f471985..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Model/Plugin/Sales/Order/PaymentPlugin.php
+++ /dev/null
@@ -1,78 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Model\Plugin\Sales\Order;
-
-use Magento\Braintree\Model\PaymentMethod;
-use Magento\Sales\Model\Order\Payment;
-use Magento\Sales\Model\ResourceModel\Order\Payment\Transaction\CollectionFactory as TransactionCollectionFactory;
-use Magento\Sales\Model\Order\Payment\Transaction as PaymentTransaction;
-
-class PaymentPlugin
-{
-    /**
-     * @var \Magento\Framework\Registry
-     */
-    protected $registry;
-
-    /**
-     * @var \Magento\Braintree\Helper\Data
-     */
-    protected $paymentHelper;
-
-    /**
-     * @var TransactionCollectionFactory
-     */
-    protected $salesTransactionCollectionFactory;
-
-    /**
-     * @param \Magento\Framework\Registry $registry
-     * @param TransactionCollectionFactory $salesTransactionCollectionFactory
-     * @param \Magento\Braintree\Helper\Data $paymentHelper
-     */
-    public function __construct(
-        \Magento\Framework\Registry $registry,
-        TransactionCollectionFactory $salesTransactionCollectionFactory,
-        \Magento\Braintree\Helper\Data $paymentHelper
-    ) {
-        $this->registry = $registry;
-        $this->salesTransactionCollectionFactory = $salesTransactionCollectionFactory;
-        $this->paymentHelper = $paymentHelper;
-    }
-
-    /**
-     * Magento will consider a transaction for voiding only if it is an authorization
-     * Braintree allows voiding captures too
-     *
-     * Lookup an authorization transaction using parent transaction id, if set
-     *
-     * @param Payment $subject
-     * @param callable $proceed
-     *
-     * @return \Magento\Sales\Model\Order\Payment\Transaction|false
-     * @SuppressWarnings(PHPMD.CyclomaticComplexity)
-     */
-    public function aroundGetAuthorizationTransaction(
-        Payment $subject,
-        \Closure $proceed
-    ) {
-        if ($subject->getMethodInstance()->getCode() != PaymentMethod::METHOD_CODE) {
-            return $proceed();
-        }
-        $invoice = $this->registry->registry('current_invoice');
-        if ($invoice && $invoice->getId()) {
-            $transactionId = $this->paymentHelper
-                ->clearTransactionId($invoice->getTransactionId());
-            $collection = $this->salesTransactionCollectionFactory->create()
-                ->addFieldToFilter('txn_id', ['eq' => $transactionId]);
-            if ($collection->getSize() < 1) {
-                return $proceed();
-            } else {
-                return $collection->getFirstItem();
-            }
-        }
-        return $proceed();
-    }
-}
diff --git a/app/code/Magento/BraintreeTwo/Model/Report/ConditionAppliers/ApplierInterface.php b/app/code/Magento/Braintree/Model/Report/ConditionAppliers/ApplierInterface.php
similarity index 89%
rename from app/code/Magento/BraintreeTwo/Model/Report/ConditionAppliers/ApplierInterface.php
rename to app/code/Magento/Braintree/Model/Report/ConditionAppliers/ApplierInterface.php
index 6beb0bbea597a6c79d533ac069c18e6488ea05f7..b2fed09c0aef71fab232fff04b9278b1380c9eab 100644
--- a/app/code/Magento/BraintreeTwo/Model/Report/ConditionAppliers/ApplierInterface.php
+++ b/app/code/Magento/Braintree/Model/Report/ConditionAppliers/ApplierInterface.php
@@ -3,7 +3,7 @@
  * Copyright © 2016 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Model\Report\ConditionAppliers;
+namespace Magento\Braintree\Model\Report\ConditionAppliers;
 
 /**
  * Braintree filter condition applier interface
diff --git a/app/code/Magento/BraintreeTwo/Model/Report/ConditionAppliers/AppliersPool.php b/app/code/Magento/Braintree/Model/Report/ConditionAppliers/AppliersPool.php
similarity index 95%
rename from app/code/Magento/BraintreeTwo/Model/Report/ConditionAppliers/AppliersPool.php
rename to app/code/Magento/Braintree/Model/Report/ConditionAppliers/AppliersPool.php
index c129ab25870222fb7af130cb77ddfe2ea545ad4f..29c9e6c7b3ea5a7668ba2e0ae95a5a733a067629 100644
--- a/app/code/Magento/BraintreeTwo/Model/Report/ConditionAppliers/AppliersPool.php
+++ b/app/code/Magento/Braintree/Model/Report/ConditionAppliers/AppliersPool.php
@@ -3,7 +3,7 @@
  * Copyright © 2016 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Model\Report\ConditionAppliers;
+namespace Magento\Braintree\Model\Report\ConditionAppliers;
 
 /**
  * Class AppliersPool
diff --git a/app/code/Magento/BraintreeTwo/Model/Report/ConditionAppliers/MultipleValue.php b/app/code/Magento/Braintree/Model/Report/ConditionAppliers/MultipleValue.php
similarity index 94%
rename from app/code/Magento/BraintreeTwo/Model/Report/ConditionAppliers/MultipleValue.php
rename to app/code/Magento/Braintree/Model/Report/ConditionAppliers/MultipleValue.php
index f3bccc15e03b0b1aeb412cb12be2cbdcf7595625..a80f3eac316f308ff4654bd364678963c66f5ead 100644
--- a/app/code/Magento/BraintreeTwo/Model/Report/ConditionAppliers/MultipleValue.php
+++ b/app/code/Magento/Braintree/Model/Report/ConditionAppliers/MultipleValue.php
@@ -3,7 +3,7 @@
  * Copyright © 2016 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Model\Report\ConditionAppliers;
+namespace Magento\Braintree\Model\Report\ConditionAppliers;
 
 use Braintree\MultipleValueNode;
 
diff --git a/app/code/Magento/BraintreeTwo/Model/Report/ConditionAppliers/Range.php b/app/code/Magento/Braintree/Model/Report/ConditionAppliers/Range.php
similarity index 92%
rename from app/code/Magento/BraintreeTwo/Model/Report/ConditionAppliers/Range.php
rename to app/code/Magento/Braintree/Model/Report/ConditionAppliers/Range.php
index 8e8f57953a215e606c94e147d183e7da6305d810..68b20158437061516007a17669cb0356407f6cc1 100644
--- a/app/code/Magento/BraintreeTwo/Model/Report/ConditionAppliers/Range.php
+++ b/app/code/Magento/Braintree/Model/Report/ConditionAppliers/Range.php
@@ -3,7 +3,7 @@
  * Copyright © 2016 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Model\Report\ConditionAppliers;
+namespace Magento\Braintree\Model\Report\ConditionAppliers;
 
 use Braintree\RangeNode;
 
diff --git a/app/code/Magento/BraintreeTwo/Model/Report/ConditionAppliers/Text.php b/app/code/Magento/Braintree/Model/Report/ConditionAppliers/Text.php
similarity index 92%
rename from app/code/Magento/BraintreeTwo/Model/Report/ConditionAppliers/Text.php
rename to app/code/Magento/Braintree/Model/Report/ConditionAppliers/Text.php
index 54e540483673573c30fae31166c03ecd1e54efc7..9d4e3217c948ef47dc4a2565b302686ebaa29962 100644
--- a/app/code/Magento/BraintreeTwo/Model/Report/ConditionAppliers/Text.php
+++ b/app/code/Magento/Braintree/Model/Report/ConditionAppliers/Text.php
@@ -3,7 +3,7 @@
  * Copyright © 2016 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Model\Report\ConditionAppliers;
+namespace Magento\Braintree\Model\Report\ConditionAppliers;
 
 use Braintree\TextNode;
 
diff --git a/app/code/Magento/BraintreeTwo/Model/Report/FilterMapper.php b/app/code/Magento/Braintree/Model/Report/FilterMapper.php
similarity index 93%
rename from app/code/Magento/BraintreeTwo/Model/Report/FilterMapper.php
rename to app/code/Magento/Braintree/Model/Report/FilterMapper.php
index 73a0fbe3753d63303d8a1c80e119290783b5eec0..30cc22880b8ff0bc914148f7121904c4511cb20d 100644
--- a/app/code/Magento/BraintreeTwo/Model/Report/FilterMapper.php
+++ b/app/code/Magento/Braintree/Model/Report/FilterMapper.php
@@ -3,10 +3,10 @@
  * Copyright © 2016 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Model\Report;
+namespace Magento\Braintree\Model\Report;
 
-use Magento\BraintreeTwo\Model\Adapter\BraintreeSearchAdapter;
-use Magento\BraintreeTwo\Model\Report\ConditionAppliers\AppliersPool;
+use Magento\Braintree\Model\Adapter\BraintreeSearchAdapter;
+use Magento\Braintree\Model\Report\ConditionAppliers\AppliersPool;
 
 /**
  * Class FilterMapper
diff --git a/app/code/Magento/BraintreeTwo/Model/Report/Row/TransactionMap.php b/app/code/Magento/Braintree/Model/Report/Row/TransactionMap.php
similarity index 99%
rename from app/code/Magento/BraintreeTwo/Model/Report/Row/TransactionMap.php
rename to app/code/Magento/Braintree/Model/Report/Row/TransactionMap.php
index bfc40ac3690e191f001ccde48c2f475208d47ff2..0abae8af89fbca4664c7b35568cf16e61533a3fe 100644
--- a/app/code/Magento/BraintreeTwo/Model/Report/Row/TransactionMap.php
+++ b/app/code/Magento/Braintree/Model/Report/Row/TransactionMap.php
@@ -3,7 +3,7 @@
  * Copyright © 2016 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Model\Report\Row;
+namespace Magento\Braintree\Model\Report\Row;
 
 use Braintree\Transaction;
 use DateTime;
diff --git a/app/code/Magento/BraintreeTwo/Model/Report/TransactionsCollection.php b/app/code/Magento/Braintree/Model/Report/TransactionsCollection.php
similarity index 96%
rename from app/code/Magento/BraintreeTwo/Model/Report/TransactionsCollection.php
rename to app/code/Magento/Braintree/Model/Report/TransactionsCollection.php
index 174e58d7e241c78fd88a93083be3790913da671e..f52f19c0ab6f04e013946cd226f522c9cbd993ec 100644
--- a/app/code/Magento/BraintreeTwo/Model/Report/TransactionsCollection.php
+++ b/app/code/Magento/Braintree/Model/Report/TransactionsCollection.php
@@ -3,9 +3,9 @@
  * Copyright © 2016 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Model\Report;
+namespace Magento\Braintree\Model\Report;
 
-use Magento\BraintreeTwo\Model\Adapter\BraintreeAdapter;
+use Magento\Braintree\Model\Adapter\BraintreeAdapter;
 use Magento\Framework\Api\Search\SearchResultInterface;
 use Magento\Framework\Api\SearchCriteriaInterface;
 use Magento\Framework\Data\Collection;
@@ -26,7 +26,7 @@ class TransactionsCollection extends Collection implements SearchResultInterface
      *
      * @var string
      */
-    protected $_itemObjectClass = 'Magento\BraintreeTwo\Model\Report\Row\TransactionMap';
+    protected $_itemObjectClass = 'Magento\Braintree\Model\Report\Row\TransactionMap';
 
     /**
      * @var array
diff --git a/app/code/Magento/Braintree/Model/Source/CaptureAction.php b/app/code/Magento/Braintree/Model/Source/CaptureAction.php
deleted file mode 100644
index e997df9a8327b2424d5123aee6097e7799faeaa8..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Model/Source/CaptureAction.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Model\Source;
-
-use \Magento\Braintree\Model\PaymentMethod;
-
-/**
- * Class CaptureAction
- * @codeCoverageIgnore
- */
-class CaptureAction implements \Magento\Framework\Option\ArrayInterface
-{
-    /**
-     * Possible actions to capture
-     * 
-     * @return array
-     */
-    public function toOptionArray()
-    {
-        return [
-            [
-                'value' => PaymentMethod::CAPTURE_ON_INVOICE,
-                'label' => __('Invoice'),
-            ],
-            [
-                'value' => PaymentMethod::CAPTURE_ON_SHIPMENT,
-                'label' => __('Shipment'),
-            ],
-        ];
-    }
-}
diff --git a/app/code/Magento/Braintree/Model/Source/CcType.php b/app/code/Magento/Braintree/Model/Source/CcType.php
deleted file mode 100644
index 822918fcd84f1f383eb45ad26dbaf10f9f711202..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Model/Source/CcType.php
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Model\Source;
-
-/**
- * Class CcType
- * @codeCoverageIgnore
- */
-class CcType extends \Magento\Payment\Model\Source\Cctype
-{
-    /**
-     * Allowed credit card types
-     *
-     * @return string[]
-     */
-    public function getAllowedTypes()
-    {
-        return ['VI', 'MC', 'AE', 'DI', 'JCB', 'OT'];
-    }
-}
diff --git a/app/code/Magento/Braintree/Model/Source/Environment.php b/app/code/Magento/Braintree/Model/Source/Environment.php
deleted file mode 100644
index 713c2b3d45a786934d4dbb6f9b9b61c056692bbe..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Model/Source/Environment.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Model\Source;
-
-/**
- * Class Environment
- * @codeCoverageIgnore
- */
-class Environment implements \Magento\Framework\Option\ArrayInterface
-{
-    const ENVIRONMENT_PRODUCTION    = 'production';
-    const ENVIRONMENT_SANDBOX       = 'sandbox';
-
-    /**
-     * Possible environment types
-     * 
-     * @return array
-     */
-    public function toOptionArray()
-    {
-        return [
-            [
-                'value' => self::ENVIRONMENT_SANDBOX,
-                'label' => 'Sandbox',
-            ],
-            [
-                'value' => self::ENVIRONMENT_PRODUCTION,
-                'label' => 'Production'
-            ]
-        ];
-    }
-}
diff --git a/app/code/Magento/Braintree/Model/Source/PaymentAction.php b/app/code/Magento/Braintree/Model/Source/PaymentAction.php
deleted file mode 100644
index 502e3dd25f7c824c22a59392afb420e3751f22d3..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Model/Source/PaymentAction.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Model\Source;
-
-use \Magento\Payment\Model\Method\AbstractMethod;
-
-/**
- * Class PaymentAction
- * @codeCoverageIgnore
- */
-class PaymentAction implements \Magento\Framework\Option\ArrayInterface
-{
-    /**
-     * Possible actions on order place
-     * 
-     * @return array
-     */
-    public function toOptionArray()
-    {
-        return [
-            [
-                'value' => AbstractMethod::ACTION_AUTHORIZE,
-                'label' => __('Authorize'),
-            ],
-            [
-                'value' => AbstractMethod::ACTION_AUTHORIZE_CAPTURE,
-                'label' => __('Authorize and Capture'),
-            ]
-        ];
-    }
-}
diff --git a/app/code/Magento/Braintree/Model/System/Config/Backend/Countrycreditcard.php b/app/code/Magento/Braintree/Model/System/Config/Backend/Countrycreditcard.php
deleted file mode 100644
index 73b1c40112ec7c408332f9eda97da6fafd1f862a..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Model/System/Config/Backend/Countrycreditcard.php
+++ /dev/null
@@ -1,100 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Model\System\Config\Backend;
-
-class Countrycreditcard extends \Magento\Framework\App\Config\Value
-{
-    /**
-     * @var \Magento\Framework\Math\Random
-     */
-    protected $mathRandom;
-
-    /**
-     * @param \Magento\Framework\Model\Context $context
-     * @param \Magento\Framework\Registry $registry
-     * @param \Magento\Framework\App\Config\ScopeConfigInterface $config
-     * @param \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList
-     * @param \Magento\Framework\Math\Random $mathRandom
-     * @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
-     * @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
-     * @param array $data
-     */
-    public function __construct(
-        \Magento\Framework\Model\Context $context,
-        \Magento\Framework\Registry $registry,
-        \Magento\Framework\App\Config\ScopeConfigInterface $config,
-        \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList,
-        \Magento\Framework\Math\Random $mathRandom,
-        \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
-        \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
-        array $data = []
-    ) {
-        $this->mathRandom = $mathRandom;
-        parent::__construct($context, $registry, $config, $cacheTypeList, $resource, $resourceCollection, $data);
-    }
-
-    /**
-     * Prepare data before save
-     *
-     * @return $this
-     */
-    public function beforeSave()
-    {
-        $value = $this->getValue();
-        $result = [];
-        foreach ($value as $data) {
-            if (!$data) {
-                continue;
-            }
-            if (!is_array($data)) {
-                continue;
-            }
-            if (count($data) < 2) {
-                continue;
-            }
-            $country = $data['country_id'];
-            if (array_key_exists($country, $result)) {
-                $result[$country] = array_unique(array_merge($result[$country], $data['cc_types']));
-            } else {
-                $result[$country] = $data['cc_types'];
-            }
-        }
-        $this->setValue(serialize($result));
-        return $this;
-    }
-
-    /**
-     * Process data after load
-     *
-     * @return $this
-     */
-    protected function _afterLoad()
-    {
-        $value = $this->getValue();
-        $value = unserialize($value);
-        if (is_array($value)) {
-            $value = $this->encodeArrayFieldValue($value);
-            $this->setValue($value);
-        }
-        return $this;
-    }
-
-    /**
-     * Encode value to be used in \Magento\Config\Block\System\Config\Form\Field\FieldArray\AbstractFieldArray
-     *
-     * @param array $value
-     * @return array
-     */
-    protected function encodeArrayFieldValue(array $value)
-    {
-        $result = [];
-        foreach ($value as $country => $creditCardType) {
-            $resultId = $this->mathRandom->getUniqueHash('_');
-            $result[$resultId] = ['country_id' => $country, 'cc_types' => $creditCardType];
-        }
-        return $result;
-    }
-}
diff --git a/app/code/Magento/Braintree/Model/System/Config/Backend/Usevault.php b/app/code/Magento/Braintree/Model/System/Config/Backend/Usevault.php
deleted file mode 100644
index 4bdc926b19e19e797acbd65c5e354aa73653ad4f..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Model/System/Config/Backend/Usevault.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Model\System\Config\Backend;
-
-class Usevault extends \Magento\Framework\App\Config\Value
-{
-    const BRAINTREE_ENABLED_CONFIG_PATH = 'payment/braintree/active';
-
-    /**
-     * Prepare data before save
-     * If payment method is disabled, vault also have to be disabled
-     *
-     * @return $this
-     */
-    public function beforeSave()
-    {
-        $data = $this->getData();
-        if (isset($data['groups']['braintree']['fields']['active']['value']) &&
-            !$data['groups']['braintree']['fields']['active']['value']) {
-            $this->setValue(0);
-        }
-    }
-}
diff --git a/app/code/Magento/Braintree/Model/System/Config/Source/Country.php b/app/code/Magento/Braintree/Model/System/Config/Source/Country.php
deleted file mode 100644
index 619c29752f57afac7d88a6eb8816122233b5578b..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Model/System/Config/Source/Country.php
+++ /dev/null
@@ -1,82 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Model\System\Config\Source;
-
-class Country implements \Magento\Framework\Option\ArrayInterface
-{
-    /**
-     * @var array
-     */
-    protected $options;
-
-    /**
-     * Countries
-     *
-     * @var \Magento\Directory\Model\ResourceModel\Country\Collection
-     */
-    protected $countryCollection;
-
-    /**
-     * Countries not supported by Braintree
-     * List can be found in Braintree website https://support.braintreepayments.com/customer/portal/articles/1142481
-     */
-    protected $excludedCountries = [
-        'MM', 'IR', 'SD', 'BY', 'CI', 'CD', 'CG', 'IQ', 'LR', 'LB', 'KP', 'SL', 'SY', 'ZW', 'AL', 'BA', 'MK', 'ME', 'RS'
-    ];
-
-    /**
-     * @param \Magento\Directory\Model\ResourceModel\Country\Collection $countryCollection
-     */
-    public function __construct(\Magento\Directory\Model\ResourceModel\Country\Collection $countryCollection)
-    {
-        $this->countryCollection = $countryCollection;
-    }
-
-    /**
-     * @param bool $isMultiselect
-     * @return array
-     */
-    public function toOptionArray($isMultiselect = false)
-    {
-        if (!$this->options) {
-            $this->options = $this->countryCollection
-                ->addFieldToFilter('country_id', ['nin' => $this->excludedCountries])
-                ->loadData()
-                ->toOptionArray(false);
-        }
-
-        $options = $this->options;
-        if (!$isMultiselect) {
-            array_unshift($options, ['value'=>'', 'label'=> __('--Please Select--')]);
-        }
-
-        return $options;
-    }
-
-    /**
-     * If country is in list of restricted (not supported by Braintree)
-     *
-     * @param string $countryId
-     * @return boolean
-     */
-    public function isCountryRestricted($countryId)
-    {
-        if (in_array($countryId, $this->excludedCountries)) {
-            return true;
-        }
-        return false;
-    }
-
-    /**
-     * Returns list of restricted countries
-     *
-     * @return array
-     */
-    public function getRestrictedCountries()
-    {
-        return $this->excludedCountries;
-    }
-}
diff --git a/app/code/Magento/BraintreeTwo/Model/Ui/Adminhtml/TokenUiComponentProvider.php b/app/code/Magento/Braintree/Model/Ui/Adminhtml/TokenUiComponentProvider.php
similarity index 91%
rename from app/code/Magento/BraintreeTwo/Model/Ui/Adminhtml/TokenUiComponentProvider.php
rename to app/code/Magento/Braintree/Model/Ui/Adminhtml/TokenUiComponentProvider.php
index 46dcb77abcaa17c539872a8f1eae27da0565a67b..7bf0e90bdbf3e047114585b2155c643abf2054e9 100644
--- a/app/code/Magento/BraintreeTwo/Model/Ui/Adminhtml/TokenUiComponentProvider.php
+++ b/app/code/Magento/Braintree/Model/Ui/Adminhtml/TokenUiComponentProvider.php
@@ -3,9 +3,9 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Model\Ui\Adminhtml;
+namespace Magento\Braintree\Model\Ui\Adminhtml;
 
-use Magento\BraintreeTwo\Model\Ui\ConfigProvider;
+use Magento\Braintree\Model\Ui\ConfigProvider;
 use Magento\Framework\UrlInterface;
 use Magento\Framework\View\Element\Template;
 use Magento\Vault\Api\Data\PaymentTokenInterface;
@@ -52,7 +52,7 @@ class TokenUiComponentProvider implements TokenUiComponentProviderInterface
                     'nonceUrl' => $this->getNonceRetrieveUrl(),
                     TokenUiComponentProviderInterface::COMPONENT_DETAILS => $data,
                     TokenUiComponentProviderInterface::COMPONENT_PUBLIC_HASH => $paymentToken->getPublicHash(),
-                    'template' => 'Magento_BraintreeTwo::form/vault.phtml'
+                    'template' => 'Magento_Braintree::form/vault.phtml'
                 ],
                 'name' => Template::class
             ]
diff --git a/app/code/Magento/BraintreeTwo/Model/Ui/ConfigProvider.php b/app/code/Magento/Braintree/Model/Ui/ConfigProvider.php
similarity index 92%
rename from app/code/Magento/BraintreeTwo/Model/Ui/ConfigProvider.php
rename to app/code/Magento/Braintree/Model/Ui/ConfigProvider.php
index bf5b73b06f084b778cd81bdf30ff10576d38f7d3..6f70e16063579cb1df0f6925076d418eb618d8f7 100644
--- a/app/code/Magento/BraintreeTwo/Model/Ui/ConfigProvider.php
+++ b/app/code/Magento/Braintree/Model/Ui/ConfigProvider.php
@@ -3,12 +3,12 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Model\Ui;
+namespace Magento\Braintree\Model\Ui;
 
 use Magento\Checkout\Model\ConfigProviderInterface;
-use Magento\BraintreeTwo\Gateway\Config\Config;
-use Magento\BraintreeTwo\Gateway\Config\PayPal\Config as PayPalConfig;
-use Magento\BraintreeTwo\Model\Adapter\BraintreeAdapter;
+use Magento\Braintree\Gateway\Config\Config;
+use Magento\Braintree\Gateway\Config\PayPal\Config as PayPalConfig;
+use Magento\Braintree\Model\Adapter\BraintreeAdapter;
 use Magento\Framework\Locale\ResolverInterface;
 
 /**
@@ -16,9 +16,9 @@ use Magento\Framework\Locale\ResolverInterface;
  */
 final class ConfigProvider implements ConfigProviderInterface
 {
-    const CODE = 'braintreetwo';
+    const CODE = 'braintree';
 
-    const PAYPAL_CODE = 'braintreetwo_paypal';
+    const PAYPAL_CODE = 'braintree_paypal';
 
     /**
      * @var ResolverInterface
diff --git a/app/code/Magento/BraintreeTwo/Model/Ui/TokenUiComponentProvider.php b/app/code/Magento/Braintree/Model/Ui/TokenUiComponentProvider.php
similarity index 94%
rename from app/code/Magento/BraintreeTwo/Model/Ui/TokenUiComponentProvider.php
rename to app/code/Magento/Braintree/Model/Ui/TokenUiComponentProvider.php
index 381c536a423da5e714893c19df1c275c15476731..4e8ef7d82f244b2e0b28cfaebeaf4f88468041e3 100644
--- a/app/code/Magento/BraintreeTwo/Model/Ui/TokenUiComponentProvider.php
+++ b/app/code/Magento/Braintree/Model/Ui/TokenUiComponentProvider.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Model\Ui;
+namespace Magento\Braintree\Model\Ui;
 
 use Magento\Vault\Api\Data\PaymentTokenInterface;
 use Magento\Vault\Model\Ui\TokenUiComponentInterface;
@@ -53,7 +53,7 @@ class TokenUiComponentProvider implements TokenUiComponentProviderInterface
                     TokenUiComponentProviderInterface::COMPONENT_DETAILS => $jsonDetails,
                     TokenUiComponentProviderInterface::COMPONENT_PUBLIC_HASH => $paymentToken->getPublicHash()
                 ],
-                'name' => 'Magento_BraintreeTwo/js/view/payment/method-renderer/vault'
+                'name' => 'Magento_Braintree/js/view/payment/method-renderer/vault'
             ]
         );
 
diff --git a/app/code/Magento/Braintree/Model/Vault.php b/app/code/Magento/Braintree/Model/Vault.php
deleted file mode 100644
index c485f272d069f568aa39d4401f0b10c36887c61c..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Model/Vault.php
+++ /dev/null
@@ -1,394 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Model;
-
-use Magento\Braintree\Model\Adapter\BraintreeCreditCard;
-use Magento\Braintree\Model\Adapter\BraintreePaymentMethod;
-use \Braintree_Exception;
-use Magento\Braintree\Model\Adapter\BraintreeCustomer;
-use Magento\Framework\Exception\LocalizedException;
-
-/**
- * Class Vault
- *
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
- */
-class Vault
-{
-    const CACHE_KEY_CREDIT_CARDS = 'braintree_cc';
-
-    /**
-     * @var \Magento\Braintree\Helper\Data
-     */
-    protected $braintreeHelper;
-
-    /**
-     * @var \Magento\Braintree\Helper\Error
-     */
-    protected $errorHelper;
-
-    /**
-     * @var \Magento\Customer\Model\Session
-     */
-    protected $customerSession;
-
-    /**
-     * @var \Magento\Customer\Model\CustomerFactory
-     */
-    protected $customerFactory;
-
-    /**
-     * @var \Magento\Directory\Model\ResourceModel\Country\CollectionFactory
-     */
-    protected $countryFactory;
-
-    /**
-     * @var \Magento\Framework\App\Cache\Type\Collection
-     */
-    protected $cache;
-
-    /**
-     * @var \Magento\Braintree\Model\Config\Cc
-     */
-    protected $config;
-
-    /**
-     * @var \Psr\Log\LoggerInterface
-     */
-    protected $logger;
-
-    /**
-     * @var BraintreeCustomer
-     */
-    protected $braintreeCustomer;
-
-    /**
-     * @var BraintreeCreditCard
-     */
-    protected $braintreeCreditCard;
-
-    /**
-     * @var BraintreePaymentMethod
-     */
-    protected $braintreePaymentMethod;
-
-    /**
-     * @param \Magento\Braintree\Helper\Data $braintreeHelper
-     * @param \Magento\Braintree\Model\Config\Cc $config
-     * @param \Psr\Log\LoggerInterface $logger
-     * @param \Magento\Braintree\Helper\Error $errorHelper
-     * @param \Magento\Framework\App\Cache\Type\Collection $cache
-     * @param \Magento\Customer\Model\Session $customerSession
-     * @param \Magento\Customer\Model\CustomerFactory $customerFactory
-     * @param BraintreeCustomer $braintreeCustomer
-     * @param BraintreeCreditCard $braintreeCreditCard
-     * @param BraintreePaymentMethod $braintreePaymentMethod
-     * @param \Magento\Directory\Model\ResourceModel\Country\CollectionFactory $countryFactory
-     * @SuppressWarnings(PHPMD.ExcessiveParameterList)
-     */
-    public function __construct(
-        \Magento\Braintree\Helper\Data $braintreeHelper,
-        \Magento\Braintree\Model\Config\Cc $config,
-        \Psr\Log\LoggerInterface $logger,
-        \Magento\Braintree\Helper\Error $errorHelper,
-        \Magento\Framework\App\Cache\Type\Collection $cache,
-        \Magento\Customer\Model\Session $customerSession,
-        \Magento\Customer\Model\CustomerFactory $customerFactory,
-        BraintreeCustomer $braintreeCustomer,
-        BraintreeCreditCard $braintreeCreditCard,
-        BraintreePaymentMethod $braintreePaymentMethod,
-        \Magento\Directory\Model\ResourceModel\Country\CollectionFactory $countryFactory
-    ) {
-        $this->config = $config;
-        $this->braintreeHelper = $braintreeHelper;
-        $this->logger = $logger;
-        $this->errorHelper = $errorHelper;
-        $this->cache = $cache;
-        $this->customerSession = $customerSession;
-        $this->customerFactory = $customerFactory;
-        $this->braintreeCustomer = $braintreeCustomer;
-        $this->braintreeCreditCard = $braintreeCreditCard;
-        $this->braintreePaymentMethod = $braintreePaymentMethod;
-        $this->countryFactory = $countryFactory;
-    }
-
-    /**
-     * Array of customer credit cards
-     *
-     * @return array
-     */
-    public function currentCustomerStoredCards()
-    {
-        if ($this->config->useVault() && $this->customerSession->isLoggedIn()) {
-            $customer = $this->customerFactory->create()->load($this->customerSession->getCustomerId());
-            $customerId = $this->braintreeHelper->generateCustomerId(
-                $this->customerSession->getCustomerId(),
-                $customer->getEmail()
-            );
-            try {
-                $ret = $this->braintreeCustomer->find($customerId)->creditCards;
-                $this->debug($customerId);
-                $this->debug($ret);
-                return $ret;
-            } catch (\Braintree_Exception $e) {
-                return [];
-            }
-        }
-        return [];
-    }
-
-    /**
-     * Returns stored card by token
-     *
-     * @param string $token
-     * @return \Braintree_CreditCard|null
-     */
-    public function storedCard($token)
-    {
-        try {
-            $ret = $this->braintreeCreditCard->find($token);
-            $this->debug($token);
-            $this->debug($ret);
-            return $ret;
-        } catch (\Braintree_Exception $e) {
-            $this->logger->critical($e);
-        }
-        return null;
-    }
-
-    /**
-     * @param string $last4
-     * @return bool
-     */
-    public function canSaveCard($last4)
-    {
-        if (!isset($last4) || !preg_match("/[0-9]{4}/", $last4)) {
-            return false;
-        }
-        if (!$this->config->allowDuplicateCards()) {
-            $storedCards = $this->currentCustomerStoredCards();
-            if (is_array($storedCards)) {
-                foreach ($storedCards as $card) {
-                    if ($card->last4 == $last4) {
-                        return false;
-                    }
-                }
-            }
-        }
-        return true;
-    }
-
-    /**
-     * Deletes customer
-     *
-     * @param int $customerID
-     * @return $this
-     */
-    public function deleteCustomer($customerID)
-    {
-        try {
-            $this->braintreeCustomer->delete($customerID);
-        } catch (\Braintree_Exception $e) {
-            $this->logger->critical($e);
-        }
-        return $this;
-    }
-
-    /**
-     * Delete card by token
-     *
-     * @param string $token
-     * @return \Braintree_CreditCard|bool
-     */
-    public function deleteCard($token)
-    {
-        try {
-            $ret = $this->braintreeCreditCard->delete($token);
-            $this->debug($token);
-            $this->debug($ret);
-            return $ret;
-        } catch (\Braintree_Exception $e) {
-            $this->logger->critical($e);
-            return false;
-        }
-    }
-
-    /**
-     * If customer exists in Braintree
-     *
-     * @param int $customerId
-     * @return bool
-     */
-    public function exists($customerId)
-    {
-        try {
-            $this->braintreeCustomer->find($customerId);
-        } catch (\Braintree_Exception $e) {
-            $this->logger->critical($e);
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * Gets response from braintree api using the nonce
-     *
-     * @param string|null $nonce
-     * @param array|null $options
-     * @param array|null $billingAddress
-     * @return $this
-     * @throws LocalizedException
-     * @SuppressWarnings(PHPMD.NPathComplexity)
-     * @SuppressWarnings(PHPMD.CyclomaticComplexity)
-     */
-    public function processNonce($nonce = null, $options = null, $billingAddress = null)
-    {
-        $customerId = $this->customerSession->getCustomerId();
-        if (!$customerId) {
-            throw new LocalizedException(__('Invalid Customer ID provided'));
-        }
-        $billingCountry = null;
-        if (is_array($billingAddress)) {
-            $collection = $this->countryFactory->create()->addCountryCodeFilter($billingAddress['countryCodeAlpha2']);
-            if ($collection->getSize()) {
-                $billingCountry = $collection->getFirstItem()->getId();
-            }
-
-            if (!$this->config->canUseForCountry($billingCountry)) {
-                throw new LocalizedException(__('Selected payment type is not allowed for billing country.'));
-            }
-        }
-
-        $ccType = null;
-        if ($options) {
-            $ccType = $options['ccType'];
-        }
-        if ($ccType) {
-            $error = $this->config->canUseCcTypeForCountry($billingCountry, $ccType);
-            if ($error) {
-                throw new LocalizedException($error);
-            }
-        }
-
-        $customer = $this->customerFactory->create()->load($customerId);
-        $customerId = $this->braintreeHelper->generateCustomerId($customerId, $customer->getEmail());
-
-        if (!$this->exists($customerId)) {
-            $customerRequest = [
-                'id'            => $customerId,
-                'firstName'     => $billingAddress['firstName'],
-                'lastName'      => $billingAddress['lastName'],
-                'email'         => $this->customerSession->getCustomerDataObject()->getEmail(),
-            ];
-            if (strlen($billingAddress['company'])) {
-                $customerRequest['company'] = $billingAddress['company'];
-            }
-            $result = $this->braintreeCustomer->create($customerRequest);
-            if (!$result->success) {
-                throw new LocalizedException($this->errorHelper->parseBraintreeError($result));
-            }
-        }
-        //check if customerId is created on braintree
-        $requestArray = [
-            'customerId' => $customerId,
-            'paymentMethodNonce' => $nonce,
-            'options' => [
-                'makeDefault' => ( $options['default'] == 'true') ? true : false,
-                'failOnDuplicatePaymentMethod' => $this->config->allowDuplicateCards() == '1' ? false : true,
-                'verifyCard' => $this->config->useCvv() == '1' ? true : false,
-            ],
-        ];
-        if ($this->config->isFraudDetectionEnabled() &&
-            strlen($options['device_data'])>0) {
-            $requestArray['deviceData'] = $options['device_data'];
-        }
-        if ($options['update'] == 'true') {
-            $token = $options['token'];
-            unset($requestArray['customerId']);
-            unset($requestArray['options']['failOnDuplicatePaymentMethod']);
-            $requestArray['billingAddress'] = $billingAddress;
-            $result = $this->braintreePaymentMethod->update($token, $requestArray);
-            $this->debug($requestArray);
-            $this->debug($result);
-        } else {
-            $result = $this->braintreePaymentMethod->create($requestArray);
-            $this->debug($requestArray);
-            $this->debug($result);
-        }
-
-        if (!$result->success) {
-            throw new LocalizedException($this->errorHelper->parseBraintreeError($result));
-        }
-        return $this;
-    }
-
-    /**
-     * Log debug data to file
-     *
-     * @param mixed $debugData
-     * @return $this
-     */
-    protected function debug($debugData)
-    {
-        if ($this->config->isDebugEnabled() && !empty($debugData)) {
-            $this->logger->debug(var_export($debugData, true));
-        }
-        return $this;
-    }
-
-    /**
-     * @param string $token
-     * @return bool|string
-     */
-    public function getSavedCardType($token)
-    {
-        $ccType = false;
-        $useCache = $this->config->useVault();
-        $cachedValues = $useCache ? $this->cache->load(self::CACHE_KEY_CREDIT_CARDS) : false;
-        if ($cachedValues) {
-            try {
-                $cachedValues = unserialize($cachedValues);
-            } catch (\Exception $e) {
-                $cachedValues = [];
-            }
-            if (array_key_exists($token, $cachedValues)) {
-                return $cachedValues[$token];
-            }
-        }
-
-        try {
-            $creditCard = $this->braintreeCreditCard->find($token);
-            $this->debug($token);
-            $this->debug($creditCard);
-            $ccType = $this->braintreeHelper->getCcTypeCodeByName($creditCard->cardType);
-            if (!empty($cachedValues)) {
-                $cachedValues = array_merge($cachedValues, [$token => $ccType]);
-            } else {
-                $cachedValues = [$token => $ccType];
-            }
-            if ($useCache) {
-                $this->cache->save(serialize($cachedValues), self::CACHE_KEY_CREDIT_CARDS);
-            }
-        } catch (\Exception $e) {
-            $this->logger->critical($e);
-        }
-        return $ccType;
-    }
-
-    /**
-     * @param string $token
-     * @throws LocalizedException
-     * @return bool|string
-     */
-    public function generatePaymentMethodToken($token)
-    {
-        $result = $this->braintreePaymentMethod->createNonce($token);
-        if (!$result->success) {
-            throw new LocalizedException($this->errorHelper->parseBraintreeError($result));
-        }
-        return $result->paymentMethodNonce->nonce;
-    }
-}
diff --git a/app/code/Magento/Braintree/Observer/AddPaypalShortcuts.php b/app/code/Magento/Braintree/Observer/AddPaypalShortcuts.php
index ecb44e726a5f074ea2dfebb43efa6b05a4dfffa1..b377b1c1a75bd22e1a3567ed5b4325a52fe461b0 100644
--- a/app/code/Magento/Braintree/Observer/AddPaypalShortcuts.php
+++ b/app/code/Magento/Braintree/Observer/AddPaypalShortcuts.php
@@ -5,70 +5,38 @@
  */
 namespace Magento\Braintree\Observer;
 
+use Magento\Framework\Event\Observer;
+use Magento\Catalog\Block\ShortcutButtons;
 use Magento\Framework\Event\ObserverInterface;
-use Magento\Braintree\Block\PayPal\Shortcut;
 
+/**
+ * Class AddPaypalShortcuts
+ */
 class AddPaypalShortcuts implements ObserverInterface
 {
-    const PAYPAL_SHORTCUT_BLOCK = 'Magento\Braintree\Block\PayPal\Shortcut';
-
     /**
-     * @var \Magento\Braintree\Model\Config\PayPal
+     * Block class
      */
-    protected $paypalConfig;
-
-    /**
-     * @var \Magento\Braintree\Model\PaymentMethod\PayPal
-     */
-    protected $methodPayPal;
-
-    /**
-     * @param \Magento\Braintree\Model\PaymentMethod\PayPal $methodPayPal
-     * @param \Magento\Braintree\Model\Config\PayPal $paypalConfig
-     */
-    public function __construct(
-        \Magento\Braintree\Model\PaymentMethod\PayPal $methodPayPal,
-        \Magento\Braintree\Model\Config\PayPal $paypalConfig
-    ) {
-        $this->methodPayPal = $methodPayPal;
-        $this->paypalConfig = $paypalConfig;
-    }
+    const PAYPAL_SHORTCUT_BLOCK = 'Magento\Braintree\Block\Paypal\Button';
 
     /**
      * Add Braintree PayPal shortcut buttons
      *
-     * @param \Magento\Framework\Event\Observer $observer
+     * @param Observer $observer
      * @return void
      */
-    public function execute(\Magento\Framework\Event\Observer $observer)
+    public function execute(Observer $observer)
     {
-        $isMiniCart = !$observer->getEvent()->getIsCatalogProduct();
-
-        //Don't display shortcut on product view page
-        if (!$this->methodPayPal->isActive() ||
-            !$this->paypalConfig->isShortcutCheckoutEnabled() ||
-            !$isMiniCart) {
+        // Remove button from catalog pages
+        if ($observer->getData('is_catalog_product')) {
             return;
         }
 
-        /** @var \Magento\Catalog\Block\ShortcutButtons $shortcutButtons */
+        /** @var ShortcutButtons $shortcutButtons */
         $shortcutButtons = $observer->getEvent()->getContainer();
 
-        /** @var Shortcut $shortcut */
-        $shortcut = $shortcutButtons->getLayout()->createBlock(
-            self::PAYPAL_SHORTCUT_BLOCK,
-            '',
-            [
-                'data' => [
-                    Shortcut::MINI_CART_FLAG_KEY => $isMiniCart
-                ]
-            ]
-        );
+        $shortcut = $shortcutButtons->getLayout()->createBlock(self::PAYPAL_SHORTCUT_BLOCK);
 
-        if ($shortcut->skipShortcutForGuest()) {
-            return;
-        }
-        $shortcut->setShowOrPosition($observer->getEvent()->getOrPosition());
         $shortcutButtons->addShortcut($shortcut);
     }
 }
diff --git a/app/code/Magento/BraintreeTwo/Observer/DataAssignObserver.php b/app/code/Magento/Braintree/Observer/DataAssignObserver.php
similarity index 96%
rename from app/code/Magento/BraintreeTwo/Observer/DataAssignObserver.php
rename to app/code/Magento/Braintree/Observer/DataAssignObserver.php
index e38425e2fac25b6f4006e18d83eeee455c16365b..a529676e04a3eabbdbbc0e8d59d130a450fd8623 100644
--- a/app/code/Magento/BraintreeTwo/Observer/DataAssignObserver.php
+++ b/app/code/Magento/Braintree/Observer/DataAssignObserver.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Observer;
+namespace Magento\Braintree\Observer;
 
 use Magento\Framework\Event\Observer;
 use Magento\Payment\Observer\AbstractDataAssignObserver;
diff --git a/app/code/Magento/Braintree/Observer/DeleteBraintreeCustomer.php b/app/code/Magento/Braintree/Observer/DeleteBraintreeCustomer.php
deleted file mode 100644
index be95c8f2b76e81ed9cf818a628cdee80497ee8f3..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Observer/DeleteBraintreeCustomer.php
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Observer;
-
-use Magento\Framework\Event\ObserverInterface;
-
-class DeleteBraintreeCustomer implements ObserverInterface
-{
-    /**
-     * @var \Magento\Braintree\Model\Vault
-     */
-    protected $vault;
-
-    /**
-     * @var \Magento\Braintree\Model\Config\Cc
-     */
-    protected $config;
-
-    /**
-     * @var \Magento\Braintree\Helper\Data
-     */
-    protected $helper;
-
-    /**
-     * @param \Magento\Braintree\Model\Vault $vault
-     * @param \Magento\Braintree\Model\Config\Cc $config
-     * @param \Magento\Braintree\Helper\Data $helper
-     */
-    public function __construct(
-        \Magento\Braintree\Model\Vault $vault,
-        \Magento\Braintree\Model\Config\Cc $config,
-        \Magento\Braintree\Helper\Data $helper
-    ) {
-        $this->vault = $vault;
-        $this->config = $config;
-        $this->helper = $helper;
-    }
-
-    /**
-     * Delete Braintree customer when Magento customer is deleted
-     *
-     * @param \Magento\Framework\Event\Observer $observer
-     * @return $this
-     */
-    public function execute(\Magento\Framework\Event\Observer $observer)
-    {
-        if (!$this->config->isActive()) {
-            return $this;
-        }
-        $customer = $observer->getEvent()->getCustomer();
-        $customerId = $this->helper->generateCustomerId($customer->getId(), $customer->getEmail());
-        if ($this->vault->exists($customerId)) {
-            $this->vault->deleteCustomer($customerId);
-        }
-
-        return $this;
-    }
-}
diff --git a/app/code/Magento/Braintree/Observer/ProcessBraintreeAddress.php b/app/code/Magento/Braintree/Observer/ProcessBraintreeAddress.php
deleted file mode 100644
index 88bdebcaf7013e420862aa274f1396b50b1516a7..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Observer/ProcessBraintreeAddress.php
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Observer;
-
-use Magento\Framework\Event\ObserverInterface;
-
-class ProcessBraintreeAddress implements ObserverInterface
-{
-    /**
-     * @param \Magento\Framework\Event\Observer $observer
-     * @return void
-     */
-    public function execute(\Magento\Framework\Event\Observer $observer)
-    {
-        /** @var \Magento\Quote\Model\Quote $quote */
-        $quote = $observer->getEvent()->getQuote();
-        if ($quote->getPayment()->getMethod() === \Magento\Braintree\Model\PaymentMethod\PayPal:: METHOD_CODE) {
-            $quote->getBillingAddress()->setShouldIgnoreValidation(true);
-        }
-    }
-}
diff --git a/app/code/Magento/Braintree/Observer/ProcessBraintreePayment.php b/app/code/Magento/Braintree/Observer/ProcessBraintreePayment.php
deleted file mode 100644
index e963bcd98722b00d756adb621bb9b838109ad10e..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Observer/ProcessBraintreePayment.php
+++ /dev/null
@@ -1,88 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Observer;
-
-use Magento\Framework\Event\ObserverInterface;
-use Magento\Braintree\Model\PaymentMethod;
-
-class ProcessBraintreePayment implements ObserverInterface
-{
-    const CONFIG_PATH_CAPTURE_ACTION    = 'capture_action';
-    const CONFIG_PATH_PAYMENT_ACTION    = 'payment_action';
-
-    /**
-     * @var \Magento\Braintree\Model\Config\Cc
-     */
-    protected $config;
-
-    /**
-     * @var \Magento\Framework\DB\TransactionFactory
-     */
-    protected $transactionFactory;
-
-    /**
-     * @param \Magento\Braintree\Model\Config\Cc $config
-     * @param \Magento\Framework\DB\TransactionFactory $transactionFactory
-     */
-    public function __construct(
-        \Magento\Braintree\Model\Config\Cc $config,
-        \Magento\Framework\DB\TransactionFactory $transactionFactory
-    ) {
-        $this->config = $config;
-        $this->transactionFactory = $transactionFactory;
-    }
-
-    /**
-     * If it's configured to capture on shipment - do this
-     *
-     * @param \Magento\Framework\Event\Observer $observer
-     * @return $this
-     */
-    public function execute(\Magento\Framework\Event\Observer $observer)
-    {
-        $shipment = $observer->getEvent()->getShipment();
-        $order = $shipment->getOrder();
-        if ($order->getPayment()->getMethod() == PaymentMethod::METHOD_CODE
-            && $order->canInvoice()
-            && $this->shouldInvoice()
-        ) {
-            $qtys = [];
-            foreach ($shipment->getAllItems() as $shipmentItem) {
-                $qtys[$shipmentItem->getOrderItem()->getId()] = $shipmentItem->getQty();
-            }
-            foreach ($order->getAllItems() as $orderItem) {
-                if (!array_key_exists($orderItem->getId(), $qtys)) {
-                    $qtys[$orderItem->getId()] = 0;
-                }
-            }
-            $invoice = $order->prepareInvoice($qtys);
-            $invoice->setRequestedCaptureCase(\Magento\Sales\Model\Order\Invoice::CAPTURE_ONLINE);
-            $invoice->register();
-            /** @var \Magento\Framework\DB\Transaction $transaction */
-            $transaction = $this->transactionFactory->create();
-            $transaction->addObject($invoice)
-                ->addObject($invoice->getOrder())
-                ->save();
-        }
-
-        return $this;
-    }
-
-    /**
-     * If it's configured to capture on each shipment
-     *
-     * @return bool
-     */
-    private function shouldInvoice()
-    {
-        $flag = (($this->config->getConfigData(self::CONFIG_PATH_PAYMENT_ACTION) ==
-                \Magento\Payment\Model\Method\AbstractMethod::ACTION_AUTHORIZE) &&
-            ($this->config->getConfigData(self::CONFIG_PATH_CAPTURE_ACTION) ==
-                PaymentMethod::CAPTURE_ON_SHIPMENT));
-
-        return $flag;
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Block/Adminhtml/Form/Field/CctypesTest.php b/app/code/Magento/Braintree/Test/Unit/Block/Adminhtml/Form/Field/CctypesTest.php
deleted file mode 100644
index 7c6646e143dea41bec3f914db7dce9f8cc4bf666..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Block/Adminhtml/Form/Field/CctypesTest.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Test\Unit\Block\Adminhtml\Form\Field;
-
-class CctypesTest extends \PHPUnit_Framework_TestCase
-{
-    public function testToHtml()
-    {
-        $ccTypeSourceMock = $this->getMockBuilder('\Magento\Braintree\Model\Source\CcType')
-            ->disableOriginalConstructor()
-            ->setMethods(['toOptionArray'])
-            ->getMock();
-
-        $ccTypeSourceMock->expects($this->once())
-            ->method('toOptionArray')
-            ->willReturn([['value' => 'US', 'label' => 'US']]);
-
-        $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
-        $ccTypes = $objectManagerHelper->getObject(
-            'Magento\Braintree\Block\Adminhtml\Form\Field\Cctypes',
-            [
-                'ccTypeSource' => $ccTypeSourceMock
-            ]
-        );
-
-        $result = $ccTypes->_toHtml();
-        $expected = '<select name="" id="" class="cc-type-select" title="" multiple="multiple">'
-            . '<option value="" ></option></select>';
-        $this->assertSame($expected, $result);
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Block/Adminhtml/Form/Field/CountriesTest.php b/app/code/Magento/Braintree/Test/Unit/Block/Adminhtml/Form/Field/CountriesTest.php
deleted file mode 100644
index 68b4365f0a2871f48dffbd6f075362e0376635d9..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Block/Adminhtml/Form/Field/CountriesTest.php
+++ /dev/null
@@ -1,56 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Test\Unit\Block\Adminhtml\Form\Field;
-
-class CountriesTest extends \PHPUnit_Framework_TestCase
-{
-    public function testToHtml()
-    {
-        $countrySourceMock = $this->getMockBuilder('\Magento\Braintree\Model\System\Config\Source\Country')
-            ->disableOriginalConstructor()
-            ->setMethods(['getRestrictedCountries'])
-            ->getMock();
-
-        $countryCollectionFactoryMock = $this->getMockBuilder(
-            '\Magento\Directory\Model\ResourceModel\Country\CollectionFactory'
-        )->disableOriginalConstructor()
-            ->setMethods(['create'])
-            ->getMock();
-
-        $countryCollectionMock = $this->getMockBuilder('\Magento\Directory\Model\ResourceModel\Country\Collection')
-            ->disableOriginalConstructor()
-            ->setMethods(['addFieldToFilter', 'loadData', 'toOptionArray'])
-            ->getMock();
-
-        $countryCollectionMock->expects($this->once())
-            ->method('addFieldToFilter')
-            ->willReturnSelf();
-
-        $countryCollectionMock->expects($this->once())
-            ->method('loadData')
-            ->willReturnSelf();
-
-        $countryCollectionMock->expects($this->once())
-            ->method('toOptionArray')
-            ->willReturn([['value' => 'US', 'label' => 'US']]);
-
-        $countryCollectionFactoryMock->expects($this->once())
-            ->method('create')
-            ->willReturn($countryCollectionMock);
-
-        $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
-        $countries = $objectManagerHelper->getObject(
-            'Magento\Braintree\Block\Adminhtml\Form\Field\Countries',
-            [
-                '$countrySource' => $countrySourceMock,
-                'countryCollectionFactory' => $countryCollectionFactoryMock
-            ]
-        );
-
-        $result = $countries->_toHtml();
-        $this->assertSame($result, '<select name="" id="" class="" title="" ><option value="" ></option></select>');
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Block/Creditcard/ManagementTest.php b/app/code/Magento/Braintree/Test/Unit/Block/Creditcard/ManagementTest.php
deleted file mode 100644
index f6727156bc34de0aa7229fc2b1a520e245bbb344..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Block/Creditcard/ManagementTest.php
+++ /dev/null
@@ -1,354 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Block\Creditcard;
-
-use Magento\Braintree\Block\Creditcard\Management;
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
-
-/**
- * Class ManagementTest
- *
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
- */
-class ManagementTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Braintree\Block\Creditcard\Management
-     */
-    protected $block;
-
-    /**
-     * @var ObjectManagerHelper
-     */
-    protected $objectManagerHelper;
-
-    /**
-     * @var \Magento\Directory\Model\ResourceModel\Region\CollectionFactory|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $regionCollectionFactoryMock;
-
-    /**
-     * @var \Magento\Payment\Model\Config|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $paymentConfigMock;
-
-    /**
-     * @var \Magento\Braintree\Model\Vault|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $vaultMock;
-
-    /**
-     * @var \Magento\Braintree\Model\Config\Cc|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $configMock;
-
-    /**
-     * @var \Magento\Customer\Model\Session|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $customerSessionMock;
-
-    /**
-     * @var \Magento\Customer\Api\CustomerRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $customerRepositoryMock;
-
-    /**
-     * @var \Magento\Payment\Model\CcConfig|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $ccConfigMock;
-
-    /**
-     * @var \Magento\Braintree\Helper\Data|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $dataHelperMock;
-
-    /**
-     * @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $requestMock;
-
-    /**
-     * @var \Magento\Framework\View\LayoutInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $layoutMock;
-
-    protected function setUp()
-    {
-        $this->regionCollectionFactoryMock = $this->getMockBuilder(
-            '\Magento\Directory\Model\ResourceModel\Region\CollectionFactory'
-        )->disableOriginalConstructor()
-            ->setMethods(['create'])
-            ->getMock();
-        $this->paymentConfigMock = $this->getMockBuilder(
-            '\Magento\Payment\Model\Config'
-        )->disableOriginalConstructor()
-            ->getMock();
-        $this->configMock = $this->getMockBuilder('\Magento\Braintree\Model\Config\Cc')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->vaultMock = $this->getMockBuilder('\Magento\Braintree\Model\Vault')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->customerSessionMock = $this->getMockBuilder('\Magento\Customer\Model\Session')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->customerRepositoryMock = $this->getMock('\Magento\Customer\Api\CustomerRepositoryInterface');
-        $this->ccConfigMock = $this->getMockBuilder('\Magento\Payment\Model\CcConfig')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->dataHelperMock = $this->getMockBuilder('\Magento\Braintree\Helper\Data')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->requestMock = $this->getMock('\Magento\Framework\App\RequestInterface');
-        $this->layoutMock = $this->getMock('\Magento\Framework\View\LayoutInterface');
-        $contextMock = $this->getMockBuilder('\Magento\Framework\View\Element\Template\Context')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $contextMock->expects($this->any())
-            ->method('getRequest')
-            ->willReturn($this->requestMock);
-        $contextMock->expects($this->any())
-            ->method('getLayout')
-            ->willReturn($this->layoutMock);
-
-        $this->objectManagerHelper = new ObjectManagerHelper($this);
-        $this->block = $this->objectManagerHelper->getObject(
-            '\Magento\Braintree\Block\Creditcard\Management',
-            [
-                'context' => $contextMock,
-                'regionCollectionFactory' => $this->regionCollectionFactoryMock,
-                'paymentConfig' => $this->paymentConfigMock,
-                'vault' => $this->vaultMock,
-                'config' => $this->configMock,
-                'customerSession' => $this->customerSessionMock,
-                'customerRepository' => $this->customerRepositoryMock,
-                'ccConfig' => $this->ccConfigMock,
-                'dataHelper' => $this->dataHelperMock,
-            ]
-        );
-    }
-
-    public function testCreditCard()
-    {
-        $token = 'token';
-        $creditCard = 'creditCard';
-
-        $this->requestMock->expects($this->once())
-            ->method('getParam')
-            ->with('token')
-            ->willReturn($token);
-
-        $this->vaultMock->expects($this->once())
-            ->method('storedCard')
-            ->with($token)
-            ->willReturn($creditCard);
-
-        $this->assertEquals($creditCard, $this->block->creditCard());
-    }
-
-    /**
-     * @dataProvider getTitleDataProvider
-     */
-    public function testGetTitle($type, $expected)
-    {
-        $this->block->setType($type);
-
-        $title = new \Magento\Framework\Phrase($expected);
-
-        $this->assertEquals($title, $this->block->getTitle());
-    }
-
-    public function getTitleDataProvider()
-    {
-        return [
-            'edit' => [
-                'type' => Management::TYPE_EDIT,
-                'expected' => 'Edit Credit Card',
-            ],
-            'other' => [
-                'type' => null,
-                'expected' => 'Add Credit Card',
-            ],
-        ];
-    }
-
-    public function testIsEditMode()
-    {
-        $this->block->setType(Management::TYPE_EDIT);
-        $this->assertTrue($this->block->isEditMode());
-
-        $this->block->setType(null);
-        $this->assertFalse($this->block->isEditMode());
-    }
-
-    public function testCountrySelect()
-    {
-        $html = "<select>";
-        $default = 'default';
-        $name = 'US';
-        $id = '3';
-        $title = "United States";
-
-        $directoryDataMock = $this->getMockBuilder('\Magento\Braintree\Block\Directory\Data')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->layoutMock->expects($this->any())
-            ->method('getChildName')
-            ->willReturn(true);
-        $this->layoutMock->expects($this->any())
-            ->method('getBlock')
-            ->willReturn($directoryDataMock);
-        $directoryDataMock->expects($this->once())
-            ->method('getCountryHtmlSelect')
-            ->with($default, $name, $id, $title)
-            ->willReturn($html);
-
-        $this->assertEquals($html, $this->block->countrySelect($name, $id, $default, $title));
-    }
-
-    public function testGetRegionIdByName()
-    {
-        $regionCode = 'TX';
-        $countryId = 'US';
-        $regionId = 57;
-
-        $regionCollectionMock = $this->getMockBuilder('\Magento\Directory\Model\ResourceModel\Region\Collection')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->regionCollectionFactoryMock->expects($this->once())
-            ->method('create')
-            ->willReturn($regionCollectionMock);
-
-        $regionCollectionMock->expects($this->once())
-            ->method('addRegionCodeOrNameFilter')
-            ->with($regionCode)
-            ->willReturnSelf();
-        $regionCollectionMock->expects($this->once())
-            ->method('addCountryFilter')
-            ->with($countryId)
-            ->willReturnSelf();
-
-        $regionCollectionMock->expects($this->once())
-            ->method('getSize')
-            ->willReturn(1);
-        $regionCollectionMock->expects($this->once())
-            ->method('getFirstItem')
-            ->willReturn(new \Magento\Framework\DataObject(['id' => $regionId]));
-
-        $this->assertEquals($regionId, $this->block->getRegionIdByName($regionCode, $countryId));
-    }
-
-    public function testGetCcMonths()
-    {
-        $months = [
-            1 => '01 - January',
-            2 => '02 - February',
-        ];
-        $expected = [
-            0 => new \Magento\Framework\Phrase('Month'),
-            1 => '01 - January',
-            2 => '02 - February',
-        ];
-        $this->paymentConfigMock->expects($this->once())
-            ->method('getMonths')
-            ->willReturn($months);
-
-        $this->assertEquals($expected, $this->block->getCcMonths());
-        //Call again, should use cached copy
-        $this->assertEquals($expected, $this->block->getCcMonths());
-    }
-
-    public function testGetCcYear()
-    {
-        $year = [
-            2015 => 2015,
-            2016 => 2016,
-        ];
-        $expected = [
-            0 => new \Magento\Framework\Phrase('Year'),
-            2015 => 2015,
-            2016 => 2016,
-        ];
-        $this->paymentConfigMock->expects($this->once())
-            ->method('getYears')
-            ->willReturn($year);
-
-        $this->assertEquals($expected, $this->block->getCcYears());
-    }
-
-    public function testGetCurrentCustomerStoredCards()
-    {
-        $cards = ['card'];
-        $this->vaultMock->expects($this->once())
-            ->method('currentCustomerStoredCards')
-            ->willReturn($cards);
-
-        $this->assertEquals($cards, $this->block->getCurrentCustomerStoredCards());
-    }
-
-    public function testGetCustomer()
-    {
-        $firstName = 'John';
-        $lastName = 'Doe';
-
-        $customerId = 1003;
-        $customer = new \Magento\Framework\DataObject(
-            [
-                'firstname' => $firstName,
-                'lastname' => $lastName,
-            ]
-        );
-
-        $this->customerSessionMock->expects($this->once())
-            ->method('getCustomerId')
-            ->willReturn($customerId);
-        $this->customerRepositoryMock->expects($this->once())
-            ->method('getById')
-            ->with($customerId)
-            ->willReturn($customer);
-        $this->configMock->expects($this->any())
-            ->method('useVault')
-            ->willReturn(true);
-        $this->customerSessionMock->expects($this->any())
-            ->method('isLoggedIn')
-            ->willReturn(true);
-
-        $this->assertEquals($firstName, $this->block->currentCustomerName());
-        $this->assertEquals($lastName, $this->block->currentCustomerLastName());
-    }
-
-    /**
-     * @dataProvider getCustomerEmptyDataProvider
-     */
-    public function testGetCustomerEmpty($useVault, $isLoggedIn)
-    {
-        $this->configMock->expects($this->any())
-            ->method('useVault')
-            ->willReturn($useVault);
-        $this->customerSessionMock->expects($this->any())
-            ->method('isLoggedIn')
-            ->willReturn($isLoggedIn);
-
-        $this->assertEquals('', $this->block->currentCustomerName());
-        $this->assertEquals('', $this->block->currentCustomerLastName());
-    }
-    public function getCustomerEmptyDataProvider()
-    {
-        return [
-            'no_vault' => [
-                'use_vault' => false,
-                'loggedin' => true,
-            ],
-            'not_logged_in' => [
-                'use_vault' => true,
-                'loggedin' => false,
-            ],
-        ];
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Block/DatajsTest.php b/app/code/Magento/Braintree/Test/Unit/Block/DatajsTest.php
deleted file mode 100644
index 9964355006784075c5d86d8c2dab8bda95b28107..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Block/DatajsTest.php
+++ /dev/null
@@ -1,119 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Test\Unit\Block;
-
-class DatajsTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $contextMock;
-
-    /**
-     * @var \PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $requestMock;
-
-    /**
-     * @var \PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $configMock;
-
-    /**
-     * @var \Magento\Braintree\Block\Datajs
-     */
-    protected $dataJs;
-
-    public function setUp()
-    {
-        $this->contextMock = $this->getMockBuilder('\Magento\Framework\View\Element\Template\Context')
-            ->disableOriginalConstructor()
-            ->setMethods(['getRequest', 'getScopeConfig'])
-            ->getMock();
-
-        $this->requestMock = $this->getMockBuilder('\Magento\Framework\App\Request')
-            ->disableOriginalConstructor()
-            ->setMethods(['getControllerName', 'getActionName'])
-            ->getMock();
-
-        $this->contextMock->expects($this->once())
-            ->method('getRequest')
-            ->willReturn($this->requestMock);
-
-        $this->configMock = $this->getMockBuilder('\Magento\Framework\App\Config')
-            ->disableOriginalConstructor()
-            ->setMethods(['getValue'])
-            ->getMock();
-
-        $this->contextMock->expects($this->once())
-            ->method('getScopeConfig')
-            ->willReturn($this->configMock);
-
-        $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
-        $this->dataJs = $objectManagerHelper->getObject(
-            'Magento\Braintree\Block\Datajs',
-            [
-                'context' => $this->contextMock,
-            ]
-        );
-    }
-
-    public function testGetJsSrc()
-    {
-        $this->configMock->expects($this->once())
-            ->method('getValue')
-            ->with('payment/braintree/data_js', \Magento\Store\Model\ScopeInterface::SCOPE_STORE, null)
-            ->willReturn('data.js');
-
-        $this->dataJs->getJsSrc();
-    }
-
-    public function testGetMerchantId()
-    {
-        $this->configMock->expects($this->once())
-            ->method('getValue')
-            ->with('payment/braintree/merchant_id', \Magento\Store\Model\ScopeInterface::SCOPE_STORE, null)
-            ->willReturn('merchant_id');
-
-        $this->dataJs->getMerchantId();
-    }
-
-    /**
-     * @param string $expected
-     * @param string $controllerName
-     * @param string $actionName
-     * @dataProvider dataProviderGetFormId
-     */
-    public function testGetFormId($expected, $controllerName, $actionName)
-    {
-        $this->requestMock->expects($this->once())
-            ->method('getControllerName')
-            ->willReturn($controllerName);
-
-        $this->requestMock->expects($this->once())
-            ->method('getActionName')
-            ->willReturn($actionName);
-
-        $result = $this->dataJs->getFormId();
-
-        $this->assertSame($result, $expected);
-    }
-
-    /**
-     * @return array
-     */
-    public function dataProviderGetFormId()
-    {
-        return [
-            ['form-validate', 'creditcard', 'newcard'],
-            ['form-validate', 'creditcard', 'edit'],
-            ['delete-form', 'creditcard', 'delete'],
-            ['multishipping-billing-form', 'multishipping', ''],
-            ['edit_form', 'order_create', ''],
-            ['co-payment-form', '', '']
-        ] ;
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Block/Directory/DataTest.php b/app/code/Magento/Braintree/Test/Unit/Block/Directory/DataTest.php
deleted file mode 100644
index 46440a1e795a855ccde8d008efe9263eaeaf4c78..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Block/Directory/DataTest.php
+++ /dev/null
@@ -1,66 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Test\Unit\Block\Directory;
-
-class DataTest extends \PHPUnit_Framework_TestCase
-{
-    public function testGetCountryCollection()
-    {
-        $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
-        $countrySourceMock = $this->getMockBuilder('\Magento\Braintree\Model\System\Config\Source\Country')
-            ->disableOriginalConstructor()
-            ->setMethods(['getRestrictedCountries'])
-            ->getMock();
-
-        $countryCollectionFactoryMock = $this->getMockBuilder(
-            '\Magento\Directory\Model\ResourceModel\Country\CollectionFactory'
-        )->disableOriginalConstructor()
-            ->setMethods(['create'])
-            ->getMock();
-
-        $countryCollectionMock = $this->getMockBuilder('\Magento\Directory\Model\ResourceModel\Country\Collection')
-            ->disableOriginalConstructor()
-            ->setMethods(['addFieldToFilter', 'loadByStore'])
-            ->getMock();
-
-        $countryCollectionMock->expects($this->any())
-            ->method('addFieldToFilter')
-            ->willReturnSelf();
-
-        $country = $objectManagerHelper->getObject('Magento\Directory\Model\Country');
-        $country->setData('country_id', 'US');
-
-        $countryCollectionMock->expects($this->any())
-            ->method('loadByStore')
-            ->willReturn([$country]);
-
-        $countryCollectionFactoryMock->expects($this->any())
-            ->method('create')
-            ->willReturn($countryCollectionMock);
-
-        $configMock = $this->getMockBuilder('\Magento\Braintree\Model\Config\Cc')
-            ->disableOriginalConstructor()
-            ->setMethods(['canUseForCountry'])
-            ->getMock();
-
-        $configMock->expects($this->once())
-            ->method('canUseForCountry')
-            ->with('US')
-            ->willReturn(true);
-
-        $data = $objectManagerHelper->getObject(
-            'Magento\Braintree\Block\Directory\Data',
-            [
-                'countrySource' => $countrySourceMock,
-                'countryCollectionFactory' => $countryCollectionFactoryMock,
-                'config' => $configMock
-            ]
-        );
-
-        $result = $data->getCountryCollection();
-        $this->assertSame($result[0]->getData('country_id'), $country->getData('country_id'));
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Block/FormTest.php b/app/code/Magento/Braintree/Test/Unit/Block/FormTest.php
index 7181c6ee738c037084f18e34ce094bc57e1974ed..d240cff34867c629e726b39271088920d56adb7f 100644
--- a/app/code/Magento/Braintree/Test/Unit/Block/FormTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Block/FormTest.php
@@ -5,269 +5,169 @@
  */
 namespace Magento\Braintree\Test\Unit\Block;
 
+use Magento\Backend\Model\Session\Quote;
+use Magento\Braintree\Block\Form;
+use Magento\Braintree\Gateway\Config\Config as GatewayConfig;
+use Magento\Braintree\Model\Adminhtml\Source\CcType;
+use Magento\Braintree\Model\Ui\ConfigProvider;
+use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
+use Magento\Payment\Model\Config;
+use Magento\Vault\Model\Ui\VaultConfigProvider;
+use Magento\Vault\Model\VaultPaymentInterface;
+
+/**
+ * Class FormTest
+ */
 class FormTest extends \PHPUnit_Framework_TestCase
 {
-    /**
-     * @var \PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $onePageMock;
+    public static $baseCardTypes = [
+        'AE' => 'American Express',
+        'VI' => 'Visa',
+        'MC' => 'MasterCard',
+        'DI' => 'Discover',
+        'JBC' => 'JBC',
+        'CUP' => 'China Union Pay',
+        'MI' => 'Maestro',
+    ];
+
+    public static $configCardTypes = [
+        'AE', 'VI', 'MC', 'DI', 'JBC'
+    ];
 
     /**
-     * @var \PHPUnit_Framework_MockObject_MockObject
+     * @var Form
      */
-    protected $vaultMock;
+    private $block;
 
     /**
-     * @var \PHPUnit_Framework_MockObject_MockObject
+     * @var Quote|\PHPUnit_Framework_MockObject_MockObject
      */
-    protected $checkoutSessionMock;
+    private $sessionQuote;
 
     /**
-     * @var \PHPUnit_Framework_MockObject_MockObject
+     * @var Config|\PHPUnit_Framework_MockObject_MockObject
      */
-    protected $configMock;
+    private $gatewayConfig;
 
     /**
-     * @var \PHPUnit_Framework_MockObject_MockObject
+     * @var CcType|\PHPUnit_Framework_MockObject_MockObject
      */
-    protected $dataHelperMock;
+    private $ccType;
 
     /**
-     * @var \PHPUnit_Framework_MockObject_MockObject
+     * @var VaultPaymentInterface|\PHPUnit_Framework_MockObject_MockObject
      */
-    protected $contextMock;
+    private $vaultService;
 
-    /**
-     * @var \PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $sessionQuoteMock;
-
-    /**
-     * @var \PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $appStateMock;
-
-    /**
-     * @var \PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $paymentConfigMock;
+    protected function setUp()
+    {
+        $this->initCcTypeMock();
+        $this->initSessionQuoteMock();
+        $this->initGatewayConfigMock();
+
+        $this->vaultService = $this->getMock(VaultPaymentInterface::class);
+
+        $managerHelper = new ObjectManager($this);
+        $this->block = $managerHelper->getObject(Form::class, [
+            'paymentConfig' => $managerHelper->getObject(Config::class),
+            'sessionQuote' => $this->sessionQuote,
+            'gatewayConfig' => $this->gatewayConfig,
+            'ccType' => $this->ccType,
+            'vaultService' => $this->vaultService
+        ]);
+    }
 
     /**
-     * @var \Magento\Braintree\Block\Form
+     * @covers \Magento\Braintree\Block\Form::getCcAvailableTypes
+     * @param string $countryId
+     * @param array $availableTypes
+     * @param array $expected
+     * @dataProvider countryCardTypesDataProvider
      */
-    protected $form;
-
-    public function setUp()
+    public function testGetCcAvailableTypes($countryId, array $availableTypes, array $expected)
     {
-        $this->onePageMock = $this->getMockBuilder('\Magento\Checkout\Model\Type\Onepage')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->vaultMock = $this->getMockBuilder('\Magento\Braintree\Model\Vault')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->checkoutSessionMock = $this->getMockBuilder('\Magento\Checkout\Model\Session')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->configMock = $this->getMockBuilder('\Magento\Braintree\Model\Config\Cc')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->dataHelperMock = $this->getMockBuilder('\Magento\Braintree\Helper\Data')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->contextMock = $this->getMockBuilder('\Magento\Framework\View\Element\Template\Context')
-            ->disableOriginalConstructor()
-            ->setMethods(['getAppState'])
-            ->getMock();
-
-        $this->sessionQuoteMock = $this->getMockBuilder('\Magento\Backend\Model\Session\Quote')
-            ->disableOriginalConstructor()
-            ->setMethods(['getQuote'])
-            ->getMock();
-
-        $this->appStateMock = $this->getMockBuilder('\Magento\Framework\App\State')
-            ->disableOriginalConstructor()
-            ->getMock();
+        $this->sessionQuote->expects(static::once())
+            ->method('getCountryId')
+            ->willReturn($countryId);
 
-        $this->contextMock->expects($this->once())
-            ->method('getAppState')
-            ->willReturn($this->appStateMock);
+        $this->gatewayConfig->expects(static::once())
+            ->method('getAvailableCardTypes')
+            ->willReturn(self::$configCardTypes);
 
-        $this->paymentConfigMock = $this->getMockBuilder('\Magento\Payment\Model\Config')
-            ->disableOriginalConstructor()
-            ->getMock();
+        $this->gatewayConfig->expects(static::once())
+            ->method('getCountryAvailableCardTypes')
+            ->with($countryId)
+            ->willReturn($availableTypes);
 
-        $this->objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
-        $this->form = $this->objectManagerHelper->getObject(
-            'Magento\Braintree\Block\Form',
-            [
-                'onepage' => $this->onePageMock,
-                'vault' => $this->vaultMock,
-                'checkoutSession' => $this->checkoutSessionMock,
-                'config' => $this->configMock,
-                'dataHelper' => $this->dataHelperMock,
-                'context' => $this->contextMock,
-                'sessionQuote' => $this->sessionQuoteMock,
-                'paymentConfig' => $this->paymentConfigMock
-            ]
-        );
+        $result = $this->block->getCcAvailableTypes();
+        static::assertEquals($expected, array_values($result));
     }
 
-    public function setMethodInfo()
+    /**
+     * Get country card types testing data
+     * @return array
+     */
+    public function countryCardTypesDataProvider()
     {
-        $paymentMock = $this->getMockBuilder('\Magento\Quote\Model\Quote\Payment')
-            ->disableOriginalConstructor()
-            ->setMethods(['getMethodInstance'])
-            ->getMock();
-
-        $paymentMock->expects($this->once())
-            ->method('getMethodInstance')
-            ->willReturn('method');
-
-        $quoteMock = $this->getMockBuilder('\Magento\Quote\Model\Quote')
-            ->disableOriginalConstructor()
-            ->setMethods(['getPayment'])
-            ->getMock();
-
-        $quoteMock->expects($this->once())
-            ->method('getPayment')
-            ->willReturn($paymentMock);
-
-        $this->onePageMock->expects($this->once())
-            ->method('getQuote')
-            ->willReturn($quoteMock);
-
-        $this->form->setMethodInfo();
+        return [
+            ['US', ['AE', 'VI'], ['American Express', 'Visa']],
+            ['UK', ['VI'], ['Visa']],
+            ['CA', ['MC'], ['MasterCard']],
+            ['UA', [], ['American Express', 'Visa', 'MasterCard', 'Discover', 'JBC']]
+        ];
     }
 
-    public function testGetStoredCards()
+    public function testIsVaultEnabled()
     {
-        $card = new \stdClass();
-        $card->cardType = 'VI';
-
-        $this->vaultMock->expects($this->once())
-            ->method('currentCustomerStoredCards')
-            ->willReturn([$card]);
+        $this->vaultService->expects(static::once())
+            ->method('isActiveForPayment')
+            ->with(ConfigProvider::CODE)
+            ->willReturn(true);
 
-        $addressMock = $this->getMockBuilder('\Magento\Quote\Model\Quote\Address')
-            ->disableOriginalConstructor()
-            ->setMethods(['getCountryId'])
-            ->getMock();
-
-        $addressMock->expects($this->once())
-            ->method('getCountryId')
-            ->willReturn('US');
-
-        $quoteMock = $this->getMockBuilder('\Magento\Quote\Model\Quote')
-            ->disableOriginalConstructor()
-            ->setMethods(['getBillingAddress'])
-            ->getMock();
-
-        $quoteMock->expects($this->once())
-            ->method('getBillingAddress')
-            ->willReturn($addressMock);
-
-        $this->checkoutSessionMock->expects($this->once())
-            ->method('getQuote')
-            ->willReturn($quoteMock);
-
-        $this->configMock->expects($this->once())
-            ->method('getApplicableCardTypes')
-            ->with('US')
-            ->willReturn(['VI', 'DI', 'MC', 'AE', 'JCB']);
-
-        $this->dataHelperMock->expects($this->once())
-            ->method('getCcTypeCodeByName')
-            ->with('VI')
-            ->willReturn('VI');
-
-        $result = $this->form->getStoredCards();
-        $this->assertSame($result, [$card]);
+        static::assertTrue($this->block->isVaultEnabled());
     }
 
-    public function testGetCcAvailableTypesWithSession()
+    /**
+     * Create mock for credit card type
+     */
+    private function initCcTypeMock()
     {
-        $this->appStateMock->expects($this->once())
-            ->method('getAreaCode')
-            ->willReturn(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE);
-
-        $addressMock = $this->getMockBuilder('\Magento\Quote\Model\Quote\Address')
+        $this->ccType = $this->getMockBuilder(CcType::class)
             ->disableOriginalConstructor()
-            ->setMethods(['getCountryId'])
+            ->setMethods(['getCcTypeLabelMap'])
             ->getMock();
 
-        $addressMock->expects($this->once())
-            ->method('getCountryId')
-            ->willReturn('US');
+        $this->ccType->expects(static::any())
+            ->method('getCcTypeLabelMap')
+            ->willReturn(self::$baseCardTypes);
+    }
 
-        $quoteMock = $this->getMockBuilder('\Magento\Quote\Model\Quote')
+    /**
+     * Create mock for session quote
+     */
+    private function initSessionQuoteMock()
+    {
+        $this->sessionQuote = $this->getMockBuilder(Quote::class)
             ->disableOriginalConstructor()
-            ->setMethods(['getBillingAddress'])
+            ->setMethods(['getQuote', 'getBillingAddress', 'getCountryId', '__wakeup'])
             ->getMock();
 
-        $quoteMock->expects($this->once())
-            ->method('getBillingAddress')
-            ->willReturn($addressMock);
-
-        $this->sessionQuoteMock->expects($this->once())
+        $this->sessionQuote->expects(static::any())
             ->method('getQuote')
-            ->willReturn($quoteMock);
-
-        $this->configMock->expects($this->once())
-            ->method('getApplicableCardTypes')
-            ->with('US')
-            ->willReturn(['VI', 'DI', 'MC', 'AE', 'JCB']);
-
-        $this->paymentConfigMock->expects($this->once())
-            ->method('getCcTypes')
-            ->willReturn(['VI' => 'VI', 'DI' => 'DI', 'MC' => 'MC', 'AE' => 'AE', 'JCB' => 'JCB']);
-
-        $result = $this->form->getCcAvailableTypes();
-        $this->assertSame($result, ['VI' => 'VI', 'DI' => 'DI', 'MC' => 'MC', 'AE' => 'AE', 'JCB' => 'JCB']);
+            ->willReturnSelf();
+        $this->sessionQuote->expects(static::any())
+            ->method('getBillingAddress')
+            ->willReturnSelf();
     }
 
-    public function testGetCcAvailableTypesWithCheckout()
+    /**
+     * Create mock for gateway config
+     */
+    private function initGatewayConfigMock()
     {
-        $this->appStateMock->expects($this->once())
-            ->method('getAreaCode')
-            ->willReturn('');
-
-        $addressMock = $this->getMockBuilder('\Magento\Quote\Model\Quote\Address')
+        $this->gatewayConfig = $this->getMockBuilder(GatewayConfig::class)
             ->disableOriginalConstructor()
-            ->setMethods(['getCountryId'])
+            ->setMethods(['getCountryAvailableCardTypes', 'getAvailableCardTypes'])
             ->getMock();
-
-        $addressMock->expects($this->once())
-            ->method('getCountryId')
-            ->willReturn('US');
-
-        $quoteMock = $this->getMockBuilder('\Magento\Quote\Model\Quote')
-            ->disableOriginalConstructor()
-            ->setMethods(['getBillingAddress'])
-            ->getMock();
-
-        $quoteMock->expects($this->once())
-            ->method('getBillingAddress')
-            ->willReturn($addressMock);
-
-        $this->checkoutSessionMock->expects($this->once())
-            ->method('getQuote')
-            ->willReturn($quoteMock);
-
-        $this->configMock->expects($this->once())
-            ->method('getApplicableCardTypes')
-            ->with('US')
-            ->willReturn(['VI', 'DI', 'MC', 'AE', 'JCB']);
-
-        $this->paymentConfigMock->expects($this->once())
-            ->method('getCcTypes')
-            ->willReturn(['VI' => 'VI', 'DI' => 'DI', 'MC' => 'MC', 'AE' => 'AE', 'JCB' => 'JCB']);
-
-        $result = $this->form->getCcAvailableTypes();
-        $this->assertSame($result, ['VI' => 'VI', 'DI' => 'DI', 'MC' => 'MC', 'AE' => 'AE', 'JCB' => 'JCB']);
     }
 }
diff --git a/app/code/Magento/Braintree/Test/Unit/Block/Info/PayPalTest.php b/app/code/Magento/Braintree/Test/Unit/Block/Info/PayPalTest.php
deleted file mode 100644
index a93a87b966cb71e6a0a61a9004550eca52cdd84d..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Block/Info/PayPalTest.php
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Test\Unit\Block\Info;
-
-class PayPalTest extends \PHPUnit_Framework_TestCase
-{
-    public function testGetChildHtml()
-    {
-        $contextMock = $this->getMockBuilder('\Magento\Framework\View\Element\Template\Context')
-            ->disableOriginalConstructor()
-            ->setMethods(['getRequest'])
-            ->getMock();
-
-        $requestMock = $this->getMockBuilder('\Magento\Framework\App\Request')
-            ->disableOriginalConstructor()
-            ->setMethods(['getPost'])
-            ->getMock();
-
-        $requestMock->expects($this->once())
-            ->method('getPost')
-            ->with('device_data')
-            ->willReturn('device_data');
-
-        $contextMock->expects($this->once())
-            ->method('getRequest')
-            ->willReturn($requestMock);
-
-        $configMock = $this->getMockBuilder('\Magento\Payment\Model\Config')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
-        $info = $objectManagerHelper->getObject(
-            'Magento\Braintree\Block\Info\PayPal',
-            [
-                'context' => $contextMock,
-                'paymentConfig' => $configMock,
-            ]
-        );
-
-        $result = $info->getChildHtml();
-        $this->assertSame($result, "<input type='hidden' name='device_data' value='device_data'>");
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Block/InfoTest.php b/app/code/Magento/Braintree/Test/Unit/Block/InfoTest.php
deleted file mode 100644
index 438eda8232c37092b8acb20709afe361942dd639..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Block/InfoTest.php
+++ /dev/null
@@ -1,55 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Test\Unit\Block;
-
-class InfoTest extends \PHPUnit_Framework_TestCase
-{
-    public function testGetChildHtml()
-    {
-        $contextMock = $this->getMockBuilder('\Magento\Framework\View\Element\Template\Context')
-            ->disableOriginalConstructor()
-            ->setMethods(['getRequest'])
-            ->getMock();
-
-        $requestMock = $this->getMockBuilder('\Magento\Framework\App\Request')
-            ->disableOriginalConstructor()
-            ->setMethods(['getPost'])
-            ->getMock();
-
-        $requestMock->expects($this->at(0))
-            ->method('getPost')
-            ->with('payment')
-            ->willReturn(['cc_token' => 'cc_token', 'store_in_vault' => 'store_in_vault']);
-
-        $requestMock->expects($this->at(1))
-            ->method('getPost')
-            ->with('device_data')
-            ->willReturn('device_data');
-
-        $contextMock->expects($this->once())
-            ->method('getRequest')
-            ->willReturn($requestMock);
-
-        $configMock = $this->getMockBuilder('\Magento\Payment\Model\Config')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
-        $info = $objectManagerHelper->getObject(
-            'Magento\Braintree\Block\Info',
-            [
-                'context' => $contextMock,
-                'paymentConfig' => $configMock,
-            ]
-        );
-
-        $result = $info->getChildHtml();
-        $expected = "<input type='hidden' name='payment[cc_token]' value='cc_token'>"
-            . "<input type='hidden' name='payment[store_in_vault]' value='store_in_vault'>"
-            . "<input type='hidden' name='device_data' value='device_data'>";
-        $this->assertSame($expected, $result);
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Block/PayPal/ShortcutTest.php b/app/code/Magento/Braintree/Test/Unit/Block/PayPal/ShortcutTest.php
deleted file mode 100644
index a7392181a1a9b2d1ffa0032dc527a55d1188d42f..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Block/PayPal/ShortcutTest.php
+++ /dev/null
@@ -1,297 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Test\Unit\Block\PayPal;
-
-use Magento\Braintree\Block\PayPal\Shortcut;
-
-/**
- * Class ShortcutTest
- */
-class ShortcutTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Framework\Math\Random|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $mathRandomMock;
-
-    /**
-     * @var \Magento\Framework\Locale\ResolverInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $localeResolverMock;
-
-    /**
-     * @var \Magento\Braintree\Model\Config\PayPal|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $paypalConfigMock;
-
-    /**
-     * @var \Magento\Checkout\Model\Session|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $checkoutSessionMock;
-
-    /**
-     * @var \Magento\Customer\Model\Session|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $customerSessionMock;
-
-    /**
-     * @var \Magento\Checkout\Helper\Data|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $checkoutDataMock;
-
-    /**
-     * @var \Magento\Framework\UrlInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $urlBuilderMock;
-
-    /**
-     * @var \Magento\Framework\DataObject
-     */
-    protected $container;
-
-    /**
-     * @var Shortcut
-     */
-    protected $block;
-
-    /**
-     * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager
-     */
-    protected $objectManagerHelper;
-
-    public function setUp()
-    {
-        $this->mathRandomMock = $this->getMockBuilder('\Magento\Framework\Math\Random')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->localeResolverMock = $this->getMock('\Magento\Framework\Locale\ResolverInterface');
-
-        $this->paypalConfigMock = $this->getMockBuilder('\Magento\Braintree\Model\Config\PayPal')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->checkoutSessionMock = $this->getMockBuilder('\Magento\Checkout\Model\Session')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->customerSessionMock = $this->getMockBuilder('\Magento\Customer\Model\Session')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->checkoutDataMock = $this->getMockBuilder('\Magento\Checkout\Helper\Data')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->urlBuilderMock = $this->getMock('\Magento\Framework\UrlInterface');
-
-        $contextMock = $this->getMockBuilder('\Magento\Framework\View\Element\Template\Context')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $contextMock->expects($this->any())
-            ->method('getUrlBuilder')
-            ->willReturn($this->urlBuilderMock);
-
-        $this->container = new \Magento\Framework\DataObject(
-            [
-                'module_name' => 'Magento_Catalog',
-            ]
-        );
-
-        $this->objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
-        $this->block = $this->objectManagerHelper->getObject(
-            'Magento\Braintree\Block\PayPal\Shortcut',
-            [
-                'context' => $contextMock,
-                'mathRandom' => $this->mathRandomMock,
-                'localeResolver' => $this->localeResolverMock,
-                'paypalConfig' => $this->paypalConfigMock,
-                'checkoutSession' => $this->checkoutSessionMock,
-                'customerSession' => $this->customerSessionMock,
-                'checkoutData' => $this->checkoutDataMock,
-                'data' => [
-                    'container' => $this->container,
-                ]
-            ]
-        );
-    }
-
-    public function testGetClientToken()
-    {
-        $clientToken = 'clientToken';
-        $this->paypalConfigMock->expects($this->once())
-            ->method('getClientToken')
-            ->willReturn($clientToken);
-
-        $this->assertEquals($clientToken, $this->block->getClientToken());
-    }
-
-    public function testGetAmount()
-    {
-        $amount = 10.5;
-        $quote = new \Magento\Framework\DataObject(
-            [
-                'base_grand_total' => $amount,
-            ]
-        );
-
-        $this->checkoutSessionMock->expects($this->once())
-            ->method('getQuote')
-            ->willReturn($quote);
-
-        $this->assertEquals($amount, $this->block->getAmount());
-    }
-
-    public function testGetReviewPageUrl()
-    {
-        $url = 'http://localhost/braintree/paypal/review';
-
-        $this->urlBuilderMock->expects($this->once())
-            ->method('getUrl')
-            ->with('braintree/paypal/review')
-            ->willReturn($url);
-
-        $this->assertEquals($url, $this->block->getReviewPageUrl());
-    }
-
-    public function testGetCurrency()
-    {
-        $currency = 'USD';
-
-        $quote = new \Magento\Framework\DataObject(
-            [
-                'currency' => new \Magento\Framework\DataObject(
-                    [
-                        'base_currency_code' => $currency,
-                    ]
-                ),
-            ]
-        );
-        $this->checkoutSessionMock->expects($this->once())
-            ->method('getQuote')
-            ->willReturn($quote);
-
-        $this->assertEquals($currency, $this->block->getCurrency());
-    }
-
-    public function testGetLocale()
-    {
-        $locale = 'en_US';
-
-        $this->localeResolverMock->expects($this->once())
-            ->method('getLocale')
-            ->willReturn($locale);
-
-        $this->assertEquals($locale, $this->block->getLocale());
-    }
-
-    public function testMerchantName()
-    {
-        $merchantName = 'Magento';
-
-        $this->paypalConfigMock->expects($this->once())
-            ->method('getMerchantNameOverride')
-            ->willReturn($merchantName);
-
-        $this->assertEquals($merchantName, $this->block->getMerchantName());
-    }
-
-    public function testEnableBillingAddress()
-    {
-        $flag = true;
-
-        $this->paypalConfigMock->expects($this->once())
-            ->method('isBillingAddressEnabled')
-            ->willReturn($flag);
-
-        $this->assertEquals($flag, $this->block->enableBillingAddress());
-    }
-
-    /**
-     * @param bool $isLoggedIn
-     * @param bool $isAllowedGuestCheckout
-     * @dataProvider skipShortcutForGuestDataProvider
-     */
-    public function testSkipShortcutForGuest($isLoggedIn, $isAllowedGuestCheckout, $expected)
-    {
-        $this->customerSessionMock->expects($this->any())
-            ->method('isLoggedIn')
-            ->willReturn($isLoggedIn);
-
-        $quoteMock = $this->getMockBuilder('\Magento\Quote\Model\Quote')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->checkoutSessionMock->expects($this->any())
-            ->method('getQuote')
-            ->willReturn($quoteMock);
-        $this->checkoutDataMock->expects($this->any())
-            ->method('isAllowedGuestCheckout')
-            ->willReturn($isAllowedGuestCheckout);
-
-        $this->assertEquals($expected, $this->block->skipShortcutForGuest());
-    }
-
-    public function skipShortcutForGuestDataProvider()
-    {
-        return [
-            'logged_in' => [
-                'is_logged_in' => true,
-                'is_guest_checkout_allowed' => true,
-                'expected' => false,
-            ],
-            'not_logged_in_guest_allowed' => [
-                'is_logged_in' => false,
-                'is_guest_checkout_allowed' => true,
-                'expected' => false,
-            ],
-            'not_logged_in_guest_not_allowed' => [
-                'is_logged_in' => false,
-                'is_guest_checkout_allowed' => false,
-                'expected' => true,
-            ],
-        ];
-    }
-
-    public function testGetHtmlElementIdsMiniCart()
-    {
-        $block = $this->objectManagerHelper->getObject(
-            'Magento\Braintree\Block\PayPal\Shortcut',
-            [
-                'data' => [
-                    Shortcut::MINI_CART_FLAG_KEY => 1
-                ]
-            ]
-        );
-
-        $this->assertEquals('braintree_paypal_container_minicart', $block->getContainerId());
-        $this->assertEquals('braintree_paypal_submit_form_minicart', $block->getSubmitFormId());
-        $this->assertEquals('braintree_paypal_payment_method_nonce_minicart', $block->getPaymentMethodNonceId());
-        $this->assertEquals('braintree_paypal_payment_details_minicart', $block->getPaymentDetailsId());
-    }
-
-    public function testGetHtmlElementIdsShoppingCart()
-    {
-        $random = '_shopping_cart';
-        $this->mathRandomMock->expects($this->any())
-            ->method('getRandomString')
-            ->willReturn($random);
-
-        $block = $this->objectManagerHelper->getObject(
-            'Magento\Braintree\Block\PayPal\Shortcut',
-            [
-                'mathRandom' => $this->mathRandomMock,
-                'data' => [
-                    Shortcut::MINI_CART_FLAG_KEY => 0
-                ]
-            ]
-        );
-
-        $this->assertEquals('braintree_paypal_container_shopping_cart', $block->getContainerId());
-        $this->assertEquals('braintree_paypal_submit_form_shopping_cart', $block->getSubmitFormId());
-        $this->assertEquals('braintree_paypal_payment_method_nonce_shopping_cart', $block->getPaymentMethodNonceId());
-        $this->assertEquals('braintree_paypal_payment_details_shopping_cart', $block->getPaymentDetailsId());
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Controller/Creditcard/AjaxSaveTest.php b/app/code/Magento/Braintree/Test/Unit/Controller/Creditcard/AjaxSaveTest.php
deleted file mode 100644
index 53e070f5843a81ac46817a4e96067d2bd5b7dbf4..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Controller/Creditcard/AjaxSaveTest.php
+++ /dev/null
@@ -1,139 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Controller\Creditcard;
-
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
-use Magento\Framework\Exception\LocalizedException;
-
-/**
- * Test for AjaxSave
- */
-class AjaxSaveTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Framework\App\Request\Http
-     */
-    private $request;
-
-    /**
-     * @var \Magento\Framework\App\Response\Http
-     */
-    private $resultFactory;
-
-    /**
-     * @var \Magento\Braintree\Model\Vault
-     */
-    private $vault;
-
-    /**
-     * @var \Magento\Framework\Controller\Result\Json
-     */
-    private $resultJson;
-
-    /**
-     * @var \Magento\Framework\Message\ManagerInterface
-     */
-    private $messageManager;
-
-
-    /**
-     * test setup
-     */
-    public function setUp()
-    {
-        $this->request = $this->getMockBuilder('\Magento\Framework\App\Request\Http')
-            ->disableOriginalConstructor()
-            ->setMethods(['getParam'])
-            ->getMock();
-
-        $this->resultFactory = $this->getMockBuilder('Magento\Framework\Controller\ResultFactory')
-            ->disableOriginalConstructor()
-            ->setMethods(['create'])
-            ->getMock();
-
-        $this->vault = $this->getMockBuilder('\Magento\Braintree\Model\Vault')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->resultJson= $this->getMockBuilder('Magento\Framework\Controller\Result\Json')
-            ->disableOriginalConstructor()
-            ->setMethods(['setData'])
-            ->getMock();
-
-        $this->messageManager= $this->getMockBuilder('\Magento\Framework\Message\ManagerInterface')
-            ->getMock();
-
-    }
-
-    /**
-     * Executes the controller action and asserts non exception logic
-     */
-    public function testExecute()
-    {
-        $phrase = new \Magento\Framework\Phrase('Credit card successfully added');
-        $objectManager = new ObjectManager($this);
-        $this->resultJson->expects($this->once())
-            ->method('setData')
-            ->with(['success' => true, 'error_message' => '']);
-
-        $this->resultFactory->expects($this->once())
-            ->method('create')
-            ->willReturn($this->resultJson);
-
-        $this->messageManager->expects($this->once())
-            ->method('addSuccess')
-            ->with($phrase);
-
-
-        $notification = $objectManager->getObject(
-            'Magento\Braintree\Controller\Creditcard\AjaxSave',
-            [
-                'request' => $this->request,
-                'resultFactory' => $this->resultFactory,
-                'messageManager' => $this->messageManager,
-            ]
-        );
-
-        $this->assertSame($this->resultJson, $notification->execute());
-    }
-
-    /**
-     * Executes the controller action and asserts non exception logic
-     */
-    public function testExecuteLocalizedException()
-    {
-        $phrase = new \Magento\Framework\Phrase('some error');
-        $objectManager = new ObjectManager($this);
-        $this->vault->expects($this->once())
-            ->method('processNonce')
-            ->willThrowException(new LocalizedException($phrase));
-
-        $this->resultJson->expects($this->once())
-            ->method('setData')
-            ->with(['success' => false, 'error_message' => 'some error']);
-
-        $this->resultFactory->expects($this->once())
-            ->method('create')
-            ->willReturn($this->resultJson);
-
-        $this->messageManager->expects($this->once())
-            ->method('addError')
-            ->with($phrase);
-
-        $notification = $objectManager->getObject(
-            'Magento\Braintree\Controller\Creditcard\AjaxSave',
-            [
-                'request' => $this->request,
-                'resultFactory' => $this->resultFactory,
-                'vault' => $this->vault,
-                'messageManager' => $this->messageManager,
-            ]
-        );
-
-        $this->assertSame($this->resultJson, $notification->execute());
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Controller/Creditcard/DeleteConfirmTest.php b/app/code/Magento/Braintree/Test/Unit/Controller/Creditcard/DeleteConfirmTest.php
deleted file mode 100644
index a3047c7cac4437e36a750f67dd3b6458c2b80db2..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Controller/Creditcard/DeleteConfirmTest.php
+++ /dev/null
@@ -1,229 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Controller\Creditcard;
-
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
-use Magento\Framework\Exception\LocalizedException;
-
-class DeleteConfirmTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Framework\App\Request\Http
-     */
-    private $request;
-
-    /**
-     * @var  \Magento\Framework\Controller\Result\RedirectFactory
-     */
-    private $resultRedirectFactory;
-
-    /**
-     * @var  \Magento\Framework\Controller\Result\Redirect
-     */
-    private $resultRedirect;
-
-    /**
-     * @var \Magento\Braintree\Model\Vault
-     */
-    private $vault;
-
-    /**
-     * test setup
-     */
-    public function setUp()
-    {
-        $this->request = $this->getMockBuilder('\Magento\Framework\App\Request\Http')
-            ->disableOriginalConstructor()
-            ->setMethods(['getParam'])
-            ->getMock();
-
-        $this->vault = $this->getMockBuilder('\Magento\Braintree\Model\Vault')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->resultRedirectFactory = $this->getMockBuilder('\Magento\Framework\Controller\Result\RedirectFactory')
-            ->disableOriginalConstructor()
-            ->setMethods(['create'])
-            ->getMock();
-
-        $this->resultRedirect = $this->getMockBuilder('\Magento\Framework\Controller\Result\Redirect')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->resultRedirectFactory->expects($this->once())
-            ->method('create')
-            ->willReturn($this->resultRedirect);
-
-        $this->resultRedirect->expects($this->once())
-            ->method('setPath')
-            ->willReturnSelf();
-    }
-
-    /**
-     * Executes the controller action and asserts successfully deleted
-     */
-    public function testExecute()
-    {
-        $objectManager = new ObjectManagerHelper($this);
-        $phrase = new \Magento\Framework\Phrase('Credit card successfully deleted');
-
-        $this->vault->expects($this->once())
-            ->method('deleteCard')
-            ->willReturn(json_decode(json_encode(['success' => true])));
-
-        $this->request->expects($this->any())
-            ->method('getParam')
-            ->willReturn('token');
-
-        $this->resultRedirectFactory->expects($this->once())
-            ->method('create')
-            ->willReturn($this->resultRedirect);
-        /**
-         * @var \Magento\Framework\Message\ManagerInterface $messageManager
-         */
-        $messageManager= $this->getMockBuilder('\Magento\Framework\Message\ManagerInterface')
-            ->getMock();
-
-
-        $messageManager->expects($this->once())
-            ->method('addSuccess')
-            ->with($phrase);
-
-        $notification = $objectManager->getObject(
-            'Magento\Braintree\Controller\Creditcard\DeleteConfirm',
-            [
-                'request' => $this->request,
-                'resultRedirectFactory' => $this->resultRedirectFactory,
-                'vault' => $this->vault,
-                'messageManager' => $messageManager,
-            ]
-        );
-
-        $this->assertSame($this->resultRedirect, $notification->execute());
-    }
-
-    /**
-     * Executes the controller action and asserts with redirect for non valid token param
-     */
-    public function testExecuteNoTokenRedirect()
-    {
-        $objectManager = new ObjectManagerHelper($this);
-
-        $this->vault->expects($this->never())
-            ->method('deleteCard');
-
-        $this->request->expects($this->any())
-            ->method('getParam')
-            ->willReturn(null);
-
-        $this->resultRedirectFactory->expects($this->once())
-            ->method('create')
-            ->willReturn($this->resultRedirect);
-
-        $this->resultRedirect->expects($this->once())
-            ->method('setPath')
-            ->willReturnSelf();
-
-        $notification = $objectManager->getObject(
-            'Magento\Braintree\Controller\Creditcard\Edit',
-            [
-                'request' => $this->request,
-                'resultRedirectFactory' => $this->resultRedirectFactory,
-                'vault' => $this->vault,
-            ]
-        );
-
-        $this->assertSame($this->resultRedirect, $notification->execute());
-    }
-
-    /**
-     * Executes the controller action and asserts with redirects for can't delete card logic
-     */
-    public function testExecuteNonExistingTokenRedirect()
-    {
-        $objectManager = new ObjectManagerHelper($this);
-        $phrase = new \Magento\Framework\Phrase('a,b,c');
-        $this->vault->expects($this->once())
-            ->method('deleteCard')
-            ->willReturn(json_decode(json_encode(['success' => false, 'message'=> 'a,b,c'])));
-
-        $this->request->expects($this->any())
-            ->method('getParam')
-            ->willReturn('token');
-
-        $this->resultRedirectFactory->expects($this->once())
-            ->method('create')
-            ->willReturn($this->resultRedirect);
-
-        $this->resultRedirect->expects($this->once())
-            ->method('setPath')
-            ->willReturnSelf();
-
-        /**
-         * @var \Magento\Framework\Message\ManagerInterface $messageManager
-         */
-        $messageManager= $this->getMockBuilder('\Magento\Framework\Message\ManagerInterface')
-            ->getMock();
-        $messageManager->expects($this->once())
-            ->method('addError')
-            ->with($phrase);
-
-        $notification = $objectManager->getObject(
-            'Magento\Braintree\Controller\Creditcard\DeleteConfirm',
-            [
-                'request' => $this->request,
-                'resultRedirectFactory' => $this->resultRedirectFactory,
-                'vault' => $this->vault,
-                'messageManager' => $messageManager,
-            ]
-        );
-
-        $this->assertSame($this->resultRedirect, $notification->execute());
-    }
-
-    /**
-     * Executes the controller action and asserts failed deletion
-     */
-    public function testExecuteSaveFail()
-    {
-        $objectManager = new ObjectManagerHelper($this);
-        $phrase = new \Magento\Framework\Phrase('There was error deleting the credit card');
-
-        $this->vault->expects($this->once())
-            ->method('deleteCard')
-            ->willReturn(false);
-
-        $this->request->expects($this->any())
-            ->method('getParam')
-            ->willReturn('token');
-
-        $this->resultRedirectFactory->expects($this->once())
-            ->method('create')
-            ->willReturn($this->resultRedirect);
-
-        /**
-         * @var \Magento\Framework\Message\ManagerInterface $messageManager
-         */
-        $messageManager= $this->getMockBuilder('\Magento\Framework\Message\ManagerInterface')
-            ->getMock();
-        $messageManager->expects($this->any())
-            ->method('addError')
-            ->with($phrase);
-
-        $notification = $objectManager->getObject(
-            'Magento\Braintree\Controller\Creditcard\DeleteConfirm',
-            [
-                'request' => $this->request,
-                'resultRedirectFactory' => $this->resultRedirectFactory,
-                'vault' => $this->vault,
-                'messageManager' => $messageManager,
-            ]
-        );
-
-        $this->assertSame($this->resultRedirect, $notification->execute());
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Controller/Creditcard/DeleteTest.php b/app/code/Magento/Braintree/Test/Unit/Controller/Creditcard/DeleteTest.php
deleted file mode 100644
index 504c186ad11773a7e3b7739ac95d9946e4151b74..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Controller/Creditcard/DeleteTest.php
+++ /dev/null
@@ -1,241 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Controller\Creditcard;
-
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
-use Magento\Framework\Exception\LocalizedException;
-
-class DeleteTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Framework\App\Request\Http
-     */
-    private $request;
-
-    /**
-     * @var \Magento\Framework\View\Result\PageFactory
-     */
-    private $resultPageFactory;
-
-    /**
-     * @var \Magento\Framework\View\Result\Page
-     */
-    private $resultPage;
-
-    /**
-     * @var  \Magento\Framework\Controller\Result\RedirectFactory
-     */
-    private $resultRedirectFactory;
-
-    /**
-     * @var  \Magento\Framework\Controller\Result\Redirect
-     */
-    private $resultRedirect;
-
-    /**
-     * @var \Magento\Framework\View\Element\AbstractBlock
-     */
-    private $block;
-
-    /**
-     * @var \Magento\Framework\View\Page\Config
-     */
-    private $pageConfig;
-
-    /**
-     * @var \Magento\Framework\View\Layout
-     */
-    private $pageLayout;
-
-    /**
-     * @var \Magento\Braintree\Model\Vault
-     */
-    private $vault;
-
-    /**
-     * test setup
-     */
-    public function setUp()
-    {
-        $this->request = $this->getMockBuilder('\Magento\Framework\App\Request\Http')
-            ->disableOriginalConstructor()
-            ->setMethods(['getParam'])
-            ->getMock();
-
-        $this->pageConfig = $this->getMockBuilder('\Magento\Framework\View\Page\Config')
-            ->disableOriginalConstructor()
-            ->setMethods(['set', 'getTitle'])
-            ->getMock();
-
-        $this->vault = $this->getMockBuilder('\Magento\Braintree\Model\Vault')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->resultRedirectFactory = $this->getMockBuilder('\Magento\Framework\Controller\Result\RedirectFactory')
-            ->disableOriginalConstructor()
-            ->setMethods(['create'])
-            ->getMock();
-
-        $this->resultRedirect = $this->getMockBuilder('\Magento\Framework\Controller\Result\Redirect')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->resultPageFactory = $this->getMockBuilder('\Magento\Framework\View\Result\PageFactory')
-            ->disableOriginalConstructor()
-            ->setMethods(['create'])
-            ->getMock();
-
-        $this->resultPage = $this->getMockBuilder('\Magento\Framework\View\Result\Page')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-
-        $this->block = $this->getMockBuilder('\Magento\Framework\View\Element\AbstractBlock')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->pageLayout = $this->getMockBuilder('\Magento\Framework\View\Layout')
-            ->disableOriginalConstructor()
-            ->getMock();
-    }
-
-    /**
-     * Executes the controller action and asserts non exception logic
-     */
-    public function testExecute()
-    {
-        $objectManager = new ObjectManagerHelper($this);
-
-        $this->vault->expects($this->once())
-            ->method('storedCard')
-            ->willReturn(true);
-
-        $this->request->expects($this->any())
-            ->method('getParam')
-            ->willReturn('token');
-
-
-        $this->resultRedirectFactory->expects($this->never())
-            ->method('create')
-            ->willReturn($this->resultRedirect);
-        $this->resultPageFactory->expects($this->once())
-            ->method('create')
-            ->willReturn($this->resultPage);
-        $this->resultPage->expects($this->any())
-            ->method('getLayout')
-            ->willReturn($this->pageLayout);
-        $this->pageLayout->expects($this->any())
-            ->method('getBlock')
-            ->willReturn($this->block);
-        $this->pageConfig->expects($this->once())
-            ->method('getTitle')
-            ->willReturnSelf();
-        $this->resultPage->expects($this->any())
-            ->method('getConfig')
-            ->willReturn($this->pageConfig);
-
-
-        $notification = $objectManager->getObject(
-            'Magento\Braintree\Controller\Creditcard\Delete',
-            [
-                'request' => $this->request,
-                'resultPageFactory' => $this->resultPageFactory,
-                'vault' => $this->vault,
-            ]
-        );
-
-        $this->assertSame($this->resultPage, $notification->execute());
-    }
-
-    /**
-     * Executes the controller action and asserts with redirect for non valid token param
-     */
-    public function testExecuteNoTokenRedirect()
-    {
-        $objectManager = new ObjectManagerHelper($this);
-
-        $this->vault->expects($this->never())
-            ->method('storedCard');
-
-        $this->request->expects($this->any())
-            ->method('getParam')
-            ->willReturn(null);
-
-        $this->resultRedirectFactory->expects($this->once())
-            ->method('create')
-            ->willReturn($this->resultRedirect);
-        $this->resultPageFactory->expects($this->never())
-            ->method('create')
-            ->willReturn($this->resultPage);
-
-        $this->resultRedirect->expects($this->once())
-            ->method('setPath')
-            ->willReturnSelf();
-
-        $notification = $objectManager->getObject(
-            'Magento\Braintree\Controller\Creditcard\Delete',
-            [
-                'request' => $this->request,
-                'resultPageFactory' => $this->resultPageFactory,
-                'resultRedirectFactory' => $this->resultRedirectFactory,
-                'vault' => $this->vault,
-            ]
-        );
-
-        $this->assertSame($this->resultRedirect, $notification->execute());
-    }
-
-    /**
-     * Executes the controller action and asserts with redirects for non existing logic
-     */
-    public function testExecuteNonExistingTokenRedirect()
-    {
-        $objectManager = new ObjectManagerHelper($this);
-        $phrase = new \Magento\Framework\Phrase('Credit card does not exist');
-        $this->vault->expects($this->once())
-            ->method('storedCard')
-            ->willReturn(false);
-
-        $this->request->expects($this->any())
-            ->method('getParam')
-            ->willReturn('token');
-
-        $this->resultRedirectFactory->expects($this->once())
-            ->method('create')
-            ->willReturn($this->resultRedirect);
-        $this->resultPageFactory->expects($this->never())
-            ->method('create')
-            ->willReturn($this->resultPage);
-
-        $this->resultRedirect->expects($this->once())
-            ->method('setPath')
-            ->willReturnSelf();
-
-        /**
-         * @var \Magento\Framework\Message\ManagerInterface $messageManager
-         */
-        $messageManager= $this->getMockBuilder('\Magento\Framework\Message\ManagerInterface')
-            ->getMock();
-        $messageManager->expects($this->once())
-            ->method('addError')
-            ->with($phrase);
-
-
-        $notification = $objectManager->getObject(
-            'Magento\Braintree\Controller\Creditcard\Delete',
-            [
-                'request' => $this->request,
-                'resultPageFactory' => $this->resultPageFactory,
-                'resultRedirectFactory' => $this->resultRedirectFactory,
-                'vault' => $this->vault,
-                'messageManager' => $messageManager,
-            ]
-        );
-
-        $this->assertSame($this->resultRedirect, $notification->execute());
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Controller/Creditcard/EditTest.php b/app/code/Magento/Braintree/Test/Unit/Controller/Creditcard/EditTest.php
deleted file mode 100644
index cd14d7181346d491c424dde2e5f2301965cc8c98..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Controller/Creditcard/EditTest.php
+++ /dev/null
@@ -1,241 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Controller\Creditcard;
-
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
-use Magento\Framework\Exception\LocalizedException;
-
-class EditTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Framework\App\Request\Http
-     */
-    private $request;
-
-    /**
-     * @var \Magento\Framework\View\Result\PageFactory
-     */
-    private $resultPageFactory;
-
-    /**
-     * @var \Magento\Framework\View\Result\Page
-     */
-    private $resultPage;
-
-    /**
-     * @var  \Magento\Framework\Controller\Result\RedirectFactory
-     */
-    private $resultRedirectFactory;
-
-    /**
-     * @var  \Magento\Framework\Controller\Result\Redirect
-     */
-    private $resultRedirect;
-
-    /**
-     * @var \Magento\Framework\View\Element\AbstractBlock
-     */
-    private $block;
-
-    /**
-     * @var \Magento\Framework\View\Page\Config
-     */
-    private $pageConfig;
-
-    /**
-     * @var \Magento\Framework\View\Layout
-     */
-    private $pageLayout;
-
-    /**
-     * @var \Magento\Braintree\Model\Vault
-     */
-    private $vault;
-
-    /**
-     * test setup
-     */
-    public function setUp()
-    {
-        $this->request = $this->getMockBuilder('\Magento\Framework\App\Request\Http')
-            ->disableOriginalConstructor()
-            ->setMethods(['getParam'])
-            ->getMock();
-
-        $this->pageConfig = $this->getMockBuilder('\Magento\Framework\View\Page\Config')
-            ->disableOriginalConstructor()
-            ->setMethods(['set', 'getTitle'])
-            ->getMock();
-
-        $this->vault = $this->getMockBuilder('\Magento\Braintree\Model\Vault')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->resultRedirectFactory = $this->getMockBuilder('\Magento\Framework\Controller\Result\RedirectFactory')
-            ->disableOriginalConstructor()
-            ->setMethods(['create'])
-            ->getMock();
-
-        $this->resultRedirect = $this->getMockBuilder('\Magento\Framework\Controller\Result\Redirect')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->resultPageFactory = $this->getMockBuilder('\Magento\Framework\View\Result\PageFactory')
-            ->disableOriginalConstructor()
-            ->setMethods(['create'])
-            ->getMock();
-
-        $this->resultPage = $this->getMockBuilder('\Magento\Framework\View\Result\Page')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-
-        $this->block = $this->getMockBuilder('\Magento\Framework\View\Element\AbstractBlock')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->pageLayout = $this->getMockBuilder('\Magento\Framework\View\Layout')
-            ->disableOriginalConstructor()
-            ->getMock();
-    }
-
-    /**
-     * Executes the controller action and asserts non exception logic
-     */
-    public function testExecute()
-    {
-        $objectManager = new ObjectManagerHelper($this);
-
-        $this->vault->expects($this->once())
-            ->method('storedCard')
-            ->willReturn(true);
-
-        $this->request->expects($this->any())
-            ->method('getParam')
-            ->willReturn('token');
-
-
-        $this->resultRedirectFactory->expects($this->never())
-            ->method('create')
-            ->willReturn($this->resultRedirect);
-        $this->resultPageFactory->expects($this->once())
-            ->method('create')
-            ->willReturn($this->resultPage);
-        $this->resultPage->expects($this->any())
-            ->method('getLayout')
-            ->willReturn($this->pageLayout);
-        $this->pageLayout->expects($this->any())
-            ->method('getBlock')
-            ->willReturn($this->block);
-        $this->pageConfig->expects($this->once())
-            ->method('getTitle')
-            ->willReturnSelf();
-        $this->resultPage->expects($this->any())
-            ->method('getConfig')
-            ->willReturn($this->pageConfig);
-
-
-        $notification = $objectManager->getObject(
-            'Magento\Braintree\Controller\Creditcard\Edit',
-            [
-                'request' => $this->request,
-                'resultPageFactory' => $this->resultPageFactory,
-                'vault' => $this->vault,
-            ]
-        );
-
-        $this->assertSame($this->resultPage, $notification->execute());
-    }
-
-    /**
-     * Executes the controller action and asserts with redirect for non valid token param
-     */
-    public function testExecuteNoTokenRedirect()
-    {
-        $objectManager = new ObjectManagerHelper($this);
-
-        $this->vault->expects($this->never())
-            ->method('storedCard');
-
-        $this->request->expects($this->any())
-            ->method('getParam')
-            ->willReturn(null);
-
-        $this->resultRedirectFactory->expects($this->once())
-            ->method('create')
-            ->willReturn($this->resultRedirect);
-        $this->resultPageFactory->expects($this->never())
-            ->method('create')
-            ->willReturn($this->resultPage);
-
-        $this->resultRedirect->expects($this->once())
-            ->method('setPath')
-            ->willReturnSelf();
-
-        $notification = $objectManager->getObject(
-            'Magento\Braintree\Controller\Creditcard\Edit',
-            [
-                'request' => $this->request,
-                'resultPageFactory' => $this->resultPageFactory,
-                'resultRedirectFactory' => $this->resultRedirectFactory,
-                'vault' => $this->vault,
-            ]
-        );
-
-        $this->assertSame($this->resultRedirect, $notification->execute());
-    }
-
-    /**
-     * Executes the controller action and asserts with redirects for non existing logic
-     */
-    public function testExecuteNonExistingTokenRedirect()
-    {
-        $objectManager = new ObjectManagerHelper($this);
-        $phrase = new \Magento\Framework\Phrase('Credit card does not exist');
-        $this->vault->expects($this->once())
-            ->method('storedCard')
-            ->willReturn(false);
-
-        $this->request->expects($this->any())
-            ->method('getParam')
-            ->willReturn('token');
-
-        $this->resultRedirectFactory->expects($this->once())
-            ->method('create')
-            ->willReturn($this->resultRedirect);
-        $this->resultPageFactory->expects($this->never())
-            ->method('create')
-            ->willReturn($this->resultPage);
-
-        $this->resultRedirect->expects($this->once())
-            ->method('setPath')
-            ->willReturnSelf();
-
-        /**
-         * @var \Magento\Framework\Message\ManagerInterface $messageManager
-         */
-        $messageManager= $this->getMockBuilder('\Magento\Framework\Message\ManagerInterface')
-            ->getMock();
-        $messageManager->expects($this->once())
-            ->method('addError')
-            ->with($phrase);
-
-
-        $notification = $objectManager->getObject(
-            'Magento\Braintree\Controller\Creditcard\Edit',
-            [
-                'request' => $this->request,
-                'resultPageFactory' => $this->resultPageFactory,
-                'resultRedirectFactory' => $this->resultRedirectFactory,
-                'vault' => $this->vault,
-                'messageManager' => $messageManager,
-            ]
-        );
-
-        $this->assertSame($this->resultRedirect, $notification->execute());
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Controller/Creditcard/GenerateTest.php b/app/code/Magento/Braintree/Test/Unit/Controller/Creditcard/GenerateTest.php
deleted file mode 100644
index 40540bb9da8c0dafe14ffbbf70bf209aff6cfc7c..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Controller/Creditcard/GenerateTest.php
+++ /dev/null
@@ -1,141 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Controller\Creditcard;
-
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
-use Magento\Framework\Exception\LocalizedException;
-
-/**
- * Test for Generate
- */
-class GenerateTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Framework\App\Request\Http
-     */
-    private $request;
-
-    /**
-     * @var \Magento\Framework\App\Response\Http
-     */
-    private $resultFactory;
-
-    /**
-     * @var \Magento\Braintree\Model\Vault
-     */
-    private $vault;
-
-    /**
-     * @var \Magento\Framework\Controller\Result\Json
-     */
-    private $resultJson;
-
-    /**
-     * @var \Magento\Framework\Message\ManagerInterface
-     */
-    private $messageManager;
-
-
-    /**
-     * test setup
-     */
-    public function setUp()
-    {
-        $this->request = $this->getMockBuilder('\Magento\Framework\App\Request\Http')
-            ->disableOriginalConstructor()
-            ->setMethods(['getParam'])
-            ->getMock();
-
-        $this->resultFactory = $this->getMockBuilder('Magento\Framework\Controller\ResultFactory')
-            ->disableOriginalConstructor()
-            ->setMethods(['create'])
-            ->getMock();
-
-        $this->vault = $this->getMockBuilder('\Magento\Braintree\Model\Vault')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->resultJson= $this->getMockBuilder('Magento\Framework\Controller\Result\Json')
-            ->disableOriginalConstructor()
-            ->setMethods(['setData'])
-            ->getMock();
-
-        $this->messageManager= $this->getMockBuilder('\Magento\Framework\Message\ManagerInterface')
-            ->getMock();
-
-    }
-
-    /**
-     * Executes the controller action and asserts non exception logic
-     */
-    public function testExecute()
-    {
-        $objectManager = new ObjectManager($this);
-        $this->resultJson->expects($this->once())
-            ->method('setData')
-            ->with(['success' => true, 'nonce' => '', 'error_message' => '']);
-
-        $this->resultFactory->expects($this->once())
-            ->method('create')
-            ->willReturn($this->resultJson);
-
-        $this->request->expects($this->any())
-            ->method('getParam')
-            ->willReturn(true);
-
-        $notification = $objectManager->getObject(
-            'Magento\Braintree\Controller\Creditcard\Generate',
-            [
-                'request' => $this->request,
-                'resultFactory' => $this->resultFactory,
-                'messageManager' => $this->messageManager,
-            ]
-        );
-
-        $this->assertSame($this->resultJson, $notification->execute());
-    }
-
-    /**
-     * Executes the controller action and asserts non exception logic
-     */
-    public function testExecuteLocalizedException()
-    {
-        $phrase = new \Magento\Framework\Phrase('Something went wrong while processing.');
-        $objectManager = new ObjectManager($this);
-        $this->vault->expects($this->once())
-            ->method('generatePaymentMethodToken')
-            ->willThrowException(new LocalizedException($phrase));
-
-        $this->resultJson->expects($this->once())
-            ->method('setData')
-            ->with(['success' => false, 'error_message' => 'Something went wrong while processing.']);
-
-        $this->resultFactory->expects($this->once())
-            ->method('create')
-            ->willReturn($this->resultJson);
-
-        $this->messageManager->expects($this->once())
-            ->method('addError')
-            ->with($phrase);
-
-        $this->request->expects($this->any())
-            ->method('getParam')
-            ->willReturn(true);
-
-        $notification = $objectManager->getObject(
-            'Magento\Braintree\Controller\Creditcard\Generate',
-            [
-                'request' => $this->request,
-                'resultFactory' => $this->resultFactory,
-                'vault' => $this->vault,
-                'messageManager' => $this->messageManager,
-            ]
-        );
-
-        $this->assertSame($this->resultJson, $notification->execute());
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Controller/Creditcard/IndexTest.php b/app/code/Magento/Braintree/Test/Unit/Controller/Creditcard/IndexTest.php
deleted file mode 100644
index 7f8e3861a48dee3ba83c8f0e19136950781c0c24..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Controller/Creditcard/IndexTest.php
+++ /dev/null
@@ -1,102 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Controller\Creditcard;
-
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
-use Magento\Framework\Exception\LocalizedException;
-
-class IndexTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Framework\View\Result\PageFactory
-     */
-    private $resultPageFactory;
-
-    /**
-     * @var \Magento\Framework\View\Result\Page
-     */
-    private $resultPage;
-
-    /**
-     * @var \Magento\Framework\View\Element\AbstractBlock
-     */
-    private $block;
-
-    /**
-     * @var \Magento\Framework\View\Page\Config
-     */
-    private $pageConfig;
-
-    /**
-     * @var \Magento\Framework\View\Layout
-     */
-    private $pageLayout;
-
-
-    /**
-     * test setup
-     */
-    public function setUp()
-    {
-        $this->pageConfig = $this->getMockBuilder('\Magento\Framework\View\Page\Config')
-            ->disableOriginalConstructor()
-            ->setMethods(['set', 'getTitle'])
-            ->getMock();
-
-        $this->resultPageFactory = $this->getMockBuilder('\Magento\Framework\View\Result\PageFactory')
-            ->disableOriginalConstructor()
-            ->setMethods(['create'])
-            ->getMock();
-
-        $this->resultPage = $this->getMockBuilder('\Magento\Framework\View\Result\Page')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-
-        $this->block = $this->getMockBuilder('\Magento\Framework\View\Element\AbstractBlock')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->pageLayout = $this->getMockBuilder('\Magento\Framework\View\Layout')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->resultPageFactory->expects($this->once())
-        ->method('create')
-        ->willReturn($this->resultPage);
-        $this->resultPage->expects($this->any())
-            ->method('getLayout')
-            ->willReturn($this->pageLayout);
-        $this->pageLayout->expects($this->any())
-            ->method('getBlock')
-            ->willReturn($this->block);
-
-        $this->pageConfig->expects($this->once())
-            ->method('getTitle')
-            ->willReturnSelf();
-        $this->resultPage->expects($this->any())
-            ->method('getConfig')
-            ->willReturn($this->pageConfig);
-    }
-
-    /**
-     * Executes the controller action and asserts non exception logic
-     */
-    public function testExecute()
-    {
-        $objectManager = new ObjectManagerHelper($this);
-
-        $notification = $objectManager->getObject(
-            'Magento\Braintree\Controller\Creditcard\Index',
-            [
-                'resultPageFactory' => $this->resultPageFactory,
-            ]
-        );
-
-        $this->assertSame($this->resultPage, $notification->execute());
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Controller/Creditcard/NewCardTest.php b/app/code/Magento/Braintree/Test/Unit/Controller/Creditcard/NewCardTest.php
deleted file mode 100644
index ee655fe49b0834a6d249bad099a50c819ef8329d..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Controller/Creditcard/NewCardTest.php
+++ /dev/null
@@ -1,116 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Controller\Creditcard;
-
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
-use Magento\Framework\Exception\LocalizedException;
-
-class NewCardTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Framework\View\Result\PageFactory
-     */
-    private $resultPageFactory;
-
-    /**
-     * @var \Magento\Framework\View\Result\Page
-     */
-    private $resultPage;
-
-    /**
-     * @var \Magento\Framework\View\Element\AbstractBlock
-     */
-    private $block;
-
-    /**
-     * @var \Magento\Framework\View\Page\Config
-     */
-    private $pageConfig;
-
-    /**
-     * @var \Magento\Framework\View\Layout
-     */
-    private $pageLayout;
-
-    /**
-     * @var \Magento\Customer\Model\Session
-     */
-    private $customerSession;
-
-    /**
-     * test setup
-     */
-    public function setUp()
-    {
-        $this->customerSession = $this->getMockBuilder('\Magento\Customer\Model\Session')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->pageConfig = $this->getMockBuilder('\Magento\Framework\View\Page\Config')
-            ->disableOriginalConstructor()
-            ->setMethods(['set', 'getTitle'])
-            ->getMock();
-
-        $this->resultPageFactory = $this->getMockBuilder('\Magento\Framework\View\Result\PageFactory')
-            ->disableOriginalConstructor()
-            ->setMethods(['create'])
-            ->getMock();
-
-        $this->resultPage = $this->getMockBuilder('\Magento\Framework\View\Result\Page')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-
-        $this->block = $this->getMockBuilder('\Magento\Framework\View\Element\AbstractBlock')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->pageLayout = $this->getMockBuilder('\Magento\Framework\View\Layout')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->resultPageFactory->expects($this->once())
-            ->method('create')
-            ->willReturn($this->resultPage);
-        $this->resultPage->expects($this->any())
-            ->method('getLayout')
-            ->willReturn($this->pageLayout);
-        $this->pageLayout->expects($this->any())
-            ->method('getBlock')
-            ->willReturn($this->block);
-
-        $this->pageConfig->expects($this->once())
-            ->method('getTitle')
-            ->willReturnSelf();
-        $this->resultPage->expects($this->any())
-            ->method('getConfig')
-            ->willReturn($this->pageConfig);
-    }
-
-    /**
-     * Executes the controller action and asserts non exception logic
-     */
-    public function testExecute()
-    {
-        $objectManager = new ObjectManagerHelper($this);
-        $customerId = 1;
-
-        $this->customerSession->expects($this->any())
-            ->method('getCustomerId')
-            ->willReturn($customerId);
-
-        $notification = $objectManager->getObject(
-            'Magento\Braintree\Controller\Creditcard\NewCard',
-            [
-                'resultPageFactory' => $this->resultPageFactory,
-                'customerSession' => $this->customerSession
-            ]
-        );
-
-        $this->assertSame($this->resultPage, $notification->execute());
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Controller/Creditcard/SaveTest.php b/app/code/Magento/Braintree/Test/Unit/Controller/Creditcard/SaveTest.php
deleted file mode 100644
index ff42e7e7c6e0e98ad4e6a2d0c2b25c4eae8b2469..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Controller/Creditcard/SaveTest.php
+++ /dev/null
@@ -1,98 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Controller\Creditcard;
-
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
-use Magento\Framework\Exception\LocalizedException;
-
-class SaveTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Framework\App\Request\Http
-     */
-    private $request;
-
-    /**
-     * @var  \Magento\Framework\Controller\Result\RedirectFactory
-     */
-    private $resultRedirectFactory;
-
-    /**
-     * @var  \Magento\Framework\Controller\Result\Redirect
-     */
-    private $resultRedirect;
-
-
-    /**
-     * test setup
-     */
-    public function setUp()
-    {
-        $this->request = $this->getMockBuilder('\Magento\Framework\App\Request\Http')
-            ->disableOriginalConstructor()
-            ->setMethods(['getParam'])
-            ->getMock();
-
-        $this->resultRedirectFactory = $this->getMockBuilder('\Magento\Framework\Controller\Result\RedirectFactory')
-            ->disableOriginalConstructor()
-            ->setMethods(['create'])
-            ->getMock();
-
-        $this->resultRedirect = $this->getMockBuilder('\Magento\Framework\Controller\Result\Redirect')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->resultRedirectFactory->expects($this->once())
-            ->method('create')
-            ->willReturn($this->resultRedirect);
-
-        $this->resultRedirect->expects($this->once())
-            ->method('setPath')
-            ->willReturnSelf();
-    }
-
-    /**
-     * Executes the controller action
-     */
-    public function testExecute()
-    {
-        $objectManager = new ObjectManagerHelper($this);
-        $phrase = new \Magento\Framework\Phrase('There was error during saving card data');
-
-        $this->request->expects($this->any())
-            ->method('getParam')
-            ->willReturn('token');
-
-        $this->resultRedirectFactory->expects($this->once())
-            ->method('create')
-            ->willReturn($this->resultRedirect);
-
-        $this->resultRedirect->expects($this->once())
-            ->method('setPath')
-            ->willReturnSelf();
-
-        /**
-         * @var \Magento\Framework\Message\ManagerInterface $messageManager
-         */
-        $messageManager= $this->getMockBuilder('\Magento\Framework\Message\ManagerInterface')
-            ->getMock();
-        $messageManager->expects($this->once())
-            ->method('addError')
-            ->with($phrase);
-
-        $notification = $objectManager->getObject(
-            'Magento\Braintree\Controller\Creditcard\Save',
-            [
-                'request' => $this->request,
-                'resultRedirectFactory' => $this->resultRedirectFactory,
-                'messageManager' => $messageManager,
-            ]
-        );
-
-        $this->assertSame($this->resultRedirect, $notification->execute());
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Controller/MyCreditCardsTest.php b/app/code/Magento/Braintree/Test/Unit/Controller/MyCreditCardsTest.php
deleted file mode 100644
index 39f70eb0ce2ae317a337397b6c045731d7be8402..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Controller/MyCreditCardsTest.php
+++ /dev/null
@@ -1,172 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Controller;
-
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
-use Magento\Framework\Exception\LocalizedException;
-
-class MyCreditCardsTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Customer\Model\Session
-     */
-    protected $customerSession;
-
-    /**
-     * @var  \Magento\Framework\Controller\Result\RedirectFactory
-     */
-    private $resultRedirectFactory;
-
-    /**
-     * @var  \Magento\Framework\Controller\Result\Redirect
-     */
-    private $resultRedirect;
-
-    /**
-     * @var \Magento\Customer\Model\Url
-     */
-    protected $customerUrl;
-
-    /**
-     * @var \Magento\Framework\App\ActionFlag
-     */
-    protected $actionFlag;
-
-    /**
-     * @var \Magento\Braintree\Model\Config\Cc
-     */
-    protected $config;
-
-    /**
-     * @var \Magento\Framework\App\ResponseInterface
-     */
-    protected $_response;
-
-
-    /**
-     * test setup
-     */
-    public function setUp()
-    {
-        $this->customerSession = $this->getMockBuilder('\Magento\Customer\Model\Session')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->_response = $this->getMockBuilder('\Magento\Framework\App\ResponseInterface')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->config = $this->getMockBuilder('\Magento\Braintree\Model\Config\Cc')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->resultRedirectFactory = $this->getMockBuilder('\Magento\Framework\Controller\Result\RedirectFactory')
-            ->disableOriginalConstructor()
-            ->setMethods(['create'])
-            ->getMock();
-
-        $this->resultRedirect = $this->getMockBuilder('\Magento\Framework\Controller\Result\Redirect')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->customerUrl = $this->getMockBuilder('\Magento\Customer\Model\Url')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->actionFlag = $this->getMockBuilder('\Magento\Framework\App\ActionFlag')
-            ->disableOriginalConstructor()
-            ->setMethods(['set'])
-            ->getMock();
-
-
-    }
-
-    /**
-     * Executes the dispatch override
-     */
-    public function testDispatchNoVault()
-    {
-        $objectManager = new ObjectManagerHelper($this);
-
-        $this->resultRedirectFactory->expects($this->once())
-            ->method('create')
-            ->willReturn($this->resultRedirect);
-
-        $this->resultRedirect->expects($this->once())
-            ->method('setPath')
-            ->willReturnSelf();
-
-        $this->customerSession->expects($this->once())
-            ->method('authenticate')
-            ->willReturn(true);
-
-        $this->config->expects($this->once())
-            ->method('useVault')
-            ->willReturn(false);
-        /**
-         * @var \Magento\Framework\App\RequestInterface $requestInterface
-         */
-        $requestInterface= $this->getMockBuilder('\Magento\Framework\App\RequestInterface')
-            ->getMock();
-
-        $notification = $objectManager->getObject(
-            'Magento\Braintree\Test\Unit\Controller\Stub\MyCreditCardsStub',
-            [
-                'customerSession' => $this->customerSession,
-                'resultRedirectFactory' => $this->resultRedirectFactory,
-                'config' => $this->config,
-                'customerUrl' => $this->customerUrl,
-            ]
-        );
-
-        $this->assertSame($this->resultRedirect, $notification->dispatch($requestInterface));
-    }
-
-    /**
-     * Executes the dispatch override
-     */
-    public function testDispatchNotLoggedIn()
-    {
-        $objectManager = new ObjectManagerHelper($this);
-
-        $this->resultRedirectFactory->expects($this->any())
-            ->method('create')
-            ->willReturn($this->resultRedirect);
-
-        $this->resultRedirect->expects($this->any())
-            ->method('setPath')
-            ->willReturnSelf();
-
-        $this->customerSession->expects($this->any())
-            ->method('authenticate')
-            ->willReturn(false);
-
-        $this->config->expects($this->any())
-            ->method('useVault')
-            ->willReturn(true);
-        /**
-         * @var \Magento\Framework\App\RequestInterface $requestInterface
-         */
-        $requestInterface= $this->getMockBuilder('\Magento\Framework\App\Request\Http')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-
-        $notification = $objectManager->getObject(
-            'Magento\Braintree\Test\Unit\Controller\Stub\MyCreditCardsStub',
-            [
-                'customerSession' => $this->customerSession,
-                'resultRedirectFactory' => $this->resultRedirectFactory,
-                'config' => $this->config,
-                'customerUrl' => $this->customerUrl,
-                'response' => $this->_response,
-            ]
-        );
-
-        $this->assertSame($this->_response, $notification->dispatch($requestInterface));
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Controller/PayPal/PlaceOrderTest.php b/app/code/Magento/Braintree/Test/Unit/Controller/PayPal/PlaceOrderTest.php
deleted file mode 100644
index e27de2bedd42cc30865b3db67b6b44f9a7c1dbcc..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Controller/PayPal/PlaceOrderTest.php
+++ /dev/null
@@ -1,239 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Controller\PayPal;
-
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
-
-class PlaceOrderTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Braintree\Model\CheckoutFactory|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $checkoutFactoryMock;
-
-    /**
-     * @var \Magento\Checkout\Model\Session|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $checkoutSessionMock;
-
-    /**
-     * @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $requestMock;
-
-    /**
-     * @var \Magento\Framework\Controller\ResultFactory|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $resultFactoryMock;
-
-    /**
-     * @var \Magento\Braintree\Model\Checkout|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $checkoutMock;
-
-    /**
-     * @var \Magento\Framework\Message\ManagerInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $messageManager;
-
-    /**
-     * @var ObjectManagerHelper
-     */
-    protected $objectManagerHelper;
-
-    /**
-     * @var \Magento\Braintree\Controller\PayPal\PlaceOrder
-     */
-    protected $controller;
-
-    /**
-     * @var \Magento\Checkout\Api\AgreementsValidatorInterface |\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $validatorMock;
-
-    /**
-     * test setup
-     */
-    public function setUp()
-    {
-        $this->checkoutSessionMock = $this->getMockBuilder('\Magento\Checkout\Model\Session')
-            ->disableOriginalConstructor()
-            ->setMethods(
-                [
-                    'clearHelperData',
-                    'getQuote',
-                    'setLastQuoteId',
-                    'setLastSuccessQuoteId',
-                    'setLastOrderId',
-                    'setLastRealOrderId',
-                ]
-            )
-            ->getMock();
-
-        $this->checkoutFactoryMock = $this->getMockBuilder('\Magento\Braintree\Model\CheckoutFactory')
-            ->disableOriginalConstructor()
-            ->setMethods(['create'])
-            ->getMock();
-
-        $this->messageManager = $this->getMock('\Magento\Framework\Message\ManagerInterface');
-
-        $this->checkoutMock = $this->getMockBuilder('\Magento\Braintree\Model\Checkout')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->requestMock = $this->getMock('\Magento\Framework\App\Request\Http', [], [], '', '', false);
-
-        $this->resultFactoryMock = $this->getMockBuilder('\Magento\Framework\Controller\ResultFactory')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $contextMock = $this->getMockBuilder('\Magento\Framework\App\Action\Context')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $contextMock->expects($this->any())
-            ->method('getResultFactory')
-            ->willReturn($this->resultFactoryMock);
-        $contextMock->expects($this->any())
-            ->method('getRequest')
-            ->willReturn($this->requestMock);
-        $contextMock->expects($this->any())
-            ->method('getMessageManager')
-            ->willReturn($this->messageManager);
-        $this->objectManagerHelper = new ObjectManagerHelper($this);
-        $this->validatorMock = $this->getMock('Magento\Checkout\Api\AgreementsValidatorInterface');
-        $this->controller = $this->objectManagerHelper->getObject(
-            '\Magento\Braintree\Controller\PayPal\PlaceOrder',
-            [
-                'context' => $contextMock,
-                'checkoutSession' => $this->checkoutSessionMock,
-                'checkoutFactory' => $this->checkoutFactoryMock,
-                'agreementsValidator' => $this->validatorMock
-            ]
-        );
-    }
-
-    protected function setupCart()
-    {
-        $quoteMock = $this->getMockBuilder('\Magento\Quote\Model\Quote')
-            ->disableOriginalConstructor()
-            ->setMethods(['hasItems', 'getHasError', 'getPayment', 'getId'])
-            ->getMock();
-        $quoteMock->expects($this->any())
-            ->method('hasItems')
-            ->willReturn(true);
-        $quoteMock->expects($this->any())
-            ->method('getHasError')
-            ->willReturn(false);
-
-        $this->checkoutSessionMock->expects($this->any())
-            ->method('getQuote')
-            ->willReturn($quoteMock);
-
-        $this->checkoutFactoryMock->expects($this->any())
-            ->method('create')
-            ->willReturn($this->checkoutMock);
-
-        $this->requestMock->expects($this->any())->method('getPost')->willReturn([]);
-        return $quoteMock;
-    }
-
-    public function testExecute()
-    {
-        $quoteId = 123;
-        $orderId = 'orderId';
-        $orderIncrementId = 125;
-
-        $quoteMock = $this->setupCart();
-        $this->validatorMock->expects($this->once())->method('isValid')->willReturn(true);
-        $this->checkoutMock->expects($this->once())
-            ->method('place')
-            ->with(null);
-
-        $this->checkoutSessionMock->expects($this->once())
-            ->method('clearHelperData');
-
-        $quoteMock->expects($this->once())
-            ->method('getId')
-            ->willReturn($quoteId);
-
-        $this->checkoutSessionMock->expects($this->once())
-            ->method('setLastQuoteId')
-            ->with($quoteId)
-            ->willReturnSelf();
-        $this->checkoutSessionMock->expects($this->once())
-            ->method('setLastSuccessQuoteId')
-            ->with($quoteId)
-            ->willReturnSelf();
-
-        $orderMock = $this->getMockBuilder('\Magento\Sales\Model\Order')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $orderMock->expects($this->once())
-            ->method('getId')
-            ->willReturn($orderId);
-        $orderMock->expects($this->once())
-            ->method('getIncrementId')
-            ->willReturn($orderIncrementId);
-
-        $this->checkoutMock->expects($this->once())
-            ->method('getOrder')
-            ->willReturn($orderMock);
-
-        $this->checkoutSessionMock->expects($this->once())
-            ->method('setLastOrderId')
-            ->with($orderId)
-            ->willReturnSelf();
-        $this->checkoutSessionMock->expects($this->once())
-            ->method('setLastRealOrderId')
-            ->with($orderIncrementId)
-            ->willReturnSelf();
-
-        $resultRedirect = $this->getMockBuilder('\Magento\Framework\Controller\Result\Redirect')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $resultRedirect->expects($this->once())
-            ->method('setPath')
-            ->with('checkout/onepage/success')
-            ->willReturnSelf();
-        $this->resultFactoryMock->expects($this->once())
-            ->method('create')
-            ->with(\Magento\Framework\Controller\ResultFactory::TYPE_REDIRECT)
-            ->willReturn($resultRedirect);
-
-        $this->assertEquals($resultRedirect, $this->controller->execute());
-    }
-
-    public function testExecuteException()
-    {
-        $this->setupCart();
-        $this->validatorMock->expects($this->once())->method('isValid')->willReturn(true);
-        $exceptionMsg = new \Magento\Framework\Phrase('error');
-        $exception = new \Magento\Framework\Exception\LocalizedException($exceptionMsg);
-        $this->checkoutMock->expects($this->once())
-            ->method('place')
-            ->with(null)
-            ->willThrowException($exception);
-
-        $this->messageManager->expects($this->once())
-            ->method('addExceptionMessage')
-            ->with($exception, $exceptionMsg);
-
-        $resultRedirect = $this->getMockBuilder('\Magento\Framework\Controller\Result\Redirect')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $resultRedirect->expects($this->once())
-            ->method('setPath')
-            ->with('checkout/cart')
-            ->willReturnSelf();
-        $this->resultFactoryMock->expects($this->once())
-            ->method('create')
-            ->with(\Magento\Framework\Controller\ResultFactory::TYPE_REDIRECT)
-            ->willReturn($resultRedirect);
-
-        $this->assertEquals($resultRedirect, $this->controller->execute());
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Controller/PayPal/ReviewTest.php b/app/code/Magento/Braintree/Test/Unit/Controller/PayPal/ReviewTest.php
deleted file mode 100644
index bac4378b974a62f6be1313f2abce623867822ab6..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Controller/PayPal/ReviewTest.php
+++ /dev/null
@@ -1,452 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Controller\PayPal;
-
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
-
-/**
- * Class ReviewTest
- *
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
- */
-class ReviewTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Braintree\Model\CheckoutFactory|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $checkoutFactoryMock;
-
-    /**
-     * @var \Magento\Checkout\Model\Session|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $checkoutSessionMock;
-
-    /**
-     * @var \Magento\Framework\App\ActionFlag|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $actionFlagMock;
-
-    /**
-     * @var \Magento\Braintree\Model\Config\PayPal|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $braintreePayPalConfigMock;
-
-    /**
-     * @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $requestMock;
-
-    /**
-     * @var \Magento\Framework\Controller\ResultFactory|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $resultFactoryMock;
-
-    /**
-     * @var \Magento\Braintree\Model\Checkout|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $checkoutMock;
-
-    /**
-     * @var \Magento\Framework\Message\ManagerInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $messageManagerMock;
-
-    /**
-     * @var \Magento\Braintree\Model\PaymentMethod\PayPal|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $paymentMethodInstanceMock;
-
-    /**
-     * @var ObjectManagerHelper
-     */
-    protected $objectManagerHelper;
-
-    /**
-     * @var \Magento\Braintree\Controller\PayPal\Review
-     */
-    protected $controller;
-
-    /**
-     * test setup
-     */
-    public function setUp()
-    {
-        $this->checkoutSessionMock = $this->getMockBuilder('\Magento\Checkout\Model\Session')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->braintreePayPalConfigMock = $this->getMockBuilder('\Magento\Braintree\Model\Config\PayPal')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->checkoutFactoryMock = $this->getMockBuilder('\Magento\Braintree\Model\CheckoutFactory')
-            ->disableOriginalConstructor()
-            ->setMethods(['create'])
-            ->getMock();
-
-        $this->messageManagerMock = $this->getMock('\Magento\Framework\Message\ManagerInterface');
-
-        $jsonHelperMock = $this->getMockBuilder('\Magento\Framework\Json\Helper\Data')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $jsonHelperMock->expects($this->any())
-            ->method('jsonDecode')
-            ->willReturnCallback(function ($arg) {
-                return json_decode($arg, true);
-            });
-
-        $this->checkoutMock = $this->getMockBuilder('\Magento\Braintree\Model\Checkout')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->requestMock = $this->getMock('\Magento\Framework\App\RequestInterface');
-
-        $this->actionFlagMock = $this->getMockBuilder('\Magento\Framework\App\ActionFlag')
-            ->disableOriginalConstructor()
-            ->setMethods(['set'])
-            ->getMock();
-
-        $this->resultFactoryMock = $this->getMockBuilder('\Magento\Framework\Controller\ResultFactory')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->paymentMethodInstanceMock = $this->getMockBuilder('\Magento\Braintree\Model\PaymentMethod\PayPal')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $contextMock = $this->getMockBuilder('\Magento\Framework\App\Action\Context')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $contextMock->expects($this->any())
-            ->method('getResultFactory')
-            ->willReturn($this->resultFactoryMock);
-        $contextMock->expects($this->any())
-            ->method('getActionFlag')
-            ->willReturn($this->actionFlagMock);
-        $contextMock->expects($this->any())
-            ->method('getRequest')
-            ->willReturn($this->requestMock);
-        $contextMock->expects($this->any())
-            ->method('getMessageManager')
-            ->willReturn($this->messageManagerMock);
-
-        $this->objectManagerHelper = new ObjectManagerHelper($this);
-        $this->controller = $this->objectManagerHelper->getObject(
-            '\Magento\Braintree\Controller\PayPal\Review',
-            [
-                'context' => $contextMock,
-                'checkoutSession' => $this->checkoutSessionMock,
-                'braintreePayPalConfig' => $this->braintreePayPalConfigMock,
-                'checkoutFactory' => $this->checkoutFactoryMock,
-                'jsonHelper' => $jsonHelperMock,
-            ]
-        );
-    }
-
-    protected function setupCart($withPaymentMethodInstance = true)
-    {
-        $quoteMock = $this->getMockBuilder('\Magento\Quote\Model\Quote')
-            ->disableOriginalConstructor()
-            ->setMethods(['hasItems', 'getHasError', 'getPayment'])
-            ->getMock();
-        $quoteMock->expects($this->any())
-            ->method('hasItems')
-            ->willReturn(true);
-        $quoteMock->expects($this->any())
-            ->method('getHasError')
-            ->willReturn(false);
-
-        $this->checkoutSessionMock->expects($this->any())
-            ->method('getQuote')
-            ->willReturn($quoteMock);
-
-        $this->checkoutFactoryMock->expects($this->any())
-            ->method('create')
-            ->willReturn($this->checkoutMock);
-
-        if ($withPaymentMethodInstance) {
-            $paymentMock = $this->getMockBuilder('\Magento\Quote\Model\Quote\Payment')
-                ->disableOriginalConstructor()
-                ->setMethods(['getMethodInstance'])
-                ->getMock();
-
-            $paymentMock->expects($this->any())
-                ->method('getMethodInstance')
-                ->willReturn($this->paymentMethodInstanceMock);
-
-            $quoteMock->expects($this->any())
-                ->method('getPayment')
-                ->willReturn($paymentMock);
-        }
-
-        return $quoteMock;
-    }
-
-    protected function setupReviewPage($quote)
-    {
-        $shippingMethodBlockMock = $this->getMockBuilder('\Magento\Paypal\Block\Express\Review')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $reviewBlockMock = $this->getMockBuilder('\Magento\Braintree\Block\Checkout\Review')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $reviewBlockMock->expects($this->once())
-            ->method('setQuote')
-            ->with($quote);
-        $shippingMethodBlockMock->expects($this->once())
-            ->method('setQuote')
-            ->with($quote);
-        $reviewBlockMock->expects($this->once())
-            ->method('getChildBlock')
-            ->with('shipping_method')
-            ->willReturn($shippingMethodBlockMock);
-
-        $layoutMock = $this->getMockBuilder('\Magento\Framework\View\Layout')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $layoutMock->expects($this->once())
-            ->method('getBlock')
-            ->with('braintree.paypal.review')
-            ->willReturn($reviewBlockMock);
-        $resultPageMock = $this->getMockBuilder('\Magento\Framework\View\Result\Page')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $resultPageMock->expects($this->once())
-            ->method('getLayout')
-            ->willReturn($layoutMock);
-
-        $this->resultFactoryMock->expects($this->once())
-            ->method('create')
-            ->with(\Magento\Framework\Controller\ResultFactory::TYPE_PAGE)
-            ->willReturn($resultPageMock);
-        return $resultPageMock;
-    }
-
-    public function testExecute()
-    {
-        $paymentMethodNonce = 'nonce';
-        $email = 'abc@example.com';
-        $billingAddress = ['someAddress'];
-        $details = [
-            'email' => $email,
-            'billingAddress' => $billingAddress,
-        ];
-        $detailsEncoded = json_encode($details);
-
-        $this->requestMock->expects($this->at(0))
-            ->method('getParam')
-            ->with('payment_method_nonce')
-            ->willReturn($paymentMethodNonce);
-        $this->requestMock->expects($this->at(1))
-            ->method('getParam')
-            ->with('details')
-            ->willReturn($detailsEncoded);
-
-        $quoteMock = $this->setupCart();
-        $this->checkoutMock->expects($this->once())
-            ->method('initializeQuoteForReview')
-            ->with($paymentMethodNonce, ['email' => $email]);
-        $resultPageMock = $this->setupReviewPage($quoteMock);
-
-        $this->assertEquals($resultPageMock, $this->controller->execute());
-    }
-
-    public function testExecuteWithBillingAddress()
-    {
-        $paymentMethodNonce = 'nonce';
-        $email = 'abc@example.com';
-        $billingAddress = ['someAddress'];
-        $details = [
-            'email' => $email,
-            'billingAddress' => $billingAddress,
-        ];
-        $detailsEncoded = json_encode($details);
-
-        $this->braintreePayPalConfigMock->expects($this->once())
-            ->method('isBillingAddressEnabled')
-            ->willReturn(true);
-        $this->requestMock->expects($this->at(0))
-            ->method('getParam')
-            ->with('payment_method_nonce')
-            ->willReturn($paymentMethodNonce);
-        $this->requestMock->expects($this->at(1))
-            ->method('getParam')
-            ->with('details')
-            ->willReturn($detailsEncoded);
-
-        $quoteMock = $this->setupCart();
-        $this->checkoutMock->expects($this->once())
-            ->method('initializeQuoteForReview')
-            ->with($paymentMethodNonce, $details);
-        $resultPageMock = $this->setupReviewPage($quoteMock);
-
-        $this->assertEquals($resultPageMock, $this->controller->execute());
-    }
-
-    public function testExecuteRefresh()
-    {
-        $quoteMock = $this->setupCart();
-        $this->paymentMethodInstanceMock->expects($this->once())
-            ->method('getCode')
-            ->willReturn(\Magento\Braintree\Model\PaymentMethod\PayPal::METHOD_CODE);
-        $resultPageMock = $this->setupReviewPage($quoteMock);
-
-        $this->assertEquals($resultPageMock, $this->controller->execute());
-    }
-
-    public function testExecuteNoPayment()
-    {
-        $quoteMock = $this->setupCart(false);
-        $paymentMock = $this->getMockBuilder('\Magento\Quote\Model\Quote\Payment')
-            ->disableOriginalConstructor()
-            ->setMethods(['getMethodInstance'])
-            ->getMock();
-        $paymentMock->expects($this->once())
-            ->method('getMethodInstance')
-            ->willReturn(null);
-        $quoteMock->expects($this->once())
-            ->method('getPayment')
-            ->willReturn($paymentMock);
-
-        $this->messageManagerMock->expects($this->once())
-            ->method('addErrorMessage')
-            ->with(new \Magento\Framework\Phrase('Incorrect payment method.'));
-
-        $resultRedirect = $this->getMockBuilder('\Magento\Framework\Controller\Result\Redirect')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $resultRedirect->expects($this->once())
-            ->method('setPath')
-            ->with('checkout/cart')
-            ->willReturnSelf();
-        $this->resultFactoryMock->expects($this->once())
-            ->method('create')
-            ->with(\Magento\Framework\Controller\ResultFactory::TYPE_REDIRECT)
-            ->willReturn($resultRedirect);
-        $this->assertEquals($resultRedirect, $this->controller->execute());
-    }
-
-    public function testExecuteIncorrectPaymentMathod()
-    {
-        $this->setupCart();
-        $this->paymentMethodInstanceMock->expects($this->once())
-            ->method('getCode')
-            ->willReturn('incorrect_method');
-        $this->messageManagerMock->expects($this->once())
-            ->method('addErrorMessage')
-            ->with(new \Magento\Framework\Phrase('Incorrect payment method.'));
-
-        $resultRedirect = $this->getMockBuilder('\Magento\Framework\Controller\Result\Redirect')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $resultRedirect->expects($this->once())
-            ->method('setPath')
-            ->with('checkout/cart')
-            ->willReturnSelf();
-        $this->resultFactoryMock->expects($this->once())
-            ->method('create')
-            ->with(\Magento\Framework\Controller\ResultFactory::TYPE_REDIRECT)
-            ->willReturn($resultRedirect);
-        $this->assertEquals($resultRedirect, $this->controller->execute());
-    }
-
-    public function testExecuteValidationFailure()
-    {
-        $paymentMethodNonce = 'nonce';
-        $email = 'abc@example.com';
-        $billingAddress = ['someAddress'];
-        $details = [
-            'email' => $email,
-            'billingAddress' => $billingAddress,
-        ];
-        $detailsEncoded = json_encode($details);
-
-        $this->braintreePayPalConfigMock->expects($this->once())
-            ->method('isBillingAddressEnabled')
-            ->willReturn(true);
-        $this->requestMock->expects($this->at(0))
-            ->method('getParam')
-            ->with('payment_method_nonce')
-            ->willReturn($paymentMethodNonce);
-        $this->requestMock->expects($this->at(1))
-            ->method('getParam')
-            ->with('details')
-            ->willReturn($detailsEncoded);
-
-        $this->setupCart();
-        $errorMessage = new \Magento\Framework\Phrase('Selected payment type is not allowed for billing country.');
-        $exception = new \Magento\Framework\Exception\LocalizedException($errorMessage);
-
-        $this->paymentMethodInstanceMock->expects($this->once())
-            ->method('validate')
-            ->willThrowException($exception);
-        $this->messageManagerMock->expects($this->once())
-            ->method('addExceptionMessage')
-            ->with($exception, $errorMessage);
-
-        $resultRedirect = $this->getMockBuilder('\Magento\Framework\Controller\Result\Redirect')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $resultRedirect->expects($this->once())
-            ->method('setPath')
-            ->with('checkout/cart')
-            ->willReturnSelf();
-        $this->resultFactoryMock->expects($this->once())
-            ->method('create')
-            ->with(\Magento\Framework\Controller\ResultFactory::TYPE_REDIRECT)
-            ->willReturn($resultRedirect);
-        $this->assertEquals($resultRedirect, $this->controller->execute());
-    }
-
-    public function testExecuteException()
-    {
-        $paymentMethodNonce = 'nonce';
-        $email = 'abc@example.com';
-        $billingAddress = ['someAddress'];
-        $details = [
-            'email' => $email,
-            'billingAddress' => $billingAddress,
-        ];
-        $detailsEncoded = json_encode($details);
-
-        $this->requestMock->expects($this->at(0))
-            ->method('getParam')
-            ->with('payment_method_nonce')
-            ->willReturn($paymentMethodNonce);
-        $this->requestMock->expects($this->at(1))
-            ->method('getParam')
-            ->with('details')
-            ->willReturn($detailsEncoded);
-
-        $this->setupCart();
-
-        $errorMsg = new \Magento\Framework\Phrase('error');
-        $exception = new \Magento\Framework\Exception\LocalizedException($errorMsg);
-        $this->messageManagerMock->expects($this->once())
-            ->method('addExceptionMessage')
-            ->with($exception, $errorMsg);
-
-        $this->checkoutMock->expects($this->once())
-            ->method('initializeQuoteForReview')
-            ->with($paymentMethodNonce, ['email' => $email])
-            ->willThrowException($exception);
-
-        $resultRedirect = $this->getMockBuilder('\Magento\Framework\Controller\Result\Redirect')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $resultRedirect->expects($this->once())
-            ->method('setPath')
-            ->with('checkout/cart')
-            ->willReturnSelf();
-        $this->resultFactoryMock->expects($this->once())
-            ->method('create')
-            ->with(\Magento\Framework\Controller\ResultFactory::TYPE_REDIRECT)
-            ->willReturn($resultRedirect);
-        $this->assertEquals($resultRedirect, $this->controller->execute());
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Controller/PayPal/SaveShippingMethodTest.php b/app/code/Magento/Braintree/Test/Unit/Controller/PayPal/SaveShippingMethodTest.php
deleted file mode 100644
index 38d61187310a6a6146435c7d6c55e62870398ab8..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Controller/PayPal/SaveShippingMethodTest.php
+++ /dev/null
@@ -1,241 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Controller\PayPal;
-
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
-use Magento\Framework\Controller\ResultFactory;
-
-class SaveShippingMethodTest extends \PHPUnit_Framework_TestCase
-{
-    const REVIEW_URL = 'http://localhost/braintree/paypal/review';
-
-    /**
-     * @var \Magento\Braintree\Model\CheckoutFactory|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $checkoutFactoryMock;
-
-    /**
-     * @var \Magento\Checkout\Model\Session|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $checkoutSessionMock;
-
-    /**
-     * @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $requestMock;
-
-    /**
-     * @var \Magento\Framework\Controller\ResultFactory|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $resultFactoryMock;
-
-    /**
-     * @var \Magento\Braintree\Model\Checkout|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $checkoutMock;
-
-    /**
-     * @var \Magento\Framework\Message\ManagerInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $messageManager;
-
-    /**
-     * @var \Magento\Framework\App\Response|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $responseMock;
-
-    /**
-     * @var ObjectManagerHelper
-     */
-    protected $objectManagerHelper;
-
-    /**
-     * @var \Magento\Braintree\Controller\PayPal\SaveShippingMethod
-     */
-    protected $controller;
-
-    /**
-     * test setup
-     */
-    public function setUp()
-    {
-        $this->checkoutSessionMock = $this->getMockBuilder('\Magento\Checkout\Model\Session')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->checkoutFactoryMock = $this->getMockBuilder('\Magento\Braintree\Model\CheckoutFactory')
-            ->disableOriginalConstructor()
-            ->setMethods(['create'])
-            ->getMock();
-
-        $this->messageManager = $this->getMock('\Magento\Framework\Message\ManagerInterface');
-
-        $this->checkoutMock = $this->getMockBuilder('\Magento\Braintree\Model\Checkout')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->requestMock = $this->getMock('\Magento\Framework\App\RequestInterface');
-
-        $this->resultFactoryMock = $this->getMockBuilder('\Magento\Framework\Controller\ResultFactory')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->responseMock = $this->getMockBuilder('\Magento\Framework\App\Response')
-            ->disableOriginalConstructor()
-            ->setMethods(['setBody'])
-            ->getMock();
-
-        $urlBuilderMock = $this->getMock('\Magento\Framework\UrlInterface');
-        $urlBuilderMock->expects($this->any())
-            ->method('getUrl')
-            ->willReturn(self::REVIEW_URL);
-
-        $contextMock = $this->getMockBuilder('\Magento\Framework\App\Action\Context')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $contextMock->expects($this->any())
-            ->method('getResultFactory')
-            ->willReturn($this->resultFactoryMock);
-        $contextMock->expects($this->any())
-            ->method('getRequest')
-            ->willReturn($this->requestMock);
-        $contextMock->expects($this->any())
-            ->method('getMessageManager')
-            ->willReturn($this->messageManager);
-        $contextMock->expects($this->any())
-            ->method('getResponse')
-            ->willReturn($this->responseMock);
-        $contextMock->expects($this->any())
-            ->method('getUrl')
-            ->willReturn($urlBuilderMock);
-
-        $this->objectManagerHelper = new ObjectManagerHelper($this);
-        $this->controller = $this->objectManagerHelper->getObject(
-            '\Magento\Braintree\Controller\PayPal\SaveShippingMethod',
-            [
-                'context' => $contextMock,
-                'checkoutSession' => $this->checkoutSessionMock,
-                'checkoutFactory' => $this->checkoutFactoryMock,
-            ]
-        );
-    }
-
-    protected function setupCart()
-    {
-        $quoteMock = $this->getMockBuilder('\Magento\Quote\Model\Quote')
-            ->disableOriginalConstructor()
-            ->setMethods(['hasItems', 'getHasError', 'getPayment'])
-            ->getMock();
-        $quoteMock->expects($this->any())
-            ->method('hasItems')
-            ->willReturn(true);
-        $quoteMock->expects($this->any())
-            ->method('getHasError')
-            ->willReturn(false);
-
-        $this->checkoutSessionMock->expects($this->any())
-            ->method('getQuote')
-            ->willReturn($quoteMock);
-
-        $this->checkoutFactoryMock->expects($this->any())
-            ->method('create')
-            ->willReturn($this->checkoutMock);
-
-        return $quoteMock;
-    }
-
-    public function testExecute()
-    {
-        $html = '<html></html>';
-
-        $shippingMethod = 'flat_rate';
-        $this->requestMock->expects($this->at(0))
-            ->method('getParam')
-            ->with('isAjax')
-            ->willReturn(true);
-        $this->requestMock->expects($this->at(1))
-            ->method('getParam')
-            ->with('shipping_method')
-            ->willReturn($shippingMethod);
-
-        $this->setupCart();
-        $this->checkoutMock->expects($this->once())
-            ->method('updateShippingMethod')
-            ->with($shippingMethod);
-
-        $blockMock = $this->getMockBuilder('\Magento\Paypal\Block\Express\Review\Details')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $blockMock->expects($this->once())
-            ->method('toHtml')
-            ->willReturn($html);
-        $layoutMock = $this->getMockBuilder('\Magento\Framework\View\Layout')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $layoutMock->expects($this->once())
-            ->method('getBlock')
-            ->with('page.block')
-            ->willReturn($blockMock);
-        $responsePageMock = $this->getMockBuilder('\Magento\Framework\View\Result\Page')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $responsePageMock->expects($this->once())
-            ->method('addHandle')
-            ->with('paypal_express_review_details')
-            ->willReturnSelf();
-        $responsePageMock->expects($this->once())
-            ->method('getLayout')
-            ->willReturn($layoutMock);
-
-        $this->responseMock->expects($this->once())
-            ->method('setBody')
-            ->with($html);
-        $this->resultFactoryMock->expects($this->once())
-            ->method('create')
-            ->with(ResultFactory::TYPE_PAGE)
-            ->willReturn($responsePageMock);
-
-        $this->controller->execute();
-    }
-
-    public function testExecuteException()
-    {
-        $html = '<script>window.location.href = '
-            . self::REVIEW_URL
-            . ';</script>';
-
-        $shippingMethod = 'flat_rate';
-        $this->requestMock->expects($this->at(0))
-            ->method('getParam')
-            ->with('isAjax')
-            ->willReturn(true);
-        $this->requestMock->expects($this->at(1))
-            ->method('getParam')
-            ->with('shipping_method')
-            ->willReturn($shippingMethod);
-
-        $this->setupCart();
-
-        $exceptionMsg = new \Magento\Framework\Phrase('error');
-        $exception = new \Magento\Framework\Exception\LocalizedException(
-            $exceptionMsg
-        );
-        $this->checkoutMock->expects($this->once())
-            ->method('updateShippingMethod')
-            ->with($shippingMethod)
-            ->willThrowException($exception);
-
-        $this->messageManager->expects($this->once())
-            ->method('addExceptionMessage')
-            ->with($exception, $exceptionMsg);
-
-        $this->responseMock->expects($this->once())
-            ->method('setBody')
-            ->with($html);
-
-        $this->controller->execute();
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Controller/PayPalTest.php b/app/code/Magento/Braintree/Test/Unit/Controller/PayPalTest.php
deleted file mode 100644
index b20831f92fe1d2be7ba0bb66aa61d0b86733a6c5..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Controller/PayPalTest.php
+++ /dev/null
@@ -1,152 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Controller;
-
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
-
-class PayPalTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Braintree\Model\CheckoutFactory|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $checkoutFactoryMock;
-
-    /**
-     * @var \Magento\Customer\Model\Session|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $customerSessionMock;
-
-    /**
-     * @var \Magento\Checkout\Model\Session|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $checkoutSessionMock;
-
-    /**
-     * @var \Magento\Framework\App\ActionFlag|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $actionFlagMock;
-
-    /**
-     * @var \Magento\Braintree\Model\Config\PayPal|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $braintreePayPalConfigMock;
-
-    /**
-     * @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $requestMock;
-
-    /**
-     * @var \Magento\Framework\Controller\Result\RedirectFactory|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $resultRedirectFactoryMock;
-
-    /**
-     * @var ObjectManagerHelper
-     */
-    protected $objectManagerHelper;
-
-    /**
-     * @var \Magento\Braintree\Controller\PayPal
-     */
-    protected $controller;
-
-    /**
-     * test setup
-     */
-    public function setUp()
-    {
-        $this->customerSessionMock = $this->getMockBuilder('\Magento\Customer\Model\Session')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->checkoutSessionMock = $this->getMockBuilder('\Magento\Checkout\Model\Session')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->braintreePayPalConfigMock = $this->getMockBuilder('\Magento\Braintree\Model\Config\PayPal')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->checkoutFactoryMock = $this->getMockBuilder('\Magento\Braintree\Model\CheckoutFactory')
-            ->disableOriginalConstructor()
-            ->setMethods(['create'])
-            ->getMock();
-
-        $this->requestMock = $this->getMock('\Magento\Framework\App\RequestInterface');
-
-        $this->actionFlagMock = $this->getMockBuilder('\Magento\Framework\App\ActionFlag')
-            ->disableOriginalConstructor()
-            ->setMethods(['set'])
-            ->getMock();
-
-        $this->resultRedirectFactoryMock = $this->getMockBuilder('\Magento\Framework\Controller\Result\RedirectFactory')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $contextMock = $this->getMockBuilder('\Magento\Framework\App\Action\Context')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $contextMock->expects($this->any())
-            ->method('getResultRedirectFactory')
-            ->willReturn($this->resultRedirectFactoryMock);
-        $contextMock->expects($this->any())
-            ->method('getActionFlag')
-            ->willReturn($this->actionFlagMock);
-
-        $this->objectManagerHelper = new ObjectManagerHelper($this);
-        $this->controller = $this->objectManagerHelper->getObject(
-            'Magento\Braintree\Test\Unit\Controller\Stub\PayPalStub',
-            [
-                'context' => $contextMock,
-                'customerSession' => $this->customerSessionMock,
-                'checkoutSession' => $this->checkoutSessionMock,
-                'braintreePayPalConfig' => $this->braintreePayPalConfigMock,
-                'checkoutFactory' => $this->checkoutFactoryMock,
-            ]
-        );
-    }
-
-    public function testDispatchNotActive()
-    {
-        $resultRedirect = new \Magento\Framework\DataObject();
-        $this->braintreePayPalConfigMock->expects($this->once())
-            ->method('isActive')
-            ->willReturn(false);
-
-        $this->actionFlagMock->expects($this->once())
-            ->method('set')
-            ->with('', \Magento\Framework\App\ActionInterface::FLAG_NO_DISPATCH);
-        $this->resultRedirectFactoryMock->expects($this->once())
-            ->method('create')
-            ->willReturn($resultRedirect);
-
-        $this->assertEquals($resultRedirect, $this->controller->dispatch($this->requestMock));
-        $this->assertEquals('noRoute', $resultRedirect->getPath()) ;
-    }
-
-    public function testDispatchButtonNotEnabled()
-    {
-        $resultRedirect = new \Magento\Framework\DataObject();
-        $this->braintreePayPalConfigMock->expects($this->once())
-            ->method('isActive')
-            ->willReturn(true);
-        $this->braintreePayPalConfigMock->expects($this->once())
-            ->method('isShortcutCheckoutEnabled')
-            ->willReturn(false);
-
-        $this->actionFlagMock->expects($this->once())
-            ->method('set')
-            ->with('', \Magento\Framework\App\ActionInterface::FLAG_NO_DISPATCH);
-        $this->resultRedirectFactoryMock->expects($this->once())
-            ->method('create')
-            ->willReturn($resultRedirect);
-
-        $this->assertEquals($resultRedirect, $this->controller->dispatch($this->requestMock));
-        $this->assertEquals('noRoute', $resultRedirect->getPath()) ;
-    }
-}
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Controller/Payment/GetNonceTest.php b/app/code/Magento/Braintree/Test/Unit/Controller/Payment/GetNonceTest.php
similarity index 94%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Controller/Payment/GetNonceTest.php
rename to app/code/Magento/Braintree/Test/Unit/Controller/Payment/GetNonceTest.php
index 0e179131fdcec7c1985228c8e89c1b24ad9b00fe..1a38003f15d73b01c675df12246055fb8f99bcaf 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Controller/Payment/GetNonceTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Controller/Payment/GetNonceTest.php
@@ -3,10 +3,10 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Controller\Payment;
+namespace Magento\Braintree\Test\Unit\Controller\Payment;
 
-use Magento\BraintreeTwo\Controller\Payment\GetNonce;
-use Magento\BraintreeTwo\Gateway\Command\GetPaymentNonceCommand;
+use Magento\Braintree\Controller\Payment\GetNonce;
+use Magento\Braintree\Gateway\Command\GetPaymentNonceCommand;
 use Magento\Customer\Model\Session;
 use Magento\Framework\App\Action\Context;
 use Magento\Framework\App\Request\Http;
@@ -109,7 +109,7 @@ class GetNonceTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Controller\Payment\GetNonce::execute
+     * @covers \Magento\Braintree\Controller\Payment\GetNonce::execute
      */
     public function testExecuteWithException()
     {
@@ -142,7 +142,7 @@ class GetNonceTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Controller\Payment\GetNonce::execute
+     * @covers \Magento\Braintree\Controller\Payment\GetNonce::execute
      */
     public function testExecute()
     {
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Controller/Paypal/PlaceOrderTest.php b/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/PlaceOrderTest.php
similarity index 95%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Controller/Paypal/PlaceOrderTest.php
rename to app/code/Magento/Braintree/Test/Unit/Controller/Paypal/PlaceOrderTest.php
index ca77b718cf4af60bc4ba0f1b123f99706bf8fa3a..ca390d803f385a5151c10594689ded7163ff3324 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Controller/Paypal/PlaceOrderTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/PlaceOrderTest.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Controller\Paypal;
+namespace Magento\Braintree\Test\Unit\Controller\Paypal;
 
 use Magento\Quote\Model\Quote;
 use Magento\Checkout\Model\Session;
@@ -12,14 +12,14 @@ use Magento\Framework\App\RequestInterface;
 use Magento\Framework\Message\ManagerInterface;
 use Magento\Framework\Controller\ResultFactory;
 use Magento\Framework\Controller\ResultInterface;
-use Magento\BraintreeTwo\Controller\Paypal\PlaceOrder;
-use Magento\BraintreeTwo\Gateway\Config\PayPal\Config;
-use Magento\BraintreeTwo\Model\Paypal\Helper\OrderPlace;
+use Magento\Braintree\Controller\Paypal\PlaceOrder;
+use Magento\Braintree\Gateway\Config\PayPal\Config;
+use Magento\Braintree\Model\Paypal\Helper\OrderPlace;
 
 /**
  * Class PlaceOrderTest
  *
- * @see \Magento\BraintreeTwo\Controller\Paypal\PlaceOrder
+ * @see \Magento\Braintree\Controller\Paypal\PlaceOrder
  *
  * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
  */
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Controller/Paypal/ReviewTest.php b/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/ReviewTest.php
similarity index 95%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Controller/Paypal/ReviewTest.php
rename to app/code/Magento/Braintree/Test/Unit/Controller/Paypal/ReviewTest.php
index 27f6835b6d66904e386ab95bd913e99a9988e80a..8b609e3054e510c1ab581f9bf53c8b7021c696a0 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Controller/Paypal/ReviewTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/ReviewTest.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Controller\Paypal;
+namespace Magento\Braintree\Test\Unit\Controller\Paypal;
 
 use Magento\Quote\Model\Quote;
 use Magento\Framework\View\Layout;
@@ -15,15 +15,15 @@ use Magento\Framework\Message\ManagerInterface;
 use Magento\Framework\Controller\ResultFactory;
 use Magento\Framework\Controller\Result\Redirect;
 use Magento\Framework\View\Element\AbstractBlock;
-use Magento\BraintreeTwo\Controller\Paypal\Review;
-use Magento\BraintreeTwo\Gateway\Config\PayPal\Config;
-use Magento\BraintreeTwo\Model\Paypal\Helper\QuoteUpdater;
-use Magento\BraintreeTwo\Block\Paypal\Checkout\Review as CheckoutReview;
+use Magento\Braintree\Controller\Paypal\Review;
+use Magento\Braintree\Gateway\Config\PayPal\Config;
+use Magento\Braintree\Model\Paypal\Helper\QuoteUpdater;
+use Magento\Braintree\Block\Paypal\Checkout\Review as CheckoutReview;
 
 /**
  * Class ReviewTest
  *
- * @see \Magento\BraintreeTwo\Controller\Paypal\Review
+ * @see \Magento\Braintree\Controller\Paypal\Review
  *
  * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
  */
@@ -144,7 +144,7 @@ class ReviewTest extends \PHPUnit_Framework_TestCase
 
         $layoutMock->expects(self::once())
             ->method('getBlock')
-            ->with('braintreetwo.paypal.review')
+            ->with('braintree.paypal.review')
             ->willReturn($blockMock);
 
         $blockMock->expects(self::once())
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Controller/Paypal/SaveShippingMethodTest.php b/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/SaveShippingMethodTest.php
similarity index 96%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Controller/Paypal/SaveShippingMethodTest.php
rename to app/code/Magento/Braintree/Test/Unit/Controller/Paypal/SaveShippingMethodTest.php
index 63368faa94c80122ef8d13957e07380103e27414..42247857f9562c09492f73646b72790d9ddf6faa 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Controller/Paypal/SaveShippingMethodTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/SaveShippingMethodTest.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Controller\Paypal;
+namespace Magento\Braintree\Test\Unit\Controller\Paypal;
 
 use Magento\Quote\Model\Quote;
 use Magento\Framework\View\Layout;
@@ -16,15 +16,15 @@ use Magento\Framework\App\ResponseInterface;
 use Magento\Framework\Controller\ResultFactory;
 use Magento\Framework\Message\ManagerInterface;
 use Magento\Framework\App\Response\RedirectInterface;
-use Magento\BraintreeTwo\Block\Paypal\Checkout\Review;
-use Magento\BraintreeTwo\Gateway\Config\PayPal\Config;
-use Magento\BraintreeTwo\Controller\Paypal\SaveShippingMethod;
-use Magento\BraintreeTwo\Model\Paypal\Helper\ShippingMethodUpdater;
+use Magento\Braintree\Block\Paypal\Checkout\Review;
+use Magento\Braintree\Gateway\Config\PayPal\Config;
+use Magento\Braintree\Controller\Paypal\SaveShippingMethod;
+use Magento\Braintree\Model\Paypal\Helper\ShippingMethodUpdater;
 
 /**
  * Class SaveShippingMethodTest
  *
- * @see \Magento\BraintreeTwo\Controller\Paypal\SaveShippingMethod
+ * @see \Magento\Braintree\Controller\Paypal\SaveShippingMethod
  *
  * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
  */
diff --git a/app/code/Magento/Braintree/Test/Unit/Controller/Stub/MyCreditCardsStub.php b/app/code/Magento/Braintree/Test/Unit/Controller/Stub/MyCreditCardsStub.php
deleted file mode 100644
index 38b0640e3481853dbe9908c6921767c3c78dcbc9..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Controller/Stub/MyCreditCardsStub.php
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Controller\Stub;
-
-class MyCreditCardsStub extends \Magento\Braintree\Controller\MyCreditCards
-{
-    public function execute()
-    {
-        // Empty method stub for test
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Controller/Stub/PayPalStub.php b/app/code/Magento/Braintree/Test/Unit/Controller/Stub/PayPalStub.php
deleted file mode 100644
index d474ea7db5bc575afd8d69f907e1c43723219390..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Controller/Stub/PayPalStub.php
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Controller\Stub;
-
-class PayPalStub extends \Magento\Braintree\Controller\PayPal
-{
-    public function execute()
-    {
-        // Empty method stub for test
-    }
-}
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Command/CaptureStrategyCommandTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Command/CaptureStrategyCommandTest.php
similarity index 94%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Command/CaptureStrategyCommandTest.php
rename to app/code/Magento/Braintree/Test/Unit/Gateway/Command/CaptureStrategyCommandTest.php
index 6d11b297eb697762bc100118af4633c37aba3454..ba3fdd51fca99ad81d51fcbef804003356976164 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Command/CaptureStrategyCommandTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Command/CaptureStrategyCommandTest.php
@@ -3,10 +3,10 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Gateway\Command;
+namespace Magento\Braintree\Test\Unit\Gateway\Command;
 
-use Magento\BraintreeTwo\Gateway\Command\CaptureStrategyCommand;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Command\CaptureStrategyCommand;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 use Magento\Framework\Api\FilterBuilder;
 use Magento\Framework\Api\Search\SearchCriteria;
 use Magento\Framework\Api\SearchCriteriaBuilder;
@@ -27,7 +27,7 @@ use Magento\Sales\Model\ResourceModel\Order\Payment\Transaction\CollectionFactor
 class CaptureStrategyCommandTest extends \PHPUnit_Framework_TestCase
 {
     /**
-     * @var \Magento\BraintreeTwo\Gateway\Command\CaptureStrategyCommand
+     * @var \Magento\Braintree\Gateway\Command\CaptureStrategyCommand
      */
     private $strategyCommand;
 
@@ -92,7 +92,7 @@ class CaptureStrategyCommandTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Gateway\Command\CaptureStrategyCommand::execute
+     * @covers \Magento\Braintree\Gateway\Command\CaptureStrategyCommand::execute
      */
     public function testSaleExecute()
     {
@@ -127,7 +127,7 @@ class CaptureStrategyCommandTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Gateway\Command\CaptureStrategyCommand::execute
+     * @covers \Magento\Braintree\Gateway\Command\CaptureStrategyCommand::execute
      */
     public function testCaptureExecute()
     {
@@ -162,7 +162,7 @@ class CaptureStrategyCommandTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Gateway\Command\CaptureStrategyCommand::execute
+     * @covers \Magento\Braintree\Gateway\Command\CaptureStrategyCommand::execute
      */
     public function testVaultCaptureExecute()
     {
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Command/GetPaymentNonceCommandTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Command/GetPaymentNonceCommandTest.php
similarity index 92%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Command/GetPaymentNonceCommandTest.php
rename to app/code/Magento/Braintree/Test/Unit/Gateway/Command/GetPaymentNonceCommandTest.php
index 7e75dee359b7849e942aff1e633be41afa3aef07..f75ada4a8ade2bc2679183fbf636f319094e01d1 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Command/GetPaymentNonceCommandTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Command/GetPaymentNonceCommandTest.php
@@ -3,12 +3,12 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Gateway\Command;
+namespace Magento\Braintree\Test\Unit\Gateway\Command;
 
-use Magento\BraintreeTwo\Gateway\Command\GetPaymentNonceCommand;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
-use Magento\BraintreeTwo\Gateway\Validator\PaymentNonceResponseValidator;
-use Magento\BraintreeTwo\Model\Adapter\BraintreeAdapter;
+use Magento\Braintree\Gateway\Command\GetPaymentNonceCommand;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Validator\PaymentNonceResponseValidator;
+use Magento\Braintree\Model\Adapter\BraintreeAdapter;
 use Magento\Payment\Gateway\Command;
 use Magento\Payment\Gateway\Command\Result\ArrayResultFactory;
 use Magento\Payment\Gateway\Command\Result\ArrayResult;
@@ -109,7 +109,7 @@ class GetPaymentNonceCommandTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Gateway\Command\GetPaymentNonceCommand::execute
+     * @covers \Magento\Braintree\Gateway\Command\GetPaymentNonceCommand::execute
      * @expectedException \InvalidArgumentException
      * @expectedExceptionMessage The "publicHash" field does not exists
      */
@@ -128,7 +128,7 @@ class GetPaymentNonceCommandTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Gateway\Command\GetPaymentNonceCommand::execute
+     * @covers \Magento\Braintree\Gateway\Command\GetPaymentNonceCommand::execute
      * @expectedException \InvalidArgumentException
      * @expectedExceptionMessage The "customerId" field does not exists
      */
@@ -152,7 +152,7 @@ class GetPaymentNonceCommandTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Gateway\Command\GetPaymentNonceCommand::execute
+     * @covers \Magento\Braintree\Gateway\Command\GetPaymentNonceCommand::execute
      * @expectedException \Exception
      * @expectedExceptionMessage No available payment tokens
      */
@@ -181,7 +181,7 @@ class GetPaymentNonceCommandTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Gateway\Command\GetPaymentNonceCommand::execute
+     * @covers \Magento\Braintree\Gateway\Command\GetPaymentNonceCommand::execute
      * @expectedException \Exception
      * @expectedExceptionMessage Payment method nonce can't be retrieved.
      */
@@ -235,7 +235,7 @@ class GetPaymentNonceCommandTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Gateway\Command\GetPaymentNonceCommand::execute
+     * @covers \Magento\Braintree\Gateway\Command\GetPaymentNonceCommand::execute
      */
     public function testExecute()
     {
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Config/CanVoidHandlerTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Config/CanVoidHandlerTest.php
similarity index 92%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Config/CanVoidHandlerTest.php
rename to app/code/Magento/Braintree/Test/Unit/Gateway/Config/CanVoidHandlerTest.php
index a383cb3bcdc64eeea1c2df89fa4e3342eafcc810..4438821d471bb23e928d9a2a9e58914231c18492 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Config/CanVoidHandlerTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Config/CanVoidHandlerTest.php
@@ -3,10 +3,10 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Gateway\Config;
+namespace Magento\Braintree\Test\Unit\Gateway\Config;
 
-use Magento\BraintreeTwo\Gateway\Config\CanVoidHandler;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Config\CanVoidHandler;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 use Magento\Payment\Gateway\Data\PaymentDataObjectInterface;
 use Magento\Payment\Model\InfoInterface;
 use Magento\Sales\Model\Order\Payment;
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Config/ConfigTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Config/ConfigTest.php
similarity index 93%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Config/ConfigTest.php
rename to app/code/Magento/Braintree/Test/Unit/Gateway/Config/ConfigTest.php
index ec998eb136e034abceb34488078fa229fdf390ca..23e2870cfb6bf56ee14cc99f5d03f1aac699bb06 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Config/ConfigTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Config/ConfigTest.php
@@ -4,9 +4,9 @@
  * See COPYING.txt for license details.
  */
 
-namespace Magento\BraintreeTwo\Test\Unit\Gateway\Config;
+namespace Magento\Braintree\Test\Unit\Gateway\Config;
 
-use Magento\BraintreeTwo\Gateway\Config\Config;
+use Magento\Braintree\Gateway\Config\Config;
 use Magento\Framework\App\Config\ScopeConfigInterface;
 use Magento\Store\Model\ScopeInterface;
 
@@ -31,7 +31,6 @@ class ConfigTest extends \PHPUnit_Framework_TestCase
     {
         $this->scopeConfigMock = $this->getMock(ScopeConfigInterface::class);
 
-
         $this->model = new Config($this->scopeConfigMock, self::METHOD_CODE);
     }
 
@@ -145,7 +144,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers       \Magento\BraintreeTwo\Gateway\Config\Config::getCountryAvailableCardTypes
+     * @covers       \Magento\Braintree\Gateway\Config\Config::getCountryAvailableCardTypes
      * @dataProvider getCountrySpecificCardTypeConfigDataProvider
      */
     public function testCountryAvailableCardTypes($data, $countryData)
@@ -162,7 +161,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Gateway\Config\Config::isCvvEnabled
+     * @covers \Magento\Braintree\Gateway\Config\Config::isCvvEnabled
      */
     public function testUseCvv()
     {
@@ -178,7 +177,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase
      * @param mixed $data
      * @param boolean $expected
      * @dataProvider verify3DSecureDataProvider
-     * @covers \Magento\BraintreeTwo\Gateway\Config\Config::isVerify3DSecure
+     * @covers \Magento\Braintree\Gateway\Config\Config::isVerify3DSecure
      */
     public function testIsVerify3DSecure($data, $expected)
     {
@@ -208,7 +207,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase
     /**
      * @param mixed $data
      * @param double $expected
-     * @covers \Magento\BraintreeTwo\Gateway\Config\Config::getThresholdAmount
+     * @covers \Magento\Braintree\Gateway\Config\Config::getThresholdAmount
      * @dataProvider thresholdAmountDataProvider
      */
     public function testGetThresholdAmount($data, $expected)
@@ -241,7 +240,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase
     /**
      * @param int $value
      * @param array $expected
-     * @covers \Magento\BraintreeTwo\Gateway\Config\Config::get3DSecureSpecificCountries
+     * @covers \Magento\Braintree\Gateway\Config\Config::get3DSecureSpecificCountries
      * @dataProvider threeDSecureSpecificCountriesDataProvider
      */
     public function testGet3DSecureSpecificCountries($value, array $expected)
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Helper/SubjectReaderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Helper/SubjectReaderTest.php
similarity index 77%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Helper/SubjectReaderTest.php
rename to app/code/Magento/Braintree/Test/Unit/Gateway/Helper/SubjectReaderTest.php
index 5fcf519df0356ea31fb8afb22e7cd29274076773..b0ba028d068f8a3fa50c2f06a6a8bd29363d8a42 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Helper/SubjectReaderTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Helper/SubjectReaderTest.php
@@ -3,11 +3,11 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Gateway\Helper;
+namespace Magento\Braintree\Test\Unit\Gateway\Helper;
 
 use Braintree\Transaction;
 use InvalidArgumentException;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 
 /**
  * Class SubjectReaderTest
@@ -25,7 +25,7 @@ class SubjectReaderTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Gateway\Helper\SubjectReader::readCustomerId
+     * @covers \Magento\Braintree\Gateway\Helper\SubjectReader::readCustomerId
      * @expectedException InvalidArgumentException
      * @expectedExceptionMessage The "customerId" field does not exists
      */
@@ -35,7 +35,7 @@ class SubjectReaderTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Gateway\Helper\SubjectReader::readCustomerId
+     * @covers \Magento\Braintree\Gateway\Helper\SubjectReader::readCustomerId
      */
     public function testReadCustomerId()
     {
@@ -44,7 +44,7 @@ class SubjectReaderTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Gateway\Helper\SubjectReader::readPublicHash
+     * @covers \Magento\Braintree\Gateway\Helper\SubjectReader::readPublicHash
      * @expectedException InvalidArgumentException
      * @expectedExceptionMessage The "public_hash" field does not exists
      */
@@ -54,7 +54,7 @@ class SubjectReaderTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Gateway\Helper\SubjectReader::readPublicHash
+     * @covers \Magento\Braintree\Gateway\Helper\SubjectReader::readPublicHash
      */
     public function testReadPublicHash()
     {
@@ -63,7 +63,7 @@ class SubjectReaderTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Gateway\Helper\SubjectReader::readPayPal
+     * @covers \Magento\Braintree\Gateway\Helper\SubjectReader::readPayPal
      * @expectedException \InvalidArgumentException
      * @expectedExceptionMessage Transaction has't paypal attribute
      */
@@ -76,7 +76,7 @@ class SubjectReaderTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Gateway\Helper\SubjectReader::readPayPal
+     * @covers \Magento\Braintree\Gateway\Helper\SubjectReader::readPayPal
      */
     public function testReadPayPal()
     {
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Http/Client/TransactionSaleTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Http/Client/TransactionSaleTest.php
similarity index 95%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Http/Client/TransactionSaleTest.php
rename to app/code/Magento/Braintree/Test/Unit/Gateway/Http/Client/TransactionSaleTest.php
index d2c26fc00c9d9fcd003335fba33f6766ef8dba45..f80246e55735d5345f975563d11727c197470122 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Http/Client/TransactionSaleTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Http/Client/TransactionSaleTest.php
@@ -3,10 +3,10 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Gateway\Http\Client;
+namespace Magento\Braintree\Test\Unit\Gateway\Http\Client;
 
-use Magento\BraintreeTwo\Gateway\Http\Client\TransactionSale;
-use Magento\BraintreeTwo\Model\Adapter\BraintreeAdapter;
+use Magento\Braintree\Gateway\Http\Client\TransactionSale;
+use Magento\Braintree\Model\Adapter\BraintreeAdapter;
 use Magento\Payment\Gateway\Http\TransferInterface;
 use Magento\Payment\Model\Method\Logger;
 use Psr\Log\LoggerInterface;
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Http/Client/TransactionSubmitForSettlementTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Http/Client/TransactionSubmitForSettlementTest.php
similarity index 88%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Http/Client/TransactionSubmitForSettlementTest.php
rename to app/code/Magento/Braintree/Test/Unit/Gateway/Http/Client/TransactionSubmitForSettlementTest.php
index c68780b5bbc5854fdbd07d1888520f5c984be07b..414c8c65bab82949c9aaf71405b55a045afa9f48 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Http/Client/TransactionSubmitForSettlementTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Http/Client/TransactionSubmitForSettlementTest.php
@@ -3,11 +3,11 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Gateway\Http\Client;
+namespace Magento\Braintree\Test\Unit\Gateway\Http\Client;
 
 use Braintree\Result\Successful;
-use Magento\BraintreeTwo\Gateway\Http\Client\TransactionSubmitForSettlement;
-use Magento\BraintreeTwo\Model\Adapter\BraintreeAdapter;
+use Magento\Braintree\Gateway\Http\Client\TransactionSubmitForSettlement;
+use Magento\Braintree\Model\Adapter\BraintreeAdapter;
 use Magento\Payment\Gateway\Http\TransferInterface;
 use Magento\Payment\Model\Method\Logger;
 use Psr\Log\LoggerInterface;
@@ -52,7 +52,7 @@ class TransactionSubmitForSettlementTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Gateway\Http\Client\TransactionSubmitForSettlement::placeRequest
+     * @covers \Magento\Braintree\Gateway\Http\Client\TransactionSubmitForSettlement::placeRequest
      * @expectedException \Magento\Payment\Gateway\Http\ClientException
      * @expectedExceptionMessage Transaction has been declined
      */
@@ -69,7 +69,7 @@ class TransactionSubmitForSettlementTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Gateway\Http\Client\TransactionSubmitForSettlement::process
+     * @covers \Magento\Braintree\Gateway\Http\Client\TransactionSubmitForSettlement::process
      */
     public function testPlaceRequest()
     {
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Http/TransferFactoryTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Http/TransferFactoryTest.php
similarity index 92%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Http/TransferFactoryTest.php
rename to app/code/Magento/Braintree/Test/Unit/Gateway/Http/TransferFactoryTest.php
index f0690b6bc94676af17051fcf0bf6c57b9f769692..3a23ff9c6be472af089661c31d8abdb17dc9915a 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Http/TransferFactoryTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Http/TransferFactoryTest.php
@@ -3,9 +3,9 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Gateway\Http;
+namespace Magento\Braintree\Test\Unit\Gateway\Http;
 
-use Magento\BraintreeTwo\Gateway\Http\TransferFactory;
+use Magento\Braintree\Gateway\Http\TransferFactory;
 use Magento\Payment\Gateway\Http\TransferBuilder;
 use Magento\Payment\Gateway\Http\TransferInterface;
 
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Request/AddressDataBuilderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/AddressDataBuilderTest.php
similarity index 97%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Request/AddressDataBuilderTest.php
rename to app/code/Magento/Braintree/Test/Unit/Gateway/Request/AddressDataBuilderTest.php
index 614a916c5988dea44d756176d4c41a221e977298..e3fe748ed96c15dea6da87945d640a11bc0256fe 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Request/AddressDataBuilderTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/AddressDataBuilderTest.php
@@ -3,13 +3,13 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Gateway\Request;
+namespace Magento\Braintree\Test\Unit\Gateway\Request;
 
-use Magento\BraintreeTwo\Gateway\Request\AddressDataBuilder;
+use Magento\Braintree\Gateway\Request\AddressDataBuilder;
 use Magento\Payment\Gateway\Data\PaymentDataObjectInterface;
 use Magento\Payment\Gateway\Data\OrderAdapterInterface;
 use Magento\Payment\Gateway\Data\AddressAdapterInterface;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 
 /**
  * Class AddressDataBuilderTest
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Request/CaptureDataBuilderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/CaptureDataBuilderTest.php
similarity index 88%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Request/CaptureDataBuilderTest.php
rename to app/code/Magento/Braintree/Test/Unit/Gateway/Request/CaptureDataBuilderTest.php
index 1a5e6d7cd0863287490fbbf143dad100c3380076..0a4c77d34fc820819ee8649a8d9ef550c6a0a9ba 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Request/CaptureDataBuilderTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/CaptureDataBuilderTest.php
@@ -3,12 +3,12 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Gateway\Request;
+namespace Magento\Braintree\Test\Unit\Gateway\Request;
 
-use Magento\BraintreeTwo\Gateway\Request\CaptureDataBuilder;
+use Magento\Braintree\Gateway\Request\CaptureDataBuilder;
 use Magento\Payment\Gateway\Data\PaymentDataObjectInterface;
 use Magento\Sales\Model\Order\Payment;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 
 /**
  * Class CaptureDataBuilderTest
@@ -16,7 +16,7 @@ use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
 class CaptureDataBuilderTest extends \PHPUnit_Framework_TestCase
 {
     /**
-     * @var \Magento\BraintreeTwo\Gateway\Request\CaptureDataBuilder
+     * @var \Magento\Braintree\Gateway\Request\CaptureDataBuilder
      */
     private $builder;
 
@@ -49,7 +49,7 @@ class CaptureDataBuilderTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Gateway\Request\CaptureDataBuilder::build
+     * @covers \Magento\Braintree\Gateway\Request\CaptureDataBuilder::build
      * @expectedException \Magento\Framework\Exception\LocalizedException
      * @expectedExceptionMessage No authorization transaction to proceed capture.
      */
@@ -78,7 +78,7 @@ class CaptureDataBuilderTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Gateway\Request\CaptureDataBuilder::build
+     * @covers \Magento\Braintree\Gateway\Request\CaptureDataBuilder::build
      */
     public function testBuild()
     {
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Request/CustomerDataBuilderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/CustomerDataBuilderTest.php
similarity index 96%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Request/CustomerDataBuilderTest.php
rename to app/code/Magento/Braintree/Test/Unit/Gateway/Request/CustomerDataBuilderTest.php
index e2cca399497978a3d0b025db5ff97086b642d7ad..600e7a3748d7fd0a3ff7bd827bdc4dde06c39518 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Request/CustomerDataBuilderTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/CustomerDataBuilderTest.php
@@ -3,13 +3,13 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Gateway\Request;
+namespace Magento\Braintree\Test\Unit\Gateway\Request;
 
-use Magento\BraintreeTwo\Gateway\Request\CustomerDataBuilder;
+use Magento\Braintree\Gateway\Request\CustomerDataBuilder;
 use Magento\Payment\Gateway\Data\PaymentDataObjectInterface;
 use Magento\Payment\Gateway\Data\OrderAdapterInterface;
 use Magento\Payment\Gateway\Data\AddressAdapterInterface;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 
 /**
  * Class CustomerDataBuilderTest
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Request/KountPaymentDataBuilderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/KountPaymentDataBuilderTest.php
similarity index 89%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Request/KountPaymentDataBuilderTest.php
rename to app/code/Magento/Braintree/Test/Unit/Gateway/Request/KountPaymentDataBuilderTest.php
index 9c455d2bcb8b950d59b2e64bbea6f59c38f757f6..85be34d04032c83644b27649c60fa109f1da6e9f 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Request/KountPaymentDataBuilderTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/KountPaymentDataBuilderTest.php
@@ -3,19 +3,19 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Gateway\Request;
+namespace Magento\Braintree\Test\Unit\Gateway\Request;
 
 use Magento\Sales\Model\Order\Payment;
-use Magento\BraintreeTwo\Gateway\Config\Config;
-use Magento\BraintreeTwo\Observer\DataAssignObserver;
+use Magento\Braintree\Gateway\Config\Config;
+use Magento\Braintree\Observer\DataAssignObserver;
 use Magento\Payment\Gateway\Data\PaymentDataObjectInterface;
-use Magento\BraintreeTwo\Gateway\Request\KountPaymentDataBuilder;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Request\KountPaymentDataBuilder;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 
 /**
  * Class KountPaymentDataBuilderTest
  *
- * @see \Magento\BraintreeTwo\Gateway\Request\KountPaymentDataBuilder
+ * @see \Magento\Braintree\Gateway\Request\KountPaymentDataBuilder
  */
 class KountPaymentDataBuilderTest extends \PHPUnit_Framework_TestCase
 {
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Request/PaymentDataBuilderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/PaymentDataBuilderTest.php
similarity index 94%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Request/PaymentDataBuilderTest.php
rename to app/code/Magento/Braintree/Test/Unit/Gateway/Request/PaymentDataBuilderTest.php
index 1fd03a16ab47e38a11c1c4e7bb92a687ecee3a72..571512769ce0459a02fdaed753ed0e6603ad8ea5 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Request/PaymentDataBuilderTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/PaymentDataBuilderTest.php
@@ -3,12 +3,12 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Gateway\Request;
+namespace Magento\Braintree\Test\Unit\Gateway\Request;
 
-use Magento\BraintreeTwo\Gateway\Config\Config;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
-use Magento\BraintreeTwo\Gateway\Request\PaymentDataBuilder;
-use Magento\BraintreeTwo\Observer\DataAssignObserver;
+use Magento\Braintree\Gateway\Config\Config;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Request\PaymentDataBuilder;
+use Magento\Braintree\Observer\DataAssignObserver;
 use Magento\Payment\Gateway\Data\OrderAdapterInterface;
 use Magento\Payment\Gateway\Data\PaymentDataObjectInterface;
 use Magento\Sales\Model\Order\Payment;
diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/RefundDataBuilderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/RefundDataBuilderTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..5715f9d67605402fca8b469f81ba9d55726caa14
--- /dev/null
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/RefundDataBuilderTest.php
@@ -0,0 +1,142 @@
+<?php
+/**
+ * Copyright © 2015 Magento. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+namespace Magento\Braintree\Test\Unit\Gateway\Request;
+
+use Magento\Braintree\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Request\PaymentDataBuilder;
+use Magento\Braintree\Gateway\Request\RefundDataBuilder;
+use Magento\Payment\Gateway\Data\PaymentDataObjectInterface;
+use Magento\Sales\Api\Data\TransactionInterface;
+use Magento\Sales\Model\Order\Payment;
+
+class RefundDataBuilderTest extends \PHPUnit_Framework_TestCase
+{
+    /**
+     * @var SubjectReader | \PHPUnit_Framework_MockObject_MockObject
+     */
+    private $subjectReader;
+
+    /**
+     * @var RefundDataBuilder
+     */
+    private $dataBuilder;
+
+    public function setUp()
+    {
+        $this->subjectReader = $this->getMockBuilder(
+            SubjectReader::class
+        )->disableOriginalConstructor()
+            ->getMock();
+
+        $this->dataBuilder = new RefundDataBuilder($this->subjectReader);
+    }
+
+    public function testBuild()
+    {
+        $paymentDO = $this->getMock(PaymentDataObjectInterface::class);
+        $paymentModel = $this->getMockBuilder(
+            Payment::class
+        )->disableOriginalConstructor()
+            ->getMock();
+
+        $buildSubject = ['payment' => $paymentDO, 'amount' => 12.358];
+        $transactionId = 'xsd7n';
+
+        $this->subjectReader->expects(static::once())
+            ->method('readPayment')
+            ->with($buildSubject)
+            ->willReturn($paymentDO);
+        $paymentDO->expects(static::once())
+            ->method('getPayment')
+            ->willReturn($paymentModel);
+        $paymentModel->expects(static::once())
+            ->method('getParentTransactionId')
+            ->willReturn($transactionId);
+        $this->subjectReader->expects(static::once())
+            ->method('readAmount')
+            ->with($buildSubject)
+            ->willReturn($buildSubject['amount']);
+
+        static::assertEquals(
+            [
+                'transaction_id' => $transactionId,
+                PaymentDataBuilder::AMOUNT => '12.36'
+            ],
+            $this->dataBuilder->build($buildSubject)
+        );
+    }
+
+    public function testBuildNullAmount()
+    {
+        $paymentDO = $this->getMock(PaymentDataObjectInterface::class);
+        $paymentModel = $this->getMockBuilder(
+            Payment::class
+        )->disableOriginalConstructor()
+            ->getMock();
+
+        $buildSubject = ['payment' => $paymentDO];
+        $transactionId = 'xsd7n';
+
+        $this->subjectReader->expects(static::once())
+            ->method('readPayment')
+            ->with($buildSubject)
+            ->willReturn($paymentDO);
+        $paymentDO->expects(static::once())
+            ->method('getPayment')
+            ->willReturn($paymentModel);
+        $paymentModel->expects(static::once())
+            ->method('getParentTransactionId')
+            ->willReturn($transactionId);
+        $this->subjectReader->expects(static::once())
+            ->method('readAmount')
+            ->with($buildSubject)
+            ->willThrowException(new \InvalidArgumentException());
+
+        static::assertEquals(
+            [
+                'transaction_id' => $transactionId,
+                PaymentDataBuilder::AMOUNT => null
+            ],
+            $this->dataBuilder->build($buildSubject)
+        );
+    }
+
+    public function testBuildCutOffLegacyTransactionIdPostfix()
+    {
+        $paymentDO = $this->getMock(PaymentDataObjectInterface::class);
+        $paymentModel = $this->getMockBuilder(
+            Payment::class
+        )->disableOriginalConstructor()
+            ->getMock();
+
+        $buildSubject = ['payment' => $paymentDO];
+        $legacyTxnId = 'xsd7n-' . TransactionInterface::TYPE_CAPTURE;
+        $transactionId = 'xsd7n';
+
+        $this->subjectReader->expects(static::once())
+            ->method('readPayment')
+            ->with($buildSubject)
+            ->willReturn($paymentDO);
+        $paymentDO->expects(static::once())
+            ->method('getPayment')
+            ->willReturn($paymentModel);
+        $paymentModel->expects(static::once())
+            ->method('getParentTransactionId')
+            ->willReturn($legacyTxnId);
+        $this->subjectReader->expects(static::once())
+            ->method('readAmount')
+            ->with($buildSubject)
+            ->willThrowException(new \InvalidArgumentException());
+
+        static::assertEquals(
+            [
+                'transaction_id' => $transactionId,
+                PaymentDataBuilder::AMOUNT => null
+            ],
+            $this->dataBuilder->build($buildSubject)
+        );
+    }
+}
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Request/SettlementDataBuilderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/SettlementDataBuilderTest.php
similarity index 79%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Request/SettlementDataBuilderTest.php
rename to app/code/Magento/Braintree/Test/Unit/Gateway/Request/SettlementDataBuilderTest.php
index 0dcd195a7e0dfff721a167bd8284e8af0fafce77..e33302f7256b33a48b2aa48a00bf3a2a76c8a53a 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Request/SettlementDataBuilderTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/SettlementDataBuilderTest.php
@@ -3,9 +3,9 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Gateway\Request;
+namespace Magento\Braintree\Test\Unit\Gateway\Request;
 
-use Magento\BraintreeTwo\Gateway\Request\SettlementDataBuilder;
+use Magento\Braintree\Gateway\Request\SettlementDataBuilder;
 
 class SettlementDataBuilderTest extends \PHPUnit_Framework_TestCase
 {
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Request/ThreeDSecureDataBuilderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/ThreeDSecureDataBuilderTest.php
similarity index 94%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Request/ThreeDSecureDataBuilderTest.php
rename to app/code/Magento/Braintree/Test/Unit/Gateway/Request/ThreeDSecureDataBuilderTest.php
index de7ee0e9f28728850bb5c1fc11d075ae4ab46dfe..bd9440a275843ad8bce130b13b386beeb01c63de 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Request/ThreeDSecureDataBuilderTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/ThreeDSecureDataBuilderTest.php
@@ -3,14 +3,14 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Gateway\Request;
+namespace Magento\Braintree\Test\Unit\Gateway\Request;
 
-use Magento\BraintreeTwo\Gateway\Config\Config;
-use Magento\BraintreeTwo\Gateway\Request\ThreeDSecureDataBuilder;
+use Magento\Braintree\Gateway\Config\Config;
+use Magento\Braintree\Gateway\Request\ThreeDSecureDataBuilder;
 use Magento\Payment\Gateway\Data\PaymentDataObjectInterface;
 use Magento\Payment\Gateway\Data\Order\OrderAdapter;
 use Magento\Payment\Gateway\Data\Order\AddressAdapter;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 
 /**
  * Class ThreeDSecureDataBuilderTest
@@ -76,7 +76,7 @@ class ThreeDSecureDataBuilderTest extends \PHPUnit_Framework_TestCase
      * @param string $countryId
      * @param array $countries
      * @param array $expected
-     * @covers \Magento\BraintreeTwo\Gateway\Request\ThreeDSecureDataBuilder::build
+     * @covers \Magento\Braintree\Gateway\Request\ThreeDSecureDataBuilder::build
      * @dataProvider buildDataProvider
      */
     public function testBuild($verify, $thresholdAmount, $countryId, array $countries, array $expected)
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Request/VaultCaptureDataBuilderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/VaultCaptureDataBuilderTest.php
similarity index 88%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Request/VaultCaptureDataBuilderTest.php
rename to app/code/Magento/Braintree/Test/Unit/Gateway/Request/VaultCaptureDataBuilderTest.php
index 716250016327c17c587b9b4ed14ecd1d33915794..79cae863ec6cb50f7121b67ba944397866397482 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Request/VaultCaptureDataBuilderTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/VaultCaptureDataBuilderTest.php
@@ -3,14 +3,14 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Gateway\Request;
+namespace Magento\Braintree\Test\Unit\Gateway\Request;
 
-use Magento\BraintreeTwo\Gateway\Config\Config;
-use Magento\BraintreeTwo\Gateway\Request\VaultCaptureDataBuilder;
-use Magento\BraintreeTwo\Observer\DataAssignObserver;
+use Magento\Braintree\Gateway\Config\Config;
+use Magento\Braintree\Gateway\Request\VaultCaptureDataBuilder;
+use Magento\Braintree\Observer\DataAssignObserver;
 use Magento\Payment\Gateway\Data\PaymentDataObjectInterface;
 use Magento\Sales\Model\Order\Payment;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 use Magento\Vault\Model\PaymentToken;
 use Magento\Sales\Api\Data\OrderPaymentExtension;
 
@@ -54,7 +54,7 @@ class VaultCaptureDataBuilderTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * \Magento\BraintreeTwo\Gateway\Request\VaultCaptureDataBuilder::build
+     * \Magento\Braintree\Gateway\Request\VaultCaptureDataBuilder::build
      */
     public function testBuild()
     {
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Request/VaultDataBuilderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/VaultDataBuilderTest.php
similarity index 82%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Request/VaultDataBuilderTest.php
rename to app/code/Magento/Braintree/Test/Unit/Gateway/Request/VaultDataBuilderTest.php
index 654b599fa3f0e02222568ec04c7ed45a639abb52..42996c7a9412088071928ff451f05095f3c56613 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Request/VaultDataBuilderTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/VaultDataBuilderTest.php
@@ -3,9 +3,9 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Gateway\Request;
+namespace Magento\Braintree\Test\Unit\Gateway\Request;
 
-use Magento\BraintreeTwo\Gateway\Request\VaultDataBuilder;
+use Magento\Braintree\Gateway\Request\VaultDataBuilder;
 
 class VaultDataBuilderTest extends \PHPUnit_Framework_TestCase
 {
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Response/CardDetailsHandlerTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/CardDetailsHandlerTest.php
similarity index 89%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Response/CardDetailsHandlerTest.php
rename to app/code/Magento/Braintree/Test/Unit/Gateway/Response/CardDetailsHandlerTest.php
index 5b65be7de10aeeeb1478eb717bba1556a50723a3..dd8604a92a55331e298447c2e698880e9678ab33 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Response/CardDetailsHandlerTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/CardDetailsHandlerTest.php
@@ -3,15 +3,15 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Gateway\Response;
+namespace Magento\Braintree\Test\Unit\Gateway\Response;
 
 use Braintree\Result\Successful;
 use Braintree\Transaction;
-use Magento\BraintreeTwo\Gateway\Response\CardDetailsHandler;
+use Magento\Braintree\Gateway\Response\CardDetailsHandler;
 use Magento\Payment\Gateway\Data\PaymentDataObject;
 use Magento\Sales\Model\Order\Payment;
-use Magento\BraintreeTwo\Gateway\Config\Config;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Config\Config;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 
 /**
  * Class CardDetailsHandlerTest
@@ -19,7 +19,7 @@ use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
 class CardDetailsHandlerTest extends \PHPUnit_Framework_TestCase
 {
     /**
-     * @var \Magento\BraintreeTwo\Gateway\Response\CardDetailsHandler
+     * @var \Magento\Braintree\Gateway\Response\CardDetailsHandler
      */
     private $cardHandler;
 
@@ -29,7 +29,7 @@ class CardDetailsHandlerTest extends \PHPUnit_Framework_TestCase
     private $payment;
 
     /**
-     * @var \Magento\BraintreeTwo\Gateway\Config\Config|\PHPUnit_Framework_MockObject_MockObject
+     * @var \Magento\Braintree\Gateway\Config\Config|\PHPUnit_Framework_MockObject_MockObject
      */
     private $config;
 
@@ -49,7 +49,7 @@ class CardDetailsHandlerTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Gateway\Response\CardDetailsHandler::handle
+     * @covers \Magento\Braintree\Gateway\Response\CardDetailsHandler::handle
      */
     public function testHandle()
     {
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Response/PayPalDetailsHandlerTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/PayPalDetailsHandlerTest.php
similarity index 91%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Response/PayPalDetailsHandlerTest.php
rename to app/code/Magento/Braintree/Test/Unit/Gateway/Response/PayPalDetailsHandlerTest.php
index ab4d569604994cf114e08ee03d4c7bbf3e156871..bbabeb31e596d1eb4caf49fb347773d5fdcfc84c 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Response/PayPalDetailsHandlerTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/PayPalDetailsHandlerTest.php
@@ -3,14 +3,14 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Gateway\Response;
+namespace Magento\Braintree\Test\Unit\Gateway\Response;
 
 use Braintree\Transaction;
-use Magento\BraintreeTwo\Gateway\Response\PayPalDetailsHandler;
+use Magento\Braintree\Gateway\Response\PayPalDetailsHandler;
 use Magento\Payment\Gateway\Data\PaymentDataObject;
 use Magento\Sales\Model\Order;
 use Magento\Sales\Model\Order\Payment;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 use PHPUnit_Framework_MockObject_MockObject as MockObject;
 
 /**
@@ -49,7 +49,7 @@ class PayPalDetailsHandlerTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Gateway\Response\PayPalDetailsHandler::handle
+     * @covers \Magento\Braintree\Gateway\Response\PayPalDetailsHandler::handle
      */
     public function testHandle()
     {
@@ -96,7 +96,6 @@ class PayPalDetailsHandlerTest extends \PHPUnit_Framework_TestCase
         return $mock;
     }
 
-
     /**
      * Create Braintree transaction
      * @return Transaction
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Response/PaymentDetailsHandlerTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/PaymentDetailsHandlerTest.php
similarity index 90%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Response/PaymentDetailsHandlerTest.php
rename to app/code/Magento/Braintree/Test/Unit/Gateway/Response/PaymentDetailsHandlerTest.php
index ea44967c3c182b772d183e5ad8899431eab97dc2..cabad447be4989abdb47f58d28bd968b6d0e971e 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Response/PaymentDetailsHandlerTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/PaymentDetailsHandlerTest.php
@@ -3,14 +3,14 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Gateway\Response;
+namespace Magento\Braintree\Test\Unit\Gateway\Response;
 
 use Braintree\Transaction;
-use Magento\BraintreeTwo\Gateway\Response\PaymentDetailsHandler;
+use Magento\Braintree\Gateway\Response\PaymentDetailsHandler;
 use Magento\Payment\Gateway\Data\PaymentDataObject;
 use Magento\Sales\Model\Order;
 use Magento\Sales\Model\Order\Payment;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 use PHPUnit_Framework_MockObject_MockObject as MockObject;
 
 /**
@@ -21,7 +21,7 @@ class PaymentDetailsHandlerTest extends \PHPUnit_Framework_TestCase
     const TRANSACTION_ID = '432erwwe';
 
     /**
-     * @var \Magento\BraintreeTwo\Gateway\Response\PaymentDetailsHandler
+     * @var \Magento\Braintree\Gateway\Response\PaymentDetailsHandler
      */
     private $paymentHandler;
 
@@ -60,7 +60,7 @@ class PaymentDetailsHandlerTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Gateway\Response\PaymentDetailsHandler::handle
+     * @covers \Magento\Braintree\Gateway\Response\PaymentDetailsHandler::handle
      */
     public function testHandle()
     {
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Response/RiskDataHandlerTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/RiskDataHandlerTest.php
similarity index 92%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Response/RiskDataHandlerTest.php
rename to app/code/Magento/Braintree/Test/Unit/Gateway/Response/RiskDataHandlerTest.php
index c4aa2e4e251bbb451ef18880e95d953217a95ddc..f613eae8da27d09401a32a04328a184260bfbbc0 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Response/RiskDataHandlerTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/RiskDataHandlerTest.php
@@ -3,19 +3,19 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Gateway\Response;
+namespace Magento\Braintree\Test\Unit\Gateway\Response;
 
 use Braintree\RiskData;
 use Braintree\Transaction;
 use Magento\Sales\Model\Order\Payment;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
-use Magento\BraintreeTwo\Gateway\Response\RiskDataHandler;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Response\RiskDataHandler;
 use Magento\Payment\Gateway\Data\PaymentDataObjectInterface;
 
 /**
  * Class RiskDataHandlerTest
  *
- * @see \Magento\BraintreeTwo\Gateway\Response\RiskDataHandler
+ * @see \Magento\Braintree\Gateway\Response\RiskDataHandler
  */
 class RiskDataHandlerTest extends \PHPUnit_Framework_TestCase
 {
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Response/ThreeDSecureDetailsHandlerTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/ThreeDSecureDetailsHandlerTest.php
similarity index 90%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Response/ThreeDSecureDetailsHandlerTest.php
rename to app/code/Magento/Braintree/Test/Unit/Gateway/Response/ThreeDSecureDetailsHandlerTest.php
index 38b1849761ac6499f4fca68ae4ad2f2e29a5d51b..1f9bcfb06d700e33ebf55b45e3c36a3f69c248ca 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Response/ThreeDSecureDetailsHandlerTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/ThreeDSecureDetailsHandlerTest.php
@@ -3,14 +3,14 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Gateway\Response;
+namespace Magento\Braintree\Test\Unit\Gateway\Response;
 
 use Braintree\Transaction;
-use Magento\BraintreeTwo\Gateway\Response\ThreeDSecureDetailsHandler;
+use Magento\Braintree\Gateway\Response\ThreeDSecureDetailsHandler;
 use Magento\Payment\Gateway\Data\PaymentDataObject;
 use Magento\Sales\Model\Order;
 use Magento\Sales\Model\Order\Payment;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 use PHPUnit_Framework_MockObject_MockObject as MockObject;
 
 /**
@@ -22,7 +22,7 @@ class ThreeDSecureDetailsHandlerTest extends \PHPUnit_Framework_TestCase
     const TRANSACTION_ID = '432er5ww3e';
 
     /**
-     * @var \Magento\BraintreeTwo\Gateway\Response\ThreeDSecureDetailsHandler
+     * @var \Magento\Braintree\Gateway\Response\ThreeDSecureDetailsHandler
      */
     private $handler;
 
@@ -55,7 +55,7 @@ class ThreeDSecureDetailsHandlerTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Gateway\Response\ThreeDSecureDetailsHandler::handle
+     * @covers \Magento\Braintree\Gateway\Response\ThreeDSecureDetailsHandler::handle
      */
     public function testHandle()
     {
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Response/TransactionIdHandlerTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/TransactionIdHandlerTest.php
similarity index 91%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Response/TransactionIdHandlerTest.php
rename to app/code/Magento/Braintree/Test/Unit/Gateway/Response/TransactionIdHandlerTest.php
index 92665735dec22f0e4b0a7f533cfc0425347954cc..862277deed95429ba95b0a230abd327e73b81261 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Response/TransactionIdHandlerTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/TransactionIdHandlerTest.php
@@ -3,10 +3,10 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Gateway\Response;
+namespace Magento\Braintree\Test\Unit\Gateway\Response;
 
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
-use Magento\BraintreeTwo\Gateway\Response\TransactionIdHandler;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Response\TransactionIdHandler;
 use Magento\Payment\Gateway\Data\PaymentDataObjectInterface;
 use Magento\Sales\Model\Order\Payment;
 
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Response/VaultDetailsHandlerTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/VaultDetailsHandlerTest.php
similarity index 94%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Response/VaultDetailsHandlerTest.php
rename to app/code/Magento/Braintree/Test/Unit/Gateway/Response/VaultDetailsHandlerTest.php
index 3ab67ddcfbb2e7ee9dd7e359a23113d7bc18a016..99e615a8906c4ab499c6bd383e39ee4f6ad40ffb 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Response/VaultDetailsHandlerTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/VaultDetailsHandlerTest.php
@@ -3,11 +3,11 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Gateway\Response;
+namespace Magento\Braintree\Test\Unit\Gateway\Response;
 
 use Braintree\Transaction;
 use Braintree\Transaction\CreditCardDetails;
-use Magento\BraintreeTwo\Gateway\Response\VaultDetailsHandler;
+use Magento\Braintree\Gateway\Response\VaultDetailsHandler;
 use Magento\Framework\DataObject;
 use Magento\Payment\Gateway\Data\PaymentDataObject;
 use Magento\Sales\Api\Data\OrderPaymentExtensionInterfaceFactory;
@@ -16,9 +16,9 @@ use Magento\Sales\Model\Order;
 use Magento\Sales\Model\Order\Payment;
 use Magento\Vault\Api\Data\PaymentTokenInterface;
 use Magento\Vault\Api\Data\PaymentTokenInterfaceFactory;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 use PHPUnit_Framework_MockObject_MockObject as MockObject;
-use Magento\BraintreeTwo\Gateway\Config\Config;
+use Magento\Braintree\Gateway\Config\Config;
 
 /**
  * VaultDetailsHandler Test
@@ -30,7 +30,7 @@ class VaultDetailsHandlerTest extends \PHPUnit_Framework_TestCase
     const TRANSACTION_ID = '432erwwe';
 
     /**
-     * @var \Magento\BraintreeTwo\Gateway\Response\PaymentDetailsHandler
+     * @var \Magento\Braintree\Gateway\Response\PaymentDetailsHandler
      */
     private $paymentHandler;
 
@@ -131,7 +131,7 @@ class VaultDetailsHandlerTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Gateway\Response\VaultDetailsHandler::handle
+     * @covers \Magento\Braintree\Gateway\Response\VaultDetailsHandler::handle
      */
     public function testHandle()
     {
@@ -163,7 +163,6 @@ class VaultDetailsHandlerTest extends \PHPUnit_Framework_TestCase
             ->method('setExpiresAt')
             ->with('2022-01-01 00:00:00');
 
-
         $this->paymentHandler->handle($subject, $response);
         $this->assertSame($this->paymentToken, $this->payment->getExtensionAttributes()->getVaultPaymentToken());
     }
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Response/VoidHandlerTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/VoidHandlerTest.php
similarity index 91%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Response/VoidHandlerTest.php
rename to app/code/Magento/Braintree/Test/Unit/Gateway/Response/VoidHandlerTest.php
index 544a8470ef5215a0674eb793cb5d2508642cc3a1..bdda2e16f49e754313a2cb9d9c1c614999da759c 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Response/VoidHandlerTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/VoidHandlerTest.php
@@ -3,10 +3,10 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Gateway\Response;
+namespace Magento\Braintree\Test\Unit\Gateway\Response;
 
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
-use Magento\BraintreeTwo\Gateway\Response\VoidHandler;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Response\VoidHandler;
 use Magento\Payment\Gateway\Data\PaymentDataObjectInterface;
 use Magento\Sales\Model\Order\Payment;
 
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Validator/GeneralResponseValidatorTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Validator/GeneralResponseValidatorTest.php
similarity index 94%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Validator/GeneralResponseValidatorTest.php
rename to app/code/Magento/Braintree/Test/Unit/Gateway/Validator/GeneralResponseValidatorTest.php
index 2129f7d949c7befc7010cf058f69ea95b8bc4ad3..8842d3cf495c3fd40e031fd03c97a9a25897febc 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Validator/GeneralResponseValidatorTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Validator/GeneralResponseValidatorTest.php
@@ -3,14 +3,14 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Gateway\Validator;
+namespace Magento\Braintree\Test\Unit\Gateway\Validator;
 
 use Braintree\Transaction;
 use Magento\Framework\Phrase;
 use Magento\Payment\Gateway\Validator\ResultInterface;
 use Magento\Payment\Gateway\Validator\ResultInterfaceFactory;
-use Magento\BraintreeTwo\Gateway\Validator\GeneralResponseValidator;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Validator\GeneralResponseValidator;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 
 class GeneralResponseValidatorTest extends \PHPUnit_Framework_TestCase
 {
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Validator/PaymentNonceResponseValidatorTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Validator/PaymentNonceResponseValidatorTest.php
similarity index 91%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Validator/PaymentNonceResponseValidatorTest.php
rename to app/code/Magento/Braintree/Test/Unit/Gateway/Validator/PaymentNonceResponseValidatorTest.php
index 3f82aca1602443fcc49ce0d2a659604b473dd1ad..d74aa7c251f7c9b5bd1705dc979166b1eedd57a6 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Validator/PaymentNonceResponseValidatorTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Validator/PaymentNonceResponseValidatorTest.php
@@ -3,13 +3,13 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Gateway\Validator;
+namespace Magento\Braintree\Test\Unit\Gateway\Validator;
 
 use Braintree\Transaction;
-use Magento\BraintreeTwo\Gateway\Validator\PaymentNonceResponseValidator;
+use Magento\Braintree\Gateway\Validator\PaymentNonceResponseValidator;
 use Magento\Payment\Gateway\Validator\ResultInterface;
 use Magento\Payment\Gateway\Validator\ResultInterfaceFactory;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 
 /**
  * Class PaymentNonceResponseValidatorTest
@@ -49,7 +49,7 @@ class PaymentNonceResponseValidatorTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Gateway\Validator\PaymentNonceResponseValidator::validate
+     * @covers \Magento\Braintree\Gateway\Validator\PaymentNonceResponseValidator::validate
      */
     public function testFailedValidate()
     {
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Validator/ResponseValidatorTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Validator/ResponseValidatorTest.php
similarity index 96%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Validator/ResponseValidatorTest.php
rename to app/code/Magento/Braintree/Test/Unit/Gateway/Validator/ResponseValidatorTest.php
index 0bdebbbeb96a8c509add759523e3a8764b507419..bd8cf2a1bca6fdec30da0b1f27884f0c18ad5e9a 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Validator/ResponseValidatorTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Validator/ResponseValidatorTest.php
@@ -3,14 +3,14 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Gateway\Validator;
+namespace Magento\Braintree\Test\Unit\Gateway\Validator;
 
 use Braintree\Transaction;
 use Magento\Framework\Phrase;
 use Magento\Payment\Gateway\Validator\ResultInterface;
 use Magento\Payment\Gateway\Validator\ResultInterfaceFactory;
-use Magento\BraintreeTwo\Gateway\Validator\ResponseValidator;
-use Magento\BraintreeTwo\Gateway\Helper\SubjectReader;
+use Magento\Braintree\Gateway\Validator\ResponseValidator;
+use Magento\Braintree\Gateway\Helper\SubjectReader;
 
 /**
  * Class ResponseValidatorTest
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Helper/CcTypeTest.php b/app/code/Magento/Braintree/Test/Unit/Helper/CcTypeTest.php
similarity index 76%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Helper/CcTypeTest.php
rename to app/code/Magento/Braintree/Test/Unit/Helper/CcTypeTest.php
index 3e4335499bee8e103fa5964e51c9fe0fad1da8f8..ac61ced5216c8946210309399b6be895ae2f1f59 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Helper/CcTypeTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Helper/CcTypeTest.php
@@ -3,10 +3,10 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Helper;
+namespace Magento\Braintree\Test\Unit\Helper;
 
-use Magento\BraintreeTwo\Helper\CcType;
-use Magento\BraintreeTwo\Model\Adminhtml\Source\CcType as CcTypeSource;
+use Magento\Braintree\Helper\CcType;
+use Magento\Braintree\Model\Adminhtml\Source\CcType as CcTypeSource;
 use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
 
 /**
@@ -21,11 +21,11 @@ class CcTypeTest extends \PHPUnit_Framework_TestCase
     private $objectManager;
 
     /**
-     * @var \Magento\BraintreeTwo\Helper\CcType
+     * @var \Magento\Braintree\Helper\CcType
      */
     private $helper;
 
-    /** @var \Magento\BraintreeTwo\Model\Adminhtml\Source\CcType|\PHPUnit_Framework_MockObject_MockObject */
+    /** @var \Magento\Braintree\Model\Adminhtml\Source\CcType|\PHPUnit_Framework_MockObject_MockObject */
     private $ccTypeSource;
 
     protected function setUp()
@@ -43,7 +43,7 @@ class CcTypeTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Helper\CcType::getCcTypes
+     * @covers \Magento\Braintree\Helper\CcType::getCcTypes
      */
     public function testGetCcTypes()
     {
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Helper/CountryTest.php b/app/code/Magento/Braintree/Test/Unit/Helper/CountryTest.php
similarity index 92%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Helper/CountryTest.php
rename to app/code/Magento/Braintree/Test/Unit/Helper/CountryTest.php
index a2dcaba980762669dd69ee9d4c502e2ec38a5349..fe557d6f335617c00cf41dd22b64c9968bbd1946 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Helper/CountryTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Helper/CountryTest.php
@@ -3,9 +3,9 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Helper;
+namespace Magento\Braintree\Test\Unit\Helper;
 
-use Magento\BraintreeTwo\Helper\Country;
+use Magento\Braintree\Helper\Country;
 use Magento\Directory\Model\ResourceModel\Country\CollectionFactory;
 use Magento\Directory\Model\ResourceModel\Country\Collection;
 use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
@@ -21,7 +21,7 @@ class CountryTest extends \PHPUnit_Framework_TestCase
     private $collection;
 
     /**
-     * @var \Magento\BraintreeTwo\Helper\Country
+     * @var \Magento\Braintree\Helper\Country
      */
     private $helper;
 
@@ -42,7 +42,7 @@ class CountryTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Helper\Country::getCountries
+     * @covers \Magento\Braintree\Helper\Country::getCountries
      */
     public function testGetCountries()
     {
diff --git a/app/code/Magento/Braintree/Test/Unit/Helper/CreateorderTest.php b/app/code/Magento/Braintree/Test/Unit/Helper/CreateorderTest.php
deleted file mode 100644
index 0e67b243fabcb7e62a3670730a711395e4c9f48f..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Helper/CreateorderTest.php
+++ /dev/null
@@ -1,199 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Test\Unit\Helper;
-
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
-use Magento\Braintree\Model\Adapter\BraintreeCustomer;
-
-/**
- * Test for Createorder
- */
-class CreateorderTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager
-     */
-    private $objectManager;
-
-    /**
-     * @var \Magento\Braintree\Helper\Createorder
-     */
-    private $model;
-
-    /**
-     * @var \Magento\Braintree\Helper\Data
-     */
-    private $paymentHelper;
-
-    /**
-     * @var \Magento\Backend\Model\Session\Quote
-     */
-    private $sessionQuote;
-
-    /**
-     * @var \Magento\Braintree\Model\Adapter\BraintreeCustomer
-     */
-    private $braintreeCustomerAdapter;
-
-    /**
-     * @var \Magento\Framework\App\Config
-     */
-    protected $scopeConfig;
-
-    /**
-     * test setup
-     */
-    public function setUp()
-    {
-
-        $this->paymentHelper = $this->getMockBuilder('\Magento\Braintree\Helper\Data')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->braintreeCustomerAdapter = $this->getMockBuilder('\Magento\Braintree\Model\Adapter\BraintreeCustomer')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->sessionQuote = $this->getMockBuilder('\Magento\Backend\Model\Session\Quote')
-            ->disableOriginalConstructor()
-            ->setMethods(['getStoreId', 'getCustomerId', 'getQuote', 'getBillingAddress'])
-            ->getMock();
-
-        $this->scopeConfig = $this->getMockBuilder('\Magento\Framework\App\Config')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->objectManager = new ObjectManager($this);
-        $this->model = $this->objectManager->getObject(
-            'Magento\Braintree\Helper\Createorder',
-            [
-                'paymentHelper' =>  $this->paymentHelper,
-                'braintreeCustomerAdapter' =>  $this->braintreeCustomerAdapter,
-                'sessionQuote' =>  $this->sessionQuote,
-                'scopeConfig' => $this->scopeConfig,
-            ]
-        );
-    }
-
-    /**
-     * @param array $data
-     * @param boolean|array $expected
-     * @dataProvider getLoggedInCustomerCardsDataProvider
-     */
-    public function testGetLoggedInCustomerCards($data, $expected)
-    {
-
-        $this->sessionQuote->expects($this->once())
-            ->method('getStoreId')
-            ->willReturn(1);
-        $this->scopeConfig->expects($this->any())
-            ->method('getValue')
-            ->willReturn($data['vault']);
-        if ($data['vault']) {
-            $this->sessionQuote->expects($this->any())
-                ->method('getCustomerId')
-                ->willReturn(1);
-
-            $this->paymentHelper->expects($this->any())
-                ->method('generateCustomerId')
-                ->willReturn(1);
-
-            $this->paymentHelper->expects($this->any())
-                ->method('getCcAvailableCardTypes')
-                ->willReturn([
-                    'VI' => "VISA",
-                    'MC' => "MasterCard"
-                ]);
-
-            $this->paymentHelper->expects($this->any())
-                ->method('getCcTypeCodeByName')
-                ->willReturn(count($expected) ? 'VI' : false);
-
-            $ccobj = json_decode(json_encode(['creditCards' => null]));
-            $ccobj->creditCards[] = json_decode(json_encode(['cardType' => 'AE']));
-            $ccobj->creditCards[] = json_decode(json_encode(['cardType' => 'VI']));
-            $ccobj->creditCards[] = json_decode(json_encode(['cardType' => 'MC']));
-
-            $this->braintreeCustomerAdapter->expects($this->any())
-                ->method('find')
-                ->willReturn($ccobj);
-
-            $billing = $this->getMockBuilder('\Magento\Quote\Model\Quote\Address')
-                ->disableOriginalConstructor()
-                ->setMethods(['getCountryId'])
-                ->getMock();
-
-            $billing->expects($this->once())
-                ->method('getCountryId')
-                ->willReturn("US");
-
-            $quote = $this->getMockBuilder('\Magento\Quote\Model\Quote')
-                ->disableOriginalConstructor()
-                ->setMethods(['getBillingAddress'])
-                ->getMock();
-
-            $this->sessionQuote->expects($this->any())
-                ->method('getCustomerEmail')
-                ->willReturn("email@email.com");
-
-            $quote->expects($this->any())
-                ->method('getBillingAddress')
-                ->willReturn($billing);
-
-            $this->sessionQuote->expects($this->any())
-                ->method('getQuote')
-                ->willReturn($quote);
-        }
-
-        $result = $this->model->getLoggedInCustomerCards();
-        $this->assertEquals($expected, $result);
-    }
-
-    /**
-     * @return array
-     */
-    public function getLoggedInCustomerCardsDataProvider()
-    {
-        return [
-                [
-                    'data' => [
-                        'vault' => false
-                    ],
-                    'expected' => [],
-                ],
-                [
-                    'data' => [
-                        'vault' => true
-                    ],
-                    'expected' => [],
-                ],
-                [
-                    'data' => [
-                        'vault' => true
-                    ],
-                    'expected' => [
-                        json_decode(json_encode(['cardType' => 'AE'])),
-                        json_decode(json_encode(['cardType' => 'VI'])),
-                        json_decode(json_encode(['cardType' => 'MC'])),
-                    ],
-                ],
-            ];
-
-    }
-
-    public function testGetMerchantId()
-    {
-        $this->sessionQuote->expects($this->once())
-            ->method('getStoreId')
-            ->willReturn(1);
-        $this->scopeConfig->expects($this->any())
-            ->method('getValue')
-            ->willReturn(1);
-
-        $result = $this->model->getMerchantId();
-        $this->assertEquals(1, $result);
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Helper/DataTest.php b/app/code/Magento/Braintree/Test/Unit/Helper/DataTest.php
deleted file mode 100644
index 2e320929c2a700525678da1b4819a23e0ad4f37f..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Helper/DataTest.php
+++ /dev/null
@@ -1,364 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Test\Unit\Helper;
-
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
-use Magento\Payment\Model\Config as PaymentConfig;
-
-/**
- * Test for Data
- */
-class DataTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager
-     */
-    private $objectManager;
-
-    /**
-     * @var \Magento\Braintree\Helper\Data
-     */
-    private $model;
-
-    /**
-     * @var PaymentConfig
-     */
-    private $paymentConfig;
-
-    /**
-     * @var \Magento\Braintree\Model\Config\Cc
-     */
-    private $braintreeCcConfig;
-
-    /**
-     * @var \Magento\Framework\Stdlib\DateTime
-     */
-    private $dateFormat;
-
-    /**
-     * @var \Magento\Framework\Stdlib\DateTime\DateTime
-     */
-    private $dateTime;
-
-    /**
-     * test setup
-     */
-    public function setUp()
-    {
-
-        $this->paymentConfig = $this->getMockBuilder('\Magento\Payment\Model\Config')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->braintreeCcConfig = $this->getMockBuilder('\Magento\Braintree\Model\Config\Cc')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->dateFormat = $this->getMockBuilder('\Magento\Framework\Stdlib\DateTime')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->dateTime = $this->getMockBuilder('\Magento\Framework\Stdlib\DateTime\DateTime')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->objectManager = new ObjectManager($this);
-        $this->model = $this->objectManager->getObject(
-            'Magento\Braintree\Helper\Data',
-            [
-                'paymentConfig' =>  $this->paymentConfig,
-                'braintreeCcConfig' =>  $this->braintreeCcConfig,
-                'dateFormat' =>  $this->dateFormat,
-                'dateTime' =>  $this->dateTime,
-            ]
-        );
-    }
-
-    /**
-     * @param string $name
-     * @param array $cctypes
-     * @param boolean|string $expected
-     * @dataProvider getCcTypeCodeByNameDataProvider
-     */
-    public function testGetCcTypeCodeByName($name, $cctypes, $expected)
-    {
-
-        $this->paymentConfig->expects($this->any())
-            ->method('getCcTypes')
-            ->willReturn($cctypes);
-
-
-        $result = $this->model->GetCcTypeCodeByName($name);
-        $this->assertEquals($expected, $result);
-    }
-
-    /**
-     * @return array
-     */
-    public function getCcTypeCodeByNameDataProvider()
-    {
-        return [
-                [
-                    'name' => 'DISCOVER',
-                    'cctypes' => [
-                        'VI' => 'VISA',
-                        'MC' => 'MASTERCARD',
-                    ],
-                    'expected' => false,
-                ],
-                [
-                    'name' => 'VISA',
-                    'cctypes' => [
-                        'VI' => 'VISA',
-                        'MC' => 'MASTERCARD',
-                    ],
-                    'expected' => 'VI',
-                ],
-            ];
-
-    }
-
-    /**
-     * @param string $name
-     * @param array $cctypes
-     * @param boolean|string $expected
-     * @dataProvider getCcTypeNameByCodeDataProvider
-     */
-    public function testGetCcTypeNameByCode($name, $cctypes, $expected)
-    {
-
-        $this->paymentConfig->expects($this->any())
-            ->method('getCcTypes')
-            ->willReturn($cctypes);
-
-
-        $result = $this->model->getCcTypeNameByCode($name);
-        $this->assertEquals($expected, $result);
-    }
-
-    /**
-     * @return array
-     */
-    public function getCcTypeNameByCodeDataProvider()
-    {
-        return [
-            [
-                'name' => 'DI',
-                'cctypes' => [
-                    'VI' => 'VISA',
-                    'MC' => 'MASTERCARD',
-                ],
-                'expected' => false,
-            ],
-            [
-                'name' => 'VI',
-                'cctypes' => [
-                    'VI' => 'VISA',
-                    'MC' => 'MASTERCARD',
-                ],
-                'expected' => 'VISA',
-            ],
-        ];
-
-    }
-
-    /**
-     * @param array $cctypes
-     * @param boolean|string $expected
-     * @dataProvider getCcTypesDataProvider
-     */
-    public function testGetCcTypes($cctypes, $expected)
-    {
-        $this->paymentConfig->expects($this->any())
-            ->method('getCcTypes')
-            ->willReturn($cctypes);
-
-        $result = $this->model->getCcTypes();
-        $this->assertEquals($expected, $result);
-    }
-
-    /**
-     * @return array
-     */
-    public function getCcTypesDataProvider()
-    {
-        return [
-            [
-                'cctypes' => null,
-                'expected' => false,
-            ],
-            [
-                'cctypes' => [
-                    'VI' => 'VISA',
-                    'MC' => 'MASTERCARD1',
-                ],
-                'expected' => [
-                    'VI' => 'VISA',
-                    'MC' => 'MASTERCARD1',
-                ],
-            ],
-        ];
-
-    }
-
-    public function testGenerateCustomerId()
-    {
-        $result = $this->model->generateCustomerId(1, "email@email.com");
-        $this->assertEquals(md5("1" . '-' . "email@email.com"), $result);
-    }
-
-
-    public function testClearTransactionId()
-    {
-        $result = $this->model->clearTransactionId(1);
-        $this->assertEquals(1, $result);
-        $result = $this->model->clearTransactionId("1-".\Magento\Sales\Model\Order\Payment\Transaction::TYPE_CAPTURE);
-        $this->assertEquals(1, $result);
-        $result = $this->model->clearTransactionId("1-".\Magento\Sales\Model\Order\Payment\Transaction::TYPE_VOID);
-        $this->assertEquals(1, $result);
-    }
-
-    /**
-     * @param array $data
-     * @param array $expected
-     * @dataProvider getCcAvailableCardTypesDataProvider
-     */
-    public function testGetCcAvailableCardTypes($data, $expected)
-    {
-        $this->braintreeCcConfig->expects($this->any())
-            ->method('getConfigData')
-            ->willReturn($data['cctypes']);
-
-        $this->braintreeCcConfig->expects($this->any())
-            ->method('getCountrySpecificCardTypeConfig')
-            ->willReturn($data['cctypesCountrySpecific']);
-
-        $this->braintreeCcConfig->expects($this->any())
-            ->method('getApplicableCardTypes')
-            ->willReturn($data['applicableCards']);
-
-        $this->paymentConfig->expects($this->any())
-            ->method('getCcTypes')
-            ->willReturn($data['ccTypes']);
-
-
-
-        $result = $this->model->getCcAvailableCardTypes($data['country']);
-        $this->assertEquals($expected, $result);
-    }
-
-    /**
-     * @return array
-     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
-     */
-    public function getCcAvailableCardTypesDataProvider()
-    {
-        return [
-            [
-                'data' => [
-                    'cctypes' => 'AE,MC',
-                    'cctypesCountrySpecific' => [
-                        'US'=> [
-                            'VI'
-                        ]
-                    ],
-                    'applicableCards' => ['VI', 'MC'],
-                    'country' => 'US',
-                    'ccTypes' => [
-                        'AE' => 'American Express',
-                        'VI' => 'Visa',
-                        'MC' => 'MasterCard',
-                    ],
-                ],
-                'expected' => [
-                    'VI' => 'Visa',
-                    'MC' => 'MasterCard',
-                ],
-            ],
-            [
-                'data' => [
-                    'cctypes' => 'AE,MC',
-                    'cctypesCountrySpecific' => [
-                        'US'=> [
-                            'VI'
-                        ]
-                    ],
-                    'applicableCards' => ['VI', 'MC'],
-                    'country' => null,
-                    'ccTypes' => [
-                        'AE' => 'American Express',
-                        'VI' => 'Visa',
-                        'MC' => 'MasterCard',
-                    ],
-                ],
-                'expected' => [
-                    'AE' => 'American Express',
-                    'VI' => 'Visa',
-                    'MC' => 'MasterCard',
-                ],
-            ],
-            [
-                'data' => [
-                    'cctypes' => 'AE,MC',
-                    'cctypesCountrySpecific' => [
-                        'US'=> [
-                            'VI'
-                        ]
-                    ],
-                    'applicableCards' => ['VI', 'MC'],
-                    'country' => 'AG',
-                    'ccTypes' => [
-                        'AE' => 'American Express',
-                        'VI' => 'Visa',
-                        'MC' => 'MasterCard',
-                    ],
-                ],
-                'expected' => [
-                    'VI' => 'Visa',
-                    'MC' => 'MasterCard',
-                ],
-            ],
-            [
-                'data' => [
-                    'cctypes' => 'AE,MC',
-                    'cctypesCountrySpecific' => [
-                        'AG'=> [
-                            'VI'
-                        ]
-                    ],
-                    'applicableCards' => ['VI'],
-                    'country' => 'AG',
-                    'ccTypes' => [
-                        'AE' => 'American Express',
-                        'VI' => 'Visa',
-                        'MC' => 'MasterCard',
-                    ],
-                ],
-                'expected' => [
-                    'VI' => 'Visa',
-                ],
-            ],
-            [
-                'data' => [
-                    'cctypes' => 'AE,MC',
-                    'cctypesCountrySpecific' => [],
-                    'applicableCards' => ['VI'],
-                    'country' => null,
-                    'ccTypes' => [
-                        'AE' => 'American Express',
-                        'VI' => 'Visa',
-                        'MC' => 'MasterCard',
-                    ],
-                ],
-                'expected' => [
-                    'AE' => 'American Express',
-                    'MC' => 'MasterCard',
-                ],
-            ],
-        ];
-
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Helper/ErrorTest.php b/app/code/Magento/Braintree/Test/Unit/Helper/ErrorTest.php
deleted file mode 100644
index 3b54f68cfb82c2d1a26bf6ae6a98ce33ccbd6f83..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Helper/ErrorTest.php
+++ /dev/null
@@ -1,541 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\Braintree\Test\Unit\Helper;
-
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
-use \Braintree_Result_Error;
-
-/**
- * Test for Error
- */
-class ErrorTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager
-     */
-    private $objectManager;
-
-    /**
-     * @var \Magento\Braintree\Helper\Error
-     */
-    private $model;
-
-    /**
-     * test setup
-     */
-    public function setUp()
-    {
-        $this->objectManager = new ObjectManager($this);
-        $this->model = $this->objectManager->getObject(
-            'Magento\Braintree\Helper\Error',
-            [
-            ]
-        );
-    }
-
-    /**
-     * @param array $result
-     * @param boolean $expected
-     * @dataProvider parseBraintreeErrorDataProvider
-     */
-    public function testisparseBraintreeError($result, $expected)
-    {
-        $resultObj = new \Braintree_Result_Error($result);
-        $result = $this->model->parseBraintreeError($resultObj);
-        $this->assertEquals(new \Magento\Framework\Phrase($expected), $result);
-    }
-
-    /**
-     * @return array
-     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
-     */
-    public function parseBraintreeErrorDataProvider()
-    {
-        return [
-            [
-                'result' => [
-                    'errors' =>
-                        [
-                            'errors' => [
-                                [
-                                    'code' => '91564',
-                                    'message' => 'message 1',
-                                ]
-                            ],
-                        ],
-                ],
-                'expected' => 'The processor declined your transaction, please re-enter your payment information',
-            ],
-            [
-                'result' => [
-                    'errors' =>
-                        [
-                            'errors' => [
-                                [
-                                    'code' => '1',
-                                    'message' => 'message 1',
-                                ],
-                                [
-                                    'code' => '2',
-                                    'message' => 'message 2',
-                                ],
-                                [
-                                    'code' => '3',
-                                    'message' => 'message 3',
-                                ],
-                            ],
-                        ],
-                        'message' => "message 1\nmessage 2\nmessage 3",
-                ],
-                'expected' => ' message 1 message 2 message 3',
-            ],
-            [
-                'result' => [
-                    'errors' =>
-                        [
-                            'errors' => [],
-                        ],
-                        'params' =>
-                        [
-                            'transaction' =>
-                                [
-                                    'correlationId' => "e9e070b888210088a98217b8a4fa8e6e",
-                                    'deviceSessionId' => "0ee868ff2ded66e8b09c092c9b3ee3a1",
-                                    'fraudMerchantId' => "600000",
-                                    'type' => "sale",
-                                    'channel' => "Magento Kiwis",
-                                    'orderId' => "000000073",
-                                    'merchantAccountId' => "vr8xr64fvyzngb3j",
-                                    'paymentMethodNonce' => "28581ba3-0ae0-43f6-9eb0-535d0de7c253",
-                                    'options' =>
-                                        [
-                                            'storeInVault' => "false",
-                                            'addBillingAddressToPaymentMethod' => "true",
-                                        ],
-                                        'customerId' => "10fa91e8a97f52743737f97163654e44",
-                                        'creditCard' =>
-                                        [
-                                            'cardholderName' => "Name Lname",
-                                        ],
-                                        'billing' =>
-                                        [
-                                            'firstName' => "Name",
-                                            'lastName' => "Lname",
-                                            'company' => "null",
-                                            'streetAddress' => "130 St",
-                                            'extendedAddress' => "#110",
-                                            'locality' => "Austin",
-                                            'region' => "Texas",
-                                            'postalCode' => "65656",
-                                            'countryCodeAlpha2' => "US",
-                                        ],
-                                        'shipping' =>
-                                        [
-                                            'firstName' => "Name",
-                                            'lastName' => "Lname",
-                                            'company' => "null",
-                                            'streetAddress' => "130 St",
-                                            'extendedAddress' => "#110",
-                                            'locality' => "Austin",
-                                            'region' => "Texas",
-                                            'postalCode' => "65656",
-                                            'countryCodeAlpha2' => "US",
-                                        ],
-                                        'amount' => "1010",
-                                ],
-                        ],
-                        'message' => "Gateway Rejected: fraud",
-                        'transaction' =>
-                        [
-                            'id' => "dtkd8p",
-                            'status' => "gateway_rejected",
-                            'type' => "sale",
-                            'currencyIsoCode' => "USD",
-                            'amount' => "1010.00",
-                            'merchantAccountId' => "vr8xr64fvyzngb3j",
-                            'orderId' => "000000073",
-                            'createdAt' => "DateTime Object",
-                            'date' => "2015-06-17 14:35:51.000000",
-                            'timezone_type' => "3",
-                            'timezone' => "'UTC'",
-                            'customer' =>
-                                [
-                                    'id' => "10fa91e8a97f52743737f97163654e44",
-                                    'firstName' => "crius",
-                                    'lastName' => "party",
-                                    'company' => "null",
-                                    'email' => "partysoft@gmail.com",
-                                    'website' => "null",
-                                    'phone' => "21034 343",
-                                    'fax' => "null",
-                                ],
-                                'billing' =>
-                                [
-                                    'id' => "null",
-                                    'firstName' => "Name",
-                                    'lastName' => "Lname",
-                                    'company' => "null",
-                                    'streetAddress' => "130 St",
-                                    'extendedAddress' => "#110",
-                                    'locality' => "Austin",
-                                    'region' => "Texas",
-                                    'postalCode' => "65656",
-                                    'countryName' => "Canada",
-                                    'countryCodeAlpha2' => "US",
-                                    'countryCodeAlpha3' => "USN",
-                                    'countryCodeNumeric' => "124",
-                                ],
-                                'refundId' => "null",
-                                'refundIds' => [],
-                                'refundedTransactionId' => "null",
-                                'settlementBatchId' => "null",
-                                'shipping' =>
-                                [
-                                    'id' => "null",
-                                    'firstName' => "Name",
-                                    'lastName' => "Lname",
-                                    'company' => "null",
-                                    'streetAddress' => "130 St",
-                                    'extendedAddress' => "#110",
-                                    'locality' => "Austin",
-                                    'region' => "Texas",
-                                    'postalCode' => "65656",
-                                    'countryName' => "Canada",
-                                    'countryCodeAlpha2' => "US",
-                                    'countryCodeAlpha3' => "USN",
-                                    'countryCodeNumeric' => "124",
-                                ],
-                                'customFields' => "null",
-                                'avsErrorResponseCode' => "null",
-                                'avsPostalCodeResponseCode' => "null",
-                                'avsStreetAddressResponseCode' => "null",
-                                'cvvResponseCode' => "null",
-                                'gatewayRejectionReason' => "fraud",
-                                'processorAuthorizationCode' => "null",
-                                'processorResponseCode' => "null",
-                                'processorResponseText' => "Unknown []",
-                                'additionalProcessorResponse' => "null",
-                                'voiceReferralNumber' => "null",
-                                'purchaseOrderNumber' => "null",
-                                'taxAmount' => "null",
-                                'taxExempt' => "null",
-                                'creditCard' =>
-                                    [
-                                    'token' => "null",
-                                    'bin' => "400011",
-                                    'last4' => "1511",
-                                    'cardType' => "Visa",
-                                    'expirationMonth' => "06",
-                                    'expirationYear' => "2015",
-                                    'customerLocation' => "International",
-                                    'cardholderName' => "Name Lname",
-                                    'imageUrl' =>
-                                        "https://assets.braintreegateway.com/payment_method_logo".
-                                        "/visa.png?environment=sandbox",
-                                    'uniqueNumberIdentifier' => "null",
-                                    'prepaid' => "Unknown",
-                                    'healthcare' => "Unknown",
-                                    'debit' => "Unknown",
-                                    'durbinRegulated' => "Unknown",
-                                    'commercial' => "Unknown",
-                                    'payroll' => "Unknown",
-                                    'issuingBank' => "Unknown",
-                                    'countryOfIssuance' => "Unknown",
-                                    'productId' => "Unknown",
-                                    'venmoSdk' => "null",
-                                    ],
-                                    'recurring' => "null",
-                                    'channel' => "Magento Kiwis",
-                                    'paymentInstrumentType' => "credit_card",
-                                    'processorSettlementResponseCode' => "null",
-                                    'processorSettlementResponseText' => "null",
-                                    'threeDSecureInfo' => "null",
-                        ],
-                ],
-                'expected' => 'Transaction declined by gateway: Check card details or try another card',
-            ],
-            [
-                'result' => [
-                    'errors' =>
-                        [
-                            'errors' => [],
-                        ],
-                        'params' =>
-                        [
-                            'transaction' =>
-                                [
-                                    'correlationId' => "e9e070b888210088a98217b8a4fa8e6e",
-                                    'deviceSessionId' => "0ee868ff2ded66e8b09c092c9b3ee3a1",
-                                    'fraudMerchantId' => "600000",
-                                    'type' => "sale",
-                                    'channel' => "Magento Kiwis",
-                                    'orderId' => "000000073",
-                                    'merchantAccountId' => "vr8xr64fvyzngb3j",
-                                    'paymentMethodNonce' => "28581ba3-0ae0-43f6-9eb0-535d0de7c253",
-                                    'options' =>
-                                        [
-                                            'storeInVault' => "false",
-                                            'addBillingAddressToPaymentMethod' => "true",
-                                        ],
-                                        'customerId' => "10fa91e8a97f52743737f97163654e44",
-                                        'creditCard' =>
-                                        [
-                                            'cardholderName' => "Name Lname",
-                                        ],
-                                        'billing' =>
-                                        [
-                                            'firstName' => "Name",
-                                            'lastName' => "Lname",
-                                            'company' => "null",
-                                            'streetAddress' => "130 St",
-                                            'extendedAddress' => "#110",
-                                            'locality' => "Austin",
-                                            'region' => "Texas",
-                                            'postalCode' => "65656",
-                                            'countryCodeAlpha2' => "US",
-                                        ],
-                                        'shipping' =>
-                                        [
-                                            'firstName' => "Name",
-                                            'lastName' => "Lname",
-                                            'company' => "null",
-                                            'streetAddress' => "130 St",
-                                            'extendedAddress' => "#110",
-                                            'locality' => "Austin",
-                                            'region' => "Texas",
-                                            'postalCode' => "65656",
-                                            'countryCodeAlpha2' => "US",
-                                        ],
-                                        'amount' => "1010",
-                                ],
-                        ],
-                        'message' => "Processor Declined: fraud",
-                        'transaction' =>
-                        [
-                            'id' => "dtkd8p",
-                            'status' => "processor_declined",
-                            'type' => "sale",
-                            'currencyIsoCode' => "USD",
-                            'amount' => "1010.00",
-                            'merchantAccountId' => "vr8xr64fvyzngb3j",
-                            'orderId' => "000000073",
-                            'createdAt' => "DateTime Object",
-                            'date' => "2015-06-17 14:35:51.000000",
-                            'timezone_type' => "3",
-                            'timezone' => "'UTC'",
-                            'customer' =>
-                                    [
-                                    'id' => "10fa91e8a97f52743737f97163654e44",
-                                    'firstName' => "crius",
-                                    'lastName' => "party",
-                                    'company' => "null",
-                                    'email' => "partysoft@gmail.com",
-                                    'website' => "null",
-                                    'phone' => "21034 343",
-                                    'fax' => "null",
-                                    ],
-                                    'billing' =>
-                                    [
-                                    'id' => "null",
-                                    'firstName' => "Name",
-                                    'lastName' => "Lname",
-                                    'company' => "null",
-                                    'streetAddress' => "130 St",
-                                    'extendedAddress' => "#110",
-                                    'locality' => "Austin",
-                                    'region' => "Texas",
-                                    'postalCode' => "65656",
-                                    'countryName' => "Canada",
-                                    'countryCodeAlpha2' => "US",
-                                    'countryCodeAlpha3' => "USN",
-                                    'countryCodeNumeric' => "124",
-                                    ],
-                                    'refundId' => "null",
-                                    'refundIds' => [],
-                                    'refundedTransactionId' => "null",
-                                    'settlementBatchId' => "null",
-                                    'shipping' =>
-                                    [
-                                    'id' => "null",
-                                    'firstName' => "Name",
-                                    'lastName' => "Lname",
-                                    'company' => "null",
-                                    'streetAddress' => "130 St",
-                                    'extendedAddress' => "#110",
-                                    'locality' => "Austin",
-                                    'region' => "Texas",
-                                    'postalCode' => "65656",
-                                    'countryName' => "Canada",
-                                    'countryCodeAlpha2' => "US",
-                                    'countryCodeAlpha3' => "USN",
-                                    'countryCodeNumeric' => "124",
-                                    ],
-                                    'customFields' => "null",
-                                    'avsErrorResponseCode' => "null",
-                                    'avsPostalCodeResponseCode' => "null",
-                                    'avsStreetAddressResponseCode' => "null",
-                                    'cvvResponseCode' => "null",
-                                    'gatewayRejectionReason' => "fraud",
-                                    'processorAuthorizationCode' => "null",
-                                    'processorResponseCode' => "2000",
-                                    'processorResponseText' => "Unknown []",
-                                    'additionalProcessorResponse' => "null",
-                                    'voiceReferralNumber' => "null",
-                                    'purchaseOrderNumber' => "null",
-                                    'taxAmount' => "null",
-                                    'taxExempt' => "null",
-                                    'creditCard' =>
-                                    [
-                                        'token' => "null",
-                                        'bin' => "400011",
-                                        'last4' => "1511",
-                                        'cardType' => "Visa",
-                                        'expirationMonth' => "06",
-                                        'expirationYear' => "2015",
-                                        'customerLocation' => "International",
-                                        'cardholderName' => "Name Lname",
-                                        'imageUrl' =>
-                                            "https://assets.braintreegateway.com/payment_method_logo".
-                                            "/visa.png?environment=sandbox",
-                                        'uniqueNumberIdentifier' => "null",
-                                        'prepaid' => "Unknown",
-                                        'healthcare' => "Unknown",
-                                        'debit' => "Unknown",
-                                        'durbinRegulated' => "Unknown",
-                                        'commercial' => "Unknown",
-                                        'payroll' => "Unknown",
-                                        'issuingBank' => "Unknown",
-                                        'countryOfIssuance' => "Unknown",
-                                        'productId' => "Unknown",
-                                        'venmoSdk' => "null",
-                                    ],
-                                    'recurring' => "null",
-                                    'channel' => "Magento Kiwis",
-                                    'paymentInstrumentType' => "credit_card",
-                                    'processorSettlementResponseCode' => "null",
-                                    'processorSettlementResponseText' => "null",
-                                    'threeDSecureInfo' => "null",
-                        ],
-                ],
-                'expected' => 'Transaction declined: Contact your bank or try another card',
-            ]
-        ];
-
-    }
-
-    /**
-     * @param array $result
-     * @param boolean $expected
-     * @dataProvider isCloneUnsuccessfulErrorDataProvider
-     */
-    public function testisCloneUnsuccessfulError($result, $expected)
-    {
-        $resultObj = new \Braintree_Result_Error($result);
-        $resultBool = $this->model->isCloneUnsuccessfulError($resultObj);
-        $this->assertEquals($expected, $resultBool);
-    }
-
-    /**
-     * @return array
-     */
-    public function isCloneUnsuccessfulErrorDataProvider()
-    {
-        return [
-            [
-                'result' => [
-                    'errors' =>
-                        [
-                            'errors' => [],
-                        ],
-                ],
-                'expected' => false,
-            ],
-            [
-                'result' => [
-                    'errors' =>
-                        [
-                            'errors' => [
-                                [
-                                    'code' => 'code'
-                                ]
-                            ],
-                        ],
-                ],
-                'expected' => false,
-            ],
-            [
-                'result' => [
-                    'errors' =>
-                        [
-                            'errors' => [
-                                [
-                                    'code' => '91542'
-                                ]
-                            ],
-                        ],
-                ],
-                'expected' => true,
-            ],
-        ];
-
-    }
-
-    /**
-     * @param array $result
-     * @param boolean $expected
-     * @dataProvider isNonceUsedMoreThanOnceErrorDataProvider
-     */
-    public function testIsNonceUsedMoreThanOnceError($result, $expected)
-    {
-        $resultObj = new \Braintree_Result_Error($result);
-        $resultBool = $this->model->isNonceUsedMoreThanOnceError($resultObj);
-        $this->assertEquals($expected, $resultBool);
-    }
-
-    /**
-     * @return array
-     */
-    public function isNonceUsedMoreThanOnceErrorDataProvider()
-    {
-        return [
-                [
-                    'result' => [
-                        'errors' =>
-                            [
-                                'errors' => [],
-                            ],
-                    ],
-                    'expected' => false,
-                ],
-                [
-                    'result' => [
-                        'errors' =>
-                            [
-                                'errors' => [
-                                    [
-                                        'code' => 'code'
-                                    ]
-                                ],
-                            ],
-                        ],
-                    'expected' => false,
-                ],
-                [
-                    'result' => [
-                        'errors' =>
-                            [
-                                'errors' => [
-                                    [
-                                        'code' => '91564'
-                                    ]
-                                ],
-                            ],
-                    ],
-                    'expected' => true,
-                ],
-            ];
-    }
-}
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Model/Adminhtml/System/Config/CountryCreditCardTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Adminhtml/System/Config/CountryCreditCardTest.php
similarity index 95%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Model/Adminhtml/System/Config/CountryCreditCardTest.php
rename to app/code/Magento/Braintree/Test/Unit/Model/Adminhtml/System/Config/CountryCreditCardTest.php
index 99ed36038929ed35314a5f2d4b60616a343cb97f..0e1660bfb4bf0e754c792c71d207a1563551c4bb 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Model/Adminhtml/System/Config/CountryCreditCardTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Model/Adminhtml/System/Config/CountryCreditCardTest.php
@@ -4,9 +4,9 @@
  * See COPYING.txt for license details.
  */
 
-namespace Magento\BraintreeTwo\Test\Unit\Model\Adminhtml\System\Config;
+namespace Magento\Braintree\Test\Unit\Model\Adminhtml\System\Config;
 
-use Magento\BraintreeTwo\Model\Adminhtml\System\Config\CountryCreditCard;
+use Magento\Braintree\Model\Adminhtml\System\Config\CountryCreditCard;
 use Magento\Framework\Math\Random;
 use Magento\Framework\Model\ResourceModel\AbstractResource;
 use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
@@ -18,7 +18,7 @@ use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
 class CountryCreditCardTest extends \PHPUnit_Framework_TestCase
 {
     /**
-     * @var \Magento\BraintreeTwo\Model\Adminhtml\System\Config\CountryCreditCard
+     * @var \Magento\Braintree\Model\Adminhtml\System\Config\CountryCreditCard
      */
     protected $model;
 
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Model/Adminhtml/System/Config/CountryTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Adminhtml/System/Config/CountryTest.php
similarity index 87%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Model/Adminhtml/System/Config/CountryTest.php
rename to app/code/Magento/Braintree/Test/Unit/Model/Adminhtml/System/Config/CountryTest.php
index 449c07fd80b2d4c8e259e9ed097c4a033f335370..b87d373bf6c7eafe54e9a6a71f5d68761f15d763 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Model/Adminhtml/System/Config/CountryTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Model/Adminhtml/System/Config/CountryTest.php
@@ -3,9 +3,9 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Model\Adminhtml\System\Config;
+namespace Magento\Braintree\Test\Unit\Model\Adminhtml\System\Config;
 
-use Magento\BraintreeTwo\Model\Adminhtml\System\Config\Country;
+use Magento\Braintree\Model\Adminhtml\System\Config\Country;
 use Magento\Directory\Model\ResourceModel\Country\Collection;
 use Magento\Framework\Phrase;
 use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
@@ -17,7 +17,7 @@ use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
 class CountryTest extends \PHPUnit_Framework_TestCase
 {
     /**
-     * @var \Magento\BraintreeTwo\Model\Adminhtml\System\Config\Country
+     * @var \Magento\Braintree\Model\Adminhtml\System\Config\Country
      */
     protected $model;
 
@@ -47,7 +47,7 @@ class CountryTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Model\Adminhtml\System\Config\Country::toOptionArray
+     * @covers \Magento\Braintree\Model\Adminhtml\System\Config\Country::toOptionArray
      */
     public function testToOptionArrayMultiSelect()
     {
@@ -67,7 +67,7 @@ class CountryTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Model\Adminhtml\System\Config\Country::toOptionArray
+     * @covers \Magento\Braintree\Model\Adminhtml\System\Config\Country::toOptionArray
      */
     public function testToOptionArray()
     {
@@ -90,7 +90,7 @@ class CountryTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Model\Adminhtml\System\Config\Country::isCountryRestricted
+     * @covers \Magento\Braintree\Model\Adminhtml\System\Config\Country::isCountryRestricted
      * @param string $countryId
      * @dataProvider countryDataProvider
      */
diff --git a/app/code/Magento/Braintree/Test/Unit/Model/CheckoutTest.php b/app/code/Magento/Braintree/Test/Unit/Model/CheckoutTest.php
deleted file mode 100644
index b3bff2a5a459c476bc6de218d8e4d1a28e6ccf9a..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Model/CheckoutTest.php
+++ /dev/null
@@ -1,362 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Model;
-
-use Magento\Braintree\Model\PaymentMethod\PayPal;
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
-
-/**
- * Class CheckoutTest
- *
- */
-class CheckoutTest extends \PHPUnit_Framework_TestCase
-{
-    const EMAIL = 'joe@example.com';
-    const FIRSTNAME = 'John';
-    const LASTNAME = 'Doe';
-    const SHIPPING_STREET_ADDRESS = '123 Division Street';
-    const SHIPPING_EXTENDED_ADDRESS = 'Apt. #1';
-    const SHIPPING_LOCALITY = 'Chicago';
-    const SHIPPING_REGION = 'IL';
-    const SHIPPING_COUNTRY_CODE = 'US';
-    const SHIPPING_POSTAL_CODE = '60618';
-    const BILLING_LINE1 = '123 Billing Street';
-    const BILLING_LINE2 = 'Apt. #1';
-    const BILLING_CITY = 'Chicago';
-    const BILLING_STATE = 'IL';
-    const BILLING_COUNTRY_CODE = 'US';
-    const BILLING_POSTAL_CODE = '60618';
-
-    /**
-     * @var \Magento\Braintree\Model\Checkout
-     */
-    protected $model;
-
-    /**
-     * @var ObjectManagerHelper
-     */
-    protected $objectManagerHelper;
-
-    /**
-     * @var \Magento\Quote\Model\Quote|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $quoteMock;
-
-    /**
-     * @var \Magento\Quote\Model\Quote\Address|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $billingAddressMock;
-
-    /**
-     * @var \Magento\Quote\Model\Quote\Address|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $shippingAddressMock;
-
-    /**
-     * @var \Magento\Quote\Api\CartRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $quoteRepositoryMock;
-
-    protected function setUp()
-    {
-        $this->setupAddressMock();
-        $this->quoteMock = $this->getMockBuilder('\Magento\Quote\Model\Quote')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->quoteMock->expects($this->any())
-            ->method('getBillingAddress')
-            ->willReturn($this->billingAddressMock);
-        $this->quoteMock->expects($this->any())
-            ->method('getShippingAddress')
-            ->willReturn($this->shippingAddressMock);
-        $this->quoteRepositoryMock = $this->getMock('\Magento\Quote\Api\CartRepositoryInterface');
-        $configMock = $this->getMockBuilder('\Magento\Paypal\Model\Config')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->objectManagerHelper = new ObjectManagerHelper($this);
-        $this->model = $this->objectManagerHelper->getObject(
-            'Magento\Braintree\Model\Checkout',
-            [
-                'quoteRepository' => $this->quoteRepositoryMock,
-                'params' => [
-                    'quote' => $this->quoteMock,
-                    'config' => $configMock,
-                ]
-            ]
-        );
-    }
-
-    protected function setupAddressMock()
-    {
-        $this->billingAddressMock = $this->getMockBuilder('\Magento\Quote\Model\Quote\Address')
-            ->disableOriginalConstructor()
-            ->setMethods(
-                [
-                    'setShouldIgnoreValidation',
-                    'setSameAsBilling',
-                    'getEmail',
-                    'setEmail',
-                    'setPrefix',
-                    'setMiddlename',
-                    'setLastname',
-                    'setFirstname',
-                    'setSuffix',
-                    'setCollectShippingRates',
-                    'setStreet',
-                    'setCity',
-                    'setRegionCode',
-                    'setCountryId',
-                    'setPostcode'
-                ]
-            )->getMock();
-        $this->shippingAddressMock = $this->getMockBuilder('\Magento\Quote\Model\Quote\Address')
-            ->disableOriginalConstructor()
-            ->setMethods(
-                [
-                    'setShouldIgnoreValidation',
-                    'setSameAsBilling',
-                    'setEmail',
-                    'setPrefix',
-                    'setMiddlename',
-                    'setLastname',
-                    'setFirstname',
-                    'setSuffix',
-                    'setCollectShippingRates',
-                    'setStreet',
-                    'setCity',
-                    'setRegionCode',
-                    'setCountryId',
-                    'setPostcode'
-                ]
-            )->getMock();
-    }
-
-    protected function verifyIgnoreAddressValidation()
-    {
-        $this->billingAddressMock->expects($this->once())
-            ->method('setShouldIgnoreValidation')
-            ->with(true);
-
-        $this->billingAddressMock->expects($this->once())
-            ->method('setShouldIgnoreValidation')
-            ->with(true);
-    }
-
-    protected function verifyPaymentInfo()
-    {
-        $paymentMock = $this->getMockBuilder('\Magento\Quote\Model\Quote\Payment')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->quoteMock->expects($this->any())
-            ->method('getPayment')
-            ->willReturn($paymentMock);
-    }
-
-
-    /**
-     * @dataProvider initializeQuoteForReviewDataProvider
-     */
-    public function testInitializeQuoteForReview(
-        $paymentMethodNonce,
-        $details,
-        $expectedShipping,
-        $expectedBilling,
-        $expectedPaymentAdditionalInfo
-    ) {
-        $this->verifyIgnoreAddressValidation();
-        $this->quoteMock->expects($this->any())
-            ->method('getIsVirtual')
-            ->willReturn(false);
-
-        $paymentMock = $this->getMockBuilder('\Magento\Quote\Model\Quote\Payment')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $paymentMock->expects($this->once())
-            ->method('setMethod')
-            ->with(PayPal::METHOD_CODE);
-
-        $this->quoteMock->expects($this->any())
-            ->method('getPayment')
-            ->willReturn($paymentMock);
-
-        foreach ($expectedShipping as $methodName => $value) {
-            $this->shippingAddressMock->expects($this->once())
-                ->method($methodName)
-                ->with($value)
-                ->willReturnSelf();
-        }
-        foreach ($expectedBilling as $methodName => $value) {
-            $this->billingAddressMock->expects($this->once())
-                ->method($methodName)
-                ->with($value)
-                ->willReturnSelf();
-        }
-        $index = 1;
-        foreach ($expectedPaymentAdditionalInfo as $key => $value) {
-            $paymentMock->expects($this->at($index))
-                ->method('setAdditionalInformation')
-                ->with($key, $value);
-            $index++;
-        }
-
-        $this->quoteMock->expects($this->once())
-            ->method('collectTotals');
-        $this->quoteRepositoryMock->expects($this->once())
-            ->method('save')
-            ->with($this->quoteMock);
-
-        $this->model->initializeQuoteForReview($paymentMethodNonce, $details);
-    }
-
-    /**
-     * @return array
-     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
-     */
-    public function initializeQuoteForReviewDataProvider()
-    {
-        return [
-            'with_billing_address' => [
-                'payment_method_nonce' => 'nonce',
-                'details' => [
-                    'email' => self::EMAIL,
-                    'firstName' => self::FIRSTNAME,
-                    'lastName' => self::LASTNAME,
-                    'shippingAddress' => [
-                        'streetAddress' => self::SHIPPING_STREET_ADDRESS,
-                        'extendedAddress' => self::SHIPPING_EXTENDED_ADDRESS,
-                        'locality' => self::SHIPPING_LOCALITY,
-                        'region' => self::SHIPPING_REGION,
-                        'countryCodeAlpha2' => self::SHIPPING_COUNTRY_CODE,
-                        'postalCode' => self::SHIPPING_POSTAL_CODE,
-                    ],
-                    'billingAddress' => [
-                        'line1' => self::BILLING_LINE1,
-                        'line2' => self::BILLING_LINE2,
-                        'city' => self::BILLING_CITY,
-                        'state' => self::BILLING_STATE,
-                        'countryCode' => self::BILLING_COUNTRY_CODE,
-                        'postalCode' => self::BILLING_POSTAL_CODE,
-                    ],
-                ],
-                'expected_shipping' => [
-                    'setFirstname' => self::FIRSTNAME,
-                    'setLastname' => self::LASTNAME,
-                    'setEmail' => self::EMAIL,
-                    'setCollectShippingRates' => true,
-                    'setStreet' => [self::SHIPPING_STREET_ADDRESS, self::SHIPPING_EXTENDED_ADDRESS],
-                    'setCity' => self::SHIPPING_LOCALITY,
-                    'setRegionCode' => self::SHIPPING_REGION,
-                    'setCountryId' => self::SHIPPING_COUNTRY_CODE,
-                    'setPostCode' => self::SHIPPING_POSTAL_CODE,
-                ],
-                'expected_billing' => [
-                    'setFirstname' => self::FIRSTNAME,
-                    'setLastname' => self::LASTNAME,
-                    'setEmail' => self::EMAIL,
-                    'setStreet' => [self::BILLING_LINE1, self::BILLING_LINE2],
-                    'setCity' => self::BILLING_CITY,
-                    'setRegionCode' => self::BILLING_STATE,
-                    'setCountryId' => self::BILLING_COUNTRY_CODE,
-                    'setPostCode' => self::BILLING_POSTAL_CODE,
-                ],
-                'expected_payment_additional_info' => [
-                    'payment_method_nonce' => 'nonce',
-                    'payerEmail' => self::EMAIL,
-                    'payerFirstName' => self::FIRSTNAME,
-                    'payerLastName' => self::LASTNAME,
-                ]
-            ],
-            'without_billing_address' => [
-                'payment_method_nonce' => 'nonce',
-                'details' => [
-                    'email' => self::EMAIL,
-                    'firstName' => self::FIRSTNAME,
-                    'lastName' => self::LASTNAME,
-                    'shippingAddress' => [
-                        'streetAddress' => self::SHIPPING_STREET_ADDRESS,
-                        'extendedAddress' => self::SHIPPING_EXTENDED_ADDRESS,
-                        'locality' => self::SHIPPING_LOCALITY,
-                        'region' => self::SHIPPING_REGION,
-                        'countryCodeAlpha2' => self::SHIPPING_COUNTRY_CODE,
-                        'postalCode' => self::SHIPPING_POSTAL_CODE,
-                    ],
-                ],
-                'expected_shipping' => [
-                    'setFirstname' => self::FIRSTNAME,
-                    'setLastname' => self::LASTNAME,
-                    'setEmail' => self::EMAIL,
-                    'setCollectShippingRates' => true,
-                    'setStreet' => [self::SHIPPING_STREET_ADDRESS, self::SHIPPING_EXTENDED_ADDRESS],
-                    'setCity' => self::SHIPPING_LOCALITY,
-                    'setRegionCode' => self::SHIPPING_REGION,
-                    'setCountryId' => self::SHIPPING_COUNTRY_CODE,
-                    'setPostCode' => self::SHIPPING_POSTAL_CODE,
-                ],
-                'expected_billing' => [
-                    'setFirstname' => self::FIRSTNAME,
-                    'setLastname' => self::LASTNAME,
-                    'setEmail' => self::EMAIL,
-                    'setStreet' => [self::SHIPPING_STREET_ADDRESS, self::SHIPPING_EXTENDED_ADDRESS],
-                    'setCity' => self::SHIPPING_LOCALITY,
-                    'setRegionCode' => self::SHIPPING_REGION,
-                    'setCountryId' => self::SHIPPING_COUNTRY_CODE,
-                    'setPostCode' => self::SHIPPING_POSTAL_CODE,
-                ],
-                'expected_payment_additional_info' => [
-                    'payment_method_nonce' => 'nonce',
-                    'payerEmail' => self::EMAIL,
-                    'payerFirstName' => self::FIRSTNAME,
-                    'payerLastName' => self::LASTNAME,
-                ]
-            ],
-            'without_shipping_extended_address' => [
-                'payment_method_nonce' => 'nonce',
-                'details' => [
-                    'email' => self::EMAIL,
-                    'firstName' => self::FIRSTNAME,
-                    'lastName' => self::LASTNAME,
-                    'shippingAddress' => [
-                        'streetAddress' => self::SHIPPING_STREET_ADDRESS,
-                        'locality' => self::SHIPPING_LOCALITY,
-                        'region' => self::SHIPPING_REGION,
-                        'countryCodeAlpha2' => self::SHIPPING_COUNTRY_CODE,
-                        'postalCode' => self::SHIPPING_POSTAL_CODE,
-                    ],
-                ],
-                'expected_shipping' => [
-                    'setFirstname' => self::FIRSTNAME,
-                    'setLastname' => self::LASTNAME,
-                    'setEmail' => self::EMAIL,
-                    'setCollectShippingRates' => true,
-                    'setStreet' => [self::SHIPPING_STREET_ADDRESS, null],
-                    'setCity' => self::SHIPPING_LOCALITY,
-                    'setRegionCode' => self::SHIPPING_REGION,
-                    'setCountryId' => self::SHIPPING_COUNTRY_CODE,
-                    'setPostCode' => self::SHIPPING_POSTAL_CODE,
-                ],
-                'expected_billing' => [
-                    'setFirstname' => self::FIRSTNAME,
-                    'setLastname' => self::LASTNAME,
-                    'setEmail' => self::EMAIL,
-                    'setStreet' => [self::SHIPPING_STREET_ADDRESS, null],
-                    'setCity' => self::SHIPPING_LOCALITY,
-                    'setRegionCode' => self::SHIPPING_REGION,
-                    'setCountryId' => self::SHIPPING_COUNTRY_CODE,
-                    'setPostCode' => self::SHIPPING_POSTAL_CODE,
-                ],
-                'expected_payment_additional_info' => [
-                    'payment_method_nonce' => 'nonce',
-                    'payerEmail' => self::EMAIL,
-                    'payerFirstName' => self::FIRSTNAME,
-                    'payerLastName' => self::LASTNAME,
-                ]
-            ],
-        ];
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Model/Config/CcTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Config/CcTest.php
deleted file mode 100644
index ec652a485b789c0b899b6cccad026a6ec739a470..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Model/Config/CcTest.php
+++ /dev/null
@@ -1,243 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Model\Config;
-
-use Magento\Braintree\Model\Config;
-use Magento\Braintree\Model\Config\Cc;
-use Magento\Store\Model\ScopeInterface;
-use Magento\Braintree\Model\PaymentMethod;
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
-
-/**
- * Class CcTest
- *
- */
-class CcTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Braintree\Model\Config\Cc
-     */
-    protected $model;
-
-    /**
-     * @var ObjectManagerHelper
-     */
-    protected $objectManagerHelper;
-
-    /**
-     * @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $scopeConfigMock;
-
-    /**
-     * @var \Magento\Braintree\Model\Adapter\BraintreeConfiguration|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $braintreeConfigurationMock;
-
-    /**
-     * @var \Magento\Framework\DB\TransactionFactory|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $braintreeClientTokenMock;
-
-    /**
-     * @var \Magento\Braintree\Model\System\Config\Source\Country|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $sourceCountryMock;
-
-    protected function setUp()
-    {
-        $this->scopeConfigMock = $this->getMock('\Magento\Framework\App\Config\ScopeConfigInterface');
-        $this->braintreeConfigurationMock = $this->getMockBuilder(
-            '\Magento\Braintree\Model\Adapter\BraintreeConfiguration'
-        )->disableOriginalConstructor()
-            ->getMock();
-        $this->sourceCountryMock = $this->getMockBuilder('\Magento\Braintree\Model\System\Config\Source\Country')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->braintreeClientTokenMock = $this->getMockBuilder('\Magento\Braintree\Model\Adapter\BraintreeClientToken')
-            ->getMock();
-
-        $this->objectManagerHelper = new ObjectManagerHelper($this);
-        $this->model = $this->objectManagerHelper->getObject(
-            '\Magento\Braintree\Model\Config\Cc',
-            [
-                'scopeConfig' => $this->scopeConfigMock,
-                'braintreeConfiguration' => $this->braintreeConfigurationMock,
-                'braintreeClientToken' => $this->braintreeClientTokenMock,
-                'sourceCountry' => $this->sourceCountryMock,
-            ]
-        );
-    }
-
-    /**
-     * @dataProvider canUseCcTypeForCountryDataProvider
-     */
-    public function testCanUseCcTypeForCountry($country, $ccType, $countryCardType, $ccTypes, $expectedResult)
-    {
-        $prefix = 'payment/braintree/';
-
-        $valueMap = [
-            [$prefix . Cc::KEY_COUNTRY_CREDIT_CARD, ScopeInterface::SCOPE_STORE, null, $countryCardType],
-            [$prefix . Cc::KEY_CC_TYPES, ScopeInterface::SCOPE_STORE, null, $ccTypes],
-        ];
-        $this->scopeConfigMock->expects($this->any())
-            ->method('getValue')
-            ->willReturnMap($valueMap);
-
-        $this->assertEquals($expectedResult, $this->model->canUseCcTypeForCountry($country, $ccType));
-    }
-
-    public function canUseCcTypeForCountryDataProvider()
-    {
-        return [
-            'no_country_card_config' => [
-                'country' => 'US',
-                'cc_type' => 'VI',
-                'country_specific_card_types' => 'illega_serialized_form',
-                'cc_types' => 'VI,MA,AE',
-                'expected_result' => false,
-            ],
-            'no_country_card_config_not_allowed' => [
-                'country' => 'US',
-                'cc_type' => 'random_card_type',
-                'country_specific_card_types' => 'illega_serialized_form',
-                'cc_types' => 'VI,MA,AE',
-                'expected_result' => new \Magento\Framework\Phrase(
-                    'Credit card type is not allowed for this payment method.'
-                ),
-            ],
-            'country_card_country_not_found_card_type_not_allowed' => [
-                'country' => 'US',
-                'cc_type' => 'random_card_type',
-                'country_specific_card_types' => serialize(
-                    [
-                        'FR' => ['VI', 'MA'],
-                    ]
-                ),
-                'cc_types' => 'VI,MA,AE',
-                'expected_result' => new \Magento\Framework\Phrase(
-                    'Credit card type is not allowed for this payment method.'
-                ),
-            ],
-            'country_card_not_found_card_type_not_allowed' => [
-                'country' => 'US',
-                'cc_type' => 'random_card_type',
-                'country_specific_card_types' => serialize(
-                    [
-                        'US' => ['AE', 'MA'],
-                    ]
-                ),
-                'cc_types' => 'VI,MA,AE',
-                'expected_result' => new \Magento\Framework\Phrase(
-                    'Credit card type is not allowed for your country.'
-                ),
-            ],
-            'country_card_found' => [
-                'country' => 'US',
-                'cc_type' => 'random_card_type',
-                'country_specific_card_types' => serialize(
-                    [
-                        'US' => ['AE', 'VI'],
-                    ]
-                ),
-                'cc_types' => '',
-                'expected_result' => new \Magento\Framework\Phrase(
-                    'Credit card type is not allowed for your country.'
-                ),
-            ],
-        ];
-    }
-
-    /**
-     * @dataProvider getApplicableCardTypesDataProvider
-     */
-    public function testGetApplicableCardTypes($country, $countryCardType, $ccTypes, $expectedResult)
-    {
-        $prefix = 'payment/braintree/';
-
-        $valueMap = [
-            [$prefix . Cc::KEY_COUNTRY_CREDIT_CARD, ScopeInterface::SCOPE_STORE, null, $countryCardType],
-            [$prefix . Cc::KEY_CC_TYPES, ScopeInterface::SCOPE_STORE, null, $ccTypes],
-        ];
-        $this->scopeConfigMock->expects($this->any())
-            ->method('getValue')
-            ->willReturnMap($valueMap);
-
-        $this->assertEquals($expectedResult, $this->model->getApplicableCardTypes($country));
-    }
-    public function getApplicableCardTypesDataProvider()
-    {
-        return [
-            'no_country_card_config' => [
-                'country' => 'US',
-                'country_specific_card_types' => 'illega_serialized_form',
-                'cc_types' => 'VI,MA,AE',
-                'expected_result' => ['VI', 'MA', 'AE'],
-            ],
-            'country_card_country_not_found_card_type_not_allowed' => [
-                'country' => 'US',
-                'country_specific_card_types' => serialize(
-                    [
-                        'FR' => ['VI', 'MA', 'DI'],
-                    ]
-                ),
-                'cc_types' => 'VI,MA,AE',
-                'expected_result' => ['VI', 'MA', 'AE'],
-            ],
-            'country_card_not_found_card_type_not_allowed' => [
-                'country' => 'US',
-                'country_specific_card_types' => serialize(
-                    [
-                        'US' => ['AE', 'MA'],
-                    ]
-                ),
-                'cc_types' => 'VI,MA,AE',
-                'expected_result' => ['AE', 'MA'],
-            ],
-        ];
-    }
-
-    /**
-     * @dataProvider getCountrySpecificCardTypeConfigDataProvider
-     */
-    public function testGetCountrySpecificCardTypeConfig($countryCardType, $expectedResult)
-    {
-        $prefix = 'payment/braintree/';
-
-        $valueMap = [
-            [$prefix . Cc::KEY_COUNTRY_CREDIT_CARD, ScopeInterface::SCOPE_STORE, null, $countryCardType],
-        ];
-        $this->scopeConfigMock->expects($this->any())
-            ->method('getValue')
-            ->willReturnMap($valueMap);
-
-        $this->assertEquals($expectedResult, $this->model->getCountrySpecificCardTypeConfig());
-    }
-
-    public function getCountrySpecificCardTypeConfigDataProvider()
-    {
-        return [
-            'no_country_card_config' => [
-                'country_specific_card_types' => 'illega_serialized_form',
-                'expected' => [],
-            ],
-            'country_card_country_not_found_card_type_not_allowed' => [
-                'country_specific_card_types' => serialize(
-                    [
-                        'US' => ['VI', 'MA', 'AE'],
-                        'FR' => ['VI', 'MA', 'DI'],
-                    ]
-                ),
-                'expected_result' => [
-                    'US' => ['VI', 'MA', 'AE'],
-                    'FR' => ['VI', 'MA', 'DI'],
-                ],
-            ],
-
-        ];
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Model/Config/PayPalTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Config/PayPalTest.php
deleted file mode 100644
index ebfb3e1c933e43a3d547f33c01743387f6c0a1e1..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Model/Config/PayPalTest.php
+++ /dev/null
@@ -1,110 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Model\Config;
-
-use Magento\Braintree\Model\Config;
-use Magento\Braintree\Model\Config\PayPal;
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
-
-/**
- * Class ConfigTest
- *
- */
-class PayPalTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Braintree\Model\Config\PayPal
-     */
-    protected $model;
-
-    /**
-     * @var ObjectManagerHelper
-     */
-    protected $objectManagerHelper;
-
-    /**
-     * @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $scopeConfigMock;
-
-    /**
-     * @var \Magento\Braintree\Model\Adapter\BraintreeConfiguration|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $braintreeConfigurationMock;
-
-    /**
-     * @var \Magento\Framework\DB\TransactionFactory|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $braintreeClientTokenMock;
-
-    /**
-     * @var \Magento\Braintree\Model\System\Config\Source\Country|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $sourceCountryMock;
-
-    protected function setUp()
-    {
-        $this->scopeConfigMock = $this->getMock('\Magento\Framework\App\Config\ScopeConfigInterface');
-
-        $this->objectManagerHelper = new ObjectManagerHelper($this);
-        $this->model = $this->objectManagerHelper->getObject(
-            '\Magento\Braintree\Model\Config\PayPal',
-            [
-                'scopeConfig' => $this->scopeConfigMock,
-            ]
-        );
-    }
-
-    public function testIsActive()
-    {
-        $prefix = 'payment/braintree_paypal/';
-        $this->scopeConfigMock->expects($this->once())
-            ->method('getValue')
-            ->with($prefix . Config::KEY_ACTIVE, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, null)
-            ->willReturn(true);
-        $this->assertEquals(true, $this->model->isActive());
-    }
-
-    public function testGetMerchantNameOverride()
-    {
-        $prefix = 'payment/braintree_paypal/';
-        $merchantName = 'merchantName';
-        $this->scopeConfigMock->expects($this->once())
-            ->method('getValue')
-            ->with($prefix . PayPal::KEY_MERCHANT_NAME_OVERRIDE, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, null)
-            ->willReturn($merchantName);
-        $this->assertEquals($merchantName, $this->model->getMerchantNameOverride());
-    }
-
-    public function testIsShortcutCheckoutEnabled()
-    {
-        $isEnabled = 1;
-        $prefix = 'payment/braintree_paypal/';
-        $this->scopeConfigMock->expects($this->once())
-            ->method('getValue')
-            ->with(
-                $prefix . PayPal::KEY_DISPLAY_ON_SHOPPING_CART,
-                \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
-                null
-            )->willReturn($isEnabled);
-        $this->assertEquals(true, $this->model->isShortcutCheckoutEnabled());
-    }
-
-    public function testIsBillingAddressEnabled()
-    {
-        $isEnabled = 1;
-        $prefix = 'payment/braintree_paypal/';
-        $this->scopeConfigMock->expects($this->once())
-            ->method('getValue')
-            ->with(
-                $prefix . PayPal::KEY_REQUIRE_BILLING_ADDRESS,
-                \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
-                null
-            )->willReturn($isEnabled);
-        $this->assertEquals(true, $this->model->isBillingAddressEnabled());
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Model/ConfigProvider/PayPalTest.php b/app/code/Magento/Braintree/Test/Unit/Model/ConfigProvider/PayPalTest.php
deleted file mode 100644
index 591b2c9bd3d0f6b127a35d98166f742c65051fce..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Model/ConfigProvider/PayPalTest.php
+++ /dev/null
@@ -1,110 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Model\ConfigProvider;
-
-use Magento\Braintree\Model\PaymentMethod;
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
-
-/**
- * Class PayPalTest
- */
-class PayPalTest extends \PHPUnit_Framework_TestCase
-{
-    const CLIENT_TOKEN = 'token';
-
-    /**
-     * @var \Magento\Braintree\Model\ConfigProvider\PayPal
-     */
-    protected $model;
-
-    /**
-     * @var ObjectManagerHelper
-     */
-    protected $objectManagerHelper;
-
-    /**
-     * @var \Magento\Braintree\Model\Config\PayPal|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $configMock;
-
-    /**
-     * @var \Magento\Framework\Locale\ResolverInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $localResolverMock;
-
-    protected function setUp()
-    {
-        $this->configMock = $this->getMockBuilder('\Magento\Braintree\Model\Config\PayPal')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->localResolverMock = $this->getMock('\Magento\Framework\Locale\ResolverInterface');
-        $this->objectManagerHelper = new ObjectManagerHelper($this);
-        $this->model = $this->objectManagerHelper->getObject(
-            'Magento\Braintree\Model\ConfigProvider\PayPal',
-            [
-                'config' => $this->configMock,
-                'localeResolver' => $this->localResolverMock,
-            ]
-        );
-    }
-
-    /**
-     * @dataProvider getConfigDataProvider
-     */
-    public function testGetConfig(
-        $configData,
-        $locale,
-        $expectedResult
-    ) {
-        foreach ($configData as $key => $value) {
-            $this->configMock->expects($this->any())
-                ->method($key)
-                ->willReturn($value);
-        }
-
-        $this->localResolverMock->expects($this->any())
-            ->method('getLocale')
-            ->willReturn($locale);
-
-        $this->assertEquals($expectedResult, $this->model->getConfig());
-    }
-
-    /**
-     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
-     */
-    public function getConfigDataProvider()
-    {
-        return [
-            'not_active' => [
-                'config_data' => [
-                    'isActive' => false,
-                    'getClientToken' => self::CLIENT_TOKEN,
-                ],
-                'locale' => 'en_US',
-                'expected_result' => [
-                ]
-            ],
-            'active' => [
-                'config_data' => [
-                    'isActive' => true,
-                    'getClientToken' => self::CLIENT_TOKEN,
-                    'getMerchantNameOverride' => 'merchantName',
-                ],
-                'locale' => 'en_US',
-                'expected_result' => [
-                    'payment' => [
-                        'braintree_paypal' => [
-                            'clientToken' => self::CLIENT_TOKEN,
-                            'locale' => 'en_US',
-                            'merchantDisplayName' => 'merchantName',
-                        ],
-                    ]
-                ]
-            ],
-        ];
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Model/ConfigProviderTest.php b/app/code/Magento/Braintree/Test/Unit/Model/ConfigProviderTest.php
deleted file mode 100644
index 5cb0addb803cb2c490083bf4e50a8f2549b43080..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Model/ConfigProviderTest.php
+++ /dev/null
@@ -1,467 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Model;
-
-use Magento\Braintree\Model\ConfigProvider;
-use Magento\Braintree\Model\PaymentMethod;
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
-
-/**
- * Class ConfigProviderTest
- */
-class ConfigProviderTest extends \PHPUnit_Framework_TestCase
-{
-    const CLIENT_TOKEN = 'token';
-    const CC_TOKEN = 'cc_token';
-    const TODAY_MONTH = 6;
-    const TODAY_YEAR = 2015;
-    const PAYMENT_NONCE_GENERATION_URL = 'braintree/creditcard/generate';
-
-    protected $availableCardTypes = [
-        'VI' => 'Visa',
-        'MA' => 'Master Card',
-        'AE' => 'American Express',
-        'DI' => 'Discover Card',
-    ];
-
-    /**
-     * @var \Magento\Braintree\Model\ConfigProvider
-     */
-    protected $model;
-
-    /**
-     * @var ObjectManagerHelper
-     */
-    protected $objectManagerHelper;
-
-    /**
-     * @var \Magento\Payment\Model\CcConfig|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $ccConfigMock;
-
-    /**
-     * @var \Magento\Braintree\Model\Config\Cc|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $configMock;
-
-    /**
-     * @var \Magento\Braintree\Model\Vault|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $vaultMock;
-
-    /**
-     * @var \Magento\Checkout\Model\Session|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $checkoutSessionMock;
-
-    /**
-     * @var \Magento\Customer\Model\Session|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $customerSessionMock;
-
-    /**
-     * @var \Magento\Braintree\Helper\Data|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $helperMock;
-
-    /**
-     * @var \Magento\Framework\Url|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $urlBuilderMock;
-
-    protected function setUp()
-    {
-        $this->ccConfigMock = $this->getMockBuilder('\Magento\Payment\Model\CcConfig')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->configMock = $this->getMockBuilder('\Magento\Braintree\Model\Config\Cc')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->vaultMock = $this->getMockBuilder('\Magento\Braintree\Model\Vault')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->helperMock = $this->getMockBuilder('\Magento\Braintree\Helper\Data')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->checkoutSessionMock = $this->getMockBuilder('\Magento\Checkout\Model\Session')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->customerSessionMock = $this->getMockBuilder('\Magento\Customer\Model\Session')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->urlBuilderMock = $this->getMockBuilder('\Magento\Framework\Url')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->objectManagerHelper = new ObjectManagerHelper($this);
-        $this->model = $this->objectManagerHelper->getObject(
-            'Magento\Braintree\Model\ConfigProvider',
-            [
-                'ccConfig' => $this->ccConfigMock,
-                'vault' => $this->vaultMock,
-                'config' => $this->configMock,
-                'checkoutSession' => $this->checkoutSessionMock,
-                'customerSession' => $this->customerSessionMock,
-                'dataHelper' => $this->helperMock,
-                'urlBuilder' => $this->urlBuilderMock,
-            ]
-        );
-    }
-
-    public function testGetStoredCards()
-    {
-        $result = 'result';
-        $this->vaultMock->expects($this->once())
-            ->method('currentCustomerStoredCards')
-            ->willReturn($result);
-        $this->assertEquals($result, $this->model->getStoredCards());
-    }
-
-    /**
-     * @param bool $useVault
-     * @param bool $isLoggedIn
-     * @param bool $result
-     * @dataProvider canSaveCardDataProvider
-     */
-    public function testCanSaveCard($useVault, $isLoggedIn, $result)
-    {
-        $this->configMock->expects($this->once())
-            ->method('useVault')
-            ->willReturn($useVault);
-
-        $this->customerSessionMock->expects($this->any())
-            ->method('isLoggedIn')
-            ->willReturn($isLoggedIn);
-
-        $this->assertEquals($result, $this->model->canSaveCard());
-    }
-
-    public function canSaveCardDataProvider()
-    {
-        return [
-            'not_using_vault' => [
-                'use_vault' => false,
-                'is_logged_in' => true,
-                'result' => false,
-            ],
-            'using_vault_not_logged_in' => [
-                'use_vault' => true,
-                'is_logged_in' => false,
-                'result' => false,
-            ],
-            'using_vault_logged_in' => [
-                'use_vault' => true,
-                'is_logged_in' => true,
-                'result' => true,
-            ],
-        ];
-    }
-
-    public function testGetConfigNotActive()
-    {
-        $this->configMock->expects($this->once())
-            ->method('isActive')
-            ->willReturn(false);
-        $this->assertEquals([], $this->model->getConfig());
-    }
-
-    /**
-     * @dataProvider getConfigDataProvider
-     */
-    public function testGetConfig(
-        $configData,
-        $vaultData,
-        $tokenNonceMap,
-        $expectedResult
-    ) {
-        foreach ($configData as $key => $value) {
-            $this->configMock->expects($this->any())
-                ->method($key)
-                ->willReturn($value);
-        }
-
-        foreach ($vaultData as $key => $value) {
-            $this->vaultMock->expects($this->any())
-                ->method($key)
-                ->willReturn($value);
-        }
-
-        $this->vaultMock->expects($this->any())
-            ->method('generatePaymentMethodToken')
-            ->willReturnMap($tokenNonceMap);
-
-        $cardTypeMap = [
-            ['Visa', 'VI'],
-            ['Master Card', 'MA'],
-            ['American Express', 'AE'],
-            ['Discover Card', 'DI'],
-        ];
-        $this->helperMock->expects($this->any())
-            ->method('getCcTypeCodeByName')
-            ->willReturnMap($cardTypeMap);
-        $this->helperMock->expects($this->once())
-            ->method('getTodayMonth')
-            ->willReturn(self::TODAY_MONTH);
-        $this->helperMock->expects($this->once())
-            ->method('getTodayYear')
-            ->willReturn(self::TODAY_YEAR);
-        $this->helperMock->expects($this->once())
-            ->method('getCcAvailableCardTypes')
-            ->willReturn($this->availableCardTypes);
-
-        $this->customerSessionMock->expects($this->any())
-            ->method('isLoggedIn')
-            ->willReturn(true);
-        $this->urlBuilderMock->expects($this->once())
-            ->method('getUrl')
-            ->with('braintree/creditcard/generate')
-            ->willReturn(self::PAYMENT_NONCE_GENERATION_URL);
-
-        $this->assertEquals($expectedResult, $this->model->getConfig());
-    }
-
-    /**
-     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
-     */
-    public function getConfigDataProvider()
-    {
-        return [
-            'no_vault' => [
-                'config_data' => [
-                    'isActive' => true,
-                    'getClientToken' => self::CLIENT_TOKEN,
-                    'is3dSecureEnabled' => true,
-                    'useVault' => false,
-                    'getCountrySpecificCardTypeConfig' => [
-                        'US' => ['VI', 'AE', 'MA'],
-                    ],
-                    'isFraudDetectionEnabled' => true,
-                    'isCcDetectionEnabled' => true,
-                    'getBraintreeDataJs' => 'https://js.braintreegateway.com/v1/braintree-data.js'
-                ],
-                'vault_data' => [],
-                'token_nonce_map' => [],
-                'expected_result' => [
-                    'payment' => [
-                        'braintree' => [
-                            'clientToken' => self::CLIENT_TOKEN,
-                            'useVault' => false,
-                            'canSaveCard' => false,
-                            'show3dSecure' => true,
-                            'storedCards' => [],
-                            'selectedCardToken' => null,
-                            'creditCardExpMonth' => self::TODAY_MONTH,
-                            'creditCardExpYear' => self::TODAY_YEAR,
-                            'countrySpecificCardTypes' => [
-                                'US' => ['VI', 'AE', 'MA'],
-                            ],
-                            'isFraudDetectionEnabled' => true,
-                            'isCcDetectionEnabled' => true,
-                            'availableCardTypes' => $this->availableCardTypes,
-                            'braintreeDataJs'=> 'https://js.braintreegateway.com/v1/braintree-data.js',
-                            'ajaxGenerateNonceUrl' => self::PAYMENT_NONCE_GENERATION_URL
-                        ],
-                    ],
-                ]
-            ],
-            'vault_with_stored_cards' => [
-                'config_data' => [
-                    'isActive' => true,
-                    'getClientToken' => self::CLIENT_TOKEN,
-                    'is3dSecureEnabled' => false,
-                    'useVault' => true,
-                    'getCountrySpecificCardTypeConfig' => [
-                        'US' => ['VI', 'AE', 'MA'],
-                    ],
-                    'isFraudDetectionEnabled' => true,
-                    'isCcDetectionEnabled' => true,
-                    'getBraintreeDataJs' => 'https://js.braintreegateway.com/v1/braintree-data.js'
-                ],
-                'vault_data' => [
-                    'currentCustomerStoredCards' => [
-                        \Braintree_CreditCard::factory(
-                            [
-                                'token' => 'token1',
-                                'bin' => '4218',
-                                'last4' => '1001',
-                                'cardType' => 'Visa',
-                                'default' => false,
-                            ]
-                        ),
-                        \Braintree_CreditCard::factory(
-                            [
-                                'token' => 'token2',
-                                'bin' => '5555',
-                                'last4' => '1054',
-                                'cardType' => 'Master Card',
-                                'default' => 1,
-                            ]
-                        ),
-                    ],
-                ],
-                'token_nonce_map' => [
-                    ['token1', 'nonce1'],
-                    ['token2', 'nonce2'],
-                ],
-                'expected_result' => [
-                    'payment' => [
-                        'braintree' => [
-                            'clientToken' => self::CLIENT_TOKEN,
-                            'useVault' => true,
-                            'canSaveCard' => true,
-                            'show3dSecure' => false,
-                            'storedCards' => [
-                                [
-                                    'token' => 'token1',
-                                    'maskedNumber' => '4218******1001 - Visa',
-                                    'selected' => false,
-                                    'type' => 'VI',
-                                ],
-                                [
-                                    'token' => 'token2',
-                                    'maskedNumber' => '5555******1054 - Master Card',
-                                    'selected' => 1,
-                                    'type' => 'MA',
-                                ],
-                            ],
-                            'selectedCardToken' => 'token2',
-                            'creditCardExpMonth' => self::TODAY_MONTH,
-                            'creditCardExpYear' => self::TODAY_YEAR,
-                            'countrySpecificCardTypes' => [
-                                'US' => ['VI', 'AE', 'MA'],
-                            ],
-                            'isFraudDetectionEnabled' => true,
-                            'isCcDetectionEnabled' => true,
-                            'availableCardTypes' => $this->availableCardTypes,
-                            'braintreeDataJs'=> 'https://js.braintreegateway.com/v1/braintree-data.js',
-                            'ajaxGenerateNonceUrl' => self::PAYMENT_NONCE_GENERATION_URL
-                        ],
-                    ],
-                ]
-            ],
-            'vault_with_stored_cards_3dsecure' => [
-                'config_data' => [
-                    'isActive' => true,
-                    'getClientToken' => self::CLIENT_TOKEN,
-                    'is3dSecureEnabled' => true,
-                    'useVault' => true,
-                    'getCountrySpecificCardTypeConfig' => [
-                        'US' => ['VI', 'AE', 'MA'],
-                    ],
-                    'isFraudDetectionEnabled' => true,
-                    'isCcDetectionEnabled' => true,
-                    'getBraintreeDataJs' => 'https://js.braintreegateway.com/v1/braintree-data.js'
-                ],
-                'vault_data' => [
-                    'currentCustomerStoredCards' => [
-                        \Braintree_CreditCard::factory(
-                            [
-                                'token' => 'token1',
-                                'bin' => '4218',
-                                'last4' => '1001',
-                                'cardType' => 'Visa',
-                                'default' => false,
-                            ]
-                        ),
-                        \Braintree_CreditCard::factory(
-                            [
-                                'token' => 'token2',
-                                'bin' => '5555',
-                                'last4' => '1054',
-                                'cardType' => 'Master Card',
-                                'default' => 1,
-                            ]
-                        ),
-                    ],
-                ],
-                'token_nonce_map' => [
-                    ['token1', 'nonce1'],
-                    ['token2', 'nonce2'],
-                ],
-                'expected_result' => [
-                    'payment' => [
-                        'braintree' => [
-                            'clientToken' => self::CLIENT_TOKEN,
-                            'useVault' => true,
-                            'canSaveCard' => true,
-                            'show3dSecure' => true,
-                            'storedCards' => [
-                                [
-                                    'token' => 'token1',
-                                    'maskedNumber' => '4218******1001 - Visa',
-                                    'selected' => false,
-                                    'type' => 'VI',
-                                ],
-                                [
-                                    'token' => 'token2',
-                                    'maskedNumber' => '5555******1054 - Master Card',
-                                    'selected' => 1,
-                                    'type' => 'MA',
-                                ],
-                            ],
-                            'selectedCardToken' => 'token2',
-                            'creditCardExpMonth' => self::TODAY_MONTH,
-                            'creditCardExpYear' => self::TODAY_YEAR,
-                            'countrySpecificCardTypes' => [
-                                'US' => ['VI', 'AE', 'MA'],
-                            ],
-                            'isFraudDetectionEnabled' => true,
-                            'isCcDetectionEnabled' => true,
-                            'availableCardTypes' => $this->availableCardTypes,
-                            'braintreeDataJs'=> 'https://js.braintreegateway.com/v1/braintree-data.js',
-                            'ajaxGenerateNonceUrl' => self::PAYMENT_NONCE_GENERATION_URL
-                        ],
-                    ],
-                ]
-            ],
-            'vault_with_no_stored_cards' => [
-                'config_data' => [
-                    'isActive' => true,
-                    'getClientToken' => self::CLIENT_TOKEN,
-                    'is3dSecureEnabled' => true,
-                    'useVault' => true,
-                    'getCountrySpecificCardTypeConfig' => [
-                        'US' => ['VI', 'AE', 'MA'],
-                    ],
-                    'isFraudDetectionEnabled' => true,
-                    'isCcDetectionEnabled' => true,
-                    'getBraintreeDataJs' => 'https://js.braintreegateway.com/v1/braintree-data.js'
-                ],
-                'vault_data' => [
-                    'currentCustomerStoredCards' => [],
-                ],
-                'token_nonce_map' => [
-                    ['token1', 'nonce1'],
-                    ['token2', 'nonce2'],
-                ],
-                'expected_result' => [
-                    'payment' => [
-                        'braintree' => [
-                            'clientToken' => self::CLIENT_TOKEN,
-                            'useVault' => false,
-                            'canSaveCard' => true,
-                            'show3dSecure' => true,
-                            'storedCards' => [
-                            ],
-                            'selectedCardToken' => null,
-                            'creditCardExpMonth' => self::TODAY_MONTH,
-                            'creditCardExpYear' => self::TODAY_YEAR,
-                            'countrySpecificCardTypes' => [
-                                'US' => ['VI', 'AE', 'MA'],
-                            ],
-                            'isFraudDetectionEnabled' => true,
-                            'isCcDetectionEnabled' => true,
-                            'availableCardTypes' => $this->availableCardTypes,
-                            'braintreeDataJs'=> 'https://js.braintreegateway.com/v1/braintree-data.js',
-                            'ajaxGenerateNonceUrl' => self::PAYMENT_NONCE_GENERATION_URL
-                        ],
-                    ],
-                ]
-            ],
-        ];
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Model/ConfigTest.php b/app/code/Magento/Braintree/Test/Unit/Model/ConfigTest.php
deleted file mode 100644
index 3580e52a3d1d9bba9fcc5349ab815ba11c14a075..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Model/ConfigTest.php
+++ /dev/null
@@ -1,298 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Model;
-
-use Magento\Braintree\Model\Config;
-use Magento\Braintree\Model\PaymentMethod;
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
-
-/**
- * Class ConfigTest
- *
- */
-class ConfigTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Braintree\Model\Config
-     */
-    protected $model;
-
-    /**
-     * @var ObjectManagerHelper
-     */
-    protected $objectManagerHelper;
-
-    /**
-     * @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $scopeConfigMock;
-
-    /**
-     * @var \Magento\Braintree\Model\Adapter\BraintreeConfiguration|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $braintreeConfigurationMock;
-
-    /**
-     * @var \Magento\Framework\DB\TransactionFactory|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $braintreeClientTokenMock;
-
-    /**
-     * @var \Magento\Braintree\Model\System\Config\Source\Country|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $sourceCountryMock;
-
-    protected function setUp()
-    {
-        $this->scopeConfigMock = $this->getMock('\Magento\Framework\App\Config\ScopeConfigInterface');
-        $this->braintreeConfigurationMock = $this->getMockBuilder(
-            '\Magento\Braintree\Model\Adapter\BraintreeConfiguration'
-        )->disableOriginalConstructor()
-            ->getMock();
-        $this->sourceCountryMock = $this->getMockBuilder('\Magento\Braintree\Model\System\Config\Source\Country')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->braintreeClientTokenMock = $this->getMockBuilder('\Magento\Braintree\Model\Adapter\BraintreeClientToken')
-            ->getMock();
-
-        $this->objectManagerHelper = new ObjectManagerHelper($this);
-        $this->model = $this->objectManagerHelper->getObject(
-            '\Magento\Braintree\Model\Config',
-            [
-                'scopeConfig' => $this->scopeConfigMock,
-                'braintreeConfiguration' => $this->braintreeConfigurationMock,
-                'braintreeClientToken' => $this->braintreeClientTokenMock,
-                'sourceCountry' => $this->sourceCountryMock,
-            ]
-        );
-    }
-
-    public function testConstructorActive()
-    {
-        $prefix = 'payment/braintree/';
-
-        $environment = \Magento\Braintree\Model\Source\Environment::ENVIRONMENT_PRODUCTION;
-        $merchantId = 'merchantId';
-        $publicKey = 'public_key';
-        $privateKey = 'private_key';
-        $merchantAccountId = 'merchantAccountId';
-        $clientToken = 'clientToken';
-
-        $this->scopeConfigMock->expects($this->at(0))
-            ->method('getValue')
-            ->with($prefix . Config::KEY_ACTIVE, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, null)
-            ->willReturn(1);
-        $this->scopeConfigMock->expects($this->at(1))
-            ->method('getValue')
-            ->with($prefix . Config::KEY_ENVIRONMENT, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, null)
-            ->willReturn($environment);
-        $this->scopeConfigMock->expects($this->at(2))
-            ->method('getValue')
-            ->with($prefix . Config::KEY_MERCHANT_ID, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, null)
-            ->willReturn($merchantId);
-        $this->scopeConfigMock->expects($this->at(3))
-            ->method('getValue')
-            ->with($prefix . Config::KEY_PUBLIC_KEY, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, null)
-            ->willReturn($publicKey);
-        $this->scopeConfigMock->expects($this->at(4))
-            ->method('getValue')
-            ->with($prefix . Config::KEY_PRIVATE_KEY, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, null)
-            ->willReturn($privateKey);
-        $this->scopeConfigMock->expects($this->at(5))
-            ->method('getValue')
-            ->with($prefix . Config::KEY_MERCHANT_ACCOUNT_ID, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, null)
-            ->willReturn($merchantAccountId);
-
-
-        $this->braintreeConfigurationMock->expects($this->once())
-            ->method('environment')
-            ->with($environment);
-        $this->braintreeConfigurationMock->expects($this->once())
-            ->method('merchantId')
-            ->with($merchantId);
-        $this->braintreeConfigurationMock->expects($this->once())
-            ->method('publicKey')
-            ->with($publicKey);
-        $this->braintreeConfigurationMock->expects($this->once())
-            ->method('privateKey')
-            ->with($privateKey);
-
-        $this->model = new Config(
-            $this->scopeConfigMock,
-            $this->braintreeConfigurationMock,
-            $this->braintreeClientTokenMock,
-            $this->sourceCountryMock
-        );
-
-        $this->assertEquals($merchantAccountId, $this->model->getMerchantAccountId());
-        $this->braintreeClientTokenMock->expects($this->once())
-            ->method('generate')
-            ->willReturn($clientToken);
-        $this->assertEquals($clientToken, $this->model->getClientToken());
-        //second call will return cached version
-        $this->assertEquals($clientToken, $this->model->getClientToken());
-    }
-
-    public function testConstructorInActive()
-    {
-        $prefix = 'payment/braintree/';
-
-        $this->scopeConfigMock->expects($this->once(0))
-            ->method('getValue')
-            ->with($prefix . Config::KEY_ACTIVE, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, null)
-            ->willReturn(0);
-
-        $this->model = new Config(
-            $this->scopeConfigMock,
-            $this->braintreeConfigurationMock,
-            $this->braintreeClientTokenMock,
-            $this->sourceCountryMock
-        );
-
-        $this->assertEquals('', $this->model->getMerchantAccountId());
-    }
-
-    public function testInitEnvironment()
-    {
-        $prefix = 'payment/braintree/';
-        $storeId  = 2;
-
-        $environment2 = \Magento\Braintree\Model\Source\Environment::ENVIRONMENT_SANDBOX;
-        $merchantId2 = 'merchantId_2';
-        $publicKey2 = 'public_key_2';
-        $privateKey2 = 'private_key_2';
-        $merchantAccountId2 = 'merchantAccountId_2';
-        $clientToken2 = 'clientToken_2';
-
-        $this->scopeConfigMock->expects($this->at(0))
-            ->method('getValue')
-            ->with($prefix . Config::KEY_ACTIVE, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, null)
-            ->willReturn(1);
-
-        //for the initEnvironment call
-        $this->scopeConfigMock->expects($this->at(6))
-            ->method('getValue')
-            ->with($prefix . Config::KEY_ENVIRONMENT, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $storeId)
-            ->willReturn($environment2);
-        $this->scopeConfigMock->expects($this->at(7))
-            ->method('getValue')
-            ->with($prefix . Config::KEY_MERCHANT_ID, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $storeId)
-            ->willReturn($merchantId2);
-        $this->scopeConfigMock->expects($this->at(8))
-            ->method('getValue')
-            ->with($prefix . Config::KEY_PUBLIC_KEY, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $storeId)
-            ->willReturn($publicKey2);
-        $this->scopeConfigMock->expects($this->at(9))
-            ->method('getValue')
-            ->with($prefix . Config::KEY_PRIVATE_KEY, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $storeId)
-            ->willReturn($privateKey2);
-        $this->scopeConfigMock->expects($this->at(10))
-            ->method('getValue')
-            ->with(
-                $prefix . Config::KEY_MERCHANT_ACCOUNT_ID,
-                \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
-                $storeId
-            )->willReturn($merchantAccountId2);
-
-
-        //for the initEnvironment call
-        $this->braintreeConfigurationMock->expects($this->at(4))
-            ->method('environment')
-            ->with($environment2);
-        $this->braintreeConfigurationMock->expects($this->at(5))
-            ->method('merchantId')
-            ->with($merchantId2);
-        $this->braintreeConfigurationMock->expects($this->at(6))
-            ->method('publicKey')
-            ->with($publicKey2);
-        $this->braintreeConfigurationMock->expects($this->at(7))
-            ->method('privateKey')
-            ->with($privateKey2);
-
-        $this->model = new Config(
-            $this->scopeConfigMock,
-            $this->braintreeConfigurationMock,
-            $this->braintreeClientTokenMock,
-            $this->sourceCountryMock
-        );
-
-        $this->model->initEnvironment($storeId);
-        $this->assertEquals($merchantAccountId2, $this->model->getMerchantAccountId());
-        $this->braintreeClientTokenMock->expects($this->once())
-            ->method('generate')
-            ->willReturn($clientToken2);
-        $this->assertEquals($clientToken2, $this->model->getClientToken());
-        //second call will return cached version
-        $this->assertEquals($clientToken2, $this->model->getClientToken());
-    }
-
-    /**
-     * @dataProvider canUseForCountryAllowSpecificDataProvider
-     */
-    public function testCanUseForCountryAllowSpecific($countryId, $expected)
-    {
-        $prefix = 'payment/braintree/';
-        $specificCountry = 'FR,US';
-
-        $this->scopeConfigMock->expects($this->at(0))
-            ->method('getValue')
-            ->with($prefix . Config::KEY_ALLOW_SPECIFIC, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, null)
-            ->willReturn(1);
-        $this->scopeConfigMock->expects($this->at(1))
-            ->method('getValue')
-            ->with($prefix . Config::KEY_SPECIFIC_COUNTRY, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, null)
-            ->willReturn($specificCountry);
-        $this->assertEquals($expected, $this->model->canUseForCountry($countryId));
-    }
-
-    public function canUseForCountryAllowSpecificDataProvider()
-    {
-        return [
-            'US' => [
-                'country' => 'US',
-                'expected' => true,
-            ],
-            'TT' => [
-                'country' => 'TT',
-                'expected' => false,
-            ],
-        ];
-    }
-
-    /**
-     * @dataProvider canUseForCountryNotAllowSpecificDataProvider
-     */
-    public function testCanUseForCountryNotAllowSpecific($isRestricted, $expected)
-    {
-        $countryId  = 'non-existing';
-        $prefix = 'payment/braintree/';
-
-        $this->scopeConfigMock->expects($this->at(0))
-            ->method('getValue')
-            ->with($prefix . Config::KEY_ALLOW_SPECIFIC, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, null)
-            ->willReturn(0);
-        $this->sourceCountryMock->expects($this->once())
-            ->method('isCountryRestricted')
-            ->with($countryId)
-            ->willReturn($isRestricted);
-        $this->assertEquals($expected, $this->model->canUseForCountry($countryId));
-    }
-
-    public function canUseForCountryNotAllowSpecificDataProvider()
-    {
-        return [
-            'restricted' => [
-                'is_restricted' => true,
-                'expected' => false,
-            ],
-            'non_restricted' => [
-                'is_restricted' => false,
-                'expected' => true,
-            ],
-        ];
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Model/PaymentMethod/PayPalTest.php b/app/code/Magento/Braintree/Test/Unit/Model/PaymentMethod/PayPalTest.php
deleted file mode 100644
index 15a689c8663a0819986f0051996d903297b8848e..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Model/PaymentMethod/PayPalTest.php
+++ /dev/null
@@ -1,813 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Model\PaymentMethod;
-
-use Magento\Braintree\Model\PaymentMethod;
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
-use \Magento\Sales\Model\ResourceModel\Order\Payment\Transaction\CollectionFactory as TransactionCollectionFactory;
-use Magento\Framework\Exception\LocalizedException;
-use \Braintree_Result_Successful;
-use \Braintree_Result_Error;
-use \Braintree_Transaction;
-use Magento\Sales\Model\Order\Payment\Transaction as PaymentTransaction;
-
-/**
- * Class PayPalTest
- *
- * @SuppressWarnings(PHPMD.TooManyFields)
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
- */
-class PayPalTest extends \PHPUnit_Framework_TestCase
-{
-    const CHANNEL = 'Magento Community Edition 2.0';
-    const PAYMENT_METHOD_NONCE = 'nonce';
-    const CC_TOKEN = 'cc45kn';
-    const MERCHANT_ACCOUNT_ID = '5z4rh64p772cy7pb';
-    const FNAME = 'John';
-    const LNAME = 'Doe';
-    const AUTH_TRAN_ID = 'r4z34j';
-    const AUTH_AMOUNT = 5.76;
-    const AUTH_CC_LAST_4 = '0004';
-    const CUSTOMER_ID = '221b3649effb4bb1b62fc940691bd18c';
-    const PAYER_EMAIL = 'jogndoe@example.com';
-    const PAYER_ID = 'PAYERID';
-    const AUTHORIZATION_ID = 'PAY-ID';
-    const PAYMENT_ID = 'PAYMENT-ID';
-
-    /**
-     * @var \Magento\Braintree\Model\PaymentMethod\PayPal
-     */
-    protected $model;
-
-    /**
-     * @var ObjectManagerHelper
-     */
-    protected $objectManagerHelper;
-
-    /**
-     * @var \Magento\Braintree\Model\Config\Cc|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $configMock;
-
-    /**
-     * @var \Magento\Braintree\Model\Vault|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $vaultMock;
-
-    /**
-     * @var \Magento\Framework\Registry|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $registryMock;
-
-    /**
-     * @var \Magento\Payment\Model\InfoInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $infoInstanceMock;
-
-    /**
-     * @var TransactionCollectionFactory|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $salesTransactionCollectionFactoryMock;
-
-    /**
-     * @var \Magento\Payment\Model\Method\Logger|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $loggerMock;
-
-    /**
-     * @var \Magento\Braintree\Helper\Data|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $helperMock;
-
-    /**
-     * @var \Magento\Directory\Model\RegionFactory|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $regionFactoryMock;
-
-    /**
-     * @var \Magento\Framework\App\ProductMetadataInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $productMetaDataMock;
-
-    /**
-     * @var \Magento\Braintree\Helper\Error|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $errorHelperMock;
-
-    /**
-     * @var \Magento\Framework\Model\Context|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $contextMock;
-
-    /**
-     * @var \Psr\Log\LoggerInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $psrLoggerMock;
-
-    /**
-     * @var \Magento\Braintree\Model\Adapter\BraintreeTransaction|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $braintreeTransactionMock;
-
-    /**
-     * @var \Magento\Braintree\Model\Adapter\BraintreeCreditCard|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $braintreeCreditCardMock;
-
-    /**
-     * @var \Magento\Braintree\Model\Config\PayPal|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $payPalConfigMock;
-
-    protected function setUp()
-    {
-        $this->contextMock = $this->getMockBuilder('\Magento\Framework\Model\Context')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->configMock = $this->getMockBuilder('\Magento\Braintree\Model\Config\Cc')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->payPalConfigMock = $this->getMockBuilder('\Magento\Braintree\Model\Config\PayPal')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->vaultMock = $this->getMockBuilder('\Magento\Braintree\Model\Vault')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->registryMock = $this->getMockBuilder('\Magento\Framework\Registry')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->salesTransactionCollectionFactoryMock = $this->getMockBuilder(
-            '\Magento\Sales\Model\ResourceModel\Order\Payment\Transaction\CollectionFactory'
-        )->disableOriginalConstructor()
-            ->getMock();
-        $this->productMetaDataMock = $this->getMockBuilder('\Magento\Framework\App\ProductMetadataInterface')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->helperMock = $this->getMockBuilder('\Magento\Braintree\Helper\Data')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->errorHelperMock = $this->getMockBuilder('\Magento\Braintree\Helper\Error')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->regionFactoryMock = $this->getMockBuilder('\Magento\Directory\Model\RegionFactory')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->loggerMock = $this->getMockBuilder('\Magento\Payment\Model\Method\Logger')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->braintreeTransactionMock = $this->getMockBuilder(
-            '\Magento\Braintree\Model\Adapter\BraintreeTransaction'
-        )->getMock();
-        $this->braintreeCreditCardMock = $this->getMockBuilder(
-            '\Magento\Braintree\Model\Adapter\BraintreeCreditCard'
-        )->getMock();
-
-        $this->psrLoggerMock = $this->getMock('\\Psr\Log\LoggerInterface');
-        $this->contextMock->expects($this->any())
-            ->method('getLogger')
-            ->willReturn($this->psrLoggerMock);
-
-        $this->objectManagerHelper = new ObjectManagerHelper($this);
-        $this->model = $this->objectManagerHelper->getObject(
-            'Magento\Braintree\Model\PaymentMethod\PayPal',
-            [
-                'context' => $this->contextMock,
-                'config' => $this->configMock,
-                'vault' => $this->vaultMock,
-                'registry' => $this->registryMock,
-                'salesTransactionCollectionFactory' => $this->salesTransactionCollectionFactoryMock,
-                'productMetaData' => $this->productMetaDataMock,
-                'braintreeHelper' => $this->helperMock,
-                'errorHelper' => $this->errorHelperMock,
-                'regionFactory' => $this->regionFactoryMock,
-                'logger' => $this->loggerMock,
-                'braintreeTransaction' => $this->braintreeTransactionMock,
-                'braintreeCreditCard' => $this->braintreeCreditCardMock,
-                'payPalConfig' => $this->payPalConfigMock,
-            ]
-        );
-
-        $this->infoInstanceMock = $this->getMockForAbstractClass(
-            '\Magento\Payment\Model\InfoInterface',
-            [],
-            '',
-            false,
-            false,
-            false,
-            [
-                'setCcType',
-                'setCcOwner',
-                'setCcLast4',
-                'setCcNumber',
-                'setCcCid',
-                'setCcExpMonth',
-                'setCcExpYear',
-                'setCcSsIssue',
-                'setCcSsStartMonth',
-                'setCcSsStartYear',
-                'getOrder',
-                'getQuote',
-                'getCcType',
-            ]
-        );
-
-        $this->productMetaDataMock->expects($this->any())
-            ->method('getEdition')
-            ->willReturn('Community Edition');
-        $this->productMetaDataMock->expects($this->any())
-            ->method('getVersion')
-            ->willReturn('2.0');
-    }
-
-    public function testAssignData()
-    {
-        $ccLast4 = '9216';
-        $ccToken = 'erf6re';
-        $paymentMethodNonce = 'nonce';
-        $storeInVault = true;
-        $data = [
-            'cc_last4' => $ccLast4,
-            'cc_token' => $ccToken,
-            'payment_method_nonce' => $paymentMethodNonce,
-            'store_in_vault' => $storeInVault,
-        ];
-        $data = new \Magento\Framework\DataObject($data);
-        $this->model->setInfoInstance($this->infoInstanceMock);
-
-        //ignore all fields except for payment_method_nonce
-        $this->infoInstanceMock->expects($this->once())
-            ->method('setAdditionalInformation')
-            ->with('payment_method_nonce', $paymentMethodNonce);
-        $this->model->assignData($data);
-    }
-
-    //Start: test validate
-    /**
-     * @param $countryId
-     * @param $ccType
-     * @param null $ccToken
-     */
-    protected function setupInfoInstance(
-        $countryId,
-        $ccType,
-        $ccToken = null
-    ) {
-        $quoteObj = new \Magento\Framework\DataObject(
-            [
-                'billing_address' => new \Magento\Framework\DataObject(
-                    [
-                        'country_id' => $countryId,
-                    ]
-                ),
-            ]
-        );
-        $this->infoInstanceMock->expects($this->once())
-            ->method('getQuote')
-            ->willReturn($quoteObj);
-
-        if ($ccType) {
-            $this->infoInstanceMock->expects($this->once())
-                ->method('getCcType')
-                ->willReturn($ccType);
-        }
-        if ($ccToken) {
-            $this->infoInstanceMock->expects($this->any())
-                ->method('getAdditionalInformation')
-                ->with('cc_token')
-                ->willReturn($ccToken);
-        }
-        return;
-    }
-
-    /**
-     * @expectedException \Magento\Framework\Exception\LocalizedException
-     * @expectedExceptionMessage Selected payment type is not allowed for billing country.
-     */
-    public function testValidateInvalidCountry()
-    {
-        $countryId = 'US';
-        $this->setupInfoInstance($countryId, null);
-
-        $this->model->setInfoInstance($this->infoInstanceMock);
-
-        $this->payPalConfigMock->expects($this->once())
-            ->method('canUseForCountry')
-            ->with($countryId)
-            ->willReturn(false);
-        $this->model->validate();
-    }
-
-    public function testValidate()
-    {
-        $countryId = 'US';
-        $this->setupInfoInstance($countryId, null);
-
-        $this->model->setInfoInstance($this->infoInstanceMock);
-
-        $this->payPalConfigMock->expects($this->once())
-            ->method('canUseForCountry')
-            ->with($countryId)
-            ->willReturn(true);
-        $this->assertEquals($this->model, $this->model->validate());
-    }
-    //END: test validate
-
-    //Start: test authorize
-    protected function setupOrderMock(
-        $billingAddress,
-        $shippingAddress,
-        $customerEmail,
-        $orderId,
-        $customerId,
-        $storeId
-    ) {
-        $orderMock = $this->getMockBuilder('Magento\Sales\Model\Order')
-            ->disableOriginalConstructor()
-            ->setMethods(
-                [
-                    'getIncrementId',
-                    'getBillingAddress',
-                    'getShippingAddress',
-                    'getCustomerEmail',
-                    'getCustomerId',
-                    'getStoreId',
-                ]
-            )->getMock();
-
-        $orderMock->expects($this->any())
-            ->method('getIncrementId')
-            ->willReturn($orderId);
-        $orderMock->expects($this->any())
-            ->method('getBillingAddress')
-            ->willReturn($billingAddress);
-        $orderMock->expects($this->any())
-            ->method('getShippingAddress')
-            ->willReturn($shippingAddress);
-        $orderMock->expects($this->any())
-            ->method('getCustomerEmail')
-            ->willReturn($customerEmail);
-        $orderMock->expects($this->any())
-            ->method('getCustomerId')
-            ->willReturn($customerId);
-        $orderMock->expects($this->any())
-            ->method('getStoreId')
-            ->willReturn($storeId);
-        return $orderMock;
-    }
-
-    /**
-     * @param \Magento\Framework\DataObject $paymentObject
-     * @param int $storeId
-     * @return array
-     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
-     */
-    protected function setupPaymentObject(
-        \Magento\Framework\DataObject $paymentObject,
-        $storeId
-    ) {
-        $customerId = '12';
-        $customerEmail = 'abc@example.com';
-        $company = 'NA';
-        $phone = '3316655';
-        $fax = '3316677';
-        $orderId = '100000024';
-        $street = '1201 N 1st Stree';
-        $street2 = 'build 45';
-        $city = 'San Jose';
-        $region = 'California';
-        $regionCode = 'CA';
-        $regionId = 65;
-        $postcode = '63241';
-        $countryId = 'US';
-
-        $addressData = [
-            'firstname' => self::FNAME,
-            'lastname' => self::LNAME,
-            'company' => $company,
-            'telephone' => $phone,
-            'fax' => $fax,
-            'street' => [$street, $street2],
-            'city' => $city,
-            'region' => $region,
-            'region_id' => $regionId,
-            'postcode' => $postcode,
-            'country_id' => $countryId,
-            'address_type' => 'billing',
-        ];
-
-        $billingAddress = new \Magento\Framework\DataObject(
-            $addressData
-        );
-        $addressData['address_type'] = 'shipping';
-        $shippingAddress = new \Magento\Framework\DataObject(
-            $addressData
-        );
-
-        $order = $this->setupOrderMock(
-            $billingAddress,
-            $shippingAddress,
-            $customerEmail,
-            $orderId,
-            $customerId,
-            $storeId
-        );
-
-        $paymentObject->setOrder($order);
-        $this->helperMock->expects($this->once())
-            ->method('generateCustomerId')
-            ->with($customerId, $customerEmail)
-            ->willReturn(self::CUSTOMER_ID);
-
-        $regionMock = $this->getMockBuilder('Magento\Directory\Model\Region')
-            ->disableOriginalConstructor()
-            ->setMethods(['getId', 'getCode', 'load'])
-            ->getMock();
-        $regionMock->expects($this->any())
-            ->method('getId')
-            ->willReturn($regionId);
-        $regionMock->expects($this->any())
-            ->method('getCode')
-            ->willReturn($regionCode);
-        $regionMock->expects($this->any())
-            ->method('load')
-            ->with($regionId)
-            ->willReturnSelf();
-        $this->regionFactoryMock->expects($this->any())
-            ->method('create')
-            ->willReturn($regionMock);
-
-        $braintreeAddressData = [
-            'firstName'         => self::FNAME,
-            'lastName'          => self::LNAME,
-            'company'           => $company,
-            'streetAddress'     => $street,
-            'extendedAddress'   => $street2,
-            'locality'          => $city,
-            'region'            => $regionCode,
-            'postalCode'        => $postcode,
-            'countryCodeAlpha2' => $countryId,
-        ];
-        return [
-            'channel'   => self::CHANNEL,
-            'orderId'   => $orderId,
-            'customer'  => [
-                'firstName' => self::FNAME,
-                'lastName'  => self::LNAME,
-                'company'   => $company,
-                'phone'     => $phone,
-                'fax'       => $fax,
-                'email'     => $customerEmail,
-            ],
-            'billing' => $braintreeAddressData,
-            'shipping' => $braintreeAddressData,
-        ];
-    }
-
-    /**
-     * @param array $actual
-     * @param array $expected
-     * @return bool
-     * @SuppressWarnings(PHPMD.CyclomaticComplexity)
-     */
-    protected function compareArray(array $actual, array $expected)
-    {
-        foreach ($actual as $key => $value) {
-            if (!isset($expected[$key])) {
-                $this->assertTrue(false, 'Array mismatch for key: ' . $key);
-            }
-            if (is_array($value)) {
-                if (!is_array($expected[$key])) {
-                    $this->assertTrue(false, 'Array mismatch for key: ' . $key);
-                }
-                if (!$this->compareArray($value, $expected[$key])) {
-                    $this->assertTrue(false, 'Array mismatch for key: ' . $key);
-                }
-            } else {
-                if ($value != $expected[$key]) {
-                    $this->assertTrue(false, 'Array mismatch for key: ' . $key);
-                }
-            }
-        }
-        foreach (array_keys($expected) as $key) {
-            if (isset($expected[$key]) && !array_key_exists($key, $actual)) {
-                $this->assertTrue(false, 'Array mismatch for key: ' . $key);
-            }
-        }
-        return true;
-    }
-
-    protected function setupAuthorizeRequest(
-        array $configData,
-        array $paymentInfo,
-        array $expectedRequestAttributes,
-        $paymentObject,
-        $storeId,
-        $amount
-    ) {
-        //setup general payment and order information
-        $transactionRequest = $this->setupPaymentObject(
-            $paymentObject,
-            $storeId
-        );
-
-        //setup config options
-        foreach ($configData as $methodName => $value) {
-            $this->configMock->expects($this->any())
-                ->method($methodName)
-                ->willReturn($value);
-        }
-
-        //setup payment info instance
-        $this->infoInstanceMock->expects($this->any())
-            ->method('getAdditionalInformation')
-            ->willReturnMap($paymentInfo);
-        $this->model->setInfoInstance($this->infoInstanceMock);
-
-        $expectedRequestAttribs = array_merge($transactionRequest, $expectedRequestAttributes);
-        $expectedRequestAttribs['amount'] = $amount;
-
-        return $expectedRequestAttribs;
-    }
-
-    /**
-     * @param array $response
-     */
-    protected function setupSuccessResponse(array $response)
-    {
-        $params = array_keys($response);
-        $values = array_values($response);
-        $result = new \Braintree_Result_Successful($values, $params);
-        return $result;
-    }
-
-    /**
-     * @param array $configData
-     * @param array $paymentInfo
-     * @param array $expectedRequestAttributes
-     * @param array $braintreeResponse
-     * @param array $expectedPaymentFields
-     * @dataProvider authorizeDataProvider
-     */
-    public function testAuthorizeSuccess(
-        array $configData,
-        array $paymentInfo,
-        array $expectedRequestAttributes,
-        array $braintreeResponse,
-        array $expectedPaymentFields
-    ) {
-        $storeId = 3;
-        $amount = self::AUTH_AMOUNT;
-        $paymentObject = $this->objectManagerHelper->getObject('Magento\Sales\Model\Order\Payment');
-
-
-        $expectedRequestAttribs = $this->setupAuthorizeRequest(
-            $configData,
-            $paymentInfo,
-            $expectedRequestAttributes,
-            $paymentObject,
-            $storeId,
-            $amount
-        );
-        //setup braintree response
-        $result = $this->setupSuccessResponse($braintreeResponse);
-        $this->braintreeTransactionMock->expects($this->once())
-            ->method('sale')
-            ->with($this->callback(function ($actual) use ($expectedRequestAttribs) {
-                return $this->compareArray($actual, $expectedRequestAttribs);
-            }))
-            ->willReturn($result);
-
-        $this->psrLoggerMock->expects($this->never())
-            ->method('critical');
-
-        $this->assertEquals($this->model, $this->model->authorize($paymentObject, $amount));
-        foreach ($expectedPaymentFields as $key => $value) {
-            if ($key == 'getTransactionAdditionalInfo') {
-                $this->assertEquals($value, $paymentObject->getTransactionAdditionalInfo());
-            } else {
-                $this->assertEquals($value, $paymentObject->getData($key), 'Incorrect field in paymentobject: ' . $key);
-            }
-        }
-        $this->assertEquals($storeId, $this->model->getStore());
-        $this->assertEquals(PaymentMethod::STATUS_APPROVED, $paymentObject->getStatus());
-    }
-
-    /**
-     * @return array
-     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
-     */
-    public function authorizeDataProvider()
-    {
-        return [
-            'paypal_payment_nonce' => [
-                'config' => [
-                    'is3dSecureEnabled' => false,
-                    'isFraudProtectionEnabled' => false,
-                    'isDebugEnabled' => false,
-                    'useVault' => false,
-                    'getMerchantAccountId' => self::MERCHANT_ACCOUNT_ID,
-                ],
-                'infoInstanceValueMap' => [
-                    ['store_in_vault', null],
-                    ['payment_method_nonce', self::PAYMENT_METHOD_NONCE],
-                    ['device_data', 'fraud_detection_data'],
-                ],
-                'expectedParams' => [
-                    'options' => [
-                        'addBillingAddressToPaymentMethod' => true,
-                    ],
-                    'merchantAccountId' => self::MERCHANT_ACCOUNT_ID,
-                    'paymentMethodNonce' => self::PAYMENT_METHOD_NONCE,
-                ],
-                'braintree_response' => [
-                    'transaction' => \Braintree_Transaction::factory(
-                        [
-                            'id' => self::AUTH_TRAN_ID,
-                            'gatewayRejectionReason' => null,
-                            'processorAuthorizationCode' => 'S02T5Q',
-                            'processorResponseCode' => '1000',
-                            'processorResponseText' => 'Approved',
-                            'paypal' => [
-                                'payerEmail' => self::PAYER_EMAIL,
-                                'paymentId' => self::PAYMENT_ID,
-                                'authorizationId' => self::AUTHORIZATION_ID,
-                                'payerId' => self::PAYER_ID,
-                                'payerFirstName' => self::FNAME,
-                                'payerLastName' => self::LNAME,
-                            ]
-                        ]
-                    ),
-                ],
-                'expected_payment_fields' => [
-                    'status' => 'APPROVED',
-                    'cc_trans_id' => self::AUTH_TRAN_ID,
-                    'last_trans_id' => self::AUTH_TRAN_ID,
-                    'transaction_id' => self::AUTH_TRAN_ID,
-                    'is_transactioN_cloned' => 0,
-                    'amount' => self::AUTH_AMOUNT,
-                    'should_close_parent_transaction' => false,
-                    'additional_information' => [
-                        'processorAuthorizationCode' => 'S02T5Q',
-                        'processorResponseCode' => '1000',
-                        'processorResponseText' => 'Approved',
-                        'payerEmail' => self::PAYER_EMAIL,
-                        'paymentId' => self::PAYMENT_ID,
-                        'authorizationId' => self::AUTHORIZATION_ID,
-                        'payerId' => self::PAYER_ID,
-                        'payerFirstName' => self::FNAME,
-                        'payerLastName' => self::LNAME,
-                    ],
-                ],
-            ],
-            'paypal_payment_nonce_fraud_protection' => [
-                'config' => [
-                    'is3dSecureEnabled' => false,
-                    'isFraudProtectionEnabled' => true,
-                    'isDebugEnabled' => false,
-                    'useVault' => false,
-                    'getMerchantAccountId' => self::MERCHANT_ACCOUNT_ID,
-                ],
-                'infoInstanceValueMap' => [
-                    ['store_in_vault', null],
-                    ['payment_method_nonce', self::PAYMENT_METHOD_NONCE],
-                    ['device_data', 'fraud_detection_data'],
-                ],
-                'expectedParams' => [
-                    'options' => [
-                        'addBillingAddressToPaymentMethod' => true,
-                    ],
-                    'merchantAccountId' => self::MERCHANT_ACCOUNT_ID,
-                    'paymentMethodNonce' => self::PAYMENT_METHOD_NONCE,
-                    'deviceData' => 'fraud_detection_data',
-                ],
-                'braintree_response' => [
-                    'transaction' => \Braintree_Transaction::factory(
-                        [
-                            'id' => self::AUTH_TRAN_ID,
-                            'gatewayRejectionReason' => null,
-                            'processorAuthorizationCode' => 'S02T5Q',
-                            'processorResponseCode' => '1000',
-                            'processorResponseText' => 'Approved',
-                            'paypal' => [
-                                'payerEmail' => self::PAYER_EMAIL,
-                                'paymentId' => self::PAYMENT_ID,
-                                'authorizationId' => self::AUTHORIZATION_ID,
-                                'payerId' => self::PAYER_ID,
-                                'payerFirstName' => self::FNAME,
-                                'payerLastName' => self::LNAME,
-                            ]
-                        ]
-                    ),
-                ],
-                'expected_payment_fields' => [
-                    'status' => 'APPROVED',
-                    'cc_trans_id' => self::AUTH_TRAN_ID,
-                    'last_trans_id' => self::AUTH_TRAN_ID,
-                    'transaction_id' => self::AUTH_TRAN_ID,
-                    'is_transactioN_cloned' => 0,
-                    'amount' => self::AUTH_AMOUNT,
-                    'should_close_parent_transaction' => false,
-                    'additional_information' => [
-                        'processorAuthorizationCode' => 'S02T5Q',
-                        'processorResponseCode' => '1000',
-                        'processorResponseText' => 'Approved',
-                        'payerEmail' => self::PAYER_EMAIL,
-                        'paymentId' => self::PAYMENT_ID,
-                        'authorizationId' => self::AUTHORIZATION_ID,
-                        'payerId' => self::PAYER_ID,
-                        'payerFirstName' => self::FNAME,
-                        'payerLastName' => self::LNAME,
-                    ],
-                ],
-            ],
-        ];
-    }
-    //End: test authorize
-
-    //Start: test capture
-    protected function setupPaymentObjectForCapture(
-        $paymentId
-    ) {
-        $paymentObject = $this->objectManagerHelper->getObject(
-            'Magento\Sales\Model\Order\Payment',
-            [
-                'data' => [
-                    'id' => $paymentId,
-                    'cc_trans_id' => self::AUTH_TRAN_ID,
-                ]
-            ]
-        );
-
-        return $paymentObject;
-    }
-    public function testCaptureSuccess()
-    {
-        $amount = self::AUTH_AMOUNT;
-        $paymentId = 1005;
-
-        $paymentObject = $this->setupPaymentObjectForCapture($paymentId);
-
-        $successResult = $this->setupSuccessResponse([]);
-        $this->braintreeTransactionMock->expects($this->once())
-            ->method('submitForSettlement')
-            ->with(self::AUTH_TRAN_ID, $amount)
-            ->willReturn($successResult);
-
-        $this->psrLoggerMock->expects($this->never())
-            ->method('critical');
-
-        $this->model->capture($paymentObject, $amount);
-        $this->assertEquals(false, $paymentObject->getIsTransactionClosed());
-        $this->assertEquals(true, $paymentObject->getShouldCloseParentTransaction());
-    }
-
-    /**
-     * @expectedException \Magento\Framework\Exception\LocalizedException
-     * @expectedExceptionMessage There was an error capturing the transaction: error.
-     */
-    public function testCaptureError()
-    {
-        $amount = self::AUTH_AMOUNT;
-        $paymentId = 1005;
-
-        $paymentObject = $this->setupPaymentObjectForCapture($paymentId);
-
-        //setup braintree error response
-        $resultError = $this->getMockBuilder('\Braintree_Result_Error')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->errorHelperMock->expects($this->once())
-            ->method('parseBraintreeError')
-            ->with($resultError)
-            ->willReturn(new \Magento\Framework\Phrase('error'));
-        $this->braintreeTransactionMock->expects($this->once())
-            ->method('submitForSettlement')
-            ->with(self::AUTH_TRAN_ID, $amount)
-            ->willReturn($resultError);
-
-        $this->psrLoggerMock->expects($this->once())
-            ->method('critical');
-
-        $this->model->capture($paymentObject, $amount);
-    }
-    //End: test capture
-
-    public function testGetConfigData()
-    {
-        $field = 'configFieldName';
-        $storeId = '2';
-        $configValue = 'configValue';
-
-        $this->payPalConfigMock->expects($this->once())
-            ->method('getConfigData')
-            ->with($field, $storeId)
-            ->willReturn($configValue);
-
-        $this->assertEquals($configValue, $this->model->getConfigData($field, $storeId));
-    }
-}
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Model/Paypal/Helper/OrderPlaceTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Paypal/Helper/OrderPlaceTest.php
similarity index 97%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Model/Paypal/Helper/OrderPlaceTest.php
rename to app/code/Magento/Braintree/Test/Unit/Model/Paypal/Helper/OrderPlaceTest.php
index 41ab8adab431706ebb89041975646a377c3858fd..2af45299e33f62da71c8ec514caca94f70cc0c44 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Model/Paypal/Helper/OrderPlaceTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Model/Paypal/Helper/OrderPlaceTest.php
@@ -3,9 +3,9 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Model\Paypal\Helper;
+namespace Magento\Braintree\Test\Unit\Model\Paypal\Helper;
 
-use Magento\BraintreeTwo\Model\Paypal\Helper\OrderPlace;
+use Magento\Braintree\Model\Paypal\Helper\OrderPlace;
 use Magento\Checkout\Api\AgreementsValidatorInterface;
 use Magento\Checkout\Helper\Data;
 use Magento\Checkout\Model\Type\Onepage;
@@ -18,7 +18,7 @@ use Magento\Quote\Model\Quote\Address;
 /**
  * Class OrderPlaceTest
  *
- * @see \Magento\BraintreeTwo\Model\Paypal\Helper\OrderPlace
+ * @see \Magento\Braintree\Model\Paypal\Helper\OrderPlace
  *
  * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
  */
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Model/Paypal/Helper/QuoteUpdaterTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Paypal/Helper/QuoteUpdaterTest.php
similarity index 96%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Model/Paypal/Helper/QuoteUpdaterTest.php
rename to app/code/Magento/Braintree/Test/Unit/Model/Paypal/Helper/QuoteUpdaterTest.php
index 0ca3df59073aaa02b9e9928dbad9255b996954dd..56f5b9d6a364c9a310bdccb10c3f067c1eb9d659 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Model/Paypal/Helper/QuoteUpdaterTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Model/Paypal/Helper/QuoteUpdaterTest.php
@@ -3,21 +3,21 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Model\Paypal\Helper;
+namespace Magento\Braintree\Test\Unit\Model\Paypal\Helper;
 
 use Magento\Quote\Model\Quote;
 use Magento\Quote\Model\Quote\Address;
 use Magento\Quote\Model\Quote\Payment;
 use Magento\Quote\Api\CartRepositoryInterface;
-use Magento\BraintreeTwo\Model\Ui\ConfigProvider;
-use Magento\BraintreeTwo\Observer\DataAssignObserver;
-use Magento\BraintreeTwo\Gateway\Config\PayPal\Config;
-use Magento\BraintreeTwo\Model\Paypal\Helper\QuoteUpdater;
+use Magento\Braintree\Model\Ui\ConfigProvider;
+use Magento\Braintree\Observer\DataAssignObserver;
+use Magento\Braintree\Gateway\Config\PayPal\Config;
+use Magento\Braintree\Model\Paypal\Helper\QuoteUpdater;
 
 /**
  * Class QuoteUpdaterTest
  *
- * @see \Magento\BraintreeTwo\Model\Paypal\Helper\QuoteUpdater
+ * @see \Magento\Braintree\Model\Paypal\Helper\QuoteUpdater
  *
  * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
  */
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Model/Paypal/Helper/ShippingMethodUpdaterTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Paypal/Helper/ShippingMethodUpdaterTest.php
similarity index 95%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Model/Paypal/Helper/ShippingMethodUpdaterTest.php
rename to app/code/Magento/Braintree/Test/Unit/Model/Paypal/Helper/ShippingMethodUpdaterTest.php
index 74a40093af0526d044f1742de1e86a02de15e53c..d3791191fd7fd90899618744e11cb368006df763 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Model/Paypal/Helper/ShippingMethodUpdaterTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Model/Paypal/Helper/ShippingMethodUpdaterTest.php
@@ -3,18 +3,18 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Model\Paypal\Helper;
+namespace Magento\Braintree\Test\Unit\Model\Paypal\Helper;
 
 use Magento\Quote\Model\Quote;
 use Magento\Quote\Model\Quote\Address;
 use Magento\Quote\Api\CartRepositoryInterface;
-use Magento\BraintreeTwo\Gateway\Config\PayPal\Config;
-use Magento\BraintreeTwo\Model\Paypal\Helper\ShippingMethodUpdater;
+use Magento\Braintree\Gateway\Config\PayPal\Config;
+use Magento\Braintree\Model\Paypal\Helper\ShippingMethodUpdater;
 
 /**
  * Class ShippingMethodUpdaterTest
  *
- * @see \Magento\BraintreeTwo\Model\Paypal\Helper\ShippingMethodUpdater
+ * @see \Magento\Braintree\Model\Paypal\Helper\ShippingMethodUpdater
  */
 class ShippingMethodUpdaterTest extends \PHPUnit_Framework_TestCase
 {
diff --git a/app/code/Magento/Braintree/Test/Unit/Model/Plugin/Sales/Order/PaymentPluginTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Plugin/Sales/Order/PaymentPluginTest.php
deleted file mode 100644
index 8ee3b2f738c0a52825ddd1b33d7f45f74a8d6d4c..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Model/Plugin/Sales/Order/PaymentPluginTest.php
+++ /dev/null
@@ -1,215 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Model\Plugin\Sales\Order;
-
-use Magento\Braintree\Model\PaymentMethod;
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
-use Magento\Sales\Model\ResourceModel\Order\Payment\Transaction\CollectionFactory as TransactionCollectionFactory;
-
-/**
- * Class PaymentPluginTest
- *
- */
-class PaymentPluginTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Braintree\Model\Plugin\Sales\Order\PaymentPlugin
-     */
-    protected $model;
-
-    /**
-     * @var ObjectManagerHelper
-     */
-    protected $objectManagerHelper;
-
-    /**
-     * @var \Magento\Framework\Registry|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $registryMock;
-
-    /**
-     * @var TransactionCollectionFactory|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $transactionCollectionFactoryMock;
-
-    /**
-     * @var \Magento\Braintree\Helper\Data|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $helperMock;
-
-    protected function setUp()
-    {
-        $this->registryMock = $this->getMockBuilder('\Magento\Framework\Registry')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->helperMock = $this->getMockBuilder('\Magento\Braintree\Helper\Data')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->transactionCollectionFactoryMock = $this->getMockBuilder(
-            'Magento\Sales\Model\ResourceModel\Order\Payment\Transaction\CollectionFactory'
-        )->disableOriginalConstructor()
-            ->setMethods(['create'])
-            ->getMock();
-
-        $this->objectManagerHelper = new ObjectManagerHelper($this);
-        $this->model = $this->objectManagerHelper->getObject(
-            'Magento\Braintree\Model\Plugin\Sales\Order\PaymentPlugin',
-            [
-                'registry' => $this->registryMock,
-                'salesTransactionCollectionFactory' => $this->transactionCollectionFactoryMock,
-                'paymentHelper' => $this->helperMock,
-            ]
-        );
-    }
-
-    public function testAroundGetAuthorizationTransactionNotPaymentMethod()
-    {
-        $result = 'result';
-        $proceed = function () use ($result) {
-            return $result;
-        };
-
-        $methodInstanceMock = $this->getMock('\Magento\Payment\Model\MethodInterface');
-        $methodInstanceMock->expects($this->once())
-            ->method('getCode')
-            ->willReturn('PayPal');
-
-        $payment = $this->getMockBuilder('\Magento\Sales\Model\Order\Payment')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $payment->expects($this->once())
-            ->method('getMethodInstance')
-            ->willReturn($methodInstanceMock);
-
-        $this->assertEquals($result, $this->model->aroundGetAuthorizationTransaction($payment, $proceed));
-    }
-
-    public function testAroundGetAuthorizationTransaction()
-    {
-        $result = 'result';
-        $transactionId = 're45gf';
-        $transaction = 'invoice_transaction';
-
-        $proceed = function () use ($result) {
-            return $result;
-        };
-
-        $methodInstanceMock = $this->getMock('\Magento\Payment\Model\MethodInterface');
-        $methodInstanceMock->expects($this->once())
-            ->method('getCode')
-            ->willReturn(PaymentMethod::METHOD_CODE);
-
-        $invoiceMock = $this->getMockBuilder('\Magento\Sales\Model\Order\Invoice')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $invoiceMock->expects($this->once())
-            ->method('getId')
-            ->willReturn(1004);
-        $invoiceMock->expects($this->once())
-            ->method('getTransactionId')
-            ->willReturn($transactionId);
-        $this->helperMock->expects($this->once())
-            ->method('clearTransactionId')
-            ->with($transactionId)
-            ->willReturn($transactionId);
-
-        $collectionMock =
-            $this->getMockBuilder('\Magento\Sales\Model\ResourceModel\Order\Payment\Transaction\Collection')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->transactionCollectionFactoryMock->expects($this->once())
-            ->method('create')
-            ->willReturn($collectionMock);
-        $collectionMock->expects($this->once())
-            ->method('addFieldToFilter')
-            ->with('txn_id', ['eq' => $transactionId])
-            ->willReturnSelf();
-        $collectionMock->expects($this->once())
-            ->method('getSize')
-            ->willReturn(1);
-        $collectionMock->expects($this->once())
-            ->method('getFirstItem')
-            ->willReturn($transaction);
-
-        $this->registryMock->expects($this->once())
-            ->method('registry')
-            ->with('current_invoice')
-            ->willReturn($invoiceMock);
-
-        $payment = $this->getMockBuilder('\Magento\Sales\Model\Order\Payment')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $payment->expects($this->once())
-            ->method('getMethodInstance')
-            ->willReturn($methodInstanceMock);
-
-        $this->assertEquals($transaction, $this->model->aroundGetAuthorizationTransaction($payment, $proceed));
-    }
-    public function testAroundGetAuthorizationTransactionNoInvoiceTransaction()
-    {
-        $result = 'result';
-        $transactionId = 're45gf';
-        $transaction = 'invoice_transaction';
-
-        $proceed = function () use ($result) {
-            return $result;
-        };
-
-        $methodInstanceMock = $this->getMock('\Magento\Payment\Model\MethodInterface');
-        $methodInstanceMock->expects($this->once())
-            ->method('getCode')
-            ->willReturn(PaymentMethod::METHOD_CODE);
-
-        $invoiceMock = $this->getMockBuilder('\Magento\Sales\Model\Order\Invoice')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $invoiceMock->expects($this->once())
-            ->method('getId')
-            ->willReturn(1004);
-        $invoiceMock->expects($this->once())
-            ->method('getTransactionId')
-            ->willReturn($transactionId);
-        $this->helperMock->expects($this->once())
-            ->method('clearTransactionId')
-            ->with($transactionId)
-            ->willReturn($transactionId);
-
-        $collectionMock =
-            $this->getMockBuilder('\Magento\Sales\Model\ResourceModel\Order\Payment\Transaction\Collection')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->transactionCollectionFactoryMock->expects($this->once())
-            ->method('create')
-            ->willReturn($collectionMock);
-        $collectionMock->expects($this->once())
-            ->method('addFieldToFilter')
-            ->with('txn_id', ['eq' => $transactionId])
-            ->willReturnSelf();
-        $collectionMock->expects($this->once())
-            ->method('getSize')
-            ->willReturn(0);
-        $collectionMock->expects($this->never())
-            ->method('getFirstItem')
-            ->willReturn($transaction);
-
-        $this->registryMock->expects($this->once())
-            ->method('registry')
-            ->with('current_invoice')
-            ->willReturn($invoiceMock);
-
-        $payment = $this->getMockBuilder('\Magento\Sales\Model\Order\Payment')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $payment->expects($this->once())
-            ->method('getMethodInstance')
-            ->willReturn($methodInstanceMock);
-
-        $this->assertEquals($result, $this->model->aroundGetAuthorizationTransaction($payment, $proceed));
-    }
-}
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Model/Report/BraintreeSearchNodeStub.php b/app/code/Magento/Braintree/Test/Unit/Model/Report/BraintreeSearchNodeStub.php
similarity index 76%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Model/Report/BraintreeSearchNodeStub.php
rename to app/code/Magento/Braintree/Test/Unit/Model/Report/BraintreeSearchNodeStub.php
index 853c72327edeba921380452f6c29871d9ee633f8..b16da3e4a9d28c05314b162c08e0a64459091d55 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Model/Report/BraintreeSearchNodeStub.php
+++ b/app/code/Magento/Braintree/Test/Unit/Model/Report/BraintreeSearchNodeStub.php
@@ -3,7 +3,7 @@
  * Copyright © 2016 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Model\Report;
+namespace Magento\Braintree\Test\Unit\Model\Report;
 
 /**
  * Class BraintreeSearchNodeStub
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Model/Report/BraintreeTransactionStub.php b/app/code/Magento/Braintree/Test/Unit/Model/Report/BraintreeTransactionStub.php
similarity index 96%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Model/Report/BraintreeTransactionStub.php
rename to app/code/Magento/Braintree/Test/Unit/Model/Report/BraintreeTransactionStub.php
index ce8e3f334afcf17619454bf7da1863f2aa903c36..e9f16f59a0786a32877e2f812ae55ecb30bf530f 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Model/Report/BraintreeTransactionStub.php
+++ b/app/code/Magento/Braintree/Test/Unit/Model/Report/BraintreeTransactionStub.php
@@ -3,7 +3,7 @@
  * Copyright © 2016 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Model\Report;
+namespace Magento\Braintree\Test\Unit\Model\Report;
 
 /**
  * Class BraintreeSearchNodeStub
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Model/Report/FilterMapperTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Report/FilterMapperTest.php
similarity index 89%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Model/Report/FilterMapperTest.php
rename to app/code/Magento/Braintree/Test/Unit/Model/Report/FilterMapperTest.php
index 2de0a7ae522a7804d494acacd74811d23555dd26..02f1623c955c7732a77cee90a36712c6a0dc3e23 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Model/Report/FilterMapperTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Model/Report/FilterMapperTest.php
@@ -3,17 +3,17 @@
  * Copyright © 2016 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Model\Report;
+namespace Magento\Braintree\Test\Unit\Model\Report;
 
-use Magento\BraintreeTwo\Model\Adapter\BraintreeSearchAdapter;
-use Magento\BraintreeTwo\Model\Report\ConditionAppliers\ApplierInterface;
-use Magento\BraintreeTwo\Model\Report\ConditionAppliers\AppliersPool;
-use Magento\BraintreeTwo\Model\Report\FilterMapper;
+use Magento\Braintree\Model\Adapter\BraintreeSearchAdapter;
+use Magento\Braintree\Model\Report\ConditionAppliers\ApplierInterface;
+use Magento\Braintree\Model\Report\ConditionAppliers\AppliersPool;
+use Magento\Braintree\Model\Report\FilterMapper;
 
 /**
  * Class FilterMapperTest
  *
- * Test for class \Magento\BraintreeTwo\Model\Report\FilterMapper
+ * Test for class \Magento\Braintree\Model\Report\FilterMapper
  */
 class FilterMapperTest extends \PHPUnit_Framework_TestCase
 {
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Model/Report/TransactionMapTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionMapTest.php
similarity index 93%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Model/Report/TransactionMapTest.php
rename to app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionMapTest.php
index f17c79e9088b26d54f5cafac841545d93fcb78c8..c44a67b2c61d92cabe3087e9a47f20f1b94f9250 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Model/Report/TransactionMapTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionMapTest.php
@@ -3,12 +3,12 @@
  * Copyright © 2016 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Model\Report;
+namespace Magento\Braintree\Test\Unit\Model\Report;
 
 use Braintree\Transaction;
 use Braintree\Transaction\PayPalDetails;
 use DateTime;
-use Magento\BraintreeTwo\Model\Report\Row\TransactionMap;
+use Magento\Braintree\Model\Report\Row\TransactionMap;
 use Magento\Framework\Api\AttributeValue;
 use Magento\Framework\Api\AttributeValueFactory;
 use Magento\Store\Model\StoreManagerInterface;
@@ -16,7 +16,7 @@ use Magento\Store\Model\StoreManagerInterface;
 /**
  * Class TransactionMapTest
  *
- * Test for class \Magento\BraintreeTwo\Model\Report\\Row\TransactionMap
+ * Test for class \Magento\Braintree\Model\Report\\Row\TransactionMap
  */
 class TransactionMapTest extends \PHPUnit_Framework_TestCase
 {
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Model/Report/TransactionsCollectionTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionsCollectionTest.php
similarity index 95%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Model/Report/TransactionsCollectionTest.php
rename to app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionsCollectionTest.php
index c7d18298eb679fbbb21927261436fc1b31aed17a..50488df2600c64f1267755b0da98cee69c993789 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Model/Report/TransactionsCollectionTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionsCollectionTest.php
@@ -3,11 +3,11 @@
  * Copyright © 2016 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Model\Report;
+namespace Magento\Braintree\Test\Unit\Model\Report;
 
-use Magento\BraintreeTwo\Model\Adapter\BraintreeAdapter;
-use Magento\BraintreeTwo\Model\Report\FilterMapper;
-use Magento\BraintreeTwo\Model\Report\TransactionsCollection;
+use Magento\Braintree\Model\Adapter\BraintreeAdapter;
+use Magento\Braintree\Model\Report\FilterMapper;
+use Magento\Braintree\Model\Report\TransactionsCollection;
 use Magento\Framework\Api\Search\DocumentInterface;
 use Magento\Framework\Data\Collection\EntityFactoryInterface;
 use Magento\Store\Model\StoreManagerInterface;
@@ -15,7 +15,7 @@ use Magento\Store\Model\StoreManagerInterface;
 /**
  * Class TransactionsCollectionTest
  *
- * Test for class \Magento\BraintreeTwo\Model\Report\TransactionsCollection
+ * Test for class \Magento\Braintree\Model\Report\TransactionsCollection
  */
 class TransactionsCollectionTest extends \PHPUnit_Framework_TestCase
 {
diff --git a/app/code/Magento/Braintree/Test/Unit/Model/System/Config/Backend/CountrycreditcardTest.php b/app/code/Magento/Braintree/Test/Unit/Model/System/Config/Backend/CountrycreditcardTest.php
deleted file mode 100644
index 155ee8dcddac44a39569a18ec9c03b87c2a6080a..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Model/System/Config/Backend/CountrycreditcardTest.php
+++ /dev/null
@@ -1,163 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Model\System\Config\Backend;
-
-use Magento\Braintree\Model\Config;
-use Magento\Braintree\Model\PaymentMethod;
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
-
-/**
- * Class CountrycreditcardTest
- *
- */
-class CountrycreditcardTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Braintree\Model\System\Config\Backend\Countrycreditcard
-     */
-    protected $model;
-
-    /**
-     * @var ObjectManagerHelper
-     */
-    protected $objectManagerHelper;
-
-    /**
-     * @var \Magento\Framework\Math\Random|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $mathRandomMock;
-
-    protected function setUp()
-    {
-        $this->objectManagerHelper = new ObjectManagerHelper($this);
-
-        $this->mathRandomMock = $this->getMockBuilder(
-            '\Magento\Framework\Math\Random'
-        )->disableOriginalConstructor()
-            ->getMock();
-
-
-        $this->model = $this->objectManagerHelper->getObject(
-            '\Magento\Braintree\Model\System\Config\Backend\Countrycreditcard',
-            [
-                'mathRandom' => $this->mathRandomMock
-            ]
-        );
-    }
-
-    /**
-     * @dataProvider beforeSaveDataProvider
-     */
-    public function testBeforeSave($value, $expectedValue)
-    {
-        $this->model->setValue($value);
-        $this->model->beforeSave();
-        $this->assertEquals($expectedValue, $this->model->getValue());
-    }
-
-    public function beforeSaveDataProvider()
-    {
-        return [
-            'empty_value' => [
-                'value' => [],
-                'expected' => serialize([]),
-            ],
-            'not_array' => [
-                'value' => [
-                    '1' => 'abc',
-                ],
-                'expected' => serialize([]),
-            ],
-            'array_with_invalid_format' => [
-                'value' => [
-                    '1' => [
-                        'country_id' => 'US',
-                    ],
-                ],
-                'expected' => serialize([]),
-            ],
-            'array_with_two_countries' => [
-                'value' => [
-                    '1' => [
-                        'country_id' => 'AF',
-                        'cc_types' => [
-                            'AE',
-                            'VI',
-                        ]
-                    ],
-                    '2' => [
-                        'country_id' => 'US',
-                        'cc_types' => [
-                            'AE',
-                            'VI',
-                            'MA',
-                        ]
-                    ],
-                    '__empty' => "",
-                ],
-                'expected' => serialize(
-                    [
-                        'AF' => ['AE', 'VI'],
-                        'US' => ['AE', 'VI', 'MA'],
-                    ]
-                ),
-            ],
-        ];
-    }
-
-    /**
-     * @dataProvider afterLoadDataProvider
-     */
-    public function testAfterLoad($value, $hashData, $expected)
-    {
-        $this->model->setValue($value);
-        $index = 0;
-        foreach ($hashData as $hash) {
-            $this->mathRandomMock->expects($this->at($index))
-                ->method('getUniqueHash')
-                ->willReturn($hash);
-            $index++;
-        }
-        $this->model->afterLoad();
-        $this->assertEquals($expected, $this->model->getValue());
-    }
-
-    public function afterLoadDataProvider()
-    {
-        return [
-            'empty' => [
-                'value' => serialize([]),
-                'randomHash' => [],
-                'expected' => [],
-            ],
-            'null' => [
-                'value' => null,
-                'randomHash' => [],
-                'expected' => null,
-            ],
-            'valid_data' => [
-                'value' => serialize(
-                    [
-                        'US' => ['AE', 'VI', 'MA'],
-                        'AF' => ['AE', 'MA'],
-                    ]
-                ),
-                'randomHash' => ['hash_1', 'hash_2'],
-                'expected' => [
-                    'hash_1' => [
-                        'country_id' => 'US',
-                        'cc_types' => ['AE', 'VI', 'MA'],
-                    ],
-                    'hash_2' => [
-                        'country_id' => 'AF',
-                        'cc_types' => ['AE', 'MA'],
-                    ],
-                ]
-            ],
-        ];
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Model/System/Config/Backend/UsevaultTest.php b/app/code/Magento/Braintree/Test/Unit/Model/System/Config/Backend/UsevaultTest.php
deleted file mode 100644
index f76ed4b387ab11cf988f9b6ea468503a30ada18b..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Model/System/Config/Backend/UsevaultTest.php
+++ /dev/null
@@ -1,100 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Model\System\Config\Backend;
-
-use Magento\Braintree\Model\Config;
-use Magento\Braintree\Model\PaymentMethod;
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
-
-/**
- * Class UsevaultTest
- *
- */
-class UsevaultTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Braintree\Model\System\Config\Backend\Usevault
-     */
-    protected $model;
-
-    /**
-     * @var ObjectManagerHelper
-     */
-    protected $objectManagerHelper;
-
-    protected function setUp()
-    {
-        $this->objectManagerHelper = new ObjectManagerHelper($this);
-        $this->model = $this->objectManagerHelper->getObject(
-            '\Magento\Braintree\Model\System\Config\Backend\Usevault',
-            [
-            ]
-        );
-    }
-
-    /**
-     * @dataProvider beforeSaveDataProvider
-     */
-    public function testBeforeSave($data, $value, $expectedValue)
-    {
-        $this->model->setData($data);
-        $this->model->setValue($value);
-        $this->model->beforeSave();
-        $this->assertEquals($expectedValue, $this->model->getValue());
-    }
-
-    public function beforeSaveDataProvider()
-    {
-        return [
-            'not_active' => [
-                'data' => [
-                    'groups' => [
-                        'braintree' => [
-                            'fields' => [
-                                'active' => [
-                                    'value' => 0,
-                                ],
-                            ],
-                        ],
-                    ],
-                ],
-                'value' => 1,
-                'expected' => 0,
-            ],
-            'active_enabled' => [
-                'data' => [
-                    'groups' => [
-                        'braintree' => [
-                            'fields' => [
-                                'active' => [
-                                    'value' => 1,
-                                ],
-                            ],
-                        ],
-                    ],
-                ],
-                'value' => 1,
-                'expected' => 1,
-            ],
-            'active_disabled' => [
-                'data' => [
-                    'groups' => [
-                        'braintree' => [
-                            'fields' => [
-                                'active' => [
-                                    'value' => 1,
-                                ],
-                            ],
-                        ],
-                    ],
-                ],
-                'value' => 0,
-                'expected' => 0,
-            ],
-        ];
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Model/System/Config/Source/CountryTest.php b/app/code/Magento/Braintree/Test/Unit/Model/System/Config/Source/CountryTest.php
deleted file mode 100644
index 184e1abd83046c0783adc29ab0837919c0973f8d..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Model/System/Config/Source/CountryTest.php
+++ /dev/null
@@ -1,108 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Model\System\Config\Source;
-
-use Magento\Braintree\Model\Config;
-use Magento\Braintree\Model\PaymentMethod;
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
-
-/**
- * Class CountryTest
- *
- */
-class CountryTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Braintree\Model\System\Config\Source\Country
-     */
-    protected $model;
-
-    /**
-     * @var \Magento\Directory\Model\ResourceModel\Country\Collection|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $countryCollectionMock;
-
-    /**
-     * @var ObjectManagerHelper
-     */
-    protected $objectManagerHelper;
-
-    protected function setUp()
-    {
-        $this->countryCollectionMock = $this->getMockBuilder(
-            '\Magento\Directory\Model\ResourceModel\Country\Collection'
-        )->disableOriginalConstructor()
-            ->getMock();
-
-        $this->objectManagerHelper = new ObjectManagerHelper($this);
-        $this->model = $this->objectManagerHelper->getObject(
-            '\Magento\Braintree\Model\System\Config\Source\Country',
-            [
-                'countryCollection' => $this->countryCollectionMock,
-            ]
-        );
-    }
-
-    public function testToOptionArrayMultiSelect()
-    {
-        $excludedCountries = $this->model->getRestrictedCountries();
-        $countries = [
-            [
-                'value' => 'US',
-                'lable' => 'United States',
-            ],
-            [
-                'value' => 'countryCode',
-                'lable' => 'countryName',
-            ],
-        ];
-
-        $this->countryCollectionMock->expects($this->once())
-            ->method('addFieldToFilter')
-            ->with('country_id', ['nin' => $excludedCountries])
-            ->willReturnSelf();
-        $this->countryCollectionMock->expects($this->once())
-            ->method('loadData')
-            ->willReturnSelf();
-        $this->countryCollectionMock->expects($this->once())
-            ->method('toOptionArray')
-            ->willReturn($countries);
-
-        $this->assertEquals($countries, $this->model->toOptionArray(true));
-    }
-
-    public function testToOptionArray()
-    {
-        $excludedCountries = $this->model->getRestrictedCountries();
-        $countries = [
-            [
-                'value' => 'US',
-                'lable' => 'United States',
-            ],
-            [
-                'value' => 'countryCode',
-                'lable' => 'countryName',
-            ],
-        ];
-
-        $this->countryCollectionMock->expects($this->once())
-            ->method('addFieldToFilter')
-            ->with('country_id', ['nin' => $excludedCountries])
-            ->willReturnSelf();
-        $this->countryCollectionMock->expects($this->once())
-            ->method('loadData')
-            ->willReturnSelf();
-        $this->countryCollectionMock->expects($this->once())
-            ->method('toOptionArray')
-            ->willReturn($countries);
-
-        $header = ['value'=>'', 'label'=> new \Magento\Framework\Phrase('--Please Select--')];
-        array_unshift($countries, $header);
-
-        $this->assertEquals($countries, $this->model->toOptionArray());
-    }
-}
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Model/Ui/Adminhtml/TokenUiComponentProviderTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Ui/Adminhtml/TokenUiComponentProviderTest.php
similarity index 92%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Model/Ui/Adminhtml/TokenUiComponentProviderTest.php
rename to app/code/Magento/Braintree/Test/Unit/Model/Ui/Adminhtml/TokenUiComponentProviderTest.php
index 7770ed4930664285c9cc61166d553e67a64dd2e6..b71f25a0ce3b88f8be415b1ac6f955bbacb037a7 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Model/Ui/Adminhtml/TokenUiComponentProviderTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Model/Ui/Adminhtml/TokenUiComponentProviderTest.php
@@ -3,9 +3,9 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Model\Ui\Adminhtml;
+namespace Magento\Braintree\Test\Unit\Model\Ui\Adminhtml;
 
-use Magento\BraintreeTwo\Model\Ui\Adminhtml\TokenUiComponentProvider;
+use Magento\Braintree\Model\Ui\Adminhtml\TokenUiComponentProvider;
 use Magento\Framework\UrlInterface;
 use Magento\Framework\View\Element\Template;
 use Magento\Vault\Api\Data\PaymentTokenInterface;
@@ -49,7 +49,7 @@ class TokenUiComponentProviderTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Model\Ui\Adminhtml\TokenUiComponentProvider::getComponentForToken
+     * @covers \Magento\Braintree\Model\Ui\Adminhtml\TokenUiComponentProvider::getComponentForToken
      */
     public function testGetComponentForToken()
     {
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Model/Ui/ConfigProviderTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Ui/ConfigProviderTest.php
similarity index 93%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Model/Ui/ConfigProviderTest.php
rename to app/code/Magento/Braintree/Test/Unit/Model/Ui/ConfigProviderTest.php
index f63ead378bde04e3f0e48b4efbb59b89fb05542c..53177f5c59ae2b616a5d6af80cb5bf901fe7cc62 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Model/Ui/ConfigProviderTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Model/Ui/ConfigProviderTest.php
@@ -3,18 +3,18 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Model\Ui;
+namespace Magento\Braintree\Test\Unit\Model\Ui;
 
-use Magento\BraintreeTwo\Gateway\Config\Config;
-use Magento\BraintreeTwo\Model\Adapter\BraintreeAdapter;
-use Magento\BraintreeTwo\Model\Ui\ConfigProvider;
-use Magento\BraintreeTwo\Gateway\Config\PayPal\Config as PayPalConfig;
+use Magento\Braintree\Gateway\Config\Config;
+use Magento\Braintree\Model\Adapter\BraintreeAdapter;
+use Magento\Braintree\Model\Ui\ConfigProvider;
+use Magento\Braintree\Gateway\Config\PayPal\Config as PayPalConfig;
 use Magento\Framework\Locale\ResolverInterface;
 
 /**
  * Class ConfigProviderTest
  *
- * Test for class \Magento\BraintreeTwo\Model\Ui\ConfigProvider
+ * Test for class \Magento\Braintree\Model\Ui\ConfigProvider
  */
 class ConfigProviderTest extends \PHPUnit_Framework_TestCase
 {
@@ -114,7 +114,7 @@ class ConfigProviderTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @covers \Magento\BraintreeTwo\Model\Ui\ConfigProvider::getClientToken
+     * @covers \Magento\Braintree\Model\Ui\ConfigProvider::getClientToken
      */
     public function testGetClientToken()
     {
diff --git a/app/code/Magento/Braintree/Test/Unit/Model/VaultTest.php b/app/code/Magento/Braintree/Test/Unit/Model/VaultTest.php
deleted file mode 100644
index b4027ed550a269df2fe7c6e0c8fe1f921f0c4ba5..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Model/VaultTest.php
+++ /dev/null
@@ -1,594 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Model;
-
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
-use Magento\Framework\Exception\LocalizedException;
-use \Braintree_Result_Error;
-use \Braintree_Exception;
-use \Braintree_CreditCard;
-
-/**
- * Class VaultTest
- *
- * @SuppressWarnings(PHPMD.TooManyFields)
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
- */
-class VaultTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Braintree\Model\Vault
-     */
-    protected $model;
-
-    /**
-     * @var ObjectManagerHelper
-     */
-    protected $objectManagerHelper;
-
-    /**
-     * @var \Magento\Braintree\Model\Config\Cc|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $configMock;
-
-    /**
-     * @var \Magento\Payment\Model\InfoInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $infoInstanceMock;
-
-    /**
-     * @var \Magento\Payment\Model\Method\Logger|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $loggerMock;
-
-    /**
-     * @var \Magento\Braintree\Helper\Data|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $helperMock;
-
-    /**
-     * @var  \Magento\Directory\Model\ResourceModel\Country\CollectionFactory|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $countryFactoryMock;
-
-    /**
-     * @var \Magento\Framework\App\Cache\Type\Collection|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $cacheMock;
-
-    /**
-     * @var \Magento\Braintree\Helper\Error|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $errorHelperMock;
-
-    /**
-     * @var \Magento\Framework\Model\Context|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $contextMock;
-
-    /**
-     * @var \Psr\Log\LoggerInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $psrLoggerMock;
-
-    /**
-     * @var \Magento\Customer\Model\Session|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $customerSessionMock;
-
-    /**
-     * @var \Magento\Customer\Model\CustomerFactory|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $customerFactoryMock;
-
-    /**
-     * @var \Magento\Braintree\Model\Adapter\BraintreeCustomer|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $braintreeCustomerMock;
-
-    /**
-     * @var \Magento\Braintree\Model\Adapter\BraintreeCreditCard|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $braintreeCreditCardMock;
-
-    /**
-     * @var \Magento\Braintree\Model\Adapter\BraintreePaymentMethod|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $braintreePaymentMethodMock;
-
-    /**
-     * @var \Magento\Customer\Model\Customer|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $customerMock;
-
-
-    protected function setUp()
-    {
-
-        $this->configMock = $this->getMockBuilder('\Magento\Braintree\Model\Config\Cc')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->salesTransactionCollectionFactoryMock = $this->getMockBuilder(
-            '\Magento\Sales\Model\ResourceModel\Order\Payment\Transaction\CollectionFactory'
-        )->disableOriginalConstructor()
-            ->setMethods(['create'])
-            ->getMock();
-        $this->cacheMock = $this->getMockBuilder('\Magento\Framework\App\Cache\Type\Collection')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->helperMock = $this->getMockBuilder('\Magento\Braintree\Helper\Data')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->errorHelperMock = $this->getMockBuilder('\Magento\Braintree\Helper\Error')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->countryFactoryMock =
-            $this->getMockBuilder('\Magento\Directory\Model\ResourceModel\Country\CollectionFactory')
-            ->disableOriginalConstructor()
-            ->setMethods(['create'])
-            ->getMock();
-        $this->loggerMock = $this->getMockBuilder('\Psr\Log\LoggerInterface')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->customerSessionMock = $this->getMockBuilder('\Magento\Customer\Model\Session')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->customerFactoryMock = $this->getMockBuilder('\Magento\Customer\Model\CustomerFactory')
-            ->disableOriginalConstructor()
-            ->setMethods(['create'])
-            ->getMock();
-        $this->braintreeCustomerMock = $this->getMockBuilder('\Magento\Braintree\Model\Adapter\BraintreeCustomer')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->braintreeCreditCardMock = $this->getMockBuilder('\Magento\Braintree\Model\Adapter\BraintreeCreditCard')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->braintreePaymentMethodMock = $this->getMockBuilder(
-            '\Magento\Braintree\Model\Adapter\BraintreePaymentMethod'
-        )
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->customerMock = $this->getMockBuilder('\Magento\Customer\Model\Customer')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->objectManagerHelper = new ObjectManagerHelper($this);
-        $this->model = $this->objectManagerHelper->getObject(
-            'Magento\Braintree\Model\Vault',
-            [
-                'braintreeHelper' => $this->helperMock,
-                'config' => $this->configMock,
-                'logger' => $this->loggerMock,
-                'errorHelper' => $this->errorHelperMock,
-                'cache' => $this->cacheMock,
-                'customerSession'=> $this->customerSessionMock,
-                'customerFactory'=> $this->customerFactoryMock,
-                'braintreeCustomer'=> $this->braintreeCustomerMock,
-                'braintreeCreditCard'=> $this->braintreeCreditCardMock,
-                'braintreePaymentMethod'=> $this->braintreePaymentMethodMock,
-                'countryFactory' => $this->countryFactoryMock,
-            ]
-        );
-    }
-
-    public function testExists()
-    {
-        $customerId = 1;
-        $this->braintreeCustomerMock->expects($this->once())
-            ->method('find')
-            ->with($customerId)
-            ->willReturnSelf();
-        $result = $this->model->exists($customerId);
-        $this->assertEquals(true, $result);
-    }
-
-    public function testExistsException()
-    {
-        $exception = new \Braintree_Exception();
-        $customerId = 1;
-        $this->braintreeCustomerMock->expects($this->once())
-            ->method('find')
-            ->with($customerId)
-            ->willThrowException($exception);
-
-        $this->loggerMock->expects($this->once())
-            ->method('critical')
-            ->with($exception);
-
-        $result = $this->model->exists($customerId);
-        $this->assertEquals(false, $result);
-    }
-
-    public function testDeleteCustomer()
-    {
-        $customerID = 1;
-        $this->braintreeCustomerMock->expects($this->once())
-            ->method('delete')
-            ->with($customerID)
-            ->willReturnSelf();
-        $result = $this->model->deleteCustomer($customerID);
-        $this->assertEquals(true, is_object($result));
-    }
-
-    public function testDeleteCustomerException()
-    {
-        $exception = new \Braintree_Exception();
-        $customerID = 1;
-        $this->braintreeCustomerMock->expects($this->once())
-            ->method('delete')
-            ->with($customerID)
-            ->willThrowException($exception);
-
-        $this->loggerMock->expects($this->once())
-            ->method('critical')
-            ->with($exception);
-
-        $this->model->deleteCustomer($customerID);
-    }
-
-    public function testStoredCard()
-    {
-        $cardToken = 1;
-        $this->braintreeCreditCardMock->expects($this->once())
-            ->method('find')
-            ->with($cardToken)
-            ->willReturnSelf();
-        $result = $this->model->storedCard($cardToken);
-        $this->assertEquals(true, is_object($result));
-    }
-
-    public function testStoredCardException()
-    {
-        $exception = new \Braintree_Exception();
-        $cardToken = 1;
-        $this->braintreeCreditCardMock->expects($this->once())
-            ->method('find')
-            ->with($cardToken)
-            ->willThrowException($exception);
-
-        $this->loggerMock->expects($this->once())
-            ->method('critical')
-            ->with($exception);
-
-        $this->model->storedCard($cardToken);
-    }
-
-    public function testDeleteCard()
-    {
-        $cardToken = 1;
-        $this->braintreeCreditCardMock->expects($this->once())
-            ->method('delete')
-            ->with($cardToken)
-            ->willReturnSelf();
-        $result = $this->model->deleteCard($cardToken);
-        $this->assertEquals(true, is_object($result));
-    }
-
-    public function testDeleteException()
-    {
-        $exception = new \Braintree_Exception();
-        $cardToken = 1;
-        $this->braintreeCreditCardMock->expects($this->once())
-            ->method('delete')
-            ->with($cardToken)
-            ->willThrowException($exception);
-
-        $this->loggerMock->expects($this->once())
-            ->method('critical')
-            ->with($exception);
-
-        $return = $this->model->deleteCard($cardToken);
-
-        $this->assertEquals(false, $return);
-    }
-
-    public function testGeneratePaymentMethodToken()
-    {
-        $cardToken = 1;
-        $nonce = 'nonce';
-        $paymentMethodObj=json_decode(json_encode(
-            [
-                'success' => true,
-                'paymentMethodNonce'=> [
-                    'nonce' => $nonce,
-                ],
-            ]
-        ));
-        $this->braintreePaymentMethodMock->expects($this->once())
-            ->method('createNonce')
-            ->with($cardToken)
-            ->willReturn($paymentMethodObj);
-        $result = $this->model->generatePaymentMethodToken($cardToken);
-        $this->assertEquals($nonce, $result);
-    }
-
-    /**
-     * @expectedException \Magento\Framework\Exception\LocalizedException
-     * @expectedExceptionMessage exception
-     */
-    public function testGeneratePaymentMethodTokenException()
-    {
-        $cardToken = 1;
-        $paymentMethodObj=json_decode(json_encode(
-            [
-                'success' => false,
-            ]
-        ));
-
-        $this->braintreePaymentMethodMock->expects($this->once())
-            ->method('createNonce')
-            ->with($cardToken)
-            ->willReturn($paymentMethodObj);
-
-        $this->errorHelperMock->expects($this->once())
-            ->method('parseBraintreeError')
-            ->willReturn(new \Magento\Framework\Phrase('exception'));
-
-        $this->model->generatePaymentMethodToken($cardToken);
-    }
-
-    /**
-     * @param array $creditCardsArray
-     * @param boolean $useVault
-     * @param stdClass $braintreeCustomerObject
-     * @dataProvider dataProviderCurrentCustomerStoredCards
-     */
-    public function testCurrentCustomerStoredCards(
-        $creditCardsArray = [],
-        $useVault = false,
-        $braintreeCustomerObject = null
-    ) {
-        $customerId = 1;
-        $this->configMock->expects($this->once())
-            ->method('useVault')
-            ->willReturn($useVault);
-
-        $this->customerSessionMock->expects($this->any())
-            ->method('isLoggedIn')
-            ->willReturn(true);
-
-        $this->customerFactoryMock->expects($this->any())
-            ->method('create')
-            ->willReturn($this->customerMock);
-
-        $this->helperMock->expects($this->any())
-            ->method('generateCustomerId')
-            ->willReturn($customerId);
-
-        $this->customerMock->expects($this->any())
-            ->method('load')
-            ->willReturn($this->customerMock);
-
-
-        if ($braintreeCustomerObject != null) {
-            $this->braintreeCustomerMock->expects($this->any())
-                ->method('find')
-                ->with($customerId)
-                ->willReturn($braintreeCustomerObject);
-        } else {
-            $this->braintreeCustomerMock->expects($this->any())
-                ->method('find')
-                ->with($customerId)
-                ->willThrowException(new \Braintree_Exception());
-        }
-
-        $result = $this->model->currentCustomerStoredCards();
-
-        $this->assertEquals($creditCardsArray, $result);
-    }
-
-    /**
-     * @return array
-     */
-    public function dataProviderCurrentCustomerStoredCards()
-    {
-        $creditCardsArray = [
-            '4111411141114111',
-            '4111411141114111',
-            '4111411141114111',
-        ];
-
-        return [
-            [
-                'creditCardsArray' => $creditCardsArray,
-                'useVault' => true,
-                'braintreeCustomerObject' => json_decode(json_encode(['creditCards' => $creditCardsArray])),
-            ],
-            [
-                'creditCardsArray' => [],
-                'useVault' => true,
-                'braintreeCustomerObject' => null,
-            ],
-            [
-                'creditCardsArray' => [],
-                'useVault' => false,
-                'braintreeCustomerObject' => null,
-            ],
-        ];
-    }
-
-    /**
-     * @param string $params
-     * @dataProvider dataProcessNonce
-     */
-    public function testProcessNonceException($params = null, $exceptionMessage = null)
-    {
-        $this->customerSessionMock->expects($this->any())
-            ->method('getCustomerId')
-            ->willReturn($params['customerId']);
-
-        $countryCollectionMock = $this->getMockBuilder('\Magento\Directory\Model\ResourceModel\Country\Collection')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $countryCollectionMock->expects($this->any())
-            ->method('addCountryCodeFilter')
-            ->willReturn($countryCollectionMock);
-
-        $this->countryFactoryMock->expects($this->any())
-            ->method('create')
-            ->willReturn($countryCollectionMock);
-
-        $this->configMock->expects($this->any())
-            ->method('canUseForCountry')
-            ->willReturn($params['canUseForCountry']);
-
-        $this->configMock->expects($this->any())
-            ->method('canUseCcTypeForCountry')
-            ->willReturn($params['canUseCcTypeForCountry']);
-
-
-        $this->helperMock->expects($this->any())
-            ->method('generateCustomerId')
-            ->willReturn($params['customerId']);
-
-        $this->customerMock->expects($this->any())
-            ->method('load')
-            ->willReturn($this->customerMock);
-
-        $this->customerFactoryMock->expects($this->any())
-            ->method('create')
-            ->willReturn($this->customerMock);
-
-        if (is_object($params['paymentMethodObj'])) {
-            if (!$params['optionsArray']['update']) {
-                $this->braintreePaymentMethodMock->expects($this->once())
-                    ->method('create')
-                    ->willReturn($params['paymentMethodObj']);
-            } else {
-                $this->braintreePaymentMethodMock->expects($this->once())
-                    ->method('update')
-                    ->willReturn($params['paymentMethodObj']);
-            }
-
-            if (!$params['paymentMethodObj']->success) {
-                $this->errorHelperMock->expects($this->once())
-                    ->method('parseBraintreeError')
-                    ->willReturn(new \Magento\Framework\Phrase($exceptionMessage));
-            } else {
-                $this->errorHelperMock->expects($this->never())->method('parseBraintreeError');
-            }
-        }
-
-        try {
-            $this->model->processNonce($params['nonce'], $params['optionsArray'], $params['billingAddress']);
-        } catch (\Magento\Framework\Exception\LocalizedException $e) {
-            $this->assertEquals($exceptionMessage, $e->getMessage());
-        }
-
-    }
-
-    /**
-     * @return array
-     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
-     */
-    public function dataProcessNonce()
-    {
-        $optionsArray = [
-            'default' => true,
-            'token' => "",
-            'update' => false,
-            'ccType' => 'VI',
-            'device_data' => "",
-        ];
-        $billingAddress = [
-            "firstName" => 'firstName',
-            "lastName" => 'lastName',
-            "company" => '',
-            "streetAddress" => '130 Street',
-            "extendedAddress" => 'apt 114',
-            "locality" => 'Austin',
-            "region" => 'TX',
-            "postalCode" => '78232',
-            "countryCodeAlpha2" => 'US',
-        ];
-
-        return [
-            [
-                'params' => [
-                    'customerId' => false,
-                    'nonce' => null,
-                    'optionsArray' => null,
-                    'billingAddress' => null,
-                    'canUseForCountry' => false,
-                    'canUseCcTypeForCountry' => false,
-                    'paymentMethodObj' => false,
-                ],
-                'exceptionMessage' => 'Invalid Customer ID provided'
-            ],
-            [
-                'params' => [
-                    'customerId' => '1',
-                    'nonce' => 'nonce',
-                    'optionsArray' => $optionsArray,
-                    'billingAddress' => $billingAddress,
-                    'canUseForCountry' => false,
-                    'canUseCcTypeForCountry' => false,
-                    'paymentMethodObj' => false,
-                ],
-                'exceptionMessage' => 'Selected payment type is not allowed for billing country.'
-            ],
-            [
-                'params' => [
-                    'customerId' => '1',
-                    'nonce' => 'nonce',
-                    'optionsArray' => $optionsArray,
-                    'billingAddress' => $billingAddress,
-                    'canUseForCountry' => true,
-                    'canUseCcTypeForCountry' => new \Magento\Framework\Phrase(
-                        'Credit card type is not allowed for your country.'
-                    ),
-                    'paymentMethodObj' => false,
-                ],
-                'exceptionMessage' => 'Credit card type is not allowed for your country.'
-            ],
-            [
-                'params' => [
-                    'customerId' => '1',
-                    'nonce' => 'nonce',
-                    'optionsArray' => $optionsArray,
-                    'billingAddress' => $billingAddress,
-                    'canUseForCountry' => true,
-                    'canUseCcTypeForCountry' => false,
-                    'paymentMethodObj' => json_decode(json_encode(['success' => false]))
-                ],
-                'exceptionMessage' => 'Braintree api error'
-            ],
-            [
-                'params' => [
-                    'customerId' => '1',
-                    'nonce' => 'nonce',
-                    'optionsArray' => $optionsArray,
-                    'billingAddress' => $billingAddress,
-                    'canUseForCountry' => true,
-                    'canUseCcTypeForCountry' => false,
-                    'paymentMethodObj' => json_decode(json_encode(['success' => true]))
-                ],
-                'exceptionMessage' => 'Braintree api error'
-            ],
-            [
-                'params' => [
-                    'customerId' => '1',
-                    'nonce' => 'nonce',
-                    'optionsArray' => [
-                        'default' => true,
-                        'token' => "",
-                        'update' => 'true',
-                        'ccType' => 'VI',
-                        'device_data' => "",
-                    ],
-                    'billingAddress' => $billingAddress,
-                    'canUseForCountry' => true,
-                    'canUseCcTypeForCountry' => false,
-                    'paymentMethodObj' => json_decode(json_encode(['success' => true]))
-                ],
-                'exceptionMessage' => 'Braintree api error'
-            ],
-        ];
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Observer/AddPaypalShortcutsTest.php b/app/code/Magento/Braintree/Test/Unit/Observer/AddPaypalShortcutsTest.php
index d5456667ba0f5068e6e34a66b0408a75c2f37798..21f42c3e1a0b0e1e32649bd3f39e1ba9d6124b65 100644
--- a/app/code/Magento/Braintree/Test/Unit/Observer/AddPaypalShortcutsTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Observer/AddPaypalShortcutsTest.php
@@ -3,210 +3,70 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-
 namespace Magento\Braintree\Test\Unit\Observer;
 
-use Magento\Braintree\Block\PayPal\Shortcut;
+use Magento\Braintree\Block\Paypal\Button;
+use Magento\Catalog\Block\ShortcutButtons;
+use Magento\Framework\Event;
+use Magento\Framework\Event\Observer;
 use Magento\Braintree\Observer\AddPaypalShortcuts;
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
+use Magento\Framework\View\LayoutInterface;
 
 /**
  * Class AddPaypalShortcutsTest
+ *
+ * @see \Magento\Braintree\Observer\AddPaypalShortcuts
  */
 class AddPaypalShortcutsTest extends \PHPUnit_Framework_TestCase
 {
-    /**
-     * @var \Magento\Braintree\Observer\AddPaypalShortcuts
-     */
-    protected $addPaypalShortcutsObserver;
-
-    /**
-     * @var ObjectManagerHelper
-     */
-    protected $objectManagerHelper;
-
-    /**
-     * @var \Magento\Braintree\Model\PaymentMethod\PayPal|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $paypalMethodMock;
-
-    /**
-     * @var \Magento\Braintree\Model\Config\PayPal|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $paypalConfigMock;
-
-    protected function setUp()
+    public function testExecute()
     {
-        $this->paypalMethodMock = $this->getMockBuilder('\Magento\Braintree\Model\PaymentMethod\PayPal')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->paypalConfigMock = $this->getMockBuilder('\Magento\Braintree\Model\Config\PayPal')
+        $addPaypalShortcuts = new AddPaypalShortcuts();
+
+        /** @var Observer|\PHPUnit_Framework_MockObject_MockObject $observerMock */
+        $observerMock = $this->getMockBuilder(Observer::class)
             ->disableOriginalConstructor()
             ->getMock();
 
-        $this->objectManagerHelper = new ObjectManagerHelper($this);
-        $this->addPaypalShortcutsObserver = $this->objectManagerHelper->getObject(
-            'Magento\Braintree\Observer\AddPaypalShortcuts',
-            [
-                'methodPayPal' => $this->paypalMethodMock,
-                'paypalConfig' => $this->paypalConfigMock,
-            ]
-        );
-    }
-
-    /**
-     * @covers \Magento\Braintree\Observer\AddPaypalShortcuts::execute()
-     */
-    public function testAddPaypalShortcuts()
-    {
-        $orPosition = 'before';
-        $isInMiniCart = true;
-
-        $containerMock = $this->getMockBuilder('\Magento\Catalog\Block\ShortcutButtons')
+        /** @var Event|\PHPUnit_Framework_MockObject_MockObject $eventMock */
+        $eventMock = $this->getMockBuilder(Event::class)
+            ->setMethods(['getContainer'])
             ->disableOriginalConstructor()
             ->getMock();
 
-        $event = new \Magento\Framework\DataObject(
-            [
-                'is_catalog_product' => false,
-                'container' => $containerMock,
-                'or_position' => $orPosition,
-            ]
-        );
-        $observer = new \Magento\Framework\Event\Observer(
-            [
-                'event' => $event,
-            ]
-        );
-
-        $this->paypalMethodMock->expects($this->once())
-            ->method('isActive')
-            ->willReturn(true);
-        $this->paypalConfigMock->expects($this->once())
-            ->method('isShortcutCheckoutEnabled')
-            ->willReturn(true);
-
-        $shortcutMock = $this->getMockBuilder('\Magento\Braintree\Block\PayPal\Shortcut')
+        /** @var ShortcutButtons|\PHPUnit_Framework_MockObject_MockObject $shortcutButtonsMock */
+        $shortcutButtonsMock = $this->getMockBuilder(ShortcutButtons::class)
             ->disableOriginalConstructor()
-            ->setMethods(['setShowOrPosition', 'skipShortcutForGuest'])
             ->getMock();
-        $shortcutMock->expects($this->once())
-            ->method('skipShortcutForGuest')
-            ->willReturn(false);
-        $shortcutMock->expects($this->once())
-            ->method('setShowOrPosition')
-            ->with($orPosition);
-
-        $layoutMock = $this->getMock('\Magento\Framework\View\LayoutInterface');
-        $layoutMock->expects($this->once())
-            ->method('createBlock')
-            ->with(
-                AddPaypalShortcuts::PAYPAL_SHORTCUT_BLOCK,
-                '',
-                [
-                    'data' => [
-                        Shortcut::MINI_CART_FLAG_KEY => $isInMiniCart,
-                    ]
-                ]
-            )->willReturn($shortcutMock);
 
-        $containerMock->expects($this->once())
-            ->method('getLayout')
-            ->willReturn($layoutMock);
-
-        $containerMock->expects($this->once())
-            ->method('addShortcut')
-            ->with($shortcutMock);
+        $layoutMock = $this->getMockBuilder(LayoutInterface::class)
+            ->getMockForAbstractClass();
 
-        $this->addPaypalShortcutsObserver->execute($observer);
-    }
-
-    /**
-     * @covers \Magento\Braintree\Observer\AddPaypalShortcuts::execute()
-     */
-    public function testAddPaypalShortcutsWithoutMinicart()
-    {
-        $containerMock = $this->getMockBuilder('\Magento\Catalog\Block\ShortcutButtons')
+        $blockMock = $this->getMockBuilder(Button::class)
             ->disableOriginalConstructor()
             ->getMock();
 
-        $event = new \Magento\Framework\DataObject(
-            [
-                'is_catalog_product' => true,
-                'container' => $containerMock
-            ]
-        );
-        $observer = new \Magento\Framework\Event\Observer(
-            [
-                'event' => $event,
-            ]
-        );
-        $this->paypalMethodMock->expects(static::once())
-            ->method('isActive')
-            ->willReturn(true);
-        $this->paypalConfigMock->expects(static::once())
-            ->method('isShortcutCheckoutEnabled')
-            ->willReturn(true);
-
-        $containerMock->expects(static::never())
-            ->method('getLayout');
-
-        $this->addPaypalShortcutsObserver->execute($observer);
-    }
-
-    public function testAddPaypalShortcutsNotActive()
-    {
-        $event = new \Magento\Framework\DataObject(
-            [
-                'is_catalog_product' => false,
-            ]
-        );
-        $observer = new \Magento\Framework\Event\Observer(
-            [
-                'event' => $event,
-            ]
-        );
+        $observerMock->expects(self::once())
+            ->method('getEvent')
+            ->willReturn($eventMock);
 
-        $this->paypalMethodMock->expects($this->once())
-            ->method('isActive')
-            ->willReturn(false);
-        $this->paypalConfigMock->expects($this->never())
-            ->method('isShortcutCheckoutEnabled');
-
-        $this->addPaypalShortcutsObserver->execute($observer);
-    }
+        $eventMock->expects(self::once())
+            ->method('getContainer')
+            ->willReturn($shortcutButtonsMock);
 
-    public function testAddPaypalShortcutsNotEnabled()
-    {
-        $orPosition = 'before';
-
-        $containerMock = $this->getMockBuilder('\Magento\Catalog\Block\ShortcutButtons')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $event = new \Magento\Framework\DataObject(
-            [
-                'is_catalog_product' => false,
-                'container' => $containerMock,
-                'or_position' => $orPosition,
-            ]
-        );
-        $observer = new \Magento\Framework\Event\Observer(
-            [
-                'event' => $event,
-            ]
-        );
+        $shortcutButtonsMock->expects(self::once())
+            ->method('getLayout')
+            ->willReturn($layoutMock);
 
-        $this->paypalMethodMock->expects($this->once())
-            ->method('isActive')
-            ->willReturn(true);
-        $this->paypalConfigMock->expects($this->once())
-            ->method('isShortcutCheckoutEnabled')
-            ->willReturn(false);
+        $layoutMock->expects(self::once())
+            ->method('createBlock')
+            ->with(AddPaypalShortcuts::PAYPAL_SHORTCUT_BLOCK)
+            ->willReturn($blockMock);
 
-        $containerMock->expects($this->never())
-            ->method('getLayout');
+        $shortcutButtonsMock->expects(self::once())
+            ->method('addShortcut')
+            ->with($blockMock);
 
-        $this->addPaypalShortcutsObserver->execute($observer);
+        $addPaypalShortcuts->execute($observerMock);
     }
 }
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Observer/DataAssignObserverTest.php b/app/code/Magento/Braintree/Test/Unit/Observer/DataAssignObserverTest.php
similarity index 94%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Observer/DataAssignObserverTest.php
rename to app/code/Magento/Braintree/Test/Unit/Observer/DataAssignObserverTest.php
index e11aa39f26abbdd8779dcf0047d75db3881a4946..d89802a5489a991363776cc832563e53bf1dda06 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Observer/DataAssignObserverTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Observer/DataAssignObserverTest.php
@@ -3,13 +3,13 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Observer;
+namespace Magento\Braintree\Test\Unit\Observer;
 
 use Magento\Framework\DataObject;
 use Magento\Framework\Event;
 use Magento\Payment\Model\InfoInterface;
 use Magento\Payment\Observer\AbstractDataAssignObserver;
-use Magento\BraintreeTwo\Observer\DataAssignObserver;
+use Magento\Braintree\Observer\DataAssignObserver;
 
 /**
  * Class DataAssignObserverTest
diff --git a/app/code/Magento/Braintree/Test/Unit/Observer/DeleteBraintreeCustomerTest.php b/app/code/Magento/Braintree/Test/Unit/Observer/DeleteBraintreeCustomerTest.php
deleted file mode 100644
index bbeaa2ea67cd1d8fb3b685c4735313acd2c1ff2f..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Observer/DeleteBraintreeCustomerTest.php
+++ /dev/null
@@ -1,142 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Observer;
-
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
-
-/**
- * Class DeleteBraintreeCustomerTest
- */
-class DeleteBraintreeCustomerTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Braintree\Observer\DeleteBraintreeCustomer
-     */
-    protected $deleteBraintreeCustomerObserver;
-
-    /**
-     * @var ObjectManagerHelper
-     */
-    protected $objectManagerHelper;
-
-    /**
-     * @var \Magento\Braintree\Model\Config\Cc|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $configMock;
-
-    /**
-     * @var \Magento\Braintree\Model\Vault|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $vaultMock;
-
-    /**
-     * @var \Magento\Braintree\Helper\Data|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $helperMock;
-
-    protected function setUp()
-    {
-        $this->configMock = $this->getMockBuilder('\Magento\Braintree\Model\Config\Cc')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->vaultMock = $this->getMockBuilder('\Magento\Braintree\Model\Vault')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->helperMock = $this->getMockBuilder('\Magento\Braintree\Helper\Data')
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $this->objectManagerHelper = new ObjectManagerHelper($this);
-        $this->deleteBraintreeCustomerObserver = $this->objectManagerHelper->getObject(
-            'Magento\Braintree\Observer\DeleteBraintreeCustomer',
-            [
-                'vault' => $this->vaultMock,
-                'config' => $this->configMock,
-                'helper' => $this->helperMock
-            ]
-        );
-    }
-
-    /**
-     * @param bool $isActive
-     * @param bool $isExistingCustomer
-     * @param bool $deleteCustomer
-     * @dataProvider deleteBraintreeCustomerDataProvider
-     */
-    public function testDeleteBraintreeCustomer($isActive, $isExistingCustomer, $deleteCustomer)
-    {
-        $braintreeCustoemrId = 'braintreeCustomerId';
-        $customerId = '10002';
-        $customerEmail = 'John@example.com';
-
-        $this->configMock->expects($this->once())
-            ->method('isActive')
-            ->willReturn($isActive);
-
-        $customer = new \Magento\Framework\DataObject(
-            [
-                'id' => $customerId,
-                'email' => $customerEmail,
-            ]
-        );
-
-        $this->helperMock->expects($this->any())
-            ->method('generateCustomerId')
-            ->with($customerId, $customerEmail)
-            ->willReturn($braintreeCustoemrId);
-
-        $observer = new \Magento\Framework\Event\Observer(
-            [
-                'event' => new \Magento\Framework\DataObject(
-                    [
-                        'customer' => $customer,
-                    ]
-                ),
-            ]
-        );
-
-        $this->vaultMock->expects($this->any())
-            ->method('exists')
-            ->with($braintreeCustoemrId)
-            ->willReturn($isExistingCustomer);
-
-        if ($deleteCustomer) {
-            $this->vaultMock->expects($this->once())
-                ->method('deleteCustomer')
-                ->with($braintreeCustoemrId);
-        } else {
-            $this->vaultMock->expects($this->never())
-                ->method('deleteCustomer');
-        }
-
-        $this->assertEquals(
-            $this->deleteBraintreeCustomerObserver,
-            $this->deleteBraintreeCustomerObserver->execute($observer)
-        );
-    }
-
-    public function deleteBraintreeCustomerDataProvider()
-    {
-        return [
-            'not_active' => [
-                'is_active' => false,
-                'is_existing_customer' => true,
-                'delete_customer' => false,
-            ],
-            'active_not_existing_customer' => [
-                'is_active' => true,
-                'is_existing_customer' => false,
-                'delete_customer' => false,
-            ],
-            'active_existing_customer' => [
-                'is_active' => true,
-                'is_existing_customer' => true,
-                'delete_customer' => true,
-            ],
-        ];
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Observer/ProcessBraintreeAddressTest.php b/app/code/Magento/Braintree/Test/Unit/Observer/ProcessBraintreeAddressTest.php
deleted file mode 100644
index 4ad56dc5c018ff14784232f2c49029b1e05dc33f..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Observer/ProcessBraintreeAddressTest.php
+++ /dev/null
@@ -1,76 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Observer;
-
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
-
-/**
- * Class ProcessBraintreeAddressTest
- */
-class ProcessBraintreeAddressTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Braintree\Observer\ProcessBraintreeAddress
-     */
-    protected $processBraintreeAddressObserver;
-
-    /**
-     * @var ObjectManagerHelper
-     */
-    protected $objectManagerHelper;
-
-    protected function setUp()
-    {
-        $this->objectManagerHelper = new ObjectManagerHelper($this);
-        $this->processBraintreeAddressObserver = $this->objectManagerHelper->getObject(
-            'Magento\Braintree\Observer\ProcessBraintreeAddress',
-            []
-        );
-    }
-
-    public function testProcessBraintreeAddressIfPaymentIsBraintree()
-    {
-        $billingAddressMock = $this->getMock(
-            'Magento\Quote\Model\Quote\Address',
-            ['setShouldIgnoreValidation'],
-            [],
-            '',
-            false
-        );
-        $eventMock = $this->getMock('Magento\Framework\Event', ['getQuote'], [], '', false);
-        $observerMock = $this->getMock('Magento\Framework\Event\Observer', [], [], '', false);
-        $observerMock->expects($this->once())->method('getEvent')->willReturn($eventMock);
-        $quoteMock = $this->getMock('Magento\Quote\Model\Quote', [], [], '', false);
-        $eventMock->expects($this->once())->method('getQuote')->willReturn($quoteMock);
-        $paymentMock = $this->getMock('Magento\Quote\Model\Quote\Payment', [], [], '', false);
-        $quoteMock->expects($this->once())->method('getPayment')->willReturn($paymentMock);
-        $paymentMock
-            ->expects($this->once())
-            ->method('getMethod')
-            ->willReturn(\Magento\Braintree\Model\PaymentMethod\PayPal:: METHOD_CODE);
-        $quoteMock->expects($this->once())->method('getBillingAddress')->willReturn($billingAddressMock);
-        $billingAddressMock->expects($this->once())->method('setShouldIgnoreValidation')->with(true);
-        $this->processBraintreeAddressObserver->execute($observerMock);
-    }
-
-    public function testProcessBraintreeAddressIfPaymentIsNotBraintree()
-    {
-        $eventMock = $this->getMock('Magento\Framework\Event', ['getQuote'], [], '', false);
-        $observerMock = $this->getMock('Magento\Framework\Event\Observer', [], [], '', false);
-        $observerMock->expects($this->once())->method('getEvent')->willReturn($eventMock);
-        $quoteMock = $this->getMock('Magento\Quote\Model\Quote', [], [], '', false);
-        $eventMock->expects($this->once())->method('getQuote')->willReturn($quoteMock);
-        $paymentMock = $this->getMock('Magento\Quote\Model\Quote\Payment', [], [], '', false);
-        $quoteMock->expects($this->once())->method('getPayment')->willReturn($paymentMock);
-        $paymentMock
-            ->expects($this->once())
-            ->method('getMethod')
-            ->willReturn('checkmo');
-        $quoteMock->expects($this->never())->method('getBillingAddress');
-        $this->processBraintreeAddressObserver->execute($observerMock);
-    }
-}
diff --git a/app/code/Magento/Braintree/Test/Unit/Observer/ProcessBraintreePaymentTest.php b/app/code/Magento/Braintree/Test/Unit/Observer/ProcessBraintreePaymentTest.php
deleted file mode 100644
index 9e98631e960cc655f25274e16a8c0384c5858998..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/Test/Unit/Observer/ProcessBraintreePaymentTest.php
+++ /dev/null
@@ -1,255 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-namespace Magento\Braintree\Test\Unit\Observer;
-
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
-use Magento\Braintree\Observer\ProcessBraintreePayment;
-use Magento\Payment\Model\Method\AbstractMethod;
-use Magento\Braintree\Model\PaymentMethod;
-
-/**
- * Class ProcessBraintreePaymentTest
- */
-class ProcessBraintreePaymentTest extends \PHPUnit_Framework_TestCase
-{
-    /**
-     * @var \Magento\Braintree\Observer\ProcessBraintreePayment
-     */
-    protected $processBraintreePaymentObserver;
-
-    /**
-     * @var ObjectManagerHelper
-     */
-    protected $objectManagerHelper;
-
-    /**
-     * @var \Magento\Braintree\Model\Config\Cc|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $configMock;
-
-    /**
-     * @var \Magento\Framework\DB\TransactionFactory|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $transactionFactoryMock;
-
-    protected function setUp()
-    {
-        $this->configMock = $this->getMockBuilder('\Magento\Braintree\Model\Config\Cc')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->transactionFactoryMock = $this->getMockBuilder('\Magento\Framework\DB\TransactionFactory')
-            ->disableOriginalConstructor()
-            ->setMethods(['create'])
-            ->getMock();
-
-        $this->objectManagerHelper = new ObjectManagerHelper($this);
-        $this->processBraintreePaymentObserver = $this->objectManagerHelper->getObject(
-            'Magento\Braintree\Observer\ProcessBraintreePayment',
-            [
-                'config' => $this->configMock,
-                'transactionFactory' => $this->transactionFactoryMock,
-            ]
-        );
-    }
-
-    public function testProcessBraintreePayment()
-    {
-        $orderMock = $this->getMockBuilder('\Magento\Sales\Model\Order')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $orderMock->expects($this->once())
-            ->method('getPayment')
-            ->willReturn(new \Magento\Framework\DataObject(['method' => PaymentMethod::METHOD_CODE]));
-        $orderMock->expects($this->once())
-            ->method('canInvoice')
-            ->willReturn(true);
-
-        $this->configMock->expects($this->at(0))
-            ->method('getConfigData')
-            ->with(ProcessBraintreePayment::CONFIG_PATH_PAYMENT_ACTION)
-            ->willReturn(AbstractMethod::ACTION_AUTHORIZE);
-        $this->configMock->expects($this->at(1))
-            ->method('getConfigData')
-            ->with(ProcessBraintreePayment::CONFIG_PATH_CAPTURE_ACTION)
-            ->willReturn(PaymentMethod::CAPTURE_ON_SHIPMENT);
-
-        $shipmentMock = $this->getMockBuilder('\Magento\Sales\Model\Order\Shipment')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $shipmentMock->expects($this->any())
-            ->method('getOrder')
-            ->willReturn($orderMock);
-
-        $invoiceItemQty = $this->setupOrderShipmentItems($orderMock, $shipmentMock);
-        $invoiceMock = $this->getMockBuilder('\Magento\Sales\Model\Order\Invoice')
-            ->disableOriginalConstructor()
-            ->setMethods(['setRequestedCaptureCase', 'register', 'getOrder'])
-            ->getMock();
-        $orderMock->expects($this->once())
-            ->method('prepareInvoice')
-            ->with($invoiceItemQty)
-            ->willReturn($invoiceMock);
-
-        $invoiceMock->expects($this->once())
-            ->method('setRequestedCaptureCase')
-            ->with(\Magento\Sales\Model\Order\Invoice::CAPTURE_ONLINE);
-        $invoiceMock->expects($this->once())
-            ->method('register');
-        $invoiceMock->expects($this->once())
-            ->method('getOrder')
-            ->willReturn($orderMock);
-
-        $transactionMock = $this->getMockBuilder('\Magento\Framework\DB\Transaction')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->transactionFactoryMock->expects($this->once())
-            ->method('create')
-            ->willReturn($transactionMock);
-        $transactionMock->expects($this->at(0))
-            ->method('addObject')
-            ->with($invoiceMock)
-            ->willReturnSelf();
-        $transactionMock->expects($this->at(1))
-            ->method('addObject')
-            ->with($orderMock)
-            ->willReturnSelf();
-        $transactionMock->expects($this->once())
-            ->method('save');
-
-        $observer = new \Magento\Framework\Event\Observer(
-            [
-                'event' => new \Magento\Framework\DataObject(
-                    [
-                        'shipment' => $shipmentMock,
-                    ]
-                ),
-            ]
-        );
-
-        $this->assertEquals(
-            $this->processBraintreePaymentObserver,
-            $this->processBraintreePaymentObserver->execute($observer)
-        );
-    }
-
-    /**
-     * @dataProvider processBraintreePaymentSkipDataProvider
-     */
-    public function testProcessBraintreePaymentSkip($config)
-    {
-        $index = 0;
-        foreach ($config as $key => $value) {
-            $this->configMock->expects($this->at($index))
-                ->method('getConfigData')
-                ->with($key)
-                ->willReturn($value);
-            $index++;
-        }
-
-        $paymentObj = new \Magento\Framework\DataObject(
-            [
-                'method' => PaymentMethod::METHOD_CODE,
-            ]
-        );
-        $orderMock = $this->getMockBuilder('\Magento\Sales\Model\Order')
-            ->disableOriginalConstructor()
-            ->getMock();
-        $orderMock->expects($this->once())
-            ->method('getPayment')
-            ->willReturn($paymentObj);
-        $orderMock->expects($this->once())
-            ->method('canInvoice')
-            ->willReturn(true);
-
-        $observer = new \Magento\Framework\Event\Observer(
-            [
-                'event' => new \Magento\Framework\DataObject(
-                    [
-                        'shipment' => new \Magento\Framework\DataObject(
-                            [
-                                'order' => $orderMock,
-                            ]
-                        ),
-                    ]
-                )
-            ]
-        );
-
-        $this->transactionFactoryMock->expects($this->never())
-            ->method('create');
-        $this->assertEquals(
-            $this->processBraintreePaymentObserver,
-            $this->processBraintreePaymentObserver->execute($observer)
-        );
-    }
-
-    public function processBraintreePaymentSkipDataProvider()
-    {
-        return [
-            'capture_on_invoice' => [
-                'config_data' => [
-                    ProcessBraintreePayment::CONFIG_PATH_PAYMENT_ACTION => AbstractMethod::ACTION_AUTHORIZE,
-                    ProcessBraintreePayment::CONFIG_PATH_CAPTURE_ACTION => PaymentMethod::CAPTURE_ON_INVOICE,
-                ]
-            ],
-            'action_capture' => [
-                'config_data' => [
-                    ProcessBraintreePayment::CONFIG_PATH_PAYMENT_ACTION => AbstractMethod::ACTION_AUTHORIZE_CAPTURE,
-                ]
-            ]
-        ];
-    }
-
-    protected function setupOrderShipmentItems($orderMock, $shipmentMock)
-    {
-        //three order items
-        $orderItem1Id = '1001';
-        $orderItem2Id = '1002';
-        $orderItem3Id = '1003';
-        $shipment1Qty = 2;
-        $shipment3Qty = 3;
-
-        $orderItem1 = new \Magento\Framework\DataObject(
-            ['id' => $orderItem1Id]
-        );
-        $orderItem2 = new \Magento\Framework\DataObject(
-            ['id' => $orderItem2Id]
-        );
-        $orderItem3 = new \Magento\Framework\DataObject(
-            ['id' => $orderItem3Id]
-        );
-        $orderItems = [$orderItem1, $orderItem2, $orderItem3];
-        $orderMock->expects($this->any())
-            ->method('getAllItems')
-            ->willReturn($orderItems);
-
-        //two items shipped
-        $shipmentItems = [
-            new \Magento\Framework\DataObject(
-                [
-                    'qty' => $shipment1Qty,
-                    'order_item' => $orderItem1,
-                ]
-            ),
-            new \Magento\Framework\DataObject(
-                [
-                    'qty' => $shipment3Qty,
-                    'order_item' => $orderItem3,
-                ]
-            ),
-        ];
-        $shipmentMock->expects($this->any())
-            ->method('getAllItems')
-            ->willReturn($shipmentItems);
-
-        return [
-            $orderItem1Id => $shipment1Qty,
-            $orderItem3Id => $shipment3Qty,
-            $orderItem2Id => 0,
-        ];
-    }
-}
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Ui/Component/Report/Listing/Column/CheckColumnOptionSourceTest.php b/app/code/Magento/Braintree/Test/Unit/Ui/Component/Report/Listing/Column/CheckColumnOptionSourceTest.php
similarity index 72%
rename from app/code/Magento/BraintreeTwo/Test/Unit/Ui/Component/Report/Listing/Column/CheckColumnOptionSourceTest.php
rename to app/code/Magento/Braintree/Test/Unit/Ui/Component/Report/Listing/Column/CheckColumnOptionSourceTest.php
index f616a65a70fffe392c22e35feb20cd86dd7b9972..b2be9afc2eae3589beaf8a18b1619aa3b1455958 100644
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Ui/Component/Report/Listing/Column/CheckColumnOptionSourceTest.php
+++ b/app/code/Magento/Braintree/Test/Unit/Ui/Component/Report/Listing/Column/CheckColumnOptionSourceTest.php
@@ -3,11 +3,11 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Test\Unit\Ui\Component\Report\Listing\Column;
+namespace Magento\Braintree\Test\Unit\Ui\Component\Report\Listing\Column;
 
-use Magento\BraintreeTwo\Ui\Component\Report\Listing\Column\PaymentType;
-use Magento\BraintreeTwo\Ui\Component\Report\Listing\Column\Status;
-use Magento\BraintreeTwo\Ui\Component\Report\Listing\Column\TransactionType;
+use Magento\Braintree\Ui\Component\Report\Listing\Column\PaymentType;
+use Magento\Braintree\Ui\Component\Report\Listing\Column\Status;
+use Magento\Braintree\Ui\Component\Report\Listing\Column\TransactionType;
 
 /**
  * Class CheckColumnOptionSourceTest
diff --git a/app/code/Magento/BraintreeTwo/Ui/Component/Report/Listing/Column/PaymentType.php b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/PaymentType.php
similarity index 95%
rename from app/code/Magento/BraintreeTwo/Ui/Component/Report/Listing/Column/PaymentType.php
rename to app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/PaymentType.php
index 528a851fb5612a69ad445100814d15be2c984090..df6c2ffcd229dd244c8f39a8191ac0955fd936c6 100644
--- a/app/code/Magento/BraintreeTwo/Ui/Component/Report/Listing/Column/PaymentType.php
+++ b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/PaymentType.php
@@ -3,7 +3,7 @@
  * Copyright © 2016 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Ui\Component\Report\Listing\Column;
+namespace Magento\Braintree\Ui\Component\Report\Listing\Column;
 
 use Braintree\PaymentInstrumentType;
 use Magento\Framework\Data\OptionSourceInterface;
diff --git a/app/code/Magento/BraintreeTwo/Ui/Component/Report/Listing/Column/Status.php b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/Status.php
similarity index 96%
rename from app/code/Magento/BraintreeTwo/Ui/Component/Report/Listing/Column/Status.php
rename to app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/Status.php
index c6248bc6fa345f666e8a2252a4de51be79034935..f5424c6dd9b7f1a1c30b761fe6b3041017191c7e 100644
--- a/app/code/Magento/BraintreeTwo/Ui/Component/Report/Listing/Column/Status.php
+++ b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/Status.php
@@ -3,7 +3,7 @@
  * Copyright © 2016 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Ui\Component\Report\Listing\Column;
+namespace Magento\Braintree\Ui\Component\Report\Listing\Column;
 
 use Braintree\Transaction;
 use Magento\Framework\Data\OptionSourceInterface;
diff --git a/app/code/Magento/BraintreeTwo/Ui/Component/Report/Listing/Column/TransactionType.php b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/TransactionType.php
similarity index 93%
rename from app/code/Magento/BraintreeTwo/Ui/Component/Report/Listing/Column/TransactionType.php
rename to app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/TransactionType.php
index 38d16b097606fb0f2b777c1e5b180956331e61e0..312b2f518b4644a3ba5165b877d0bba5b0ed9e4b 100644
--- a/app/code/Magento/BraintreeTwo/Ui/Component/Report/Listing/Column/TransactionType.php
+++ b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/TransactionType.php
@@ -3,7 +3,7 @@
  * Copyright © 2016 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\BraintreeTwo\Ui\Component\Report\Listing\Column;
+namespace Magento\Braintree\Ui\Component\Report\Listing\Column;
 
 use Braintree\Transaction;
 use Magento\Framework\Data\OptionSourceInterface;
diff --git a/app/code/Magento/Braintree/composer.json b/app/code/Magento/Braintree/composer.json
index 2778dc6dc6bd9994f38111c81efd92de1829fda6..e5001d4932aa8e27795531ebafe0c6134af01be5 100644
--- a/app/code/Magento/Braintree/composer.json
+++ b/app/code/Magento/Braintree/composer.json
@@ -3,24 +3,23 @@
     "description": "N/A",
     "require": {
         "php": "~5.5.0|~5.6.0|~7.0.0",
-        "magento/module-config": "100.0.*",
-        "magento/module-store": "100.0.*",
-        "magento/module-checkout": "100.0.*",
-        "magento/module-catalog": "100.0.*",
-        "magento/module-sales": "100.0.*",
-        "magento/module-customer": "100.0.*",
-        "magento/module-payment": "100.0.*",
-        "magento/module-paypal": "100.0.*",
-        "magento/module-quote": "100.0.*",
-        "magento/module-backend": "100.0.*",
-        "magento/module-directory": "100.0.*",
-        "magento/module-theme": "100.0.*",
-        "magento/framework": "100.0.*",
+        "magento/framework": "*",
+        "magento/magento-composer-installer": "*",
+        "magento/module-config": "*",
+        "magento/module-directory": "*",
+        "magento/module-payment": "*",
+        "magento/module-checkout": "*",
+        "magento/module-sales": "*",
+        "magento/module-backend": "*",
+        "magento/module-vault": "*",
+        "magento/module-customer": "*",
+        "magento/module-catalog": "*",
+        "magento/module-quote": "*",
+        "magento/module-paypal": "*",
+        "magento/module-checkout-agreements": "*",
+        "magento/module-theme": "*",
         "braintree/braintree_php": "3.7.0"
     },
-    "suggest": {
-        "magento/module-checkout-agreements": "100.0.*"
-    },
     "type": "magento2-module",
     "version": "100.0.2",
     "license": [
diff --git a/app/code/Magento/BraintreeTwo/etc/acl.xml b/app/code/Magento/Braintree/etc/acl.xml
similarity index 82%
rename from app/code/Magento/BraintreeTwo/etc/acl.xml
rename to app/code/Magento/Braintree/etc/acl.xml
index f264abebe0f152a8e228f827eccd2e455fa8e351..e926613a18e1e05466a4f787a8e3fea6d62bd47b 100644
--- a/app/code/Magento/BraintreeTwo/etc/acl.xml
+++ b/app/code/Magento/Braintree/etc/acl.xml
@@ -11,7 +11,7 @@
             <resource id="Magento_Backend::admin">
                 <resource id="Magento_Reports::report">
                     <resource id="Magento_Reports::salesroot">
-                        <resource id="Magento_BraintreeTwo::settlement_report" title="Braintree Settlement" sortOrder="80" />
+                        <resource id="Magento_Braintree::settlement_report" title="Braintree Settlement" sortOrder="80" />
                     </resource>
                 </resource>
             </resource>
diff --git a/app/code/Magento/BraintreeTwo/etc/adminhtml/di.xml b/app/code/Magento/Braintree/etc/adminhtml/di.xml
similarity index 66%
rename from app/code/Magento/BraintreeTwo/etc/adminhtml/di.xml
rename to app/code/Magento/Braintree/etc/adminhtml/di.xml
index eeb0ac6a96acda4a081367f2303db2e14b92cf2c..66966136bf782c494675c7665dbeb954e21ee914 100644
--- a/app/code/Magento/BraintreeTwo/etc/adminhtml/di.xml
+++ b/app/code/Magento/Braintree/etc/adminhtml/di.xml
@@ -6,12 +6,12 @@
  */
 -->
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
-    <type name="Magento\BraintreeTwo\Block\Payment">
+    <type name="Magento\Braintree\Block\Payment">
         <arguments>
-            <argument name="config" xsi:type="object">Magento\BraintreeTwo\Model\Ui\ConfigProvider</argument>
+            <argument name="config" xsi:type="object">Magento\Braintree\Model\Ui\ConfigProvider</argument>
         </arguments>
     </type>
-    <type name="Magento\BraintreeTwo\Block\Info">
+    <type name="Magento\Braintree\Block\Info">
         <arguments>
             <argument name="data" xsi:type="array">
                 <item xsi:type="string" name="is_secure_mode">0</item>
@@ -22,26 +22,26 @@
     <type name="Magento\Vault\Model\Adminhtml\Source\VaultProvidersMap">
         <arguments>
             <argument name="options" xsi:type="array">
-                <item xsi:type="object" name="braintree">BraintreeTwoFacade</item>
+                <item xsi:type="object" name="braintree">BraintreeFacade</item>
             </argument>
         </arguments>
     </type>
-    <virtualType name="BraintreeTwoAuthorizeDataBuilder" type="Magento\Payment\Gateway\Request\BuilderComposite">
+    <virtualType name="BraintreeAuthorizeDataBuilder" type="Magento\Payment\Gateway\Request\BuilderComposite">
         <arguments>
             <argument name="builders" xsi:type="array">
-                <item name="customer" xsi:type="string">Magento\BraintreeTwo\Gateway\Request\CustomerDataBuilder</item>
-                <item name="payment" xsi:type="string">Magento\BraintreeTwo\Gateway\Request\PaymentDataBuilder</item>
-                <item name="address" xsi:type="string">Magento\BraintreeTwo\Gateway\Request\AddressDataBuilder</item>
-                <item name="vault" xsi:type="string">Magento\BraintreeTwo\Gateway\Request\VaultDataBuilder</item>
+                <item name="customer" xsi:type="string">Magento\Braintree\Gateway\Request\CustomerDataBuilder</item>
+                <item name="payment" xsi:type="string">Magento\Braintree\Gateway\Request\PaymentDataBuilder</item>
+                <item name="address" xsi:type="string">Magento\Braintree\Gateway\Request\AddressDataBuilder</item>
+                <item name="vault" xsi:type="string">Magento\Braintree\Gateway\Request\VaultDataBuilder</item>
             </argument>
         </arguments>
     </virtualType>
-    <virtualType name="BraintreeTwoVaultAuthorizeDataBuilder" type="Magento\Payment\Gateway\Request\BuilderComposite">
+    <virtualType name="BraintreeVaultAuthorizeDataBuilder" type="Magento\Payment\Gateway\Request\BuilderComposite">
         <arguments>
             <argument name="builders" xsi:type="array">
-                <item name="customer" xsi:type="string">Magento\BraintreeTwo\Gateway\Request\CustomerDataBuilder</item>
-                <item name="payment" xsi:type="string">Magento\BraintreeTwo\Gateway\Request\PaymentDataBuilder</item>
-                <item name="address" xsi:type="string">Magento\BraintreeTwo\Gateway\Request\AddressDataBuilder</item>
+                <item name="customer" xsi:type="string">Magento\Braintree\Gateway\Request\CustomerDataBuilder</item>
+                <item name="payment" xsi:type="string">Magento\Braintree\Gateway\Request\PaymentDataBuilder</item>
+                <item name="address" xsi:type="string">Magento\Braintree\Gateway\Request\AddressDataBuilder</item>
             </argument>
         </arguments>
     </virtualType>
@@ -49,12 +49,12 @@
     <type name="Magento\Vault\Model\Ui\Adminhtml\TokensConfigProvider">
         <arguments>
             <argument name="tokenUiComponentProviders" xsi:type="array">
-                <item name="braintreetwo" xsi:type="object">Magento\BraintreeTwo\Model\Ui\Adminhtml\TokenUiComponentProvider</item>
+                <item name="braintree" xsi:type="object">Magento\Braintree\Model\Ui\Adminhtml\TokenUiComponentProvider</item>
             </argument>
         </arguments>
     </type>
 
-    <type name="Magento\BraintreeTwo\Controller\Adminhtml\Payment\GetNonce">
+    <type name="Magento\Braintree\Controller\Adminhtml\Payment\GetNonce">
         <arguments>
             <argument name="session" xsi:type="object">Magento\Backend\Model\Session\Quote</argument>
         </arguments>
diff --git a/app/code/Magento/BraintreeTwo/etc/adminhtml/menu.xml b/app/code/Magento/Braintree/etc/adminhtml/menu.xml
similarity index 67%
rename from app/code/Magento/BraintreeTwo/etc/adminhtml/menu.xml
rename to app/code/Magento/Braintree/etc/adminhtml/menu.xml
index 2084778e7c436d0430db97683d80758a046fc76f..ed73aa20cdb6f01e7c934e62e41767262d4c8a5e 100644
--- a/app/code/Magento/BraintreeTwo/etc/adminhtml/menu.xml
+++ b/app/code/Magento/Braintree/etc/adminhtml/menu.xml
@@ -8,12 +8,12 @@
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
     <menu>
         <add
-                id="Magento_BraintreeTwo::settlement_report"
+                id="Magento_Braintree::settlement_report"
                 title="Braintree Settlement"
-                module="Magento_BraintreeTwo"
+                module="Magento_Braintree"
                 sortOrder="80"
                 parent="Magento_Reports::report_salesroot"
-                action="braintreetwo/report"
-                resource="Magento_BraintreeTwo::settlement_report"/>
+                action="braintree/report"
+                resource="Magento_Braintree::settlement_report"/>
     </menu>
 </config>
diff --git a/app/code/Magento/BraintreeTwo/etc/adminhtml/routes.xml b/app/code/Magento/Braintree/etc/adminhtml/routes.xml
similarity index 71%
rename from app/code/Magento/BraintreeTwo/etc/adminhtml/routes.xml
rename to app/code/Magento/Braintree/etc/adminhtml/routes.xml
index 7cd489915cc8b88363161c5be6b9eda8d8c73c36..7b70a3e73dc688e8412907f994603c3267689671 100644
--- a/app/code/Magento/BraintreeTwo/etc/adminhtml/routes.xml
+++ b/app/code/Magento/Braintree/etc/adminhtml/routes.xml
@@ -7,8 +7,8 @@
 -->
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
     <router id="admin">
-        <route id="braintreetwo" frontName="braintreetwo">
-            <module name="Magento_BraintreeTwo" before="Magento_Backend" />
+        <route id="braintree" frontName="braintree">
+            <module name="Magento_Braintree" before="Magento_Backend" />
         </route>
     </router>
 </config>
diff --git a/app/code/Magento/Braintree/etc/adminhtml/system.xml b/app/code/Magento/Braintree/etc/adminhtml/system.xml
index 55190b106779f9f4a1e279f76534ca4d2723e035..36ce17a858200229cdb85fe38c88dcbbf540b04f 100644
--- a/app/code/Magento/Braintree/etc/adminhtml/system.xml
+++ b/app/code/Magento/Braintree/etc/adminhtml/system.xml
@@ -26,7 +26,7 @@
                             <group id="braintree_required"/>
                         </requires>
                     </field>
-                    <field id="active_braintree_pay_pal" translate="label" type="select" sortOrder="11" showInDefault="1" showInWebsite="1" showInStore="0">
+                    <field id="active_braintree_paypal" translate="label" type="select" sortOrder="11" showInDefault="1" showInWebsite="1" showInStore="0">
                         <label>Enable PayPal through Braintree</label>
                         <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                         <config_path>payment/braintree_paypal/active</config_path>
@@ -45,18 +45,14 @@
                         </field>
                         <field id="environment" translate="label" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="0">
                             <label>Environment</label>
-                            <source_model>Magento\Braintree\Model\Source\Environment</source_model>
+                            <source_model>Magento\Braintree\Model\Adminhtml\Source\Environment</source_model>
                             <config_path>payment/braintree/environment</config_path>
                         </field>
                         <field id="payment_action" translate="label" type="select" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="0">
                             <label>Payment Action</label>
-                            <source_model>Magento\Braintree\Model\Source\PaymentAction</source_model>
+                            <source_model>Magento\Braintree\Model\Adminhtml\Source\PaymentAction</source_model>
                             <config_path>payment/braintree/payment_action</config_path>
                         </field>
-                        <field id="merchant_account_id" translate="label" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Merchant Account ID</label>
-                            <config_path>payment/braintree/merchant_account_id</config_path>
-                        </field>
                         <field id="merchant_id" translate="label" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="0">
                             <label>Merchant ID</label>
                             <config_path>payment/braintree/merchant_id</config_path>
@@ -75,66 +71,41 @@
                     <group id="braintree_advanced" translate="label" showInDefault="1" showInWebsite="1" sortOrder="20">
                         <label>Advanced Braintree Settings</label>
                         <frontend_model>Magento\Config\Block\System\Config\Form\Fieldset</frontend_model>
-                        <field id="debug" translate="label" type="select" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Debug</label>
-                            <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
-                            <config_path>payment/braintree/debug</config_path>
-                        </field>
-                        <field id="capture_action" translate="label" type="select" sortOrder="60" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Capture Action</label>
-                            <source_model>Magento\Braintree\Model\Source\CaptureAction</source_model>
-                            <config_path>payment/braintree/capture_action</config_path>
-                        </field>
-                        <field id="order_status" translate="label" type="select" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>New Order Status</label>
-                            <source_model>Magento\Sales\Model\Config\Source\Order\Status\Processing</source_model>
-                            <config_path>payment/braintree/order_status</config_path>
+                        <field id="merchant_account_id" translate="label" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="0">
+                            <label>Merchant Account ID</label>
+                            <comment>If you don't specify the merchant account to use to process a transaction, Braintree will process it using your default merchant account.</comment>
+                            <config_path>payment/braintree/merchant_account_id</config_path>
                         </field>
-                        <field id="use_vault" translate="label" type="select" sortOrder="130" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Use Vault</label>
+                        <field id="fraudprotection" translate="label" type="select" sortOrder="34" showInDefault="1" showInWebsite="1" showInStore="0">
+                            <label>Advanced Fraud Protection</label>
                             <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
-                            <config_path>payment/braintree/use_vault</config_path>
+                            <comment>Be sure to Enable Advanced Fraud Protection in Your Braintree Account in Settings/Processing Section</comment>
+                            <config_path>payment/braintree/fraudprotection</config_path>
+                        </field>
+                        <field id="kount_id" translate="label" sortOrder="35" showInDefault="1" showInWebsite="1" showInStore="0">
+                            <label>Kount Merchant ID</label>
+                            <comment><![CDATA[Used for direct fraud tool integration. Make sure you also contact <a href="mailto:accounts@braintreepayments.com">accounts@braintreepayments.com</a> to setup your Kount account.]]></comment>
+                            <depends>
+                                <field id="fraudprotection">1</field>
+                            </depends>
+                            <config_path>payment/braintree/kount_id</config_path>
                         </field>
-                        <field id="duplicate_card" translate="label" type="select" sortOrder="140" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Allow Duplicate Cards</label>
+                        <field id="debug" translate="label" type="select" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="0">
+                            <label>Debug</label>
                             <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
-                            <config_path>payment/braintree/duplicate_card</config_path>
+                            <config_path>payment/braintree/debug</config_path>
                         </field>
                         <field id="useccv" translate="label" type="select" sortOrder="150" showInDefault="1" showInWebsite="1" showInStore="0">
                             <label>CVV Verification</label>
                             <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
-                            <comment>Be sure to Enable AVS and/or CVV in Your Braintree Account in Settings/Processing Section</comment>
+                            <comment>Be sure to Enable AVS and/or CVV in Your Braintree Account in Settings/Processing Section.</comment>
                             <config_path>payment/braintree/useccv</config_path>
                         </field>
                         <field id="cctypes" translate="label" type="multiselect" sortOrder="160" showInDefault="1" showInWebsite="1" showInStore="0">
                             <label>Credit Card Types</label>
-                            <source_model>Magento\Braintree\Model\Source\CcType</source_model>
+                            <source_model>Magento\Braintree\Model\Adminhtml\Source\CcType</source_model>
                             <config_path>payment/braintree/cctypes</config_path>
                         </field>
-                        <field id="enable_cc_detection" translate="label" type="select" sortOrder="170" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Enable Credit Card auto-detection on Storefront</label>
-                            <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
-                            <comment>Typing in a credit card number will automatically select the credit card type</comment>
-                            <config_path>payment/braintree/enable_cc_detection</config_path>
-                        </field>
-                        <field id="fraudprotection" translate="label" type="select" sortOrder="180" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Advanced Fraud Protection</label>
-                            <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
-                            <comment>Be sure to Enable Advanced Fraud Protection in Your Braintree Account in Settings/Processing Section</comment>
-                            <config_path>payment/braintree/fraudprotection</config_path>
-                        </field>
-                        <field id="kount_id" translate="label" type="textarea" sortOrder="185" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Your Kount ID</label>
-                            <comment><![CDATA[Used for direct fraud tool integration. Make sure you also contact <a href="mailto:accounts@braintreepayments.com">accounts@braintreepayments.com</a> to setup your Kount account.]]></comment>
-                            <depends><field id="fraudprotection">1</field></depends>
-                            <config_path>payment/braintree/kount_id</config_path>
-                        </field>
-                        <field id="usecache" translate="label" type="select" sortOrder="190" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Use Cache</label>
-                            <comment>Some of results will be cached to improve performance. Magento cache have to be enabled</comment>
-                            <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
-                            <config_path>payment/braintree/usecache</config_path>
-                        </field>
                         <field id="sort_order" translate="label" type="text" sortOrder="230" showInDefault="1" showInWebsite="1" showInStore="0">
                             <label>Sort Order</label>
                             <frontend_class>validate-number</frontend_class>
@@ -151,14 +122,14 @@
                         </field>
                         <field id="specificcountry" translate="label" type="multiselect" sortOrder="210" showInDefault="1" showInWebsite="1" showInStore="0">
                             <label>Payment from Specific Countries</label>
-                            <source_model>Magento\Braintree\Model\System\Config\Source\Country</source_model>
+                            <source_model>Magento\Braintree\Model\Adminhtml\System\Config\Country</source_model>
                             <can_be_empty>1</can_be_empty>
                             <config_path>payment/braintree/specificcountry</config_path>
                         </field>
                         <field id="countrycreditcard" translate="label" sortOrder="220" showInDefault="1" showInWebsite="1" showInStore="0">
                             <label>Country Specific Credit Card Types</label>
-                            <frontend_model>Magento\Braintree\Block\Adminhtml\Form\Field\Countrycreditcard</frontend_model>
-                            <backend_model>Magento\Braintree\Model\System\Config\Backend\Countrycreditcard</backend_model>
+                            <frontend_model>Magento\Braintree\Block\Adminhtml\Form\Field\CountryCreditCard</frontend_model>
+                            <backend_model>Magento\Braintree\Model\Adminhtml\System\Config\CountryCreditCard</backend_model>
                             <config_path>payment/braintree/countrycreditcard</config_path>
                         </field>
                     </group>
@@ -168,6 +139,7 @@
                         <field id="title" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
                             <label>Title</label>
                             <config_path>payment/braintree_paypal/title</config_path>
+                            <comment>It is recommended to set this value to "PayPal" per store views.</comment>
                         </field>
                         <field id="sort_order" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="0">
                             <label>Sort Order</label>
@@ -180,14 +152,9 @@
                         </field>
                         <field id="payment_action" translate="label" type="select" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="0">
                             <label>Payment Action</label>
-                            <source_model>Magento\Braintree\Model\Source\PaymentAction</source_model>
+                            <source_model>Magento\Braintree\Model\Adminhtml\Source\PaymentAction</source_model>
                             <config_path>payment/braintree_paypal/payment_action</config_path>
                         </field>
-                        <field id="order_status" translate="label" type="select" sortOrder="60" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>New Order Status</label>
-                            <source_model>Magento\Sales\Model\Config\Source\Order\Status\Processing</source_model>
-                            <config_path>payment/braintree_paypal/order_status</config_path>
-                        </field>
                         <field id="allowspecific" translate="label" type="allowspecific" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="0">
                             <label>Payment from Applicable Countries</label>
                             <source_model>Magento\Payment\Model\Config\Source\Allspecificcountries</source_model>
@@ -195,30 +162,32 @@
                         </field>
                         <field id="specificcountry" translate="label" type="multiselect" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="0">
                             <label>Payment from Specific Countries</label>
-                            <source_model>Magento\Braintree\Model\System\Config\Source\Country</source_model>
+                            <source_model>Magento\Braintree\Model\Adminhtml\System\Config\Country</source_model>
                             <can_be_empty>1</can_be_empty>
                             <config_path>payment/braintree_paypal/specificcountry</config_path>
                         </field>
-                        <field id="display_on_shopping_cart" translate="label" type="select" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Display on Shopping Cart</label>
-                            <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
-                            <config_path>payment/braintree_paypal/display_on_shopping_cart</config_path>
-                        </field>
                         <field id="require_billing_address" translate="label" type="select" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="0">
                             <label>Require Customer's Billing Address</label>
                             <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                             <config_path>payment/braintree_paypal/require_billing_address</config_path>
+                            <comment>This feature needs be enabled first for the merchant account through PayPal technical support.</comment>
                         </field>
-                        <field id="allow_shipping_address_override" translate="label" type="select" sortOrder="110" showInDefault="1" showInWebsite="1" showInStore="0">
+                        <field id="allow_shipping_address_override" translate="label" type="select" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0">
                             <label>Allow to Edit Shipping Address Entered During Checkout on PayPal Side</label>
                             <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                             <config_path>payment/braintree_paypal/allow_shipping_address_override</config_path>
                         </field>
-                        <field id="debug" translate="label" type="select" sortOrder="120" showInDefault="1" showInWebsite="1" showInStore="0">
+                        <field id="debug" translate="label" type="select" sortOrder="110" showInDefault="1" showInWebsite="1" showInStore="0">
                             <label>Debug</label>
                             <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                             <config_path>payment/braintree_paypal/debug</config_path>
                         </field>
+                        <field id="display_on_shopping_cart" translate="label" type="select" sortOrder="120" showInDefault="1" showInWebsite="1" showInStore="0">
+                            <label>Display on Shopping Cart</label>
+                            <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
+                            <config_path>payment/braintree_paypal/display_on_shopping_cart</config_path>
+                            <comment>Also affects mini-shopping cart.</comment>
+                        </field>
                     </group>
                     <group id="braintree_3dsecure" translate="label" showInDefault="1" showInWebsite="1" sortOrder="41">
                         <label>3D Secure Verification Settings</label>
@@ -228,6 +197,21 @@
                             <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                             <config_path>payment/braintree/verify_3dsecure</config_path>
                         </field>
+                        <field id="threshold_amount" translate="label" type="text" sortOrder="151" showInDefault="1" showInWebsite="1" showInStore="0">
+                            <label>Threshold Amount</label>
+                            <config_path>payment/braintree/threshold_amount</config_path>
+                        </field>
+                        <field id="allowspecific" translate="label" type="allowspecific" sortOrder="152" showInDefault="1" showInWebsite="1" showInStore="0">
+                            <label>Verify for Applicable Countries</label>
+                            <source_model>Magento\Payment\Model\Config\Source\Allspecificcountries</source_model>
+                            <config_path>payment/braintree/verify_all_countries</config_path>
+                        </field>
+                        <field id="specificcountry" translate="label" type="multiselect" sortOrder="153" showInDefault="1" showInWebsite="1" showInStore="0">
+                            <label>Verify for Specific Countries</label>
+                            <source_model>Magento\Braintree\Model\Adminhtml\System\Config\Country</source_model>
+                            <can_be_empty>1</can_be_empty>
+                            <config_path>payment/braintree/verify_specific_countries</config_path>
+                        </field>
                     </group>
                 </group>
             </group>
diff --git a/app/code/Magento/Braintree/etc/config.xml b/app/code/Magento/Braintree/etc/config.xml
index 325439b6c8cbd24add45e3d15801bd40f2bb650b..a82be282ca024ec9bb3a9ee4d9750e0c2cd3d976 100644
--- a/app/code/Magento/Braintree/etc/config.xml
+++ b/app/code/Magento/Braintree/etc/config.xml
@@ -9,35 +9,56 @@
     <default>
         <payment>
             <braintree>
-                <model>Magento\Braintree\Model\PaymentMethod</model>
+                <model>BraintreeFacade</model>
                 <title>Credit Card (Braintree)</title>
                 <payment_action>authorize</payment_action>
                 <active>0</active>
-                <cctypes>AE,VI,MC,DI,JCB</cctypes>
+                <is_gateway>1</is_gateway>
+                <can_use_checkout>1</can_use_checkout>
+                <can_authorize>1</can_authorize>
+                <can_capture>1</can_capture>
+                <can_capture_partial>1</can_capture_partial>
+                <can_authorize_vault>1</can_authorize_vault>
+                <can_capture_vault>1</can_capture_vault>
+                <can_use_internal>1</can_use_internal>
+                <can_refund_partial_per_invoice>1</can_refund_partial_per_invoice>
+                <can_refund>1</can_refund>
+                <can_void>1</can_void>
+                <can_cancel>1</can_cancel>
+                <cctypes>AE,VI,MC,DI,JCB,CUP,DN,MI</cctypes>
                 <useccv>1</useccv>
-                <verify_3dsecure>0</verify_3dsecure>
+                <cctypes_braintree_mapper><![CDATA[{"american-express":"AE","discover":"DI","jcb":"JCB","mastercard":"MC","master-card":"MC","visa":"VI","maestro":"MI","diners-club":"DN","unionpay":"CUP"}]]></cctypes_braintree_mapper>
                 <order_status>processing</order_status>
                 <environment>sandbox</environment>
                 <allowspecific>0</allowspecific>
-                <fraudprotection>0</fraudprotection>
-                <capture_action>invoice</capture_action>
-                <data_js><![CDATA[https://js.braintreegateway.com/v1/braintree-data.js]]></data_js>
+                <sdk_url><![CDATA[https://js.braintreegateway.com/js/braintree-2.17.6.min.js]]></sdk_url>
                 <public_key backend_model="Magento\Config\Model\Config\Backend\Encrypted" />
                 <private_key backend_model="Magento\Config\Model\Config\Backend\Encrypted" />
-                <duplicate_card>0</duplicate_card>
                 <masked_fields>cvv,number</masked_fields>
-                <usecache>0</usecache>
-                <enable_cc_detection>1</enable_cc_detection>
+                <privateInfoKeys>avsPostalCodeResponseCode,avsStreetAddressResponseCode,cvvResponseCode,processorAuthorizationCode,processorResponseCode,processorResponseText,liabilityShifted,liabilityShiftPossible,riskDataId,riskDataDecision</privateInfoKeys>
+                <paymentInfoKeys>cc_type,cc_number,avsPostalCodeResponseCode,avsStreetAddressResponseCode,cvvResponseCode,processorAuthorizationCode,processorResponseCode,processorResponseText,liabilityShifted,liabilityShiftPossible,riskDataId,riskDataDecision</paymentInfoKeys>
             </braintree>
             <braintree_paypal>
-                <model>Magento\Braintree\Model\PaymentMethod\PayPal</model>
+                <model>BraintreePayPalFacade</model>
                 <title>PayPal (Braintree)</title>
-                <payment_action>authorize</payment_action>
                 <active>0</active>
+                <payment_action>authorize</payment_action>
                 <allowspecific>0</allowspecific>
-                <order_status>processing</order_status>
-                <dispaly_on_shopping_cart>1</dispaly_on_shopping_cart>
                 <require_billing_address>0</require_billing_address>
+                <allow_shipping_address_override>1</allow_shipping_address_override>
+                <display_on_shopping_cart>1</display_on_shopping_cart>
+                <order_status>processing</order_status>
+                <is_gateway>1</is_gateway>
+                <can_use_checkout>1</can_use_checkout>
+                <can_authorize>1</can_authorize>
+                <can_capture>1</can_capture>
+                <can_capture_partial>1</can_capture_partial>
+                <can_refund>1</can_refund>
+                <can_refund_partial_per_invoice>1</can_refund_partial_per_invoice>
+                <can_void>1</can_void>
+                <can_cancel>1</can_cancel>
+                <privateInfoKeys>processorResponseCode,processorResponseText,paymentId</privateInfoKeys>
+                <paymentInfoKeys>processorResponseCode,processorResponseText,paymentId,payerEmail</paymentInfoKeys>
             </braintree_paypal>
         </payment>
     </default>
diff --git a/app/code/Magento/Braintree/etc/di.xml b/app/code/Magento/Braintree/etc/di.xml
index 575aa507e7ca84a4a8f57e36f84761691088cb99..bb841fa56d2ffe8be21b89f0b2299400b5aa75e3 100644
--- a/app/code/Magento/Braintree/etc/di.xml
+++ b/app/code/Magento/Braintree/etc/di.xml
@@ -6,7 +6,403 @@
  */
 -->
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
-    <type name="Magento\Sales\Model\Order\Payment">
-        <plugin name="braintreeSalesOrderPayment" type="\Magento\Braintree\Model\Plugin\Sales\Order\PaymentPlugin"/>
+    <!-- Payment Method Facade configuration -->
+    <virtualType name="BraintreeFacade" type="Magento\Payment\Model\Method\Adapter">
+        <arguments>
+            <argument name="code" xsi:type="const">Magento\Braintree\Model\Ui\ConfigProvider::CODE</argument>
+            <argument name="formBlockType" xsi:type="string">Magento\Braintree\Block\Form</argument>
+            <argument name="infoBlockType" xsi:type="string">Magento\Braintree\Block\Info</argument>
+            <argument name="valueHandlerPool" xsi:type="object">BraintreeValueHandlerPool</argument>
+            <argument name="validatorPool" xsi:type="object">BraintreeValidatorPool</argument>
+            <argument name="commandPool" xsi:type="object">BraintreeCommandPool</argument>
+        </arguments>
+    </virtualType>
+    <virtualType name="BraintreePayPalFacade" type="BraintreeFacade">
+        <arguments>
+            <argument name="code" xsi:type="const">Magento\Braintree\Model\Ui\ConfigProvider::PAYPAL_CODE</argument>
+            <argument name="infoBlockType" xsi:type="string">BraintreePayPalInfo</argument>
+            <argument name="valueHandlerPool" xsi:type="object">BraintreePayPalValueHandlerPool</argument>
+            <argument name="commandPool" xsi:type="object">BraintreePayPalCommandPool</argument>
+        </arguments>
+    </virtualType>
+
+    <!-- Configuration reader -->
+    <type name="Magento\Braintree\Gateway\Config\Config">
+        <arguments>
+            <argument name="methodCode" xsi:type="const">Magento\Braintree\Model\Ui\ConfigProvider::CODE</argument>
+        </arguments>
     </type>
+    <type name="Magento\Braintree\Gateway\Config\PayPal\Config">
+        <arguments>
+            <argument name="methodCode" xsi:type="const">Magento\Braintree\Model\Ui\ConfigProvider::PAYPAL_CODE</argument>
+        </arguments>
+    </type>
+
+    <!-- Logger, initialized with BraintreeConfig -->
+    <virtualType name="BraintreeLogger" type="Magento\Payment\Model\Method\Logger">
+        <arguments>
+            <argument name="config" xsi:type="object">Magento\Braintree\Gateway\Config\Config</argument>
+        </arguments>
+    </virtualType>
+
+    <!-- Commands infrastructure -->
+    <virtualType name="BraintreeCommandPool" type="Magento\Payment\Gateway\Command\CommandPool">
+        <arguments>
+            <argument name="commands" xsi:type="array">
+                <item name="authorize" xsi:type="string">BraintreeAuthorizeCommand</item>
+                <item name="sale" xsi:type="string">BraintreeSaleCommand</item>
+                <item name="capture" xsi:type="string">BraintreeCaptureStrategyCommand</item>
+                <item name="settlement" xsi:type="string">BraintreeCaptureCommand</item>
+                <item name="vault_authorize" xsi:type="string">BraintreeVaultAuthorizeCommand</item>
+                <item name="vault_sale" xsi:type="string">BraintreeVaultSaleCommand</item>
+                <item name="vault_capture" xsi:type="string">BraintreeVaultCaptureCommand</item>
+                <item name="void" xsi:type="string">BraintreeVoidCommand</item>
+                <item name="refund" xsi:type="string">BraintreeRefundCommand</item>
+                <item name="cancel" xsi:type="string">BraintreeVoidCommand</item>
+            </argument>
+        </arguments>
+    </virtualType>
+    <virtualType name="BraintreePayPalCommandPool" type="Magento\Payment\Gateway\Command\CommandPool">
+        <arguments>
+            <argument name="commands" xsi:type="array">
+                <item name="authorize" xsi:type="string">BraintreePayPalAuthorizeCommand</item>
+                <item name="sale" xsi:type="string">BraintreePayPalSaleCommand</item>
+                <item name="capture" xsi:type="string">BraintreePayPalCaptureStrategyCommand</item>
+                <item name="settlement" xsi:type="string">BraintreeCaptureCommand</item>
+                <item name="void" xsi:type="string">BraintreeVoidCommand</item>
+                <item name="refund" xsi:type="string">BraintreeRefundCommand</item>
+                <item name="cancel" xsi:type="string">BraintreeVoidCommand</item>
+            </argument>
+        </arguments>
+    </virtualType>
+
+    <virtualType name="BraintreeCommandManager" type="Magento\Payment\Gateway\Command\CommandManager">
+        <arguments>
+            <argument name="commandPool" xsi:type="object">BraintreeCommandPool</argument>
+        </arguments>
+    </virtualType>
+
+    <type name="Magento\Payment\Gateway\Command\CommandManagerPool">
+        <arguments>
+            <argument name="executors" xsi:type="array">
+                <item name="braintree" xsi:type="string">BraintreeCommandManager</item>
+            </argument>
+        </arguments>
+    </type>
+
+    <virtualType name="BraintreeCaptureStrategyCommand" type="Magento\Braintree\Gateway\Command\CaptureStrategyCommand">
+        <arguments>
+            <argument name="commandPool" xsi:type="object">BraintreeCommandPool</argument>
+        </arguments>
+    </virtualType>
+    <virtualType name="BraintreePayPalCaptureStrategyCommand" type="Magento\Braintree\Gateway\Command\CaptureStrategyCommand">
+        <arguments>
+            <argument name="commandPool" xsi:type="object">BraintreePayPalCommandPool</argument>
+        </arguments>
+    </virtualType>
+
+    <!-- Authorization command  -->
+    <virtualType name="BraintreeAuthorizeCommand" type="Magento\Payment\Gateway\Command\GatewayCommand">
+        <arguments>
+            <argument name="requestBuilder" xsi:type="object">BraintreeAuthorizeRequest</argument>
+            <argument name="transferFactory" xsi:type="object">Magento\Braintree\Gateway\Http\TransferFactory</argument>
+            <argument name="client" xsi:type="object">Magento\Braintree\Gateway\Http\Client\TransactionSale</argument>
+            <argument name="handler" xsi:type="object">BraintreeAuthorizationHandler</argument>
+            <argument name="validator" xsi:type="object">Magento\Braintree\Gateway\Validator\ResponseValidator</argument>
+        </arguments>
+    </virtualType>
+    <virtualType name="BraintreeAuthorizeRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
+        <arguments>
+            <argument name="builders" xsi:type="array">
+                <item name="customer" xsi:type="string">Magento\Braintree\Gateway\Request\CustomerDataBuilder</item>
+                <item name="payment" xsi:type="string">Magento\Braintree\Gateway\Request\PaymentDataBuilder</item>
+                <item name="address" xsi:type="string">Magento\Braintree\Gateway\Request\AddressDataBuilder</item>
+                <item name="vault" xsi:type="string">Magento\Braintree\Gateway\Request\VaultDataBuilder</item>
+                <item name="3dsecure" xsi:type="string">Magento\Braintree\Gateway\Request\ThreeDSecureDataBuilder</item>
+                <item name="kount" xsi:type="string">Magento\Braintree\Gateway\Request\KountPaymentDataBuilder</item>
+            </argument>
+        </arguments>
+    </virtualType>
+
+    <!-- Vault Authorization command -->
+    <virtualType name="BraintreeVaultAuthorizeCommand" type="Magento\Payment\Gateway\Command\GatewayCommand">
+        <arguments>
+            <argument name="requestBuilder" xsi:type="object">BraintreeVaultAuthorizeRequest</argument>
+            <argument name="transferFactory" xsi:type="object">Magento\Braintree\Gateway\Http\TransferFactory</argument>
+            <argument name="client" xsi:type="object">Magento\Braintree\Gateway\Http\Client\TransactionSale</argument>
+            <argument name="handler" xsi:type="object">BraintreeVaultResponseHandler</argument>
+            <argument name="validator" xsi:type="object">Magento\Braintree\Gateway\Validator\ResponseValidator</argument>
+        </arguments>
+    </virtualType>
+    <virtualType name="BraintreeVaultAuthorizeRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
+        <arguments>
+            <argument name="builders" xsi:type="array">
+                <item name="customer" xsi:type="string">Magento\Braintree\Gateway\Request\CustomerDataBuilder</item>
+                <item name="payment" xsi:type="string">Magento\Braintree\Gateway\Request\PaymentDataBuilder</item>
+                <item name="address" xsi:type="string">Magento\Braintree\Gateway\Request\AddressDataBuilder</item>
+                <item name="3dsecure" xsi:type="string">Magento\Braintree\Gateway\Request\ThreeDSecureDataBuilder</item>
+                <item name="kount" xsi:type="string">Magento\Braintree\Gateway\Request\KountPaymentDataBuilder</item>
+            </argument>
+        </arguments>
+    </virtualType>
+
+    <!-- PayPal Authorization command -->
+    <virtualType name="BraintreePayPalAuthorizeCommand" type="BraintreeAuthorizeCommand">
+        <arguments>
+            <argument name="requestBuilder" xsi:type="object">BraintreePayPalAuthorizeRequest</argument>
+            <argument name="handler" xsi:type="object">BraintreePayPalResponseHandler</argument>
+        </arguments>
+    </virtualType>
+    <virtualType name="BraintreePayPalAuthorizeRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
+        <arguments>
+            <argument name="builders" xsi:type="array">
+                <item name="customer" xsi:type="string">Magento\Braintree\Gateway\Request\CustomerDataBuilder</item>
+                <item name="payment" xsi:type="string">Magento\Braintree\Gateway\Request\PaymentDataBuilder</item>
+            </argument>
+        </arguments>
+    </virtualType>
+
+    <type name="Magento\Braintree\Gateway\Http\Client\TransactionSale">
+        <arguments>
+            <argument name="customLogger" xsi:type="object">BraintreeLogger</argument>
+        </arguments>
+    </type>
+    <type name="Magento\Braintree\Gateway\Http\Client\TransactionSubmitForSettlement">
+        <arguments>
+            <argument name="customLogger" xsi:type="object">BraintreeLogger</argument>
+        </arguments>
+    </type>
+    <type name="Magento\Braintree\Gateway\Http\Client\TransactionRefund">
+        <arguments>
+            <argument name="customLogger" xsi:type="object">BraintreeLogger</argument>
+        </arguments>
+    </type>
+    <type name="Magento\Braintree\Gateway\Http\Client\TransactionVoid">
+        <arguments>
+            <argument name="customLogger" xsi:type="object">BraintreeLogger</argument>
+        </arguments>
+    </type>
+
+    <!-- Authorization&Capture command  -->
+    <virtualType name="BraintreeSaleCommand" type="BraintreeAuthorizeCommand">
+        <arguments>
+            <argument name="requestBuilder" xsi:type="object">BraintreeSaleRequest</argument>
+        </arguments>
+    </virtualType>
+    <virtualType name="BraintreeSaleRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
+        <arguments>
+            <argument name="builders" xsi:type="array">
+                <item name="authorize" xsi:type="string">BraintreeAuthorizeRequest</item>
+                <item name="settlement" xsi:type="string">Magento\Braintree\Gateway\Request\SettlementDataBuilder</item>
+            </argument>
+        </arguments>
+    </virtualType>
+    <!-- Vault Authorization&Capture command -->
+    <virtualType name="BraintreeVaultSaleCommand" type="BraintreeVaultAuthorizeCommand">
+        <arguments>
+            <argument name="requestBuilder" xsi:type="object">BraintreeVaultSaleRequest</argument>
+        </arguments>
+    </virtualType>
+    <virtualType name="BraintreeVaultSaleRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
+        <arguments>
+            <argument name="builders" xsi:type="array">
+                <item name="authorize" xsi:type="string">BraintreeVaultAuthorizeRequest</item>
+                <item name="settlement" xsi:type="string">Magento\Braintree\Gateway\Request\SettlementDataBuilder</item>
+            </argument>
+        </arguments>
+    </virtualType>
+    <!-- PayPal Authorization&Capture command -->
+    <virtualType name="BraintreePayPalSaleCommand" type="BraintreePayPalAuthorizeCommand">
+        <arguments>
+            <argument name="requestBuilder" xsi:type="object">BraintreePayPalSaleRequest</argument>
+        </arguments>
+    </virtualType>
+    <virtualType name="BraintreePayPalSaleRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
+        <arguments>
+            <argument name="builders" xsi:type="array">
+                <item name="authorize" xsi:type="string">BraintreePayPalAuthorizeRequest</item>
+                <item name="settlement" xsi:type="string">Magento\Braintree\Gateway\Request\SettlementDataBuilder</item>
+            </argument>
+        </arguments>
+    </virtualType>
+
+    <!-- Capture command  -->
+    <virtualType name="BraintreeCaptureCommand" type="Magento\Payment\Gateway\Command\GatewayCommand">
+        <arguments>
+            <argument name="requestBuilder" xsi:type="object">BraintreeCaptureRequest</argument>
+            <argument name="transferFactory" xsi:type="object">Magento\Braintree\Gateway\Http\TransferFactory</argument>
+            <argument name="client" xsi:type="object">Magento\Braintree\Gateway\Http\Client\TransactionSubmitForSettlement</argument>
+            <argument name="handler" xsi:type="object">Magento\Braintree\Gateway\Response\TransactionIdHandler</argument>
+            <argument name="validator" xsi:type="object">Magento\Braintree\Gateway\Validator\ResponseValidator</argument>
+        </arguments>
+    </virtualType>
+    <virtualType name="BraintreeCaptureRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
+        <arguments>
+            <argument name="builders" xsi:type="array">
+                <item name="capture" xsi:type="string">Magento\Braintree\Gateway\Request\CaptureDataBuilder</item>
+            </argument>
+        </arguments>
+    </virtualType>
+
+    <!-- Vault Capture (Sale actually) command -->
+    <virtualType name="BraintreeVaultCaptureCommand" type="Magento\Payment\Gateway\Command\GatewayCommand">
+        <arguments>
+            <argument name="requestBuilder" xsi:type="object">BraintreeVaultCaptureRequest</argument>
+            <argument name="transferFactory" xsi:type="object">Magento\Braintree\Gateway\Http\TransferFactory</argument>
+            <argument name="client" xsi:type="object">Magento\Braintree\Gateway\Http\Client\TransactionSale</argument>
+            <argument name="handler" xsi:type="object">Magento\Braintree\Gateway\Response\TransactionIdHandler</argument>
+            <argument name="validator" xsi:type="object">Magento\Braintree\Gateway\Validator\ResponseValidator</argument>
+        </arguments>
+    </virtualType>
+    <virtualType name="BraintreeVaultCaptureRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
+        <arguments>
+            <argument name="builders" xsi:type="array">
+                <item name="vault_capture" xsi:type="string">Magento\Braintree\Gateway\Request\VaultCaptureDataBuilder</item>
+                <item name="settlement" xsi:type="string">Magento\Braintree\Gateway\Request\SettlementDataBuilder</item>
+            </argument>
+        </arguments>
+    </virtualType>
+    
+    <!-- Value handlers infrastructure -->
+    <virtualType name="BraintreeValueHandlerPool" type="Magento\Payment\Gateway\Config\ValueHandlerPool">
+        <arguments>
+            <argument name="handlers" xsi:type="array">
+                <item name="default" xsi:type="string">BraintreeConfigValueHandler</item>
+                <item name="can_void" xsi:type="string">Magento\Braintree\Gateway\Config\CanVoidHandler</item>
+                <item name="can_cancel" xsi:type="string">Magento\Braintree\Gateway\Config\CanVoidHandler</item>
+            </argument>
+        </arguments>
+    </virtualType>
+    <virtualType name="BraintreeConfigValueHandler" type="Magento\Payment\Gateway\Config\ConfigValueHandler">
+        <arguments>
+            <argument name="configInterface" xsi:type="object">Magento\Braintree\Gateway\Config\Config</argument>
+        </arguments>
+    </virtualType>
+    <virtualType name="BraintreeAuthorizationHandler" type="Magento\Payment\Gateway\Response\HandlerChain">
+        <arguments>
+            <argument name="handlers" xsi:type="array">
+                <item name="payment_details" xsi:type="string">Magento\Braintree\Gateway\Response\PaymentDetailsHandler</item>
+                <item name="txn_id" xsi:type="string">Magento\Braintree\Gateway\Response\TransactionIdHandler</item>
+                <item name="card_details" xsi:type="string">Magento\Braintree\Gateway\Response\CardDetailsHandler</item>
+                <item name="risk_data" xsi:type="string">Magento\Braintree\Gateway\Response\RiskDataHandler</item>
+                <item name="vault_details" xsi:type="string">Magento\Braintree\Gateway\Response\VaultDetailsHandler</item>
+                <item name="3d_secure" xsi:type="string">Magento\Braintree\Gateway\Response\ThreeDSecureDetailsHandler</item>
+            </argument>
+        </arguments>
+    </virtualType>
+    <virtualType name="BraintreeVaultResponseHandler" type="Magento\Payment\Gateway\Response\HandlerChain">
+        <arguments>
+            <argument name="handlers" xsi:type="array">
+                <item name="payment_details" xsi:type="string">Magento\Braintree\Gateway\Response\PaymentDetailsHandler</item>
+                <item name="txn_id" xsi:type="string">Magento\Braintree\Gateway\Response\TransactionIdHandler</item>
+                <item name="card_details" xsi:type="string">Magento\Braintree\Gateway\Response\CardDetailsHandler</item>
+                <item name="risk_data" xsi:type="string">Magento\Braintree\Gateway\Response\RiskDataHandler</item>
+                <item name="3d_secure" xsi:type="string">Magento\Braintree\Gateway\Response\ThreeDSecureDetailsHandler</item>
+            </argument>
+        </arguments>
+    </virtualType>
+    <virtualType name="BraintreePayPalResponseHandler" type="Magento\Payment\Gateway\Response\HandlerChain">
+        <arguments>
+            <argument name="handlers" xsi:type="array">
+                <item name="payment_details" xsi:type="string">Magento\Braintree\Gateway\Response\PaymentDetailsHandler</item>
+                <item name="txn_id" xsi:type="string">Magento\Braintree\Gateway\Response\TransactionIdHandler</item>
+                <item name="paypal_details" xsi:type="string">Magento\Braintree\Gateway\Response\PayPalDetailsHandler</item>
+            </argument>
+        </arguments>
+    </virtualType>
+
+    <!-- PayPal value handlers infrastructure -->
+    <virtualType name="BraintreePayPalValueHandlerPool" type="Magento\Payment\Gateway\Config\ValueHandlerPool">
+        <arguments>
+            <argument name="handlers" xsi:type="array">
+                <item name="default" xsi:type="string">BraintreePayPalConfigValueHandler</item>
+                <item name="can_void" xsi:type="string">Magento\Braintree\Gateway\Config\CanVoidHandler</item>
+                <item name="can_cancel" xsi:type="string">Magento\Braintree\Gateway\Config\CanVoidHandler</item>
+                <item name="can_capture" xsi:type="string">Magento\Braintree\Gateway\Config\CanVoidHandler</item>
+            </argument>
+        </arguments>
+    </virtualType>
+    <virtualType name="BraintreePayPalConfigValueHandler" type="Magento\Payment\Gateway\Config\ConfigValueHandler">
+        <arguments>
+            <argument name="configInterface" xsi:type="object">Magento\Braintree\Gateway\Config\PayPal\Config</argument>
+        </arguments>
+    </virtualType>
+    
+    <!-- Void Command -->
+    <virtualType name="BraintreeVoidCommand" type="Magento\Payment\Gateway\Command\GatewayCommand">
+        <arguments>
+            <argument name="client" xsi:type="object">Magento\Braintree\Gateway\Http\Client\TransactionVoid</argument>
+            <argument name="requestBuilder" xsi:type="object">Magento\Braintree\Gateway\Request\VoidDataBuilder</argument>
+            <argument name="handler" xsi:type="object">Magento\Braintree\Gateway\Response\VoidHandler</argument>
+            <argument name="validator" xsi:type="object">Magento\Braintree\Gateway\Validator\GeneralResponseValidator</argument>
+            <argument name="transferFactory" xsi:type="object">Magento\Braintree\Gateway\Http\TransferFactory</argument>
+        </arguments>
+    </virtualType>
+
+    <!-- Refund Command -->
+    <virtualType name="BraintreeRefundCommand" type="Magento\Payment\Gateway\Command\GatewayCommand">
+        <arguments>
+            <argument name="client" xsi:type="object">Magento\Braintree\Gateway\Http\Client\TransactionRefund</argument>
+            <argument name="requestBuilder" xsi:type="object">Magento\Braintree\Gateway\Request\RefundDataBuilder</argument>
+            <argument name="validator" xsi:type="object">Magento\Braintree\Gateway\Validator\GeneralResponseValidator</argument>
+            <argument name="handler" xsi:type="object">Magento\Braintree\Gateway\Response\RefundHandler</argument>
+            <argument name="transferFactory" xsi:type="object">Magento\Braintree\Gateway\Http\TransferFactory</argument>
+        </arguments>
+    </virtualType>
+
+    <!-- Value validators infrastructure -->
+    <virtualType name="BraintreeCountryValidator" type="Magento\Payment\Gateway\Validator\CountryValidator">
+        <arguments>
+            <argument name="config" xsi:type="object">Magento\Braintree\Gateway\Config\Config</argument>
+        </arguments>
+    </virtualType>
+    <virtualType name="BraintreeValidatorPool" type="Magento\Payment\Gateway\Validator\ValidatorPool">
+        <arguments>
+            <argument name="validators" xsi:type="array">
+                <item name="country" xsi:type="string">BraintreeCountryValidator</item>
+            </argument>
+        </arguments>
+    </virtualType>
+
+    <type name="Magento\Braintree\Block\Info">
+        <arguments>
+            <argument name="config" xsi:type="object">Magento\Braintree\Gateway\Config\Config</argument>
+        </arguments>
+    </type>
+    <virtualType name="BraintreePayPalInfo" type="Magento\Braintree\Block\Info">
+        <arguments>
+            <argument name="config" xsi:type="object">Magento\Braintree\Gateway\Config\PayPal\Config</argument>
+        </arguments>
+    </virtualType>
+
+    <virtualType name="BraintreeTransactionsCollectionFactory" type="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
+        <arguments>
+            <argument name="collections" xsi:type="array">
+                <item name="braintree_report_data_source" xsi:type="string">Magento\Braintree\Model\Report\TransactionsCollection</item>
+            </argument>
+        </arguments>
+    </virtualType>
+
+    <virtualType name="BraintreeTransactionsReporting" type="Magento\Framework\View\Element\UiComponent\DataProvider\Reporting">
+        <arguments>
+            <argument name="collectionFactory" xsi:type="object">BraintreeTransactionsCollectionFactory</argument>
+        </arguments>
+    </virtualType>
+
+    <virtualType name="BraintreeTransactionsDataProvider" type="Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider">
+        <arguments>
+            <argument name="reporting" xsi:type="object">BraintreeTransactionsReporting</argument>
+        </arguments>
+    </virtualType>
+
+    <type name="Magento\Braintree\Model\Report\ConditionAppliers\AppliersPool">
+        <arguments>
+            <argument name="appliers" xsi:type="array">
+                <item name="Braintree\TextNode" xsi:type="object">Magento\Braintree\Model\Report\ConditionAppliers\Text</item>
+                <item name="Braintree\RangeNode" xsi:type="object">Magento\Braintree\Model\Report\ConditionAppliers\Range</item>
+                <item name="Braintree\MultipleValueNode" xsi:type="object">Magento\Braintree\Model\Report\ConditionAppliers\MultipleValue</item>
+            </argument>
+        </arguments>
+    </type>
+
 </config>
diff --git a/app/code/Magento/Braintree/etc/events.xml b/app/code/Magento/Braintree/etc/events.xml
index 835d6b407b01484554470ae8a606dff6cdedb20a..14e865bbf736f5fb999afb57970c3a8f1d095ac8 100644
--- a/app/code/Magento/Braintree/etc/events.xml
+++ b/app/code/Magento/Braintree/etc/events.xml
@@ -5,14 +5,12 @@
  * See COPYING.txt for license details.
  */
 -->
+
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
-    <event name="sales_order_shipment_save_after">
-        <observer name="braintree" instance="Magento\Braintree\Observer\ProcessBraintreePayment" />
+    <event name="payment_method_assign_data_braintree">
+        <observer name="braintree_gateway_data_assign" instance="Magento\Braintree\Observer\DataAssignObserver" />
     </event>
-    <event name="customer_delete_commit_after">
-        <observer name="braintree" instance="Magento\Braintree\Observer\DeleteBraintreeCustomer" />
-    </event>
-    <event name="checkout_submit_before">
-        <observer name="braintree" instance="Magento\Braintree\Observer\ProcessBraintreeAddress" />
+    <event name="payment_method_assign_data_braintree_paypal">
+        <observer name="braintree_paypal_gateway_data_assign" instance="Magento\Braintree\Observer\DataAssignObserver" />
     </event>
 </config>
diff --git a/app/code/Magento/Braintree/etc/frontend/di.xml b/app/code/Magento/Braintree/etc/frontend/di.xml
index 83dc6607ed3160f5719646521ffcb74b8a822c34..b64a54c9751fa4ca4b5816d81a32bc0b5af65ff2 100644
--- a/app/code/Magento/Braintree/etc/frontend/di.xml
+++ b/app/code/Magento/Braintree/etc/frontend/di.xml
@@ -6,26 +6,50 @@
  */
 -->
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
+    <type name="Magento\Checkout\Model\CompositeConfigProvider">
+        <arguments>
+            <argument name="configProviders" xsi:type="array">
+                <item name="braintree_config_provider" xsi:type="object">Magento\Braintree\Model\Ui\ConfigProvider</item>
+            </argument>
+        </arguments>
+    </type>
     <type name="Magento\Payment\Model\CcGenericConfigProvider">
         <arguments>
             <argument name="methodCodes" xsi:type="array">
-                <item name="braintree" xsi:type="const">Magento\Braintree\Model\PaymentMethod::METHOD_CODE</item>
+                <item name="braintree" xsi:type="const">Magento\Braintree\Model\Ui\ConfigProvider::CODE</item>
             </argument>
         </arguments>
     </type>
-    <type name="Magento\Checkout\Model\CompositeConfigProvider">
+    <type name="Magento\Braintree\Block\Info">
         <arguments>
-            <argument name="configProviders" xsi:type="array">
-                <item name="braintree_config_provider" xsi:type="object">Magento\Braintree\Model\ConfigProvider</item>
-                <item name="braintree_paypal_config_provider" xsi:type="object">Magento\Braintree\Model\ConfigProvider\PayPal</item>
+            <argument name="data" xsi:type="array">
+                <item xsi:type="string" name="is_secure_mode">1</item>
             </argument>
         </arguments>
     </type>
-    <type name="Magento\Framework\Url\SecurityInfo">
+
+    <type name="Magento\Vault\Model\Ui\TokensConfigProvider">
+        <arguments>
+            <argument name="tokenUiComponentProviders" xsi:type="array">
+                <item name="braintree" xsi:type="object">Magento\Braintree\Model\Ui\TokenUiComponentProvider</item>
+            </argument>
+        </arguments>
+    </type>
+
+    <type name="Magento\Braintree\Controller\Payment\GetNonce">
+        <arguments>
+            <argument name="session" xsi:type="object">Magento\Customer\Model\Session</argument>
+        </arguments>
+    </type>
+
+    <type name="Magento\Braintree\Block\Paypal\Button">
         <arguments>
-            <argument name="secureUrlList" xsi:type="array">
-                <item name="braintree" xsi:type="string">/braintree/</item>
+            <argument name="data" xsi:type="array">
+                <item name="template" xsi:type="string">Magento_Braintree::paypal/button.phtml</item>
+                <item name="alias" xsi:type="string">braintree.paypal.mini-cart</item>
+                <item name="button_id" xsi:type="string">braintree-paypal-mini-cart</item>
             </argument>
+            <argument name="payment" xsi:type="object">BraintreePayPalFacade</argument>
         </arguments>
     </type>
 </config>
diff --git a/app/code/Magento/Braintree/etc/frontend/events.xml b/app/code/Magento/Braintree/etc/frontend/events.xml
index 6e7b06bf0c86e1a60bd062a3c9168e27ccca15f7..a7b371293c8e59b502f8d9cb54b919bb2aa458e8 100644
--- a/app/code/Magento/Braintree/etc/frontend/events.xml
+++ b/app/code/Magento/Braintree/etc/frontend/events.xml
@@ -7,6 +7,6 @@
 -->
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
     <event name="shortcut_buttons_container">
-        <observer name="braintree_paypal_shortcuts" instance="Magento\Braintree\Observer\AddPaypalShortcuts" />
+        <observer name="braintree_paypal_shortcuts" instance="Magento\Braintree\Observer\AddPaypalShortcuts"/>
     </event>
 </config>
diff --git a/app/code/Magento/Braintree/etc/frontend/routes.xml b/app/code/Magento/Braintree/etc/frontend/routes.xml
index 7177e15a55eca8c226ec883acb91bfb337689574..4380c3db09190a5644d191240c5f090ee32e7ee0 100644
--- a/app/code/Magento/Braintree/etc/frontend/routes.xml
+++ b/app/code/Magento/Braintree/etc/frontend/routes.xml
@@ -11,4 +11,4 @@
             <module name="Magento_Braintree" />
         </route>
     </router>
-</config>
\ No newline at end of file
+</config>
diff --git a/app/code/Magento/Braintree/etc/module.xml b/app/code/Magento/Braintree/etc/module.xml
index edf1cfe4a5f73fc4055652163d6cdfa1395ab025..d49baf04a5435496a3276d084856235a68d510ba 100644
--- a/app/code/Magento/Braintree/etc/module.xml
+++ b/app/code/Magento/Braintree/etc/module.xml
@@ -8,9 +8,15 @@
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
     <module name="Magento_Braintree" setup_version="2.0.0">
         <sequence>
+            <module name="Magento_Customer"/>
+            <module name="Magento_Payment"/>
             <module name="Magento_Checkout"/>
-            <module name="Magento_Sales"/>
+            <module name="Magento_Vault"/>
+            <module name="Magento_Catalog"/>
             <module name="Magento_Quote"/>
+            <module name="Magento_Paypal"/>
+            <module name="Magento_CheckoutAgreements"/>
+            <module name="Magento_Theme"/>
         </sequence>
     </module>
 </config>
diff --git a/app/code/Magento/Braintree/etc/payment.xml b/app/code/Magento/Braintree/etc/payment.xml
deleted file mode 100644
index 0ad37aefce23a4262be4a915207afbc8a763cecf..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/etc/payment.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
--->
-<payment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Payment:etc/payment.xsd">
-    <methods>
-        <method name="braintree">
-            <allow_multiple_address>1</allow_multiple_address>
-        </method>
-    </methods>
-</payment>
-
diff --git a/app/code/Magento/Braintree/i18n/en_US.csv b/app/code/Magento/Braintree/i18n/en_US.csv
index 72919239a5585fbc786b688740cd0c68c3418271..acc96d04ebec0255a1a9c9b4b3c3bf2f21692e18 100644
--- a/app/code/Magento/Braintree/i18n/en_US.csv
+++ b/app/code/Magento/Braintree/i18n/en_US.csv
@@ -1,288 +1,15 @@
-"Country","Country"
-"Allowed Credit Card Types","Allowed Credit Card Types"
-"Add Rule","Add Rule"
-"Edit Credit Card","Edit Credit Card"
-"Add Credit Card","Add Credit Card"
-"Stored Card","Stored Card"
-"Credit Card Type","Credit Card Type"
-"Credit Card Number","Credit Card Number"
-"Selected payment type is not allowed for billing country.","Selected payment type is not allowed for billing country."
-"Credit card type is not allowed for this payment method.","Credit card type is not allowed for this payment method."
-"Credit card type is not allowed for your country.","Credit card type is not allowed for your country."
-"Please try again later","Please try again later"
-"Contact your bank or try another card","Contact your bank or try another card"
-"Check card details or try another card","Check card details or try another card"
-"Try another card","Try another card"
-"Voice Authorization Required","Voice Authorization Required"
-"Duplicate transaction","Duplicate transaction"
-"Try again later","Try again later"
-"Processor decline","Processor decline"
-"Processor network error","Processor network error"
-"Transaction declined by gateway: Check card details or try another card","Transaction declined by gateway: Check card details or try another card"
-"Transaction declined: ","Transaction declined: "
-"There was an error capturing the transaction.","There was an error capturing the transaction."
-"There was an error refunding the transaction.","There was an error refunding the transaction."
-"There was an error voiding the transaction.","There was an error voiding the transaction."
-"This refund is for a partial amount but the Transaction has not settled. ","This refund is for a partial amount but the Transaction has not settled. "
-"Please wait 24 hours before trying to issue a partial refund.","Please wait 24 hours before trying to issue a partial refund."
-"The Transaction has not settled. ","The Transaction has not settled. "
-"Please wait 24 hours before trying to issue a refund or use Void option.","Please wait 24 hours before trying to issue a refund or use Void option."
-"Invalid Customer ID provided","Invalid Customer ID provided"
-"Invalid Credit Card Data provided","Invalid Credit Card Data provided"
-"Invalid Address Data provided","Invalid Address Data provided"
-"Credit card successfully added","Credit card successfully added"
-"Credit card successfully updated","Credit card successfully updated"
-"Credit card successfully deleted","Credit card successfully deleted"
-"There was error during saving card data","There was error during saving card data"
-"My Credit Cards","My Credit Cards"
-"Please Select","Please Select"
-"Credit Cards","Credit Cards"
-"Expiration Date","Expiration Date"
-"Card Verification Number","Card Verification Number"
-"What is this?","What is this?"
-"Delete Credit Card","Delete Credit Card"
-"Please confirm that you want to delete this credit card","Please confirm that you want to delete this credit card"
-"Cardholder Name","Cardholder Name"
-"Delete","Delete"
-"Back","Back"
-"CVV","CVV"
-"Make Default","Make Default"
-"Billing Address","Billing Address"
-"First Name","First Name"
-"Last Name","Last Name"
-"Company","Company"
-"Street Address","Street Address"
-"Extended Address","Extended Address"
-"City","City"
-"State/Province","State/Province"
-"Please select region, state or province","Please select region, state or province"
-"Postal Code","Postal Code"
-"Country","Country"
-"* Required Fields","* Required Fields"
-"Submit","Submit"
-"Type","Type"
-"Is Default","Is Default"
-"Actions","Actions"
-"Yes","Yes"
-"No","No"
-"Edit","Edit"
-"Delete","Delete"
-"Payment Information","Payment Information"
-"Add new card","Add new card"
-"Switch/Solo/Maestro Only","Switch/Solo/Maestro Only"
-"Issue Number","Issue Number"
-"Start Date","Start Date"
-"Save this card for future use","Save this card for future use"
-"Please try again later","Please try again later"
-"Braintree","Braintree"
-"Enabled","Enabled"
-"Payment action","Payment action"
-"Capture action","Capture action"
-"New order status","New order status"
-"Environment","Environment"
-"Title","Title"
-"Merchant ID","Merchant ID"
-"Merchant Account ID","Merchant Account ID"
-"Public Key","Public Key"
-"Private Key","Private Key"
-"Client Side Encryption Key","Client Side Encryption Key"
-"Credit Card Types","Credit Card Types"
-"Use Vault","Use Vault"
-"Allow Duplicate Cards","Allow Duplicate Cards"
-"CVV Verification","CVV Verification"
-"Payment from Applicable Countries","Payment from Applicable Countries"
-"Payment from Specific Countries","Payment from Specific Countries"
-"Country Specific Credit Card Types","Country Specific Credit Card Types"
-"Advanced Fraud Protection","Advanced Fraud Protection"
-"Be sure to Enable Advanced Fraud Protection in Your Braintree Account in Settings/Processing Section","Be sure to Enable Advanced Fraud Protection in Your Braintree Account in Settings/Processing Section"
-"Used for direct fraud tool integration. Make sure you also contact <a href=""mailto:accounts@braintreepayments.com"">accounts@braintreepayments.com</a> to setup your Kount account.","Used for direct fraud tool integration. Make sure you also contact <a href=""mailto:accounts@braintreepayments.com"">accounts@braintreepayments.com</a> to setup your Kount account."
-"<a href=""https://www.braintreegateway.com/login"" target=""_blank"">Click here to login to your existing Braintree account</a>. Or to setup a new account and accept payments on your website, <a href=""https://apply.braintreegateway.com/signup/us"" target=""_blank"">click here to signup for a Braintree account</a>.","<a href=""https://www.braintreegateway.com/login"" target=""_blank"">Click here to login to your existing Braintree account</a>. Or to setup a new account and accept payments on your website, <a href=""https://apply.braintreegateway.com/signup/us"" target=""_blank"">click here to signup for a Braintree account</a>."
-"Enable Credit Card auto-detection on front-end","Enable Credit Card auto-detection on front-end"
-"Typing in a credit card number will automatically select the credit card type","Typing in a credit card number will automatically select the credit card type"
-"Your Kount ID","Your Kount ID"
-"Debug","Debug"
-"Some of results will be cached to improve performance. Magento cache have to be enabled","Some of results will be cached to improve performance. Magento cache have to be enabled"
-"Use Cache","Use Cache"
-"Avs Postal Code Response Code","Avs Postal Code Response Code"
-"Avs Street Address Response Code","Avs Street Address Response Code"
-"Cvv Response Code","Cvv Response Code"
-"Processor Authorization Code","Processor Authorization Code"
-"Processor Response Code","Processor Response Code"
-"Processor Response Text","Processor Response Text"
-"This invoice can be processed only offline","This invoice can be processed only offline"
-"Some transactions are already settled or voided and cannot be voided.","Some transactions are already settled or voided and cannot be voided."
-"Duplicate card exists in the vault.","The credit card already exists in records, please verify that you entered the correct credit card number."
-"Amount cannot be negative.","Amount cannot be negative."
-"Amount is required.","Amount is required."
-"Amount is an invalid format.","Amount is an invalid format."
-"Amount is too large.","Amount is too large."
-"Credit card type is not accepted by this merchant account.","Credit card type is not accepted by this merchant account."
-"Custom field is too long.","Custom field is too long."
-"Order ID is too long.","Order ID is too long."
-"Cannot provide a billing address unless also providing a credit card.","Cannot provide a billing address unless also providing a credit card."
-"Transaction can only be voided if status is authorized or submitted_for_settlement.","Transaction can only be voided if status is authorized or submitted_for_settlement."
-"Cannot refund credit","Cannot refund credit"
-"Cannot refund a transaction unless it is settled.","Cannot refund a transaction unless it is settled."
-"Cannot submit for settlement unless status is authorized.","Cannot submit for settlement unless status is authorized."
-"Need a customer_id, payment_method_token, credit_card, or subscription_id.","Need a customer_id, payment_method_token, credit_card, or subscription_id."
-"Custom field is invalid","Custom field is invalid"
-"Customer ID is invalid.","Customer ID is invalid."
-"Customer does not have any credit cards.","Customer does not have any credit cards."
-"Transaction has already been refunded.","Transaction has already been refunded."
-"Merchant account ID is invalid.","Merchant account ID is invalid."
-"Merchant account is suspended.","Merchant account is suspended."
-"Cannot provide both payment_method_token and credit_card attributes.","Cannot provide both payment_method_token and credit_card attributes."
-"Cannot provide both payment_method_token and customer_id unless the payment_method belongs to the customer.","Cannot provide both payment_method_token and customer_id unless the payment_method belongs to the customer."
-"Cannot provide both payment_method_token and subscription_id unless the payment method belongs to the subscription.","Cannot provide both payment_method_token and subscription_id unless the payment method belongs to the subscription."
-"Payment method token is invalid.","Payment method token is invalid."
-"Processor authorization code cannot be set unless for a voice authorization.","Processor authorization code cannot be set unless for a voice authorization."
-"Refund amount cannot be more than the authorized amount.","Refund amount cannot be more than the authorized amount."
-"Cannot refund transaction with suspended merchant account.","Cannot refund transaction with suspended merchant account."
-"Settlement amount cannot be more than the authorized amount.","Settlement amount cannot be more than the authorized amount."
-"Cannot provide both subscription_id and customer_id unless the subscription belongs to the customer.","Cannot provide both subscription_id and customer_id unless the subscription belongs to the customer."
-"Subscription ID is invalid.","Subscription ID is invalid."
-"Transaction type is invalid.","Transaction type is invalid."
-"Transaction type is required.","Transaction type is required."
-"Vault is disabled.","Vault is disabled."
-"Subscription status must be past due","Subscription status must be past due"
-"Merchant account does not support refunds","Merchant account does not support refunds"
-"Amount must be greater than zero","Amount must be greater than zero"
-"Tax amount cannot be negative.","Tax amount cannot be negative."
-"Tax amount is an invalid format.","Tax amount is an invalid format."
-"Tax amount is too large.","Tax amount is too large."
-"Purchase order number is too long.","Purchase order number is too long."
-"Voice Authorization is not allowed for this card type","Voice Authorization is not allowed for this card type"
-"Transaction cannot be cloned if payment method is stored in Vault","Transaction cannot be cloned if payment method is stored in Vault"
-"Cannot clone voice authorization transactions","Cannot clone voice authorization transactions"
-"Unsuccessful transaction cannot be cloned.","Unsuccessful transaction cannot be cloned."
-"Credits cannot be cloned.","Credits cannot be cloned."
-"Cannot clone transaction without submit_for_settlement flag.","Cannot clone transaction without submit_for_settlement flag."
-"Voice Authorizations are not supported for this processor","Voice Authorizations are not supported for this processor"
-"Credits are not supported by this processor","Credits are not supported by this processor"
-"Purchase order number is invalid","Purchase order number is invalid"
-"Processor authorization code is invalid","Processor authorization code is invalid"
-"Payment method conflict with venmo sdk","Payment method conflict with venmo sdk"
-"Channel is too long","Channel is too long"
-"Settlement amount is less than service fee amount","Settlement amount is less than service fee amount"
-"Service fee is not allowed on credits","Service fee is not allowed on credits"
-"Sub merchant account requires service fee amount","Sub merchant account requires service fee amount"
-"Service fee amount cannot be negative","Service fee amount cannot be negative"
-"Service fee amount format is invalid","Service fee amount format is invalid"
-"Service fee amount is too large","Service fee amount is too large"
-"Service fee amount not allowed on master merchant account","Service fee amount not allowed on master merchant account"
-"Merchant account does not support MOTO","Merchant account does not support MOTO"
-"Cannot refund with pending merchant account","Cannot refund with pending merchant account"
-"Cannot hold in escrow","Cannot hold in escrow"
-"Cannot release from escrow","Cannot release from escrow"
-"Cannot cancel release","Cannot cancel release"
-"Cannot partially refund escrowed transaction","Cannot partially refund escrowed transaction"
-"Cannot provide both a billing address and a billing address ID.","Cannot provide both a billing address and a billing address ID."
-"Billing address ID is invalid.","Billing address ID is invalid."
-"Customer ID is required.","Customer ID is required."
-"Customer ID is invalid.","Customer ID is invalid."
-"Cannot provide expiration_date if you are also providing expiration_month and expiration_year.","Cannot provide expiration_date if you are also providing expiration_month and expiration_year."
-"Token is invalid.","Token is invalid."
-"Credit card token is taken.","Credit card token is taken."
-"Credit card token is too long.","Credit card token is too long."
-"Token is not an allowed token.","Token is not an allowed token."
-"Payment method token is required.","Payment method token is required."
-"Cardholder name is too long.","Cardholder name is too long."
-"Credit card number cannot be updated to an unsupported card type when it is associated to subscriptions.","Credit card number cannot be updated to an unsupported card type when it is associated to subscriptions."
-"CVV is required.","CVV is required."
-"CVV must be 3 or 4 digits.","CVV must be 3 or 4 digits."
-"Expiration date is required.","Expiration date is required."
-"Expiration date is invalid.","Expiration date is invalid."
-"Expiration date year is invalid.","Expiration date year is invalid."
-"Expiration month is invalid.","Expiration month is invalid."
-"Expiration year is invalid.","Expiration year is invalid."
-"Credit card number is required.","Credit card number is required."
-"Credit card number is invalid.","Credit card number is invalid."
-"Credit card number must be 12-19 digits.","Credit card number must be 12-19 digits."
-"Credit card number is not an accepted test number.","Credit card number is not an accepted test number."
-"Update Existing Token is invalid.","Update Existing Token is invalid."
-"Duplicate card exists","Duplicate card exists"
-"Payment method conflict","Payment method conflict"
-"Venmo sdk payment method code card type is not accepted","Venmo sdk payment method code card type is not accepted"
-"Invalid venmo sdk payment method code","Invalid venmo sdk payment method code"
-"Invalid verification merchant account ID","Invalid verification merchant account ID"
-"Verification not supported on this merchant account","Verification not supported on this merchant account"
-"Custom field is invalid.","Custom field is invalid."
-"Customer ID has already been taken.","Customer ID has already been taken."
-"Customer ID is invalid.","Customer ID is invalid."
-"Customer ID is not an allowed ID.","Customer ID is not an allowed ID."
-"Customer ID is too long.","Customer ID is too long."
-"Id is required","Id is required"
-"Company is too long.","Company is too long."
-"Custom field is too long.","Custom field is too long."
-"Email is an invalid format.","Email is an invalid format."
-"Email is too long.","Email is too long."
-"Email is required if sending a receipt.","Email is required if sending a receipt."
-"Fax is too long.","Fax is too long."
-"First name is too long.","First name is too long."
-"Last name is too long.","Last name is too long."
-"Phone is too long.","Phone is too long."
-"Website is too long.","Website is too long."
-"Website is an invalid format.","Website is an invalid format."
-"Address must have at least one field fill in.","Address must have at least one field fill in."
-"Company is too long.","Company is too long."
-"Extended address is too long.","Extended address is too long."
-"First name is too long.","First name is too long."
-"Last name is too long.","Last name is too long."
-"Locality is too long.","Locality is too long."
-"Postal code can only contain letters, numbers, spaces, and hyphens.","Postal code can only contain letters, numbers, spaces, and hyphens."
-"Postal code is required.","Postal code is required."
-"Postal code may contain no more than 9 letter or number characters.","Postal code may contain no more than 9 letter or number characters."
-"Region is too long.","Region is too long."
-"Street address is required.","Street address is required."
-"Street address is too long.","Street address is too long."
-"Country name is not an accepted country.","Country name is not an accepted country."
-"Inconsistent country","Inconsistent country"
-"Country code alpha-3 is not accepted","Country code alpha-3 is not accepted"
-"Country code numeric is not accepted","Country code numeric is not accepted"
-"Country code alpha-2 is not accepted","Country code alpha-2 is not accepted"
-"Too many addresses per customer","Too many addresses per customer"
-"First name is invalid","First name is invalid"
-"Last name is invalid","Last name is invalid"
-"Company is invalid","Company is invalid"
-"Street address is invalid","Street address is invalid"
-"Extended address is invalid","Extended address is invalid"
-"Locality is invalid","Locality is invalid"
-"Region is invalid","Region is invalid"
-"Postal code is invalid","Postal code is invalid"
-"Cannot edit a canceled subscription.","Cannot edit a canceled subscription."
-"ID has already been taken.","ID has already been taken."
-"Price cannot be blank.","Price cannot be blank."
-"Price is an invalid format.","Price is an invalid format."
-"Subscription has already been canceled.","Subscription has already been canceled."
-"ID is invalid.","ID is invalid."
-"Trial duration is an invalid format.","Trial duration is an invalid format."
-"Trial duration is required.","Trial duration is required."
-"Trial duration unit is invalid.","Trial duration unit is invalid."
-"Cannot edit expired subscription","Cannot edit expired subscription"
-"Price is too large","Price is too large"
-"Merchant account ID is invalid.","Merchant account ID is invalid."
-"Payment method token card type is not accepted by this merchant account.","Payment method token card type is not accepted by this merchant account."
-"Payment method token is invalid.","Payment method token is invalid."
-"Plan ID is invalid.","Plan ID is invalid."
-"Payment method token does not belong to the subscription’s customer.","Payment method token does not belong to the subscription’s customer."
-"Number of billing cycles must be numeric","Number of billing cycles must be numeric"
-"Number of billing cycles must be greater than zero","Number of billing cycles must be greater than zero"
-"Inconsistent number of billing cycles","Inconsistent number of billing cycles"
-"Number of billing cycles is too small","Number of billing cycles is too small"
-"Cannot add duplicate addon or discount","Cannot add duplicate addon or discount"
-"Number of billing cycles cannot be blank","Number of billing cycles cannot be blank"
-"Billing day of month must be numeric","Billing day of month must be numeric"
-"Billing day of month is invalid","Billing day of month is invalid"
-"First billing date is invalid","First billing date is invalid"
-"First billing date cannot be in the past","First billing date cannot be in the past"
-"Inconsistent start date","Inconsistent start date"
-"Billing day of month cannot be updated","Billing day of month cannot be updated"
-"First billing date cannot be updated","First billing date cannot be updated"
-"Cannot edit price changing fields on past due subscription","Cannot edit price changing fields on past due subscription"
-"Invalid request format","Invalid request format"
-"Cannot update subscription to a plan with a different billing frequency.","Cannot update subscription to a plan with a different billing frequency."
-"Mismatch currency iso code","Mismatch currency iso code"
-"Enable this Solution","Enable this Solution"
-"Enable PayPal through Braintree","Enable PayPal through Braintree"
-"3D Secure Verification Settings","3D Secure Verification Settings"
-"3D Secure Verification","3D Secure Verification"
+"cc_type","Credit Card Type"
+"cc_number","Credit Card Number"
+"avsPostalCodeResponseCode","AVS Postal Code Response Code"
+"avsStreetAddressResponseCode","AVS Street Address Response Code"
+"cvvResponseCode","CVV Response Code"
+"processorAuthorizationCode","Processor Authorization Code"
+"processorResponseCode","Processor Response Code"
+"processorResponseText","Processor Response Text"
+"braintree", "Braintree"
+"liabilityShifted", "Liability Shifted"
+"liabilityShiftPossible", "Liability Shift Possible"
+"riskDataId", "Risk ID"
+"riskDataDecision", "Risk Decision",
+"paymentId", "Payment Id",
+"payerEmail", "Payer Email",
diff --git a/app/code/Magento/Braintree/registration.php b/app/code/Magento/Braintree/registration.php
index 913c5ea6786a671578696791ec3bb4d9ab6ad3d3..8f28e77c8ce45506dbe6e2b714f40384bfd2f285 100644
--- a/app/code/Magento/Braintree/registration.php
+++ b/app/code/Magento/Braintree/registration.php
@@ -3,7 +3,6 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-
 \Magento\Framework\Component\ComponentRegistrar::register(
     \Magento\Framework\Component\ComponentRegistrar::MODULE,
     'Magento_Braintree',
diff --git a/app/code/Magento/Braintree/view/adminhtml/layout/adminhtml_system_config_edit.xml b/app/code/Magento/Braintree/view/adminhtml/layout/adminhtml_system_config_edit.xml
index 08cbf3988c77f716f649e87322370154416d5165..20377380999fdd992bb8293022fd2320da299de9 100644
--- a/app/code/Magento/Braintree/view/adminhtml/layout/adminhtml_system_config_edit.xml
+++ b/app/code/Magento/Braintree/view/adminhtml/layout/adminhtml_system_config_edit.xml
@@ -9,4 +9,4 @@
     <head>
         <css src="Magento_Braintree::styles.css"/>
     </head>
-</page>
+</page>
\ No newline at end of file
diff --git a/app/code/Magento/BraintreeTwo/view/adminhtml/layout/braintreetwo_report_index.xml b/app/code/Magento/Braintree/view/adminhtml/layout/braintree_report_index.xml
similarity index 85%
rename from app/code/Magento/BraintreeTwo/view/adminhtml/layout/braintreetwo_report_index.xml
rename to app/code/Magento/Braintree/view/adminhtml/layout/braintree_report_index.xml
index d5b1b24d2eb2860a406fc45aaba99885fd7198cf..0a12bceaec0ef2bd444d16db3e7cdd86567e536c 100644
--- a/app/code/Magento/BraintreeTwo/view/adminhtml/layout/braintreetwo_report_index.xml
+++ b/app/code/Magento/Braintree/view/adminhtml/layout/braintree_report_index.xml
@@ -8,14 +8,14 @@
 <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
     <body>
         <referenceContainer name="page.main.actions">
-            <block class="Magento\Backend\Block\Template" name="adminhtml.report.grid.braintreetwo.tooltip" template="Magento_BraintreeTwo::grid/tooltip.phtml">
+            <block class="Magento\Backend\Block\Template" name="adminhtml.report.grid.braintree.tooltip" template="Magento_Braintree::grid/tooltip.phtml">
                 <arguments>
                     <argument name="tooltip_content" xsi:type="string" translate="true">Apply filters in order to get results. Only first 100 records will be displayed in the grid, you will be able to download full version of the report in .csv format.</argument>
                 </arguments>
             </block>
         </referenceContainer>
         <referenceContainer name="content">
-            <uiComponent name="braintreetwo_report"/>
+            <uiComponent name="braintree_report"/>
         </referenceContainer>
     </body>
 </page>
\ No newline at end of file
diff --git a/app/code/Magento/Braintree/view/adminhtml/layout/sales_order_create_index.xml b/app/code/Magento/Braintree/view/adminhtml/layout/sales_order_create_index.xml
index e42d10356bde9a6bf13b078641bdd5a3ed3be78c..3061df52bf7d6abfaa0e81e2fad4a4a347d7e3b5 100644
--- a/app/code/Magento/Braintree/view/adminhtml/layout/sales_order_create_index.xml
+++ b/app/code/Magento/Braintree/view/adminhtml/layout/sales_order_create_index.xml
@@ -7,8 +7,18 @@
 -->
 <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
     <body>
-        <referenceContainer name="footer">
-            <block class="Magento\Braintree\Block\Datajs" name="braintree_data_js" template="data_js.phtml" ifconfig="payment/braintree/fraudprotection"/>
-        </referenceContainer>
+        <referenceBlock name="order_create_billing_form">
+            <action method="setMethodFormTemplate">
+                <argument name="method" xsi:type="string">braintree</argument>
+                <argument name="template" xsi:type="string">Magento_Braintree::form/cc.phtml</argument>
+            </action>
+        </referenceBlock>
+        <referenceBlock name="content">
+            <block name="braintree_payment_script"
+                   as="braintree_payment_script"
+                   after="billing_method"
+                   template="Magento_Braintree::payment/script.phtml"
+                   class="Magento\Braintree\Block\Payment"/>
+        </referenceBlock>
     </body>
 </page>
diff --git a/app/code/Magento/BraintreeTwo/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml b/app/code/Magento/Braintree/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml
similarity index 90%
rename from app/code/Magento/BraintreeTwo/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml
rename to app/code/Magento/Braintree/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml
index 9de9299095b8bfe2d62191136828deab595ddc72..74889612927f0efd7c34bc76321f61d992aed4ea 100644
--- a/app/code/Magento/BraintreeTwo/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml
+++ b/app/code/Magento/Braintree/view/adminhtml/layout/sales_order_create_load_block_billing_method.xml
@@ -9,8 +9,8 @@
     <body>
         <referenceBlock name="order.create.billing.method.form">
             <action method="setMethodFormTemplate">
-                <argument name="method" xsi:type="string">braintreetwo</argument>
-                <argument name="template" xsi:type="string">Magento_BraintreeTwo::form/cc.phtml</argument>
+                <argument name="method" xsi:type="string">braintree</argument>
+                <argument name="template" xsi:type="string">Magento_Braintree::form/cc.phtml</argument>
             </action>
         </referenceBlock>
     </body>
diff --git a/app/code/Magento/Braintree/view/adminhtml/requirejs-config.js b/app/code/Magento/Braintree/view/adminhtml/requirejs-config.js
deleted file mode 100644
index 53ed568d69b9baa287b927b786aedd44093c4cd9..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/view/adminhtml/requirejs-config.js
+++ /dev/null
@@ -1,14 +0,0 @@
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-var config = {
-    map: {
-        '*': {
-            braintree:                  'https://js.braintreegateway.com/v2/braintree.js',
-            braintreeCcForm:            'Magento_Braintree/js/cc-form',
-            braintreeDataJs:            'Magento_Braintree/js/cc-data'
-        }
-    }
-};
diff --git a/app/code/Magento/Braintree/view/adminhtml/templates/data_js.phtml b/app/code/Magento/Braintree/view/adminhtml/templates/data_js.phtml
deleted file mode 100644
index 70634e81b0992114ed262c1781c46dd5c4f1fb07..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/view/adminhtml/templates/data_js.phtml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-/**
- * @var $block \Magento\Braintree\Block\Datajs
- */
-
-$arrayData = [
-    "kountId" => $this->helper('Magento\Braintree\Helper\Data')->getKountId() ?
-        $this->helper('Magento\Braintree\Helper\Data')->getKountId() : false,
-    "formId" =>$block->getFormId(),
-    "merchantId" => $block->getMerchantId(),
-    "braintreeDataJs" => $block->escapeUrl($block->getJsSrc()),
-];
-$serializedFormData = $this->helper('Magento\Framework\Json\Helper\Data')->jsonEncode($arrayData);
-?>
-<script type="text/x-magento-init">
-    {
-        "body": {
-             "braintreeDataJs": <?php /* @noEscape */ echo $serializedFormData ?>
-        }
-    }
-</script>
diff --git a/app/code/Magento/Braintree/view/adminhtml/templates/form.phtml b/app/code/Magento/Braintree/view/adminhtml/templates/form.phtml
deleted file mode 100644
index 508313a25527a942d6c55cea7fd64873528e91a6..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/view/adminhtml/templates/form.phtml
+++ /dev/null
@@ -1,149 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-// @codingStandardsIgnoreFile
-
-/** @var \Magento\Braintree\Block\Form $block */
-$code = $block->escapeHtml($block->getMethodCode());
-$storedCards = $this->helper('\Magento\Braintree\Helper\Createorder')->getLoggedInCustomerCards();
-$useVault = $block->useVault();
-$useCvv = $block->useCvv();
-$clientToken = $block->escapeHtml($block->getClientToken());
-$isFraudDetectionEnabled = $block->isFraudDetectionEnabled();
-$braintreeDataJs = $block->getBraintreeDataJs();
-$formData = [
-    "useVault" => $useVault,
-    "useCvv"  => $useCvv,
-    "clientToken" => $clientToken,
-    "code" => $code,
-    "isFraudDetectionEnabled" => $isFraudDetectionEnabled,
-    "braintreeDataJs"=> $braintreeDataJs,
-];
-$serializedFormData = $this->helper('Magento\Framework\Json\Helper\Data')->jsonEncode($formData);
-$ccType = $block->getInfoData('cc_type');
-$ccExpMonth = $block->getInfoData('cc_exp_month');
-$ccExpYear = $block->getInfoData('cc_exp_year');
-?>
-<input id="<?php /* @noEscape */ echo $code; ?>_payment_method" type="hidden" name="payment[method]"
-       value="<?php /* @noEscape */ echo $code; ?>" />
-<div id="payment_form_<?php /* @noEscape */ echo $code; ?>" class="admin__page-section-item" style="display:none;"
-    data-mage-init='{"braintreeCcForm":<?php /* @noEscape */ echo $serializedFormData; ?>}'
-    >
-    <input type="hidden" name="payment[payment_method_nonce]" id="braintree_nonce" value="" />
-    <input type="hidden" name="payment[cc_last4]" id="cc_last4" value="" />
-    <?php if ($isFraudDetectionEnabled): ?>
-        <input type="hidden" name="payment[device_data]" id="braintree_device_id" value="" />
-    <?php endif; ?>
-    <?php if ($storedCards): ?>
-        <fieldset class="admin__fieldset">
-            <div class="admin__field" id="<?php /* @noEscape */ echo $code; ?>_token_selector">
-                <label class="admin__field-label" for="<?php /* @noEscape */ echo $code; ?>_cc_token">
-                    <?php echo $block->escapeHtml(__('Payment Information')); ?>
-                </label>
-                <div class="admin__field-control control">
-                    <select id="<?php /* @noEscape */ echo $code; ?>_cc_token" name="payment[cc_token]"
-                            class="select admin__control-select">
-                        <?php foreach ($storedCards as $creditCard): ?>
-                            <option value="<?php echo $block->escapeHtml($creditCard->token); ?>"
-                                <?php /* @noEscape */ echo $creditCard->default ? ' selected="selected"' : ''; ?>>
-                                <?php echo $block->escapeHtml($creditCard->maskedNumber); ?> - <?php echo $block->escapeHtml($creditCard->cardType); ?>
-                            </option>
-                        <?php endforeach; ?>
-                        <option value=''><?php echo $block->escapeHtml(__('Add new card')); ?></option>
-                    </select>
-                </div>
-            </div>
-        </fieldset>
-    <?php endif; ?>
-    <fieldset class="admin__fieldset hide_if_token_selected">
-    <div class="admin__field">
-        <label class="label admin__field-label" for="<?php /* @noEscape */ echo $code; ?>_cc_type" >
-            <?php echo $block->escapeHtml(__('Credit Card Type')); ?><span class="required">*</span>
-        </label>
-        <div class="admin__field-control control">
-            <select id="<?php /* @noEscape */ echo $code; ?>_cc_type" name="payment[cc_type]"
-                    class="required-entry _required select admin__control-select validate-cc-type-select">
-                <option value="">--<?php echo $block->escapeHtml(__('Please Select')); ?>--</option>
-            <?php foreach ($block->getCcAvailableTypes() as $typeCode => $typeName): ?>
-                <option value="<?php echo $block->escapeHtml($typeCode); ?>"
-                    <?php if($typeCode == $ccType): ?> selected="selected"<?php endif; ?>>
-                    <?php echo $block->escapeHtml($typeName); ?>
-                </option>
-            <?php endforeach; ?>
-            </select>
-        </div>
-    </div>
-    </fieldset>
-    <fieldset class="admin__fieldset hide_if_token_selected">
-    <div class="admin__field">
-        <label class="label admin__field-label" for="<?php /* @noEscape */ echo $code; ?>_cc_number">
-            <?php echo $block->escapeHtml(__('Credit Card Number')); ?><span class="required">*</span>
-        </label>
-        <div class="admin__field-control control">
-            <input type="text" id="<?php /* @noEscape */ echo $code; ?>_cc_number" data-encrypted-name="payment[cc_number]"
-                   title="<?php echo $block->escapeHtml(__('Credit Card Number')); ?>"
-                   class="input-text admin__control-text validate-cc-number validate-cc-type" value="" />
-        </div>
-    </div>
-    </fieldset>
-    <fieldset class="admin__fieldset hide_if_token_selected">
-    <div id="<?php /* @noEscape */ echo $code; ?>_cc_type_exp_div" class="admin__field">
-        <label class="label admin__field-label" for="<?php /* @noEscape */ echo $code; ?>_expiration">
-            <?php echo $block->escapeHtml(__('Expiration Date')); ?><span class="required">*</span>
-        </label>
-        <div class="admin__field-control control">
-            <select id="<?php /* @noEscape */ echo $code; ?>_expiration" name="payment[cc_exp_month]"
-                    class="month validate-cc-exp required-entry _required select admin__control-select">
-                <?php foreach ($block->getCcMonths() as $k=>$v): ?>
-                    <option value="<?php /* @noEscape */ echo $k ? $block->escapeHtml($k) : ''; ?>"
-                        <?php if ($k == $ccExpMonth): ?> selected="selected"<?php endif; ?>>
-                        <?php echo $block->escapeHtml($v); ?></option>
-                <?php endforeach; ?>
-            </select>
-            <select id="<?php /* @noEscape */ echo $code; ?>_expiration_yr" name="payment[cc_exp_year]"
-                    class="year required-entry _required select admin__control-select">
-            <?php foreach ($block->getCcYears() as $k => $v): ?>
-                <option value="<?php /* @noEscape */ echo $k ? $block->escapeHtml($k) : ''; ?>"
-                    <?php if ($k == $ccExpYear): ?> selected="selected"<?php endif; ?>>
-                    <?php echo $block->escapeHtml($v); ?>
-                </option>
-            <?php endforeach ?>
-            </select>
-        </div>
-    </div>
-    </fieldset>
-    <?php echo $block->getChildHtml(); ?>
-    <?php if ($block->hasVerification()): ?>
-        <fieldset class="admin__fieldset hide_if_token_selected">
-            <div id="<?php /* @noEscape */ echo $code; ?>_cc_type_cvv_div" class="admin__field">
-                <label class="label admin__field-label" for="<?php /* @noEscape */ echo $code; ?>_cc_cid">
-                    <?php echo $block->escapeHtml(__('Card Verification Number')); ?><span class="required">*</span>
-                </label>
-
-                <div class="admin__field-control control">
-                    <div class="v-fix">
-                        <input type="text" title="<?php echo $block->escapeHtml(__('Card Verification Number')); ?>"
-                               class="input-text admin__control-text cvv required-entry validate-cc-cvn"
-                               id="<?php /* @noEscape */ echo $code; ?>_cc_cid" data-encrypted-name="payment[cc_cid]" value=""/>
-                    </div>
-                </div>
-            </div>
-        </fieldset>
-    <?php endif; ?>
-    <?php if($useVault): ?>
-        <fieldset class="admin__fieldset hide_if_token_selected">
-            <div id="<?php /* @noEscape */ echo $code; ?>_store_in_vault_div" style="text-align:left;" class="">
-                <input type="checkbox" title="<?php echo $block->escapeHtml(__('Save this card for future use')); ?>"
-                       class="input-checkbox" id="<?php /* @noEscape */ echo $code; ?>_store_in_vault"
-                       name="payment[store_in_vault]" value="1"/>
-                <label for="<?php /* @noEscape */ echo $code; ?>_store_in_vault" style="float:none;">
-                    <?php echo $block->escapeHtml(__('Save this card for future use')); ?>
-
-                </label>
-            </div>
-        </fieldset>
-    <?php endif; ?>
-</div>
\ No newline at end of file
diff --git a/app/code/Magento/BraintreeTwo/view/adminhtml/templates/form/cc.phtml b/app/code/Magento/Braintree/view/adminhtml/templates/form/cc.phtml
similarity index 98%
rename from app/code/Magento/BraintreeTwo/view/adminhtml/templates/form/cc.phtml
rename to app/code/Magento/Braintree/view/adminhtml/templates/form/cc.phtml
index ec8c31cd39377e8a9e9cdb4b084d17cbd7290b54..33a728c2f137219ad657dccd308ddeb07d087995 100644
--- a/app/code/Magento/BraintreeTwo/view/adminhtml/templates/form/cc.phtml
+++ b/app/code/Magento/Braintree/view/adminhtml/templates/form/cc.phtml
@@ -6,7 +6,7 @@
 
 // @codingStandardsIgnoreFile
 
-/** @var Magento\BraintreeTwo\Block\Form $block */
+/** @var Magento\Braintree\Block\Form $block */
 
 $code = $block->escapeHtml($block->getMethodCode());
 $ccType = $block->getInfoData('cc_type');
diff --git a/app/code/Magento/BraintreeTwo/view/adminhtml/templates/form/vault.phtml b/app/code/Magento/Braintree/view/adminhtml/templates/form/vault.phtml
similarity index 97%
rename from app/code/Magento/BraintreeTwo/view/adminhtml/templates/form/vault.phtml
rename to app/code/Magento/Braintree/view/adminhtml/templates/form/vault.phtml
index 089d38e32c0d07ce61424ce1c52397a05cc9ef04..9514282ff6fa693266a7f92a067c8a5829f796dd 100644
--- a/app/code/Magento/BraintreeTwo/view/adminhtml/templates/form/vault.phtml
+++ b/app/code/Magento/Braintree/view/adminhtml/templates/form/vault.phtml
@@ -12,7 +12,7 @@ $icon = $block->getData('icons')[$details['type']];
 $id = $block->escapeHtml($block->getData('id'));
 ?>
 <div data-mage-init='{
-        "Magento_BraintreeTwo/js/vault": {
+        "Magento_Braintree/js/vault": {
             "container": "payment_<?php /* @noEscape */ echo $id; ?>",
             "publicHash": "<?php echo $block->escapeHtml($block->getData(TokenUiComponentProviderInterface::COMPONENT_PUBLIC_HASH)); ?>",
             "nonceUrl": "<?php echo $block->escapeUrl($block->getData('nonceUrl')); ?>"
diff --git a/app/code/Magento/BraintreeTwo/view/adminhtml/templates/grid/tooltip.phtml b/app/code/Magento/Braintree/view/adminhtml/templates/grid/tooltip.phtml
similarity index 100%
rename from app/code/Magento/BraintreeTwo/view/adminhtml/templates/grid/tooltip.phtml
rename to app/code/Magento/Braintree/view/adminhtml/templates/grid/tooltip.phtml
diff --git a/app/code/Magento/BraintreeTwo/view/adminhtml/templates/payment/script.phtml b/app/code/Magento/Braintree/view/adminhtml/templates/payment/script.phtml
similarity index 85%
rename from app/code/Magento/BraintreeTwo/view/adminhtml/templates/payment/script.phtml
rename to app/code/Magento/Braintree/view/adminhtml/templates/payment/script.phtml
index dc774b051738084ade66d83c6759eb727b16618f..6e05f121cb2573668a39867268eb6538e0444c1e 100644
--- a/app/code/Magento/BraintreeTwo/view/adminhtml/templates/payment/script.phtml
+++ b/app/code/Magento/Braintree/view/adminhtml/templates/payment/script.phtml
@@ -4,7 +4,7 @@
  * See COPYING.txt for license details.
  */
 
-/** @var Magento\BraintreeTwo\Block\Payment $block */
+/** @var Magento\Braintree\Block\Payment $block */
 
 $code = $block->escapeHtml($block->getCode());
 
@@ -13,7 +13,7 @@ $code = $block->escapeHtml($block->getCode());
     //<![CDATA[
     require(
         [
-            'Magento_BraintreeTwo/js/braintree',
+            'Magento_Braintree/js/braintree',
             'jquery',
             'domReady!'
         ], function(Braintree, $) {
diff --git a/app/code/Magento/BraintreeTwo/view/adminhtml/ui_component/braintreetwo_report.xml b/app/code/Magento/Braintree/view/adminhtml/ui_component/braintree_report.xml
similarity index 91%
rename from app/code/Magento/BraintreeTwo/view/adminhtml/ui_component/braintreetwo_report.xml
rename to app/code/Magento/Braintree/view/adminhtml/ui_component/braintree_report.xml
index fdf3852b3d5daf7a3b89958b810cc5811fd93882..d1b661b2c3ecdf0d6bb92ffc03e3a235e090cb5f 100644
--- a/app/code/Magento/BraintreeTwo/view/adminhtml/ui_component/braintreetwo_report.xml
+++ b/app/code/Magento/Braintree/view/adminhtml/ui_component/braintree_report.xml
@@ -8,15 +8,15 @@
 <listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
     <argument name="data" xsi:type="array">
         <item name="js_config" xsi:type="array">
-            <item name="provider" xsi:type="string">braintreetwo_report.braintreetwo_report_data_source</item>
-            <item name="deps" xsi:type="string">braintreetwo_report.braintreetwo_report_data_source</item>
+            <item name="provider" xsi:type="string">braintree_report.braintree_report_data_source</item>
+            <item name="deps" xsi:type="string">braintree_report.braintree_report_data_source</item>
         </item>
-        <item name="spinner" xsi:type="string">braintreetwo_report_columns</item>
+        <item name="spinner" xsi:type="string">braintree_report_columns</item>
     </argument>
-    <dataSource name="braintreetwo_report_data_source">
+    <dataSource name="braintree_report_data_source">
         <argument name="dataProvider" xsi:type="configurableObject">
             <argument name="class" xsi:type="string">BraintreeTransactionsDataProvider</argument>
-            <argument name="name" xsi:type="string">braintreetwo_report_data_source</argument>
+            <argument name="name" xsi:type="string">braintree_report_data_source</argument>
             <argument name="primaryFieldName" xsi:type="string">page_id</argument>
             <argument name="requestFieldName" xsi:type="string">id</argument>
             <argument name="data" xsi:type="array">
@@ -27,7 +27,7 @@
         </argument>
         <argument name="data" xsi:type="array">
             <item name="js_config" xsi:type="array">
-                <item name="component" xsi:type="string">Magento_BraintreeTwo/js/grid/provider</item>
+                <item name="component" xsi:type="string">Magento_Braintree/js/grid/provider</item>
             </item>
         </argument>
     </dataSource>
@@ -52,7 +52,7 @@
             <argument name="data" xsi:type="array">
                 <item name="config" xsi:type="array">
                     <item name="columnsData" xsi:type="array">
-                        <item name="provider" xsi:type="string">braintreetwo_report.braintreetwo_report.braintreetwo_report_columns</item>
+                        <item name="provider" xsi:type="string">braintree_report.braintree_report.braintree_report_columns</item>
                     </item>
                     <item name="component" xsi:type="string">Magento_Ui/js/grid/controls/columns</item>
                     <item name="displayArea" xsi:type="string">dataGridActions</item>
@@ -66,20 +66,20 @@
                     <item name="displayArea" xsi:type="string">dataGridFilters</item>
                     <item name="dataScope" xsi:type="string">filters</item>
                     <item name="storageConfig" xsi:type="array">
-                        <item name="provider" xsi:type="string">braintreetwo_report.braintreetwo_report.listing_top.bookmarks</item>
+                        <item name="provider" xsi:type="string">braintree_report.braintree_report.listing_top.bookmarks</item>
                         <item name="namespace" xsi:type="string">current.filters</item>
                     </item>
                     <item name="childDefaults" xsi:type="array">
-                        <item name="provider" xsi:type="string">braintreetwo_report.braintreetwo_report.listing_top.listing_filters</item>
+                        <item name="provider" xsi:type="string">braintree_report.braintree_report.listing_top.listing_filters</item>
                         <item name="imports" xsi:type="array">
-                            <item name="visible" xsi:type="string">braintreetwo_report.braintreetwo_report.listing_top.bookmarks:current.columns.${ $.index }.visible</item>
+                            <item name="visible" xsi:type="string">braintree_report.braintree_report.listing_top.bookmarks:current.columns.${ $.index }.visible</item>
                         </item>
                     </item>
                 </item>
             </argument>
             <filterSelect name="status">
                 <argument name="optionsProvider" xsi:type="configurableObject">
-                    <argument name="class" xsi:type="string">Magento\BraintreeTwo\Ui\Component\Report\Listing\Column\Status</argument>
+                    <argument name="class" xsi:type="string">Magento\Braintree\Ui\Component\Report\Listing\Column\Status</argument>
                 </argument>
                 <argument name="data" xsi:type="array">
                     <item name="config" xsi:type="array">
@@ -95,7 +95,7 @@
             </filterSelect>
             <filterSelect name="type">
                 <argument name="optionsProvider" xsi:type="configurableObject">
-                    <argument name="class" xsi:type="string">Magento\BraintreeTwo\Ui\Component\Report\Listing\Column\TransactionType</argument>
+                    <argument name="class" xsi:type="string">Magento\Braintree\Ui\Component\Report\Listing\Column\TransactionType</argument>
                 </argument>
                 <argument name="data" xsi:type="array">
                     <item name="config" xsi:type="array">
@@ -112,7 +112,7 @@
             <!--
             <filterSelect name="paymentInstrumentType">
                 <argument name="optionsProvider" xsi:type="configurableObject">
-                    <argument name="class" xsi:type="string">Magento\BraintreeTwo\Ui\Component\Report\Listing\Column\PaymentType</argument>
+                    <argument name="class" xsi:type="string">Magento\Braintree\Ui\Component\Report\Listing\Column\PaymentType</argument>
                 </argument>
                 <argument name="data" xsi:type="array">
                     <item name="config" xsi:type="array">
@@ -137,16 +137,16 @@
             </filterInput>
         </filters>
     </container>
-    <columns name="braintreetwo_report_columns">
+    <columns name="braintree_report_columns">
         <argument name="data" xsi:type="array">
             <item name="config" xsi:type="array">
                 <item name="storageConfig" xsi:type="array">
-                    <item name="provider" xsi:type="string">braintreetwo_report.braintreetwo_report.listing_top.bookmarks</item>
+                    <item name="provider" xsi:type="string">braintree_report.braintree_report.listing_top.bookmarks</item>
                     <item name="namespace" xsi:type="string">current</item>
                 </item>
                 <item name="childDefaults" xsi:type="array">
                     <item name="fieldAction" xsi:type="array">
-                        <item name="provider" xsi:type="string">braintreetwo_report.braintreetwo_report.braintreetwo_report_columns_editor</item>
+                        <item name="provider" xsi:type="string">braintree_report.braintree_report.braintree_report_columns_editor</item>
                         <item name="target" xsi:type="string">startEdit</item>
                         <item name="params" xsi:type="array">
                             <item name="0" xsi:type="string">${ $.$data.rowIndex }</item>
@@ -155,7 +155,7 @@
                     </item>
                     <item name="controlVisibility" xsi:type="boolean">true</item>
                     <item name="storageConfig" xsi:type="array">
-                        <item name="provider" xsi:type="string">braintreetwo_report.braintreetwo_report.listing_top.bookmarks</item>
+                        <item name="provider" xsi:type="string">braintree_report.braintree_report.listing_top.bookmarks</item>
                         <item name="root" xsi:type="string">columns.${ $.index }</item>
                         <item name="namespace" xsi:type="string">current.${ $.storageConfig.root}</item>
                     </item>
diff --git a/app/code/Magento/BraintreeTwo/view/adminhtml/web/js/braintree.js b/app/code/Magento/Braintree/view/adminhtml/web/js/braintree.js
similarity index 97%
rename from app/code/Magento/BraintreeTwo/view/adminhtml/web/js/braintree.js
rename to app/code/Magento/Braintree/view/adminhtml/web/js/braintree.js
index 8ed51a0d13fa769b5edf7bf5647b1b08b0ee6fb8..649c498ce503c34a6715a9e14ca627427c0b7ca0 100644
--- a/app/code/Magento/BraintreeTwo/view/adminhtml/web/js/braintree.js
+++ b/app/code/Magento/Braintree/view/adminhtml/web/js/braintree.js
@@ -10,7 +10,7 @@ define([
     'Magento_Ui/js/modal/alert',
     'Magento_Ui/js/lib/view/utils/dom-observer',
     'mage/translate',
-    'Magento_BraintreeTwo/js/validator'
+    'Magento_Braintree/js/validator'
 ], function ($, Class, alert, domObserver, $t, validator) {
     'use strict';
 
@@ -19,7 +19,7 @@ define([
         defaults: {
             $selector: null,
             selector: 'edit_form',
-            container: 'payment_form_braintreetwo',
+            container: 'payment_form_braintree',
             active: false,
             scriptLoaded: false,
             braintree: null,
@@ -79,7 +79,7 @@ define([
          */
         onActiveChange: function (isActive) {
             if (!isActive) {
-                this.$selector.off('submitOrder.braintreetwo');
+                this.$selector.off('submitOrder.braintree');
 
                 return;
             }
@@ -245,7 +245,7 @@ define([
          * Enable form event listeners
          */
         enableEventListeners: function () {
-            this.$selector.on('submitOrder.braintreetwo', this.submitOrder.bind(this));
+            this.$selector.on('submitOrder.braintree', this.submitOrder.bind(this));
         },
 
         /**
diff --git a/app/code/Magento/Braintree/view/adminhtml/web/js/cc-data.js b/app/code/Magento/Braintree/view/adminhtml/web/js/cc-data.js
deleted file mode 100644
index 484a2c26b88462e8de3aa4559dd0299fe98817b8..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/view/adminhtml/web/js/cc-data.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-/*jshint jquery:true*/
-define([
-    "jquery",
-    "jquery/ui",
-], function ($) {
-    'use strict';
-
-    $.widget('mage.braintreeDataJs', {
-        options: {
-            kountId: false
-        },
-        _create: function () {
-            var self = this;
-            window.onBraintreeDataLoad = function () {
-                var formId = self.options.formId;
-                if (!$('#' + formId)) {
-                    formId = 'onestepcheckout-form';
-                }
-                var env;
-                if (self.options.kountId) {
-                    env = BraintreeData.environments.production.withId(self.options.kountId);
-                } else {
-                    env = BraintreeData.environments.production;
-                }
-
-                BraintreeData.setup(self.options.merchantId, formId, env);
-                if (typeof(payment) !== 'undefined' && typeof(payment.addAfterInitFunction) !== "undefined") {
-                    payment.addBeforeValidateFunction('braintree', function () {
-                        $('#device_data').disabled = false;
-                    });
-                }
-            };
-            $.getScript(self.options.braintreeDataJs);
-        }
-    });
-    return $.mage.braintreeDataJs;
-});
diff --git a/app/code/Magento/Braintree/view/adminhtml/web/js/cc-form.js b/app/code/Magento/Braintree/view/adminhtml/web/js/cc-form.js
deleted file mode 100644
index ec10d20792fff3be27efdf60ad0c1c33855e46a2..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/view/adminhtml/web/js/cc-form.js
+++ /dev/null
@@ -1,130 +0,0 @@
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-/*jshint jquery:true*/
-define([
-    "jquery",
-    "braintree",
-    "jquery/ui"
-], function($, braintree){
-    "use strict";
-
-    $.widget('mage.braintreeCcForm', {
-        options: {
-            submitSelectors: ['.save', '#submit_order_top_button'],
-            clientToken : "",
-            useVault : false,
-            useCvv : false,
-            code : "braintree",
-            isFraudDetectionEnabled : false,
-            braintreeDataJs : null
-        },
-        ccNumber: "",
-        ccExprYr: "",
-        ccExprMo: "",
-        cvv: "",
-        nonce: "",
-        ccToken: "",
-
-        enableDisableFields: function(disabled) {
-            var fields = ["_cc_type", "_cc_number", "_expiration", "_expiration_yr", "_cc_cid"];
-            var id;
-            for (id = 0; id < fields.length; id++) {
-                $('#' + this.options.code + fields[id]).prop('disabled', disabled);
-            }
-        },
-
-        prepare : function(event, method) {
-            if (method === 'braintree') {
-                this.preparePayment();
-            }
-        },
-        preparePayment: function() {
-            $('#edit_form').off('submitOrder').on('submitOrder', this.submitAdminOrder.bind(this));
-        },
-        submitAdminOrder: function() {
-            var ccNumber = $("#braintree_cc_number").val(),
-                ccExprYr = $("#braintree_expiration_yr").val(),
-                ccExprMo = $("#braintree_expiration").val(),
-                self = this;
-            if (self.options.useCvv) {
-                var cvv = $('#braintree_cc_cid').val();
-            }
-
-            if (ccNumber) {
-                this.enableDisableFields(true);
-                var braintreeClient = new braintree.api.Client({clientToken: this.options.clientToken}),
-                    braintreeObj = {
-                        number: ccNumber,
-                        expirationMonth: ccExprMo,
-                        expirationYear: ccExprYr,
-                        };
-                if (self.options.useCvv) {
-                    braintreeObj.cvv = cvv;
-                }
-                braintreeClient.tokenizeCard(
-                    braintreeObj,
-                    function (err, nonce) {
-                        if (!err) {
-                            $('#braintree_nonce').val(nonce);
-                            if (self.options.isFraudDetectionEnabled) {
-                                $('#braintree_device_id').val($('#device_data').val());
-                            }
-                            order._realSubmit();
-                        } else {
-                            //TODO: handle error case
-                        }
-                    }
-                );
-            } else {
-                if (self.options.isFraudDetectionEnabled) {
-                    $('#braintree_device_id').val($('#device_data').val());
-                }
-                order._realSubmit();
-            }
-        },
-        useVault: function() {
-            var selectBox = $('#braintree_cc_token'),
-                initToken = selectBox.val(),
-                self = this;
-
-            if (initToken) {
-                $('.hide_if_token_selected').hide();
-                this.enableDisableFields("disabled");
-                $('#braintree_nonce').val("");
-            }
-
-            $('#braintree_cc_token').bind('change', function (e) {
-                var selectBox = $(this);
-                var token = selectBox.val();
-                if (token) {
-                    $('.hide_if_token_selected').hide();
-                    self.enableDisableFields(true);
-                    $('#braintree_nonce').val("");
-                } else {
-                    $('.hide_if_token_selected').show();
-                    self.enableDisableFields(false);
-                }
-            });
-        },
-
-        _create: function() {
-            $('#edit_form').on('changePaymentMethod', this.prepare.bind(this));
-            $('#edit_form').trigger(
-                'changePaymentMethod',
-                [
-                    $('#edit_form').find(':radio[name="payment[method]"]:checked').val()
-                ]
-            );
-            if (this.options.useVault) {
-                this.useVault();
-            }
-            $('#braintree_cc_number').bind('change', function(){
-                $('#cc_last4').val($("#braintree_cc_number").val().slice(-4));
-            });
-        }
-    });
-
-    return $.mage.braintreeCcForm;
-});
\ No newline at end of file
diff --git a/app/code/Magento/BraintreeTwo/view/adminhtml/web/js/grid/filters/status.html b/app/code/Magento/Braintree/view/adminhtml/web/js/grid/filters/status.html
similarity index 100%
rename from app/code/Magento/BraintreeTwo/view/adminhtml/web/js/grid/filters/status.html
rename to app/code/Magento/Braintree/view/adminhtml/web/js/grid/filters/status.html
diff --git a/app/code/Magento/BraintreeTwo/view/adminhtml/web/js/grid/provider.js b/app/code/Magento/Braintree/view/adminhtml/web/js/grid/provider.js
similarity index 100%
rename from app/code/Magento/BraintreeTwo/view/adminhtml/web/js/grid/provider.js
rename to app/code/Magento/Braintree/view/adminhtml/web/js/grid/provider.js
diff --git a/app/code/Magento/BraintreeTwo/view/adminhtml/web/js/vault.js b/app/code/Magento/Braintree/view/adminhtml/web/js/vault.js
similarity index 91%
rename from app/code/Magento/BraintreeTwo/view/adminhtml/web/js/vault.js
rename to app/code/Magento/Braintree/view/adminhtml/web/js/vault.js
index 8a98abdaac2e8ea7a19ff0f365da0397f28be331..75ad04d4c95c3403e279d2101f86e392d85953de 100644
--- a/app/code/Magento/BraintreeTwo/view/adminhtml/web/js/vault.js
+++ b/app/code/Magento/Braintree/view/adminhtml/web/js/vault.js
@@ -28,7 +28,7 @@ define([
             self.$selector.on(
                 'setVaultNotActive',
                 function () {
-                    self.$selector.off('submitOrder.braintreetwo_vault');
+                    self.$selector.off('submitOrder.braintree_vault');
                 }
             );
             this._super();
@@ -43,7 +43,7 @@ define([
          * @returns {String}
          */
         getCode: function () {
-            return 'braintreetwo';
+            return 'braintree';
         },
 
         /**
@@ -66,7 +66,7 @@ define([
          * Enable form event listeners
          */
         enableEventListeners: function () {
-            this.$selector.on('submitOrder.braintreetwo_vault', this.submitOrder.bind(this));
+            this.$selector.on('submitOrder.braintree_vault', this.submitOrder.bind(this));
         },
 
         /**
@@ -130,7 +130,7 @@ define([
             this.createPublicHashSelector();
 
             this.$selector.find('[name="payment[public_hash]"]').val(this.publicHash);
-            this.$selector.find('#braintreetwo_nonce').val(nonce);
+            this.$selector.find('#braintree_nonce').val(nonce);
         },
 
         /**
@@ -139,11 +139,11 @@ define([
         createPublicHashSelector: function () {
             var $input;
 
-            if (this.$selector.find('#braintreetwo_nonce').size() === 0) {
+            if (this.$selector.find('#braintree_nonce').size() === 0) {
                 $input = $('<input>').attr(
                     {
                         type: 'hidden',
-                        id: 'braintreetwo_nonce',
+                        id: 'braintree_nonce',
                         name: 'payment[payment_method_nonce]'
                     }
                 );
diff --git a/app/code/Magento/BraintreeTwo/view/base/web/js/validator.js b/app/code/Magento/Braintree/view/base/web/js/validator.js
similarity index 100%
rename from app/code/Magento/BraintreeTwo/view/base/web/js/validator.js
rename to app/code/Magento/Braintree/view/base/web/js/validator.js
diff --git a/app/code/Magento/Braintree/view/frontend/layout/braintree_creditcard_delete.xml b/app/code/Magento/Braintree/view/frontend/layout/braintree_creditcard_delete.xml
deleted file mode 100644
index bdff568967a353fd94e648906f4f8d345229ee58..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/view/frontend/layout/braintree_creditcard_delete.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
--->
-<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
-    <update handle="customer_account"/>
-    <body>
-        <referenceContainer name="content">
-            <block class="Magento\Braintree\Block\Creditcard\Management" name="customer_creditcard_management" template="creditcard/delete.phtml" cacheable="false"/>
-        </referenceContainer>
-        <referenceContainer name="footer">
-            <block class="Magento\Braintree\Block\Datajs" name="braintree_data_js" template="data_js.phtml" ifconfig="payment/braintree/fraudprotection"/>
-        </referenceContainer>
-        <referenceBlock name="customer_creditcard_management">
-            <action method="setType">
-                <argument name="type" xsi:type="string">delete</argument>
-            </action>
-        </referenceBlock>
-    </body>
-</page>
diff --git a/app/code/Magento/Braintree/view/frontend/layout/braintree_creditcard_edit.xml b/app/code/Magento/Braintree/view/frontend/layout/braintree_creditcard_edit.xml
deleted file mode 100644
index 1b15add780fb94e7d544e1b8c28644233cd12a0e..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/view/frontend/layout/braintree_creditcard_edit.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
--->
-<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
-    <update handle="customer_account"/>
-    <body>
-        <referenceContainer name="content">
-            <block class="Magento\Braintree\Block\Creditcard\Management" name="customer_creditcard_management" template="creditcard/edit.phtml" cacheable="false">
-                <block class="Magento\Braintree\Block\Directory\Data" name="customer_creditcard_management_country"/>
-            </block>
-        </referenceContainer>
-        <referenceContainer name="footer">
-            <block class="Magento\Braintree\Block\Datajs" name="braintree_data_js" template="data_js.phtml" ifconfig="payment/braintree/fraudprotection"/>
-        </referenceContainer>
-        <referenceBlock name="customer_creditcard_management">
-            <action method="setType">
-                <argument name="type" xsi:type="string">edit</argument>
-            </action>
-        </referenceBlock>
-    </body>
-</page>
diff --git a/app/code/Magento/Braintree/view/frontend/layout/braintree_creditcard_index.xml b/app/code/Magento/Braintree/view/frontend/layout/braintree_creditcard_index.xml
deleted file mode 100644
index e4b3010ca3fa6ddb3defa3d856d48244d967ae33..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/view/frontend/layout/braintree_creditcard_index.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
--->
-<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
-    <update handle="customer_account"/>
-    <body>
-        <referenceContainer name="content">
-            <block class="Magento\Braintree\Block\Creditcard\Management" name="customer_creditcard_management" template="creditcard/index.phtml" cacheable="false"/>
-        </referenceContainer>
-        <referenceBlock name="root">
-            <action method="setHeaderTitle">
-                <argument translate="true" name="title" xsi:type="string">My Credit Cards</argument>
-            </action>
-        </referenceBlock>
-    </body>
-</page>
diff --git a/app/code/Magento/Braintree/view/frontend/layout/braintree_creditcard_newcard.xml b/app/code/Magento/Braintree/view/frontend/layout/braintree_creditcard_newcard.xml
deleted file mode 100644
index 704f8562f8b3bd330011b8aef2f7e4b016a3546c..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/view/frontend/layout/braintree_creditcard_newcard.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
--->
-<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
-    <update handle="customer_account"/>
-    <body>
-        <referenceContainer name="content">
-            <block class="Magento\Braintree\Block\Creditcard\Management" name="customer_creditcard_management" template="creditcard/edit.phtml" cacheable="false">
-                <block class="Magento\Braintree\Block\Directory\Data" name="customer_creditcard_management_country" cacheable="false"/>
-            </block>
-        </referenceContainer>
-        <referenceContainer name="footer">
-            <block class="Magento\Braintree\Block\Datajs" name="braintree_data_js" template="data_js.phtml" ifconfig="payment/braintree/fraudprotection"/>
-        </referenceContainer>
-        <referenceBlock name="root">
-            <action method="setHeaderTitle">
-                <argument translate="true" name="title" xsi:type="string">Edit My Credit Cards</argument>
-            </action>
-        </referenceBlock>
-    </body>
-</page>
diff --git a/app/code/Magento/Braintree/view/frontend/layout/braintree_paypal_review.xml b/app/code/Magento/Braintree/view/frontend/layout/braintree_paypal_review.xml
index 126f80a2e25e82ba2d4c82638fb13d035844481d..7a406813c9f250e46d825c7fc87f3c4e1bb6aaf3 100644
--- a/app/code/Magento/Braintree/view/frontend/layout/braintree_paypal_review.xml
+++ b/app/code/Magento/Braintree/view/frontend/layout/braintree_paypal_review.xml
@@ -19,12 +19,14 @@
             <block class="Magento\Paypal\Block\Cart\ValidationMessages" name="paypal.cart.validationmessages"/>
         </referenceContainer>
         <referenceContainer name="content">
-            <block class="Magento\Braintree\Block\Checkout\Review" name="braintree.paypal.review" template="Magento_Paypal::express/review.phtml">
+            <block class="Magento\Braintree\Block\Paypal\Checkout\Review" name="braintree.paypal.review" template="Magento_Paypal::express/review.phtml">
                 <block class="Magento\Paypal\Block\Express\Review" name="express.review.shipping.method" as="shipping_method" template="express/review/shipping/method.phtml"/>
-                <block class="Magento\Framework\View\Element\Text\ListText" name="paypal.additional.actions"/>
+                <block class="Magento\Framework\View\Element\Text\ListText" name="paypal.additional.actions">
+                    <block class="Magento\Checkout\Block\Cart\Coupon" name="paypal.cart.coupon" as="coupon" template="Magento_Checkout::cart/coupon.phtml"/>
+                </block>
                 <block class="Magento\Paypal\Block\Express\Review\Details" name="paypal.express.review.details" as="details" template="express/review/details.phtml">
                     <block class="Magento\Framework\View\Element\RendererList" name="checkout.onepage.review.item.renderers" as="renderer.list"/>
-                    <block class="Magento\Checkout\Block\Cart\Totals" name="paypal.express.review.details.totals" as="totals" template="checkout/onepage/review/totals.phtml"/>
+                    <block class="Magento\Checkout\Block\Cart\Totals" name="paypal.express.review.details.totals" as="totals" template="Magento_Paypal::checkout/onepage/review/totals.phtml"/>
                 </block>
                 <block class="Magento\CheckoutAgreements\Block\Agreements" name="paypal.express.review.details.agreements" as="agreements" template="Magento_CheckoutAgreements::additional_agreements.phtml"/>
             </block>
diff --git a/app/code/Magento/Braintree/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/Braintree/view/frontend/layout/checkout_index_index.xml
index d855f38eb52c1f82f400fbc65158a92225871e13..80da18abb528c84e3a825c9be81efcfa13757c60 100644
--- a/app/code/Magento/Braintree/view/frontend/layout/checkout_index_index.xml
+++ b/app/code/Magento/Braintree/view/frontend/layout/checkout_index_index.xml
@@ -7,6 +7,9 @@
 -->
 <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
     <body>
+        <referenceContainer name="after.body.start">
+            <referenceBlock remove="true" name="braintree.paypal.component"/>
+        </referenceContainer>
         <referenceBlock name="checkout.root">
             <arguments>
                 <argument name="jsLayout" xsi:type="array">
@@ -23,8 +26,8 @@
                                                         <item name="renders" xsi:type="array">
                                                             <!-- merge payment method renders here -->
                                                             <item name="children" xsi:type="array">
-                                                                <item name="braintree-payments" xsi:type="array">
-                                                                    <item name="component" xsi:type="string">Magento_Braintree/js/view/payment/braintree-methods</item>
+                                                                <item name="braintree" xsi:type="array">
+                                                                    <item name="component" xsi:type="string">Magento_Braintree/js/view/payment/braintree</item>
                                                                     <item name="methods" xsi:type="array">
                                                                         <item name="braintree" xsi:type="array">
                                                                             <item name="isBillingAddressRequired" xsi:type="boolean">true</item>
@@ -48,8 +51,5 @@
                 </argument>
             </arguments>
         </referenceBlock>
-        <referenceBlock name="content">
-            <block class="Magento\Braintree\Block\Datajs" name="braintree_data_js2" template="data_js.phtml"/>
-        </referenceBlock>
     </body>
-</page>
+</page>
\ No newline at end of file
diff --git a/app/code/Magento/Braintree/view/frontend/layout/customer_account.xml b/app/code/Magento/Braintree/view/frontend/layout/customer_account.xml
deleted file mode 100644
index 70411f8f47f39660c2414a775bc2195c86b69a27..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/view/frontend/layout/customer_account.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
--->
-<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
-    <body>
-        <referenceBlock name="customer_account_navigation">
-            <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-my-credit-cards" ifconfig="payment/braintree/use_vault">
-                <arguments>
-                    <argument name="path" xsi:type="string">braintree/creditcard/index</argument>
-                    <argument name="label" xsi:type="string">My Credit Cards</argument>
-                </arguments>
-            </block>
-        </referenceBlock>
-    </body>
-</page>
diff --git a/app/code/Magento/BraintreeTwo/view/frontend/layout/vault_cards_listaction.xml b/app/code/Magento/Braintree/view/frontend/layout/vault_cards_listaction.xml
similarity index 73%
rename from app/code/Magento/BraintreeTwo/view/frontend/layout/vault_cards_listaction.xml
rename to app/code/Magento/Braintree/view/frontend/layout/vault_cards_listaction.xml
index 2f6328d705c85d9585a96ad0768c840b89b351f7..94a63280f319ba0898f7835ad70ce9d700467ec0 100644
--- a/app/code/Magento/BraintreeTwo/view/frontend/layout/vault_cards_listaction.xml
+++ b/app/code/Magento/Braintree/view/frontend/layout/vault_cards_listaction.xml
@@ -9,7 +9,7 @@
     <body>
         <referenceContainer name="content">
             <referenceBlock name="vault.cards.list">
-                <block class="Magento\BraintreeTwo\Block\Customer\CardRenderer" name="braintree.card.renderer" template="Magento_Vault::customer_account/credit_card.phtml"/>
+                <block class="Magento\Braintree\Block\Customer\CardRenderer" name="braintree.card.renderer" template="Magento_Vault::customer_account/credit_card.phtml"/>
             </referenceBlock>
         </referenceContainer>
     </body>
diff --git a/app/code/Magento/Braintree/view/frontend/requirejs-config.js b/app/code/Magento/Braintree/view/frontend/requirejs-config.js
index 183ebf5933cc5d32348a6e428551f9c90d959ba7..99e8e044d9aa12ede358df7e2b712497ca8f021d 100644
--- a/app/code/Magento/Braintree/view/frontend/requirejs-config.js
+++ b/app/code/Magento/Braintree/view/frontend/requirejs-config.js
@@ -6,12 +6,7 @@
 var config = {
     map: {
         '*': {
-            braintree:                  'https://js.braintreegateway.com/v2/braintree.js',
-            braintreeDataJs:            'Magento_Braintree/js/cc-data',
-            braintreeForm:              'Magento_Braintree/js/cc-form',
-            braintreeEditForm:          'Magento_Braintree/js/cc-edit-form',
-            braintreePayPalMinicart:    'Magento_Braintree/js/button/braintree-paypal-minicart',
-            transparent:                'Magento_Payment/transparent'
+            braintree: 'https://js.braintreegateway.com/js/braintree-2.17.6.min.js'
         }
     }
 };
diff --git a/app/code/Magento/Braintree/view/frontend/templates/PayPal/shortcut.phtml b/app/code/Magento/Braintree/view/frontend/templates/PayPal/shortcut.phtml
deleted file mode 100644
index 79c424fc5ce16158cd1b3aaf83fc8f310f008f1a..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/view/frontend/templates/PayPal/shortcut.phtml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-/** @var \Magento\Braintree\Block\PayPal\Shortcut $block */
-
-$containerId = $block->getContainerId();
-$formId = $block->getSubmitFormId();
-$paymentId = $block->getPaymentMethodNonceId();
-$detailsId = $block->getPaymentDetailsId();
-$isMiniCart = (bool)(int)$block->isInMiniCart();
-
-$widgetName = 'braintreePayPalMinicart';
-
-$config = [
-    $widgetName => [
-        'url' => $block->getButtonDataUrl(),
-        'isMiniCart' => $isMiniCart,
-        'formAction' => $block->escapeUrl($block->getReviewPageUrl()),
-        'clientToken' => $block->escapeHtml($block->getClientToken()),
-        'containerId' => ('#' . $containerId),
-        'formId' => ('#' . $formId),
-        'paymentId' => ('#' . $paymentId),
-        'detailsId' => ('#' . $detailsId),
-        'options' => [
-            'amount' => $block->getAmount(),
-            'currency' => $block->getCurrency(),
-            'container' => $containerId,
-            'singleUse' => true,
-            'enableShippingAddress' => true,
-            'enableBillingAddress' => $block->enableBillingAddress(),
-            'locale' => $block->getLocale(),
-            'merchantName' => $block->escapeHtml($block->getMerchantName()),
-        ],
-    ]
-];
-
-?>
-<div data-label="<?php echo $block->escapeHtml(__('or')); ?>"
-     class="paypal checkout <?php echo $block->escapeHtml($block->getShowOrPosition()) ?> paypal-logo"
-    >
-    <fieldset class="fieldset paypal items">
-        <div id="<?php echo $block->escapeHtml($containerId); ?>"
-             data-mage-init='<?php /* @noEscape */ echo json_encode($config); ?>'></div>
-    </fieldset>
-</div>
diff --git a/app/code/Magento/Braintree/view/frontend/templates/creditcard/delete.phtml b/app/code/Magento/Braintree/view/frontend/templates/creditcard/delete.phtml
deleted file mode 100644
index cba8e56e5aa3366172f42663999757bfce6b5448..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/view/frontend/templates/creditcard/delete.phtml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-// @codingStandardsIgnoreFile
-
-/**
- * @var \Magento\Braintree\Block\Creditcard\Management $block
- */
-$creditCard = $block->creditCard();
-$token = $block->escapeHtml($creditCard->token);
-?>
-<?php echo $block->getLayout()->getMessagesBlock()->getGroupedHtml();?>
-<form action="<?php echo $block->escapeUrl($block->getDeleteConfirmUrl()); ?>" method="post" id="delete-form"
-      xmlns="http://www.w3.org/1999/html">
-    <fieldset class="fieldset info">
-        <legend class="legend">
-            <?php echo $block->escapeHtml(__('Please confirm that you want to delete this credit card')); ?>
-        </legend>
-        <div class="field">
-            <ul>
-                <li>
-                    <b><?php echo $block->escapeHtml(__('Credit Card Number'));?></b>
-                </li>
-                <li>
-                    <?php echo $block->escapeHtml($creditCard->maskedNumber);?>
-                </li>
-                <li>
-                    <b><?php echo $block->escapeHtml(__('Expiration Date'));?></b>
-                </li>
-                <li>
-                    <?php echo $block->escapeHtml($creditCard->expirationDate); ?>
-                </li>
-                <li>
-                    <b><?php echo $block->escapeHtml(__('Cardholder Name'));?></b>
-                </li>
-                <li>
-                    <?php echo $block->escapeHtml($creditCard->cardholderName);?>
-                </li>
-            </ul>
-        </div>
-    </fieldset>
-    <input type="hidden" name="token" value="<?php /* @noEscape */ echo $token; ?>">
-    <div class="actions-toolbar">
-        <div class="primary">
-            <button type="submit" id="opc-submit" data-role="opc-submit" class="action save primary"
-                    title="<?php echo $block->escapeHtml(__('Delete')); ?>" >
-                <?php echo $block->escapeHtml(__('Delete')); ?>
-            </button>
-        </div>
-        <div class="secondary">
-            <a class="action back" href="<?php echo $block->escapeUrl($block->getBackUrl()); ?>">
-                <span><small>&laquo; </small><?php echo $block->escapeHtml(__('Back')); ?></span>
-            </a>
-        </div>
-    </div>
-
-</form>
diff --git a/app/code/Magento/Braintree/view/frontend/templates/creditcard/edit.phtml b/app/code/Magento/Braintree/view/frontend/templates/creditcard/edit.phtml
deleted file mode 100644
index 7c49fa2eecbd8f9859e66af635d3369ad6bb8a21..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/view/frontend/templates/creditcard/edit.phtml
+++ /dev/null
@@ -1,370 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-// @codingStandardsIgnoreFile
-
-/** @var $block \Magento\Braintree\Block\Creditcard\Management */
-
-echo $block->getLayout()->getMessagesBlock()->getGroupedHtml();
-$defaultExpMonth = '';
-$defaultExpYear = '';
-$countrySpecificCardTypeConfig = $block->getCountrySpecificCardTypeConfig();
-$applicableCardTypeConfig = $block->getCcApplicableTypes();
-if ($block->isEditMode()) {
-    $creditCard = $block->creditCard();
-    $billingAddress = $creditCard->billingAddress;
-    $maskedNumber = $creditCard->maskedNumber;
-    $isCCDefault = $creditCard->isDefault() ? true : false;
-    $defaultCardholder = $creditCard->cardholderName;
-    $defaultExpDate = $creditCard->expirationDate;
-    $defaultCcType = $creditCard->cardType;
-    if ($defaultExpDate) {
-        list($defaultExpMonth, $defaultExpYear) = explode('/', $defaultExpDate);
-    }
-    $defaultFirstName = $billingAddress->firstName;
-    $defaultLastName = $billingAddress->lastName;
-    $defaultCompany = $billingAddress->company;
-    $defaultStreetAddress = $billingAddress->streetAddress;
-    $defaultExtendedAddress = $billingAddress->extendedAddress;
-    $defaultLocality = $billingAddress->locality;
-    $defaultRegion = $billingAddress->region;
-    $defaultPostalCode = $billingAddress->postalCode;
-    $defaultCountryCodeAlpha2 = $billingAddress->countryCodeAlpha2;
-    if ($defaultRegion) {
-        $defaultRegionId = $block->getRegionIdByName($defaultRegion, $defaultCountryCodeAlpha2);
-    } else {
-        $defaultRegionId = '';
-    }
-} else {
-    $isCCDefault = false;
-    $defaultCcType = '';
-    $defaultCardholder = $block->currentCustomerName().' '.$block->currentCustomerLastName();
-    $defaultFirstName = $block->currentCustomerName();
-    $defaultLastName = $block->currentCustomerLastName();
-    $defaultCompany = '';
-    $defaultStreetAddress = '';
-    $defaultExtendedAddress = '';
-    $defaultLocality = '';
-    $defaultRegion = '';
-    $defaultRegionId = '';
-    $defaultPostalCode = '';
-    $defaultCountryCodeAlpha2 = '';
-}
-$streetValidationClass = $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('street');
-$default = $defaultCountryCodeAlpha2;
-
-$clientToken = $block->getClientToken();
-$formData = [
-    "clientToken" => $clientToken,
-    'ajaxSaveUrl' => $block->escapeUrl($block->getAjaxSaveUrl()),
-    'isEditMode' => $block->isEditMode() ? true : false,
-    'cardToken' => $block->isEditMode() ? $block->escapeHtml($creditCard->token) : '',
-    'backUrl' => $block->escapeUrl($block->getBackUrl()),
-    'hasVerification' => $block->hasVerification(),
-    "countrySpecificCardTypes" => $countrySpecificCardTypeConfig,
-    "applicableCardTypes" => $applicableCardTypeConfig,
-    "cardTypes" => $block->getCcAvailableTypes(),
-    "isFraudDetectionEnabled" => $block->isFraudDetectionEnabled()
-];
-$serializedFormData = $this->helper('Magento\Framework\Json\Helper\Data')->jsonEncode($formData);
-?>
-<form
-    class="form form-edit-credit-card"  action="<?php echo $block->escapeUrl($block->getFormAction()); ?>"
-    method="post" id="form-validate" data-mage-init='{"validation":{}}'>
-    <?php echo $block->getBlockHtml('formkey'); ?>
-    <fieldset class="fieldset info" data-hasrequired="<?php echo $block->escapeHtml(__('* Required Fields')); ?>">
-        <legend class="legend">
-            <span><?php echo $block->escapeHtml(__('Credit Card')); ?></span>
-        </legend>
-        <br>
-
-        <div class="field name required">
-            <label for="credit_card_cardholder_name" class="label">
-                <span><?php echo $block->escapeHtml(__('Cardholder Name')); ?></span>
-            </label>
-
-            <div class="control">
-                <input
-                    type="text"
-                    class="input-text required-entry"
-                    id="credit_card_cardholder_name"
-                    value="<?php echo $block->escapeHtml($defaultCardholder); ?>"
-                    data-validate="{required:true}">
-            </div>
-        </div>
-        <div class="field required type">
-            <label for="credit_card_type" class="label">
-                <span><?php echo $block->escapeHtml(__('Credit Card Type')); ?></span>
-            </label>
-
-            <div class="control">
-                <select name="credit_card_type" id="credit_card_type" data-container="credit_card_type"
-                        data-validate='{required:true, "validate-cc-type-select":"#credit_card_number"}'>
-                    <option value=""><?php echo $block->escapeHtml(__('--Please Select--')); ?></option>
-                    <?php foreach ($block->getCcAvailableTypes() as $typeCode => $typeName): ?>
-                        <option value="<?php echo $block->escapeHtml($typeCode); ?>"
-                            <?php if (stripos($typeName, $defaultCcType) !== false): ?> selected="selected"<?php endif; ?>>
-                            <?php echo $block->escapeHtml($typeName); ?>
-                        </option>
-                    <?php endforeach;
-                    ?>
-                </select>
-            </div>
-        </div>
-        <div class="field name required">
-            <label for="credit_card_number" class="label">
-                <span><?php echo $block->escapeHtml(__('Credit Card Number')); ?></span>
-            </label>
-
-            <div class="control">
-                <input name="credit_card_number"
-                       data-container="credit_card_number"
-                       type="text"
-                       class="input-text required-entry validate-cc-number"
-                       id="credit_card_number"
-                       autocomplete="off"
-                    <?php if ($block->isEditMode()): ?> placeholder="<?php echo $block->escapeHtml($maskedNumber); ?>"<?php endif; ?>
-                       data-validate="{'required-number':true, 'validate-cc-number':'#credit_card_number', 'validate-cc-type':'#credit_card_type'}">
-            </div>
-        </div>
-        <div class="field sp-methods required">
-            <label for="credit_card_expiration_date" class="label">
-                <span><?php echo $block->escapeHtml(__('Expiration Date')); ?></span>
-            </label>
-
-            <div class="control">
-
-                <div class="fields group group-2">
-                    <div class="field no-label month">
-                        <div class="control">
-                            <select
-                                name="credit_card_expiration"
-                                id="credit_card_expiration"
-                                class="month validate-cc-exp required-entry"
-                                data-validate="{'required-number':true, 'validate-cc-exp':'#credit_card_expiration_yr'}">
-                                <?php foreach ($block->getCcMonths() as $k => $v): ?>
-                                    <option value="<?php /* @noEscape */ echo $k ? $block->escapeHtml($k) : '' ?>"
-                                        <?php if ($k == $defaultExpMonth): ?> selected="selected"<?php endif; ?>>
-                                        <?php echo $block->escapeHtml($v); ?>
-                                    </option>
-                                <?php endforeach; ?>
-                            </select>
-                        </div>
-                    </div>
-
-
-                    <div class="field no-label year">
-                        <div class="control">
-                            <select
-                                name="credit_card_expiration_yr"
-                                id="credit_card_expiration_yr"
-                                class="year required-entry"
-                                data-validate="{required:true}">
-                                <?php foreach ($block->getCcYears() as $k => $v): ?>
-                                    <option value="<?php /* @noEscape */ echo $k ? $block->escapeHtml($k) : ''; ?>"
-                                        <?php if ($k == $defaultExpYear): ?> selected="selected"<?php endif; ?>>
-                                        <?php echo $block->escapeHtml($v); ?>
-                                    </option>
-                                <?php endforeach; ?>
-                            </select>
-                        </div>
-                    </div>
-                </div>
-
-            </div>
-        </div>
-        <?php if ($block->hasVerification()): ?>
-        <div class="field sp-methods required">
-            <label for="credit_card_cvv" class="label">
-                <span><?php echo $block->escapeHtml(__('CVV')); ?></span>
-            </label>
-
-            <div class="control">
-                <input
-                    type="text"
-                    title="<?php echo $block->escapeHtml(__('Card Verification Number')); ?>"
-                    class="input-text cvv required-entry validate-cc-cvn validate-cc-cvn-autodetect"
-                    name="credit_card_cvv"
-                    data-container="credit_card_cvv"
-                    id="credit_card_cvv"
-                    value=""
-                    autocomplete="off"
-                    data-validate="{'required-number':true, 'validate-cc-cvn':'#credit_card_type'}">
-                <?php $content = '<img src=\"' . $block->escapeUrl($block->getViewFileUrl('Magento_Checkout::cvv.png')) .
-                    '\" alt=\"' . $block->escapeHtml(__('Card Verification Number Visual Reference')) . '\" title=\"' .
-                    $block->escapeHtml(__('Card Verification Number Visual Reference')) . '\" />'; ?>
-                <div class="note">
-                    <a href="#" id="credit_card-cvv-what-is-this" class="action cvv"
-                       title="<?php echo $block->escapeHtml(__('What is this?')); ?>"
-                       data-mage-init='{"tooltip": {"content": "<?php /* @noEscape */ echo $content; ?>"}}'>
-                        <span><?php echo $block->escapeHtml(__('What is this?')); ?></span>
-                    </a>
-                </div>
-            </div>
-        </div>
-        <?php endif; ?>
-
-        <div class="field">
-            <label class="label">
-                <span></span>
-            </label>
-
-            <div class="control">
-                <input type="checkbox" name="credit_card[options][make_default]" id="credit_card_options_make_default"
-                       value="1" <?php /* @noEscape */ echo $isCCDefault ? "checked" : "" ?>>
-                <label for="credit_card_options_make_default" class="label">
-                    <span><?php echo $block->escapeHtml(__('Make Default')); ?></span>
-                </label>
-            </div>
-        </div>
-    </fieldset>
-    <fieldset class="fieldset info">
-        <legend class="legend">
-            <span><?php echo $block->escapeHtml(__('Billing Address')); ?></span>
-        </legend>
-        <div class="field name billing_address_first_name required">
-            <label for="billing_address_first_name" class="label">
-                <span><?php echo $block->escapeHtml(__('First Name')); ?></span>
-            </label>
-
-            <div class="control">
-                <input type="text" class="input-text required-entry " name="credit_card[billing_address][first_name]"
-                       id="billing_address_first_name"
-                       value="<?php echo $block->escapeHtml($defaultFirstName); ?>"
-                       data-validate="{required:true}">
-            </div>
-        </div>
-        <div class="field name billing_address_last_name required">
-            <label for="billing_address_last_name" class="label">
-                <span><?php echo $block->escapeHtml(__('Last Name')); ?></span>
-            </label>
-
-            <div class="control">
-                <input type="text" class="input-text required-entry " name="credit_card[billing_address][last_name]"
-                       id="billing_address_last_name"
-                       value="<?php echo $block->escapeHtml($defaultLastName); ?>"
-                       data-validate="{required:true}">
-            </div>
-        </div>
-        <div class="field name billing_address_company">
-            <label for="billing_address_company" class="label">
-                <span><?php echo $block->escapeHtml(__('Company')); ?></span>
-            </label>
-
-            <div class="control">
-                <input type="text" class="input-text " name="credit_card[billing_address][company]"
-                       id="billing_address_company"
-                       value="<?php echo $block->escapeHtml($defaultCompany); ?>">
-            </div>
-        </div>
-        <div class="field name billing_address_street_address required">
-            <label for="billing_address_street_address" class="label">
-                <span><?php echo $block->escapeHtml(__('Address')); ?></span>
-            </label>
-
-            <div class="control">
-                <input type="text" class="input-text required-entry "
-                       name="credit_card[billing_address][street_address]" id="billing_address_street_address"
-                       value="<?php echo $block->escapeHtml($defaultStreetAddress); ?>"
-                       data-validate="{required:true}">
-            </div>
-        </div>
-        <div class="field name billing_address_extended_address">
-            <label for="billing_address_extended_address" class="label">
-                <span></span>
-            </label>
-
-            <div class="control">
-                <input type="text" class="input-text " name="credit_card[billing_address][extended_address]"
-                       id="billing_address_extended_address"
-                       value="<?php echo $block->escapeHtml($defaultExtendedAddress); ?>">
-            </div>
-        </div>
-        <div class="field name billing_address_locality required">
-            <label for="billing_address_locality" class="label">
-                <span><?php echo $block->escapeHtml(__('City')); ?></span>
-            </label>
-
-            <div class="control">
-                <input type="text" class="input-text required-entry " name="credit_card[billing_address][locality]"
-                       id="billing_address_locality"
-                       value="<?php echo $block->escapeHtml($defaultLocality); ?>"
-                       data-validate="{required:true}">
-            </div>
-        </div>
-        <div class="field region billing_address_region required">
-            <label for="billing_address_region" class="label">
-                <span><?php echo $block->escapeHtml(__('State/Province')); ?></span>
-            </label>
-
-            <div class="control">
-                <select id="billing_address_region_id" name="credit_card[billing_address][region_id]"
-                        title="<?php echo $block->escapeHtml(__('State/Province')); ?>" class="validate-select" style="display:none;"
-                        data-validate="{'validate-select':true}">
-                    <option value=""><?php echo $block->escapeHtml(__('Please select region, state or province')); ?></option>
-                </select>
-                <input type="text" class="input-text " name="credit_card[billing_address][region]"
-                       id="billing_address_region"
-                       value="<?php echo $block->escapeHtml($block->getPostParam('customer.creditCard.billingAddress.region', $defaultRegion)); ?>">
-            </div>
-        </div>
-        <div class="field zip billing_address_postal_code required">
-            <label for="billing_address_postal_code" class="label">
-                <span><?php echo $block->escapeHtml(__('Zip/Postal Code')); ?></span>
-            </label>
-            <div class="control">
-                <input type="text" class="input-text required-entry validate-zip-international "
-                       name="credit_card[billing_address][postal_code]" id="billing_address_postal_code"
-                       value="<?php echo $block->escapeHtml($defaultPostalCode); ?>"
-                       data-validate="{required:true, 'validate-zip-international':true}">
-            </div>
-        </div>
-        <div class="field name billing_address_country required">
-            <label for="billing_address_country" class="label">
-                <span><?php echo $block->escapeHtml(__('Country')); ?></span>
-            </label>
-
-            <div class="control">
-                <?php /* @noEscape */ echo $block->countrySelect('credit_card[billing_address][country_code_alpha2]', 'billing_address_country', $default); ?>
-            </div>
-        </div>
-    </fieldset>
-    <div class="actions-toolbar">
-        <div class="primary">
-            <button type="submit" id="opc-submit" data-role="opc-submit" class="action save primary"
-                    title="<?php echo $block->escapeHtml(__('Submit')); ?>">
-                <span><?php echo $block->escapeHtml(__('Submit')); ?></span>
-            </button>
-        </div>
-        <div class="secondary">
-            <a class="action back" href="<?php echo $block->escapeUrl($block->getBackUrl()); ?>">
-                <span><span><small>&laquo; </small><?php echo $block->escapeUrl(__('Back')); ?></span>
-            </a>
-        </div>
-    </div>
-</form>
-
-<script type="text/x-magento-init">
-    {
-        "#form-validate": {
-            "validation": {},
-             "braintreeEditForm": <?php /* @noEscape */ echo $serializedFormData; ?>
-        },
-        "#billing_address_country": {
-            "regionUpdater": {
-                "optionalRegionAllowed": true ,
-                "regionListId": "#billing_address_region_id",
-                "regionInputId": "#billing_address_region",
-                "postcodeId": "#billing_address_region",
-                "form": "#form-validate",
-                "regionJson": <?php /* @noEscape */ echo $this->helper('Magento\Directory\Helper\Data')->getRegionJson(); ?>,
-                "defaultRegion": "<?php echo $block->escapeHtml($defaultRegionId); ?>",
-                "countriesWithOptionalZip":
-                <?php /* @noEscape */ echo $this->helper('Magento\Directory\Helper\Data')->getCountriesWithOptionalZip(true); ?>
-            }
-        }
-    }
-</script>
\ No newline at end of file
diff --git a/app/code/Magento/Braintree/view/frontend/templates/creditcard/index.phtml b/app/code/Magento/Braintree/view/frontend/templates/creditcard/index.phtml
deleted file mode 100644
index 467e2523e6162efa00389deb18ecfe9f5fa43f9a..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/view/frontend/templates/creditcard/index.phtml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-// @codingStandardsIgnoreFile
-
-/** @var $block \Magento\Braintree\Block\Creditcard\Management */
-$storedCards = $block->getCurrentCustomerStoredCards();
-?>
-<div class="page-title title-buttons">
-    <?php if ($block->getUsesVault()): ?>
-        <button type="button" title="<?php echo $block->escapeHtml(__('Add Credit Card')); ?>"
-                class="action subscribe primary"
-                onclick="window.location='<?php echo $block->escapeUrl($block->getAddUrl()) ?>';">
-            <span><span><?php echo $block->escapeHtml(__('Add Credit Card')); ?></span></span>
-        </button>
-    <?php endif; ?>
-</div>
-<?php echo $block->getLayout()->getMessagesBlock()->getGroupedHtml(); ?>
-<?php if (count($storedCards)): ?>
-    <table class="data-table" id="my-quotes-table">
-        <col width="1" />
-        <col width="1" />
-        <col width="1" />
-        <col width="1" />
-        <col width="1" />
-        <thead>
-            <tr>
-                <th><?php echo $block->escapeHtml(__('Type')); ?></th>
-                <th><?php echo $block->escapeHtml(__('Card Number')); ?></th>
-                <th><?php echo $block->escapeHtml(__('Is Default')); ?></th>
-                <th colspan="2"><?php echo $block->escapeHtml(__('Actions')); ?></th>
-            </tr>
-        </thead>
-        <tbody>
-            <?php foreach ($storedCards as $card):?>
-                <tr>
-                    <td><?php echo $block->escapeHtml($card->cardType); ?></td>
-                    <td><?php echo $block->escapeHtml($card->maskedNumber); ?></td>
-                    <td><?php /* @noEscape */ echo ($card->default) ? $block->escapeHtml(__('Yes')) : $block->escapeHtml(__('No')); ?></td>
-                    <td>
-                        <a href="<?php echo $block->escapeUrl($block->getEditUrl($card->token)); ?>">
-                            <?php echo $block->escapeHtml(__('Edit')); ?>
-                        </a>
-                    </td>
-                    <td>
-                        <a href="<?php echo $block->escapeUrl($block->getDeleteUrl($card->token)); ?>">
-                            <?php echo $block->escapeHtml(__('Delete'));?>
-                        </a>
-                    </td>
-                </tr>
-            <?php endforeach; ?>
-        </tbody>        
-    </table>
-<?php endif; ?>
diff --git a/app/code/Magento/Braintree/view/frontend/templates/data_js.phtml b/app/code/Magento/Braintree/view/frontend/templates/data_js.phtml
deleted file mode 100644
index 14579540152c5ac6e53839cf17dfdd861f564d89..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/view/frontend/templates/data_js.phtml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-/**
- * @var $block \Magento\Braintree\Block\Datajs
- */
-?>
-<?php
-$arrayData = [
-    "kountId" => $this->helper('Magento\Braintree\Helper\Data')->getKountId() ?
-        $this->helper('Magento\Braintree\Helper\Data')->getKountId() : false,
-    "formId" =>$block->getFormId(),
-    "merchantId" => $block->getMerchantId(),
-    "braintreeDataJs" => $block->escapeUrl($block->getJsSrc()),
-];
-$serializedFormData = $this->helper('Magento\Framework\Json\Helper\Data')->jsonEncode($arrayData);
-?>
-<script type="text/x-magento-init">
-    {
-        "body": {
-             "braintreeDataJs": <?php /* @noEscape */ echo $serializedFormData; ?>
-        }
-    }
-</script>
diff --git a/app/code/Magento/Braintree/view/frontend/templates/form.phtml b/app/code/Magento/Braintree/view/frontend/templates/form.phtml
deleted file mode 100644
index 41029526cc388a58d93dc9c8ef119d99a1ccafd4..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/view/frontend/templates/form.phtml
+++ /dev/null
@@ -1,163 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-// @codingStandardsIgnoreFile
-
-/** @var \Magento\Braintree\Block\Form $block */
-$code = $block->escapeHtml($block->getMethodCode());
-$loggedIn = $block->isCustomerLoggedIn();
-$storedCards = $block->getStoredCards();
-$useVault = $loggedIn && $block->useVault() && count($storedCards);
-$autoDetection = $block->isCcDetectionEnabled();
-$clientToken = $block->escapeHtml($block->getClientToken());
-$formData = [
-    "useVault" => $useVault,
-    "clientToken" => $clientToken,
-    "autoDetection" => $autoDetection,
-    "loggedIn" => $loggedIn,
-];
-$serializedFormData = $this->helper('Magento\Framework\Json\Helper\Data')->jsonEncode($formData);
-$ccType = $block->getInfoData('cc_type');
-$ccExpMonth = $block->getInfoData('cc_exp_month');
-$ccExpYear = $block->getInfoData('cc_exp_year');
-?>
-<fieldset class="fieldset items braintree" id="payment_form_<?php /* @noEscape */ echo $code; ?>" style="display:none;">
-    <input type="hidden" name="payment[payment_method_nonce]" id="braintree_nonce" value="" />
-    <input type="hidden" name="payment[cc_last4]" id="<?php /* @noEscape */ echo $code; ?>_cc_last4" value="" />
-    <?php if ($autoDetection) : ?>
-        <input type="hidden" id="card_type_autoselect" value="" />
-    <?php endif; ?>
-    <?php if ($useVault): ?>
-        <li id="<?php /* @noEscape */ echo $code; ?>_token_selector">
-            <label for="<?php /* @noEscape */ echo $code; ?>_cc_token">
-                <?php echo $block->escapeHtml(__('Payment Information')); ?>
-            </label>
-            <div class="input-box">
-                <select id="<?php /* @noEscape */ echo $code; ?>_cc_token" name="payment[cc_token]">
-                    <?php foreach ($storedCards as $creditCard): ?>
-                        <option value="<?php echo $block->escapeHtml($creditCard->token); ?>"
-                            <?php /* @noEscape */ echo $creditCard->default ? ' selected="selected"' : ''; ?>>
-                            <?php echo $block->escapeHtml($creditCard->maskedNumber); ?> - <?php echo $block->escapeHtml($creditCard->cardType); ?>
-                        </option>
-                    <?php endforeach; ?>
-                        <option value=''><?php echo $block->escapeHtml(__('Add new card')); ?></option>
-                </select>
-            </div>
-        </li>
-    <?php endif; ?>
-    <div class="field type required hide_if_token_selected">
-        <label for="<?php /* @noEscape */ echo $code; ?>_cc_type" class="label">
-            <span><?php echo $block->escapeHtml(__('Credit Card Type')); ?></span>
-        </label>
-        <div class="control">
-            <select id="<?php /* @noEscape */ echo $code; ?>_cc_type"
-                    data-mage-init='{"creditCardType":{"creditCardTypeContainer":"#<?php /* @noEscape */ echo $code; ?>_cc_type_ss_div"}}'
-                    name="payment[cc_type]" data-validate='{
-                        required:true,
-                        "validate-cc-type-select":"#<?php /* @noEscape */ echo $code; ?>_cc_number"
-                    }' class="select">
-                <option value=""><?php echo $block->escapeHtml(__('--Please Select--')); ?></option>
-                <?php foreach ($block->getCcAvailableTypes() as $typeCode => $typeName): ?>
-                    <option value="<?php echo $block->escapeHtml($typeCode); ?>"
-                        <?php if ($typeCode == $ccType): ?> selected="selected"<?php endif; ?>>
-                        <?php echo $block->escapeHtml($typeName); ?>
-                    </option>
-                <?php endforeach ?>
-            </select>
-        </div>
-    </div>
-    <div class="field number required hide_if_token_selected">
-        <label for="<?php /* @noEscape */ echo $code; ?>_cc_number" class="label">
-            <span><?php echo $block->escapeHtml(__('Credit Card Number')); ?></span>
-        </label>
-        <div class="control">
-            <input type="number" id="<?php /* @noEscape */ echo $code; ?>_cc_number" name="payment[cc_number]"
-                   title="<?php echo $block->escapeHtml(__('Credit Card Number')); ?>" class="input-text" value=""
-                   data-validate='{
-                       "required-number":true,
-                       "validate-cc-number":"#<?php /* @noEscape */ echo $code; ?>_cc_type",
-                       "validate-cc-type":"#<?php /* @noEscape */ echo $code; ?>_cc_type"
-                   }'/>
-        </div>
-    </div>
-    <div class="field date required hide_if_token_selected" id="<?php /* @noEscape */ echo $code; ?>_cc_type_exp_div">
-        <label for="<?php /* @noEscape */ echo $code; ?>_expiration" class="label">
-            <span><?php echo $block->escapeHtml(__('Expiration Date')); ?></span>
-        </label>
-        <div class="control">
-            <div class="fields group group-2">
-                <div class="field no-label month">
-                    <div class="control">
-                        <select id="<?php /* @noEscape */ echo $code; ?>_expiration" name="payment[cc_exp_month]"
-                                class="select month" data-validate='{
-                                    required:true, "validate-cc-exp":"#<?php /* @noEscape */ echo $code; ?>_expiration_yr"
-                                }'>
-                            <?php foreach ($block->getCcMonths() as $k => $v): ?>
-                                <option value="<?php echo $k ? $block->escapeHtml($k) : ''; ?>"
-                                    <?php if ($k == $ccExpMonth): ?> selected="selected"<?php endif; ?>>
-                                    <?php echo $block->escapeHtml($v); ?>
-                                </option>
-                            <?php endforeach; ?>
-                        </select>
-                    </div>
-                </div>
-                <div class="field no-label year">
-                    <div class="control">
-                        <select id="<?php /* @noEscape */ echo $code; ?>_expiration_yr" name="payment[cc_exp_year]" class="select year" data-validate='{required:true}'>
-                            <?php foreach ($block->getCcYears() as $k => $v): ?>
-                                <option value="<?php /* @noEscape */ echo $k ? $block->escapeHtml($k) : '' ?>"
-                                    <?php if ($k == $ccExpYear): ?> selected="selected"<?php endif; ?>>
-                                    <?php echo $block->escapeHtml($v); ?>
-                                </option>
-                            <?php endforeach; ?>
-                        </select>
-                    </div>
-                </div>
-            </div>
-        </div>
-    </div>
-    <?php if ($block->hasVerification()): ?>
-        <div class="field cvv required hide_if_token_selected" id="<?php /* @noEscape */ echo $code; ?>_cc_type_cvv_div">
-            <label for="<?php /* @noEscape */ echo $code; ?>_cc_cid" class="label">
-                <span><?php echo $block->escapeHtml(__('Card Verification Number')); ?></span>
-            </label>
-            <div class="control">
-                <input type="number" title="<?php echo $block->escapeHtml(__('Card Verification Number')); ?>"
-                       class="input-text cvv"
-                       id="<?php /* @noEscape */ echo $code; ?>_cc_cid" name="payment[cc_cid]" value=""
-                       data-validate='{
-                           "required-number":true, "validate-cc-cvn":"#<?php /* @noEscape */ echo $code; ?>_cc_type"
-                       }' />
-                <?php $content = '<img src=\"' . $block->escapeUrl($block->getViewFileUrl('Magento_Checkout::cvv.png')) .
-                    '\" alt=\"' . $block->escapeHtml(__('Card Verification Number Visual Reference')) .
-                    '\" title=\"' . $block->escapeHtml(__('Card Verification Number Visual Reference')) . '\" />'; ?>
-                <div class="note">
-                    <a href="#" class="action cvv" title="<?php echo $block->escapeHtml(__('What is this?')); ?>"
-                       data-mage-init='{"tooltip": {"content": "<?php /* @noEscape */ echo $content; ?>"}}'>
-                        <span><?php echo $block->escapeHtml(__('What is this?')); ?></span>
-                    </a>
-                </div>
-            </div>
-        </div>
-    <?php endif; ?>
-
-    <?php if($block->canSaveCard()): ?>
-        <li id="<?php /* @noEscape */ echo $code; ?>_store_in_vault_div" style="text-align:left;" class="hide_if_token_selected">
-            <input type="checkbox" title="<?php echo $block->escapeHtml(__('Save this card for future use')); ?>" class="input-checkbox"
-                   id="<?php /* @noEscape */ echo $code; ?>_store_in_vault" checked="checked" name="payment[store_in_vault]" value="1" />
-            <label for="<?php /* @noEscape */ echo $code; ?>_store_in_vault" class="required" style="float:none;">
-                <?php echo $block->escapeHtml(__('Save this card for future use')); ?>
-            </label>
-        </li>
-    <?php endif; ?>
-</fieldset>
-<script type="text/x-magento-init">
-    {
-        "#payment_form_braintree": {
-            "braintreeForm": <?php /* @noEscape */ echo $serializedFormData ?>
-        }
-    }
-</script>
diff --git a/app/code/Magento/BraintreeTwo/view/frontend/templates/paypal/button.phtml b/app/code/Magento/Braintree/view/frontend/templates/paypal/button.phtml
similarity index 91%
rename from app/code/Magento/BraintreeTwo/view/frontend/templates/paypal/button.phtml
rename to app/code/Magento/Braintree/view/frontend/templates/paypal/button.phtml
index 1e513876c4ee14a40586297cede8cc7aa7d56245..bb266a4c67ddacf4645e0c6acfb1b17e366b8235 100644
--- a/app/code/Magento/BraintreeTwo/view/frontend/templates/paypal/button.phtml
+++ b/app/code/Magento/Braintree/view/frontend/templates/paypal/button.phtml
@@ -5,13 +5,13 @@
  */
 
 /**
- * @var \Magento\BraintreeTwo\Block\Paypal\Button $block
+ * @var \Magento\Braintree\Block\Paypal\Button $block
  */
 
 $id = $block->getContainerId() . mt_rand();
 
 $config = [
-    'Magento_BraintreeTwo/js/paypal/button' => [
+    'Magento_Braintree/js/paypal/button' => [
         'id' => $id,
         'clientToken' => $block->getClientToken(),
         'displayName' => $block->getMerchantName(),
diff --git a/app/code/Magento/Braintree/view/frontend/web/js/button/braintree-paypal-minicart.js b/app/code/Magento/Braintree/view/frontend/web/js/button/braintree-paypal-minicart.js
deleted file mode 100644
index c26f3536f6a3bd607476e4824d5c43cd759e263d..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/view/frontend/web/js/button/braintree-paypal-minicart.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-define([
-    'jquery',
-    'Magento_Braintree/js/button/builder',
-    'Magento_Ui/js/lib/view/utils/dom-observer',
-    'mage/apply/main'
-], function ($, builder, domObserver, mage) {
-    'use strict';
-
-    return function (config) {
-        var $container = $(config.containerId);
-
-        domObserver.off(config.containerId);
-        domObserver.get(config.containerId, function () {
-            mage.apply();
-        });
-
-        if ($container.data('is_rendered')) {
-            return;
-        }
-        $container.data('is_rendered', true);
-
-        builder.setClientToken(config.clientToken)
-            .setOptions(config.options)
-            .setName('paypal')
-            .setContainer(config.containerId)
-            .setPayment(config.paymentId)
-            .setDetails(config.detailsId)
-            .setFormAction(config.formAction)
-            .build();
-    };
-});
diff --git a/app/code/Magento/Braintree/view/frontend/web/js/button/builder.js b/app/code/Magento/Braintree/view/frontend/web/js/button/builder.js
deleted file mode 100644
index 75d4568e8968d20291e762c8c69a1c1c1ea77c90..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/view/frontend/web/js/button/builder.js
+++ /dev/null
@@ -1,170 +0,0 @@
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-define([
-    'jquery',
-    'braintree',
-    'underscore',
-    'mage/template'
-], function ($, braintree, _, mageTemplate) {
-    'use strict';
-
-    // private
-    var payment = {
-        form: {
-
-            /**
-             * @param {*} formData
-             * @returns {jQuery}
-             */
-            build: function (formData) {
-                var formTmpl = mageTemplate('<form action="<%= data.action %>"' +
-                    ' method="POST" hidden enctype="multipart/form-data">' +
-                    '<% _.each(data.fields, function(val, key){ %>' +
-                    '<input value=\'<%= val %>\' name="<%= key %>" type="hidden">' +
-                    '<% }); %>' +
-                    '</form>');
-
-                return $(formTmpl({
-                    data: {
-                        action: formData.action,
-                        fields: formData.fields
-                    }
-                })).appendTo($('[data-container="body"]'));
-            }
-        },
-
-        /**
-         * @param {*} allow
-         * @returns {*}
-         */
-        prepare: function (allow) {
-            var self = this,
-                config = {
-
-                    /**
-                     * @param {*} paymentResult
-                     * @returns
-                     */
-                    onPaymentMethodReceived: function (paymentResult) {
-                        self.form.build(
-                            {
-                                action: self.formAction,
-                                fields: {
-                                    'payment_method_nonce': paymentResult.nonce,
-                                    'details': JSON.stringify(paymentResult.details)
-                                }
-                            }
-                        ).submit();
-                    }
-                };
-
-            _.each(this.options, function (option, name) {
-                if (option !== null && _.indexOf(allow, name) !== -1) {
-                    config[name] = option;
-                }
-            });
-
-            return config;
-        },
-
-        /**
-         * @returns {*}
-         */
-        getConfig: function () {
-            return this.prepare([
-                'merchantName',
-                'locale',
-                'enableBillingAddress',
-                'currency',
-                'amount',
-                'container',
-                'singleUse',
-                'enableShippingAddress'
-            ]);
-        }
-    };
-
-    // public
-    return {
-
-        /**
-         * @param {String} clientToken
-         * @returns {*}
-         */
-        setClientToken: function (clientToken) {
-            payment.clientToken = clientToken;
-
-            return this;
-        },
-
-        /**
-         * @param {*} options
-         * @returns {*}
-         */
-        setOptions: function (options) {
-            payment.options = options;
-
-            return this;
-        },
-
-        /**
-         * @param {String} name
-         * @returns {*}
-         */
-        setName: function (name) {
-            payment.name = name;
-
-            return this;
-        },
-
-        /**
-         * @param {String} containerId
-         * @returns {*}
-         */
-        setContainer: function (containerId) {
-            payment.containerId = containerId;
-
-            return this;
-        },
-
-        /**
-         * @param {String} paymentId
-         * @returns {*}
-         */
-        setPayment: function (paymentId) {
-            payment.paymentId = paymentId;
-
-            return this;
-        },
-
-        /**
-         * @param {String} detailsId
-         * @returns {*}
-         */
-        setDetails: function (detailsId) {
-            payment.detailsId = detailsId;
-
-            return this;
-        },
-
-        /**
-         * @param {String} formAction
-         * @returns {*}
-         */
-        setFormAction: function (formAction) {
-            payment.formAction = formAction;
-
-            return this;
-        },
-
-        /**
-         * @returns
-         */
-        build: function () {
-            $(payment.containerId).empty();
-            braintree.setup(payment.clientToken, payment.name, payment.getConfig());
-        }
-    };
-});
diff --git a/app/code/Magento/Braintree/view/frontend/web/js/cc-data.js b/app/code/Magento/Braintree/view/frontend/web/js/cc-data.js
deleted file mode 100644
index 0a1f7539ca745be0e689e866dc59cd46515595e7..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/view/frontend/web/js/cc-data.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-/*jshint jquery:true*/
-define([
-    "jquery",
-    "jquery/ui",
-], function ($) {
-    'use strict';
-
-    $.widget('mage.braintreeDataJs', {
-        options: {
-            kountId: false
-        },
-        _create: function () {
-            var self = this;
-            var formId = self.options.formId;
-            var defaultPaymentFormId='co-payment-form';
-            if (!$('#' + formId)) {
-                formId = defaultPaymentFormId;
-            }
-            window.onBraintreeDataLoad = function () {
-
-                var env;
-                if (self.options.kountId) {
-                    env = BraintreeData.environments.production.withId(self.options.kountId);
-                } else {
-                    env = BraintreeData.environments.production;
-                }
-
-                BraintreeData.setup(self.options.merchantId, formId, env);
-            };
-
-            if (formId != defaultPaymentFormId) {
-                $.getScript(self.options.braintreeDataJs);
-            }
-        }
-    });
-    return $.mage.braintreeDataJs;
-});
diff --git a/app/code/Magento/Braintree/view/frontend/web/js/cc-edit-form.js b/app/code/Magento/Braintree/view/frontend/web/js/cc-edit-form.js
deleted file mode 100644
index 3d8e561448c4698cae2a2a044782fac59638a1de..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/view/frontend/web/js/cc-edit-form.js
+++ /dev/null
@@ -1,220 +0,0 @@
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-/*jshint jquery:true*/
-define([
-    "jquery",
-    "braintree",
-    'mage/translate',
-    'Magento_Ui/js/modal/alert',
-    "jquery/ui"
-], function ($, braintree, $t, alert) {
-    'use strict';
-
-    $.widget('mage.braintreeEditForm', {
-        options: {
-            backUrl: '',
-            formId: '#form-validate',
-            creditCardTypeId: '#credit_card_type',
-            deviceDataId: '#device_data',
-            creditCardNumber: '#credit_card_number',
-            creditCardExpirationYr: '#credit_card_expiration_yr',
-            creditCardExpiration: '#credit_card_expiration',
-            creditCardCvv: '#credit_card_cvv',
-            creditCardCardHolderName: '#credit_card_cardholder_name',
-            creditCardOptionsMakeDefault: '#credit_card_options_make_default',
-            billingAddressFirstName: '#billing_address_first_name',
-            billingAddressLastName: '#billing_address_last_name',
-            billingAddressCompany: '#billing_address_company',
-            billingAddressStreetAddress: '#billing_address_street_address',
-            billingAddressExtendedAddress: '#billing_address_extended_address',
-            billingAddressLocality: '#billing_address_locality',
-            billingAddressRegionId: '#billing_address_region_id',
-            billingAddressRegion: '#billing_address_region',
-            billingAddressPostalCode: '#billing_address_postal_code',
-            billingAddressCountry: '#billing_address_country',
-            clientToken: "",
-            braintreeClient: null,
-            countrySpecificCardTypes: {},
-            cardTypes: {},
-            selectMergedOptions: null,
-            applicableCardTypes: {},
-            isFraudDetectionEnabled :false
-        },
-        _create: function () {
-            if (!this.preventDoubleInit()) {
-                var self = this;
-                this.ccTypes = {
-                    VI: [new RegExp('^4[0-9]{12}([0-9]{3})?$'), new RegExp('^[0-9]{3}$')],
-                    MC: [new RegExp('^5[1-5][0-9]{14}$'), new RegExp('^[0-9]{3}$')],
-                    AE: [new RegExp('^3[47][0-9]{13}$'), new RegExp('^[0-9]{4}$')],
-                    DI: [new RegExp('^6011[0-9]{12}$'), new RegExp('^[0-9]{3}$')],
-                    JCB: [new RegExp('^(3[0-9]{15}|(2131|1800)[0-9]{11})$'), new RegExp('^[0-9]{3,4}$')],
-                    OT: [false, new RegExp('^([0-9]{3}|[0-9]{4})?$')]
-                };
-
-                self.options.braintreeClient = new braintree.api.Client({clientToken: this.options.clientToken});
-                $(self.options.formId).on('submit', function (e) {
-                    e.preventDefault();
-                    $(self.options.formId).trigger('afterFormSubmit');
-                });
-
-                $(self.options.formId).on('afterFormSubmit', function (e) {
-                    self.callBraintree();
-                });
-                self.options.selectMergedOptions = $(self.options.creditCardTypeId).find('option');
-                $(self.options.billingAddressCountry).on('change', function (e) {
-                    self.populateCountrySpecificCCType();
-                });
-
-                $(self.options.creditCardNumber).on('input', function () {
-                    var ccNumber = $(this).val(),
-                        ccTypeField = $(self.options.creditCardTypeId).find('options');
-                    ccNumber = ccNumber.replace(/\D/g,''); //remove all but the digits
-                    for(var ccType in self.ccTypes) {
-                        if(self.ccTypes.hasOwnProperty(ccType)) {
-                            var ccRegex = self.ccTypes[ccType][0];
-                            if(ccRegex && ccNumber.match(ccRegex)) {
-                                if ($(self.options.creditCardTypeId).find('option').length>0) {
-                                        $(self.options.creditCardTypeId).val(ccType);
-                                }
-                            }
-                        }
-                    }
-                });
-
-                $(self.options.billingAddressCountry).trigger('change');
-            }
-
-        },
-        preventDoubleInit: function() {
-            //TODO remove this quick fix and fix the core problem, this file gets included twice, and it should not
-            return $._data($(this.options.formId).get(0),'events').afterFormSubmit;
-        },
-        populateCountrySpecificCCType: function () {
-            //TODO refactor with _underscore.js
-            var self = this;
-            var country = $(self.options.billingAddressCountry).val();
-            var ccType = $(self.options.creditCardTypeId).val();
-            if (self.options.countrySpecificCardTypes.hasOwnProperty(country)) {
-                var cTypeList = $(self.options.creditCardTypeId);
-                cTypeList.html('');
-                self.options.selectMergedOptions.each(function(i) {
-                    if (i == 0) {
-                        cTypeList.append(
-                            '<option value="' + $(this).attr('value') + '">' + $(this).text() + '</option>');
-                    }
-                });
-                for (var co in self.options.countrySpecificCardTypes[country]) {
-                    var currentType=self.options.countrySpecificCardTypes[country][co];
-                    var currentText = '';
-                    self.options.selectMergedOptions.each(function(i) {
-                        if ( $(this).attr('value') == currentType )
-                            currentText = $(this).text();
-                    });
-                    cTypeList.append('<option value="'+currentType+'">'+currentText+'</option>');
-                }
-            } else {
-                //all options
-                var cTypeList = $(self.options.creditCardTypeId);
-                cTypeList.html('');
-                self.options.selectMergedOptions.each(function(i) {
-                    if (self.options.applicableCardTypes.indexOf($(this).attr('value')) > -1 || i == 0) {
-                        cTypeList.append(
-                            '<option value="' + $(this).attr('value') + '">' + $(this).text() + '</option>');
-                    }
-                });
-            }
-            $(self.options.creditCardTypeId).val(ccType);
-        },
-        callBraintree: function () {
-            var self = this;
-            if ($(self.options.formId).validate().errorList.length == 0) {
-                var ccNumber = $(self.options.creditCardNumber).val(),
-                    ccType = $(self.options.creditCardTypeId).val(),
-                    ccExprYr = $(self.options.creditCardExpirationYr).val(),
-                    ccExprMo = ("0" + $(self.options.creditCardExpiration).val()).slice(-2),
-                    cvv = self.options.hasVerification ? $(self.options.creditCardCvv).val() : null,
-                    deviceData = (self.options.isFraudDetectionEnabled && $(self.options.deviceDataId).length>0) ?
-                        $(self.options.deviceDataId).val() : null,
-                    ccHolderName = $(self.options.creditCardCardHolderName).val(),
-                    isDefault = $(self.options.creditCardOptionsMakeDefault).prop('checked'),
-                    billFirstName = $(self.options.billingAddressFirstName).val(),
-                    billLastName = $(self.options.billingAddressLastName).val(),
-                    billCompany = $(self.options.billingAddressCompany).val(),
-                    billStreetAddress = $(self.options.billingAddressStreetAddress).val(),
-                    billExtAddress = $(self.options.billingAddressExtendedAddress).val(),
-                    billCity = $(self.options.billingAddressLocality).val(),
-                    billState = $(self.options.billingAddressRegionId).is(':visible') ?
-                        $(self.options.billingAddressRegionId).find('option:selected').text() : $(self.options.billingAddressRegion).val(),
-                    billPostal = $(self.options.billingAddressPostalCode).val(),
-                    billCountry = $(self.options.billingAddressCountry).val();
-                $('body').trigger('processStart');
-                var billingAddress = {
-                        firstName: billFirstName,
-                        lastName: billLastName,
-                        company: billCompany,
-                        streetAddress: billStreetAddress,
-                        extendedAddress: billExtAddress,
-                        locality: billCity,
-                        region: billState,
-                        postalCode: billPostal,
-                        countryCodeAlpha2: billCountry
-                    },
-                    submitObj = {
-                        number: ccNumber,
-                        cardholderName: ccHolderName,
-                        expirationDate: ccExprMo + '/' + ccExprYr,
-                        billingAddress: billingAddress
-                    };
-
-                if (self.options.hasVerification) {
-                    submitObj.cvv = cvv;
-                }
-
-                self.options.braintreeClient.tokenizeCard(submitObj, function (err, nonce) {
-                    // Send nonce to our server
-                    if (!err) {
-                        $.ajax({
-                            type: "POST",
-                            url: self.options.ajaxSaveUrl,
-                            data: {
-                                nonce: nonce,
-                                billingAddress: billingAddress,
-                                options: {
-                                    default: isDefault,
-                                    token: self.options.cardToken,
-                                    update: self.options.isEditMode,
-                                    ccType: ccType,
-                                    device_data: deviceData
-                                }
-                            },
-                            success: function (response) {
-                                $('body').trigger('processStop');
-                                if (response instanceof Object) {
-                                    if (response.success) {
-                                        $('body').trigger('processStart');
-                                        window.location = self.options.backUrl;
-                                    }
-                                }
-                            },
-                            error: function (response) {
-                                alert({
-                                    content: $t('There was error during saving card data')
-                                });
-                            }
-                        });
-                    } else {
-                        //handle error
-                        $('body').trigger('processStop');
-                        alert({
-                            content: $t('There was error during saving card data')
-                        });
-                    }
-                });
-            }
-        }
-    });
-    return $.mage.braintreeEditForm;
-});
diff --git a/app/code/Magento/Braintree/view/frontend/web/js/cc-form.js b/app/code/Magento/Braintree/view/frontend/web/js/cc-form.js
deleted file mode 100644
index a922038eae6c0e2e299fb776587ced1d13ec1afa..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/view/frontend/web/js/cc-form.js
+++ /dev/null
@@ -1,108 +0,0 @@
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-/*jshint jquery:true*/
-define([
-    "jquery",
-    "braintree",
-    'mage/translate',
-    'Magento_Ui/js/modal/alert',
-    "jquery/ui"
-], function($, braintree, $t, alert) {
-    "use strict";
-
-    $.widget('mage.braintreeForm', {
-        options: {
-            loggedIn : false,
-            formSelector: '#multishipping-billing-form',
-            paymentMethodsSelector: '#payment-methods [name="payment[method]"]:checked',
-            clientToken : "",
-            useVault : false,
-            autoDetection : false
-        },
-
-        _create: function() {
-            $('#braintree_cc_number').bind('change', function(){
-                $('#braintree_cc_last4').val($("#braintree_cc_number").val().slice(-4));
-            });
-
-            var self = this;
-            if (this.options.useVault) {
-                var selectBox = $('#braintree_cc_token');
-                var initToken = selectBox.val();
-
-                if (initToken)
-                {
-                    $('.hide_if_token_selected').hide();
-                    $('#braintree_nonce').val("");
-                }
-
-                $('#braintree_cc_token').bind('change', function (e) {
-                    var selectBox = $(this);
-                    var token = selectBox.val();
-                    if (token)
-                    {
-                        $('.hide_if_token_selected').hide();
-                        $('#braintree_nonce').val("");
-                    } else {
-                        $('.hide_if_token_selected').show();
-
-                        if (self.options.autoDetection) {
-                            $('#cc_type_manual_row').hide();
-                            $('#cc_type_auto_row').show();
-                        } else {
-                            $('#cc_type_manual_row').show();
-                            $('#cc_type_auto_row').hide();
-                        }
-                    }
-                });
-            }
-
-            //TODO: handle auto detection
-
-            $(this.options.formSelector).bind('submit', function(event, form) {
-                if ($(self.options.formSelector).find('input.mage-error').length > 0
-                    || $(self.options.formSelector).find('select.mage-error').length > 0) {
-                    return;
-                }
-                var selectedPaymentMethod = $(self.options.paymentMethodsSelector).val();
-                if (selectedPaymentMethod != 'braintree') {
-                    return;
-                }
-                var ccNumber = $("#braintree_cc_number").val();
-                var ccExprYr = $("#braintree_expiration_yr").val();
-                var ccExprMo = $("#braintree_expiration").val();
-                var cvv = $('#braintree_cc_cid').val();
-
-                if (ccNumber) {
-                    var braintreeClient = new braintree.api.Client({clientToken: self.options.clientToken});
-                    event.preventDefault();
-                    braintreeClient.tokenizeCard(
-                        {
-                            number: ccNumber,
-                            expirationMonth: ccExprMo,
-                            expirationYear: ccExprYr,
-                            cvv : cvv
-                        },
-                        function (err, nonce) {
-                            if (!err) {
-                                $('#braintree_nonce').val(nonce);
-                                $("#braintree_cc_number").prop('disabled', true);;
-                                $('#braintree_cc_cid').prop('disabled', true);;
-                                var form = $(self.options.formSelector)[0];
-                                form.submit();
-                            } else {
-                                alert({
-                                    content: $t("An error occured with payment processing.")
-                                });
-                            }
-                        }
-                    );
-                }
-            });
-        }
-    });
-
-    return $.mage.braintreeForm;
-});
\ No newline at end of file
diff --git a/app/code/Magento/BraintreeTwo/view/frontend/web/js/paypal/button.js b/app/code/Magento/Braintree/view/frontend/web/js/paypal/button.js
similarity index 98%
rename from app/code/Magento/BraintreeTwo/view/frontend/web/js/paypal/button.js
rename to app/code/Magento/Braintree/view/frontend/web/js/paypal/button.js
index c71b556848017a96f4b12896aa47d2fb8aa17cc9..a1ae02e33bd4cc39c81646e0b08b0cf9eebe1155 100644
--- a/app/code/Magento/BraintreeTwo/view/frontend/web/js/paypal/button.js
+++ b/app/code/Magento/Braintree/view/frontend/web/js/paypal/button.js
@@ -9,7 +9,7 @@ define(
         'underscore',
         'jquery',
         'braintree',
-        'Magento_BraintreeTwo/js/paypal/form-builder',
+        'Magento_Braintree/js/paypal/form-builder',
         'domReady!'
     ],
     function (
diff --git a/app/code/Magento/BraintreeTwo/view/frontend/web/js/paypal/form-builder.js b/app/code/Magento/Braintree/view/frontend/web/js/paypal/form-builder.js
similarity index 100%
rename from app/code/Magento/BraintreeTwo/view/frontend/web/js/paypal/form-builder.js
rename to app/code/Magento/Braintree/view/frontend/web/js/paypal/form-builder.js
diff --git a/app/code/Magento/BraintreeTwo/view/frontend/web/js/view/payment/3d-secure.js b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/3d-secure.js
similarity index 98%
rename from app/code/Magento/BraintreeTwo/view/frontend/web/js/view/payment/3d-secure.js
rename to app/code/Magento/Braintree/view/frontend/web/js/view/payment/3d-secure.js
index 917267bf2339c81dc2c264c919fc7263990faafb..1161fd823f6cbedfbc1b7a811f6ed93a5551284f 100644
--- a/app/code/Magento/BraintreeTwo/view/frontend/web/js/view/payment/3d-secure.js
+++ b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/3d-secure.js
@@ -7,7 +7,7 @@
 
 define([
     'jquery',
-    'Magento_BraintreeTwo/js/view/payment/adapter',
+    'Magento_Braintree/js/view/payment/adapter',
     'Magento_Checkout/js/model/quote',
     'mage/translate'
 ], function ($, braintree, quote, $t) {
diff --git a/app/code/Magento/BraintreeTwo/view/frontend/web/js/view/payment/adapter.js b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/adapter.js
similarity index 98%
rename from app/code/Magento/BraintreeTwo/view/frontend/web/js/view/payment/adapter.js
rename to app/code/Magento/Braintree/view/frontend/web/js/view/payment/adapter.js
index 9694e120fbcb9b378d5942f5872c213396d0d0e1..42dbb2fe3ca36ac57d6f5973ac1356b45ed01fc1 100644
--- a/app/code/Magento/BraintreeTwo/view/frontend/web/js/view/payment/adapter.js
+++ b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/adapter.js
@@ -54,7 +54,7 @@ define([
          * @returns {String}
          */
         getCode: function () {
-            return 'braintreetwo';
+            return 'braintree';
         },
 
         /**
diff --git a/app/code/Magento/Braintree/view/frontend/web/js/view/payment/braintree-methods.js b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/braintree-methods.js
deleted file mode 100644
index 92bad1d4da6bed78048fce341852f919c5fa3c08..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/view/frontend/web/js/view/payment/braintree-methods.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-define(
-    [
-        'uiComponent',
-        'Magento_Checkout/js/model/payment/renderer-list'
-    ],
-    function (
-        Component,
-        rendererList
-    ) {
-        'use strict';
-        rendererList.push(
-            {
-                type: 'braintree',
-                component: 'Magento_Braintree/js/view/payment/method-renderer/cc-form'
-            },
-            {
-                type: 'braintree_paypal',
-                component: 'Magento_Braintree/js/view/payment/method-renderer/braintree-paypal'
-            }
-        );
-        /** Add view logic here if needed */
-        return Component.extend({});
-    }
-);
diff --git a/app/code/Magento/BraintreeTwo/view/frontend/web/js/view/payment/braintree.js b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/braintree.js
similarity index 78%
rename from app/code/Magento/BraintreeTwo/view/frontend/web/js/view/payment/braintree.js
rename to app/code/Magento/Braintree/view/frontend/web/js/view/payment/braintree.js
index 4628aa954d863c1bf202cbabf08cd2ef538c5a3c..451ac3e33d418803e12007306ab3fb2245cebbf9 100644
--- a/app/code/Magento/BraintreeTwo/view/frontend/web/js/view/payment/braintree.js
+++ b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/braintree.js
@@ -8,7 +8,7 @@ define(
     [
         'uiComponent',
         'uiRegistry',
-        'Magento_BraintreeTwo/js/view/payment/adapter',
+        'Magento_Braintree/js/view/payment/adapter',
         'Magento_Checkout/js/model/payment/renderer-list'
     ],
     function (
@@ -20,8 +20,8 @@ define(
         'use strict';
 
         var config = window.checkoutConfig.payment,
-            braintreeType = 'braintreetwo',
-            payPalType = 'braintreetwo_paypal',
+            braintreeType = 'braintree',
+            payPalType = 'braintree_paypal',
             path = 'checkout.steps.billing-step.payment.payments-list.',
             components = [];
 
@@ -30,7 +30,7 @@ define(
             rendererList.push(
                 {
                     type: braintreeType,
-                    component: 'Magento_BraintreeTwo/js/view/payment/method-renderer/hosted-fields'
+                    component: 'Magento_Braintree/js/view/payment/method-renderer/hosted-fields'
                 }
             );
         }
@@ -39,7 +39,7 @@ define(
             rendererList.push(
                 {
                     type: payPalType,
-                    component: 'Magento_BraintreeTwo/js/view/payment/method-renderer/paypal'
+                    component: 'Magento_Braintree/js/view/payment/method-renderer/paypal'
                 }
             );
         }
diff --git a/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/braintree-paypal.js b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/braintree-paypal.js
deleted file mode 100644
index 78cd0c4f0c8d256d8c514fe335b8964e8da09f72..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/braintree-paypal.js
+++ /dev/null
@@ -1,109 +0,0 @@
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-/*browser:true*/
-/*global define*/
-define(
-    [
-        'jquery',
-        'Magento_Checkout/js/view/payment/default',
-        'Magento_Checkout/js/model/quote',
-        'braintree',
-        'Magento_Ui/js/model/messageList',
-        'mage/translate'
-    ],
-    function ($, Component, quote, braintreeClientSDK, messageList, $t) {
-        var braintreeConfig = window.checkoutConfig.payment.braintree_paypal;
-
-        return Component.extend({
-            defaults: {
-                template: 'Magento_Braintree/payment/braintree-paypal-form',
-                locale: braintreeConfig.locale,
-                merchantName: braintreeConfig.merchantDisplayName,
-                clientToken: braintreeConfig.clientToken,
-                paymentMethodNonce: null,
-                containerElement: null,
-                totalSubscription: null,
-                currentGrandTotal: null
-            },
-
-            initObservable: function () {
-                this._super()
-                    .observe([
-                        'paymentMethodNonce'
-                    ]);
-
-                this.totalSubscription = quote.totals.subscribe(function () {
-                    if (this.currentGrandTotal != quote.totals().base_grand_total) {
-                        this.initPayPalContainer();
-                    }
-                }, this);
-
-                return this;
-            },
-
-            getData: function () {
-                return {
-                    'method': this.item.method,
-                    'po_number': null,
-                    'additional_data': {
-                        'payment_method_nonce': this.paymentMethodNonce()
-                    }
-                };
-            },
-
-            disposeSubscriptions: function () {
-                if (this.totalSubscription) {
-                    this.totalSubscription.dispose();
-                }
-            },
-
-            canInitialise: function () {
-                return this.clientToken
-            },
-
-            initPayPalContainer: function (element) {
-                if (this.canInitialise()) {
-                    if (element) {
-                        // target container element is passed via afterRender data-bind
-                        this.containerElement = element;
-                    }
-
-                    var container = $(this.containerElement);
-                    if (container.length == 0) {
-                        return;
-                    }
-
-                    var totals = quote.totals();
-                    this.paymentMethodNonce(null);
-                    // the following line is an optimization to prevent frequent re-initialization of the container
-                    this.currentGrandTotal = totals.base_grand_total;
-                    container.empty();
-
-                    var self = this;
-                    //TODO: check shipping address override
-                    braintreeClientSDK.setup(this.clientToken, 'paypal', {
-                        container: container,
-                        singleUse: true,
-                        amount: totals.base_grand_total,
-                        currency: totals.base_currency_code,
-                        displayName: this.merchantName || '',
-                        locale: this.locale,
-                        onPaymentMethodReceived: function (response) {
-                            self.paymentMethodNonce(response.nonce);
-                        },
-                        onCancelled: function () {
-                            self.paymentMethodNonce(null);
-                        }
-                    });
-                } else {
-                    this.messageContainer.addErrorMessage({'message': $t('Can not initialize PayPal (Braintree)')});
-                }
-            },
-            isValid: function () {
-                return this.paymentMethodNonce() ? true : false;
-            }
-        });
-    }
-);
diff --git a/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js
index 49f3e6ff495f9a86345397f6320b089bfea7ae18..70a5f5284c837cc734c38d84c563706fb8e6f7ff 100644
--- a/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js
+++ b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js
@@ -2,391 +2,219 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
+/*browser:true*/
+/*global define*/
 define(
     [
-        'ko',
-        'Magento_Payment/js/view/payment/cc-form',
-        'Magento_Checkout/js/action/set-payment-information',
-        'Magento_Checkout/js/model/quote',
-        'braintree',
         'underscore',
         'jquery',
-        'Magento_Ui/js/model/messageList',
+        'Magento_Payment/js/view/payment/cc-form',
+        'Magento_Checkout/js/model/quote',
+        'Magento_Braintree/js/view/payment/adapter',
         'mage/translate',
-        'uiRegistry',
-        'mage/utils/wrapper'
+        'Magento_Braintree/js/validator',
+        'Magento_Braintree/js/view/payment/validator-handler',
+        'Magento_Checkout/js/model/full-screen-loader'
     ],
     function (
-        ko,
-        Component,
-        setPaymentInformationAction,
-        quote,
-        braintreeClientSDK,
         _,
         $,
-        messageList,
-        $t
+        Component,
+        quote,
+        braintree,
+        $t,
+        validator,
+        validatorManager,
+        fullScreenLoader
     ) {
         'use strict';
 
-        var configBraintree = window.checkoutConfig.payment.braintree;
-
         return Component.extend({
-            placeOrderHandler: null,
-            validateHandler: null,
+            defaults: {
+                active: false,
+                braintreeClient: null,
+                braintreeDeviceData: null,
+                paymentMethodNonce: null,
+                lastBillingAddress: null,
+                validatorManager: validatorManager,
+                code: 'braintree',
+
+                /**
+                 * Additional payment data
+                 *
+                 * {Object}
+                 */
+                additionalData: {},
+
+                /**
+                 * Braintree client configuration
+                 *
+                 * {Object}
+                 */
+                clientConfig: {
 
-            /**
-             * @param {Function} handler
-             */
-            setPlaceOrderHandler: function (handler) {
-                this.placeOrderHandler = handler;
-            },
+                    /**
+                     * Triggers on payment nonce receive
+                     * @param {Object} response
+                     */
+                    onPaymentMethodReceived: function (response) {
+                        this.beforePlaceOrder(response);
+                    },
 
-            /**
-             * @param {Function} handler
-             */
-            setValidateHandler: function (handler) {
-                this.validateHandler = handler;
-            },
+                    /**
+                     * Triggers on any Braintree error
+                     */
+                    onError: function () {
+                        this.paymentMethodNonce = null;
+                    },
 
-            /**
-             * @returns {Boolean}
-             */
-            isShowLegend: function () {
-                return true;
+                    /**
+                     * Triggers when customer click "Cancel"
+                     */
+                    onCancelled: function () {
+                        this.paymentMethodNonce = null;
+                    }
+                },
+                imports: {
+                    onActiveChange: 'active'
+                }
             },
 
             /**
-             * @returns {*}
+             * Set list of observable attributes
+             *
+             * @returns {exports.initObservable}
              */
-            getSource: function () {
-                return window.checkoutConfig.payment.iframe.source[this.getCode()];
-            },
+            initObservable: function () {
+                validator.setConfig(window.checkoutConfig.payment[this.getCode()]);
+                this._super()
+                    .observe(['active']);
+                this.validatorManager.initialize();
+                this.initBraintree();
 
-            /**
-             * @returns {*}
-             */
-            getControllerName: function () {
-                return window.checkoutConfig.payment.iframe.controllerName[this.getCode()];
+                return this;
             },
 
             /**
-             * @returns {*}
+             * Get payment name
+             *
+             * @returns {String}
              */
-            getPlaceOrderUrl: function () {
-                return window.checkoutConfig.payment.iframe.placeOrderUrl[this.getCode()];
+            getCode: function () {
+                return this.code;
             },
 
             /**
+             * Check if payment is active
+             *
              * @returns {Boolean}
              */
             isActive: function () {
-                return true;
-            },
-
-            defaults: {
-                template: 'Magento_Braintree/payment/cc-form',
-                isCcFormShown: true,
-                storeInVault: true,
-                paymentMethodNonce: null,
-                selectedCardToken: configBraintree ? configBraintree.selectedCardToken : '',
-                storedCards: configBraintree ? configBraintree.storedCards : {},
-                availableCardTypes: configBraintree ? configBraintree.availableCardTypes : {},
-                lastBillingAddress: null
-            },
+                var active = this.getCode() === this.isChecked();
 
-            /**
-             * @function
-             */
-            initVars: function () {
-                this.ajaxGenerateNonceUrl = configBraintree ? configBraintree.ajaxGenerateNonceUrl : '';
-                this.clientToken = configBraintree ? configBraintree.clientToken : '';
-                this.braintreeDataJs = configBraintree ? configBraintree.braintreeDataJs : '';
-                this.canSaveCard = configBraintree ? configBraintree.canSaveCard : false;
-                this.show3dSecure = configBraintree ? configBraintree.show3dSecure : false;
-                this.isFraudDetectionEnabled = configBraintree ? configBraintree.isFraudDetectionEnabled : false;
-                this.deviceData = '';
-                this.deviceDataElementId = '#device_data';
-                this.braintreeDataFrameLoaded = false;
-                this.isBound = false;
-                this.ccToken = '';
-                this.isPaymentProcessing = null;
-                this.braintreeClient = null;
-                this.quoteBaseGrandTotals = quote.totals()['base_grand_total'];
-            },
+                this.active(active);
 
-            /**
-             * @returns {*|String}
-             */
-            canInitialise: function () {
-                return this.clientToken;
+                return active;
             },
 
             /**
-             * @override
+             * Triggers when payment method change
+             * @param {Boolean} isActive
              */
-            initObservable: function () {
-                var self = this;
-
-                this.initVars();
-                this._super()
-                    .track('availableCcValues')
-                    .observe([
-                        'selectedCardToken',
-                        'storeInVault',
-                        'storedCards',
-                        'paymentMethodNonce',
-                        'verified'
-                    ]);
-                this.isCcFormShown = ko.computed(function () {
-
-                    return !this.useVault() ||
-                        this.selectedCardToken() === undefined ||
-                        this.selectedCardToken() === '';
-                }, this);
-
-                if (!this.braintreeDataFrameLoaded && this.isFraudDetectionEnabled) {
-                    $.getScript(this.braintreeDataJs, function () {
-                        self.braintreeDataFrameLoaded = true;
-                    });
-                }
-
-                if (this.canInitialise()) {
-                    this.braintreeClient = new braintreeClientSDK.api.Client({
-                        clientToken: this.clientToken
-                    });
-                } else {
-                    this.messageContainer.addErrorMessage({
-                        'message': $t('Can not initialize PayPal (Braintree)')
-                    });
+            onActiveChange: function (isActive) {
+                if (!isActive || this.isSingleUse()) {
+                    return;
                 }
 
-                // subscribe on billing address update
-                quote.billingAddress.subscribe(function () {
-                    self.updateAvailableTypeValues();
-                });
-
-                return this;
+                this.reInitBraintree();
             },
 
             /**
-             * Prepare and process payment information
+             * Init config
              */
-            preparePayment: function () {
-                var self = this,
-                    cardInfo = null;
-
-                if (this.validateHandler()) {
-                    this.messageContainer.clear();
-                    this.quoteBaseGrandTotals = quote.totals()['base_grand_total'];
-
-                    this.isPaymentProcessing = $.Deferred();
-                    $.when(this.isPaymentProcessing).done(
-                        function () {
-                            self.placeOrder();
-                        }
-                    ).fail(
-                        function (result) {
-                            self.handleError(result);
-                        }
-                    );
-
-                    this.getFraudAdditionalData();
-
-                    if (this.show3dSecure && this.selectedCardToken()) {
-                        this.verify3DSWithToken();
-
-                        return;
-                    }
-
-                    if (this.selectedCardToken()) {
-                        this.isPaymentProcessing.resolve();
+            initClientConfig: function () {
+                // Advanced fraud tools settings
+                if (this.hasFraudProtection()) {
+                    this.clientConfig = _.extend(this.clientConfig, this.kountConfig());
+                }
 
-                        return;
+                _.each(this.clientConfig, function (fn, name) {
+                    if (typeof fn === 'function') {
+                        this.clientConfig[name] = fn.bind(this);
                     }
-
-                    cardInfo = {
-                        number: this.creditCardNumber(),
-                        expirationMonth: this.creditCardExpMonth(),
-                        expirationYear: this.creditCardExpYear(),
-                        cvv: this.creditCardVerificationNumber()
-                    };
-                    this.braintreeClient.tokenizeCard(cardInfo, function (error, nonce) {
-                        if (error) {
-                            self.isPaymentProcessing.reject(error);
-
-                            return;
-                        }
-
-                        self.paymentMethodNonce(nonce);
-
-                        if (self.show3dSecure) {
-                            self.verify3DS();
-
-                            return;
-                        }
-
-                        self.isPaymentProcessing.resolve();
-                    });
-                }
+                }, this);
             },
 
             /**
-             * @override
+             * Create Braintree configuration
              */
-            getData: function () {
-                return {
-                    'method': this.item.method,
-                    'additional_data': {
-                        'cc_last4': this.creditCardNumber().slice(-4),
-                        'store_in_vault': this.storeInVault(),
-                        'payment_method_nonce': this.paymentMethodNonce(),
-                        'cc_token': this.selectedCardToken(),
-                        'device_data': this.deviceData,
-                        'cc_type': this.creditCardType(),
-                        'cc_exp_year': this.creditCardExpYear(),
-                        'cc_exp_month': this.creditCardExpMonth()
-                    }
-                };
+            initBraintree: function () {
+                this.initClientConfig();
+                braintree.config = _.extend(braintree.config, this.clientConfig);
             },
 
             /**
-             * Display error message on the top of the page and reset payment method nonce.
-             * @param {*} error - error message
+             * Re-init Braintree configuration
              */
-            handleError: function (error) {
-                this.paymentMethodNonce('');
-
-                if (_.isObject(error)) {
-                    this.messageContainer.addErrorMessage(error);
-                } else {
-                    this.messageContainer.addErrorMessage({
-                        message: error
-                    });
-                }
+            reInitBraintree: function () {
+                var intervalId = setInterval(function () {
+                    // stop loader when frame will be loaded
+                    if ($('#braintree-hosted-field-number').length) {
+                        clearInterval(intervalId);
+                        fullScreenLoader.stopLoader();
+                    }
+                }, 500);
+
+                fullScreenLoader.startLoader();
+                braintree.setConfig(this.clientConfig);
+                braintree.setup();
             },
 
             /**
-             * Get payment method nonce from server and perform 3DSecure card verification via braintree client.
+             * @returns {Object}
              */
-            verify3DSWithToken: function () {
-                var self = this;
-
-                //Make an ajax call to convert token to payment method nonce and use the nonce for 3dsecure verification
-                $.ajax({
-                    type: 'POST',
-                    url: self.ajaxGenerateNonceUrl,
-                    data: {
-                        token: this.selectedCardToken()
-                    },
-
-                    /**
-                     * Success callback for payment method nonce request.
-                     * @param {Object} response
-                     */
-                    success: function (response) {
-                        if (response.success) {
-                            self.paymentMethodNonce(response.nonce);
-                            self.verify3DS();
-                        } else {
-                            self.isPaymentProcessing.reject(response['error_message']);
+            kountConfig: function () {
+                var config = {
+                    dataCollector: {
+                        kount: {
+                            environment: this.getEnvironment()
                         }
                     },
 
                     /**
-                     * Error callback for payment method nonce request.
-                     * @param {*} response
+                     * Device data initialization
+                     *
+                     * @param {Object} braintreeInstance
                      */
-                    error: function (response) {
-                        self.isPaymentProcessing.reject(response);
+                    onReady: function (braintreeInstance) {
+                        this.additionalData['device_data'] = braintreeInstance.deviceData;
                     }
-                });
-            },
-
-            /**
-             * 3DSecure card verification via braintree client.
-             */
-            verify3DS: function () {
-                var self = this;
-
-                this.bind3dsecureIframe();
-                this.braintreeClient.verify3DS({
-                    amount: this.quoteBaseGrandTotals,
-                    creditCard: this.paymentMethodNonce()
-                }, function (error, response) {
-                    var liability = null;
-
-                    if (error) {
-                        self.isPaymentProcessing.reject(error);
-
-                        return;
-                    }
-                    liability = {
-                        shifted: response.verificationDetails.liabilityShifted,
-                        shiftPossible: response.verificationDetails.liabilityShiftPossible
-                    };
-
-                    if (liability.shifted || !liability.shifted && !liability.shiftPossible) {
-                        self.paymentMethodNonce(response.nonce);
-                        self.isPaymentProcessing.resolve();
-                    } else {
-                        self.paymentMethodNonce('');
-                        self.isPaymentProcessing.reject($t('Please try again with another form of payment.'));
-                    }
-                });
-            },
+                };
 
-            /**
-             * @override
-             */
-            getCode: function () {
-                return 'braintree';
-            },
+                if (this.getKountMerchantId()) {
+                    config.dataCollector.kount.merchantId = this.getKountMerchantId();
+                }
 
-            /**
-             * @returns {*}
-             */
-            useVault: function () {
-                return configBraintree ?
-                    configBraintree.useVault :
-                    false;
+                return config;
             },
 
             /**
-             * @returns {*}
-             */
-            isCcDetectionEnabled: function () {
-                return configBraintree ?
-                    configBraintree.isCcDetectionEnabled :
-                    false;
-            },
-
-            /**
-             * @returns {Array}
+             * Get full selector name
+             *
+             * @param {String} field
+             * @returns {String}
              */
-            getStoredCards: function () {
-                var availableTypes = this.getCcAvailableTypes(),
-                    storedCards = this.storedCards(),
-                    filteredCards = [],
-                    i,
-                    storedCardType;
-
-                for (i = 0; i < storedCards.length; i++) {
-                    storedCardType = storedCards[i].type;
-
-                    if (typeof availableTypes[storedCardType] != 'undefined') {
-                        filteredCards.push(storedCards[i]);
-                    }
-                }
-
-                return filteredCards;
+            getSelector: function (field) {
+                return '#' + this.getCode() + '_' + field;
             },
 
             /**
              * Get list of available CC types
+             *
+             * @returns {Object}
              */
             getCcAvailableTypes: function () {
-                var availableTypes = configBraintree.availableCardTypes,
+                var availableTypes = validator.getAvailableCardTypes(),
                     billingAddress = quote.billingAddress(),
                     billingCountryId;
 
@@ -398,13 +226,10 @@ define(
 
                 billingCountryId = billingAddress.countryId;
 
-                if (billingCountryId &&
-                    typeof configBraintree.countrySpecificCardTypes[billingCountryId] !== 'undefined'
-                ) {
+                if (billingCountryId && validator.getCountrySpecificCardTypes(billingCountryId)) {
 
-                    return this.collectTypes(
-                        availableTypes,
-                        configBraintree.countrySpecificCardTypes[billingCountryId]
+                    return validator.collectTypes(
+                        availableTypes, validator.getCountrySpecificCardTypes(billingCountryId)
                     );
                 }
 
@@ -412,74 +237,85 @@ define(
             },
 
             /**
-             * @param {Object} availableTypes
-             * @param {Object} countrySpecificCardTypes
-             * @returns {Object}
+             * @returns {Boolean}
              */
-            collectTypes: function (availableTypes, countrySpecificCardTypes) {
-                var key,
-                    filteredTypes = {};
+            hasFraudProtection: function () {
+                return window.checkoutConfig.payment[this.getCode()].hasFraudProtection;
+            },
 
-                for (key in availableTypes) {
-                    if (_.indexOf(countrySpecificCardTypes, key) !== -1) {
-                        filteredTypes[key] = availableTypes[key];
-                    }
-                }
+            /**
+             * @returns {String}
+             */
+            getEnvironment: function () {
+                return window.checkoutConfig.payment[this.getCode()].environment;
+            },
 
-                return filteredTypes;
+            /**
+             * @returns {String}
+             */
+            getKountMerchantId: function () {
+                return window.checkoutConfig.payment[this.getCode()].kountMerchantId;
             },
 
             /**
-             * @returns {exports.context}
+             * Get data
+             *
+             * @returns {Object}
              */
-            context: function () {
-                return this;
+            getData: function () {
+                var data = {
+                    'method': this.getCode(),
+                    'additional_data': {
+                        'payment_method_nonce': this.paymentMethodNonce
+                    }
+                };
+
+                data['additional_data'] = _.extend(data['additional_data'], this.additionalData);
+
+                return data;
             },
 
             /**
-             * Get fraud control token.
+             * Set payment nonce
+             * @param {String} paymentMethodNonce
              */
-            getFraudAdditionalData: function () {
-                if ($(this.deviceDataElementId).length > 0 && this.isFraudDetectionEnabled) {
-                    this.deviceData = $(this.deviceDataElementId).val();
-                }
+            setPaymentMethodNonce: function (paymentMethodNonce) {
+                this.paymentMethodNonce = paymentMethodNonce;
             },
 
             /**
-             * Fix the non-observed close button on Braintree iframe
+             * Prepare data to place order
+             * @param {Object} data
              */
-            bind3dsecureIframe: function () {
-                var self = this,
-                    $body = $('body');
-
-                if (!self.isBound) {
-                    $body.bind('DOMNodeInserted', function (e) {
-                        if (e.target.nodeName === 'IFRAME') {
-                            self.isBound = true;
-                            $('body').trigger('processStart');
-                        }
-                    });
-                    $body.bind('DOMNodeRemoved', function (e) {
-                        if (e.target.nodeName === 'IFRAME') {
-                            self.isBound = false;
-                            $('body').trigger('processStop');
-                        }
-                    });
-                }
+            beforePlaceOrder: function (data) {
+                this.setPaymentMethodNonce(data.nonce);
+                this.placeOrder();
             },
 
             /**
-             * @returns {String}
+             * Action to place order
+             * @param {String} key
              */
-            getCssClass: function () {
-                return this.isCcDetectionEnabled() ? 'field type detection' : 'field type required';
+            placeOrder: function (key) {
+                var self = this;
+
+                if (key) {
+                    return self._super();
+                }
+                // place order on success validation
+                self.validatorManager.validate(self, function () {
+                    return self.placeOrder('parent');
+                });
+
+                return false;
             },
 
             /**
-             * Update list of available CC types values
+             * Check if Braintree configured without PayPal
+             * @returns {Boolean}
              */
-            updateAvailableTypeValues: function () {
-                this.availableCcValues = this.getCcAvailableTypesValues();
+            isSingleUse: function () {
+                return window.checkoutConfig.payment[this.getCode()].isSingleUse;
             }
         });
     }
diff --git a/app/code/Magento/BraintreeTwo/view/frontend/web/js/view/payment/method-renderer/hosted-fields.js b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/hosted-fields.js
similarity index 96%
rename from app/code/Magento/BraintreeTwo/view/frontend/web/js/view/payment/method-renderer/hosted-fields.js
rename to app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/hosted-fields.js
index 5050e17aeb58437e4305014facf49c20381311a2..460031eae044af459eaf4afb103983c3ad211b2f 100644
--- a/app/code/Magento/BraintreeTwo/view/frontend/web/js/view/payment/method-renderer/hosted-fields.js
+++ b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/hosted-fields.js
@@ -7,8 +7,8 @@
 
 define([
     'jquery',
-    'Magento_BraintreeTwo/js/view/payment/method-renderer/cc-form',
-    'Magento_BraintreeTwo/js/validator',
+    'Magento_Braintree/js/view/payment/method-renderer/cc-form',
+    'Magento_Braintree/js/validator',
     'Magento_Vault/js/view/payment/vault-enabler',
     'mage/translate'
 ], function ($, Component, validator, vaultEnabler, $t) {
@@ -17,7 +17,7 @@ define([
     return Component.extend({
 
         defaults: {
-            template: 'Magento_BraintreeTwo/payment/form',
+            template: 'Magento_Braintree/payment/form',
             clientConfig: {
 
                 /**
diff --git a/app/code/Magento/BraintreeTwo/view/frontend/web/js/view/payment/method-renderer/paypal.js b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/paypal.js
similarity index 98%
rename from app/code/Magento/BraintreeTwo/view/frontend/web/js/view/payment/method-renderer/paypal.js
rename to app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/paypal.js
index 2e1c91348d22efdf4d3268e1ff8662e75c00fb68..a8c564ed6e44ba86129ca634f6b94f5c496c7258 100644
--- a/app/code/Magento/BraintreeTwo/view/frontend/web/js/view/payment/method-renderer/paypal.js
+++ b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/paypal.js
@@ -8,7 +8,7 @@ define([
     'jquery',
     'underscore',
     'Magento_Checkout/js/view/payment/default',
-    'Magento_BraintreeTwo/js/view/payment/adapter',
+    'Magento_Braintree/js/view/payment/adapter',
     'Magento_Checkout/js/model/quote',
     'Magento_Checkout/js/model/full-screen-loader'
 ], function ($, _, Component, Braintree, quote, fullScreenLoader) {
@@ -18,8 +18,8 @@ define([
 
     return Component.extend({
         defaults: {
-            template: 'Magento_BraintreeTwo/payment/paypal',
-            code: 'braintreetwo_paypal',
+            template: 'Magento_Braintree/payment/paypal',
+            code: 'braintree_paypal',
             active: false,
             paymentMethodNonce: null,
             grandTotalAmount: null,
diff --git a/app/code/Magento/BraintreeTwo/view/frontend/web/js/view/payment/method-renderer/vault.js b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/vault.js
similarity index 93%
rename from app/code/Magento/BraintreeTwo/view/frontend/web/js/view/payment/method-renderer/vault.js
rename to app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/vault.js
index d85b636722f4ef82f450bf906ab45165cd487533..4b47e4d74bd17346c1c67060cf4e40a4b414723a 100644
--- a/app/code/Magento/BraintreeTwo/view/frontend/web/js/view/payment/method-renderer/vault.js
+++ b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/vault.js
@@ -6,7 +6,7 @@
 /*global define*/
 define([
     'jquery',
-    'Magento_BraintreeTwo/js/view/payment/method-renderer/cc-form',
+    'Magento_Braintree/js/view/payment/method-renderer/cc-form',
     'Magento_Vault/js/view/payment/method-renderer/vault',
     'Magento_Ui/js/model/messageList',
     'Magento_Checkout/js/model/full-screen-loader'
@@ -17,7 +17,7 @@ define([
         defaults: {
             template: 'Magento_Vault/payment/form',
             modules: {
-                hostedFields: '${ $.parentName }.braintreetwo'
+                hostedFields: '${ $.parentName }.braintree'
             }
         },
 
@@ -26,7 +26,7 @@ define([
          * @returns {String}
          */
         getId: function () {
-            return 'braintreetwo_' + this.index;
+            return 'braintree_' + this.index;
         },
 
         /**
diff --git a/app/code/Magento/BraintreeTwo/view/frontend/web/js/view/payment/validator-handler.js b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/validator-handler.js
similarity index 97%
rename from app/code/Magento/BraintreeTwo/view/frontend/web/js/view/payment/validator-handler.js
rename to app/code/Magento/Braintree/view/frontend/web/js/view/payment/validator-handler.js
index f3c9c89ed1ed2ba7164d258e49032fb9181085ee..578f0fb1b9c800d0d7d32197e3ff6df76074dd0e 100644
--- a/app/code/Magento/BraintreeTwo/view/frontend/web/js/view/payment/validator-handler.js
+++ b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/validator-handler.js
@@ -8,7 +8,7 @@
 define([
     'jquery',
     'Magento_Ui/js/model/messageList',
-    'Magento_BraintreeTwo/js/view/payment/3d-secure'
+    'Magento_Braintree/js/view/payment/3d-secure'
 ], function ($, globalMessageList, verify3DSecure) {
     'use strict';
 
diff --git a/app/code/Magento/Braintree/view/frontend/web/template/payment/braintree-paypal-form.html b/app/code/Magento/Braintree/view/frontend/web/template/payment/braintree-paypal-form.html
deleted file mode 100644
index 683f62b9bb6248eb82fad63732dd8b213bd237c0..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/view/frontend/web/template/payment/braintree-paypal-form.html
+++ /dev/null
@@ -1,49 +0,0 @@
-<!--
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
--->
-<!-- ko if: (canInitialise())-->
-<div class="payment-method" data-bind="css: {'_active': (getCode() == isChecked())}">
-    <div class="payment-method-title field choice">
-        <input type="radio"
-               name="payment[method]"
-               class="radio"
-               data-bind="attr: {'id': getCode()}, value: getCode(), checked: isChecked, click: selectPaymentMethod, visible: isRadioButtonVisible()" />
-        <label class="label" data-bind="attr: {'for': getCode()}">
-            <span data-bind="text: getTitle()"></span>
-        </label>
-    </div>
-
-    <div class="payment-method-content">
-        <!-- ko foreach: getRegion('messages') -->
-        <!-- ko template: getTemplate() --><!-- /ko -->
-        <!--/ko-->
-        <fieldset class="fieldset" data-bind='attr: {id: "payment_form_" + getCode()}'>
-            <div data-bind="afterRender: initPayPalContainer.bind($data)"></div>
-        </fieldset>
-        <div class="checkout-agreements-block">
-            <!-- ko foreach: $parent.getRegion('before-place-order') -->
-            <!-- ko template: getTemplate() --><!-- /ko -->
-            <!--/ko-->
-        </div>
-        <!-- ko if: isValid() -->
-        <div class="actions-toolbar">
-            <div class="primary">
-                <button data-role="review-save"
-                        type="submit"
-                        data-bind="
-                        attr: {title: $t('Place Order')},
-                        enable: (getCode() == isChecked()),
-                        click: placeOrder"
-                        class="action primary checkout"
-                        disabled>
-                    <span data-bind="i18n: 'Place Order'"></span>
-                </button>
-            </div>
-        </div>
-        <!--/ko-->
-    </div>
-</div>
-<!-- /ko -->
diff --git a/app/code/Magento/Braintree/view/frontend/web/template/payment/cc-form.html b/app/code/Magento/Braintree/view/frontend/web/template/payment/cc-form.html
deleted file mode 100644
index 7cb2e61f28d706285a5966ba734a45b1d5c4cf12..0000000000000000000000000000000000000000
--- a/app/code/Magento/Braintree/view/frontend/web/template/payment/cc-form.html
+++ /dev/null
@@ -1,236 +0,0 @@
-<!--
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
--->
-<!-- ko if: (canInitialise())-->
-<div class="payment-method" data-bind="css: {'_active': (getCode() == isChecked())}">
-    <div class="payment-method-title field choice">
-        <input type="radio"
-               name="payment[method]"
-               class="radio"
-               data-bind="attr: {'id': getCode()},
-                          value: getCode(),
-                          checked: isChecked,
-                          click: selectPaymentMethod,
-                          visible: isRadioButtonVisible()"/>
-        <label class="label" data-bind="attr: {'for': getCode()}"><span data-bind="text: getTitle()"></span></label>
-    </div>
-
-    <div class="payment-method-content">
-        <!-- ko foreach: getRegion('messages') -->
-        <!-- ko template: getTemplate() --><!-- /ko -->
-        <!--/ko-->
-        <div class="payment-method-billing-address">
-            <!-- ko foreach: $parent.getRegion(getBillingAddressFormName()) -->
-                <!-- ko template: getTemplate() --><!-- /ko -->
-            <!--/ko-->
-        </div>
-
-        <form class="form" id="co-transparent-form" action="#" method="post" data-bind="mageInit: {
-            'transparent':{
-                'context': context(),
-                'gateway': getCode(),
-                'controller': getControllerName(),
-                'orderSaveUrl':getPlaceOrderUrl(),
-            }, 'validation':[]}">
-            <fieldset data-bind="attr: {class: 'fieldset payment items ccard ' + getCode(), id: 'braintree_form_cc'}">
-                <!-- ko if: (isShowLegend())-->
-                <legend class="legend"><span><!-- ko i18n: 'Credit Card Information'--><!-- /ko --></span></legend><br />
-                <!-- /ko -->
-                <!-- ko if: (useVault()) -->
-                <div>
-                    <label data-bind="attr: {for: getCode() + '_cc_token'}" class="label">
-                        <span><!-- ko i18n: 'Payment Information'--><!-- /ko --></span>
-                    </label>
-                    <div class="control">
-                        <select name="payment[cc_token]" class="select"
-                                data-bind="attr: {id: getCode() + '_cc_token', 'data-container': getCode() + '-cc-token'},
-                                            mageInit: {creditCardType:{creditCardTypeContainer:'#' + getCode() + '_cc_type_ss_div'}},
-                                            enable: true,
-                                            options: getStoredCards(),
-                                            optionsValue: 'token',
-                                            optionsText: 'maskedNumber',
-                                            optionsCaption: $t('Add new card'),
-                                            value: selectedCardToken">
-                        </select>
-                    </div>
-                </div>
-                <div>&nbsp;</div>
-                <!-- /ko -->
-                <div data-bind="visible: isCcFormShown, attr: {class: getCssClass()}">
-                    <!-- ko if: (!isCcDetectionEnabled())-->
-                    <label data-bind="attr: {for: getCode() + '_cc_type'}" class="label">
-                        <span><!-- ko i18n: 'Credit Card Type'--><!-- /ko --></span>
-                    </label>
-                    <!-- /ko -->
-                    <div class="control">
-                        <!-- ko if: (!isCcDetectionEnabled())-->
-                        <select name="payment[cc_type]" class="select"
-                                data-bind="attr: {id: getCode() + '_cc_type', 'data-container': getCode() + '-cc-type', 'data-validate': JSON.stringify({required:true, 'validate-cc-type-select':'#' + getCode() + '_cc_number'})},
-                                            mageInit: {creditCardType:{creditCardTypeContainer:'#' + getCode() + '_cc_type_ss_div'}},
-                                            enable: true,
-                                            options: availableCcValues,
-                                            optionsValue: 'value',
-                                            optionsText: 'type',
-                                            optionsCaption: $t('--Please Select--'),
-                                            value: creditCardType">
-                        </select>
-                        <!-- /ko -->
-                        <!-- ko if: (isCcDetectionEnabled())-->
-                        <ul class="credit-card-types">
-                            <!-- ko foreach: {data: availableCcValues, as: 'item'} -->
-                            <li class="item" data-bind="css: {
-                                                            _active: $parent.selectedCardType() == item.value,
-                                                            _inactive: $parent.selectedCardType() != null && $parent.selectedCardType() != item.value
-                                                            } ">
-                                <!--ko if: $parent.getIcons(item.value) -->
-                                <img data-bind="attr: {
-                                    'src': $parent.getIcons(item.value).url,
-                                    'alt': item.type,
-                                    'width': $parent.getIcons(item.value).width,
-                                    'height': $parent.getIcons(item.value).height
-                                    }">
-                                <!--/ko-->
-                            </li>
-                            <!--/ko-->
-                        </ul>
-                        <input type="hidden"
-                               name="payment[cc_type]"
-                               class="input-text"
-                               value=""
-                               data-bind="attr: {id: getCode() + '_cc_type', 'data-container': getCode() + '-cc-type'},
-                               value: creditCardType
-                               ">
-                        <!-- /ko -->
-                    </div>
-                </div>
-                <div class="field number required" data-bind="visible: isCcFormShown">
-                    <label data-bind="attr: {for: getCode() + '_cc_number'}" class="label">
-                        <span><!-- ko i18n: 'Credit Card Number'--><!-- /ko --></span>
-                    </label>
-                    <div class="control">
-                        <input type="number" name="payment[cc_number]" class="input-text" value=""
-                               data-bind="attr: {
-                                    autocomplete: off,
-                                    id: getCode() + '_cc_number',
-                                    title: $t('Credit Card Number'),
-                                    'data-container': getCode() + '-cc-number',
-                                    'data-validate': JSON.stringify({'required-number':true, 'validate-card-type':getCcAvailableTypesValues(), 'validate-card-number':'#' + getCode() + '_cc_type', 'validate-cc-type':'#' + getCode() + '_cc_type'})},
-                              enable: isActive($parents),
-                              value: creditCardNumber,
-                              valueUpdate: 'keyup' "/>
-                    </div>
-                </div>
-                <div class="field date required" data-bind="attr: {id: getCode() + '_cc_type_exp_div'}, visible: isCcFormShown">
-                    <label data-bind="attr: {for: getCode() + '_expiration'}" class="label">
-                        <span><!-- ko i18n: 'Expiration Date'--><!-- /ko --></span>
-                    </label>
-                    <div class="control">
-                        <div class="fields group group-2">
-                            <div class="field no-label month">
-                                <div class="control">
-                                    <select  name="payment[cc_exp_month]" class="select month"
-                                        data-bind="attr: {id: getCode() + '_expiration', 'data-container': getCode() + '-cc-month', 'data-validate': JSON.stringify({required:true, 'validate-cc-exp':'#' + getCode() + '_expiration_yr'})},
-                                        enable: true,
-                                        options: getCcMonthsValues(),
-                                        optionsValue: 'value',
-                                        optionsText: 'month',
-                                        optionsCaption: $t('Month'),
-                                        value: creditCardExpMonth">
-                                    </select>
-                                </div>
-                            </div>
-                            <div class="field no-label year">
-                                <div class="control">
-                                    <select name="payment[cc_exp_year]" class="select year"
-                                        data-bind="attr: {id: getCode() + '_expiration_yr', 'data-container': getCode() + '-cc-year', 'data-validate': JSON.stringify({required:true})},
-                                        enable: true,
-                                        options: getCcYearsValues(),
-                                        optionsValue: 'value',
-                                        optionsText: 'year',
-                                        optionsCaption: $t('Year'),
-                                        value: creditCardExpYear">
-                                    </select>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-                <!-- ko if: (hasVerification())-->
-                <div class="field cvv required" data-bind="attr: {id: getCode() + '_cc_type_cvv_div'}, visible: isCcFormShown">
-                    <label data-bind="attr: {for: getCode() + '_cc_cid'}" class="label">
-                        <span><!-- ko i18n: 'Card Verification Number'--><!-- /ko --></span>
-                    </label>
-                    <div class="control _with-tooltip">
-                        <input type="number"
-                               class="input-text cvv"
-                               name="payment[cc_cid]"
-                               value=""
-                               data-bind="attr: {id: getCode() + '_cc_cid',
-                               title: $t('Card Verification Number'),
-                               'data-container': getCode() + '-cc-cvv',
-                               'data-validate': JSON.stringify({'required-number':true, 'validate-cc-cvn':'#' + getCode() + '_cc_type'})},
-                               enable: true,
-                               value: creditCardVerificationNumber" />
-                        <div class="field-tooltip toggle">
-                            <span class="field-tooltip-action action-cvv"
-                                  tabindex="0"
-                                  data-toggle="dropdown"
-                                  data-bind="attr: {title: $t('What is this?')}, mageInit: {'dropdown':{'activeClass': '_active'}}">
-                                <span><!-- ko i18n: 'What is this?'--><!-- /ko --></span>
-                            </span>
-                            <div class="field-tooltip-content"
-                                 data-target="dropdown"
-                                 data-bind="html: getCvvImageHtml()"></div>
-                        </div>
-                    </div>
-                </div>
-                <!-- /ko -->
-                <!-- ko if: (canSaveCard)-->
-                <div class="field" data-bind="visible: isCcFormShown">
-                    <label class="label">
-                        <span></span>
-                    </label>
-                    <div class="control">
-                        <input type="checkbox"
-                               name="payment[store_in_vault]"
-                               id="braintree_store_in_vault"
-                               value="1"
-                               checked="checked"
-                               class="checkbox"
-                               data-bind="checked: storeInVault"/>
-                        <label class="label" for="braintree_store_in_vault">
-                            <span><!-- ko i18n: 'Save this card for future use'--><!-- /ko --></span>
-                        </label>
-                    </div>
-                </div>
-                <!-- /ko -->
-            </fieldset>
-        </form>
-
-        <div class="payment-method-content">
-            <div class="checkout-agreements-block">
-                <!-- ko foreach: $parent.getRegion('before-place-order') -->
-                <!-- ko template: getTemplate() --><!-- /ko -->
-                <!--/ko-->
-            </div>
-            <div class="actions-toolbar">
-                <div class="primary">
-                    <button class="action primary checkout"
-                            type="submit"
-                            data-bind="
-                            click: preparePayment,
-                            enable: (getCode() == isChecked()),
-                            css: {disabled: !isPlaceOrderActionAllowed()}
-                            "
-                            disabled>
-                        <span data-bind="i18n: 'Place Order'"></span>
-                    </button>
-                </div>
-            </div>
-        </div>
-    </div>
-</div>
-<!-- /ko -->
diff --git a/app/code/Magento/BraintreeTwo/view/frontend/web/template/payment/form.html b/app/code/Magento/Braintree/view/frontend/web/template/payment/form.html
similarity index 98%
rename from app/code/Magento/BraintreeTwo/view/frontend/web/template/payment/form.html
rename to app/code/Magento/Braintree/view/frontend/web/template/payment/form.html
index 68d6b63f56eab579f21d14697d215876057561ec..de073390be8c1d19d1793749192ab813d35e899d 100644
--- a/app/code/Magento/BraintreeTwo/view/frontend/web/template/payment/form.html
+++ b/app/code/Magento/Braintree/view/frontend/web/template/payment/form.html
@@ -129,7 +129,7 @@
                 </div>
                 <!-- /ko -->
             </fieldset>
-            <input type="submit" id="braintreetwo_submit"  style="display:none" />
+            <input type="submit" id="braintree_submit"  style="display:none" />
         </form>
         <div class="actions-toolbar">
             <div class="primary">
diff --git a/app/code/Magento/BraintreeTwo/view/frontend/web/template/payment/paypal.html b/app/code/Magento/Braintree/view/frontend/web/template/payment/paypal.html
similarity index 100%
rename from app/code/Magento/BraintreeTwo/view/frontend/web/template/payment/paypal.html
rename to app/code/Magento/Braintree/view/frontend/web/template/payment/paypal.html
diff --git a/app/code/Magento/BraintreeTwo/Block/Adminhtml/Form/Field/Countries.php b/app/code/Magento/BraintreeTwo/Block/Adminhtml/Form/Field/Countries.php
deleted file mode 100644
index 136bdae2b65d2325eb81ae4f13a28c7faaddc16e..0000000000000000000000000000000000000000
--- a/app/code/Magento/BraintreeTwo/Block/Adminhtml/Form/Field/Countries.php
+++ /dev/null
@@ -1,58 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\BraintreeTwo\Block\Adminhtml\Form\Field;
-
-use Magento\BraintreeTwo\Helper\Country;
-use Magento\Framework\View\Element\Context;
-use Magento\Framework\View\Element\Html\Select;
-
-/**
- * Class Countries
- */
-class Countries extends Select
-{
-    /**
-     * @var Country
-     */
-    private $countryHelper;
-
-    /**
-     * Constructor
-     *
-     * @param Context $context
-     * @param Country $countryHelper
-     * @param array $data
-     */
-    public function __construct(Context $context, Country $countryHelper, array $data = [])
-    {
-        parent::__construct($context, $data);
-        $this->countryHelper = $countryHelper;
-    }
-    
-    /**
-     * Render block HTML
-     *
-     * @return string
-     */
-    protected function _toHtml()
-    {
-        if (!$this->getOptions()) {
-            $this->setOptions($this->countryHelper->getCountries());
-        }
-        return parent::_toHtml();
-    }
-
-    /**
-     * Sets name for input element
-     * 
-     * @param string $value
-     * @return $this
-     */
-    public function setInputName($value)
-    {
-        return $this->setName($value);
-    }
-}
diff --git a/app/code/Magento/BraintreeTwo/Block/Form.php b/app/code/Magento/BraintreeTwo/Block/Form.php
deleted file mode 100644
index 128135fcf8b3ed0905d3793eb8ff04613b2c6ad0..0000000000000000000000000000000000000000
--- a/app/code/Magento/BraintreeTwo/Block/Form.php
+++ /dev/null
@@ -1,126 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\BraintreeTwo\Block;
-
-use Magento\Backend\Model\Session\Quote;
-use Magento\BraintreeTwo\Gateway\Config\Config as GatewayConfig;
-use Magento\BraintreeTwo\Model\Adminhtml\Source\CcType;
-use Magento\BraintreeTwo\Model\Ui\ConfigProvider;
-use Magento\Framework\View\Element\Template\Context;
-use Magento\Payment\Block\Form\Cc;
-use Magento\Payment\Model\Config;
-use Magento\Vault\Model\VaultPaymentInterface;
-
-/**
- * Class Form
- */
-class Form extends Cc
-{
-
-    /**
-     * @var Quote
-     */
-    protected $sessionQuote;
-
-    /**
-     * @var Config
-     */
-    protected $gatewayConfig;
-
-    /**
-     * @var CcType
-     */
-    protected $ccType;
-
-    /**
-     * @var VaultPaymentInterface
-     */
-    protected $vaultService;
-
-    /**
-     * @param Context $context
-     * @param Config $paymentConfig
-     * @param Quote $sessionQuote
-     * @param GatewayConfig $gatewayConfig
-     * @param CcType $ccType
-     * @param VaultPaymentInterface $vaultService
-     * @param array $data
-     */
-    public function __construct(
-        Context $context,
-        Config $paymentConfig,
-        Quote $sessionQuote,
-        GatewayConfig $gatewayConfig,
-        CcType $ccType,
-        VaultPaymentInterface $vaultService,
-        array $data = []
-    ) {
-        parent::__construct($context, $paymentConfig, $data);
-        $this->sessionQuote = $sessionQuote;
-        $this->gatewayConfig = $gatewayConfig;
-        $this->ccType = $ccType;
-        $this->vaultService = $vaultService;
-    }
-
-    /**
-     * Get list of available card types of order billing address country
-     * @return array
-     */
-    public function getCcAvailableTypes()
-    {
-        $configuredCardTypes = $this->getConfiguredCardTypes();
-        $countryId = $this->sessionQuote->getQuote()->getBillingAddress()->getCountryId();
-        return $this->filterCardTypesForCountry($configuredCardTypes, $countryId);
-    }
-
-    /**
-     * Check if cvv validation is available
-     * @return boolean
-     */
-    public function useCvv()
-    {
-        return $this->gatewayConfig->isCvvEnabled();
-    }
-
-    /**
-     * Check if vault enabled
-     * @return bool
-     */
-    public function isVaultEnabled()
-    {
-        return $this->vaultService->isActiveForPayment(ConfigProvider::CODE);
-    }
-
-    /**
-     * Get card types available for Braintree
-     * @return array
-     */
-    private function getConfiguredCardTypes()
-    {
-        $types = $this->ccType->getCcTypeLabelMap();
-        $configCardTypes = array_fill_keys($this->gatewayConfig->getAvailableCardTypes(), '');
-
-        return array_intersect_key($types, $configCardTypes);
-    }
-
-    /**
-     * Filter card types for specific country
-     * @param array $configCardTypes
-     * @param string $countryId
-     * @return array
-     */
-    private function filterCardTypesForCountry(array $configCardTypes, $countryId)
-    {
-        $filtered = $configCardTypes;
-        $countryCardTypes = $this->gatewayConfig->getCountryAvailableCardTypes($countryId);
-        // filter card types only if specific card types are set for country
-        if (!empty($countryCardTypes)) {
-            $availableTypes = array_fill_keys($countryCardTypes, '');
-            $filtered = array_intersect_key($filtered, $availableTypes);
-        }
-        return $filtered;
-    }
-}
diff --git a/app/code/Magento/BraintreeTwo/Block/Info.php b/app/code/Magento/BraintreeTwo/Block/Info.php
deleted file mode 100644
index 60127f446b82297cacc923198151b7a7cff86eaf..0000000000000000000000000000000000000000
--- a/app/code/Magento/BraintreeTwo/Block/Info.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\BraintreeTwo\Block;
-
-use Magento\Framework\Phrase;
-use Magento\Payment\Block\ConfigurableInfo;
-
-/**
- * Class Info
- */
-class Info extends ConfigurableInfo
-{
-    /**
-     * Returns label
-     *
-     * @param string $field
-     * @return Phrase
-     */
-    protected function getLabel($field)
-    {
-        return __($field);
-    }
-}
diff --git a/app/code/Magento/BraintreeTwo/LICENSE.txt b/app/code/Magento/BraintreeTwo/LICENSE.txt
deleted file mode 100644
index 49525fd99da9c51e6d85420266d41cb3d6b7a648..0000000000000000000000000000000000000000
--- a/app/code/Magento/BraintreeTwo/LICENSE.txt
+++ /dev/null
@@ -1,48 +0,0 @@
-
-Open Software License ("OSL") v. 3.0
-
-This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:
-
-Licensed under the Open Software License version 3.0
-
-   1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:
-
-         1. to reproduce the Original Work in copies, either alone or as part of a collective work;
-
-         2. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work;
-
-         3. to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License;
-
-         4. to perform the Original Work publicly; and
-
-         5. to display the Original Work publicly. 
-
-   2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.
-
-   3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.
-
-   4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.
-
-   5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).
-
-   6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.
-
-   7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.
-
-   8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.
-
-   9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including 'fair use' or 'fair dealing'). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).
-
-  10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.
-
-  11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.
-
-  12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.
-
-  13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.
-
-  14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
-
-  15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.
-
-  16. Modification of This License. This License is Copyright (C) 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.
\ No newline at end of file
diff --git a/app/code/Magento/BraintreeTwo/LICENSE_AFL.txt b/app/code/Magento/BraintreeTwo/LICENSE_AFL.txt
deleted file mode 100644
index 87943b95d43a5bb8736093275afe3cb8e1d93d26..0000000000000000000000000000000000000000
--- a/app/code/Magento/BraintreeTwo/LICENSE_AFL.txt
+++ /dev/null
@@ -1,48 +0,0 @@
-
-Academic Free License ("AFL") v. 3.0
-
-This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:
-
-Licensed under the Academic Free License version 3.0
-
-   1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:
-
-         1. to reproduce the Original Work in copies, either alone or as part of a collective work;
-
-         2. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work;
-
-         3. to distribute or communicate copies of the Original Work and Derivative Works to the public, under any license of your choice that does not contradict the terms and conditions, including Licensor's reserved rights and remedies, in this Academic Free License;
-
-         4. to perform the Original Work publicly; and
-
-         5. to display the Original Work publicly.
-
-   2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.
-
-   3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.
-
-   4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.
-
-   5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).
-
-   6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.
-
-   7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.
-
-   8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.
-
-   9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including "fair use" or "fair dealing"). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).
-
-  10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.
-
-  11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.
-
-  12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.
-
-  13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.
-
-  14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
-
-  15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.
-
-  16. Modification of This License. This License is Copyright © 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Academic Free License" or "AFL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.
\ No newline at end of file
diff --git a/app/code/Magento/BraintreeTwo/Observer/AddPaypalShortcuts.php b/app/code/Magento/BraintreeTwo/Observer/AddPaypalShortcuts.php
deleted file mode 100644
index f03492d74eabc5b91d9348c0ae5060eed9d502d4..0000000000000000000000000000000000000000
--- a/app/code/Magento/BraintreeTwo/Observer/AddPaypalShortcuts.php
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\BraintreeTwo\Observer;
-
-use Magento\Framework\Event\Observer;
-use Magento\Catalog\Block\ShortcutButtons;
-use Magento\Framework\Event\ObserverInterface;
-
-/**
- * Class AddPaypalShortcuts
- */
-class AddPaypalShortcuts implements ObserverInterface
-{
-    /**
-     * Block class
-     */
-    const PAYPAL_SHORTCUT_BLOCK = 'Magento\BraintreeTwo\Block\Paypal\Button';
-
-    /**
-     * Add Braintree PayPal shortcut buttons
-     *
-     * @param Observer $observer
-     * @return void
-     */
-    public function execute(Observer $observer)
-    {
-        // Remove button from catalog pages
-        if ($observer->getData('is_catalog_product')) {
-            return;
-        }
-
-        /** @var ShortcutButtons $shortcutButtons */
-        $shortcutButtons = $observer->getEvent()->getContainer();
-
-        $shortcut = $shortcutButtons->getLayout()->createBlock(self::PAYPAL_SHORTCUT_BLOCK);
-
-        $shortcutButtons->addShortcut($shortcut);
-    }
-}
diff --git a/app/code/Magento/BraintreeTwo/README.md b/app/code/Magento/BraintreeTwo/README.md
deleted file mode 100644
index e0f041d9698ff5394883cf314b36572a045584f5..0000000000000000000000000000000000000000
--- a/app/code/Magento/BraintreeTwo/README.md
+++ /dev/null
@@ -1 +0,0 @@
-Module Magento\BraintreeTwo implements integration with the Braintree payment system.
\ No newline at end of file
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Block/FormTest.php b/app/code/Magento/BraintreeTwo/Test/Unit/Block/FormTest.php
deleted file mode 100644
index 81afcab23e5eb51a37b5b5330792ef32181c132a..0000000000000000000000000000000000000000
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Block/FormTest.php
+++ /dev/null
@@ -1,174 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\BraintreeTwo\Test\Unit\Block;
-
-use Magento\Backend\Model\Session\Quote;
-use Magento\BraintreeTwo\Block\Form;
-use Magento\BraintreeTwo\Gateway\Config\Config as GatewayConfig;
-use Magento\BraintreeTwo\Model\Adminhtml\Source\CcType;
-use Magento\BraintreeTwo\Model\Ui\ConfigProvider;
-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
-use Magento\Payment\Model\Config;
-use Magento\Vault\Model\Ui\VaultConfigProvider;
-use Magento\Vault\Model\VaultPaymentInterface;
-
-/**
- * Class FormTest
- */
-class FormTest extends \PHPUnit_Framework_TestCase
-{
-    public static $baseCardTypes = [
-        'AE' => 'American Express',
-        'VI' => 'Visa',
-        'MC' => 'MasterCard',
-        'DI' => 'Discover',
-        'JBC' => 'JBC',
-        'CUP' => 'China Union Pay',
-        'MI' => 'Maestro',
-    ];
-
-    public static $configCardTypes = [
-        'AE', 'VI', 'MC', 'DI', 'JBC'
-    ];
-
-    /**
-     * @var Form
-     */
-    private $block;
-
-    /**
-     * @var Quote|\PHPUnit_Framework_MockObject_MockObject
-     */
-    private $sessionQuote;
-
-    /**
-     * @var Config|\PHPUnit_Framework_MockObject_MockObject
-     */
-    private $gatewayConfig;
-
-    /**
-     * @var CcType|\PHPUnit_Framework_MockObject_MockObject
-     */
-    private $ccType;
-
-    /**
-     * @var VaultPaymentInterface|\PHPUnit_Framework_MockObject_MockObject
-     */
-    private $vaultService;
-
-
-    protected function setUp()
-    {
-        $this->initCcTypeMock();
-        $this->initSessionQuoteMock();
-        $this->initGatewayConfigMock();
-
-        $this->vaultService = $this->getMock(VaultPaymentInterface::class);
-
-        $managerHelper = new ObjectManager($this);
-        $this->block = $managerHelper->getObject(Form::class, [
-            'paymentConfig' => $managerHelper->getObject(Config::class),
-            'sessionQuote' => $this->sessionQuote,
-            'gatewayConfig' => $this->gatewayConfig,
-            'ccType' => $this->ccType,
-            'vaultService' => $this->vaultService
-        ]);
-    }
-
-    /**
-     * @covers \Magento\BraintreeTwo\Block\Form::getCcAvailableTypes
-     * @param string $countryId
-     * @param array $availableTypes
-     * @param array $expected
-     * @dataProvider countryCardTypesDataProvider
-     */
-    public function testGetCcAvailableTypes($countryId, array $availableTypes, array $expected)
-    {
-        $this->sessionQuote->expects(static::once())
-            ->method('getCountryId')
-            ->willReturn($countryId);
-
-        $this->gatewayConfig->expects(static::once())
-            ->method('getAvailableCardTypes')
-            ->willReturn(self::$configCardTypes);
-
-        $this->gatewayConfig->expects(static::once())
-            ->method('getCountryAvailableCardTypes')
-            ->with($countryId)
-            ->willReturn($availableTypes);
-
-        $result = $this->block->getCcAvailableTypes();
-        static::assertEquals($expected, array_values($result));
-    }
-
-    /**
-     * Get country card types testing data
-     * @return array
-     */
-    public function countryCardTypesDataProvider()
-    {
-        return [
-            ['US', ['AE', 'VI'], ['American Express', 'Visa']],
-            ['UK', ['VI'], ['Visa']],
-            ['CA', ['MC'], ['MasterCard']],
-            ['UA', [], ['American Express', 'Visa', 'MasterCard', 'Discover', 'JBC']]
-        ];
-    }
-
-    public function testIsVaultEnabled()
-    {
-        $this->vaultService->expects(static::once())
-            ->method('isActiveForPayment')
-            ->with(ConfigProvider::CODE)
-            ->willReturn(true);
-
-        static::assertTrue($this->block->isVaultEnabled());
-    }
-
-    /**
-     * Create mock for credit card type
-     */
-    private function initCcTypeMock()
-    {
-        $this->ccType = $this->getMockBuilder(CcType::class)
-            ->disableOriginalConstructor()
-            ->setMethods(['getCcTypeLabelMap'])
-            ->getMock();
-
-        $this->ccType->expects(static::any())
-            ->method('getCcTypeLabelMap')
-            ->willReturn(self::$baseCardTypes);
-    }
-
-    /**
-     * Create mock for session quote
-     */
-    private function initSessionQuoteMock()
-    {
-        $this->sessionQuote = $this->getMockBuilder(Quote::class)
-            ->disableOriginalConstructor()
-            ->setMethods(['getQuote', 'getBillingAddress', 'getCountryId', '__wakeup'])
-            ->getMock();
-
-        $this->sessionQuote->expects(static::any())
-            ->method('getQuote')
-            ->willReturnSelf();
-        $this->sessionQuote->expects(static::any())
-            ->method('getBillingAddress')
-            ->willReturnSelf();
-    }
-
-    /**
-     * Create mock for gateway config
-     */
-    private function initGatewayConfigMock()
-    {
-        $this->gatewayConfig = $this->getMockBuilder(GatewayConfig::class)
-            ->disableOriginalConstructor()
-            ->setMethods(['getCountryAvailableCardTypes', 'getAvailableCardTypes'])
-            ->getMock();
-    }
-}
diff --git a/app/code/Magento/BraintreeTwo/Test/Unit/Observer/AddPaypalShortcutsTest.php b/app/code/Magento/BraintreeTwo/Test/Unit/Observer/AddPaypalShortcutsTest.php
deleted file mode 100644
index 5f4e2a7f63ca5d04e80afddb84aeaca4c8cf7ce5..0000000000000000000000000000000000000000
--- a/app/code/Magento/BraintreeTwo/Test/Unit/Observer/AddPaypalShortcutsTest.php
+++ /dev/null
@@ -1,72 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-namespace Magento\BraintreeTwo\Test\Unit\Observer;
-
-use Magento\BraintreeTwo\Block\Paypal\Button;
-use Magento\Catalog\Block\ShortcutButtons;
-use Magento\Framework\Event;
-use Magento\Framework\Event\Observer;
-use Magento\BraintreeTwo\Observer\AddPaypalShortcuts;
-use Magento\Framework\View\LayoutInterface;
-
-/**
- * Class AddPaypalShortcutsTest
- *
- * @see \Magento\BraintreeTwo\Observer\AddPaypalShortcuts
- */
-class AddPaypalShortcutsTest extends \PHPUnit_Framework_TestCase
-{
-    public function testExecute()
-    {
-        $addPaypalShortcuts = new AddPaypalShortcuts();
-
-        /** @var Observer|\PHPUnit_Framework_MockObject_MockObject $observerMock */
-        $observerMock = $this->getMockBuilder(Observer::class)
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        /** @var Event|\PHPUnit_Framework_MockObject_MockObject $eventMock */
-        $eventMock = $this->getMockBuilder(Event::class)
-            ->setMethods(['getContainer'])
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        /** @var ShortcutButtons|\PHPUnit_Framework_MockObject_MockObject $shortcutButtonsMock */
-        $shortcutButtonsMock = $this->getMockBuilder(ShortcutButtons::class)
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $layoutMock = $this->getMockBuilder(LayoutInterface::class)
-            ->getMockForAbstractClass();
-
-        $blockMock = $this->getMockBuilder(Button::class)
-            ->disableOriginalConstructor()
-            ->getMock();
-
-        $observerMock->expects(self::once())
-            ->method('getEvent')
-            ->willReturn($eventMock);
-
-        $eventMock->expects(self::once())
-            ->method('getContainer')
-            ->willReturn($shortcutButtonsMock);
-
-        $shortcutButtonsMock->expects(self::once())
-            ->method('getLayout')
-            ->willReturn($layoutMock);
-
-        $layoutMock->expects(self::once())
-            ->method('createBlock')
-            ->with(AddPaypalShortcuts::PAYPAL_SHORTCUT_BLOCK)
-            ->willReturn($blockMock);
-
-        $shortcutButtonsMock->expects(self::once())
-            ->method('addShortcut')
-            ->with($blockMock);
-
-        $addPaypalShortcuts->execute($observerMock);
-    }
-}
diff --git a/app/code/Magento/BraintreeTwo/composer.json b/app/code/Magento/BraintreeTwo/composer.json
deleted file mode 100644
index 279a75fcffa26276f4546d00eb410c32394ca01c..0000000000000000000000000000000000000000
--- a/app/code/Magento/BraintreeTwo/composer.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
-    "name": "magento/module-braintree-two",
-    "description": "N/A",
-    "require": {
-        "php": "~5.5.0|~5.6.0|~7.0.0",
-        "magento/framework": "*",
-        "magento/magento-composer-installer": "*",
-        "magento/module-config": "*",
-        "magento/module-directory": "*",
-        "magento/module-payment": "*",
-        "magento/module-checkout": "*",
-        "magento/module-sales": "*",
-        "magento/module-backend": "*",
-        "magento/module-vault": "*",
-        "magento/module-customer": "*",
-        "magento/module-catalog": "*",
-        "magento/module-quote": "*",
-        "magento/module-paypal": "*",
-        "magento/module-checkout-agreements": "*",
-        "magento/module-theme": "*",
-        "braintree/braintree_php": "3.7.0"
-    },
-    "type": "magento2-module",
-    "version": "100.0.2",
-    "license": [
-        "proprietary"
-    ],
-    "autoload": {
-        "files": [
-            "registration.php"
-        ],
-        "psr-4": {
-            "Magento\\BraintreeTwo\\": ""
-        }
-    }
-}
diff --git a/app/code/Magento/BraintreeTwo/etc/adminhtml/system.xml b/app/code/Magento/BraintreeTwo/etc/adminhtml/system.xml
deleted file mode 100644
index 53925f8e54d30f7500232321e2d8d931e47decc1..0000000000000000000000000000000000000000
--- a/app/code/Magento/BraintreeTwo/etc/adminhtml/system.xml
+++ /dev/null
@@ -1,220 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
--->
-<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
-    <system>
-        <section id="payment">
-            <group id="braintreetwo_section" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
-                <label>BraintreeTwo</label>
-                <comment><![CDATA[Accept credit/debit cards and PayPal in your Magento store. No setup or monthly fees and your customers never leave your store to complete the purchase.]]></comment>
-                <attribute type="expanded">1</attribute>
-                <fieldset_css>complex braintree-section</fieldset_css>
-                <frontend_model>Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Group</frontend_model>
-                <group id="braintreetwo" translate="label" type="text" sortOrder="25" showInDefault="1" showInWebsite="1" showInStore="1">
-                    <label><![CDATA[&nbsp;]]></label>
-                    <frontend_model>Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Payment</frontend_model>
-                    <attribute type="activity_path">payment/braintreetwo/active</attribute>
-                    <field id="active" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0">
-                        <label>Enable this Solution</label>
-                        <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
-                        <config_path>payment/braintreetwo/active</config_path>
-                        <requires>
-                            <group id="braintreetwo_required"/>
-                        </requires>
-                    </field>
-                    <field id="active_braintreetwo_paypal" translate="label" type="select" sortOrder="11" showInDefault="1" showInWebsite="1" showInStore="0">
-                        <label>Enable PayPal through Braintree</label>
-                        <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
-                        <config_path>payment/braintreetwo_paypal/active</config_path>
-                        <requires>
-                            <group id="braintreetwo_required"/>
-                        </requires>
-                    </field>
-                    <group id="braintreetwo_required" translate="label" showInDefault="1" showInWebsite="1" sortOrder="5">
-                        <comment><![CDATA[<a href="https://www.braintreegateway.com/login" target="_blank">Click here to login to your existing Braintree account</a>. Or to setup a new account and accept payments on your website, <a href="https://apply.braintreegateway.com/signup/us" target="_blank">click here to signup for a Braintree account</a>.]]></comment>
-                        <label>Basic BraintreeTwo Settings</label>
-                        <attribute type="expanded">1</attribute>
-                        <frontend_model>Magento\Config\Block\System\Config\Form\Fieldset</frontend_model>
-                        <field id="title" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
-                            <label>Title</label>
-                            <config_path>payment/braintreetwo/title</config_path>
-                        </field>
-                        <field id="environment" translate="label" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Environment</label>
-                            <source_model>Magento\BraintreeTwo\Model\Adminhtml\Source\Environment</source_model>
-                            <config_path>payment/braintreetwo/environment</config_path>
-                        </field>
-                        <field id="payment_action" translate="label" type="select" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Payment Action</label>
-                            <source_model>Magento\BraintreeTwo\Model\Adminhtml\Source\PaymentAction</source_model>
-                            <config_path>payment/braintreetwo/payment_action</config_path>
-                        </field>
-                        <field id="merchant_id" translate="label" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Merchant ID</label>
-                            <config_path>payment/braintreetwo/merchant_id</config_path>
-                        </field>
-                        <field id="public_key" translate="label" type="obscure" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Public Key</label>
-                            <config_path>payment/braintreetwo/public_key</config_path>
-                            <backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
-                        </field>
-                        <field id="private_key" translate="label" type="obscure" sortOrder="110" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Private Key</label>
-                            <config_path>payment/braintreetwo/private_key</config_path>
-                            <backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
-                        </field>
-                    </group>
-                    <group id="braintreetwo_advanced" translate="label" showInDefault="1" showInWebsite="1" sortOrder="20">
-                        <label>Advanced Braintree Settings</label>
-                        <frontend_model>Magento\Config\Block\System\Config\Form\Fieldset</frontend_model>
-                        <field id="merchant_account_id" translate="label" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Merchant Account ID</label>
-                            <comment>If you don't specify the merchant account to use to process a transaction, Braintree will process it using your default merchant account.</comment>
-                            <config_path>payment/braintreetwo/merchant_account_id</config_path>
-                        </field>
-                        <field id="fraud_protection" translate="label" type="select" sortOrder="34" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Advanced Fraud Protection</label>
-                            <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
-                            <comment>Be sure to Enable Advanced Fraud Protection in Your Braintree Account in Settings/Processing Section</comment>
-                            <config_path>payment/braintreetwo/fraud_protection</config_path>
-                        </field>
-                        <field id="kount_merchant_id" translate="label" sortOrder="35" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Kount Merchant ID</label>
-                            <comment><![CDATA[Used for direct fraud tool integration. Make sure you also contact <a href="mailto:accounts@braintreepayments.com">accounts@braintreepayments.com</a> to setup your Kount account.]]></comment>
-                            <depends>
-                                <field id="fraud_protection">1</field>
-                            </depends>
-                            <config_path>payment/braintreetwo/kount_merchant_id</config_path>
-                        </field>
-                        <field id="debug" translate="label" type="select" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Debug</label>
-                            <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
-                            <config_path>payment/braintreetwo/debug</config_path>
-                        </field>
-                        <field id="useccv" translate="label" type="select" sortOrder="150" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>CVV Verification</label>
-                            <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
-                            <comment>Be sure to Enable AVS and/or CVV in Your Braintree Account in Settings/Processing Section.</comment>
-                            <config_path>payment/braintreetwo/useccv</config_path>
-                        </field>
-                        <field id="cctypes" translate="label" type="multiselect" sortOrder="160" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Credit Card Types</label>
-                            <source_model>Magento\BraintreeTwo\Model\Adminhtml\Source\CcType</source_model>
-                            <config_path>payment/braintreetwo/cctypes</config_path>
-                        </field>
-                        <field id="sort_order" translate="label" type="text" sortOrder="230" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Sort Order</label>
-                            <frontend_class>validate-number</frontend_class>
-                            <config_path>payment/braintreetwo/sort_order</config_path>
-                        </field>
-                    </group>
-                    <group id="braintreetwo_country_specific" translate="label" showInDefault="1" showInWebsite="1" sortOrder="30">
-                        <label>Country Specific Settings</label>
-                        <frontend_model>Magento\Config\Block\System\Config\Form\Fieldset</frontend_model>
-                        <field id="allowspecific" translate="label" type="allowspecific" sortOrder="200" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Payment from Applicable Countries</label>
-                            <source_model>Magento\Payment\Model\Config\Source\Allspecificcountries</source_model>
-                            <config_path>payment/braintreetwo/allowspecific</config_path>
-                        </field>
-                        <field id="specificcountry" translate="label" type="multiselect" sortOrder="210" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Payment from Specific Countries</label>
-                            <source_model>Magento\BraintreeTwo\Model\Adminhtml\System\Config\Country</source_model>
-                            <can_be_empty>1</can_be_empty>
-                            <config_path>payment/braintreetwo/specificcountry</config_path>
-                        </field>
-                        <field id="countrycreditcard" translate="label" sortOrder="220" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Country Specific Credit Card Types</label>
-                            <frontend_model>Magento\BraintreeTwo\Block\Adminhtml\Form\Field\CountryCreditCard</frontend_model>
-                            <backend_model>Magento\BraintreeTwo\Model\Adminhtml\System\Config\CountryCreditCard</backend_model>
-                            <config_path>payment/braintreetwo/countrycreditcard</config_path>
-                        </field>
-                    </group>
-                    <group id="braintreetwo_paypal" translate="label" showInDefault="1" showInWebsite="1" sortOrder="40">
-                        <label>PayPal through Braintree</label>
-                        <frontend_model>Magento\Config\Block\System\Config\Form\Fieldset</frontend_model>
-                        <field id="title" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
-                            <label>Title</label>
-                            <config_path>payment/braintreetwo_paypal/title</config_path>
-                            <comment>It is recommended to set this value to "PayPal" per store views.</comment>
-                        </field>
-                        <field id="sort_order" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Sort Order</label>
-                            <frontend_class>validate-number</frontend_class>
-                            <config_path>payment/braintreetwo_paypal/sort_order</config_path>
-                        </field>
-                        <field id="merchant_name_override" translate="label" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
-                            <label>Override Merchant Name</label>
-                            <config_path>payment/braintreetwo_paypal/merchant_name_override</config_path>
-                        </field>
-                        <field id="payment_action" translate="label" type="select" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Payment Action</label>
-                            <source_model>Magento\BraintreeTwo\Model\Adminhtml\Source\PaymentAction</source_model>
-                            <config_path>payment/braintreetwo_paypal/payment_action</config_path>
-                        </field>
-                        <field id="allowspecific" translate="label" type="allowspecific" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Payment from Applicable Countries</label>
-                            <source_model>Magento\Payment\Model\Config\Source\Allspecificcountries</source_model>
-                            <config_path>payment/braintreetwo_paypal/allowspecific</config_path>
-                        </field>
-                        <field id="specificcountry" translate="label" type="multiselect" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Payment from Specific Countries</label>
-                            <source_model>Magento\BraintreeTwo\Model\Adminhtml\System\Config\Country</source_model>
-                            <can_be_empty>1</can_be_empty>
-                            <config_path>payment/braintreetwo_paypal/specificcountry</config_path>
-                        </field>
-                        <field id="require_billing_address" translate="label" type="select" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Require Customer's Billing Address</label>
-                            <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
-                            <config_path>payment/braintreetwo_paypal/require_billing_address</config_path>
-                            <comment>This feature needs be enabled first for the merchant account through PayPal technical support.</comment>
-                        </field>
-                        <field id="allow_shipping_address_override" translate="label" type="select" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Allow to Edit Shipping Address Entered During Checkout on PayPal Side</label>
-                            <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
-                            <config_path>payment/braintreetwo_paypal/allow_shipping_address_override</config_path>
-                        </field>
-                        <field id="debug" translate="label" type="select" sortOrder="110" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Debug</label>
-                            <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
-                            <config_path>payment/braintreetwo_paypal/debug</config_path>
-                        </field>
-                        <field id="display_on_shopping_cart" translate="label" type="select" sortOrder="120" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Display on Shopping Cart</label>
-                            <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
-                            <config_path>payment/braintreetwo_paypal/display_on_shopping_cart</config_path>
-                            <comment>Also affects mini-shopping cart.</comment>
-                        </field>
-                    </group>
-                    <group id="braintreetwo_3dsecure" translate="label" showInDefault="1" showInWebsite="1" sortOrder="41">
-                        <label>3D Secure Verification Settings</label>
-                        <frontend_model>Magento\Config\Block\System\Config\Form\Fieldset</frontend_model>
-                        <field id="verify_3dsecure" translate="label" type="select" sortOrder="150" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>3D Secure Verification</label>
-                            <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
-                            <config_path>payment/braintreetwo/verify_3dsecure</config_path>
-                        </field>
-                        <field id="threshold_amount" translate="label" type="text" sortOrder="151" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Threshold Amount</label>
-                            <config_path>payment/braintreetwo/threshold_amount</config_path>
-                        </field>
-                        <field id="allowspecific" translate="label" type="allowspecific" sortOrder="152" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Verify for Applicable Countries</label>
-                            <source_model>Magento\Payment\Model\Config\Source\Allspecificcountries</source_model>
-                            <config_path>payment/braintreetwo/verify_all_countries</config_path>
-                        </field>
-                        <field id="specificcountry" translate="label" type="multiselect" sortOrder="153" showInDefault="1" showInWebsite="1" showInStore="0">
-                            <label>Verify for Specific Countries</label>
-                            <source_model>Magento\BraintreeTwo\Model\Adminhtml\System\Config\Country</source_model>
-                            <can_be_empty>1</can_be_empty>
-                            <config_path>payment/braintreetwo/verify_specific_countries</config_path>
-                        </field>
-                    </group>
-                </group>
-            </group>
-        </section>
-    </system>
-</config>
diff --git a/app/code/Magento/BraintreeTwo/etc/config.xml b/app/code/Magento/BraintreeTwo/etc/config.xml
deleted file mode 100644
index f8b5f868d3c8b7871beda51b41b52ff1e68599b0..0000000000000000000000000000000000000000
--- a/app/code/Magento/BraintreeTwo/etc/config.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
--->
-<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
-    <default>
-        <payment>
-            <braintreetwo>
-                <model>BraintreeTwoFacade</model>
-                <title>Credit Card (BraintreeTwo)</title>
-                <payment_action>authorize</payment_action>
-                <active>0</active>
-                <is_gateway>1</is_gateway>
-                <can_use_checkout>1</can_use_checkout>
-                <can_authorize>1</can_authorize>
-                <can_capture>1</can_capture>
-                <can_capture_partial>1</can_capture_partial>
-                <can_authorize_vault>1</can_authorize_vault>
-                <can_capture_vault>1</can_capture_vault>
-                <can_use_internal>1</can_use_internal>
-                <can_refund_partial_per_invoice>1</can_refund_partial_per_invoice>
-                <can_refund>1</can_refund>
-                <can_void>1</can_void>
-                <can_cancel>1</can_cancel>
-                <cctypes>AE,VI,MC,DI,JCB,CUP,DN,MI</cctypes>
-                <useccv>1</useccv>
-                <cctypes_braintree_mapper><![CDATA[{"american-express":"AE","discover":"DI","jcb":"JCB","mastercard":"MC","master-card":"MC","visa":"VI","maestro":"MI","diners-club":"DN","unionpay":"CUP"}]]></cctypes_braintree_mapper>
-                <order_status>processing</order_status>
-                <environment>sandbox</environment>
-                <allowspecific>0</allowspecific>
-                <sdk_url><![CDATA[https://js.braintreegateway.com/js/braintree-2.17.6.min.js]]></sdk_url>
-                <public_key backend_model="Magento\Config\Model\Config\Backend\Encrypted" />
-                <private_key backend_model="Magento\Config\Model\Config\Backend\Encrypted" />
-                <masked_fields>cvv,number</masked_fields>
-                <privateInfoKeys>avsPostalCodeResponseCode,avsStreetAddressResponseCode,cvvResponseCode,processorAuthorizationCode,processorResponseCode,processorResponseText,liabilityShifted,liabilityShiftPossible,riskDataId,riskDataDecision</privateInfoKeys>
-                <paymentInfoKeys>cc_type,cc_number,avsPostalCodeResponseCode,avsStreetAddressResponseCode,cvvResponseCode,processorAuthorizationCode,processorResponseCode,processorResponseText,liabilityShifted,liabilityShiftPossible,riskDataId,riskDataDecision</paymentInfoKeys>
-            </braintreetwo>
-            <braintreetwo_paypal>
-                <model>BraintreeTwoPayPalFacade</model>
-                <title>PayPal (Braintree)</title>
-                <active>0</active>
-                <payment_action>authorize</payment_action>
-                <allowspecific>0</allowspecific>
-                <require_billing_address>0</require_billing_address>
-                <allow_shipping_address_override>1</allow_shipping_address_override>
-                <display_on_shopping_cart>1</display_on_shopping_cart>
-                <order_status>processing</order_status>
-                <is_gateway>1</is_gateway>
-                <can_use_checkout>1</can_use_checkout>
-                <can_authorize>1</can_authorize>
-                <can_capture>1</can_capture>
-                <can_capture_partial>1</can_capture_partial>
-                <can_refund>1</can_refund>
-                <can_refund_partial_per_invoice>1</can_refund_partial_per_invoice>
-                <can_void>1</can_void>
-                <can_cancel>1</can_cancel>
-                <privateInfoKeys>processorResponseCode,processorResponseText,paymentId</privateInfoKeys>
-                <paymentInfoKeys>processorResponseCode,processorResponseText,paymentId,payerEmail</paymentInfoKeys>
-            </braintreetwo_paypal>
-        </payment>
-    </default>
-</config>
diff --git a/app/code/Magento/BraintreeTwo/etc/di.xml b/app/code/Magento/BraintreeTwo/etc/di.xml
deleted file mode 100644
index c3b62fcbd87f211b9b1c9775269bb423d36e0005..0000000000000000000000000000000000000000
--- a/app/code/Magento/BraintreeTwo/etc/di.xml
+++ /dev/null
@@ -1,408 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
--->
-<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
-    <!-- Payment Method Facade configuration -->
-    <virtualType name="BraintreeTwoFacade" type="Magento\Payment\Model\Method\Adapter">
-        <arguments>
-            <argument name="code" xsi:type="const">Magento\BraintreeTwo\Model\Ui\ConfigProvider::CODE</argument>
-            <argument name="formBlockType" xsi:type="string">Magento\BraintreeTwo\Block\Form</argument>
-            <argument name="infoBlockType" xsi:type="string">Magento\BraintreeTwo\Block\Info</argument>
-            <argument name="valueHandlerPool" xsi:type="object">BraintreeTwoValueHandlerPool</argument>
-            <argument name="validatorPool" xsi:type="object">BraintreeTwoValidatorPool</argument>
-            <argument name="commandPool" xsi:type="object">BraintreeTwoCommandPool</argument>
-        </arguments>
-    </virtualType>
-    <virtualType name="BraintreeTwoPayPalFacade" type="BraintreeTwoFacade">
-        <arguments>
-            <argument name="code" xsi:type="const">Magento\BraintreeTwo\Model\Ui\ConfigProvider::PAYPAL_CODE</argument>
-            <argument name="infoBlockType" xsi:type="string">BraintreeTwoPayPalInfo</argument>
-            <argument name="valueHandlerPool" xsi:type="object">BraintreeTwoPayPalValueHandlerPool</argument>
-            <argument name="commandPool" xsi:type="object">BraintreeTwoPayPalCommandPool</argument>
-        </arguments>
-    </virtualType>
-
-    <!-- Configuration reader -->
-    <type name="Magento\BraintreeTwo\Gateway\Config\Config">
-        <arguments>
-            <argument name="methodCode" xsi:type="const">Magento\BraintreeTwo\Model\Ui\ConfigProvider::CODE</argument>
-        </arguments>
-    </type>
-    <type name="Magento\BraintreeTwo\Gateway\Config\PayPal\Config">
-        <arguments>
-            <argument name="methodCode" xsi:type="const">Magento\BraintreeTwo\Model\Ui\ConfigProvider::PAYPAL_CODE</argument>
-        </arguments>
-    </type>
-
-    <!-- Logger, initialized with BraintreeConfig -->
-    <virtualType name="BraintreeTwoLogger" type="Magento\Payment\Model\Method\Logger">
-        <arguments>
-            <argument name="config" xsi:type="object">Magento\BraintreeTwo\Gateway\Config\Config</argument>
-        </arguments>
-    </virtualType>
-
-    <!-- Commands infrastructure -->
-    <virtualType name="BraintreeTwoCommandPool" type="Magento\Payment\Gateway\Command\CommandPool">
-        <arguments>
-            <argument name="commands" xsi:type="array">
-                <item name="authorize" xsi:type="string">BraintreeTwoAuthorizeCommand</item>
-                <item name="sale" xsi:type="string">BraintreeTwoSaleCommand</item>
-                <item name="capture" xsi:type="string">BraintreeTwoCaptureStrategyCommand</item>
-                <item name="settlement" xsi:type="string">BraintreeTwoCaptureCommand</item>
-                <item name="vault_authorize" xsi:type="string">BraintreeTwoVaultAuthorizeCommand</item>
-                <item name="vault_sale" xsi:type="string">BraintreeTwoVaultSaleCommand</item>
-                <item name="vault_capture" xsi:type="string">BraintreeTwoVaultCaptureCommand</item>
-                <item name="void" xsi:type="string">BraintreeTwoVoidCommand</item>
-                <item name="refund" xsi:type="string">BraintreeTwoRefundCommand</item>
-                <item name="cancel" xsi:type="string">BraintreeTwoVoidCommand</item>
-            </argument>
-        </arguments>
-    </virtualType>
-    <virtualType name="BraintreeTwoPayPalCommandPool" type="Magento\Payment\Gateway\Command\CommandPool">
-        <arguments>
-            <argument name="commands" xsi:type="array">
-                <item name="authorize" xsi:type="string">BraintreeTwoPayPalAuthorizeCommand</item>
-                <item name="sale" xsi:type="string">BraintreeTwoPayPalSaleCommand</item>
-                <item name="capture" xsi:type="string">BraintreeTwoPayPalCaptureStrategyCommand</item>
-                <item name="settlement" xsi:type="string">BraintreeTwoCaptureCommand</item>
-                <item name="void" xsi:type="string">BraintreeTwoVoidCommand</item>
-                <item name="refund" xsi:type="string">BraintreeTwoRefundCommand</item>
-                <item name="cancel" xsi:type="string">BraintreeTwoVoidCommand</item>
-            </argument>
-        </arguments>
-    </virtualType>
-
-    <virtualType name="BraintreeTwoCommandManager" type="Magento\Payment\Gateway\Command\CommandManager">
-        <arguments>
-            <argument name="commandPool" xsi:type="object">BraintreeTwoCommandPool</argument>
-        </arguments>
-    </virtualType>
-
-    <type name="Magento\Payment\Gateway\Command\CommandManagerPool">
-        <arguments>
-            <argument name="executors" xsi:type="array">
-                <item name="braintreetwo" xsi:type="string">BraintreeTwoCommandManager</item>
-            </argument>
-        </arguments>
-    </type>
-
-    <virtualType name="BraintreeTwoCaptureStrategyCommand" type="Magento\BraintreeTwo\Gateway\Command\CaptureStrategyCommand">
-        <arguments>
-            <argument name="commandPool" xsi:type="object">BraintreeTwoCommandPool</argument>
-        </arguments>
-    </virtualType>
-    <virtualType name="BraintreeTwoPayPalCaptureStrategyCommand" type="Magento\BraintreeTwo\Gateway\Command\CaptureStrategyCommand">
-        <arguments>
-            <argument name="commandPool" xsi:type="object">BraintreeTwoPayPalCommandPool</argument>
-        </arguments>
-    </virtualType>
-
-    <!-- Authorization command  -->
-    <virtualType name="BraintreeTwoAuthorizeCommand" type="Magento\Payment\Gateway\Command\GatewayCommand">
-        <arguments>
-            <argument name="requestBuilder" xsi:type="object">BraintreeTwoAuthorizeRequest</argument>
-            <argument name="transferFactory" xsi:type="object">Magento\BraintreeTwo\Gateway\Http\TransferFactory</argument>
-            <argument name="client" xsi:type="object">Magento\BraintreeTwo\Gateway\Http\Client\TransactionSale</argument>
-            <argument name="handler" xsi:type="object">BraintreeTwoAuthorizationHandler</argument>
-            <argument name="validator" xsi:type="object">Magento\BraintreeTwo\Gateway\Validator\ResponseValidator</argument>
-        </arguments>
-    </virtualType>
-    <virtualType name="BraintreeTwoAuthorizeRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
-        <arguments>
-            <argument name="builders" xsi:type="array">
-                <item name="customer" xsi:type="string">Magento\BraintreeTwo\Gateway\Request\CustomerDataBuilder</item>
-                <item name="payment" xsi:type="string">Magento\BraintreeTwo\Gateway\Request\PaymentDataBuilder</item>
-                <item name="address" xsi:type="string">Magento\BraintreeTwo\Gateway\Request\AddressDataBuilder</item>
-                <item name="vault" xsi:type="string">Magento\BraintreeTwo\Gateway\Request\VaultDataBuilder</item>
-                <item name="3dsecure" xsi:type="string">Magento\BraintreeTwo\Gateway\Request\ThreeDSecureDataBuilder</item>
-                <item name="kount" xsi:type="string">Magento\BraintreeTwo\Gateway\Request\KountPaymentDataBuilder</item>
-            </argument>
-        </arguments>
-    </virtualType>
-
-    <!-- Vault Authorization command -->
-    <virtualType name="BraintreeTwoVaultAuthorizeCommand" type="Magento\Payment\Gateway\Command\GatewayCommand">
-        <arguments>
-            <argument name="requestBuilder" xsi:type="object">BraintreeTwoVaultAuthorizeRequest</argument>
-            <argument name="transferFactory" xsi:type="object">Magento\BraintreeTwo\Gateway\Http\TransferFactory</argument>
-            <argument name="client" xsi:type="object">Magento\BraintreeTwo\Gateway\Http\Client\TransactionSale</argument>
-            <argument name="handler" xsi:type="object">BraintreeTwoVaultResponseHandler</argument>
-            <argument name="validator" xsi:type="object">Magento\BraintreeTwo\Gateway\Validator\ResponseValidator</argument>
-        </arguments>
-    </virtualType>
-    <virtualType name="BraintreeTwoVaultAuthorizeRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
-        <arguments>
-            <argument name="builders" xsi:type="array">
-                <item name="customer" xsi:type="string">Magento\BraintreeTwo\Gateway\Request\CustomerDataBuilder</item>
-                <item name="payment" xsi:type="string">Magento\BraintreeTwo\Gateway\Request\PaymentDataBuilder</item>
-                <item name="address" xsi:type="string">Magento\BraintreeTwo\Gateway\Request\AddressDataBuilder</item>
-                <item name="3dsecure" xsi:type="string">Magento\BraintreeTwo\Gateway\Request\ThreeDSecureDataBuilder</item>
-                <item name="kount" xsi:type="string">Magento\BraintreeTwo\Gateway\Request\KountPaymentDataBuilder</item>
-            </argument>
-        </arguments>
-    </virtualType>
-
-    <!-- PayPal Authorization command -->
-    <virtualType name="BraintreeTwoPayPalAuthorizeCommand" type="BraintreeTwoAuthorizeCommand">
-        <arguments>
-            <argument name="requestBuilder" xsi:type="object">BraintreeTwoPayPalAuthorizeRequest</argument>
-            <argument name="handler" xsi:type="object">BraintreeTwoPayPalResponseHandler</argument>
-        </arguments>
-    </virtualType>
-    <virtualType name="BraintreeTwoPayPalAuthorizeRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
-        <arguments>
-            <argument name="builders" xsi:type="array">
-                <item name="customer" xsi:type="string">Magento\BraintreeTwo\Gateway\Request\CustomerDataBuilder</item>
-                <item name="payment" xsi:type="string">Magento\BraintreeTwo\Gateway\Request\PaymentDataBuilder</item>
-            </argument>
-        </arguments>
-    </virtualType>
-
-    <type name="Magento\BraintreeTwo\Gateway\Http\Client\TransactionSale">
-        <arguments>
-            <argument name="customLogger" xsi:type="object">BraintreeTwoLogger</argument>
-        </arguments>
-    </type>
-    <type name="Magento\BraintreeTwo\Gateway\Http\Client\TransactionSubmitForSettlement">
-        <arguments>
-            <argument name="customLogger" xsi:type="object">BraintreeTwoLogger</argument>
-        </arguments>
-    </type>
-    <type name="Magento\BraintreeTwo\Gateway\Http\Client\TransactionRefund">
-        <arguments>
-            <argument name="customLogger" xsi:type="object">BraintreeTwoLogger</argument>
-        </arguments>
-    </type>
-    <type name="Magento\BraintreeTwo\Gateway\Http\Client\TransactionVoid">
-        <arguments>
-            <argument name="customLogger" xsi:type="object">BraintreeTwoLogger</argument>
-        </arguments>
-    </type>
-
-    <!-- Authorization&Capture command  -->
-    <virtualType name="BraintreeTwoSaleCommand" type="BraintreeTwoAuthorizeCommand">
-        <arguments>
-            <argument name="requestBuilder" xsi:type="object">BraintreeTwoSaleRequest</argument>
-        </arguments>
-    </virtualType>
-    <virtualType name="BraintreeTwoSaleRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
-        <arguments>
-            <argument name="builders" xsi:type="array">
-                <item name="authorize" xsi:type="string">BraintreeTwoAuthorizeRequest</item>
-                <item name="settlement" xsi:type="string">Magento\BraintreeTwo\Gateway\Request\SettlementDataBuilder</item>
-            </argument>
-        </arguments>
-    </virtualType>
-    <!-- Vault Authorization&Capture command -->
-    <virtualType name="BraintreeTwoVaultSaleCommand" type="BraintreeTwoVaultAuthorizeCommand">
-        <arguments>
-            <argument name="requestBuilder" xsi:type="object">BraintreeTwoVaultSaleRequest</argument>
-        </arguments>
-    </virtualType>
-    <virtualType name="BraintreeTwoVaultSaleRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
-        <arguments>
-            <argument name="builders" xsi:type="array">
-                <item name="authorize" xsi:type="string">BraintreeTwoVaultAuthorizeRequest</item>
-                <item name="settlement" xsi:type="string">Magento\BraintreeTwo\Gateway\Request\SettlementDataBuilder</item>
-            </argument>
-        </arguments>
-    </virtualType>
-    <!-- PayPal Authorization&Capture command -->
-    <virtualType name="BraintreeTwoPayPalSaleCommand" type="BraintreeTwoPayPalAuthorizeCommand">
-        <arguments>
-            <argument name="requestBuilder" xsi:type="object">BraintreeTwoPayPalSaleRequest</argument>
-        </arguments>
-    </virtualType>
-    <virtualType name="BraintreeTwoPayPalSaleRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
-        <arguments>
-            <argument name="builders" xsi:type="array">
-                <item name="authorize" xsi:type="string">BraintreeTwoPayPalAuthorizeRequest</item>
-                <item name="settlement" xsi:type="string">Magento\BraintreeTwo\Gateway\Request\SettlementDataBuilder</item>
-            </argument>
-        </arguments>
-    </virtualType>
-
-    <!-- Capture command  -->
-    <virtualType name="BraintreeTwoCaptureCommand" type="Magento\Payment\Gateway\Command\GatewayCommand">
-        <arguments>
-            <argument name="requestBuilder" xsi:type="object">BraintreeTwoCaptureRequest</argument>
-            <argument name="transferFactory" xsi:type="object">Magento\BraintreeTwo\Gateway\Http\TransferFactory</argument>
-            <argument name="client" xsi:type="object">Magento\BraintreeTwo\Gateway\Http\Client\TransactionSubmitForSettlement</argument>
-            <argument name="handler" xsi:type="object">Magento\BraintreeTwo\Gateway\Response\TransactionIdHandler</argument>
-            <argument name="validator" xsi:type="object">Magento\BraintreeTwo\Gateway\Validator\ResponseValidator</argument>
-        </arguments>
-    </virtualType>
-    <virtualType name="BraintreeTwoCaptureRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
-        <arguments>
-            <argument name="builders" xsi:type="array">
-                <item name="capture" xsi:type="string">Magento\BraintreeTwo\Gateway\Request\CaptureDataBuilder</item>
-            </argument>
-        </arguments>
-    </virtualType>
-
-    <!-- Vault Capture (Sale actually) command -->
-    <virtualType name="BraintreeTwoVaultCaptureCommand" type="Magento\Payment\Gateway\Command\GatewayCommand">
-        <arguments>
-            <argument name="requestBuilder" xsi:type="object">BraintreeTwoVaultCaptureRequest</argument>
-            <argument name="transferFactory" xsi:type="object">Magento\BraintreeTwo\Gateway\Http\TransferFactory</argument>
-            <argument name="client" xsi:type="object">Magento\BraintreeTwo\Gateway\Http\Client\TransactionSale</argument>
-            <argument name="handler" xsi:type="object">Magento\BraintreeTwo\Gateway\Response\TransactionIdHandler</argument>
-            <argument name="validator" xsi:type="object">Magento\BraintreeTwo\Gateway\Validator\ResponseValidator</argument>
-        </arguments>
-    </virtualType>
-    <virtualType name="BraintreeTwoVaultCaptureRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
-        <arguments>
-            <argument name="builders" xsi:type="array">
-                <item name="vault_capture" xsi:type="string">Magento\BraintreeTwo\Gateway\Request\VaultCaptureDataBuilder</item>
-                <item name="settlement" xsi:type="string">Magento\BraintreeTwo\Gateway\Request\SettlementDataBuilder</item>
-            </argument>
-        </arguments>
-    </virtualType>
-    
-    <!-- Value handlers infrastructure -->
-    <virtualType name="BraintreeTwoValueHandlerPool" type="Magento\Payment\Gateway\Config\ValueHandlerPool">
-        <arguments>
-            <argument name="handlers" xsi:type="array">
-                <item name="default" xsi:type="string">BraintreeTwoConfigValueHandler</item>
-                <item name="can_void" xsi:type="string">Magento\BraintreeTwo\Gateway\Config\CanVoidHandler</item>
-                <item name="can_cancel" xsi:type="string">Magento\BraintreeTwo\Gateway\Config\CanVoidHandler</item>
-            </argument>
-        </arguments>
-    </virtualType>
-    <virtualType name="BraintreeTwoConfigValueHandler" type="Magento\Payment\Gateway\Config\ConfigValueHandler">
-        <arguments>
-            <argument name="configInterface" xsi:type="object">Magento\BraintreeTwo\Gateway\Config\Config</argument>
-        </arguments>
-    </virtualType>
-    <virtualType name="BraintreeTwoAuthorizationHandler" type="Magento\Payment\Gateway\Response\HandlerChain">
-        <arguments>
-            <argument name="handlers" xsi:type="array">
-                <item name="payment_details" xsi:type="string">Magento\BraintreeTwo\Gateway\Response\PaymentDetailsHandler</item>
-                <item name="txn_id" xsi:type="string">Magento\BraintreeTwo\Gateway\Response\TransactionIdHandler</item>
-                <item name="card_details" xsi:type="string">Magento\BraintreeTwo\Gateway\Response\CardDetailsHandler</item>
-                <item name="risk_data" xsi:type="string">Magento\BraintreeTwo\Gateway\Response\RiskDataHandler</item>
-                <item name="vault_details" xsi:type="string">Magento\BraintreeTwo\Gateway\Response\VaultDetailsHandler</item>
-                <item name="3d_secure" xsi:type="string">Magento\BraintreeTwo\Gateway\Response\ThreeDSecureDetailsHandler</item>
-            </argument>
-        </arguments>
-    </virtualType>
-    <virtualType name="BraintreeTwoVaultResponseHandler" type="Magento\Payment\Gateway\Response\HandlerChain">
-        <arguments>
-            <argument name="handlers" xsi:type="array">
-                <item name="payment_details" xsi:type="string">Magento\BraintreeTwo\Gateway\Response\PaymentDetailsHandler</item>
-                <item name="txn_id" xsi:type="string">Magento\BraintreeTwo\Gateway\Response\TransactionIdHandler</item>
-                <item name="card_details" xsi:type="string">Magento\BraintreeTwo\Gateway\Response\CardDetailsHandler</item>
-                <item name="risk_data" xsi:type="string">Magento\BraintreeTwo\Gateway\Response\RiskDataHandler</item>
-                <item name="3d_secure" xsi:type="string">Magento\BraintreeTwo\Gateway\Response\ThreeDSecureDetailsHandler</item>
-            </argument>
-        </arguments>
-    </virtualType>
-    <virtualType name="BraintreeTwoPayPalResponseHandler" type="Magento\Payment\Gateway\Response\HandlerChain">
-        <arguments>
-            <argument name="handlers" xsi:type="array">
-                <item name="payment_details" xsi:type="string">Magento\BraintreeTwo\Gateway\Response\PaymentDetailsHandler</item>
-                <item name="txn_id" xsi:type="string">Magento\BraintreeTwo\Gateway\Response\TransactionIdHandler</item>
-                <item name="paypal_details" xsi:type="string">Magento\BraintreeTwo\Gateway\Response\PayPalDetailsHandler</item>
-            </argument>
-        </arguments>
-    </virtualType>
-
-    <!-- PayPal value handlers infrastructure -->
-    <virtualType name="BraintreeTwoPayPalValueHandlerPool" type="Magento\Payment\Gateway\Config\ValueHandlerPool">
-        <arguments>
-            <argument name="handlers" xsi:type="array">
-                <item name="default" xsi:type="string">BraintreeTwoPayPalConfigValueHandler</item>
-                <item name="can_void" xsi:type="string">Magento\BraintreeTwo\Gateway\Config\CanVoidHandler</item>
-                <item name="can_cancel" xsi:type="string">Magento\BraintreeTwo\Gateway\Config\CanVoidHandler</item>
-                <item name="can_capture" xsi:type="string">Magento\BraintreeTwo\Gateway\Config\CanVoidHandler</item>
-            </argument>
-        </arguments>
-    </virtualType>
-    <virtualType name="BraintreeTwoPayPalConfigValueHandler" type="Magento\Payment\Gateway\Config\ConfigValueHandler">
-        <arguments>
-            <argument name="configInterface" xsi:type="object">Magento\BraintreeTwo\Gateway\Config\PayPal\Config</argument>
-        </arguments>
-    </virtualType>
-    
-    <!-- Void Command -->
-    <virtualType name="BraintreeTwoVoidCommand" type="Magento\Payment\Gateway\Command\GatewayCommand">
-        <arguments>
-            <argument name="client" xsi:type="object">Magento\BraintreeTwo\Gateway\Http\Client\TransactionVoid</argument>
-            <argument name="requestBuilder" xsi:type="object">Magento\BraintreeTwo\Gateway\Request\VoidDataBuilder</argument>
-            <argument name="handler" xsi:type="object">Magento\BraintreeTwo\Gateway\Response\VoidHandler</argument>
-            <argument name="validator" xsi:type="object">Magento\BraintreeTwo\Gateway\Validator\GeneralResponseValidator</argument>
-            <argument name="transferFactory" xsi:type="object">Magento\BraintreeTwo\Gateway\Http\TransferFactory</argument>
-        </arguments>
-    </virtualType>
-
-    <!-- Refund Command -->
-    <virtualType name="BraintreeTwoRefundCommand" type="Magento\Payment\Gateway\Command\GatewayCommand">
-        <arguments>
-            <argument name="client" xsi:type="object">Magento\BraintreeTwo\Gateway\Http\Client\TransactionRefund</argument>
-            <argument name="requestBuilder" xsi:type="object">Magento\BraintreeTwo\Gateway\Request\RefundDataBuilder</argument>
-            <argument name="validator" xsi:type="object">Magento\BraintreeTwo\Gateway\Validator\GeneralResponseValidator</argument>
-            <argument name="handler" xsi:type="object">Magento\BraintreeTwo\Gateway\Response\RefundHandler</argument>
-            <argument name="transferFactory" xsi:type="object">Magento\BraintreeTwo\Gateway\Http\TransferFactory</argument>
-        </arguments>
-    </virtualType>
-
-    <!-- Value validators infrastructure -->
-    <virtualType name="BraintreeTwoCountryValidator" type="Magento\Payment\Gateway\Validator\CountryValidator">
-        <arguments>
-            <argument name="config" xsi:type="object">Magento\BraintreeTwo\Gateway\Config\Config</argument>
-        </arguments>
-    </virtualType>
-    <virtualType name="BraintreeTwoValidatorPool" type="Magento\Payment\Gateway\Validator\ValidatorPool">
-        <arguments>
-            <argument name="validators" xsi:type="array">
-                <item name="country" xsi:type="string">BraintreeTwoCountryValidator</item>
-            </argument>
-        </arguments>
-    </virtualType>
-
-    <type name="Magento\BraintreeTwo\Block\Info">
-        <arguments>
-            <argument name="config" xsi:type="object">Magento\BraintreeTwo\Gateway\Config\Config</argument>
-        </arguments>
-    </type>
-    <virtualType name="BraintreeTwoPayPalInfo" type="Magento\BraintreeTwo\Block\Info">
-        <arguments>
-            <argument name="config" xsi:type="object">Magento\BraintreeTwo\Gateway\Config\PayPal\Config</argument>
-        </arguments>
-    </virtualType>
-
-    <virtualType name="BraintreeTransactionsCollectionFactory" type="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
-        <arguments>
-            <argument name="collections" xsi:type="array">
-                <item name="braintreetwo_report_data_source" xsi:type="string">Magento\BraintreeTwo\Model\Report\TransactionsCollection</item>
-            </argument>
-        </arguments>
-    </virtualType>
-
-    <virtualType name="BraintreeTransactionsReporting" type="Magento\Framework\View\Element\UiComponent\DataProvider\Reporting">
-        <arguments>
-            <argument name="collectionFactory" xsi:type="object">BraintreeTransactionsCollectionFactory</argument>
-        </arguments>
-    </virtualType>
-
-    <virtualType name="BraintreeTransactionsDataProvider" type="Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider">
-        <arguments>
-            <argument name="reporting" xsi:type="object">BraintreeTransactionsReporting</argument>
-        </arguments>
-    </virtualType>
-
-    <type name="Magento\BraintreeTwo\Model\Report\ConditionAppliers\AppliersPool">
-        <arguments>
-            <argument name="appliers" xsi:type="array">
-                <item name="Braintree\TextNode" xsi:type="object">Magento\BraintreeTwo\Model\Report\ConditionAppliers\Text</item>
-                <item name="Braintree\RangeNode" xsi:type="object">Magento\BraintreeTwo\Model\Report\ConditionAppliers\Range</item>
-                <item name="Braintree\MultipleValueNode" xsi:type="object">Magento\BraintreeTwo\Model\Report\ConditionAppliers\MultipleValue</item>
-            </argument>
-        </arguments>
-    </type>
-
-</config>
diff --git a/app/code/Magento/BraintreeTwo/etc/events.xml b/app/code/Magento/BraintreeTwo/etc/events.xml
deleted file mode 100644
index ad3e61436d6ad566bec2d178f3bf512442cfead8..0000000000000000000000000000000000000000
--- a/app/code/Magento/BraintreeTwo/etc/events.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
--->
-
-<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
-    <event name="payment_method_assign_data_braintreetwo">
-        <observer name="braintreetwo_gateway_data_assign" instance="Magento\BraintreeTwo\Observer\DataAssignObserver" />
-    </event>
-    <event name="payment_method_assign_data_braintreetwo_paypal">
-        <observer name="braintreetwo_paypal_gateway_data_assign" instance="Magento\BraintreeTwo\Observer\DataAssignObserver" />
-    </event>
-</config>
diff --git a/app/code/Magento/BraintreeTwo/etc/frontend/di.xml b/app/code/Magento/BraintreeTwo/etc/frontend/di.xml
deleted file mode 100644
index 599251dd98a713eb0efcdcd1b43def27d830773f..0000000000000000000000000000000000000000
--- a/app/code/Magento/BraintreeTwo/etc/frontend/di.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
--->
-<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
-    <type name="Magento\Checkout\Model\CompositeConfigProvider">
-        <arguments>
-            <argument name="configProviders" xsi:type="array">
-                <item name="braintreetwo_config_provider" xsi:type="object">Magento\BraintreeTwo\Model\Ui\ConfigProvider</item>
-            </argument>
-        </arguments>
-    </type>
-    <type name="Magento\Payment\Model\CcGenericConfigProvider">
-        <arguments>
-            <argument name="methodCodes" xsi:type="array">
-                <item name="braintreetwo" xsi:type="const">Magento\BraintreeTwo\Model\Ui\ConfigProvider::CODE</item>
-            </argument>
-        </arguments>
-    </type>
-    <type name="Magento\BraintreeTwo\Block\Info">
-        <arguments>
-            <argument name="data" xsi:type="array">
-                <item xsi:type="string" name="is_secure_mode">1</item>
-            </argument>
-        </arguments>
-    </type>
-
-    <type name="Magento\Vault\Model\Ui\TokensConfigProvider">
-        <arguments>
-            <argument name="tokenUiComponentProviders" xsi:type="array">
-                <item name="braintreetwo" xsi:type="object">Magento\BraintreeTwo\Model\Ui\TokenUiComponentProvider</item>
-            </argument>
-        </arguments>
-    </type>
-
-    <type name="Magento\BraintreeTwo\Controller\Payment\GetNonce">
-        <arguments>
-            <argument name="session" xsi:type="object">Magento\Customer\Model\Session</argument>
-        </arguments>
-    </type>
-
-    <type name="Magento\BraintreeTwo\Block\Paypal\Button">
-        <arguments>
-            <argument name="data" xsi:type="array">
-                <item name="template" xsi:type="string">Magento_BraintreeTwo::paypal/button.phtml</item>
-                <item name="alias" xsi:type="string">braintree.paypal.mini-cart</item>
-                <item name="button_id" xsi:type="string">braintree-paypal-mini-cart</item>
-            </argument>
-            <argument name="payment" xsi:type="object">BraintreeTwoPayPalFacade</argument>
-        </arguments>
-    </type>
-</config>
diff --git a/app/code/Magento/BraintreeTwo/etc/frontend/events.xml b/app/code/Magento/BraintreeTwo/etc/frontend/events.xml
deleted file mode 100644
index 53169c047e639c593fbeff4513b1fb17492cbb67..0000000000000000000000000000000000000000
--- a/app/code/Magento/BraintreeTwo/etc/frontend/events.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
--->
-<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
-    <event name="shortcut_buttons_container">
-        <observer name="braintree_paypal_shortcuts" instance="Magento\BraintreeTwo\Observer\AddPaypalShortcuts"/>
-    </event>
-</config>
diff --git a/app/code/Magento/BraintreeTwo/etc/frontend/routes.xml b/app/code/Magento/BraintreeTwo/etc/frontend/routes.xml
deleted file mode 100644
index 0626cc18a1615348962f63ae1a0ab35b1bed4d36..0000000000000000000000000000000000000000
--- a/app/code/Magento/BraintreeTwo/etc/frontend/routes.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
--->
-<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
-    <router id="standard">
-        <route id="braintreetwo" frontName="braintreetwo">
-            <module name="Magento_BraintreeTwo" />
-        </route>
-    </router>
-</config>
diff --git a/app/code/Magento/BraintreeTwo/etc/frontend/sections.xml b/app/code/Magento/BraintreeTwo/etc/frontend/sections.xml
deleted file mode 100644
index 7e6ec9164ed2d64bc30c9a53f64e6da1e0131671..0000000000000000000000000000000000000000
--- a/app/code/Magento/BraintreeTwo/etc/frontend/sections.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
--->
-<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-        xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
-    <action name="braintreetwo/paypal/placeOrder">
-        <section name="cart"/>
-        <section name="checkout-data"/>
-    </action>
-</config>
diff --git a/app/code/Magento/BraintreeTwo/etc/module.xml b/app/code/Magento/BraintreeTwo/etc/module.xml
deleted file mode 100644
index dadace30d4595a54d364eca15957ca518ba91b1b..0000000000000000000000000000000000000000
--- a/app/code/Magento/BraintreeTwo/etc/module.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
--->
-<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
-    <module name="Magento_BraintreeTwo" setup_version="2.0.0">
-        <sequence>
-            <module name="Magento_Customer"/>
-            <module name="Magento_Payment"/>
-            <module name="Magento_Checkout"/>
-            <module name="Magento_Vault"/>
-            <module name="Magento_Catalog"/>
-            <module name="Magento_Quote"/>
-            <module name="Magento_Paypal"/>
-            <module name="Magento_CheckoutAgreements"/>
-            <module name="Magento_Theme"/>
-        </sequence>
-    </module>
-</config>
diff --git a/app/code/Magento/BraintreeTwo/i18n/en_US.csv b/app/code/Magento/BraintreeTwo/i18n/en_US.csv
deleted file mode 100644
index 5feecc352a20d439a2657d14bfefc6732911a385..0000000000000000000000000000000000000000
--- a/app/code/Magento/BraintreeTwo/i18n/en_US.csv
+++ /dev/null
@@ -1,15 +0,0 @@
-"cc_type","Credit Card Type"
-"cc_number","Credit Card Number"
-"avsPostalCodeResponseCode","AVS Postal Code Response Code"
-"avsStreetAddressResponseCode","AVS Street Address Response Code"
-"cvvResponseCode","CVV Response Code"
-"processorAuthorizationCode","Processor Authorization Code"
-"processorResponseCode","Processor Response Code"
-"processorResponseText","Processor Response Text"
-"braintreetwo", "Braintree"
-"liabilityShifted", "Liability Shifted"
-"liabilityShiftPossible", "Liability Shift Possible"
-"riskDataId", "Risk ID"
-"riskDataDecision", "Risk Decision",
-"paymentId", "Payment Id",
-"payerEmail", "Payer Email",
diff --git a/app/code/Magento/BraintreeTwo/registration.php b/app/code/Magento/BraintreeTwo/registration.php
deleted file mode 100644
index 1598b3780f2e97190e4c9d149587eec6c0b55853..0000000000000000000000000000000000000000
--- a/app/code/Magento/BraintreeTwo/registration.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-\Magento\Framework\Component\ComponentRegistrar::register(
-    \Magento\Framework\Component\ComponentRegistrar::MODULE,
-    'Magento_BraintreeTwo',
-    __DIR__
-);
diff --git a/app/code/Magento/BraintreeTwo/view/adminhtml/layout/sales_order_create_index.xml b/app/code/Magento/BraintreeTwo/view/adminhtml/layout/sales_order_create_index.xml
deleted file mode 100644
index c3191421f12b36238f3ebe8b2fad87e96cff47d5..0000000000000000000000000000000000000000
--- a/app/code/Magento/BraintreeTwo/view/adminhtml/layout/sales_order_create_index.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
--->
-<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
-    <body>
-        <referenceBlock name="order_create_billing_form">
-            <action method="setMethodFormTemplate">
-                <argument name="method" xsi:type="string">braintreetwo</argument>
-                <argument name="template" xsi:type="string">Magento_BraintreeTwo::form/cc.phtml</argument>
-            </action>
-        </referenceBlock>
-        <referenceBlock name="content">
-            <block name="braintreetwo_payment_script"
-                   as="braintreetwo_payment_script"
-                   after="billing_method"
-                   template="Magento_BraintreeTwo::payment/script.phtml"
-                   class="Magento\BraintreeTwo\Block\Payment"/>
-        </referenceBlock>
-    </body>
-</page>
diff --git a/app/code/Magento/BraintreeTwo/view/frontend/layout/braintreetwo_paypal_review.xml b/app/code/Magento/BraintreeTwo/view/frontend/layout/braintreetwo_paypal_review.xml
deleted file mode 100644
index 6e6066048bb70df97c48b68a9fd272814dd5c9e0..0000000000000000000000000000000000000000
--- a/app/code/Magento/BraintreeTwo/view/frontend/layout/braintreetwo_paypal_review.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
--->
-<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
-    <head>
-        <title>Review Order</title>
-    </head>
-    <update handle="checkout_onepage_review_item_renderers"/>
-    <body>
-        <referenceBlock name="head.components">
-            <block class="Magento\Framework\View\Element\Js\Components" name="paypal_express_review_checkout_head_components" template="Magento_Checkout::js/components.phtml"/>
-            <block class="Magento\Framework\View\Element\Js\Components" name="paypal_express_review_head_components" template="Magento_Paypal::js/components.phtml"/>
-        </referenceBlock>
-        <referenceContainer name="page.messages">
-            <block class="Magento\Paypal\Block\Cart\ValidationMessages" name="paypal.cart.validationmessages"/>
-        </referenceContainer>
-        <referenceContainer name="content">
-            <block class="Magento\BraintreeTwo\Block\Paypal\Checkout\Review" name="braintreetwo.paypal.review" template="Magento_Paypal::express/review.phtml">
-                <block class="Magento\Paypal\Block\Express\Review" name="express.review.shipping.method" as="shipping_method" template="express/review/shipping/method.phtml"/>
-                <block class="Magento\Framework\View\Element\Text\ListText" name="paypal.additional.actions"/>
-                <block class="Magento\Paypal\Block\Express\Review\Details" name="paypal.express.review.details" as="details" template="express/review/details.phtml">
-                    <block class="Magento\Framework\View\Element\RendererList" name="checkout.onepage.review.item.renderers" as="renderer.list"/>
-                    <block class="Magento\Checkout\Block\Cart\Totals" name="paypal.express.review.details.totals" as="totals" template="Magento_Paypal::checkout/onepage/review/totals.phtml"/>
-                </block>
-                <block class="Magento\CheckoutAgreements\Block\Agreements" name="paypal.express.review.details.agreements" as="agreements" template="Magento_CheckoutAgreements::additional_agreements.phtml"/>
-            </block>
-        </referenceContainer>
-        <block class="Magento\Framework\View\Element\Template" name="additional.product.info" template="Magento_Theme::template.phtml"/>
-    </body>
-</page>
diff --git a/app/code/Magento/BraintreeTwo/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/BraintreeTwo/view/frontend/layout/checkout_index_index.xml
deleted file mode 100644
index 5995052ca59b0d27fb7e6beb74056b7c5f98ba76..0000000000000000000000000000000000000000
--- a/app/code/Magento/BraintreeTwo/view/frontend/layout/checkout_index_index.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
--->
-<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
-    <body>
-        <referenceContainer name="after.body.start">
-            <referenceBlock remove="true" name="braintree.paypal.component"/>
-        </referenceContainer>
-        <referenceBlock name="checkout.root">
-            <arguments>
-                <argument name="jsLayout" xsi:type="array">
-                    <item name="components" xsi:type="array">
-                        <item name="checkout" xsi:type="array">
-                            <item name="children" xsi:type="array">
-                                <item name="steps" xsi:type="array">
-                                    <item name="children" xsi:type="array">
-                                        <item name="billing-step" xsi:type="array">
-                                            <item name="component" xsi:type="string">uiComponent</item>
-                                            <item name="children" xsi:type="array">
-                                                <item name="payment" xsi:type="array">
-                                                    <item name="children" xsi:type="array">
-                                                        <item name="renders" xsi:type="array">
-                                                            <!-- merge payment method renders here -->
-                                                            <item name="children" xsi:type="array">
-                                                                <item name="braintreetwo" xsi:type="array">
-                                                                    <item name="component" xsi:type="string">Magento_BraintreeTwo/js/view/payment/braintree</item>
-                                                                    <item name="methods" xsi:type="array">
-                                                                        <item name="braintreetwo" xsi:type="array">
-                                                                            <item name="isBillingAddressRequired" xsi:type="boolean">true</item>
-                                                                        </item>
-                                                                        <item name="braintreetwo_paypal" xsi:type="array">
-                                                                            <item name="isBillingAddressRequired" xsi:type="boolean">false</item>
-                                                                        </item>
-                                                                    </item>
-                                                                </item>
-                                                            </item>
-                                                        </item>
-                                                    </item>
-                                                </item>
-                                            </item>
-                                        </item>
-                                    </item>
-                                </item>
-                            </item>
-                        </item>
-                    </item>
-                </argument>
-            </arguments>
-        </referenceBlock>
-    </body>
-</page>
\ No newline at end of file
diff --git a/app/code/Magento/BraintreeTwo/view/frontend/requirejs-config.js b/app/code/Magento/BraintreeTwo/view/frontend/requirejs-config.js
deleted file mode 100644
index 99e8e044d9aa12ede358df7e2b712497ca8f021d..0000000000000000000000000000000000000000
--- a/app/code/Magento/BraintreeTwo/view/frontend/requirejs-config.js
+++ /dev/null
@@ -1,12 +0,0 @@
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-var config = {
-    map: {
-        '*': {
-            braintree: 'https://js.braintreegateway.com/js/braintree-2.17.6.min.js'
-        }
-    }
-};
diff --git a/app/code/Magento/BraintreeTwo/view/frontend/web/js/view/payment/method-renderer/cc-form.js b/app/code/Magento/BraintreeTwo/view/frontend/web/js/view/payment/method-renderer/cc-form.js
deleted file mode 100644
index 838ba9604b5eaf7ccae1a959318296deac76d00f..0000000000000000000000000000000000000000
--- a/app/code/Magento/BraintreeTwo/view/frontend/web/js/view/payment/method-renderer/cc-form.js
+++ /dev/null
@@ -1,322 +0,0 @@
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
-/*browser:true*/
-/*global define*/
-define(
-    [
-        'underscore',
-        'jquery',
-        'Magento_Payment/js/view/payment/cc-form',
-        'Magento_Checkout/js/model/quote',
-        'Magento_BraintreeTwo/js/view/payment/adapter',
-        'mage/translate',
-        'Magento_BraintreeTwo/js/validator',
-        'Magento_BraintreeTwo/js/view/payment/validator-handler',
-        'Magento_Checkout/js/model/full-screen-loader'
-    ],
-    function (
-        _,
-        $,
-        Component,
-        quote,
-        braintree,
-        $t,
-        validator,
-        validatorManager,
-        fullScreenLoader
-    ) {
-        'use strict';
-
-        return Component.extend({
-            defaults: {
-                active: false,
-                braintreeClient: null,
-                braintreeDeviceData: null,
-                paymentMethodNonce: null,
-                lastBillingAddress: null,
-                validatorManager: validatorManager,
-                code: 'braintreetwo',
-
-                /**
-                 * Additional payment data
-                 *
-                 * {Object}
-                 */
-                additionalData: {},
-
-                /**
-                 * Braintree client configuration
-                 *
-                 * {Object}
-                 */
-                clientConfig: {
-
-                    /**
-                     * Triggers on payment nonce receive
-                     * @param {Object} response
-                     */
-                    onPaymentMethodReceived: function (response) {
-                        this.beforePlaceOrder(response);
-                    },
-
-                    /**
-                     * Triggers on any Braintree error
-                     */
-                    onError: function () {
-                        this.paymentMethodNonce = null;
-                    },
-
-                    /**
-                     * Triggers when customer click "Cancel"
-                     */
-                    onCancelled: function () {
-                        this.paymentMethodNonce = null;
-                    }
-                },
-                imports: {
-                    onActiveChange: 'active'
-                }
-            },
-
-            /**
-             * Set list of observable attributes
-             *
-             * @returns {exports.initObservable}
-             */
-            initObservable: function () {
-                validator.setConfig(window.checkoutConfig.payment[this.getCode()]);
-                this._super()
-                    .observe(['active']);
-                this.validatorManager.initialize();
-                this.initBraintree();
-
-                return this;
-            },
-
-            /**
-             * Get payment name
-             *
-             * @returns {String}
-             */
-            getCode: function () {
-                return this.code;
-            },
-
-            /**
-             * Check if payment is active
-             *
-             * @returns {Boolean}
-             */
-            isActive: function () {
-                var active = this.getCode() === this.isChecked();
-
-                this.active(active);
-
-                return active;
-            },
-
-            /**
-             * Triggers when payment method change
-             * @param {Boolean} isActive
-             */
-            onActiveChange: function (isActive) {
-                if (!isActive || this.isSingleUse()) {
-                    return;
-                }
-
-                this.reInitBraintree();
-            },
-
-            /**
-             * Init config
-             */
-            initClientConfig: function () {
-                // Advanced fraud tools settings
-                if (this.hasFraudProtection()) {
-                    this.clientConfig = _.extend(this.clientConfig, this.kountConfig());
-                }
-
-                _.each(this.clientConfig, function (fn, name) {
-                    if (typeof fn === 'function') {
-                        this.clientConfig[name] = fn.bind(this);
-                    }
-                }, this);
-            },
-
-            /**
-             * Create Braintree configuration
-             */
-            initBraintree: function () {
-                this.initClientConfig();
-                braintree.config = _.extend(braintree.config, this.clientConfig);
-            },
-
-            /**
-             * Re-init Braintree configuration
-             */
-            reInitBraintree: function () {
-                var intervalId = setInterval(function () {
-                    // stop loader when frame will be loaded
-                    if ($('#braintree-hosted-field-number').length) {
-                        clearInterval(intervalId);
-                        fullScreenLoader.stopLoader();
-                    }
-                }, 500);
-
-                fullScreenLoader.startLoader();
-                braintree.setConfig(this.clientConfig);
-                braintree.setup();
-            },
-
-            /**
-             * @returns {Object}
-             */
-            kountConfig: function () {
-                var config = {
-                    dataCollector: {
-                        kount: {
-                            environment: this.getEnvironment()
-                        }
-                    },
-
-                    /**
-                     * Device data initialization
-                     *
-                     * @param {Object} braintreeInstance
-                     */
-                    onReady: function (braintreeInstance) {
-                        this.additionalData['device_data'] = braintreeInstance.deviceData;
-                    }
-                };
-
-                if (this.getKountMerchantId()) {
-                    config.dataCollector.kount.merchantId = this.getKountMerchantId();
-                }
-
-                return config;
-            },
-
-            /**
-             * Get full selector name
-             *
-             * @param {String} field
-             * @returns {String}
-             */
-            getSelector: function (field) {
-                return '#' + this.getCode() + '_' + field;
-            },
-
-            /**
-             * Get list of available CC types
-             *
-             * @returns {Object}
-             */
-            getCcAvailableTypes: function () {
-                var availableTypes = validator.getAvailableCardTypes(),
-                    billingAddress = quote.billingAddress(),
-                    billingCountryId;
-
-                this.lastBillingAddress = quote.shippingAddress();
-
-                if (!billingAddress) {
-                    billingAddress = this.lastBillingAddress;
-                }
-
-                billingCountryId = billingAddress.countryId;
-
-                if (billingCountryId && validator.getCountrySpecificCardTypes(billingCountryId)) {
-
-                    return validator.collectTypes(
-                        availableTypes, validator.getCountrySpecificCardTypes(billingCountryId)
-                    );
-                }
-
-                return availableTypes;
-            },
-
-            /**
-             * @returns {Boolean}
-             */
-            hasFraudProtection: function () {
-                return window.checkoutConfig.payment[this.getCode()].hasFraudProtection;
-            },
-
-            /**
-             * @returns {String}
-             */
-            getEnvironment: function () {
-                return window.checkoutConfig.payment[this.getCode()].environment;
-            },
-
-            /**
-             * @returns {String}
-             */
-            getKountMerchantId: function () {
-                return window.checkoutConfig.payment[this.getCode()].kountMerchantId;
-            },
-
-            /**
-             * Get data
-             *
-             * @returns {Object}
-             */
-            getData: function () {
-                var data = {
-                    'method': this.getCode(),
-                    'additional_data': {
-                        'payment_method_nonce': this.paymentMethodNonce
-                    }
-                };
-
-                data['additional_data'] = _.extend(data['additional_data'], this.additionalData);
-
-                return data;
-            },
-
-            /**
-             * Set payment nonce
-             * @param {String} paymentMethodNonce
-             */
-            setPaymentMethodNonce: function (paymentMethodNonce) {
-                this.paymentMethodNonce = paymentMethodNonce;
-            },
-
-            /**
-             * Prepare data to place order
-             * @param {Object} data
-             */
-            beforePlaceOrder: function (data) {
-                this.setPaymentMethodNonce(data.nonce);
-                this.placeOrder();
-            },
-
-            /**
-             * Action to place order
-             * @param {String} key
-             */
-            placeOrder: function (key) {
-                var self = this;
-
-                if (key) {
-                    return self._super();
-                }
-                // place order on success validation
-                self.validatorManager.validate(self, function () {
-                    return self.placeOrder('parent');
-                });
-
-                return false;
-            },
-
-            /**
-             * Check if Braintree configured without PayPal
-             * @returns {Boolean}
-             */
-            isSingleUse: function () {
-                return window.checkoutConfig.payment[this.getCode()].isSingleUse;
-            }
-        });
-    }
-);
diff --git a/app/code/Magento/Checkout/view/frontend/layout/braintree_paypal_review.xml b/app/code/Magento/Checkout/view/frontend/layout/braintree_paypal_review.xml
deleted file mode 100644
index 584acf04fccd853873b22c6b22bf421bfa7289b7..0000000000000000000000000000000000000000
--- a/app/code/Magento/Checkout/view/frontend/layout/braintree_paypal_review.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
--->
-<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
-    <body>
-        <referenceBlock name="paypal.additional.actions">
-            <block class="Magento\Checkout\Block\Cart\Coupon" name="paypal.cart.coupon" as="coupon" template="cart/coupon.phtml"/>
-        </referenceBlock>
-    </body>
-</page>
diff --git a/app/code/Magento/Checkout/view/frontend/layout/braintreetwo_paypal_review.xml b/app/code/Magento/Checkout/view/frontend/layout/braintreetwo_paypal_review.xml
deleted file mode 100644
index 584acf04fccd853873b22c6b22bf421bfa7289b7..0000000000000000000000000000000000000000
--- a/app/code/Magento/Checkout/view/frontend/layout/braintreetwo_paypal_review.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
--->
-<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
-    <body>
-        <referenceBlock name="paypal.additional.actions">
-            <block class="Magento\Checkout\Block\Cart\Coupon" name="paypal.cart.coupon" as="coupon" template="cart/coupon.phtml"/>
-        </referenceBlock>
-    </body>
-</page>
diff --git a/app/code/Magento/Checkout/view/frontend/layout/paypal_express_review.xml b/app/code/Magento/Checkout/view/frontend/layout/paypal_express_review.xml
deleted file mode 100644
index 584acf04fccd853873b22c6b22bf421bfa7289b7..0000000000000000000000000000000000000000
--- a/app/code/Magento/Checkout/view/frontend/layout/paypal_express_review.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
--->
-<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
-    <body>
-        <referenceBlock name="paypal.additional.actions">
-            <block class="Magento\Checkout\Block\Cart\Coupon" name="paypal.cart.coupon" as="coupon" template="cart/coupon.phtml"/>
-        </referenceBlock>
-    </body>
-</page>
diff --git a/app/code/Magento/Checkout/view/frontend/layout/paypal_payflowexpress_review.xml b/app/code/Magento/Checkout/view/frontend/layout/paypal_payflowexpress_review.xml
deleted file mode 100644
index 584acf04fccd853873b22c6b22bf421bfa7289b7..0000000000000000000000000000000000000000
--- a/app/code/Magento/Checkout/view/frontend/layout/paypal_payflowexpress_review.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/**
- * Copyright © 2015 Magento. All rights reserved.
- * See COPYING.txt for license details.
- */
--->
-<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
-    <body>
-        <referenceBlock name="paypal.additional.actions">
-            <block class="Magento\Checkout\Block\Cart\Coupon" name="paypal.cart.coupon" as="coupon" template="cart/coupon.phtml"/>
-        </referenceBlock>
-    </body>
-</page>
diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/bulk.js b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/bulk.js
index 42b5a81fd43459fe37bd86440a9792cba9383220..78e8c5b5b3721c9670afc81bf3f018d5f89abd9a 100644
--- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/bulk.js
+++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/bulk.js
@@ -304,6 +304,7 @@ define([
 
                     uploadInput.fileupload({
                         dataType: 'json',
+                        dropZone: gallery,
                         process: [{
                             action: 'load',
                             fileTypes: /^image\/(gif|jpeg|png)$/
diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review.xml
index 4ba950cd85099b0da6cc9a428b1a6ace0fa824d4..7fc192640b00c1468961a69ef89942c7745122da 100644
--- a/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review.xml
+++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review.xml
@@ -21,7 +21,9 @@
         <referenceContainer name="content">
             <block class="Magento\Paypal\Block\Express\Review" name="paypal.express.review" template="express/review.phtml">
                 <block class="Magento\Paypal\Block\Express\Review" name="express.review.shipping.method" as="shipping_method" template="express/review/shipping/method.phtml"/>
-                <block class="Magento\Framework\View\Element\Text\ListText" name="paypal.additional.actions"/>
+                <block class="Magento\Framework\View\Element\Text\ListText" name="paypal.additional.actions">
+                    <block class="Magento\Checkout\Block\Cart\Coupon" name="paypal.cart.coupon" as="coupon" template="Magento_Checkout::cart/coupon.phtml"/>
+                </block>
                 <block class="Magento\Paypal\Block\Express\Review\Details" name="paypal.express.review.details" as="details" template="express/review/details.phtml">
                     <block class="Magento\Framework\View\Element\RendererList" name="checkout.onepage.review.item.renderers" as="renderer.list"/>
                     <block class="Magento\Checkout\Block\Cart\Totals" name="paypal.express.review.details.totals" as="totals" template="Magento_Paypal::checkout/onepage/review/totals.phtml"/>
diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowexpress_review.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowexpress_review.xml
index 0c9f663e2c28d5591cf0f1a5b58943fb34a30576..f5a96f7cd092241d2782151c09b20246d643239f 100644
--- a/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowexpress_review.xml
+++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_payflowexpress_review.xml
@@ -24,7 +24,9 @@
                     <argument name="prefix" xsi:type="string">paypal/payflowexpress</argument>
                 </action>
                 <block class="Magento\Paypal\Block\Express\Review" name="express.review.shipping.method" as="shipping_method" template="express/review/shipping/method.phtml"/>
-                <block class="Magento\Framework\View\Element\Text\ListText" name="paypal.additional.actions"/>
+                <block class="Magento\Framework\View\Element\Text\ListText" name="paypal.additional.actions">
+                    <block class="Magento\Checkout\Block\Cart\Coupon" name="paypal.cart.coupon" as="coupon" template="Magento_Checkout::cart/coupon.phtml"/>
+                </block>
                 <block class="Magento\Paypal\Block\Express\Review\Details" name="paypal.express.review.details" as="details" template="express/review/details.phtml">
                     <block class="Magento\Framework\View\Element\RendererList" name="checkout.onepage.review.item.renderers" as="renderer.list"/>
                     <block class="Magento\Checkout\Block\Cart\Totals" name="paypal.express.review.details.totals" as="totals" template="Magento_Paypal::checkout/onepage/review/totals.phtml"/>
diff --git a/app/design/frontend/Magento/blank/Magento_Braintree/web/css/source/_module.less b/app/design/frontend/Magento/blank/Magento_Braintree/web/css/source/_module.less
index 652c516f9392595dba1d9ea4484fea5341e60fba..7c07adbd5276a659cf7522092651d657edef33f7 100644
--- a/app/design/frontend/Magento/blank/Magento_Braintree/web/css/source/_module.less
+++ b/app/design/frontend/Magento/blank/Magento_Braintree/web/css/source/_module.less
@@ -18,7 +18,6 @@
 //  _____________________________________________
 
 & when (@media-common = true) {
-    .payment-method-braintreetwo, // ToDo Ui: Remove this selector when Payment Module is fully implemented.
     .payment-method-braintree {
 
         .hosted-date-wrap {
@@ -94,7 +93,6 @@
 //  _____________________________________________
 
 .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
-    .payment-method-braintreetwo, // ToDo Ui: Remove this selector when Payment Module is fully implemented.
     .payment-method-braintree {
         .field-tooltip {
             left: 6rem;
diff --git a/composer.json b/composer.json
index b5222ae5f4fa824f5a0bde29995e1b5b0458d7fb..aa6febfe181ec1f70a73e2e9536b0949c630e636 100644
--- a/composer.json
+++ b/composer.json
@@ -80,7 +80,6 @@
         "magento/module-backend": "100.0.2",
         "magento/module-backup": "100.0.2",
         "magento/module-braintree": "100.0.2",
-        "magento/module-braintree-two": "100.0.2",
         "magento/module-bundle": "100.0.2",
         "magento/module-bundle-import-export": "100.0.2",
         "magento/module-cache-invalidate": "100.0.2",
diff --git a/composer.lock b/composer.lock
index bdda4dadaf3f72c4319faa4e7be3f5c5a24f298d..d8ccd062dfe8a2ebae78a2a3edcc8ef29d08af7a 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,8 +4,8 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
         "This file is @generated automatically"
     ],
-    "hash": "a784bbb7f1a3fc568160aa4129b1920f",
-    "content-hash": "d171af939bed91b4acc9b011f456528a",
+    "hash": "8390f8d836d4daa2b32effa5c2a63ad1",
+    "content-hash": "dbb9b3bdfc1c4dea80cd1544eaabafa1",
     "packages": [
         {
             "name": "braintree/braintree_php",
@@ -957,16 +957,16 @@
         },
         {
             "name": "symfony/event-dispatcher",
-            "version": "v2.8.2",
+            "version": "v2.8.3",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/event-dispatcher.git",
-                "reference": "ee278f7c851533e58ca307f66305ccb9188aceda"
+                "reference": "78c468665c9568c3faaa9c416a7134308f2d85c3"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ee278f7c851533e58ca307f66305ccb9188aceda",
-                "reference": "ee278f7c851533e58ca307f66305ccb9188aceda",
+                "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/78c468665c9568c3faaa9c416a7134308f2d85c3",
+                "reference": "78c468665c9568c3faaa9c416a7134308f2d85c3",
                 "shasum": ""
             },
             "require": {
@@ -1013,20 +1013,20 @@
             ],
             "description": "Symfony EventDispatcher Component",
             "homepage": "https://symfony.com",
-            "time": "2016-01-13 10:28:07"
+            "time": "2016-01-27 05:14:19"
         },
         {
             "name": "symfony/finder",
-            "version": "v2.8.2",
+            "version": "v2.8.3",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/finder.git",
-                "reference": "c90fabdd97e431ee19b6383999cf35334dff27da"
+                "reference": "877bb4b16ea573cc8c024e9590888fcf7eb7e0f7"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/finder/zipball/c90fabdd97e431ee19b6383999cf35334dff27da",
-                "reference": "c90fabdd97e431ee19b6383999cf35334dff27da",
+                "url": "https://api.github.com/repos/symfony/finder/zipball/877bb4b16ea573cc8c024e9590888fcf7eb7e0f7",
+                "reference": "877bb4b16ea573cc8c024e9590888fcf7eb7e0f7",
                 "shasum": ""
             },
             "require": {
@@ -1062,20 +1062,20 @@
             ],
             "description": "Symfony Finder Component",
             "homepage": "https://symfony.com",
-            "time": "2016-01-14 08:26:52"
+            "time": "2016-02-22 16:12:45"
         },
         {
             "name": "symfony/process",
-            "version": "v2.8.2",
+            "version": "v2.8.3",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/process.git",
-                "reference": "6f1979c3b0f4c22c77a8a8971afaa7dd07f082ac"
+                "reference": "7dedd5b60550f33dca16dd7e94ef8aca8b67bbfe"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/process/zipball/6f1979c3b0f4c22c77a8a8971afaa7dd07f082ac",
-                "reference": "6f1979c3b0f4c22c77a8a8971afaa7dd07f082ac",
+                "url": "https://api.github.com/repos/symfony/process/zipball/7dedd5b60550f33dca16dd7e94ef8aca8b67bbfe",
+                "reference": "7dedd5b60550f33dca16dd7e94ef8aca8b67bbfe",
                 "shasum": ""
             },
             "require": {
@@ -1111,7 +1111,7 @@
             ],
             "description": "Symfony Process Component",
             "homepage": "https://symfony.com",
-            "time": "2016-01-06 09:59:23"
+            "time": "2016-02-02 13:33:15"
         },
         {
             "name": "tedivm/jshrink",
@@ -2760,16 +2760,16 @@
         },
         {
             "name": "fabpot/php-cs-fixer",
-            "version": "v1.11.1",
+            "version": "v1.11.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git",
-                "reference": "2c9f8298181f059c5077abda78019b9a0c9a7cc0"
+                "reference": "41f70154642ec0f9ea9ea9c290943f3b5dfa76fc"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/2c9f8298181f059c5077abda78019b9a0c9a7cc0",
-                "reference": "2c9f8298181f059c5077abda78019b9a0c9a7cc0",
+                "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/41f70154642ec0f9ea9ea9c290943f3b5dfa76fc",
+                "reference": "41f70154642ec0f9ea9ea9c290943f3b5dfa76fc",
                 "shasum": ""
             },
             "require": {
@@ -2810,7 +2810,7 @@
                 }
             ],
             "description": "A tool to automatically fix PHP code style",
-            "time": "2016-01-20 19:00:28"
+            "time": "2016-02-26 07:37:29"
         },
         {
             "name": "lusitanian/oauth",
@@ -2921,16 +2921,16 @@
         },
         {
             "name": "phpmd/phpmd",
-            "version": "2.3.2",
+            "version": "2.4.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/phpmd/phpmd.git",
-                "reference": "08b5bcd454a7148579b68931fc500d824afd3bb5"
+                "reference": "fccbdb6b222f6d7a6d35af1c396ba5435cec76a9"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/phpmd/phpmd/zipball/08b5bcd454a7148579b68931fc500d824afd3bb5",
-                "reference": "08b5bcd454a7148579b68931fc500d824afd3bb5",
+                "url": "https://api.github.com/repos/phpmd/phpmd/zipball/fccbdb6b222f6d7a6d35af1c396ba5435cec76a9",
+                "reference": "fccbdb6b222f6d7a6d35af1c396ba5435cec76a9",
                 "shasum": ""
             },
             "require": {
@@ -2959,7 +2959,7 @@
                     "name": "Manuel Pichler",
                     "email": "github@manuel-pichler.de",
                     "homepage": "https://github.com/manuelpichler",
-                    "role": "Project founder"
+                    "role": "Project Founder"
                 },
                 {
                     "name": "Other contributors",
@@ -2982,7 +2982,7 @@
                 "phpmd",
                 "pmd"
             ],
-            "time": "2015-09-24 14:37:49"
+            "time": "2016-03-10 17:17:44"
         },
         {
             "name": "phpunit/php-code-coverage",
@@ -3470,16 +3470,16 @@
         },
         {
             "name": "sebastian/environment",
-            "version": "1.3.3",
+            "version": "1.3.5",
             "source": {
                 "type": "git",
                 "url": "https://github.com/sebastianbergmann/environment.git",
-                "reference": "6e7133793a8e5a5714a551a8324337374be209df"
+                "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6e7133793a8e5a5714a551a8324337374be209df",
-                "reference": "6e7133793a8e5a5714a551a8324337374be209df",
+                "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf",
+                "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf",
                 "shasum": ""
             },
             "require": {
@@ -3516,7 +3516,7 @@
                 "environment",
                 "hhvm"
             ],
-            "time": "2015-12-02 08:37:27"
+            "time": "2016-02-26 18:40:46"
         },
         {
             "name": "sebastian/exporter",
@@ -3749,22 +3749,25 @@
         },
         {
             "name": "symfony/config",
-            "version": "v2.8.2",
+            "version": "v2.8.3",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/config.git",
-                "reference": "41ee6c70758f40fa1dbf90d019ae0a66c4a09e74"
+                "reference": "0f8f94e6a32b5c480024eed5fa5cbd2790d0ad19"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/config/zipball/41ee6c70758f40fa1dbf90d019ae0a66c4a09e74",
-                "reference": "41ee6c70758f40fa1dbf90d019ae0a66c4a09e74",
+                "url": "https://api.github.com/repos/symfony/config/zipball/0f8f94e6a32b5c480024eed5fa5cbd2790d0ad19",
+                "reference": "0f8f94e6a32b5c480024eed5fa5cbd2790d0ad19",
                 "shasum": ""
             },
             "require": {
                 "php": ">=5.3.9",
                 "symfony/filesystem": "~2.3|~3.0.0"
             },
+            "suggest": {
+                "symfony/yaml": "To use the yaml reference dumper"
+            },
             "type": "library",
             "extra": {
                 "branch-alias": {
@@ -3795,20 +3798,20 @@
             ],
             "description": "Symfony Config Component",
             "homepage": "https://symfony.com",
-            "time": "2016-01-03 15:33:41"
+            "time": "2016-02-22 16:12:45"
         },
         {
             "name": "symfony/dependency-injection",
-            "version": "v2.8.2",
+            "version": "v2.8.3",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/dependency-injection.git",
-                "reference": "ba94a914e244e0d05f0aaef460d5558d5541d2b1"
+                "reference": "62251761a7615435b22ccf562384c588b431be44"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/ba94a914e244e0d05f0aaef460d5558d5541d2b1",
-                "reference": "ba94a914e244e0d05f0aaef460d5558d5541d2b1",
+                "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/62251761a7615435b22ccf562384c588b431be44",
+                "reference": "62251761a7615435b22ccf562384c588b431be44",
                 "shasum": ""
             },
             "require": {
@@ -3857,20 +3860,20 @@
             ],
             "description": "Symfony DependencyInjection Component",
             "homepage": "https://symfony.com",
-            "time": "2016-01-12 17:46:01"
+            "time": "2016-02-28 16:34:46"
         },
         {
             "name": "symfony/filesystem",
-            "version": "v2.8.2",
+            "version": "v2.8.3",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/filesystem.git",
-                "reference": "637b64d0ee10f44ae98dbad651b1ecdf35a11e8c"
+                "reference": "65cb36b6539b1d446527d60457248f30d045464d"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/filesystem/zipball/637b64d0ee10f44ae98dbad651b1ecdf35a11e8c",
-                "reference": "637b64d0ee10f44ae98dbad651b1ecdf35a11e8c",
+                "url": "https://api.github.com/repos/symfony/filesystem/zipball/65cb36b6539b1d446527d60457248f30d045464d",
+                "reference": "65cb36b6539b1d446527d60457248f30d045464d",
                 "shasum": ""
             },
             "require": {
@@ -3906,11 +3909,11 @@
             ],
             "description": "Symfony Filesystem Component",
             "homepage": "https://symfony.com",
-            "time": "2016-01-13 10:28:07"
+            "time": "2016-02-22 15:02:30"
         },
         {
             "name": "symfony/stopwatch",
-            "version": "v3.0.2",
+            "version": "v3.0.3",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/stopwatch.git",
@@ -3959,16 +3962,16 @@
         },
         {
             "name": "symfony/yaml",
-            "version": "v2.8.2",
+            "version": "v2.8.3",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/yaml.git",
-                "reference": "34c8a4b51e751e7ea869b8262f883d008a2b81b8"
+                "reference": "2a4ee40acb880c56f29fb1b8886e7ffe94f3b995"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/yaml/zipball/34c8a4b51e751e7ea869b8262f883d008a2b81b8",
-                "reference": "34c8a4b51e751e7ea869b8262f883d008a2b81b8",
+                "url": "https://api.github.com/repos/symfony/yaml/zipball/2a4ee40acb880c56f29fb1b8886e7ffe94f3b995",
+                "reference": "2a4ee40acb880c56f29fb1b8886e7ffe94f3b995",
                 "shasum": ""
             },
             "require": {
@@ -4004,7 +4007,7 @@
             ],
             "description": "Symfony Yaml Component",
             "homepage": "https://symfony.com",
-            "time": "2016-01-13 10:28:07"
+            "time": "2016-02-23 07:41:20"
         }
     ],
     "aliases": [],
diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/Page/adminhtml/BraintreeSettlementReport.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/Page/adminhtml/BraintreeSettlementReport.xml
index 76ab1cf26618ab34da01c816b62224ac1fd51daf..20359c41bd55fb148c4dd407a0b75c4e2cda8f93 100644
--- a/dev/tests/functional/tests/app/Magento/Braintree/Test/Page/adminhtml/BraintreeSettlementReport.xml
+++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/Page/adminhtml/BraintreeSettlementReport.xml
@@ -6,7 +6,7 @@
  */
  -->
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd">
-    <page name="BraintreeSettlementReportIndex" area="Adminhtml" mca="braintreetwo/report/index" module="Magento_Braintree">
+    <page name="BraintreeSettlementReportIndex" area="Adminhtml" mca="braintree/report/index" module="Magento_Braintree">
         <block name="settlementReportGrid" class="Magento\Braintree\Test\Block\Adminhtml\Report\Grid" locator=".admin__data-grid-outer-wrap" strategy="css selector"/>
     </page>
 </config>
diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/Repository/ConfigData.xml
index 95cecff4a3d92590792729bb9c95e74a7577fb5d..4f256fd8f8cca0ac4dc2620843dfd4d16a4344f5 100644
--- a/dev/tests/functional/tests/app/Magento/Braintree/Test/Repository/ConfigData.xml
+++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/Repository/ConfigData.xml
@@ -7,140 +7,140 @@
 -->
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd">
     <repository class="Magento\Config\Test\Repository\ConfigData">
-        <dataset name="braintreetwo">
-            <field name="payment/braintreetwo_section/braintreetwo/braintreetwo_required/merchant_id" xsi:type="array">
+        <dataset name="braintree">
+            <field name="payment/braintree_section/braintree/braintree_required/merchant_id" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string"/>
-                <item name="value" xsi:type="string">PAYMENT_BRAINTREETWO_MERCHANT_ID</item>
+                <item name="value" xsi:type="string">PAYMENT_BRAINTREE_MERCHANT_ID</item>
             </field>
-            <field name="payment/braintreetwo_section/braintreetwo/braintreetwo_required/public_key" xsi:type="array">
+            <field name="payment/braintree_section/braintree/braintree_required/public_key" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string"/>
-                <item name="value" xsi:type="string">PAYMENT_PAYMENT_BRAINTREETWO_PUBLIC_KEY</item>
+                <item name="value" xsi:type="string">PAYMENT_PAYMENT_BRAINTREE_PUBLIC_KEY</item>
             </field>
-            <field name="payment/braintreetwo_section/braintreetwo/braintreetwo_required/private_key" xsi:type="array">
+            <field name="payment/braintree_section/braintree/braintree_required/private_key" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string"/>
-                <item name="value" xsi:type="string">PAYMENT_BRAINTREETWO_PRIVATE_KEY</item>
+                <item name="value" xsi:type="string">PAYMENT_BRAINTREE_PRIVATE_KEY</item>
             </field>
-            <field name="payment/braintreetwo_section/braintreetwo/braintreetwo_advanced/merchant_account_id" xsi:type="array">
+            <field name="payment/braintree_section/braintree/braintree_advanced/merchant_account_id" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string">Yes</item>
-                <item name="value" xsi:type="string">PAYMENT_BRAINTREETWO_MERCHANT_ACCOUNT_ID</item>
+                <item name="value" xsi:type="string">PAYMENT_BRAINTREE_MERCHANT_ACCOUNT_ID</item>
             </field>
-            <field name="payment/braintreetwo_section/braintreetwo/braintreetwo_required/payment_action" xsi:type="array">
+            <field name="payment/braintree_section/braintree/braintree_required/payment_action" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string">Authorize</item>
                 <item name="value" xsi:type="string">authorize</item>
             </field>
-            <field name="payment/braintreetwo_section/braintreetwo/braintreetwo_advanced/debug" xsi:type="array">
+            <field name="payment/braintree_section/braintree/braintree_advanced/debug" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string">Yes</item>
                 <item name="value" xsi:type="number">1</item>
             </field>
-            <field name="payment/braintreetwo_section/braintreetwo/active" xsi:type="array">
+            <field name="payment/braintree_section/braintree/active" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string">Yes</item>
                 <item name="value" xsi:type="number">1</item>
             </field>
         </dataset>
-        <dataset name="braintreetwo_rollback">
-            <field name="payment/braintreetwo/active" xsi:type="array">
+        <dataset name="braintree_rollback">
+            <field name="payment/braintree/active" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string">Yes</item>
                 <item name="value" xsi:type="number">0</item>
             </field>
         </dataset>
-        <dataset name="braintreetwo_sale">
-            <field name="payment/braintreetwo_section/braintreetwo/braintreetwo_required/merchant_id" xsi:type="array">
+        <dataset name="braintree_sale">
+            <field name="payment/braintree_section/braintree/braintree_required/merchant_id" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string"/>
-                <item name="value" xsi:type="string">PAYMENT_BRAINTREETWO_MERCHANT_ID</item>
+                <item name="value" xsi:type="string">PAYMENT_BRAINTREE_MERCHANT_ID</item>
             </field>
-            <field name="payment/braintreetwo_section/braintreetwo/braintreetwo_required/public_key" xsi:type="array">
+            <field name="payment/braintree_section/braintree/braintree_required/public_key" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string"/>
-                <item name="value" xsi:type="string">PAYMENT_PAYMENT_BRAINTREETWO_PUBLIC_KEY</item>
+                <item name="value" xsi:type="string">PAYMENT_PAYMENT_BRAINTREE_PUBLIC_KEY</item>
             </field>
-            <field name="payment/braintreetwo_section/braintreetwo/braintreetwo_required/private_key" xsi:type="array">
+            <field name="payment/braintree_section/braintree/braintree_required/private_key" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string"/>
-                <item name="value" xsi:type="string">PAYMENT_BRAINTREETWO_PRIVATE_KEY</item>
+                <item name="value" xsi:type="string">PAYMENT_BRAINTREE_PRIVATE_KEY</item>
             </field>
-            <field name="payment/braintreetwo_section/braintreetwo/braintreetwo_advanced/merchant_account_id" xsi:type="array">
+            <field name="payment/braintree_section/braintree/braintree_advanced/merchant_account_id" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string">Yes</item>
-                <item name="value" xsi:type="string">PAYMENT_BRAINTREETWO_MERCHANT_ACCOUNT_ID</item>
+                <item name="value" xsi:type="string">PAYMENT_BRAINTREE_MERCHANT_ACCOUNT_ID</item>
             </field>
-            <field name="payment/braintreetwo/payment_action" xsi:type="array">
+            <field name="payment/braintree/payment_action" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string">Authorize and Capture</item>
                 <item name="value" xsi:type="string">authorize_capture</item>
             </field>
-            <field name="payment/braintreetwo/debug" xsi:type="array">
+            <field name="payment/braintree/debug" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string">Yes</item>
                 <item name="value" xsi:type="number">1</item>
             </field>
-            <field name="payment/braintreetwo/active" xsi:type="array">
+            <field name="payment/braintree/active" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string">Yes</item>
                 <item name="value" xsi:type="number">1</item>
             </field>
         </dataset>
-        <dataset name="braintreetwo_sale_rollback">
-            <field name="payment/braintreetwo/active" xsi:type="array">
+        <dataset name="braintree_sale_rollback">
+            <field name="payment/braintree/active" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string">Yes</item>
                 <item name="value" xsi:type="number">0</item>
             </field>
         </dataset>
-        <dataset name="braintreetwo_3d_secure">
-            <field name="payment/braintreetwo_section/braintreetwo/braintreetwo_3dsecure/verify_3dsecure" xsi:type="array">
+        <dataset name="braintree_3d_secure">
+            <field name="payment/braintree_section/braintree/braintree_3dsecure/verify_3dsecure" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string">Yes</item>
                 <item name="value" xsi:type="number">1</item>
             </field>
         </dataset>
-        <dataset name="braintreetwo_3d_secure_rollback">
-            <field name="payment/braintreetwo_section/braintreetwo/braintreetwo_3dsecure/verify_3dsecure" xsi:type="array">
+        <dataset name="braintree_3d_secure_rollback">
+            <field name="payment/braintree_section/braintree/braintree_3dsecure/verify_3dsecure" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string">Yes</item>
                 <item name="value" xsi:type="number">0</item>
             </field>
         </dataset>
-        <dataset name="braintreetwo_3d_secure_uk">
-            <field name="payment/braintreetwo/verify_3dsecure" xsi:type="array">
+        <dataset name="braintree_3d_secure_uk">
+            <field name="payment/braintree/verify_3dsecure" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string">Yes</item>
                 <item name="value" xsi:type="number">1</item>
             </field>
-            <field name="payment/braintreetwo_section/braintreetwo/braintreetwo_3dsecure/allowspecific" xsi:type="array">
+            <field name="payment/braintree_section/braintree/braintree_3dsecure/allowspecific" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string">Yes</item>
                 <item name="value" xsi:type="number">1</item>
             </field>
-            <field name="payment/braintreetwo_section/braintreetwo/braintreetwo_3dsecure/specificcountry" xsi:type="array">
+            <field name="payment/braintree_section/braintree/braintree_3dsecure/specificcountry" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="value" xsi:type="array">
@@ -148,57 +148,57 @@
                 </item>
             </field>
         </dataset>
-        <dataset name="braintreetwo_3d_secure_uk_rollback">
-            <field name="payment/braintreetwo_section/braintreetwo/braintreetwo_3dsecure/verify_3dsecure" xsi:type="array">
+        <dataset name="braintree_3d_secure_uk_rollback">
+            <field name="payment/braintree_section/braintree/braintree_3dsecure/verify_3dsecure" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string">Yes</item>
                 <item name="value" xsi:type="number">0</item>
             </field>
-            <field name="payment/braintreetwo_section/braintreetwo/braintreetwo_3dsecure/allowspecific" xsi:type="array">
+            <field name="payment/braintree_section/braintree/braintree_3dsecure/allowspecific" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string">Yes</item>
                 <item name="value" xsi:type="number">0</item>
             </field>
         </dataset>
-        <dataset name="braintreetwo_3d_secure_not_triggered_due_threshold">
-            <field name="payment/braintreetwo/verify_3dsecure" xsi:type="array">
+        <dataset name="braintree_3d_secure_not_triggered_due_threshold">
+            <field name="payment/braintree/verify_3dsecure" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string">Yes</item>
                 <item name="value" xsi:type="number">1</item>
             </field>
-            <field name="payment/braintreetwo/threshold_amount" xsi:type="array">
+            <field name="payment/braintree/threshold_amount" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string">Yes</item>
                 <item name="value" xsi:type="number">300</item>
             </field>
         </dataset>
-        <dataset name="braintreetwo_3d_secure_not_triggered_due_threshold_rollback">
-            <field name="payment/braintreetwo/verify_3dsecure" xsi:type="array">
+        <dataset name="braintree_3d_secure_not_triggered_due_threshold_rollback">
+            <field name="payment/braintree/verify_3dsecure" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string">Yes</item>
                 <item name="value" xsi:type="number">0</item>
             </field>
-            <field name="payment/braintreetwo/threshold_amount" xsi:type="array">
+            <field name="payment/braintree/threshold_amount" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string">Yes</item>
                 <item name="value" xsi:type="number">0</item>
             </field>
         </dataset>
-        <dataset name="braintreetwo_use_vault">
+        <dataset name="braintree_use_vault">
             <field name="payment/vault/vault_payment" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string">Braintree</item>
-                <item name="value" xsi:type="string">braintreetwo</item>
+                <item name="value" xsi:type="string">braintree</item>
             </field>
         </dataset>
-        <dataset name="braintreetwo_use_vault_rollback">
+        <dataset name="braintree_use_vault_rollback">
             <field name="payment/vault/vault_payment" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
@@ -206,50 +206,50 @@
                 <item name="value" xsi:type="string">null</item>
             </field>
         </dataset>
-        <dataset name="braintreetwo_paypal">
-            <field name="payment/braintreetwo_section/braintreetwo/active_braintreetwo_paypal" xsi:type="array">
+        <dataset name="braintree_paypal">
+            <field name="payment/braintree_section/braintree/active_braintree_paypal" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string">Yes</item>
                 <item name="value" xsi:type="number">1</item>
             </field>
-            <field name="payment/braintreetwo_section/braintreetwo/braintreetwo_paypal/payment_action" xsi:type="array">
+            <field name="payment/braintree_section/braintree/braintree_paypal/payment_action" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string">Authorize</item>
                 <item name="value" xsi:type="string">authorize</item>
             </field>
         </dataset>
-        <dataset name="braintreetwo_paypal_rollback">
-            <field name="payment/braintreetwo_section/braintreetwo/active_braintreetwo_paypal" xsi:type="array">
+        <dataset name="braintree_paypal_rollback">
+            <field name="payment/braintree_section/braintree/active_braintree_paypal" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string">Yes</item>
                 <item name="value" xsi:type="number">0</item>
             </field>
         </dataset>
-        <dataset name="braintreetwo_paypal_sale">
-            <field name="payment/braintreetwo_section/braintreetwo/active_braintreetwo_paypal" xsi:type="array">
+        <dataset name="braintree_paypal_sale">
+            <field name="payment/braintree_section/braintree/active_braintree_paypal" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string">Yes</item>
                 <item name="value" xsi:type="number">1</item>
             </field>
-            <field name="payment/braintreetwo_section/braintreetwo/braintreetwo_paypal/payment_action" xsi:type="array">
+            <field name="payment/braintree_section/braintree/braintree_paypal/payment_action" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string">Authorize and Capture</item>
                 <item name="value" xsi:type="string">authorize_capture</item>
             </field>
         </dataset>
-        <dataset name="braintreetwo_paypal_sale_rollback">
-            <field name="payment/braintreetwo_section/braintreetwo/active_braintreetwo_paypal" xsi:type="array">
+        <dataset name="braintree_paypal_sale_rollback">
+            <field name="payment/braintree_section/braintree/active_braintree_paypal" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string">Yes</item>
                 <item name="value" xsi:type="number">0</item>
             </field>
-            <field name="payment/braintreetwo_section/braintreetwo/braintreetwo_paypal/payment_action" xsi:type="array">
+            <field name="payment/braintree_section/braintree/braintree_paypal/payment_action" xsi:type="array">
                 <item name="scope" xsi:type="string">payment</item>
                 <item name="scope_id" xsi:type="number">1</item>
                 <item name="label" xsi:type="string">Authorize</item>
diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/BraintreeSettlementReportTest.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/BraintreeSettlementReportTest.xml
index 7d9e18117917b786ec5820fdf822f3fd4fc63555..3c933323d21f1addc53fa4030959b158bf174d6e 100644
--- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/BraintreeSettlementReportTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/BraintreeSettlementReportTest.xml
@@ -17,10 +17,10 @@
             <data name="prices" xsi:type="array">
                 <item name="grandTotal" xsi:type="string">15.00</item>
             </data>
-            <data name="payment/method" xsi:type="string">braintreetwo</data>
+            <data name="payment/method" xsi:type="string">braintree</data>
             <data name="creditCardClass" xsi:type="string">credit_card_braintree</data>
             <data name="creditCard/dataset" xsi:type="string">visa_braintree</data>
-            <data name="configData" xsi:type="string">braintreetwo</data>
+            <data name="configData" xsi:type="string">braintree</data>
             <data name="status" xsi:type="string">Processing</data>
             <data name="tag" xsi:type="string">test_type:extended_acceptance_test, test_type:3rd_party_test</data>
             <constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage" />
diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CheckoutWithBraintreePaypalCartTest.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CheckoutWithBraintreePaypalCartTest.xml
index 61db84fc3c837fdc54b28bb13041338ab37e10f8..4d625d494d0ecb9961b367e85c0b5274f02f60c8 100644
--- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CheckoutWithBraintreePaypalCartTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CheckoutWithBraintreePaypalCartTest.xml
@@ -17,8 +17,8 @@
             <data name="prices" xsi:type="array">
                 <item name="grandTotal" xsi:type="string">15.00</item>
             </data>
-            <data name="payment/method" xsi:type="string">braintreetwo_paypal</data>
-            <data name="configData" xsi:type="string">braintreetwo, braintreetwo_paypal</data>
+            <data name="payment/method" xsi:type="string">braintree_paypal</data>
+            <data name="configData" xsi:type="string">braintree, braintree_paypal</data>
             <data name="status" xsi:type="string">Processing</data>
             <data name="tag" xsi:type="string">test_type:3rd_party_test</data>
             <constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage" />
@@ -39,8 +39,8 @@
             <data name="capturedPrices" xsi:type="array">
                 <item name="0" xsi:type="string">15.00</item>
             </data>
-            <data name="payment/method" xsi:type="string">braintreetwo_paypal</data>
-            <data name="configData" xsi:type="string">braintreetwo, braintreetwo_paypal_sale</data>
+            <data name="payment/method" xsi:type="string">braintree_paypal</data>
+            <data name="configData" xsi:type="string">braintree, braintree_paypal_sale</data>
             <data name="status" xsi:type="string">Processing</data>
             <data name="tag" xsi:type="string">test_type:3rd_party_test</data>
             <constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage" />
diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CheckoutWithBraintreePaypalMinicartTest.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CheckoutWithBraintreePaypalMinicartTest.xml
index 804ea8e235c07dc7f8970cd17d496f1e1c5cb63f..6453aa8160b73f6efdb40c4547c3420f98d3d023 100644
--- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CheckoutWithBraintreePaypalMinicartTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CheckoutWithBraintreePaypalMinicartTest.xml
@@ -17,8 +17,8 @@
             <data name="prices" xsi:type="array">
                 <item name="grandTotal" xsi:type="string">15.00</item>
             </data>
-            <data name="payment/method" xsi:type="string">braintreetwo_paypal</data>
-            <data name="configData" xsi:type="string">braintreetwo, braintreetwo_paypal</data>
+            <data name="payment/method" xsi:type="string">braintree_paypal</data>
+            <data name="configData" xsi:type="string">braintree, braintree_paypal</data>
             <data name="status" xsi:type="string">Processing</data>
             <data name="tag" xsi:type="string">test_type:3rd_party_test</data>
             <constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage" />
@@ -39,8 +39,8 @@
             <data name="capturedPrices" xsi:type="array">
                 <item name="0" xsi:type="string">15.00</item>
             </data>
-            <data name="payment/method" xsi:type="string">braintreetwo_paypal</data>
-            <data name="configData" xsi:type="string">braintreetwo, braintreetwo_paypal_sale</data>
+            <data name="payment/method" xsi:type="string">braintree_paypal</data>
+            <data name="configData" xsi:type="string">braintree, braintree_paypal_sale</data>
             <data name="status" xsi:type="string">Processing</data>
             <data name="tag" xsi:type="string">test_type:3rd_party_test</data>
             <constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage" />
diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineInvoiceEntityTest.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineInvoiceEntityTest.xml
index ac570ec147ee3bdf538bb71fa3f48c145492a633..603dc61709fccba8a08bb5b9a48894e8a4a54eff 100644
--- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineInvoiceEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOnlineInvoiceEntityTest.xml
@@ -19,10 +19,10 @@
             <data name="capturedPrices" xsi:type="array">
                 <item name="0" xsi:type="string">139.9</item>
             </data>
-            <data name="payment/method" xsi:type="string">braintreetwo</data>
+            <data name="payment/method" xsi:type="string">braintree</data>
             <data name="creditCardClass" xsi:type="string">credit_card_braintree</data>
             <data name="creditCard/dataset" xsi:type="string">visa_braintree</data>
-            <data name="configData" xsi:type="string">braintreetwo</data>
+            <data name="configData" xsi:type="string">braintree</data>
             <data name="status" xsi:type="string">Processing</data>
             <data name="orderButtonsAvailable" xsi:type="string">Back, Send Email, Credit Memo, Hold, Ship, Reorder</data>
             <data name="data/items_data/0/qty" xsi:type="string">-</data>
@@ -48,10 +48,10 @@
                 <item name="0" xsi:type="string">108.25</item>
                 <item name="1" xsi:type="string">118.25</item>
             </data>
-            <data name="payment/method" xsi:type="string">braintreetwo</data>
+            <data name="payment/method" xsi:type="string">braintree</data>
             <data name="creditCardClass" xsi:type="string">credit_card_braintree</data>
             <data name="creditCard/dataset" xsi:type="string">visa_braintree</data>
-            <data name="configData" xsi:type="string">braintreetwo</data>
+            <data name="configData" xsi:type="string">braintree</data>
             <data name="status" xsi:type="string">Processing</data>
             <data name="orderButtonsAvailable" xsi:type="string">Back, Send Email, Credit Memo, Hold, Ship, Reorder</data>
             <data name="data/items_data/0/qty" xsi:type="string">1</data>
diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOrderBackendTest.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOrderBackendTest.xml
index 3180271db86cbd63cfba39439ad2c13020e53eea..ede88da99e5a11f29578e0dff293fd669e4c7e2c 100644
--- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOrderBackendTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateOrderBackendTest.xml
@@ -19,10 +19,10 @@
             <data name="prices" xsi:type="array">
                 <item name="grandTotal" xsi:type="string">145.98</item>
             </data>
-            <data name="payment/method" xsi:type="string">braintreetwo</data>
+            <data name="payment/method" xsi:type="string">braintree</data>
             <data name="creditCardClass" xsi:type="string">credit_card_braintree</data>
             <data name="creditCard/dataset" xsi:type="string">visa_braintree</data>
-            <data name="configData" xsi:type="string">braintreetwo</data>
+            <data name="configData" xsi:type="string">braintree</data>
             <data name="status" xsi:type="string">Processing</data>
             <data name="orderButtonsAvailable" xsi:type="string">Back, Cancel, Send Email, Hold, Invoice, Ship</data>
             <constraint name="Magento\Sales\Test\Constraint\AssertOrderSuccessCreateMessage" />
@@ -48,10 +48,10 @@
             <data name="capturedPrices" xsi:type="array">
                 <item name="0" xsi:type="string">145.98</item>
             </data>
-            <data name="payment/method" xsi:type="string">braintreetwo</data>
+            <data name="payment/method" xsi:type="string">braintree</data>
             <data name="creditCardClass" xsi:type="string">credit_card_braintree</data>
             <data name="creditCard/dataset" xsi:type="string">visa_braintree</data>
-            <data name="configData" xsi:type="string">braintreetwo_sale</data>
+            <data name="configData" xsi:type="string">braintree_sale</data>
             <data name="status" xsi:type="string">Processing</data>
             <data name="orderButtonsAvailable" xsi:type="string">Back, Send Email, Hold, Ship</data>
             <constraint name="Magento\Sales\Test\Constraint\AssertOrderSuccessCreateMessage" />
diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateVaultOrderBackendTest.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateVaultOrderBackendTest.xml
index 154da22b049ca885935c636ea9a9a23613036018..7d2d8c4aae90e1e32d9be8812a781ff97d921a95 100644
--- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateVaultOrderBackendTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateVaultOrderBackendTest.xml
@@ -18,11 +18,11 @@
             <data name="prices" xsi:type="array">
                 <item name="grandTotal" xsi:type="string">15.00</item>
             </data>
-            <data name="payment/method" xsi:type="string">braintreetwo</data>
+            <data name="payment/method" xsi:type="string">braintree</data>
             <data name="creditCardClass" xsi:type="string">credit_card_braintree</data>
             <data name="creditCard/dataset" xsi:type="string">visa_braintree</data>
             <data name="creditCardSave" xsi:type="string">Yes</data>
-            <data name="configData" xsi:type="string">braintreetwo, braintreetwo_use_vault</data>
+            <data name="configData" xsi:type="string">braintree, braintree_use_vault</data>
             <data name="status" xsi:type="string">Processing</data>
             <data name="orderButtonsAvailable" xsi:type="string">Back, Cancel, Send Email, Hold, Invoice, Ship</data>
             <constraint name="Magento\Sales\Test\Constraint\AssertOrderSuccessCreateMessage" />
diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/DeleteSavedCreditCardTest.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/DeleteSavedCreditCardTest.xml
index 0da522038acf64a6651a8f2df01605e2bdc23b30..5511538e072c4a545cd1c8af43d678fce5707e21 100644
--- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/DeleteSavedCreditCardTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/DeleteSavedCreditCardTest.xml
@@ -14,11 +14,11 @@
             <data name="checkoutMethod" xsi:type="string">login</data>
             <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data>
             <data name="shipping/shipping_method" xsi:type="string">Fixed</data>
-            <data name="payment/method" xsi:type="string">braintreetwo</data>
+            <data name="payment/method" xsi:type="string">braintree</data>
             <data name="creditCardClass" xsi:type="string">credit_card_braintree</data>
             <data name="creditCard/dataset" xsi:type="string">visa_braintree</data>
             <data name="creditCardSave" xsi:type="string">Yes</data>
-            <data name="configData" xsi:type="string">braintreetwo, braintreetwo_use_vault</data>
+            <data name="configData" xsi:type="string">braintree, braintree_use_vault</data>
             <data name="tag" xsi:type="string">test_type:3rd_party_test</data>
             <constraint name="Magento\Vault\Test\Constraint\AssertCreditCardNotPresentOnCheckout" />
         </variation>
diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/InvoicePaypalBraintreeTest.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/InvoicePaypalBraintreeTest.xml
index 313cfff4a2dcf4d397bc63023265117dcaf7d89f..1b0cc505904e9763478cac371f9e6e49da105f82 100644
--- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/InvoicePaypalBraintreeTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/InvoicePaypalBraintreeTest.xml
@@ -19,8 +19,8 @@
             <data name="capturedPrices" xsi:type="array">
                 <item name="0" xsi:type="string">139.9</item>
             </data>
-            <data name="payment/method" xsi:type="string">braintreetwo_paypal</data>
-            <data name="configData" xsi:type="string">braintreetwo, braintreetwo_paypal</data>
+            <data name="payment/method" xsi:type="string">braintree_paypal</data>
+            <data name="configData" xsi:type="string">braintree, braintree_paypal</data>
             <data name="orderButtonsAvailable" xsi:type="string">Back, Send Email, Credit Memo, Hold, Ship</data>
             <data name="data/items_data/0/qty" xsi:type="string">-</data>
             <data name="data/form_data/do_shipment" xsi:type="string">No</data>
@@ -44,8 +44,8 @@
                 <item name="0" xsi:type="string">118.25</item>
                 <item name="1" xsi:type="string">108.25</item>
             </data>
-            <data name="payment/method" xsi:type="string">braintreetwo_paypal</data>
-            <data name="configData" xsi:type="string">braintreetwo, braintreetwo_paypal</data>
+            <data name="payment/method" xsi:type="string">braintree_paypal</data>
+            <data name="configData" xsi:type="string">braintree, braintree_paypal</data>
             <data name="orderButtonsAvailable" xsi:type="string">Back, Send Email, Credit Memo, Hold, Ship</data>
             <data name="data/items_data/0/qty" xsi:type="string">1</data>
             <data name="data/form_data/do_shipment" xsi:type="string">No</data>
diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/OnePageCheckoutTest.xml
index 40f8c0d5ef5eb4e82d219101a20082bb939a90f2..9cb50c69c73d38b2e7db81a92cc282d7c9ec45da 100644
--- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/OnePageCheckoutTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/OnePageCheckoutTest.xml
@@ -18,10 +18,10 @@
             <data name="prices" xsi:type="array">
                 <item name="grandTotal" xsi:type="string">145.98</item>
             </data>
-            <data name="payment/method" xsi:type="string">braintreetwo</data>
+            <data name="payment/method" xsi:type="string">braintree</data>
             <data name="creditCardClass" xsi:type="string">credit_card_braintree</data>
             <data name="creditCard/dataset" xsi:type="string">visa_braintree_3dsecure</data>
-            <data name="configData" xsi:type="string">braintreetwo, braintreetwo_3d_secure_not_triggered_due_threshold</data>
+            <data name="configData" xsi:type="string">braintree, braintree_3d_secure_not_triggered_due_threshold</data>
             <data name="status" xsi:type="string">Processing</data>
             <data name="tag" xsi:type="string">test_type:3rd_party_test</data>
             <constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage" />
@@ -39,10 +39,10 @@
             <data name="prices" xsi:type="array">
                 <item name="grandTotal" xsi:type="string">145.98</item>
             </data>
-            <data name="payment/method" xsi:type="string">braintreetwo</data>
+            <data name="payment/method" xsi:type="string">braintree</data>
             <data name="creditCardClass" xsi:type="string">credit_card_braintree</data>
             <data name="creditCard/dataset" xsi:type="string">visa_braintree_3dsecure</data>
-            <data name="configData" xsi:type="string">braintreetwo, braintreetwo_3d_secure_uk</data>
+            <data name="configData" xsi:type="string">braintree, braintree_3d_secure_uk</data>
             <data name="status" xsi:type="string">Processing</data>
             <data name="tag" xsi:type="string">test_type:3rd_party_test</data>
             <constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage" />
@@ -60,10 +60,10 @@
             <data name="prices" xsi:type="array">
                 <item name="grandTotal" xsi:type="string">145.98</item>
             </data>
-            <data name="payment/method" xsi:type="string">braintreetwo</data>
+            <data name="payment/method" xsi:type="string">braintree</data>
             <data name="creditCardClass" xsi:type="string">credit_card_braintree</data>
             <data name="creditCard/dataset" xsi:type="string">visa_braintree</data>
-            <data name="configData" xsi:type="string">braintreetwo</data>
+            <data name="configData" xsi:type="string">braintree</data>
             <data name="status" xsi:type="string">Processing</data>
             <data name="tag" xsi:type="string">test_type:extended_acceptance_test, test_type:3rd_party_test</data>
             <constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage" />
@@ -85,10 +85,10 @@
             <data name="capturedPrices" xsi:type="array">
                 <item name="0" xsi:type="string">145.98</item>
             </data>
-            <data name="payment/method" xsi:type="string">braintreetwo</data>
+            <data name="payment/method" xsi:type="string">braintree</data>
             <data name="creditCardClass" xsi:type="string">credit_card_braintree</data>
             <data name="creditCard/dataset" xsi:type="string">visa_braintree</data>
-            <data name="configData" xsi:type="string">braintreetwo_sale</data>
+            <data name="configData" xsi:type="string">braintree_sale</data>
             <data name="status" xsi:type="string">Processing</data>
             <data name="tag" xsi:type="string">test_type:3rd_party_test</data>
             <constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage" />
diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/OnePageCheckoutWith3dSecureTest.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/OnePageCheckoutWith3dSecureTest.xml
index 106b7deaf3a7587618cda5aaab340027a9a34c6a..2ad4a28033da90ee1bc85ccdfe489ae58a18d0b6 100644
--- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/OnePageCheckoutWith3dSecureTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/OnePageCheckoutWith3dSecureTest.xml
@@ -19,7 +19,7 @@
             <data name="prices" xsi:type="array">
                 <item name="grandTotal" xsi:type="string">145.98</item>
             </data>
-            <data name="payment/method" xsi:type="string">braintreetwo</data>
+            <data name="payment/method" xsi:type="string">braintree</data>
             <data name="creditCardClass" xsi:type="string">credit_card_braintree</data>
             <data name="creditCard/dataset" xsi:type="string">visa_braintree_3dsecure</data>
             <data name="paymentInformation" xsi:type="array">
@@ -27,7 +27,7 @@
                 <item name="Liability Shift Possible" xsi:type="string">1</item>
             </data>
             <data name="secure3d/dataset" xsi:type="string">secure3d_braintree</data>
-            <data name="configData" xsi:type="string">braintreetwo, braintreetwo_3d_secure</data>
+            <data name="configData" xsi:type="string">braintree, braintree_3d_secure</data>
             <data name="status" xsi:type="string">Processing</data>
             <data name="tag" xsi:type="string">test_type:3rd_party_test</data>
             <constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage" />
diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/OnePageCheckoutWithBraintreePaypalTest.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/OnePageCheckoutWithBraintreePaypalTest.xml
index 1906e2060b02b842dc987146db2cb31fe49baff2..b32817bf4ce9ba6f416ae6dc36890e4ee8b6c8b8 100644
--- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/OnePageCheckoutWithBraintreePaypalTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/OnePageCheckoutWithBraintreePaypalTest.xml
@@ -18,8 +18,8 @@
             <data name="prices" xsi:type="array">
                 <item name="grandTotal" xsi:type="string">15.00</item>
             </data>
-            <data name="payment/method" xsi:type="string">braintreetwo_paypal</data>
-            <data name="configData" xsi:type="string">braintreetwo, braintreetwo_paypal</data>
+            <data name="payment/method" xsi:type="string">braintree_paypal</data>
+            <data name="configData" xsi:type="string">braintree, braintree_paypal</data>
             <data name="status" xsi:type="string">Processing</data>
             <data name="tag" xsi:type="string">test_type:3rd_party_test</data>
             <constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage" />
@@ -41,8 +41,8 @@
             <data name="capturedPrices" xsi:type="array">
                 <item name="0" xsi:type="string">15.00</item>
             </data>
-            <data name="payment/method" xsi:type="string">braintreetwo_paypal</data>
-            <data name="configData" xsi:type="string">braintreetwo, braintreetwo_paypal_sale</data>
+            <data name="payment/method" xsi:type="string">braintree_paypal</data>
+            <data name="configData" xsi:type="string">braintree, braintree_paypal_sale</data>
             <data name="status" xsi:type="string">Processing</data>
             <data name="tag" xsi:type="string">test_type:3rd_party_test</data>
             <constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage" />
diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/UseVaultOnCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/UseVaultOnCheckoutTest.xml
index 2be837de7a83578e1c632e2fd27fefed4a94a2b5..efed24194b5ddc3d011e93c87179f621eae857dc 100644
--- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/UseVaultOnCheckoutTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/UseVaultOnCheckoutTest.xml
@@ -15,11 +15,11 @@
             <data name="checkoutMethod" xsi:type="string">login</data>
             <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data>
             <data name="shipping/shipping_method" xsi:type="string">Fixed</data>
-            <data name="payment/method" xsi:type="string">braintreetwo</data>
+            <data name="payment/method" xsi:type="string">braintree</data>
             <data name="creditCardClass" xsi:type="string">credit_card_braintree</data>
             <data name="creditCard/dataset" xsi:type="string">visa_braintree</data>
             <data name="creditCardSave" xsi:type="string">Yes</data>
-            <data name="configData" xsi:type="string">braintreetwo, braintreetwo_use_vault</data>
+            <data name="configData" xsi:type="string">braintree, braintree_use_vault</data>
             <data name="status" xsi:type="string">Processing</data>
             <data name="tag" xsi:type="string">test_type:3rd_party_test</data>
             <data name="status" xsi:type="string">Processing</data>
diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/_files/skip_blocks_ce.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/_files/skip_blocks_ce.php
index b96cd98f83ffbd71faa5e21b3fd7f00e9d7eb445..f2b46818c3225ce283419f43465854d66574d6bb 100644
--- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/_files/skip_blocks_ce.php
+++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/_files/skip_blocks_ce.php
@@ -15,8 +15,8 @@ return [
     'Magento\Config\Block\System\Config\Form',
     'Magento\Config\Block\System\Config\Tabs',
     'Magento\Review\Block\Form',
-    'Magento\BraintreeTwo\Block\Form',
-    'Magento\BraintreeTwo\Block\Payment',
+    'Magento\Braintree\Block\Form',
+    'Magento\Braintree\Block\Payment',
     // Fails because of dependence on registry
     'Magento\Reminder\Block\Adminhtml\Reminder\Edit\Tab\Customers',
     'Magento\LayeredNavigation\Block\Navigation',
diff --git a/dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/magento.txt b/dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/magento.txt
index 7a86288ed4b3f91cf55c69fe38ab1f429fcf2cca..4f021e6d897fb7f51e310c7b1178f812d67e2956 100644
--- a/dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/magento.txt
+++ b/dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/magento.txt
@@ -1054,5 +1054,5 @@ vendor/magento/theme-adminhtml-backend/web/js/theme.js
 vendor/magento/theme-frontend-blank/web/js/navigation-menu.js
 vendor/magento/theme-frontend-blank/web/js/responsive.js
 vendor/magento/theme-frontend-blank/web/js/theme.js
-app/code/Magento/BraintreeTwo/view/frontend/requirejs-config.js
+app/code/Magento/Braintree/view/frontend/requirejs-config.js
 app/code/Magento/Customer/view/frontend/web/js/zxcvbn.js
diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php
index 9863052b4f26b980196969b2a621c67a9da4ce26..608e6cff33d0c112431cd0829bdcfc60cc34b6e4 100755
--- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php
+++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php
@@ -4136,5 +4136,90 @@ return [
     ['Magento\CatalogRule\Block\Adminhtml\Promo\Catalog\Edit\Js'],
     ['Magento\CatalogRule\Block\Adminhtml\Promo\Catalog\Edit\Tabs'],
     ['Magento\ConfigurableProduct\Model\Product\VariationMediaAttributes'],
-    ['Magento\CatalogRule\Block\Adminhtml\Promo\Catalog\Edit']
+    ['Magento\CatalogRule\Block\Adminhtml\Promo\Catalog\Edit'],
+    ['Magento\Braintree\Block\Adminhtml\Form\Field\Cctypes'],
+    ['Magento\Braintree\Block\Adminhtml\Form\Field\Countrycreditcard'],
+    ['Magento\Braintree\Block\Checkout\Review'],
+    ['Magento\Braintree\Block\Creditcard\Management'],
+    ['Magento\Braintree\Block\Datajs'],
+    ['Magento\Braintree\Block\Directory\Data'],
+    ['Magento\Braintree\Block\Info\PayPal'],
+    ['Magento\Braintree\Block\PayPal\Shortcut'],
+    ['Magento\Braintree\Controller\Creditcard\AjaxSave'],
+    ['Magento\Braintree\Controller\Creditcard\Delete'],
+    ['Magento\Braintree\Controller\Creditcard\DeleteConfirm'],
+    ['Magento\Braintree\Controller\Creditcard\Edit'],
+    ['Magento\Braintree\Controller\Creditcard\Generate'],
+    ['Magento\Braintree\Controller\Creditcard\Index'],
+    ['Magento\Braintree\Controller\Creditcard\NewCard'],
+    ['Magento\Braintree\Controller\Creditcard\Save'],
+    ['Magento\Braintree\Controller\MyCreditCards'],
+    ['Magento\Braintree\Controller\PayPal'],
+    ['Magento\Braintree\Helper\Createorder'],
+    ['Magento\Braintree\Helper\Data'],
+    ['Magento\Braintree\Helper\Error'],
+    ['Magento\Braintree\Model\Adapter\BraintreeClientToken'],
+    ['Magento\Braintree\Model\Adapter\BraintreeConfiguration'],
+    ['Magento\Braintree\Model\Adapter\BraintreeCreditCard'],
+    ['Magento\Braintree\Model\Adapter\BraintreeCustomer'],
+    ['Magento\Braintree\Model\Adapter\BraintreePaymentMethod'],
+    ['Magento\Braintree\Model\Adapter\BraintreeTransaction'],
+    ['Magento\Braintree\Model\Checkout'],
+    ['Magento\Braintree\Model\Config'],
+    ['Magento\Braintree\Model\Config\Cc'],
+    ['Magento\Braintree\Model\Config\PayPal'],
+    ['Magento\Braintree\Model\ConfigProvider'],
+    ['Magento\Braintree\Model\ConfigProvider\PayPal'],
+    ['Magento\Braintree\Model\PaymentMethod'],
+    ['Magento\Braintree\Model\PaymentMethod\PayPal'],
+    ['Magento\Braintree\Model\Plugin\Sales\Order\PaymentPlugin'],
+    ['Magento\Braintree\Model\Source\CaptureAction'],
+    ['Magento\Braintree\Model\Source\CcType'],
+    ['Magento\Braintree\Model\Source\Environment'],
+    ['Magento\Braintree\Model\Source\PaymentAction'],
+    ['Magento\Braintree\Model\System\Config\Backend\Countrycreditcard'],
+    ['Magento\Braintree\Model\System\Config\Backend\Usevault'],
+    ['Magento\Braintree\Model\System\Config\Source\Country'],
+    ['Magento\Braintree\Model\Vault'],
+    ['Magento\Braintree\Observer\DeleteBraintreeCustomer'],
+    ['Magento\Braintree\Observer\ProcessBraintreeAddress'],
+    ['Magento\Braintree\Observer\ProcessBraintreePayment'],
+    ['Magento\Braintree\Test\Unit\Block\Adminhtml\Form\Field\CctypesTest'],
+    ['Magento\Braintree\Test\Unit\Block\Adminhtml\Form\Field\CountriesTest'],
+    ['Magento\Braintree\Test\Unit\Block\Creditcard\ManagementTest'],
+    ['Magento\Braintree\Test\Unit\Block\DatajsTest'],
+    ['Magento\Braintree\Test\Unit\Block\Directory\DataTest'],
+    ['Magento\Braintree\Test\Unit\Block\Info\PayPalTest'],
+    ['Magento\Braintree\Test\Unit\Block\InfoTest'],
+    ['Magento\Braintree\Test\Unit\Block\PayPal\ShortcutTest'],
+    ['Magento\Braintree\Test\Unit\Controller\Creditcard\AjaxSaveTest'],
+    ['Magento\Braintree\Test\Unit\Controller\Creditcard\DeleteConfirmTest'],
+    ['Magento\Braintree\Test\Unit\Controller\Creditcard\DeleteTest'],
+    ['Magento\Braintree\Test\Unit\Controller\Creditcard\EditTest'],
+    ['Magento\Braintree\Test\Unit\Controller\Creditcard\GenerateTest'],
+    ['Magento\Braintree\Test\Unit\Controller\Creditcard\IndexTest'],
+    ['Magento\Braintree\Test\Unit\Controller\Creditcard\NewCardTest'],
+    ['Magento\Braintree\Test\Unit\Controller\Creditcard\SaveTest'],
+    ['Magento\Braintree\Test\Unit\Controller\MyCreditCardsTest'],
+    ['Magento\Braintree\Test\Unit\Controller\PayPalTest'],
+    ['Magento\Braintree\Test\Unit\Controller\Stub\MyCreditCardsStub'],
+    ['Magento\Braintree\Test\Unit\Controller\Stub\PayPalStub'],
+    ['Magento\Braintree\Test\Unit\Helper\CreateorderTest'],
+    ['Magento\Braintree\Test\Unit\Helper\DataTest'],
+    ['Magento\Braintree\Test\Unit\Helper\ErrorTest'],
+    ['Magento\Braintree\Test\Unit\Model\CheckoutTest'],
+    ['Magento\Braintree\Test\Unit\Model\Config\CcTest'],
+    ['Magento\Braintree\Test\Unit\Model\Config\PayPalTest'],
+    ['Magento\Braintree\Test\Unit\Model\ConfigProvider\PayPalTest'],
+    ['Magento\Braintree\Test\Unit\Model\ConfigProviderTest'],
+    ['Magento\Braintree\Test\Unit\Model\ConfigTest'],
+    ['Magento\Braintree\Test\Unit\Model\PaymentMethod\PayPalTest'],
+    ['Magento\Braintree\Test\Unit\Model\Plugin\Sales\Order\PaymentPluginTest'],
+    ['Magento\Braintree\Test\Unit\Model\System\Config\Backend\CountrycreditcardTest'],
+    ['Magento\Braintree\Test\Unit\Model\System\Config\Backend\UsevaultTest'],
+    ['Magento\Braintree\Test\Unit\Model\System\Config\Source\CountryTest'],
+    ['Magento\Braintree\Test\Unit\Model\VaultTest'],
+    ['Magento\Braintree\Test\Unit\Observer\DeleteBraintreeCustomerTest'],
+    ['Magento\Braintree\Test\Unit\Observer\ProcessBraintreeAddressTest'],
+    ['Magento\Braintree\Test\Unit\Observer\ProcessBraintreePaymentTest']
 ];
diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_namespaces.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_namespaces.php
index 38c51080c2086b77c352fdf522deea9b9ad4e47f..49979f223099e0da80283e3c1695cbe6eef76906 100644
--- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_namespaces.php
+++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_namespaces.php
@@ -197,4 +197,5 @@ return [
         'Magento\ConfigurableProduct\Block\Adminhtml\Product\Edit\Tab\Super',
         'Magento\ConfigurableProduct\Block\Adminhtml\Product\Edit\Tab\Variations',
     ],
+    ['Magento\BraintreeTwo', 'Magento\Braintree']
 ];